1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-05 06:07:32 +02:00

More plugin.xml support (should be pretty much it), and the odd small bug fix along the way.

This commit is contained in:
e107steved
2008-08-25 13:34:55 +00:00
parent 780341a53f
commit 99939cd62b
5 changed files with 84 additions and 23 deletions

View File

@@ -1,4 +1,10 @@
if (ADMIN) { /*
* e107 website system (c) 2001-2008 Steve Dunstan (e107.org)
* $Id: admin_alt_nav.sc,v 1.4 2008-08-25 13:34:45 e107steved Exp $
*/
if (ADMIN)
{
global $sql, $pref, $tp; global $sql, $pref, $tp;
parse_str($parm); parse_str($parm);
require(e_ADMIN.'ad_links.php'); require(e_ADMIN.'ad_links.php');
@@ -70,9 +76,6 @@ if (ADMIN) {
if($plug->parse_plugin($_path)) if($plug->parse_plugin($_path))
{ {
$plug_vars = $plug->plug_vars; $plug_vars = $plug->plug_vars;
// print_a($plug_vars);
// exit;
// include_once(e_PLUGIN.$row['plugin_path']."/plugin.php");
if($plug_vars['administration']['configFile']) if($plug_vars['administration']['configFile'])
{ {
$plug_vars['name'] = $tp->toHTML($plug_vars['name'], FALSE, "defs"); $plug_vars['name'] = $tp->toHTML($plug_vars['name'], FALSE, "defs");

View File

@@ -1,12 +1,39 @@
if (ADMIN) { /*
* e107 website system (c) 2001-2008 Steve Dunstan (e107.org)
* $Id: admin_icon.sc,v 1.2 2008-08-25 13:34:45 e107steved Exp $
*/
if (ADMIN)
{
global $e_sub_cat, $e_icon_array, $PLUGINS_DIRECTORY; global $e_sub_cat, $e_icon_array, $PLUGINS_DIRECTORY;
if (strstr(e_SELF, $PLUGINS_DIRECTORY)) { if (strstr(e_SELF, $PLUGINS_DIRECTORY))
{
if (is_readable('plugin.xml'))
{
require_once(e_HANDLER.'xml_class.php');
$xml = new xmlClass;
$xml->filter = array('folder' => FALSE, 'administration' => FALSE); // Just need one variable
$readFile = $xml->loadXMLfile('plugin.xml', true, true);
$eplug_icon = $readFile['folder'].'/'.$readFile['administration']['icon'];
$eplug_folder = $readFile['folder'];
}
elseif (is_readable('plugin.php'))
{
include('plugin.php'); include('plugin.php');
}
else
{
$icon = E_32_CAT_PLUG;
return $icon;
}
$icon = ($eplug_icon && file_exists(e_PLUGIN.$eplug_icon)) ? "<img src='".e_PLUGIN.$eplug_icon."' alt='' style='border:0px; width: 32px; height: 32px' />" : E_32_CAT_PLUG; $icon = ($eplug_icon && file_exists(e_PLUGIN.$eplug_icon)) ? "<img src='".e_PLUGIN.$eplug_icon."' alt='' style='border:0px; width: 32px; height: 32px' />" : E_32_CAT_PLUG;
} else { }
else
{
$icon = $e_icon_array[$e_sub_cat]; $icon = $e_icon_array[$e_sub_cat];
} }
return $icon; return $icon;
} else { }
else
{
return E_32_LOGOUT; return E_32_LOGOUT;
} }

View File

@@ -1,8 +1,16 @@
if (ADMIN) { /*
global $ns, $pref, $e107_plug, $array_functions; * e107 website system (c) 2001-2008 Steve Dunstan (e107.org)
if (strstr(e_SELF, "/admin.php")) { * $Id: admin_nav.sc,v 1.2 2008-08-25 13:34:45 e107steved Exp $
*/
if (ADMIN)
{
global $ns, $pref, $e107_plug, $array_functions, $tp;
if (strstr(e_SELF, "/admin.php"))
{
$active_page = 'x'; $active_page = 'x';
} else { }
else
{
$active_page = time(); $active_page = time();
} }
$e107_var['x']['text']=ADLAN_52; $e107_var['x']['text']=ADLAN_52;
@@ -13,7 +21,8 @@ if (ADMIN) {
$text .= show_admin_menu("",$active_page,$e107_var); $text .= show_admin_menu("",$active_page,$e107_var);
unset($e107_var); unset($e107_var);
foreach ($array_functions as $links_key => $links_value) { foreach ($array_functions as $links_key => $links_value)
{
$e107_var[$links_key]['text'] = $links_value[1]; $e107_var[$links_key]['text'] = $links_value[1];
$e107_var[$links_key]['link'] = $links_value[0]; $e107_var[$links_key]['link'] = $links_value[0];
} }
@@ -21,17 +30,33 @@ if (ADMIN) {
unset($e107_var); unset($e107_var);
// Plugin links menu // Plugin links menu
$sql = new db; require_once(e_HANDLER.'xml_class.php');
if ($sql -> db_Select("plugin", "*", "plugin_installflag=1")) { $xml = new xmlClass; // We're going to have some plugins with plugin.xml files, surely? So create XML object now
$xml->filter = array('name' => FALSE, 'administration' => FALSE); // .. and they're all going to need the same filter
$nav_sql = new db;
if ($nav_sql -> db_Select("plugin", "*", "plugin_installflag=1"))
{
//Link Plugin Manager //Link Plugin Manager
$e107_var['x']['text'] = "<b>".ADLAN_98."</b>"; $e107_var['x']['text'] = "<b>".ADLAN_98."</b>";
$e107_var['x']['link'] = e_ADMIN."plugin.php"; $e107_var['x']['link'] = e_ADMIN."plugin.php";
$e107_var['x']['perm'] = "P"; $e107_var['x']['perm'] = "P";
while($rowplug = $sql -> db_Fetch()) { while($rowplug = $nav_sql -> db_Fetch())
{
extract($rowplug); extract($rowplug);
$e107_plug[$rowplug[1]] = $rowplug[3]; $e107_plug[$rowplug[1]] = $rowplug[3];
include_once(e_PLUGIN.$plugin_path."/plugin.php"); if (is_readable(e_PLUGIN.$plugin_path."/plugin.xml"))
{
$readFile = $xml->loadXMLfile(e_PLUGIN.$plugin_path.'/plugin.xml', true, true);
include_lan_admin(e_PLUGIN.$plugin_path.'/');
$eplug_caption = $tp->toHTML($readFile['name'],FALSE,"defs, emotes_off");
$eplug_conffile = $readFile['administration']['configFile'];
}
elseif (is_readable(e_PLUGIN.$plugin_path."/plugin.php"))
{
include(e_PLUGIN.$plugin_path."/plugin.php");
}
// Links Plugins // Links Plugins
if ($eplug_conffile) { if ($eplug_conffile) {

View File

@@ -1,6 +1,12 @@
if (ADMIN) { /*
* e107 website system (c) 2001-2008 Steve Dunstan (e107.org)
* $Id: admin_plugins.sc,v 1.3 2008-08-25 13:34:45 e107steved Exp $
*/
if (ADMIN)
{
global $e107_plug, $ns, $pref; global $e107_plug, $ns, $pref;
if ($pref['admin_alerts_ok'] == 1) { if ($pref['admin_alerts_ok'] == 1)
{
ob_start(); ob_start();
$text = ""; $text = "";
$i = 0; $i = 0;

View File

@@ -11,8 +11,8 @@
| GNU General Public License (http://gnu.org). | GNU General Public License (http://gnu.org).
| |
| $Source: /cvs_backup/e107_0.8/e107_plugins/calendar_menu/admin_config.php,v $ | $Source: /cvs_backup/e107_0.8/e107_plugins/calendar_menu/admin_config.php,v $
| $Revision: 1.8 $ | $Revision: 1.9 $
| $Date: 2008-08-12 19:59:59 $ | $Date: 2008-08-25 13:34:55 $
| $Author: e107steved $ | $Author: e107steved $
| |
+----------------------------------------------------------------------------+ +----------------------------------------------------------------------------+
@@ -789,12 +789,12 @@ if(!isset($ec_qs[0]) || (isset($ec_qs[0]) && $ec_qs[0] == "config"))
{ {
if ($val == 'sun') $val = 0; elseif ($val == 'mon') $val = 1; // Legacy values if ($val == 'sun') $val = 0; elseif ($val == 'mon') $val = 1; // Legacy values
$ret = "<select name='eventpost_weekstart' class='tbox'>\n"; $ret = "<select name='eventpost_weekstart' class='tbox'>\n";
$ret .= "<\select>\n";
foreach (array(EC_LAN_18,EC_LAN_12,EC_LAN_13,EC_LAN_14,EC_LAN_15,EC_LAN_16,EC_LAN_17) as $k => $v) foreach (array(EC_LAN_18,EC_LAN_12,EC_LAN_13,EC_LAN_14,EC_LAN_15,EC_LAN_16,EC_LAN_17) as $k => $v)
{ {
$sel = ($val == $k) ? " selected='selected'" : ""; $sel = ($val == $k) ? " selected='selected'" : "";
$ret .= "<option value='{$k}'{$sel}>{$v}</option>\n"; $ret .= "<option value='{$k}'{$sel}>{$v}</option>\n";
} }
$ret .= "</select>\n";
return $ret; return $ret;
} }