mirror of
https://github.com/e107inc/e107.git
synced 2025-04-20 12:41:51 +02:00
continuing the plugin.xml work
This commit is contained in:
parent
07d5b5c3ed
commit
43b337e938
@ -58,18 +58,25 @@ if (ADMIN) {
|
||||
}
|
||||
|
||||
$render_plugins = FALSE;
|
||||
include_once(e_HANDLER.'plugin_class.php');
|
||||
$plug = new e107plugin;
|
||||
if($sql -> db_Select("plugin", "*", "plugin_installflag=1 ORDER BY plugin_path")){
|
||||
while($row = $sql -> db_Fetch()){
|
||||
if(getperms('P'.$row['plugin_id'])){
|
||||
include_once(e_PLUGIN.$row['plugin_path']."/plugin.php");
|
||||
if($eplug_conffile){
|
||||
$eplug_name = $tp->toHTML($eplug_name,FALSE,"defs");
|
||||
$plugin_icon = $eplug_icon_small ? "<img src='".e_PLUGIN_ABS.$eplug_icon_small."' alt='".$eplug_caption."' style='border:0px; vertical-align:bottom; width: 16px; height: 16px' />" : E_16_PLUGIN;
|
||||
$plugin_array[ucfirst($eplug_name)] = adnav_main($eplug_name, e_PLUGIN.$row['plugin_path']."/".$eplug_conffile, $plugin_icon);
|
||||
if($plug->parse_plugin(e_PLUGIN.$row['plugin_path'].'/'))
|
||||
{
|
||||
$plug_vars = $plug->plug_vars;
|
||||
// print_a($plug_vars);
|
||||
// exit;
|
||||
// include_once(e_PLUGIN.$row['plugin_path']."/plugin.php");
|
||||
if($plug_vars['administration']['configFile']){
|
||||
$plug_vars['name'] = $tp->toHTML($plug_vars['name'], FALSE, "defs");
|
||||
$plugin_icon = $plug_vars['administration']['iconSmall'] ? "<img src='".e_PLUGIN_ABS.$plug_vars['administration']['iconSmall']."' alt='".$plug_vars['administration']['caption']."' style='border:0px; vertical-align:bottom; width: 16px; height: 16px' />" : E_16_PLUGIN;
|
||||
$plugin_array[ucfirst($plug_vars['name'])] = adnav_main($plug_vars['name'], e_PLUGIN.$row['plugin_path']."/".$plug_vars['administration']['configFile'], $plugin_icon);
|
||||
}
|
||||
$render_plugins = TRUE;
|
||||
$active_plugs = TRUE;
|
||||
}
|
||||
unset($eplug_conffile, $eplug_name, $eplug_caption, $eplug_icon_small);
|
||||
$render_plugins = TRUE;
|
||||
$active_plugs = TRUE;
|
||||
}
|
||||
}
|
||||
ksort($plugin_array, SORT_STRING);
|
||||
|
@ -11,8 +11,8 @@
|
||||
| GNU General Public License (http://gnu.org).
|
||||
|
|
||||
| $Source: /cvs_backup/e107_0.8/e107_handlers/plugin_class.php,v $
|
||||
| $Revision: 1.18 $
|
||||
| $Date: 2008-01-27 01:34:59 $
|
||||
| $Revision: 1.19 $
|
||||
| $Date: 2008-01-27 05:16:03 $
|
||||
| $Author: mcfly_e107 $
|
||||
+----------------------------------------------------------------------------+
|
||||
*/
|
||||
@ -696,7 +696,7 @@ class e107plugin
|
||||
{
|
||||
case 'install':
|
||||
case 'upgrade':
|
||||
if(!isset($attrib['active']) || $attrib['active'] == true)
|
||||
if(!isset($attrib['active']) || $attrib['active'] == 'true')
|
||||
{
|
||||
echo "Adding prefs ".print_a($list['active'], true)."<br />";
|
||||
// manage_prefs('add', $list['active']);
|
||||
@ -718,6 +718,56 @@ class e107plugin
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Userclasses
|
||||
//$this->manage_userclass('add', $eplug_userclass, $eplug_userclass_description);
|
||||
if(isset($plug_vars['userclasses']))
|
||||
{
|
||||
|
||||
if(isset($plug_vars['userclasses']['userclass']))
|
||||
{
|
||||
if(!is_array($plug_vars['userclasses']['userclass']))
|
||||
{
|
||||
$uclass_list = array($plug_vars['mainPrefs']['pref']);
|
||||
}
|
||||
else
|
||||
{
|
||||
$uclass_list = $plug_vars['mainPrefs']['pref'];
|
||||
}
|
||||
foreach($uclass_list as $uclass)
|
||||
{
|
||||
$attrib = $uclass['@attributes'];
|
||||
switch($function)
|
||||
{
|
||||
case 'install':
|
||||
case 'upgrade':
|
||||
if(!isset($attrib['active']) || $attrib['active'] == 'true')
|
||||
{
|
||||
echo "Adding userclass ".$attrib['name']."<br />";
|
||||
// manage_userclass('add', $attrib['name'], $attrib['description']);
|
||||
}
|
||||
|
||||
//If upgrading, removing any inactive pref
|
||||
if($function == 'upgrade' && isset($attrib['active']) && $attrib['active'] == 'false')
|
||||
{
|
||||
echo "Removing userclass ".$attrib['name']."<br />";
|
||||
// manage_userclass('remove', $attrib['name'], $attrib['description']);
|
||||
}
|
||||
break;
|
||||
|
||||
//If uninstalling, remove all userclasses (active or inactive)
|
||||
case 'uninstall':
|
||||
echo "Removing prefs ".$attrib['name']."<br />";
|
||||
// manage_userclass('remove', $attrib['name'], $attrib['description']);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$this -> manage_search($function, $plug_vars['folder']);
|
||||
$this -> manage_notify($function, $plug_vars['folder']);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user