Main
Index
Search
Posts
Who's
Online
Log
In

Home: Products: CMS Builder: Plugins & Add-ons:
Plugin Descriptions on mutiple lines

 

 


ITI
User

May 24, 2011, 6:40 PM

Post #1 of 5 (1096 views)
Shortcut
Plugin Descriptions on mutiple lines Can't Post

I've been working on some plugins lately, including some plugin documentation that I'm sure others will be interested in when I'm done.

Anyway, one annoying thing is that the plugin description can only be entered on one line which results in a half mile of horizontal scrolling.

Would you please consider this minor modification to:
function getPluginData().



Code
function getPluginData($filename) { 
...
// get plugin data
$pluginData = array();
$fileContent = file_get_contents($filepath);
foreach ($textKeyToFieldname as $textKey => $fieldname) {
if($textKey == 'Description'){
preg_match_all("/$textKey:(.*?)(\r|\n)/mi", $fileContent, $matches); // match \r as well for mac users who uploaded file in ascii with wrong line end chars (and windows users who would be \r\n)
for($i=0;$i<count($matches[1]);$i+=1){
if(isset($pluginData[$fieldname])) $pluginData[$fieldname] .= ($matches[1][$i]);
else $pluginData[$fieldname] = ($matches[1][$i]);
}
}else {
preg_match("/$textKey:(.*?)(\r|\n)/mi", $fileContent, $matches); // match \r as well for mac users who uploaded file in ascii with wrong line end chars (and windows users who would be \r\n)
$pluginData[$fieldname] = trim( @$matches[1] );
}
}
...
}


A description could then be written over multiple lines like this:

Code
<?php 
/**
* Plugin Name: PI Name
* Description: My very long description ......
* Description: that goes on and on and on
* Description: but I don't have to scroll to read it.
* Description: Wouldn't this be nice.
* Version: 1.0 beta
* Requires at least: 2.00
*/


Thanks for looking at it.
Glen

Glen
http://www.CanadianDomainRegistry.ca
ITI Internetworking Technologies Inc.


Jason
Staff / Moderator


May 25, 2011, 10:37 AM

Post #2 of 5 (1050 views)
Shortcut
Re: [glenara] Plugin Descriptions on mutiple lines [In reply to] Can't Post

Hi Glen,

In general, we would want to keep the plugin descriptions fairly concise as to not have a cluttered plugin list. A good practice here would be to add a very basic description in the header of the plugin and then a more detailed description in a readme file that you can have along with your plugin.

Hope this helps
---------------------------------------------------
Jason Sauchuk - Programmer 
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/ 


ITI
User

May 25, 2011, 11:29 AM

Post #3 of 5 (1047 views)
Shortcut
Re: [Jason] Plugin Descriptions on mutiple lines [In reply to] Can't Post

Hi Jason and thanks for the reply.

I completely agree, the description should be short and concise but even some of the plugins created by you fellows requires horizontal scrolling which is annoying. Horizontal scrolling as you know is always frowned upon.

It just seems to me that it's pretty minor code update to accommodate plugin developers.

Glen

ps... Congrats on the Canuks...

Glen
http://www.CanadianDomainRegistry.ca
ITI Internetworking Technologies Inc.


robin
User / Moderator


May 26, 2011, 9:24 AM

Post #4 of 5 (1019 views)
Shortcut
Re: [glenara] Plugin Descriptions on mutiple lines [In reply to] Can't Post

Hey Glen,

Thanks for your ideas!

We'll add that to the list of things to look at for the next version.

Thanks,
Robin


ITI
User

May 26, 2011, 8:18 PM

Post #5 of 5 (1011 views)
Shortcut
Re: [robin] Plugin Descriptions on mutiple lines [In reply to] Can't Post

Hi Robin

I have written what I think is a slightly better solution which I added to my "Getting Started with Plugins Page"

http://www.canadiandomainregistry.ca/cmsDocs/cmsPublic

Glen
http://www.CanadianDomainRegistry.ca
ITI Internetworking Technologies Inc.

(This post was edited by ITI on Jul 11, 2011, 2:29 PM)