Changeset 1584 for trunk/admin/include
- Timestamp:
- Oct 31, 2006, 3:41:32 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/include/functions_plugins.inc.php
r1580 r1584 25 25 // +-----------------------------------------------------------------------+ 26 26 27 function get_plugins() 27 /* Returns an array of plugins defined in the plugin directory 28 */ 29 function get_fs_plugins() 28 30 { 29 31 $plugins = array(); … … 40 42 ) 41 43 { 42 $plugin = array('name'=>'?', 'version'=>' ?', 'uri'=>'', 'description'=>'');44 $plugin = array('name'=>'?', 'version'=>'0', 'uri'=>'', 'description'=>''); 43 45 $plg_data = implode( '', file($path.'/index.php') ); 44 46 … … 67 69 } 68 70 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 one76 $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 102 71 /*allows plugins to add their content to the administration page*/ 103 72 function add_plugin_admin_menu($title, $func)
Note: See TracChangeset
for help on using the changeset viewer.