includes/plugins.php
changeset 675 872f0048dd81
parent 613 c08670a77871
child 685 17ebe24cdf85
equal deleted inserted replaced
674:f514dc675f32 675:872f0048dd81
    52    * by any external code because user plugins are loaded after the load_list is calculated. Can be useful in
    52    * by any external code because user plugins are loaded after the load_list is calculated. Can be useful in
    53    * alternative administration panel frameworks that need the list of system plugins.
    53    * alternative administration panel frameworks that need the list of system plugins.
    54    * @var array
    54    * @var array
    55    */
    55    */
    56   
    56   
    57   var $system_plugins = Array('SpecialUserFuncs.php','SpecialUserPrefs.php','SpecialPageFuncs.php','SpecialAdmin.php','SpecialCSS.php','SpecialUpdownload.php','SpecialSearch.php','PrivateMessages.php','SpecialGroups.php', 'SpecialRecentChanges.php');
    57   var $system_plugins = Array('SpecialUserFuncs.php','SpecialUserPrefs.php','SpecialPageFuncs.php','SpecialAdmin.php','SpecialCSS.php','SpecialUpdownload.php','SpecialSearch.php','PrivateMessages.php','SpecialGroups.php', 'SpecialRecentChanges.php', 'DemoMode.php');
    58   
    58   
    59   /**
    59   /**
    60    * Name kept for compatibility. Effectively a constructor. Calculates the list of plugins that should be loaded
    60    * Name kept for compatibility. Effectively a constructor. Calculates the list of plugins that should be loaded
    61    * and puts that list in the $load_list property. Plugin developers have absolutely no use for this whatsoever.
    61    * and puts that list in the $load_list property. Plugin developers have absolutely no use for this whatsoever.
    62    */
    62    */
   508   function install_plugin($filename, $plugin_list = null)
   508   function install_plugin($filename, $plugin_list = null)
   509   {
   509   {
   510     global $db, $session, $paths, $template, $plugins; // Common objects
   510     global $db, $session, $paths, $template, $plugins; // Common objects
   511     global $lang;
   511     global $lang;
   512     
   512     
       
   513     if ( defined('ENANO_DEMO_MODE') )
       
   514     {
       
   515       return array(
       
   516           'mode' => 'error',
       
   517           'error' => $lang->get('acppl_err_demo_mode')
       
   518         );
       
   519     }
       
   520     
   513     if ( !$plugin_list )
   521     if ( !$plugin_list )
   514       $plugin_list = $this->get_plugin_list();
   522       $plugin_list = $this->get_plugin_list();
   515     
   523     
   516     // we're gonna need this
   524     // we're gonna need this
   517     require_once ( ENANO_ROOT . '/includes/sql_parse.php' );
   525     require_once ( ENANO_ROOT . '/includes/sql_parse.php' );
   614   
   622   
   615   function uninstall_plugin($filename, $plugin_list = null)
   623   function uninstall_plugin($filename, $plugin_list = null)
   616   {
   624   {
   617     global $db, $session, $paths, $template, $plugins; // Common objects
   625     global $db, $session, $paths, $template, $plugins; // Common objects
   618     global $lang;
   626     global $lang;
       
   627     
       
   628     if ( defined('ENANO_DEMO_MODE') )
       
   629     {
       
   630       return array(
       
   631           'mode' => 'error',
       
   632           'error' => $lang->get('acppl_err_demo_mode')
       
   633         );
       
   634     }
   619     
   635     
   620     if ( !$plugin_list )
   636     if ( !$plugin_list )
   621       $plugin_list = $this->get_plugin_list();
   637       $plugin_list = $this->get_plugin_list();
   622     
   638     
   623     // we're gonna need this
   639     // we're gonna need this