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

View File

@@ -3,7 +3,7 @@
+ ----------------------------------------------------------------------------+
| e107 website system
|
| <20>Steve Dunstan 2001-2002
| <20>Steve Dunstan 2001-2002
| http://e107.org
| jalist@e107.org
|
@@ -11,16 +11,16 @@
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_admin/includes/categories.php,v $
| $Revision: 1.7 $
| $Date: 2009-11-01 20:41:34 $
| $Author: e107steved $
| $Revision: 1.8 $
| $Date: 2009-11-05 09:15:12 $
| $Author: e107coders $
+----------------------------------------------------------------------------+
*/
if (!defined('e107_INIT')) { exit; }
require_once(e_HANDLER."message_handler.php");
$emessage = &eMessage::getInstance();
$emessage = e107::getMessage();
$text = "<div style='text-align:center'>
<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');
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 = e107::getXml();
$xml->filter = array('@attributes' => FALSE,'administration' => FALSE); // .. and they're all going to need the same filter
if ($text_rend)

View File

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

View File

@@ -3,7 +3,7 @@
+ ----------------------------------------------------------------------------+
| e107 website system
|
| <20>Steve Dunstan 2001-2002
| <20>Steve Dunstan 2001-2002
| http://e107.org
| jalist@e107.org
|
@@ -11,9 +11,9 @@
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_admin/upload.php,v $
| $Revision: 1.9 $
| $Date: 2009-08-28 16:10:51 $
| $Author: marj_nl_fr $
| $Revision: 1.10 $
| $Date: 2009-11-05 09:15:12 $
| $Author: e107coders $
+----------------------------------------------------------------------------+
*/
require_once("../class2.php");
@@ -191,8 +191,7 @@ switch ($action)
$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)))
{
require_once(e_HANDLER.'xml_class.php');
$xml = new xmlClass;
$xml = e107::getXml();
$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);
if ($temp_vars === FALSE)

View File

@@ -1,7 +1,7 @@
<?php
/*
* 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
*/
@@ -97,8 +97,7 @@ class admin_shortcodes
{
if (is_readable('plugin.xml'))
{
require_once(e_HANDLER.'xml_class.php');
$xml = new xmlClass;
$xml = e107::getXml();
$xml->filter = array('folder' => FALSE, 'administration' => FALSE); // Just need one variable
$readFile = $xml->loadXMLfile('plugin.xml', true, true);
$eplug_icon = $readFile['folder'].'/'.$readFile['administration']['icon'];
@@ -552,8 +551,7 @@ class admin_shortcodes
/* SUBLINKS END */
// Plugin links menu
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 = e107::getXml();
$xml->filter = array('@attributes' => FALSE, 'administration' => FALSE); // .. and they're all going to need the same filter
$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
if ((strpos(e_SELF,'localhost') !== FALSE) || (strpos(e_SELF,'127.0.0.1') !== FALSE)) { return ''; }
require_once(e_HANDLER."xml_class.php");
$xml = new xmlClass;
$xml = e107::getXml();
require_once(e_HANDLER."magpie_rss.php");
$ftext = '';

View File

@@ -10,8 +10,8 @@
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_handlers/e_upgrade_class.php,v $
| $Revision: 1.1 $
| $Date: 2009-08-17 18:42:22 $
| $Revision: 1.2 $
| $Date: 2009-11-05 09:15:12 $
| $Author: e107coders $
+----------------------------------------------------------------------------+
*/
@@ -74,8 +74,7 @@ class e_upgrade
return;
}
require_once(e_HANDLER.'xml_class.php');
$xml = new xmlClass;
$xml = e107::getXml();
$feed = $this->getOption('releaseUrl');
if(substr($feed,-4) == ".php")
@@ -125,6 +124,8 @@ class e_upgrade
}
function checkAllPlugins()
{
global $pref;
@@ -149,7 +150,12 @@ class e_upgrade
$options = array('curFolder' => $curTheme, 'curVersion' => $curVersion, 'releaseUrl' => $curUrl);
$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).
|
| $Source: /cvs_backup/e107_0.8/e107_handlers/login.php,v $
| $Revision: 1.27 $
| $Date: 2009-11-05 08:07:48 $
| $Revision: 1.28 $
| $Date: 2009-11-05 09:15:12 $
| $Author: e107coders $
+----------------------------------------------------------------------------+
*/
@@ -416,8 +416,7 @@ class userlogin
$user_id = intval($user_id); // Should already be an integer - but just in case...
if($user_xup)
{
require_once(e_HANDLER.'xml_class.php');
$xml = new xmlClass;
$xml = e107::getXml();
$xupData = array();
if($rawData = $xml -> getRemoteFile($user_xup))
{

View File

@@ -11,9 +11,9 @@
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_handlers/plugin_class.php,v $
| $Revision: 1.111 $
| $Date: 2009-11-04 21:59:35 $
| $Author: secretr $
| $Revision: 1.112 $
| $Date: 2009-11-05 09:15:12 $
| $Author: e107coders $
+----------------------------------------------------------------------------+
*/
@@ -2033,8 +2033,8 @@ class e107plugin
$tp = e107::getParser();
// loadLanFiles($plugName, 'admin'); // Look for LAN files on default paths
require_once(e_HANDLER.'xml_class.php');
$xml = new xmlClass;
$xml = e107::getXml();
// $xml->setOptArrayTags('extendedField,userclass,menuLink,commentID'); // always arrays for these tags.
// $xml->setOptStringTags('install,uninstall,upgrade');

View File

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

View File

@@ -9,9 +9,9 @@
* File Upload Handler
*
* $Source: /cvs_backup/e107_0.8/e107_handlers/upload_handler.php,v $
* $Revision: 1.21 $
* $Date: 2009-10-16 21:15:56 $
* $Author: secretr $
* $Revision: 1.22 $
* $Date: 2009-11-05 09:15:12 $
* $Author: e107coders $
*/
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))
{
require_once (e_HANDLER.'xml_class.php');
$xml = new xmlClass;
$xml = e107::getXml();
$temp_vars = $xml->loadXMLfile(e_ADMIN.$def_file, true, false);
if ($temp_vars === FALSE)
{

View File

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

View File

@@ -9,8 +9,8 @@
* Installation file
*
* $Source: /cvs_backup/e107_0.8/install_.php,v $
* $Revision: 1.47 $
* $Date: 2009-11-03 01:17:25 $
* $Revision: 1.48 $
* $Date: 2009-11-05 09:15:12 $
* $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");
//Create default plugin-table entries.
// e107::getConfig('core')->clearPrefCache();
e107::getSingleton('e107plugin')->update_plugins_table();
// 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.
$tm = e107::getSingleton('themeHandler');
$tm->noLog = TRUE;
$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.
@@ -1029,7 +1034,7 @@ class e_install
$this->previous_steps['prefs']['cookie_name'] = substr($cookiename,0,5)."cookie";
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.
$ip = $_SERVER['REMOTE_ADDR'];
@@ -1153,8 +1158,8 @@ class e_install
$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');
return (is_array($xmlArray)) ? $xmlArray : FALSE;
}

View File

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