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

remove unused code

This commit is contained in:
CaMer0n
2009-08-14 21:11:49 +00:00
parent 12fca5e138
commit eaf6929c5a
2 changed files with 68 additions and 58 deletions

View File

@@ -9,8 +9,8 @@
* General purpose file * General purpose file
* *
* $Source: /cvs_backup/e107_0.8/class2.php,v $ * $Source: /cvs_backup/e107_0.8/class2.php,v $
* $Revision: 1.125 $ * $Revision: 1.126 $
* $Date: 2009-08-14 15:57:44 $ * $Date: 2009-08-14 21:11:49 $
* $Author: e107coders $ * $Author: e107coders $
* *
*/ */
@@ -1168,7 +1168,6 @@ if(!isset($_E107['no_menus']))
$eMenuList = array(); $eMenuList = array();
$eMenuActive = array(); $eMenuActive = array();
$eMenuArea = array(); $eMenuArea = array();
// $eMenuOrder = array();
if(!is_array($menu_data)) if(!is_array($menu_data))
{ {
@@ -1176,20 +1175,14 @@ if(!isset($_E107['no_menus']))
$menu_qry = 'SELECT * FROM #menus WHERE menu_location > 0 AND menu_class IN ('.USERCLASS_LIST.') AND menu_layout = "'.$menu_layout_field.'" ORDER BY menu_location,menu_order'; $menu_qry = 'SELECT * FROM #menus WHERE menu_location > 0 AND menu_class IN ('.USERCLASS_LIST.') AND menu_layout = "'.$menu_layout_field.'" ORDER BY menu_location,menu_order';
if ($sql->db_Select_gen($menu_qry)) if ($sql->db_Select_gen($menu_qry))
{ {
$c = 1;
while ($row = $sql->db_Fetch()) while ($row = $sql->db_Fetch())
{ {
$c = ($prevloc != $row['menu_location']) ? 1 : $c;
$eMenuList[$row['menu_location']][] = $row; $eMenuList[$row['menu_location']][] = $row;
$eMenuArea[$row['menu_location']][$row['menu_name']] = 1; $eMenuArea[$row['menu_location']][$row['menu_name']] = 1;
$eMenuActive[$row['menu_name']] = $row['menu_name']; $eMenuActive[$row['menu_name']] = $row['menu_name'];
// $eMenuOrder[$row['menu_location']][$row['menu_name']] = $c;
// $c++;
// $prevloc = $row['menu_location'];
} }
} }
$menu_data['menu_area'] = $eMenuArea; $menu_data['menu_area'] = $eMenuArea;
// $menu_data['menu_order'] = $eMenuOrder;
$menu_data['menu_list'] = $eMenuList; $menu_data['menu_list'] = $eMenuList;
$menu_data['menu_active'] = $eMenuActive; $menu_data['menu_active'] = $eMenuActive;
$menu_data = $eArrayStorage->WriteArray($menu_data, false); $menu_data = $eArrayStorage->WriteArray($menu_data, false);
@@ -1202,7 +1195,6 @@ if(!isset($_E107['no_menus']))
$eMenuArea = $menu_data['menu_area']; $eMenuArea = $menu_data['menu_area'];
$eMenuList = $menu_data['menu_list']; $eMenuList = $menu_data['menu_list'];
$eMenuActive = $menu_data['menu_active']; $eMenuActive = $menu_data['menu_active'];
// $eMenuOrder = $menu_data['menu_order'];
unset($menu_data); unset($menu_data);
} }

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_admin/plugin.php,v $ | $Source: /cvs_backup/e107_0.8/e107_admin/plugin.php,v $
| $Revision: 1.35 $ | $Revision: 1.36 $
| $Date: 2009-07-22 12:00:51 $ | $Date: 2009-08-14 21:11:49 $
| $Author: marj_nl_fr $ | $Author: e107coders $
+----------------------------------------------------------------------------+ +----------------------------------------------------------------------------+
*/ */
@@ -29,7 +29,7 @@ define('PLUGIN_SHOW_REFRESH', FALSE);
global $user_pref; global $user_pref;
require_once("auth.php");
require_once(e_HANDLER.'plugin_class.php'); require_once(e_HANDLER.'plugin_class.php');
require_once(e_HANDLER.'file_class.php'); require_once(e_HANDLER.'file_class.php');
require_once(e_HANDLER."form_handler.php"); require_once(e_HANDLER."form_handler.php");
@@ -39,6 +39,12 @@ require_once (e_HANDLER.'message_handler.php');
$plugin = new e107plugin; $plugin = new e107plugin;
$frm = new e_form(); $frm = new e_form();
$pman = new pluginManager; $pman = new pluginManager;
define("e_PAGETITLE",ADLAN_98." - ".$pman->pagetitle);
require_once("auth.php");
$pman->pluginObserver();
require_once("footer.php"); require_once("footer.php");
exit; exit;
@@ -51,14 +57,20 @@ class pluginManager{
var $frm; var $frm;
var $fields; var $fields;
var $fieldpref; var $fieldpref;
var $titlearray = array();
var $pagetitle;
function pluginManager() function pluginManager()
{ {
global $user_pref,$admin_log,$ns; global $user_pref,$admin_log;
$tmp = explode('.', e_QUERY); $tmp = explode('.', e_QUERY);
$this -> action = ($tmp[0]) ? $tmp[0] : "installed"; $this -> action = ($tmp[0]) ? $tmp[0] : "installed";
$this -> id = varset($tmp[1]) ? intval($tmp[1]) : ""; $this -> id = varset($tmp[1]) ? intval($tmp[1]) : "";
$this -> titlearray = array('installed'=>EPL_ADLAN_22,'avail'=>EPL_ADLAN_23, 'upload'=>EPL_ADLAN_38);
$keys = array_keys($this -> titlearray);
$this->pagetitle = (in_array($this->action,$keys)) ? $this -> titlearray[$this->action] : $this -> titlearray['installed'];
$this-> fields = array( $this-> fields = array(
@@ -78,19 +90,6 @@ class pluginManager{
"options" => array("title" => LAN_OPTIONS, "width" => "15%", "thclass" => "middle center last", "url" => "") "options" => array("title" => LAN_OPTIONS, "width" => "15%", "thclass" => "middle center last", "url" => "")
); );
if (isset($_POST['upload']))
{
$this -> pluginProcessUpload();
}
if(isset($_POST['submit-e-columns']))
{
$user_pref['admin_pluginmanager_columns'] = $_POST['e-columns'];
save_prefs('user');
}
$this -> fieldpref = (is_array($user_pref['admin_pluginmanager_columns'])) ? $user_pref['admin_pluginmanager_columns'] : array("plugin_icon","plugin_name","plugin_version","plugin_description","plugin_category","plugin_author","plugin_website","plugin_notes");
/* if(isset($_POST['uninstall-selected'])) /* if(isset($_POST['uninstall-selected']))
@@ -109,19 +108,37 @@ class pluginManager{
}
function pluginObserver()
{
global $user_pref,$admin_log;
if (isset($_POST['upload']))
{
$this -> pluginProcessUpload();
}
if(isset($_POST['submit-e-columns']))
{
$user_pref['admin_pluginmanager_columns'] = $_POST['e-columns'];
save_prefs('user');
}
$this -> fieldpref = (is_array($user_pref['admin_pluginmanager_columns'])) ? $user_pref['admin_pluginmanager_columns'] : array("plugin_icon","plugin_name","plugin_version","plugin_description","plugin_category","plugin_author","plugin_website","plugin_notes");
if($this->action == 'avail' || $this->action == 'installed') // Plugin Check is done during upgrade_routine. if($this->action == 'avail' || $this->action == 'installed') // Plugin Check is done during upgrade_routine.
{ {
$this -> pluginCheck(); $this -> pluginCheck();
} }
if($this->action == "uninstall") if($this->action == "uninstall")
{ {
$this -> pluginUninstall(); $this -> pluginUninstall();
} }
if($this->action == "install") if($this->action == "install")
@@ -167,15 +184,11 @@ class pluginManager{
$this -> pluginRenderList(); $this -> pluginRenderList();
} }
}
}
function pluginUninstall() function pluginUninstall()
{ {
global $plugin,$ns,$admin_log,$pref,$tp,$sql; global $plugin,$admin_log,$pref,$tp,$sql;
if(!isset($_POST['uninstall_confirm'])) if(!isset($_POST['uninstall_confirm']))
{ // $id is already an integer { // $id is already an integer
@@ -295,11 +308,19 @@ class pluginManager{
} }
$admin_log->log_event('PLUGMAN_03', $plug['plugin_path'], E_LOG_INFORMATIVE, ''); $admin_log->log_event('PLUGMAN_03', $plug['plugin_path'], E_LOG_INFORMATIVE, '');
print_a($pref['plug_installed']);
if (isset($pref['plug_installed'][$plug['plugin_path']])) if (isset($pref['plug_installed'][$plug['plugin_path']]))
{ {
print_a($plug);
unset($pref['plug_installed'][$plug['plugin_path']]); unset($pref['plug_installed'][$plug['plugin_path']]);
save_prefs(); if(save_prefs())
{
echo "WORKED";
}
else
{
echo "FAILED";
}
} }
} }
@@ -327,7 +348,6 @@ class pluginManager{
function pluginProcessUpload() function pluginProcessUpload()
{ {
global $ns;
if (!$_POST['ac'] == md5(ADMINPWCHANGE)) if (!$_POST['ac'] == md5(ADMINPWCHANGE))
{ {
exit; exit;
@@ -338,7 +358,7 @@ class pluginManager{
if(!is_writable(e_PLUGIN)) if(!is_writable(e_PLUGIN))
{ {
/* still not writable - spawn error message */ /* still not writable - spawn error message */
$ns->tablerender(EPL_ADLAN_40, EPL_ADLAN_39); e107::getRender()->tablerender(EPL_ADLAN_40, EPL_ADLAN_39);
} }
else else
{ {
@@ -360,7 +380,7 @@ class pluginManager{
else else
{ {
/* not zip or tar - spawn error message */ /* not zip or tar - spawn error message */
$ns->tablerender(EPL_ADLAN_40, EPL_ADLAN_41); e107::getRender()->tablerender(EPL_ADLAN_40, EPL_ADLAN_41);
require_once("footer.php"); require_once("footer.php");
exit; exit;
} }
@@ -400,7 +420,7 @@ class pluginManager{
{ {
$error = EPL_ADLAN_47.PclErrorString().", ".EPL_ADLAN_48.intval(PclErrorCode()); $error = EPL_ADLAN_47.PclErrorString().", ".EPL_ADLAN_48.intval(PclErrorCode());
} }
$ns->tablerender(EPL_ADLAN_40, EPL_ADLAN_42." ".$archiveName." ".$error); e107::getRender()->tablerender(EPL_ADLAN_40, EPL_ADLAN_42." ".$archiveName." ".$error);
require_once("footer.php"); require_once("footer.php");
exit; exit;
} }
@@ -413,12 +433,12 @@ class pluginManager{
if(file_exists(e_PLUGIN.$folderName."/plugin.php") || file_exists(e_PLUGIN.$folderName."/plugin.xml")) if(file_exists(e_PLUGIN.$folderName."/plugin.php") || file_exists(e_PLUGIN.$folderName."/plugin.xml"))
{ {
/* upload is a plugin */ /* upload is a plugin */
$ns->tablerender(EPL_ADLAN_40, EPL_ADLAN_43); e107::getRender()->tablerender(EPL_ADLAN_40, EPL_ADLAN_43);
} }
else else
{ {
/* upload is a menu */ /* upload is a menu */
$ns->tablerender(EPL_ADLAN_40, EPL_ADLAN_45); e107::getRender()->tablerender(EPL_ADLAN_40, EPL_ADLAN_45);
} }
/* attempt to delete uploaded archive */ /* attempt to delete uploaded archive */
@@ -432,13 +452,12 @@ class pluginManager{
function pluginInstall() function pluginInstall()
{ {
global $ns,$plugin,$admin_log; global $plugin,$admin_log;
$text = $plugin->install_plugin($this->id); $text = $plugin->install_plugin($this->id);
if ($text === FALSE) if ($text === FALSE)
{ // Tidy this up { // Tidy this up
$this->show_message("Error messages above this line", E_MESSAGE_ERROR); $this->show_message("Error messages above this line", E_MESSAGE_ERROR);
// $ns->tablerender(LAN_INSTALL_FAIL, );
} }
else else
{ {
@@ -446,7 +465,6 @@ class pluginManager{
// if($eplug_conffile){ $text .= "&nbsp;<a href='".e_PLUGIN."$eplug_folder/$eplug_conffile'>[".LAN_CONFIGURE."]</a>"; } // if($eplug_conffile){ $text .= "&nbsp;<a href='".e_PLUGIN."$eplug_folder/$eplug_conffile'>[".LAN_CONFIGURE."]</a>"; }
$admin_log->log_event('PLUGMAN_01', $this->id.':'.$eplug_folder, E_LOG_INFORMATIVE, ''); $admin_log->log_event('PLUGMAN_01', $this->id.':'.$eplug_folder, E_LOG_INFORMATIVE, '');
$this->show_message($text, E_MESSAGE_SUCCESS); $this->show_message($text, E_MESSAGE_SUCCESS);
// $ns->tablerender(EPL_ADLAN_33, $text);
} }
} }
@@ -456,7 +474,7 @@ class pluginManager{
function pluginUpgrade() function pluginUpgrade()
{ {
global $plugin,$ns,$pref; global $plugin,$pref;
$plug = $plugin->getinfo($this->id); $plug = $plugin->getinfo($this->id);
@@ -574,7 +592,7 @@ class pluginManager{
$pref['plug_installed'][$plug['plugin_path']] = $eplug_version; // Update the version $pref['plug_installed'][$plug['plugin_path']] = $eplug_version; // Update the version
save_prefs(); save_prefs();
} }
$ns->tablerender(EPL_ADLAN_34, $text); e107::getRender()->tablerender(EPL_ADLAN_34, $text);
$plugin->save_addon_prefs(); $plugin->save_addon_prefs();
@@ -615,13 +633,13 @@ class pluginManager{
function pluginUpload() function pluginUpload()
{ {
global $plugin,$ns,$frm; global $plugin,$frm;
/* plugin upload form */ /* plugin upload form */
if(!is_writable(e_PLUGIN)) if(!is_writable(e_PLUGIN))
{ {
$ns->tablerender(EPL_ADLAN_40, EPL_ADLAN_44); e107::getRender()->tablerender(EPL_ADLAN_40, EPL_ADLAN_44);
} }
else else
{ {
@@ -656,7 +674,7 @@ class pluginManager{
</form>\n"; </form>\n";
} }
$ns->tablerender(EPL_ADLAN_16, $text); e107::getRender()->tablerender(ADLAN_98." :: ".EPL_ADLAN_38, $text);
} }
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
@@ -713,7 +731,7 @@ class pluginManager{
"; ";
$emessage = &eMessage::getInstance(); $emessage = &eMessage::getInstance();
$e107->ns->tablerender(EPL_ADLAN_16." : ".$caption, $emessage->render(). $text); e107::getRender()->tablerender(ADLAN_98." :: ".$caption, $emessage->render(). $text);
} }
@@ -858,7 +876,7 @@ class pluginManager{
function pluginConfirmUninstall() function pluginConfirmUninstall()
{ {
global $plugin, $tp, $ns; global $plugin, $tp;
$plug = $plugin->getinfo($this->id); $plug = $plugin->getinfo($this->id);
if ($plug['plugin_installflag'] == true ) if ($plug['plugin_installflag'] == true )
@@ -995,7 +1013,7 @@ class pluginManager{
</fieldset> </fieldset>
</form> </form>
"; ";
$ns->tablerender(EPL_ADLAN_63." ".$tp->toHtml($plug_vars['@attributes']['name'], "", "defs,emotes_off, no_make_clickable"), $text); e107::getRender()->tablerender(EPL_ADLAN_63." ".$tp->toHtml($plug_vars['@attributes']['name'], "", "defs,emotes_off, no_make_clickable"), $text);
} }