1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-05 14:17:49 +02:00

More plugin.xml support stuff

This commit is contained in:
mcfly
2008-01-26 05:19:59 +00:00
parent 86a1606e1d
commit b8ff0b70da
2 changed files with 139 additions and 113 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/plugin.php,v $ | $Source: /cvs_backup/e107_0.8/e107_admin/plugin.php,v $
| $Revision: 1.8 $ | $Revision: 1.9 $
| $Date: 2008-01-26 04:47:27 $ | $Date: 2008-01-26 05:19:58 $
| $Author: mcfly_e107 $ | $Author: mcfly_e107 $
+----------------------------------------------------------------------------+ +----------------------------------------------------------------------------+
*/ */
@@ -522,10 +522,10 @@ function render_plugs($pluginList)
$plugin_icon = $plug_vars['administration']['icon'] ? "<img src='".e_PLUGIN.$plug_vars['administration']['icon']."' alt='' style='border:0px;vertical-align: bottom; width: 32px; height: 32px' />" : E_32_CAT_PLUG; $plugin_icon = $plug_vars['administration']['icon'] ? "<img src='".e_PLUGIN.$plug_vars['administration']['icon']."' alt='' style='border:0px;vertical-align: bottom; width: 32px; height: 32px' />" : E_32_CAT_PLUG;
if ($plug_vars['configFile'] && $plug['plugin_installflag'] == true) if ($plug_vars['administration']['configFile'] && $plug['plugin_installflag'] == true)
{ {
$conf_title = LAN_CONFIGURE.' '.$tp->toHtml($plug_vars['name'], "", "defs,emotes_off, no_make_clickable"); $conf_title = LAN_CONFIGURE.' '.$tp->toHtml($plug_vars['name'], "", "defs,emotes_off, no_make_clickable");
$plugin_icon = "<a title='{$conf_title}' href='".e_PLUGIN.$plug_vars['folder'].'/'.$plug_vars['configFile']."' >".$plugin_icon.'</a>'; $plugin_icon = "<a title='{$conf_title}' href='".e_PLUGIN.$plug_vars['folder'].'/'.$plug_vars['administration']['configFile']."' >".$plugin_icon.'</a>';
} }
$text .= " $text .= "

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_handlers/plugin_class.php,v $ | $Source: /cvs_backup/e107_0.8/e107_handlers/plugin_class.php,v $
| $Revision: 1.16 $ | $Revision: 1.17 $
| $Date: 2008-01-26 04:47:27 $ | $Date: 2008-01-26 05:19:59 $
| $Author: mcfly_e107 $ | $Author: mcfly_e107 $
+----------------------------------------------------------------------------+ +----------------------------------------------------------------------------+
*/ */
@@ -559,26 +559,26 @@ class e107plugin
} }
} }
$s_prefs = $tp -> toDB($notify_prefs); $s_prefs = $tp -> toDB($notify_prefs);
$s_prefs = $eArrayStorage -> WriteArray($s_prefs); $s_prefs = $eArrayStorage->WriteArray($s_prefs);
$sql -> db_Update("core", "e107_value='".$s_prefs."' WHERE e107_name='notify_prefs'"); $sql -> db_Update("core", "e107_value='".$s_prefs."' WHERE e107_name='notify_prefs'");
} }
/** function install_plugin_xml($path)
* Installs a plugin by ID
*
* @param int $id
*/
function install_plugin($id)
{ {
global $sql, $ns, $sysprefs,$mySQLprefix, $tp; $plug_vars = $this->parse_plugin_xml($path);
// install plugin ... //Still working on this, let's install via plugin.php still
$plug = $this->getinfo($id); return $this->install_plugin_php($path);
}
function install_plugin_php($path)
{
$plug = array();
$plug['plug_action'] = 'install'; $plug['plug_action'] = 'install';
if ($plug['plugin_installflag'] == FALSE) // $plug_vars = $this->parse_plugin_php($path);
{ include_once($path.'plugin.php');
include_once(e_PLUGIN.$plug['plugin_path'].'/plugin.php');
$func = $eplug_folder.'_install'; $func = $eplug_folder.'_install';
if (function_exists($func)) if (function_exists($func))
@@ -601,16 +601,12 @@ class e107plugin
} }
} }
if (is_array($eplug_prefs)) if (is_array($eplug_prefs))
{ {
$this->manage_prefs('add', $eplug_prefs); $this->manage_prefs('add', $eplug_prefs);
$text .= EPL_ADLAN_8.'<br />'; $text .= EPL_ADLAN_8.'<br />';
} }
if (is_array($eplug_array_pref)) if (is_array($eplug_array_pref))
{ {
foreach($eplug_array_pref as $key => $val) foreach($eplug_array_pref as $key => $val)
@@ -681,9 +677,39 @@ class e107plugin
save_prefs(); save_prefs();
if($rssmess) if($rssmess)
{ $text .= $rssmess; {
$text .= $rssmess;
} }
$text .= (isset($eplug_done) ? "<br />{$eplug_done}" : "<br />".LAN_INSTALL_SUCCESSFUL); $text .= (isset($eplug_done) ? "<br />{$eplug_done}" : "<br />".LAN_INSTALL_SUCCESSFUL);
return $text;
}
/**
* Installs a plugin by ID
*
* @param int $id
*/
function install_plugin($id)
{
global $sql, $ns, $sysprefs, $mySQLprefix, $tp;
// install plugin ...
$plug = $this->getinfo($id);
$plug['plug_action'] = 'install';
if ($plug['plugin_installflag'] == FALSE)
{
$_path = e_PLUGIN.$plug['plugin_path'].'/';
if(file_exists($path.'plugin.php'))
{
$text = $this->install_plugin_php($_path);
}
elseif(file_exists($path.'plugin.xml'))
{
$text = $this->install_plugin_xml($_path);
}
} }
else else
{ {