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: [Jason] Plugin Descriptions on mutiple lines

By ITI - May 25, 2011

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.

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.