Deutschland United States United Kingdom
ContentLion - Open Source CMS

Plugin base

Plugin information 

The plugin information are shown in the plugin list. From here the user can (de)activate the plugin. This information are in the file info.php. This could look like this:

<?PHP
  $pluginInfo                                = new PluginInfo();
  $pluginInfo->path                  = "skinwizard";
  $pluginInfo->name                = "Skin Wizard";
  $pluginInfo->authorName = "Stefan Wienströer";
  $pluginInfo->authorLink    = "http://SteviesWebsite.de";
  $pluginInfo->version            = "1.0.0";
  $pluginInfo->license             = "GPL 2";
  $pluginInfo->licenseUrl      = "http://www.gnu.org/licenses/gpl.html";
  $pluginInfo->supportedLanguages = array("de","en");
  $this->Add($pluginInfo);
?>

Path show the technical name of your plugin. This is the foldername your plugin is saved in. It's just allowed to use alphanumeric signs or hyphens. The display name is saved in the name property. With the authorName and authorLink you can show who you are. To ensure your wished license, you can set the licsense and licenseUrl to show, whcich license you are using. At least you have to set, which languages you are supporting.

Translations

The translations are saved in the language folder of your plugin. For every installation you have file file with the language shortcode. For Example de.php, en.php or es.php.

<?PHP
  $tokens['plugin_description']   = 'Tool zum erstellen eigener Skins';
  $tokens['menu_item']                   = 'Menüpunkt';
  $tokens['my_page']                        = 'Meine Seite';
  $tokens['menu']                               = 'Menü';
  //...
?>

You just have to fill the array $tokens. The key (menu_item, my_page,...) are the identifiers for you translation. You can access this over plugin_pluginname_tokenname. A special fall is plugin_description. This description will be shown in the plugin list.

The languages files will be integrated by the activation of the plugin. For a fast access, they are cached. To test new language, just deactivate and then activate your plugin.

(De)activation 

If a plugin changes things in the database or something simular, they should be executed while the activation of your plugin. You can create a file namend activate.php in the root folder, which we are executing.

It should also be possible to deactivate your plugin. I know, you want that your plugin is activated on all systems, but the deactivation is important to. It shows the quality of your plugin. We are calling deactivate.php in this case.