1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-03 21:27:25 +02:00

fixed plugin scan issue - update to latest XML version

This commit is contained in:
secretr
2008-12-05 14:18:51 +00:00
parent 8fc3e3542e
commit b2b15d5542

View File

@@ -11,9 +11,9 @@
| 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.52 $ | $Revision: 1.53 $
| $Date: 2008-12-03 22:29:46 $ | $Date: 2008-12-05 14:18:51 $
| $Author: e107steved $ | $Author: secretr $
+----------------------------------------------------------------------------+ +----------------------------------------------------------------------------+
*/ */
@@ -22,21 +22,21 @@ if (!defined('e107_INIT')) { exit; }
class e107plugin class e107plugin
{ {
var $plugin_addons = array( var $plugin_addons = array(
"e_rss", "e_rss",
"e_notify", "e_notify",
"e_linkgen", "e_linkgen",
"e_list", "e_list",
"e_bb", "e_bb",
"e_meta", "e_meta",
"e_emailprint", "e_emailprint",
"e_frontpage", "e_frontpage",
"e_latest", "e_latest",
"e_status", "e_status",
"e_search", "e_search",
"e_sc", "e_sc",
"e_module", "e_module",
"e_comment", "e_comment",
"e_sql", "e_sql",
"e_userprofile", "e_userprofile",
"e_header" "e_header"
); );
@@ -212,13 +212,14 @@ class e107plugin
} }
else else
{ // New plugin - not in table yet, so add it. If no install needed, mark it as 'installed' { // New plugin - not in table yet, so add it. If no install needed, mark it as 'installed'
if ($plug_info['name']) //SecretR - update to latest XML version
if ($plug_info['@attributes']['name'])
{ {
// echo "New plugin to add: {$plug_info['name']}<br />"; // echo "New plugin to add: {$plug_info['name']}<br />";
// Can just add to DB - shouldn't matter that its not in our current table // Can just add to DB - shouldn't matter that its not in our current table
// echo "Trying to insert: ".$eplug_folder."<br />"; // echo "Trying to insert: ".$eplug_folder."<br />";
$_installed = ($plug_info['installRequired'] == 'true' || $plug_info['installRequired'] == 1 ? 0 : 1 ); $_installed = ($plug_info['@attributes']['installRequired'] == 'true' || $plug_info['installRequired'] == 1 ? 0 : 1 );
$sql->db_Insert("plugin", "0, '".$tp -> toDB($plug_info['name'], true)."', '".$tp -> toDB($plug_info['@attributes']['version'], true)."', '".$tp -> toDB($plugin_path, true)."', {$_installed}, '{$eplug_addons}' "); $sql->db_Insert("plugin", "0, '".$tp -> toDB($plug_info['@attributes']['name'], true)."', '".$tp -> toDB($plug_info['@attributes']['version'], true)."', '".$tp -> toDB($plugin_path, true)."', {$_installed}, '{$eplug_addons}' ");
} }
} }
} }
@@ -287,12 +288,12 @@ class e107plugin
$this->module['ue'] = new e107_user_extended; $this->module['ue'] = new e107_user_extended;
} }
$type = constant($field_type); $type = constant($field_type);
if($action == 'add') if($action == 'add')
{ {
return $this->module['ue']->user_extended_add_system($field_name, $type, $field_default, $field_source); return $this->module['ue']->user_extended_add_system($field_name, $type, $field_default, $field_source);
} }
if ($action == 'remove') if ($action == 'remove')
{ {
return $this->module['ue']->user_extended_remove($field_name, $field_name); return $this->module['ue']->user_extended_remove($field_name, $field_name);
@@ -760,7 +761,7 @@ class e107plugin
switch ($dt) switch ($dt)
{ {
case 'plugin' : case 'plugin' :
if (!isset($pref['plug_installed'][$dv['@attributes']['name']])) if (!isset($pref['plug_installed'][$dv['@attributes']['name']]))
{ // Plugin not installed { // Plugin not installed
$canContinue = FALSE; $canContinue = FALSE;
$error[] = EPL_ADLAN_70.$dv['@attributes']['name']; $error[] = EPL_ADLAN_70.$dv['@attributes']['name'];
@@ -874,7 +875,7 @@ class e107plugin
{ {
$attrib = $link['@attributes']; $attrib = $link['@attributes'];
$linkName = $attrib['name']; $linkName = $attrib['name'];
if (defined($linkName)) if (defined($linkName))
{ {
$linkName = constant($linkName); $linkName = constant($linkName);
} }
@@ -964,7 +965,7 @@ class e107plugin
{ {
case 'install': case 'install':
case 'upgrade': case 'upgrade':
// Add all active userclasses // Add all active userclasses
if(!isset($attrib['active']) || $attrib['active'] == 'true') if(!isset($attrib['active']) || $attrib['active'] == 'true')
{ {
$txt .= "Adding userclass ".$attrib['name']."<br />"; $txt .= "Adding userclass ".$attrib['name']."<br />";
@@ -998,7 +999,7 @@ class e107plugin
$attrib['default'] = varset($attrib['default']); $attrib['default'] = varset($attrib['default']);
$attrib['name'] = 'plugin_'.$plug_vars['folder'].'_'.$attrib['name']; $attrib['name'] = 'plugin_'.$plug_vars['folder'].'_'.$attrib['name'];
$source = 'plugin_'.$plug_vars['folder']; $source = 'plugin_'.$plug_vars['folder'];
switch($function) switch($function)
{ {
case 'install': case 'install':
@@ -1130,7 +1131,7 @@ class e107plugin
{ {
$result = call_user_func($attrib['function'], $this); $result = call_user_func($attrib['function'], $this);
return $result; return $result;
} }
elseif($attrib['type'] == 'classFunction') elseif($attrib['type'] == 'classFunction')
{ {
$_tmp = new $attrib['class']; $_tmp = new $attrib['class'];
@@ -1175,7 +1176,7 @@ class e107plugin
} }
return $ret; return $ret;
} }
function install_plugin_php($id) function install_plugin_php($id)
{ {
global $sql; global $sql;
@@ -1273,7 +1274,7 @@ class e107plugin
$id = (int)$id; $id = (int)$id;
$plug = $this->getinfo($id); $plug = $this->getinfo($id);
$plug['plug_action'] = 'install'; $plug['plug_action'] = 'install';
if ($plug['plugin_installflag'] == FALSE) if ($plug['plugin_installflag'] == FALSE)
{ {
$_path = e_PLUGIN.$plug['plugin_path'].'/'; $_path = e_PLUGIN.$plug['plugin_path'].'/';