Changeset 1584 for trunk/admin/include


Ignore:
Timestamp:
Oct 31, 2006, 3:41:32 AM (18 years ago)
Author:
rvelices
Message:

plugins go now in the #plugins table

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/include/functions_plugins.inc.php

    r1580 r1584  
    2525// +-----------------------------------------------------------------------+
    2626
    27 function get_plugins()
     27/* Returns an array of plugins defined in the plugin directory
     28*/
     29function get_fs_plugins()
    2830{
    2931  $plugins = array();
     
    4042          )
    4143      {
    42         $plugin = array('name'=>'?', 'version'=>'?', 'uri'=>'', 'description'=>'');
     44        $plugin = array('name'=>'?', 'version'=>'0', 'uri'=>'', 'description'=>'');
    4345        $plg_data = implode( '', file($path.'/index.php') );
    4446
     
    6769}
    6870
    69 function activate_plugin($plugin_name)
    70 {
    71   global $conf;
    72   $arr = get_active_plugins(false);
    73   array_push($arr, $plugin_name);
    74   if ($arr != array_unique($arr) )
    75     return false; // just added the same one
    76   $conf['active_plugins'] = implode(',', $arr);
    77   pwg_query('
    78 UPDATE '.CONFIG_TABLE.'
    79   SET value="'.$conf['active_plugins'].'"
    80   WHERE param="active_plugins"');
    81   return true;
    82 }
    83 
    84 function deactivate_plugin($plugin_name)
    85 {
    86   global $conf;
    87   $arr = get_active_plugins(false);
    88   $idx = array_search($plugin_name, $arr);
    89   if ($idx!==false)
    90   {
    91     unset( $arr[$idx] );
    92     $conf['active_plugins'] = implode(',', $arr);
    93     pwg_query('
    94 UPDATE '.CONFIG_TABLE.'
    95   SET value="'.$conf['active_plugins'].'"
    96   WHERE param="active_plugins"');
    97     return true;
    98   }
    99   return false;
    100 }
    101 
    10271/*allows plugins to add their content to the administration page*/
    10372function add_plugin_admin_menu($title, $func)
Note: See TracChangeset for help on using the changeset viewer.