Plugin Descriptions on mutiple lines

5 posts by 3 authors in: Forums > CMS Builder: Plugins & Add-ons
Last Post: May 26, 2011   (RSS)

By ITI - May 24, 2011

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().


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:
<?php

Thanks for looking at it.
Glen
Glen







http://www.CanadianDomainRegistry.ca







ITI Internetworking Technologies Inc.

Re: [glenara] Plugin Descriptions on mutiple lines

By Jason - May 25, 2011

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 - Project Manager
interactivetools.com

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

Re: [glenara] Plugin Descriptions on mutiple lines

By robin - May 26, 2011

Hey Glen,

Thanks for your ideas!

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

Thanks,
Robin
Robin
Programmer
interactivetools.com

Re: [robin] Plugin Descriptions on mutiple lines

By ITI - May 26, 2011 - edited: July 11, 2011

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.