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

Some code cleanup

This commit is contained in:
CaMer0n
2009-11-05 09:15:19 +00:00
parent 3cf3d709d1
commit d892e2c039
13 changed files with 73 additions and 70 deletions

View File

@@ -9,9 +9,9 @@
* URL Management * URL Management
* *
* $Source: /cvs_backup/e107_0.8/e107_admin/eurl.php,v $ * $Source: /cvs_backup/e107_0.8/e107_admin/eurl.php,v $
* $Revision: 1.11 $ * $Revision: 1.12 $
* $Date: 2009-09-29 17:43:13 $ * $Date: 2009-11-05 09:15:12 $
* $Author: secretr $ * $Author: e107coders $
*/ */
require_once('../class2.php'); require_once('../class2.php');
@@ -254,8 +254,7 @@ class admin_eurl_config {
function parse_config_xml($path) function parse_config_xml($path)
{ {
require_once(e_HANDLER.'xml_class.php'); $xml = e107::getXml();
$xml = new xmlClass;
$parsed = $xml->loadXMLfile($path, true, true); $parsed = $xml->loadXMLfile($path, true, true);
//Load Lan file if required //Load Lan file if required

View File

@@ -3,7 +3,7 @@
+ ----------------------------------------------------------------------------+ + ----------------------------------------------------------------------------+
| e107 website system | e107 website system
| |
| <20>Steve Dunstan 2001-2002 | <20>Steve Dunstan 2001-2002
| http://e107.org | http://e107.org
| jalist@e107.org | jalist@e107.org
| |
@@ -11,16 +11,16 @@
| 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.7 $ | $Revision: 1.8 $
| $Date: 2009-11-01 20:41:34 $ | $Date: 2009-11-05 09:15:12 $
| $Author: e107steved $ | $Author: e107coders $
+----------------------------------------------------------------------------+ +----------------------------------------------------------------------------+
*/ */
if (!defined('e107_INIT')) { exit; } if (!defined('e107_INIT')) { exit; }
require_once(e_HANDLER."message_handler.php"); require_once(e_HANDLER."message_handler.php");
$emessage = &eMessage::getInstance(); $emessage = e107::getMessage();
$text = "<div style='text-align:center'> $text = "<div style='text-align:center'>
<table class='fborder' style='".ADMIN_WIDTH."'>"; <table class='fborder' style='".ADMIN_WIDTH."'>";
@@ -50,8 +50,7 @@ foreach ($admin_cat['id'] as $cat_key => $cat_id)
{ {
$text_rend = render_links(e_ADMIN."plugin.php", ADLAN_98, ADLAN_99, "Z", E_16_PLUGMANAGER, 'default'); $text_rend = render_links(e_ADMIN."plugin.php", ADLAN_98, ADLAN_99, "Z", E_16_PLUGMANAGER, 'default');
require_once(e_HANDLER.'xml_class.php'); $xml = e107::getXml();
$xml = new xmlClass; // We're going to have some plugins with plugin.xml files, surely? So create XML object now
$xml->filter = array('@attributes' => 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

@@ -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/infopanel.php,v $ | $Source: /cvs_backup/e107_0.8/e107_admin/includes/infopanel.php,v $
| $Revision: 1.14 $ | $Revision: 1.15 $
| $Date: 2009-10-26 09:50:00 $ | $Date: 2009-11-05 09:15:12 $
| $Author: e107coders $ | $Author: e107coders $
+----------------------------------------------------------------------------+ +----------------------------------------------------------------------------+
*/ */
@@ -82,9 +82,9 @@ if (isset($_POST['submit-mye107']) || varset($_POST['submit-mymenus']))
<div class='left block-text'>"; <div class='left block-text'>";
// TODO Load with Ajax // TODO Load with Ajax
/* /*
require_once(e_HANDLER.'xml_class.php'); $xml = e107::getXml();
$xml = new xmlClass;
$vars = $xml->loadXMLfile('http://www.e107.org/e107_plugins/rss_menu/rss.php?1.2', true, true); $vars = $xml->loadXMLfile('http://www.e107.org/e107_plugins/rss_menu/rss.php?1.2', true, true);
$text .= print_r($vars,TRUE); $text .= print_r($vars,TRUE);
*/ */

View File

@@ -3,7 +3,7 @@
+ ----------------------------------------------------------------------------+ + ----------------------------------------------------------------------------+
| e107 website system | e107 website system
| |
| <20>Steve Dunstan 2001-2002 | <20>Steve Dunstan 2001-2002
| http://e107.org | http://e107.org
| jalist@e107.org | jalist@e107.org
| |
@@ -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/upload.php,v $ | $Source: /cvs_backup/e107_0.8/e107_admin/upload.php,v $
| $Revision: 1.9 $ | $Revision: 1.10 $
| $Date: 2009-08-28 16:10:51 $ | $Date: 2009-11-05 09:15:12 $
| $Author: marj_nl_fr $ | $Author: e107coders $
+----------------------------------------------------------------------------+ +----------------------------------------------------------------------------+
*/ */
require_once("../class2.php"); require_once("../class2.php");
@@ -191,8 +191,7 @@ switch ($action)
$current_perms = array(); $current_perms = array();
if (($edit_upload_list && is_readable(e_UPLOAD_TEMP_DIR.e_SAVE_FILETYPES)) || (!$edit_upload_list && is_readable(e_ADMIN.e_READ_FILETYPES))) if (($edit_upload_list && is_readable(e_UPLOAD_TEMP_DIR.e_SAVE_FILETYPES)) || (!$edit_upload_list && is_readable(e_ADMIN.e_READ_FILETYPES)))
{ {
require_once(e_HANDLER.'xml_class.php'); $xml = e107::getXml();
$xml = new xmlClass;
$source_file = $edit_upload_list ? e_UPLOAD_TEMP_DIR.e_SAVE_FILETYPES : e_ADMIN.e_READ_FILETYPES; $source_file = $edit_upload_list ? e_UPLOAD_TEMP_DIR.e_SAVE_FILETYPES : e_ADMIN.e_READ_FILETYPES;
$temp_vars = $xml->loadXMLfile($source_file, true, false); $temp_vars = $xml->loadXMLfile($source_file, true, false);
if ($temp_vars === FALSE) if ($temp_vars === FALSE)

View File

@@ -1,7 +1,7 @@
<?php <?php
/* /*
* Copyright e107 Inc e107.org, Licensed under GNU GPL (http://www.gnu.org/licenses/gpl.txt) * Copyright e107 Inc e107.org, Licensed under GNU GPL (http://www.gnu.org/licenses/gpl.txt)
* $Id: admin_shortcodes_class.php,v 1.28 2009-10-31 17:57:15 secretr Exp $ * $Id: admin_shortcodes_class.php,v 1.29 2009-11-05 09:15:19 e107coders Exp $
* *
* Admin shortcode batch - class * Admin shortcode batch - class
*/ */
@@ -97,8 +97,7 @@ class admin_shortcodes
{ {
if (is_readable('plugin.xml')) if (is_readable('plugin.xml'))
{ {
require_once(e_HANDLER.'xml_class.php'); $xml = e107::getXml();
$xml = new xmlClass;
$xml->filter = array('folder' => FALSE, 'administration' => FALSE); // Just need one variable $xml->filter = array('folder' => FALSE, 'administration' => FALSE); // Just need one variable
$readFile = $xml->loadXMLfile('plugin.xml', true, true); $readFile = $xml->loadXMLfile('plugin.xml', true, true);
$eplug_icon = $readFile['folder'].'/'.$readFile['administration']['icon']; $eplug_icon = $readFile['folder'].'/'.$readFile['administration']['icon'];
@@ -552,8 +551,7 @@ class admin_shortcodes
/* SUBLINKS END */ /* SUBLINKS END */
// Plugin links menu // Plugin links menu
require_once(e_HANDLER.'xml_class.php'); $xml = e107::getXml();
$xml = new xmlClass; // We're going to have some plugins with plugin.xml files, surely? So create XML object now
$xml->filter = array('@attributes' => 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;
@@ -895,8 +893,8 @@ class admin_shortcodes
// remember it can cause delays/errors if its not possible to access the Internet // remember it can cause delays/errors if its not possible to access the Internet
if ((strpos(e_SELF,'localhost') !== FALSE) || (strpos(e_SELF,'127.0.0.1') !== FALSE)) { return ''; } if ((strpos(e_SELF,'localhost') !== FALSE) || (strpos(e_SELF,'127.0.0.1') !== FALSE)) { return ''; }
require_once(e_HANDLER."xml_class.php"); $xml = e107::getXml();
$xml = new xmlClass;
require_once(e_HANDLER."magpie_rss.php"); require_once(e_HANDLER."magpie_rss.php");
$ftext = ''; $ftext = '';

View File

@@ -10,8 +10,8 @@
| GNU General Public License (http://gnu.org). | GNU General Public License (http://gnu.org).
| |
| $Source: /cvs_backup/e107_0.8/e107_handlers/e_upgrade_class.php,v $ | $Source: /cvs_backup/e107_0.8/e107_handlers/e_upgrade_class.php,v $
| $Revision: 1.1 $ | $Revision: 1.2 $
| $Date: 2009-08-17 18:42:22 $ | $Date: 2009-11-05 09:15:12 $
| $Author: e107coders $ | $Author: e107coders $
+----------------------------------------------------------------------------+ +----------------------------------------------------------------------------+
*/ */
@@ -74,8 +74,7 @@ class e_upgrade
return; return;
} }
require_once(e_HANDLER.'xml_class.php'); $xml = e107::getXml();
$xml = new xmlClass;
$feed = $this->getOption('releaseUrl'); $feed = $this->getOption('releaseUrl');
if(substr($feed,-4) == ".php") if(substr($feed,-4) == ".php")
@@ -125,6 +124,8 @@ class e_upgrade
} }
function checkAllPlugins() function checkAllPlugins()
{ {
global $pref; global $pref;
@@ -149,7 +150,12 @@ class e_upgrade
$options = array('curFolder' => $curTheme, 'curVersion' => $curVersion, 'releaseUrl' => $curUrl); $options = array('curFolder' => $curTheme, 'curVersion' => $curVersion, 'releaseUrl' => $curUrl);
$this->setOptions($options); $this->setOptions($options);
$this->releaseCheck('theme'); $this->releaseCheck('theme',FALSE);
}
function listLangPacks()
{
} }

View File

@@ -12,8 +12,8 @@
| GNU General Public License (http://gnu.org). | GNU General Public License (http://gnu.org).
| |
| $Source: /cvs_backup/e107_0.8/e107_handlers/login.php,v $ | $Source: /cvs_backup/e107_0.8/e107_handlers/login.php,v $
| $Revision: 1.27 $ | $Revision: 1.28 $
| $Date: 2009-11-05 08:07:48 $ | $Date: 2009-11-05 09:15:12 $
| $Author: e107coders $ | $Author: e107coders $
+----------------------------------------------------------------------------+ +----------------------------------------------------------------------------+
*/ */
@@ -416,8 +416,7 @@ class userlogin
$user_id = intval($user_id); // Should already be an integer - but just in case... $user_id = intval($user_id); // Should already be an integer - but just in case...
if($user_xup) if($user_xup)
{ {
require_once(e_HANDLER.'xml_class.php'); $xml = e107::getXml();
$xml = new xmlClass;
$xupData = array(); $xupData = array();
if($rawData = $xml -> getRemoteFile($user_xup)) if($rawData = $xml -> getRemoteFile($user_xup))
{ {

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.111 $ | $Revision: 1.112 $
| $Date: 2009-11-04 21:59:35 $ | $Date: 2009-11-05 09:15:12 $
| $Author: secretr $ | $Author: e107coders $
+----------------------------------------------------------------------------+ +----------------------------------------------------------------------------+
*/ */
@@ -2033,8 +2033,8 @@ class e107plugin
$tp = e107::getParser(); $tp = e107::getParser();
// loadLanFiles($plugName, 'admin'); // Look for LAN files on default paths // loadLanFiles($plugName, 'admin'); // Look for LAN files on default paths
require_once(e_HANDLER.'xml_class.php'); $xml = e107::getXml();
$xml = new xmlClass;
// $xml->setOptArrayTags('extendedField,userclass,menuLink,commentID'); // always arrays for these tags. // $xml->setOptArrayTags('extendedField,userclass,menuLink,commentID'); // always arrays for these tags.
// $xml->setOptStringTags('install,uninstall,upgrade'); // $xml->setOptStringTags('install,uninstall,upgrade');

View File

@@ -9,8 +9,8 @@
* e107 Admin Theme Handler * e107 Admin Theme Handler
* *
* $Source: /cvs_backup/e107_0.8/e107_handlers/theme_handler.php,v $ * $Source: /cvs_backup/e107_0.8/e107_handlers/theme_handler.php,v $
* $Revision: 1.61 $ * $Revision: 1.62 $
* $Date: 2009-11-02 01:10:50 $ * $Date: 2009-11-05 09:15:12 $
* $Author: e107coders $ * $Author: e107coders $
*/ */
@@ -1299,10 +1299,10 @@ class themeHandler
function parse_theme_xml($path) function parse_theme_xml($path)
{ {
global $tp; $tp = e107::getParser();
$xml = e107::getXml();
// loadLanFiles($path, 'admin'); // Look for LAN files on default paths // loadLanFiles($path, 'admin'); // Look for LAN files on default paths
require_once (e_HANDLER.'xml_class.php');
$xml = new xmlClass;
// layout should always be an array. // layout should always be an array.
$xml->setOptArrayTags('layout'); $xml->setOptArrayTags('layout');
$xml->setOptStringTags('menuPresets,customPages'); $xml->setOptStringTags('menuPresets,customPages');

View File

@@ -9,9 +9,9 @@
* File Upload Handler * File Upload Handler
* *
* $Source: /cvs_backup/e107_0.8/e107_handlers/upload_handler.php,v $ * $Source: /cvs_backup/e107_0.8/e107_handlers/upload_handler.php,v $
* $Revision: 1.21 $ * $Revision: 1.22 $
* $Date: 2009-10-16 21:15:56 $ * $Date: 2009-11-05 09:15:12 $
* $Author: secretr $ * $Author: e107coders $
*/ */
if (!defined('e107_INIT')) if (!defined('e107_INIT'))
@@ -704,8 +704,7 @@ function vet_file($filename, $target_name, $allowed_filetypes = '', $unknown = F
if ($def_file && is_readable(e_ADMIN.$def_file)) if ($def_file && is_readable(e_ADMIN.$def_file))
{ {
require_once (e_HANDLER.'xml_class.php'); $xml = e107::getXml();
$xml = new xmlClass;
$temp_vars = $xml->loadXMLfile(e_ADMIN.$def_file, true, false); $temp_vars = $xml->loadXMLfile(e_ADMIN.$def_file, true, false);
if ($temp_vars === FALSE) if ($temp_vars === FALSE)
{ {

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/user_extended_class.php,v $ | $Source: /cvs_backup/e107_0.8/e107_handlers/user_extended_class.php,v $
| $Revision: 1.24 $ | $Revision: 1.25 $
| $Date: 2009-08-06 20:29:58 $ | $Date: 2009-11-05 09:15:12 $
| $Author: e107coders $ | $Author: e107coders $
+----------------------------------------------------------------------------+ +----------------------------------------------------------------------------+
*/ */
@@ -639,8 +639,7 @@ class e107_user_extended
return $this->extended_xml; return $this->extended_xml;
} }
require_once(e_HANDLER."xml_class.php"); $xml = e107::getXml
$xml = new xmlClass;
$data = $xml->loadXMLfile(e_FILE."cache/user_extended.xml", true); $data = $xml->loadXMLfile(e_FILE."cache/user_extended.xml", true);
$ret['version'] = $data['@attributes']['version']; $ret['version'] = $data['@attributes']['version'];
unset($info); unset($info);

View File

@@ -9,8 +9,8 @@
* Installation file * Installation file
* *
* $Source: /cvs_backup/e107_0.8/install_.php,v $ * $Source: /cvs_backup/e107_0.8/install_.php,v $
* $Revision: 1.47 $ * $Revision: 1.48 $
* $Date: 2009-11-03 01:17:25 $ * $Date: 2009-11-05 09:15:12 $
* $Author: e107coders $ * $Author: e107coders $
* *
*/ */
@@ -985,6 +985,7 @@ class e_install
include_lan($this->e107->e107_dirs['LANGUAGES_DIRECTORY'].$this->previous_steps['language']."/admin/lan_theme.php"); include_lan($this->e107->e107_dirs['LANGUAGES_DIRECTORY'].$this->previous_steps['language']."/admin/lan_theme.php");
//Create default plugin-table entries. //Create default plugin-table entries.
// e107::getConfig('core')->clearPrefCache();
e107::getSingleton('e107plugin')->update_plugins_table(); e107::getSingleton('e107plugin')->update_plugins_table();
// Install Theme-required plugins // Install Theme-required plugins
@@ -1002,12 +1003,16 @@ class e_install
} }
} }
e107::getSingleton('xmlClass')->e107Import($XMLImportfile,'add'); // Add missing core pref values
//FIXME - should be 'add' not 'replace' - but 'add' doesn't insert arrays correctly.
e107::getXml()->e107Import($XMLImportfile,'replace'); // Add missing core pref values
e107::getSingleton('e107plugin')->save_addon_prefs(); // save plugin addon pref-lists. eg. e_latest_list. e107::getSingleton('e107plugin')->save_addon_prefs(); // save plugin addon pref-lists. eg. e_latest_list.
$tm = e107::getSingleton('themeHandler'); $tm = e107::getSingleton('themeHandler');
$tm->noLog = TRUE; $tm->noLog = TRUE;
$tm->setTheme($this->previous_steps['prefs']['sitetheme']); $tm->setTheme($this->previous_steps['prefs']['sitetheme']);
$pref = e107::getConfig('core')->getPref();
// Set Preferences defined during install - overwriting those that may exist in the XML. // Set Preferences defined during install - overwriting those that may exist in the XML.
@@ -1029,7 +1034,7 @@ class e_install
$this->previous_steps['prefs']['cookie_name'] = substr($cookiename,0,5)."cookie"; $this->previous_steps['prefs']['cookie_name'] = substr($cookiename,0,5)."cookie";
e107::getConfig('core')->setPref($this->previous_steps['prefs']); e107::getConfig('core')->setPref($this->previous_steps['prefs']);
e107::getConfig('core')->save(FALSE); // save preferences made during install. e107::getConfig('core')->save(FALSE,TRUE); // save preferences made during install.
// Create the admin user - replacing any that may be been included in the XML. // Create the admin user - replacing any that may be been included in the XML.
$ip = $_SERVER['REMOTE_ADDR']; $ip = $_SERVER['REMOTE_ADDR'];
@@ -1153,8 +1158,8 @@ class e_install
$xmlArray = $tm->parse_theme_xml($theme_folder); $xmlArray = $tm->parse_theme_xml($theme_folder);
// require_once($this->e107->e107_dirs['HANDLERS_DIRECTORY']."xml_class.php");
// $xml = new xmlClass; // $xml = e107::getXml();
// $xmlArray = $xml->loadXMLfile($path,'advanced'); // $xmlArray = $xml->loadXMLfile($path,'advanced');
return (is_array($xmlArray)) ? $xmlArray : FALSE; return (is_array($xmlArray)) ? $xmlArray : FALSE;
} }

View File

@@ -9,9 +9,9 @@
* User signup * User signup
* *
* $Source: /cvs_backup/e107_0.8/signup.php,v $ * $Source: /cvs_backup/e107_0.8/signup.php,v $
* $Revision: 1.39 $ * $Revision: 1.40 $
* $Date: 2009-08-28 15:30:25 $ * $Date: 2009-11-05 09:15:12 $
* $Author: marj_nl_fr $ * $Author: e107coders $
* *
*/ */
@@ -388,7 +388,7 @@ if (isset($_POST['register']))
if (!$error && $readXUP) if (!$error && $readXUP)
{ {
require_once(e_HANDLER."xml_class.php"); require_once(e_HANDLER."xml_class.php");
$xml = new parseXml; $xml = new parseXml; // old parser
if(!$rawData = $xml -> getRemoteXmlFile($_POST['user_xup'])) if(!$rawData = $xml -> getRemoteXmlFile($_POST['user_xup']))
{ {
$extraErrors[] = LAN_SIGNUP_68."\\n"; $extraErrors[] = LAN_SIGNUP_68."\\n";