Page 1 of 1

Where is the help text for a plugin located

Posted: Thu Aug 07, 2008 10:28 am
by Kangaby
Hello,

I've had CMSMS for a day or so, and have been looking through some of the code in the plugins folder to get a feel for how hard or easy it would be to put together a simple plugin. I'm not trying to do anything special, this is just a learning exercise, so I don't want to use a user defined tag in this instance.

This is my approach:

1. copy existing plugin
2. change name and strip out functionallity
3. add some random text to display, so I know it's working
4. add extra stuff from there

What I don't understand is where the nice help text you get when you click the help link in the admin area comes from.

For example function.ImageGallery.php has the code

Code: Select all

function smarty_cms_help_function_ImageGallery() {
  echo lang('help_function_imagegallery');
}
but I can't find how lang('help_function_imagegallery') becomes the help text, unless it's hidden in the database somewhere.

In which case how do you make the help for your plugin available, if and when you choose to release it.

Thanks in advance,

Re: Where is the help text for a plugin located

Posted: Thu Aug 07, 2008 9:09 pm
by Nullig
Try using this template as a skeleton in your plugin - changing the name of the tag...

Code: Select all

/**
 * smarty_cms_help_function_yourplugin()
 *
 * output the help page
 *
 * @return void
 */
function smarty_cms_help_function_yourplugin()
{
    ?>
    <h3>What does this do?</h3>
    <p>Your help text here</p>
    <?php
}

/**
 * smarty_cms_about_function_yourplugin()
 *
 * output the about page
 *
 * @return void
 */
function smarty_cms_about_function_yourplugin()
{
    ?>
    <p>Author:</p>
 
    <p>Version:</p>
    <p>Change History:</p>
    <ul>
        <li>change 1</li>
        <li>change 2</li>
   </ul>
    <?php
}
Nullig

Re: Where is the help text for a plugin located

Posted: Thu Aug 07, 2008 10:17 pm
by Kangaby
You didn't answer my question.

Code: Select all

function smarty_cms_help_function_ImageGallery() {
  echo lang('help_function_imagegallery');
}
Doesn't have any help text like you example. So I still don't know where it's hidden or how it is released. I know I can put whatever in the file, but that doesn't explain how the existing ones work.

Re: Where is the help text for a plugin located

Posted: Thu Aug 07, 2008 10:39 pm
by Nullig
That refers to an entry in the admin.inc.php language file, which is used by the "core" modules and tags. If you are adding a new tag (plugin), you need to code the help info yourself.

Nullig