1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-03 13:17:24 +02:00

#318 - Theme manager - upload theme, partial fix. Not completely fixed yet.

This commit is contained in:
Moc
2013-06-13 16:03:45 +02:00
parent 8ea6ceca60
commit dc2511c9c6

View File

@@ -2,16 +2,12 @@
/* /*
* e107 website system * e107 website system
* *
* Copyright (C) 2008-2009 e107 Inc (e107.org) * Copyright (C) 2008-2013 e107 Inc (e107.org)
* Released under the terms and conditions of the * Released under the terms and conditions of the
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt) * GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
* *
* e107 Admin Theme Handler * e107 Admin Theme Handler
* *
* $Source: /cvs_backup/e107_0.8/e107_handlers/theme_handler.php,v $
* $Revision$
* $Date$
* $Author$
*/ */
if(!defined('e107_INIT')) if(!defined('e107_INIT'))
@@ -19,15 +15,7 @@ if(!defined('e107_INIT'))
exit; exit;
} }
/**
* Base e107 Admin Theme Handler
*
* @package e107
* @category e107_handlers
* @version 1.0
* @author Cameron
* @copyright Copyright (c) 2009, e107 Inc.
*/
class themeHandler class themeHandler
{ {
@@ -343,16 +331,16 @@ class themeHandler
extract($_FILES); extract($_FILES);
if(!is_writable(e_THEME)) if(!is_writable(e_THEME))
{ {
// $ns->tablerender(TPVLAN_16, TPVLAN_20); $mes->addInfo(TPVLAN_20);
$mes->add(TPVLAN_20, E_MESSAGE_INFO);
return FALSE; return FALSE;
} }
else else
{ {
// FIXME - upload seems to unfunctional - needs further testing and fixing
require_once (e_HANDLER."upload_handler.php"); require_once (e_HANDLER."upload_handler.php");
$fileName = $file_userfile['name'][0]; $fileName = $file_userfile['name'][0]; // $_FILES['file_userfile']['name'][0] ?
$fileSize = $file_userfile['size'][0]; $fileSize = $file_userfile['size'][0];
$fileType = $file_userfile['type'][0]; $fileType = $file_userfile['type'][0]; // type is returned as mime type (application/octet-stream) not as zip/rar
if(strstr($file_userfile['type'][0], "gzip")) if(strstr($file_userfile['type'][0], "gzip"))
{ {
@@ -365,9 +353,8 @@ class themeHandler
} }
else else
{ {
$mes->add(TPVLAN_17, E_MESSAGE_ERROR);
// $ns->tablerender(TPVLAN_16, TPVLAN_17); $mes->addError(TPVLAN_17);;
// require_once("footer.php");
return FALSE; return FALSE;
} }
@@ -739,6 +726,7 @@ class themeHandler
$mes = e107::getMessage(); $mes = e107::getMessage();
$ns = e107::getRender(); $ns = e107::getRender();
$sql = e107::getDb(); $sql = e107::getDb();
$frm = e107::getForm();
if(!is_writable(e_THEME)) if(!is_writable(e_THEME))
{ {
@@ -747,10 +735,11 @@ class themeHandler
} }
else else
{ {
require_once (e_HANDLER.'upload_handler.php'); require_once(e_HANDLER.'upload_handler.php');
$max_file_size = get_user_max_upload(); $max_file_size = get_user_max_upload();
$text = " $text = "
<form enctype='multipart/form-data' action='".e_SELF."' method='post'>
<table class='table adminform'> <table class='table adminform'>
<colgroup> <colgroup>
<col class='col-label' /> <col class='col-label' />
@@ -766,18 +755,13 @@ class themeHandler
</tr> </tr>
<tr> <tr>
<td>".TPVLAN_10."</td> <td>".TPVLAN_10."</td>
<td> <td><input type='checkbox' name='setUploadTheme' value='1' /></td>
<input type='checkbox' name='setUploadTheme' value='1' />
</td>
</tr> </tr>
</table> </table>
<div class='buttons-bar center'>";
$text .= $this->frm->admin_button('upload', TPVLAN_14, 'submit'); <div class='buttons-bar center'>".$frm->admin_button('upload', TPVLAN_14, 'submit')."</div>
</form>
$text .= " ";
</div>
\n";
} }
$ns->tablerender(TPVLAN_26.SEP.TPVLAN_38, $mes->render().$text); $ns->tablerender(TPVLAN_26.SEP.TPVLAN_38, $mes->render().$text);