You are here: start » plugin_tutorial_admin

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
plugin_tutorial_admin [2013/08/16 15:38]
Christoph M. Becker fixed navigation link
plugin_tutorial_admin [2014/08/13 20:54]
Christoph M. Becker added note about XH_wantsPluginAdministration()
Line 21: Line 21:
  
 The if guard is mandatory to avoid that the code is executed, if any action unrelated to your plugin is called. The global $visitors_online is set to '​true'​ by CMSimple_XH,​ if the plugin is called for in the back-end. The if guard is mandatory to avoid that the code is executed, if any action unrelated to your plugin is called. The global $visitors_online is set to '​true'​ by CMSimple_XH,​ if the plugin is called for in the back-end.
 +
 +<​note>​CMSimple_XH 1.6.3 is supposed to introduce the function XH_wantsPluginAdministration() to be used for this guard. It is recommended to use this function instead for future compatibility:​
 +<​code=php>​if (function_exists('​XH_wantsPluginAdministration'​) ​
 +    && XH_wantsPluginAdministration('​visitors_online'​) ​
 +    || isset($visitors_online) && $visitors_online == '​true'​
 +) {
 +    //...
 +}</​code></​note>​
  
 If it's your plugin'​s turn, typically the first thing is to display the plugin menu. The simplest solution is to append the result of print_plugin_admin() to $o. This writes the default plugin menu to the (X)HTML output (actually to the content area). If it's your plugin'​s turn, typically the first thing is to display the plugin menu. The simplest solution is to append the result of print_plugin_admin() to $o. This writes the default plugin menu to the (X)HTML output (actually to the content area).
 
You are here: start » plugin_tutorial_admin
Except where otherwise noted, content on this wiki is licensed under the following license: GNU Free Documentation License 1.3
Valid XHTML 1.0 Valid CSS Driven by DokuWiki