plugins/SpecialUserPrefs.php
changeset 326 ab66d6d1f1f4
parent 322 5f1cd51bf1be
child 328 dc838fd61a06
equal deleted inserted replaced
314:474f8be55943 326:ab66d6d1f1f4
     2 /*
     2 /*
     3 Plugin Name: User control panel
     3 Plugin Name: User control panel
     4 Plugin URI: http://enanocms.org/
     4 Plugin URI: http://enanocms.org/
     5 Description: Provides the page Special:Preferences.
     5 Description: Provides the page Special:Preferences.
     6 Author: Dan Fuhry
     6 Author: Dan Fuhry
     7 Version: 1.0.2
     7 Version: 1.0.3
     8 Author URI: http://enanocms.org/
     8 Author URI: http://enanocms.org/
     9 */
     9 */
    10 
    10 
    11 /*
    11 /*
    12  * Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
    12  * Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
    13  * Version 1.0.2
    13  * Version 1.0.3
    14  * Copyright (C) 2006-2007 Dan Fuhry
    14  * Copyright (C) 2006-2007 Dan Fuhry
    15  *
    15  *
    16  * This program is Free Software; you can redistribute it and/or modify it under the terms of the GNU General Public License
    16  * This program is Free Software; you can redistribute it and/or modify it under the terms of the GNU General Public License
    17  * as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
    17  * as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
    18  *
    18  *
    45 
    45 
    46 function userprefs_jbox_setup(&$button, &$tb, &$menubtn)
    46 function userprefs_jbox_setup(&$button, &$tb, &$menubtn)
    47 {
    47 {
    48   global $db, $session, $paths, $template, $plugins; // Common objects
    48   global $db, $session, $paths, $template, $plugins; // Common objects
    49   
    49   
    50   if ( $paths->namespace != 'Special' || $paths->cpage['urlname_nons'] != 'Preferences' )
    50   if ( $paths->namespace != 'Special' || $paths->page_id != 'Preferences' )
    51     return false;
    51     return false;
    52   
    52   
    53   $tb .= "<ul>$template->toolbar_menu</ul>";
    53   $tb .= "<ul>$template->toolbar_menu</ul>";
    54   $template->toolbar_menu = '';
    54   $template->toolbar_menu = '';
    55   
    55   
   597     default:
   597     default:
   598       $good = false;
   598       $good = false;
   599       $code = $plugins->setHook('userprefs_body');
   599       $code = $plugins->setHook('userprefs_body');
   600       foreach ( $code as $cmd )
   600       foreach ( $code as $cmd )
   601       {
   601       {
   602         if ( eval($code) )
   602         if ( eval($cmd) )
   603           $good = true;
   603           $good = true;
   604       }
   604       }
   605       if ( !$good )
   605       if ( !$good )
   606       {
   606       {
   607         echo '<h3>Invalid module</h3>
   607         echo '<h3>Invalid module</h3>