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

More handling of updated plugin.xml structure

This commit is contained in:
e107steved
2008-12-04 20:17:54 +00:00
parent c364894c91
commit 29035bacf7
3 changed files with 41 additions and 23 deletions

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_admin/admin.php,v $ | $Source: /cvs_backup/e107_0.8/e107_admin/admin.php,v $
| $Revision: 1.4 $ | $Revision: 1.5 $
| $Date: 2008-10-11 11:55:18 $ | $Date: 2008-12-04 20:17:49 $
| $Author: e107steved $ | $Author: e107steved $
+----------------------------------------------------------------------------+ +----------------------------------------------------------------------------+
*/ */
@@ -148,28 +148,38 @@ function render_links($link, $title, $description, $perms, $icon = FALSE, $mode
{ {
global $td,$tp; global $td,$tp;
$text = ''; $text = '';
if (getperms($perms)) { if (getperms($perms))
if ($mode == 'adminb') { {
if ($mode == 'adminb')
{
$text = "<tr><td class='forumheader3'> $text = "<tr><td class='forumheader3'>
<div class='td' style='text-align:left; vertical-align:top; width:100%' <div class='td' style='text-align:left; vertical-align:top; width:100%'
onmouseover=\"eover(this, 'forumheader5')\" onmouseout=\"eover(this, 'td')\" onclick=\"document.location.href='".$link."'\"> onmouseover=\"eover(this, 'forumheader5')\" onmouseout=\"eover(this, 'td')\" onclick=\"document.location.href='".$link."'\">
".$icon." <b>".$title."</b> ".($description ? "[ <span class='smalltext'>".$description."</span> ]" : "")."</div></td></tr>"; ".$icon." <b>".$title."</b> ".($description ? "[ <span class='smalltext'>".$description."</span> ]" : "")."</div></td></tr>";
} else { }
if ($td == (ADLINK_COLS+1)) { else
{
if ($td == (ADLINK_COLS+1))
{
$text .= '</tr>'; $text .= '</tr>';
$td = 1; $td = 1;
} }
if ($td == 1) { if ($td == 1)
{
$text .= '<tr>'; $text .= '<tr>';
} }
if ($mode == 'default') { if ($mode == 'default')
{
$text .= "<td class='td' style='text-align:left; vertical-align:top; width:20%; white-space:nowrap' $text .= "<td class='td' style='text-align:left; vertical-align:top; width:20%; white-space:nowrap'
onmouseover=\"eover(this, 'forumheader5')\" onmouseout=\"eover(this, 'td')\" onclick=\"document.location.href='".$link."'\">".$icon." ".$tp->toHTML($title,FALSE,"defs, emotes_off")."</td>"; onmouseover=\"eover(this, 'forumheader5')\" onmouseout=\"eover(this, 'td')\" onclick=\"document.location.href='".$link."'\">".$icon." ".$tp->toHTML($title,FALSE,"defs, emotes_off")."</td>";
} }
else if ($mode == 'classis') { elseif ($mode == 'classis')
$text .= "<td style='text-align:center; vertical-align:top; width:20%'><a href='".$link."' title='$description'>".$icon."</a><br /> {
$text .= "<td style='text-align:center; vertical-align:top; width:20%'><a href='".$link."' title='{$description}'>".$icon."</a><br />
<a href='".$link."' title='$description'><b>".$tp->toHTML($title,FALSE,"defs, emotes_off")."</b></a><br /><br /></td>"; <a href='".$link."' title='$description'><b>".$tp->toHTML($title,FALSE,"defs, emotes_off")."</b></a><br /><br /></td>";
}elseif ($mode == 'beginner'){ }
elseif ($mode == 'beginner')
{
$text .= "<td style='text-align:center; vertical-align:top; width:20%' ><a href='".$link."' >".$icon."</a> $text .= "<td style='text-align:center; vertical-align:top; width:20%' ><a href='".$link."' >".$icon."</a>
<div style='padding:5px'> <div style='padding:5px'>
<a href='".$link."' title='".$description."' style='text-decoration:none'><b>".$tp->toHTML($title,FALSE,"defs, emotes_off")."</b></a></div><br /><br /><br /></td>"; <a href='".$link."' title='".$description."' style='text-decoration:none'><b>".$tp->toHTML($title,FALSE,"defs, emotes_off")."</b></a></div><br /><br /><br /></td>";
@@ -193,6 +203,7 @@ function render_clean()
return $text; return $text;
} }
$newarray = asortbyindex($array_functions, 1); $newarray = asortbyindex($array_functions, 1);
@@ -269,7 +280,7 @@ function getPluginLinks($iconSize = E_16_PLUGMANAGER, $linkStyle = 'adminb')
require_once(e_HANDLER.'xml_class.php'); require_once(e_HANDLER.'xml_class.php');
$xml = new xmlClass; // We're going to have some plugins with plugin.xml files, surely? So create XML object now $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,'description'=>FALSE,'administration' => FALSE); // .. and they're all going to need the same filter $xml->filter = array('@attributes' => FALSE,'description'=>FALSE,'administration' => FALSE); // .. and they're all going to need the same filter
if ($sql->db_Select("plugin", "*", "plugin_installflag=1")) if ($sql->db_Select("plugin", "*", "plugin_installflag=1"))
{ {
@@ -285,13 +296,20 @@ function getPluginLinks($iconSize = E_16_PLUGMANAGER, $linkStyle = 'adminb')
if (is_readable(e_PLUGIN.$plugin_path."/plugin.xml")) if (is_readable(e_PLUGIN.$plugin_path."/plugin.xml"))
{ {
$readFile = $xml->loadXMLfile(e_PLUGIN.$plugin_path.'/plugin.xml', true, true); $readFile = $xml->loadXMLfile(e_PLUGIN.$plugin_path.'/plugin.xml', true, true);
if ($readFile === FALSE)
{
echo 'Error in file: '.e_PLUGIN.$plugin_path.'/plugin.xml'.'<br />';
}
else
{
include_lan_admin($plugin_path); include_lan_admin($plugin_path);
$eplug_name = $tp->toHTML($readFile['name'],FALSE,"defs, emotes_off"); $eplug_name = $tp->toHTML($readFile['@attributes']['name'],FALSE,"defs, emotes_off");
$eplug_conffile = $readFile['administration']['configFile']; $eplug_conffile = $readFile['administration']['configFile'];
$eplug_icon_small = $plugin_path.'/'.$readFile['administration']['iconSmall']; $eplug_icon_small = $plugin_path.'/'.$readFile['administration']['iconSmall'];
$eplug_icon = $plugin_path.'/'.$readFile['administration']['icon']; $eplug_icon = $plugin_path.'/'.$readFile['administration']['icon'];
$eplug_caption = $tp->toHTML($readFile['description'],FALSE,"defs, emotes_off"); $eplug_caption = $tp->toHTML($readFile['description'],FALSE,"defs, emotes_off");
} }
}
elseif (is_readable(e_PLUGIN.$plugin_path."/plugin.php")) elseif (is_readable(e_PLUGIN.$plugin_path."/plugin.php"))
{ {
include(e_PLUGIN.$plugin_path."/plugin.php"); include(e_PLUGIN.$plugin_path."/plugin.php");

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_admin/includes/categories.php,v $ | $Source: /cvs_backup/e107_0.8/e107_admin/includes/categories.php,v $
| $Revision: 1.3 $ | $Revision: 1.4 $
| $Date: 2008-08-25 10:46:32 $ | $Date: 2008-12-04 20:17:49 $
| $Author: e107steved $ | $Author: e107steved $
+----------------------------------------------------------------------------+ +----------------------------------------------------------------------------+
*/ */
@@ -49,7 +49,7 @@ foreach ($admin_cat['id'] as $cat_key => $cat_id)
require_once(e_HANDLER.'xml_class.php'); require_once(e_HANDLER.'xml_class.php');
$xml = new xmlClass; // We're going to have some plugins with plugin.xml files, surely? So create XML object now $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 $xml->filter = array('@attributes' => FALSE,'administration' => FALSE); // .. and they're all going to need the same filter
if ($text_rend) if ($text_rend)
{ {

View File

@@ -1,6 +1,6 @@
/* /*
* e107 website system (c) 2001-2008 Steve Dunstan (e107.org) * e107 website system (c) 2001-2008 Steve Dunstan (e107.org)
* $Id: admin_nav.sc,v 1.3 2008-12-03 22:29:52 e107steved Exp $ * $Id: admin_nav.sc,v 1.4 2008-12-04 20:17:54 e107steved Exp $
*/ */
if (ADMIN) if (ADMIN)
{ {
@@ -32,7 +32,7 @@ if (ADMIN)
require_once(e_HANDLER.'xml_class.php'); require_once(e_HANDLER.'xml_class.php');
$xml = new xmlClass; // We're going to have some plugins with plugin.xml files, surely? So create XML object now $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 $xml->filter = array('@attributes' => FALSE, 'administration' => FALSE); // .. and they're all going to need the same filter
$nav_sql = new db; $nav_sql = new db;
if ($nav_sql -> db_Select("plugin", "*", "plugin_installflag=1")) if ($nav_sql -> db_Select("plugin", "*", "plugin_installflag=1"))