mirror of
https://github.com/e107inc/e107.git
synced 2025-08-01 20:30:39 +02:00
globals fix
This commit is contained in:
@@ -57,7 +57,8 @@ class themeHandler
|
|||||||
function themeHandler()
|
function themeHandler()
|
||||||
{
|
{
|
||||||
|
|
||||||
global $emessage,$e107cache,$pref;
|
global $e107cache,$pref;
|
||||||
|
$mes = e107::getMessage();
|
||||||
|
|
||||||
require_once (e_HANDLER."form_handler.php");
|
require_once (e_HANDLER."form_handler.php");
|
||||||
//enable inner tabindex counter
|
//enable inner tabindex counter
|
||||||
@@ -129,7 +130,7 @@ class themeHandler
|
|||||||
|
|
||||||
$eplug = new e107plugin;
|
$eplug = new e107plugin;
|
||||||
$message = $eplug->install_plugin($key);
|
$message = $eplug->install_plugin($key);
|
||||||
$emessage->add($message, E_MESSAGE_SUCCESS);
|
$mes->add($message, E_MESSAGE_SUCCESS);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(isset($_POST['setMenuPreset']))
|
if(isset($_POST['setMenuPreset']))
|
||||||
@@ -153,7 +154,7 @@ class themeHandler
|
|||||||
$message .= MENLAN_14." ".$k." : ".implode(", ", $v)."<br />";
|
$message .= MENLAN_14." ".$k." : ".implode(", ", $v)."<br />";
|
||||||
}
|
}
|
||||||
|
|
||||||
$emessage->add(MENLAN_43." : ".$key."<br />".$message, E_MESSAGE_SUCCESS);
|
$mes->add(MENLAN_43." : ".$key."<br />".$message, E_MESSAGE_SUCCESS);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -317,12 +318,15 @@ class themeHandler
|
|||||||
{
|
{
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
global $ns,$emessage;
|
|
||||||
|
$mes = e107::getMessage();
|
||||||
|
$ns = e107::getRender();
|
||||||
|
|
||||||
extract($_FILES);
|
extract($_FILES);
|
||||||
if(!is_writable(e_THEME))
|
if(!is_writable(e_THEME))
|
||||||
{
|
{
|
||||||
// $ns->tablerender(TPVLAN_16, TPVLAN_20);
|
// $ns->tablerender(TPVLAN_16, TPVLAN_20);
|
||||||
$emessage->add(TPVLAN_20, E_MESSAGE_INFO);
|
$mes->add(TPVLAN_20, E_MESSAGE_INFO);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -343,7 +347,7 @@ class themeHandler
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$emessage->add(TPVLAN_17, E_MESSAGE_ERROR);
|
$mes->add(TPVLAN_17, E_MESSAGE_ERROR);
|
||||||
// $ns->tablerender(TPVLAN_16, TPVLAN_17);
|
// $ns->tablerender(TPVLAN_16, TPVLAN_17);
|
||||||
// require_once("footer.php");
|
// require_once("footer.php");
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@@ -380,13 +384,13 @@ class themeHandler
|
|||||||
$error = TPVLAN_47.PclErrorString().", ".TPVLAN_48.intval(PclErrorCode());
|
$error = TPVLAN_47.PclErrorString().", ".TPVLAN_48.intval(PclErrorCode());
|
||||||
}
|
}
|
||||||
|
|
||||||
$emessage->add(TPVLAN_18." ".$archiveName." ".$error, E_MESSAGE_ERROR);
|
$mes->add(TPVLAN_18." ".$archiveName." ".$error, E_MESSAGE_ERROR);
|
||||||
// $ns->tablerender(TPVLAN_16, TPVLAN_18." ".$archiveName." ".$error);
|
// $ns->tablerender(TPVLAN_16, TPVLAN_18." ".$archiveName." ".$error);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
$folderName = substr($fileList[0]['stored_filename'], 0, (strpos($fileList[0]['stored_filename'], "/")));
|
$folderName = substr($fileList[0]['stored_filename'], 0, (strpos($fileList[0]['stored_filename'], "/")));
|
||||||
$emessage->add(TPVLAN_19, E_MESSAGE_SUCCESS);
|
$mes->add(TPVLAN_19, E_MESSAGE_SUCCESS);
|
||||||
|
|
||||||
if(varset($_POST['setUploadTheme']))
|
if(varset($_POST['setUploadTheme']))
|
||||||
{
|
{
|
||||||
@@ -405,7 +409,9 @@ class themeHandler
|
|||||||
|
|
||||||
function showThemes($mode = 'main')
|
function showThemes($mode = 'main')
|
||||||
{
|
{
|
||||||
global $ns,$pref,$emessage;
|
global $pref;
|
||||||
|
$mes = e107::getMessage();
|
||||||
|
$ns = e107::getRender();
|
||||||
|
|
||||||
echo "<div>
|
echo "<div>
|
||||||
<form enctype='multipart/form-data' method='post' action='".e_SELF."?".$mode."'>\n";
|
<form enctype='multipart/form-data' method='post' action='".e_SELF."?".$mode."'>\n";
|
||||||
@@ -421,7 +427,7 @@ class themeHandler
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$ns->tablerender(TPVLAN_26." :: ".TPVLAN_33, $emessage->render().$text);
|
$ns->tablerender(TPVLAN_26." :: ".TPVLAN_33, $mes->render().$text);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Show Admin Configuration
|
// Show Admin Configuration
|
||||||
@@ -435,7 +441,7 @@ class themeHandler
|
|||||||
$text = $this->renderTheme(2, $theme);
|
$text = $this->renderTheme(2, $theme);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$ns->tablerender(TPVLAN_26." :: ".TPVLAN_34, $emessage->render().$text);
|
$ns->tablerender(TPVLAN_26." :: ".TPVLAN_34, $mes->render().$text);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Show Upload Form
|
// Show Upload Form
|
||||||
@@ -453,7 +459,7 @@ class themeHandler
|
|||||||
$text .= $this->renderTheme(FALSE, $theme);
|
$text .= $this->renderTheme(FALSE, $theme);
|
||||||
}
|
}
|
||||||
$text .= "<div class='clear'> </div>";
|
$text .= "<div class='clear'> </div>";
|
||||||
$ns->tablerender(TPVLAN_26." :: ".TPVLAN_39, $emessage->render().$text);
|
$ns->tablerender(TPVLAN_26." :: ".TPVLAN_39, $mes->render().$text);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -463,7 +469,9 @@ class themeHandler
|
|||||||
|
|
||||||
function renderUploadForm()
|
function renderUploadForm()
|
||||||
{
|
{
|
||||||
global $sql,$ns,$emessage;
|
$mes = e107::getMessage();
|
||||||
|
$ns = e107::getRender();
|
||||||
|
$sql = e107::getDb();
|
||||||
|
|
||||||
if(!is_writable(e_THEME))
|
if(!is_writable(e_THEME))
|
||||||
{
|
{
|
||||||
@@ -476,7 +484,6 @@ class themeHandler
|
|||||||
$max_file_size = get_user_max_upload();
|
$max_file_size = get_user_max_upload();
|
||||||
|
|
||||||
$text = "
|
$text = "
|
||||||
<div style='text-align:center'>
|
|
||||||
<table class='table adminform'>
|
<table class='table adminform'>
|
||||||
<colgroup>
|
<colgroup>
|
||||||
<col class='col-label' />
|
<col class='col-label' />
|
||||||
@@ -503,10 +510,10 @@ class themeHandler
|
|||||||
|
|
||||||
$text .= "
|
$text .= "
|
||||||
</div>
|
</div>
|
||||||
</div>\n";
|
\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
$ns->tablerender(TPVLAN_26." :: ".TPVLAN_38, $emessage->render().$text);
|
$ns->tablerender(TPVLAN_26." :: ".TPVLAN_38, $mes->render().$text);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -956,14 +963,14 @@ class themeHandler
|
|||||||
{
|
{
|
||||||
$mainid = "selectmain[".$theme['id']."]";
|
$mainid = "selectmain[".$theme['id']."]";
|
||||||
$text .= $this->frm->admin_button('submit_adminstyle', TPVLAN_35, 'update');
|
$text .= $this->frm->admin_button('submit_adminstyle', TPVLAN_35, 'update');
|
||||||
$text .= $this->frm->admin_button($mainid, TPVLAN_10, 'submit');
|
$text .= $this->frm->admin_button($mainid, TPVLAN_10, 'other');
|
||||||
|
|
||||||
}
|
}
|
||||||
else // main
|
else // main
|
||||||
{
|
{
|
||||||
$adminid = "selectadmin[".$theme['id']."]";
|
$adminid = "selectadmin[".$theme['id']."]";
|
||||||
$text .= $this->frm->admin_button('submit_style', TPVLAN_35, 'update');
|
$text .= $this->frm->admin_button('submit_style', TPVLAN_35, 'update');
|
||||||
$text .= $this->frm->admin_button($adminid, TPVLAN_32, 'submit');
|
$text .= $this->frm->admin_button($adminid, TPVLAN_32, 'other');
|
||||||
}
|
}
|
||||||
|
|
||||||
$text .= "<input type='hidden' name='curTheme' value='".$theme['path']."' />";
|
$text .= "<input type='hidden' name='curTheme' value='".$theme['path']."' />";
|
||||||
@@ -1053,7 +1060,7 @@ class themeHandler
|
|||||||
{
|
{
|
||||||
$core = e107::getConfig('core');
|
$core = e107::getConfig('core');
|
||||||
$sql = e107::getDb();
|
$sql = e107::getDb();
|
||||||
$emessage = eMessage::getInstance();
|
$mes = e107::getMessage();
|
||||||
|
|
||||||
$themeArray = $this->getThemes("id");
|
$themeArray = $this->getThemes("id");
|
||||||
|
|
||||||
@@ -1078,16 +1085,16 @@ class themeHandler
|
|||||||
if($core->save())
|
if($core->save())
|
||||||
{
|
{
|
||||||
//TODO LANs
|
//TODO LANs
|
||||||
$emessage->add(TPVLAN_3." <b>'".$name." v".$version."'</b>", E_MESSAGE_SUCCESS);
|
$mes->add(TPVLAN_3." <b>'".$name." v".$version."'</b>", E_MESSAGE_SUCCESS);
|
||||||
$emessage->add("Default Layout: ".$deflayout, E_MESSAGE_SUCCESS);
|
$mes->add("Default Layout: ".$deflayout, E_MESSAGE_SUCCESS);
|
||||||
$emessage->add("Custom Pages: ".implode(" ",$customPages), E_MESSAGE_SUCCESS);
|
$mes->add("Custom Pages: ".implode(" ",$customPages), E_MESSAGE_SUCCESS);
|
||||||
|
|
||||||
$this->theme_adminlog('01', $name.', style.css');
|
$this->theme_adminlog('01', $name.', style.css');
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$emessage->add(TPVLAN_3." <b>'".$name."'</b>", E_MESSAGE_ERROR);
|
$mes->add(TPVLAN_3." <b>'".$name."'</b>", E_MESSAGE_ERROR);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1126,7 +1133,11 @@ class themeHandler
|
|||||||
|
|
||||||
function setAdminTheme()
|
function setAdminTheme()
|
||||||
{
|
{
|
||||||
global $pref,$e107cache,$ns,$emessage;
|
global $pref,$e107cache;
|
||||||
|
|
||||||
|
$ns = e107::getRender();
|
||||||
|
$mes = e107::getMessage();
|
||||||
|
|
||||||
$themeArray = $this->getThemes("id");
|
$themeArray = $this->getThemes("id");
|
||||||
$pref['admintheme'] = $themeArray[$this->id];
|
$pref['admintheme'] = $themeArray[$this->id];
|
||||||
$pref['admincss'] = file_exists(e_THEME.$pref['admintheme'].'/admin_style.css') ? 'admin_style.css' : 'style.css';
|
$pref['admincss'] = file_exists(e_THEME.$pref['admintheme'].'/admin_style.css') ? 'admin_style.css' : 'style.css';
|
||||||
@@ -1134,7 +1145,7 @@ class themeHandler
|
|||||||
if(save_prefs())
|
if(save_prefs())
|
||||||
{
|
{
|
||||||
// Default Message
|
// Default Message
|
||||||
$emessage->add(TPVLAN_40." <b>'".$themeArray[$this->id]."'</b>", E_MESSAGE_SUCCESS);
|
$mes->add(TPVLAN_40." <b>'".$themeArray[$this->id]."'</b>", E_MESSAGE_SUCCESS);
|
||||||
$this->theme_adminlog('02', $pref['admintheme'].', '.$pref['admincss']);
|
$this->theme_adminlog('02', $pref['admintheme'].', '.$pref['admincss']);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1144,7 +1155,11 @@ class themeHandler
|
|||||||
|
|
||||||
function setStyle()
|
function setStyle()
|
||||||
{
|
{
|
||||||
global $pref,$e107cache,$ns,$sql,$emessage;
|
global $pref,$e107cache;
|
||||||
|
$sql = e107::getDb();
|
||||||
|
$ns = e107::getRender();
|
||||||
|
$mes = e107::getMessage();
|
||||||
|
|
||||||
//TODO adminlog
|
//TODO adminlog
|
||||||
e107::getConfig()->setPosted('themecss', $_POST['themecss'])->setPosted('image_preload', $_POST['image_preload'])->setPosted('sitetheme_deflayout',
|
e107::getConfig()->setPosted('themecss', $_POST['themecss'])->setPosted('image_preload', $_POST['image_preload'])->setPosted('sitetheme_deflayout',
|
||||||
$_POST['layout_default']);
|
$_POST['layout_default']);
|
||||||
@@ -1152,26 +1167,29 @@ class themeHandler
|
|||||||
$msg = $this->setThemeConfig();
|
$msg = $this->setThemeConfig();
|
||||||
if($msg)
|
if($msg)
|
||||||
{
|
{
|
||||||
$emessage->add(TPVLAN_37, E_MESSAGE_SUCCESS);
|
$mes->add(TPVLAN_37, E_MESSAGE_SUCCESS);
|
||||||
if(is_array($msg))
|
if(is_array($msg))
|
||||||
$emessage->add($msg[0], $msg[1]);
|
$mes->add($msg[0], $msg[1]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function setAdminStyle()
|
function setAdminStyle()
|
||||||
{
|
{
|
||||||
global $pref,$e107cache,$ns,$emessage;
|
global $pref,$e107cache;
|
||||||
|
|
||||||
|
$ns = e107::getRender();
|
||||||
|
$mes = e107::getMessage();
|
||||||
/*$pref['admincss'] = $_POST['admincss'];
|
/*$pref['admincss'] = $_POST['admincss'];
|
||||||
$pref['adminstyle'] = $_POST['adminstyle'];
|
$pref['adminstyle'] = $_POST['adminstyle'];
|
||||||
$e107cache->clear_sys();
|
$e107cache->clear_sys();
|
||||||
if(save_prefs())
|
if(save_prefs())
|
||||||
{
|
{
|
||||||
$emessage->add(TPVLAN_43, E_MESSAGE_SUCCESS);
|
$mes->add(TPVLAN_43, E_MESSAGE_SUCCESS);
|
||||||
$this->theme_adminlog('04',$pref['adminstyle'].', '.$pref['admincss']);
|
$this->theme_adminlog('04',$pref['adminstyle'].', '.$pref['admincss']);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$emessage->add(TPVLAN_43, E_MESSAGE_ERROR);
|
$mes->add(TPVLAN_43, E_MESSAGE_ERROR);
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user