Where is the help text for a plugin located

Talk about writing modules and plugins for CMS Made Simple, or about specific core functionality. This board is for PHP programmers that are contributing to CMSMS not for site developers
Post Reply
Kangaby
New Member
New Member
Posts: 6
Joined: Wed Aug 06, 2008 9:08 am

Where is the help text for a plugin located

Post 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,
User avatar
Nullig
Power Poster
Power Poster
Posts: 2380
Joined: Fri Feb 02, 2007 4:31 pm
Location: Comox Valley, BC

Re: Where is the help text for a plugin located

Post 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
Kangaby
New Member
New Member
Posts: 6
Joined: Wed Aug 06, 2008 9:08 am

Re: Where is the help text for a plugin located

Post 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.
User avatar
Nullig
Power Poster
Power Poster
Posts: 2380
Joined: Fri Feb 02, 2007 4:31 pm
Location: Comox Valley, BC

Re: Where is the help text for a plugin located

Post 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
Post Reply

Return to “Developers Discussion”