mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-02 01:52:10 +09:00
issue 2119. supporting php 5.4. admin module.
git-svn-id: http://xe-core.googlecode.com/svn/branches/maserati@12711 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
fa75bf0981
commit
3df6b3ecd7
4 changed files with 543 additions and 374 deletions
|
|
@ -1,4 +1,5 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* adminAdminController class
|
||||
* admin controller class of admin module
|
||||
|
|
@ -8,6 +9,7 @@
|
|||
*/
|
||||
class adminAdminController extends admin
|
||||
{
|
||||
|
||||
/**
|
||||
* initialization
|
||||
* @return void
|
||||
|
|
@ -15,9 +17,12 @@ class adminAdminController extends admin
|
|||
function init()
|
||||
{
|
||||
// forbit access if the user is not an administrator
|
||||
$oMemberModel = &getModel('member');
|
||||
$oMemberModel = getModel('member');
|
||||
$logged_info = $oMemberModel->getLoggedInfo();
|
||||
if($logged_info->is_admin!='Y') return $this->stop("msg_is_not_administrator");
|
||||
if($logged_info->is_admin != 'Y')
|
||||
{
|
||||
return $this->stop("msg_is_not_administrator");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -27,11 +32,17 @@ class adminAdminController extends admin
|
|||
function procAdminMenuReset()
|
||||
{
|
||||
$menuSrl = Context::get('menu_srl');
|
||||
if (!$menuSrl) return $this->stop('msg_invalid_request');
|
||||
if(!$menuSrl)
|
||||
{
|
||||
return $this->stop('msg_invalid_request');
|
||||
}
|
||||
|
||||
$oMenuAdminController = &getAdminController('menu');
|
||||
$oMenuAdminController = getAdminController('menu');
|
||||
$output = $oMenuAdminController->deleteMenu($menuSrl);
|
||||
if(!$output->toBool()) return $output;
|
||||
if(!$output->toBool())
|
||||
{
|
||||
return $output;
|
||||
}
|
||||
|
||||
FileHandler::removeDir('./files/cache/menu/admin_lang/');
|
||||
|
||||
|
|
@ -45,30 +56,33 @@ class adminAdminController extends admin
|
|||
function procAdminRecompileCacheFile()
|
||||
{
|
||||
// rename cache dir
|
||||
$temp_cache_dir = './files/cache_'. time();
|
||||
$temp_cache_dir = './files/cache_' . time();
|
||||
FileHandler::rename('./files/cache', $temp_cache_dir);
|
||||
FileHandler::makeDir('./files/cache');
|
||||
|
||||
// remove debug files
|
||||
FileHandler::removeFile(_XE_PATH_.'files/_debug_message.php');
|
||||
FileHandler::removeFile(_XE_PATH_.'files/_debug_db_query.php');
|
||||
FileHandler::removeFile(_XE_PATH_.'files/_db_slow_query.php');
|
||||
FileHandler::removeFile(_XE_PATH_ . 'files/_debug_message.php');
|
||||
FileHandler::removeFile(_XE_PATH_ . 'files/_debug_db_query.php');
|
||||
FileHandler::removeFile(_XE_PATH_ . 'files/_db_slow_query.php');
|
||||
|
||||
$oModuleModel = &getModel('module');
|
||||
$oModuleModel = getModel('module');
|
||||
$module_list = $oModuleModel->getModuleList();
|
||||
|
||||
// call recompileCache for each module
|
||||
foreach($module_list as $module)
|
||||
{
|
||||
$oModule = null;
|
||||
$oModule = &getClass($module->module);
|
||||
if(method_exists($oModule, 'recompileCache')) $oModule->recompileCache();
|
||||
$oModule = NULL;
|
||||
$oModule = getClass($module->module);
|
||||
if(method_exists($oModule, 'recompileCache'))
|
||||
{
|
||||
$oModule->recompileCache();
|
||||
}
|
||||
}
|
||||
|
||||
// remove cache
|
||||
$truncated = array();
|
||||
$oObjectCacheHandler = &CacheHandler::getInstance('object');
|
||||
$oTemplateCacheHandler = &CacheHandler::getInstance('template');
|
||||
$oObjectCacheHandler = CacheHandler::getInstance('object');
|
||||
$oTemplateCacheHandler = CacheHandler::getInstance('template');
|
||||
|
||||
if($oObjectCacheHandler->isSupport())
|
||||
{
|
||||
|
|
@ -80,26 +94,29 @@ class adminAdminController extends admin
|
|||
$truncated[] = $oTemplateCacheHandler->truncate();
|
||||
}
|
||||
|
||||
if(count($truncated) && in_array(false,$truncated))
|
||||
if(count($truncated) && in_array(FALSE, $truncated))
|
||||
{
|
||||
return new Object(-1,'msg_self_restart_cache_engine');
|
||||
return new Object(-1, 'msg_self_restart_cache_engine');
|
||||
}
|
||||
|
||||
// remove cache dir
|
||||
$tmp_cache_list = FileHandler::readDir('./files','/(^cache_[0-9]+)/');
|
||||
$tmp_cache_list = FileHandler::readDir('./files', '/(^cache_[0-9]+)/');
|
||||
if($tmp_cache_list)
|
||||
{
|
||||
foreach($tmp_cache_list as $tmp_dir)
|
||||
{
|
||||
if($tmp_dir) FileHandler::removeDir('./files/'.$tmp_dir);
|
||||
if($tmp_dir)
|
||||
{
|
||||
FileHandler::removeDir('./files/' . $tmp_dir);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// remove duplicate indexes (only for CUBRID)
|
||||
$db_type = &Context::getDBType();
|
||||
$db_type = Context::getDBType();
|
||||
if($db_type == 'cubrid')
|
||||
{
|
||||
$db = &DB::getInstance();
|
||||
$db = DB::getInstance();
|
||||
$db->deleteDuplicateIndexes();
|
||||
}
|
||||
$this->setMessage('success_updated');
|
||||
|
|
@ -111,13 +128,12 @@ class adminAdminController extends admin
|
|||
*/
|
||||
function procAdminLogout()
|
||||
{
|
||||
$oMemberController = &getController('member');
|
||||
$oMemberController = getController('member');
|
||||
$oMemberController->procMemberLogout();
|
||||
|
||||
header('Location: '.getNotEncodedUrl('', 'module','admin'));
|
||||
header('Location: ' . getNotEncodedUrl('', 'module', 'admin'));
|
||||
}
|
||||
|
||||
|
||||
public function procAdminInsertDefaultDesignInfo()
|
||||
{
|
||||
$vars = Context::getRequestVars();
|
||||
|
|
@ -133,7 +149,7 @@ class adminAdminController extends admin
|
|||
|
||||
public function updateDefaultDesignInfo($vars)
|
||||
{
|
||||
$siteDesignPath = _XE_PATH_.'files/site_design/';
|
||||
$siteDesignPath = _XE_PATH_ . 'files/site_design/';
|
||||
|
||||
$vars->module_skin = json_decode($vars->module_skin);
|
||||
|
||||
|
|
@ -142,7 +158,7 @@ class adminAdminController extends admin
|
|||
FileHandler::makeDir($siteDesignPath);
|
||||
}
|
||||
|
||||
$siteDesignFile = _XE_PATH_.'files/site_design/design_'.$vars->site_srl.'.php';
|
||||
$siteDesignFile = _XE_PATH_ . 'files/site_design/design_' . $vars->site_srl . '.php';
|
||||
|
||||
$layoutTarget = 'layout_srl';
|
||||
$skinTarget = 'skin';
|
||||
|
|
@ -182,28 +198,28 @@ class adminAdminController extends admin
|
|||
{
|
||||
if($designInfo->layout_srl)
|
||||
{
|
||||
$buff .= sprintf('$designInfo->layout_srl = %s; ', $designInfo->layout_srl)."\n";
|
||||
$buff .= sprintf('$designInfo->layout_srl = %s; ', $designInfo->layout_srl) . "\n";
|
||||
}
|
||||
|
||||
if($designInfo->mlayout_srl)
|
||||
{
|
||||
$buff .= sprintf('$designInfo->mlayout_srl = %s;', $designInfo->mlayout_srl)."\n";
|
||||
$buff .= sprintf('$designInfo->mlayout_srl = %s;', $designInfo->mlayout_srl) . "\n";
|
||||
}
|
||||
|
||||
$buff .= '$designInfo->module = new stdClass();'."\n";
|
||||
$buff .= '$designInfo->module = new stdClass();' . "\n";
|
||||
|
||||
foreach($designInfo->module as $moduleName => $skinInfo)
|
||||
{
|
||||
$buff .= sprintf('$designInfo->module->%s = new stdClass();', $moduleName)."\n";
|
||||
$buff .= sprintf('$designInfo->module->%s = new stdClass();', $moduleName) . "\n";
|
||||
foreach($skinInfo as $target => $skinName)
|
||||
{
|
||||
$buff .= sprintf('$designInfo->module->%s->%s = \'%s\';', $moduleName, $target, $skinName)."\n";
|
||||
$buff .= sprintf('$designInfo->module->%s->%s = \'%s\';', $moduleName, $target, $skinName) . "\n";
|
||||
}
|
||||
}
|
||||
|
||||
$buff = sprintf('<?php if(!defined("__ZBXE__")) exit();' . "\n" . 'if(!defined("__XE__")) exit();' ."\n" . '$designInfo = new stdClass();' . "\n" . '%s ?>', $buff);
|
||||
$buff = sprintf('<?php if(!defined("__ZBXE__")) exit();' . "\n" . 'if(!defined("__XE__")) exit();' . "\n" . '$designInfo = new stdClass();' . "\n" . '%s ?>', $buff);
|
||||
|
||||
$siteDesignFile = _XE_PATH_.'files/site_design/design_'.$site_srl.'.php';
|
||||
$siteDesignFile = _XE_PATH_ . 'files/site_design/design_' . $site_srl . '.php';
|
||||
FileHandler::writeFile($siteDesignFile, $buff);
|
||||
}
|
||||
|
||||
|
|
@ -217,9 +233,12 @@ class adminAdminController extends admin
|
|||
$moduleName = Context::get('module_name');
|
||||
|
||||
// check favorite exists
|
||||
$oModel = &getAdminModel('admin');
|
||||
$oModel = getAdminModel('admin');
|
||||
$output = $oModel->isExistsFavorite($siteSrl, $moduleName);
|
||||
if(!$output->toBool()) return $output;
|
||||
if(!$output->toBool())
|
||||
{
|
||||
return $output;
|
||||
}
|
||||
|
||||
// if exists, delete favorite
|
||||
if($output->get('result'))
|
||||
|
|
@ -235,7 +254,10 @@ class adminAdminController extends admin
|
|||
$result = 'on';
|
||||
}
|
||||
|
||||
if(!$output->toBool()) return $output;
|
||||
if(!$output->toBool())
|
||||
{
|
||||
return $output;
|
||||
}
|
||||
|
||||
$this->add('result', $result);
|
||||
|
||||
|
|
@ -280,6 +302,7 @@ class adminAdminController extends admin
|
|||
return new Object();
|
||||
}
|
||||
|
||||
$args = new stdClass();
|
||||
$args->admin_favorite_srls = $deleteTargets;
|
||||
$output = executeQuery('admin.deleteFavorites', $args);
|
||||
if(!$output->toBool())
|
||||
|
|
@ -297,10 +320,16 @@ class adminAdminController extends admin
|
|||
function procAdminEnviromentGatheringAgreement()
|
||||
{
|
||||
$isAgree = Context::get('is_agree');
|
||||
if($isAgree == 'true') $_SESSION['enviroment_gather'] = 'Y';
|
||||
else $_SESSION['enviroment_gather'] = 'N';
|
||||
if($isAgree == 'true')
|
||||
{
|
||||
$_SESSION['enviroment_gather'] = 'Y';
|
||||
}
|
||||
else
|
||||
{
|
||||
$_SESSION['enviroment_gather'] = 'N';
|
||||
}
|
||||
|
||||
$redirectUrl = getUrl('', 'module', 'admin');
|
||||
$redirectUrl = getNotEncodedUrl('', 'module', 'admin');
|
||||
$this->setRedirectUrl($redirectUrl);
|
||||
}
|
||||
|
||||
|
|
@ -313,9 +342,14 @@ class adminAdminController extends admin
|
|||
$adminTitle = Context::get('adminTitle');
|
||||
$file = $_FILES['adminLogo'];
|
||||
|
||||
$oModuleModel = &getModel('module');
|
||||
$oModuleModel = getModel('module');
|
||||
$oAdminConfig = $oModuleModel->getModuleConfig('admin');
|
||||
|
||||
if(!is_object($oAdminConfig))
|
||||
{
|
||||
$oAdminConfig = new stdClass();
|
||||
}
|
||||
|
||||
if($file['tmp_name'])
|
||||
{
|
||||
$target_path = 'files/attach/images/admin/';
|
||||
|
|
@ -323,21 +357,36 @@ class adminAdminController extends admin
|
|||
|
||||
// Get file information
|
||||
list($width, $height, $type, $attrs) = @getimagesize($file['tmp_name']);
|
||||
if($type == 3) $ext = 'png';
|
||||
elseif($type == 2) $ext = 'jpg';
|
||||
else $ext = 'gif';
|
||||
if($type == 3)
|
||||
{
|
||||
$ext = 'png';
|
||||
}
|
||||
elseif($type == 2)
|
||||
{
|
||||
$ext = 'jpg';
|
||||
}
|
||||
else
|
||||
{
|
||||
$ext = 'gif';
|
||||
}
|
||||
|
||||
$target_filename = sprintf('%s%s.%s.%s', $target_path, 'adminLogo', date('YmdHis'), $ext);
|
||||
@move_uploaded_file($file['tmp_name'], $target_filename);
|
||||
|
||||
$oAdminConfig->adminLogo = $target_filename;
|
||||
}
|
||||
if($adminTitle) $oAdminConfig->adminTitle = strip_tags($adminTitle);
|
||||
else unset($oAdminConfig->adminTitle);
|
||||
if($adminTitle)
|
||||
{
|
||||
$oAdminConfig->adminTitle = strip_tags($adminTitle);
|
||||
}
|
||||
else
|
||||
{
|
||||
unset($oAdminConfig->adminTitle);
|
||||
}
|
||||
|
||||
if($oAdminConfig)
|
||||
{
|
||||
$oModuleController = &getController('module');
|
||||
$oModuleController = getController('module');
|
||||
$oModuleController->insertModuleConfig('admin', $oAdminConfig);
|
||||
}
|
||||
|
||||
|
|
@ -353,13 +402,13 @@ class adminAdminController extends admin
|
|||
*/
|
||||
function procAdminDeleteLogo()
|
||||
{
|
||||
$oModuleModel = &getModel('module');
|
||||
$oModuleModel = getModel('module');
|
||||
$oAdminConfig = $oModuleModel->getModuleConfig('admin');
|
||||
|
||||
FileHandler::removeFile(_XE_PATH_.$oAdminConfig->adminLogo);
|
||||
FileHandler::removeFile(_XE_PATH_ . $oAdminConfig->adminLogo);
|
||||
unset($oAdminConfig->adminLogo);
|
||||
|
||||
$oModuleController = &getController('module');
|
||||
$oModuleController = getController('module');
|
||||
$oModuleController->insertModuleConfig('admin', $oAdminConfig);
|
||||
|
||||
$this->setMessage('success_deleted', 'info');
|
||||
|
|
@ -401,7 +450,7 @@ class adminAdminController extends admin
|
|||
*/
|
||||
function _deleteAllFavorite()
|
||||
{
|
||||
$args = null;
|
||||
$args = NULL;
|
||||
$output = executeQuery('admin.deleteAllFavorite', $args);
|
||||
return $output;
|
||||
}
|
||||
|
|
@ -410,19 +459,21 @@ class adminAdminController extends admin
|
|||
* Remove admin icon
|
||||
* @return object|void
|
||||
*/
|
||||
function procAdminRemoveIcons(){
|
||||
function procAdminRemoveIcons()
|
||||
{
|
||||
$iconname = Context::get('iconname');
|
||||
$file_exist = FileHandler::readFile(_XE_PATH_.'files/attach/xeicon/'.$iconname);
|
||||
$file_exist = FileHandler::readFile(_XE_PATH_ . 'files/attach/xeicon/' . $iconname);
|
||||
if($file_exist)
|
||||
{
|
||||
@FileHandler::removeFile(_XE_PATH_.'files/attach/xeicon/'.$iconname);
|
||||
@FileHandler::removeFile(_XE_PATH_ . 'files/attach/xeicon/' . $iconname);
|
||||
}
|
||||
else
|
||||
{
|
||||
return new Object(-1,'fail_to_delete');
|
||||
return new Object(-1, 'fail_to_delete');
|
||||
}
|
||||
$this->setMessage('success_deleted');
|
||||
}
|
||||
|
||||
}
|
||||
/* End of file admin.admin.controller.php */
|
||||
/* Location: ./modules/admin/admin.admin.controller.php */
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* adminAdminModel class
|
||||
* admin model class of admin module
|
||||
|
|
@ -8,11 +9,13 @@
|
|||
*/
|
||||
class adminAdminModel extends admin
|
||||
{
|
||||
|
||||
/**
|
||||
* Ftp root path
|
||||
* @var string
|
||||
*/
|
||||
var $pwd;
|
||||
|
||||
/**
|
||||
* Buffer for Admin GNB menu
|
||||
* @var string
|
||||
|
|
@ -24,7 +27,7 @@ class adminAdminModel extends admin
|
|||
*/
|
||||
function getSFTPPath()
|
||||
{
|
||||
$ftp_info = Context::getRequestVars();
|
||||
$ftp_info = Context::getRequestVars();
|
||||
|
||||
if(!$ftp_info->ftp_host)
|
||||
{
|
||||
|
|
@ -39,7 +42,7 @@ class adminAdminModel extends admin
|
|||
$connection = ssh2_connect($ftp_info->ftp_host, $ftp_info->ftp_port);
|
||||
if(!ssh2_auth_password($connection, $ftp_info->ftp_user, $ftp_info->ftp_password))
|
||||
{
|
||||
return new Object(-1,'msg_ftp_invalid_auth_info');
|
||||
return new Object(-1, 'msg_ftp_invalid_auth_info');
|
||||
}
|
||||
$sftp = ssh2_sftp($connection);
|
||||
|
||||
|
|
@ -121,7 +124,7 @@ class adminAdminModel extends admin
|
|||
{
|
||||
if(!function_exists(ssh2_sftp))
|
||||
{
|
||||
return new Object(-1,'disable_sftp_support');
|
||||
return new Object(-1, 'disable_sftp_support');
|
||||
}
|
||||
return $this->getSFTPPath();
|
||||
}
|
||||
|
|
@ -191,7 +194,7 @@ class adminAdminModel extends admin
|
|||
*/
|
||||
function getSFTPList()
|
||||
{
|
||||
$ftp_info = Context::getRequestVars();
|
||||
$ftp_info = Context::getRequestVars();
|
||||
if(!$ftp_info->ftp_host)
|
||||
{
|
||||
$ftp_info->ftp_host = "127.0.0.1";
|
||||
|
|
@ -199,17 +202,20 @@ class adminAdminModel extends admin
|
|||
$connection = ssh2_connect($ftp_info->ftp_host, $ftp_info->ftp_port);
|
||||
if(!ssh2_auth_password($connection, $ftp_info->ftp_user, $ftp_info->ftp_password))
|
||||
{
|
||||
return new Object(-1,'msg_ftp_invalid_auth_info');
|
||||
return new Object(-1, 'msg_ftp_invalid_auth_info');
|
||||
}
|
||||
|
||||
$sftp = ssh2_sftp($connection);
|
||||
$curpwd = "ssh2.sftp://$sftp".$this->pwd;
|
||||
$curpwd = "ssh2.sftp://$sftp" . $this->pwd;
|
||||
$dh = @opendir($curpwd);
|
||||
if(!$dh) return new Object(-1, 'msg_ftp_invalid_path');
|
||||
$list = array();
|
||||
while(($file = readdir($dh)) !== false)
|
||||
if(!$dh)
|
||||
{
|
||||
if(is_dir($curpwd.$file))
|
||||
return new Object(-1, 'msg_ftp_invalid_path');
|
||||
}
|
||||
$list = array();
|
||||
while(($file = readdir($dh)) !== FALSE)
|
||||
{
|
||||
if(is_dir($curpwd . $file))
|
||||
{
|
||||
$file .= "/";
|
||||
}
|
||||
|
|
@ -231,8 +237,8 @@ class adminAdminModel extends admin
|
|||
{
|
||||
Context::loadLang('./modules/autoinstall/lang');
|
||||
set_time_limit(5);
|
||||
require_once(_XE_PATH_.'libs/ftp.class.php');
|
||||
$ftp_info = Context::getRequestVars();
|
||||
require_once(_XE_PATH_ . 'libs/ftp.class.php');
|
||||
$ftp_info = Context::getRequestVars();
|
||||
if(!$ftp_info->ftp_user || !$ftp_info->ftp_password)
|
||||
{
|
||||
return new Object(-1, 'msg_ftp_invalid_auth_info');
|
||||
|
|
@ -245,7 +251,8 @@ class adminAdminModel extends admin
|
|||
$ftp_info->ftp_host = "127.0.0.1";
|
||||
}
|
||||
|
||||
if (!$ftp_info->ftp_port || !is_numeric ($ftp_info->ftp_port)) {
|
||||
if(!$ftp_info->ftp_port || !is_numeric($ftp_info->ftp_port))
|
||||
{
|
||||
$ftp_info->ftp_port = "21";
|
||||
}
|
||||
|
||||
|
|
@ -253,7 +260,7 @@ class adminAdminModel extends admin
|
|||
{
|
||||
if(!function_exists(ssh2_sftp))
|
||||
{
|
||||
return new Object(-1,'disable_sftp_support');
|
||||
return new Object(-1, 'disable_sftp_support');
|
||||
}
|
||||
return $this->getSFTPList();
|
||||
}
|
||||
|
|
@ -268,7 +275,7 @@ class adminAdminModel extends admin
|
|||
}
|
||||
else
|
||||
{
|
||||
return new Object(-1,'msg_ftp_invalid_auth_info');
|
||||
return new Object(-1, 'msg_ftp_invalid_auth_info');
|
||||
}
|
||||
}
|
||||
$list = array();
|
||||
|
|
@ -277,16 +284,19 @@ class adminAdminModel extends admin
|
|||
{
|
||||
foreach($_list as $k => $v)
|
||||
{
|
||||
$src = null;
|
||||
$src = new stdClass();
|
||||
$src->data = $v;
|
||||
$res = Context::convertEncoding($src);
|
||||
$v = $res->data;
|
||||
if(strpos($v,'d') === 0 || strpos($v, '<DIR>')) $list[] = substr(strrchr($v,' '),1) . '/';
|
||||
if(strpos($v, 'd') === 0 || strpos($v, '<DIR>'))
|
||||
{
|
||||
$list[] = substr(strrchr($v, ' '), 1) . '/';
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return new Object(-1,'msg_ftp_no_directory');
|
||||
return new Object(-1, 'msg_ftp_no_directory');
|
||||
}
|
||||
$this->add('list', $list);
|
||||
}
|
||||
|
|
@ -296,16 +306,16 @@ class adminAdminModel extends admin
|
|||
* @param string $type 'WORKING', 'INSTALL'
|
||||
* @return string
|
||||
*/
|
||||
function getEnv($type='WORKING')
|
||||
function getEnv($type = 'WORKING')
|
||||
{
|
||||
$skip = array(
|
||||
'ext' => array('pcre','json','hash','dom','session','spl','standard','date','ctype','tokenizer','apache2handler','filter','posix','reflection','pdo')
|
||||
,'module' => array('addon','admin','autoinstall', 'comment', 'communication', 'counter', 'document', 'editor', 'file', 'importer', 'install', 'integration_search', 'layout', 'member', 'menu', 'message', 'module', 'opage', 'page', 'point', 'poll', 'rss', 'session', 'spamfilter', 'tag', 'trackback', 'trash', 'widget')
|
||||
,'addon' => array('autolink', 'blogapi', 'captcha', 'counter', 'member_communication', 'member_extra_info', 'mobile', 'openid_delegation_id', 'point_level_icon', 'resize_image' )
|
||||
);
|
||||
'ext' => array('pcre', 'json', 'hash', 'dom', 'session', 'spl', 'standard', 'date', 'ctype', 'tokenizer', 'apache2handler', 'filter', 'posix', 'reflection', 'pdo')
|
||||
, 'module' => array('addon', 'admin', 'autoinstall', 'comment', 'communication', 'counter', 'document', 'editor', 'file', 'importer', 'install', 'integration_search', 'layout', 'member', 'menu', 'message', 'module', 'opage', 'page', 'point', 'poll', 'rss', 'session', 'spamfilter', 'tag', 'trackback', 'trash', 'widget')
|
||||
, 'addon' => array('autolink', 'blogapi', 'captcha', 'counter', 'member_communication', 'member_extra_info', 'mobile', 'openid_delegation_id', 'point_level_icon', 'resize_image')
|
||||
);
|
||||
|
||||
$info = array();
|
||||
$info['type'] = ($type !='INSTALL' ? 'WORKING' : 'INSTALL');
|
||||
$info['type'] = ($type != 'INSTALL' ? 'WORKING' : 'INSTALL');
|
||||
$info['location'] = _XE_LOCATION_;
|
||||
$info['package'] = _XE_PACKAGE_;
|
||||
$info['host'] = $db_type->default_url ? $db_type->default_url : getFullUrl();
|
||||
|
|
@ -316,42 +326,54 @@ class adminAdminModel extends admin
|
|||
$db_info = Context::getDBInfo();
|
||||
$info['db_type'] = Context::getDBType();
|
||||
$info['use_rewrite'] = $db_info->use_rewrite;
|
||||
$info['use_db_session'] = $db_info->use_db_session == 'Y' ?'Y':'N';
|
||||
$info['use_db_session'] = $db_info->use_db_session == 'Y' ? 'Y' : 'N';
|
||||
$info['use_ssl'] = $db_info->use_ssl;
|
||||
|
||||
$info['phpext'] = '';
|
||||
foreach (get_loaded_extensions() as $ext)
|
||||
foreach(get_loaded_extensions() as $ext)
|
||||
{
|
||||
$ext = strtolower($ext);
|
||||
if(in_array($ext, $skip['ext'])) continue;
|
||||
$info['phpext'] .= '|'. $ext;
|
||||
if(in_array($ext, $skip['ext']))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
$info['phpext'] .= '|' . $ext;
|
||||
}
|
||||
$info['phpext'] = substr($info['phpext'],1);
|
||||
$info['phpext'] = substr($info['phpext'], 1);
|
||||
|
||||
$info['module'] = '';
|
||||
$oModuleModel = &getModel('module');
|
||||
$oModuleModel = getModel('module');
|
||||
$module_list = $oModuleModel->getModuleList();
|
||||
foreach($module_list as $module)
|
||||
{
|
||||
if(in_array($module->module, $skip['module'])) continue;
|
||||
$info['module'] .= '|'.$module->module;
|
||||
if(in_array($module->module, $skip['module']))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
$info['module'] .= '|' . $module->module;
|
||||
}
|
||||
$info['module'] = substr($info['module'],1);
|
||||
$info['module'] = substr($info['module'], 1);
|
||||
|
||||
$info['addon'] = '';
|
||||
$oAddonAdminModel = &getAdminModel('addon');
|
||||
$oAddonAdminModel = getAdminModel('addon');
|
||||
$addon_list = $oAddonAdminModel->getAddonList();
|
||||
foreach($addon_list as $addon)
|
||||
{
|
||||
if(in_array($addon->addon, $skip['addon'])) continue;
|
||||
$info['addon'] .= '|'.$addon->addon;
|
||||
if(in_array($addon->addon, $skip['addon']))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
$info['addon'] .= '|' . $addon->addon;
|
||||
}
|
||||
$info['addon'] = substr($info['addon'],1);
|
||||
$info['addon'] = substr($info['addon'], 1);
|
||||
|
||||
$param = '';
|
||||
foreach($info as $k => $v)
|
||||
{
|
||||
if($v) $param .= sprintf('&%s=%s',$k,urlencode($v));
|
||||
if($v)
|
||||
{
|
||||
$param .= sprintf('&%s=%s', $k, urlencode($v));
|
||||
}
|
||||
}
|
||||
$param = substr($param, 1);
|
||||
|
||||
|
|
@ -364,7 +386,7 @@ class adminAdminModel extends admin
|
|||
*/
|
||||
function getThemeList()
|
||||
{
|
||||
$path = _XE_PATH_.'themes';
|
||||
$path = _XE_PATH_ . 'themes';
|
||||
$list = FileHandler::readDir($path);
|
||||
|
||||
$theme_info = array();
|
||||
|
|
@ -385,16 +407,25 @@ class adminAdminModel extends admin
|
|||
* @param array $layout_list
|
||||
* @return object
|
||||
*/
|
||||
function getThemeInfo($theme_name, $layout_list = null)
|
||||
function getThemeInfo($theme_name, $layout_list = NULL)
|
||||
{
|
||||
if ($GLOBALS['__ThemeInfo__'][$theme_name]) return $GLOBALS['__ThemeInfo__'][$theme_name];
|
||||
if($GLOBALS['__ThemeInfo__'][$theme_name])
|
||||
{
|
||||
return $GLOBALS['__ThemeInfo__'][$theme_name];
|
||||
}
|
||||
|
||||
$info_file = _XE_PATH_.'themes/'.$theme_name.'/conf/info.xml';
|
||||
if(!file_exists($info_file)) return;
|
||||
$info_file = _XE_PATH_ . 'themes/' . $theme_name . '/conf/info.xml';
|
||||
if(!file_exists($info_file))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
$oXmlParser = new XmlParser();
|
||||
$_xml_obj = $oXmlParser->loadXmlFile($info_file);
|
||||
if(!$_xml_obj->theme) return;
|
||||
if(!$_xml_obj->theme)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
$xml_obj = $_xml_obj->theme;
|
||||
|
||||
|
|
@ -402,17 +433,26 @@ class adminAdminModel extends admin
|
|||
$theme_info = new stdClass();
|
||||
$theme_info->name = $theme_name;
|
||||
$theme_info->title = $xml_obj->title->body;
|
||||
$thumbnail = './themes/'.$theme_name.'/thumbnail.png';
|
||||
$theme_info->thumbnail = (file_exists($thumbnail))?$thumbnail:null;
|
||||
$thumbnail = './themes/' . $theme_name . '/thumbnail.png';
|
||||
$theme_info->thumbnail = (file_exists($thumbnail)) ? $thumbnail : NULL;
|
||||
$theme_info->version = $xml_obj->version->body;
|
||||
$date_obj = new stdClass();
|
||||
sscanf($xml_obj->date->body, '%d-%d-%d', $date_obj->y, $date_obj->m, $date_obj->d);
|
||||
$theme_info->date = sprintf('%04d%02d%02d', $date_obj->y, $date_obj->m, $date_obj->d);
|
||||
$theme_info->description = $xml_obj->description->body;
|
||||
$theme_info->path = './themes/'.$theme_name.'/';
|
||||
$theme_info->path = './themes/' . $theme_name . '/';
|
||||
|
||||
if(!is_array($xml_obj->publisher)) $publisher_list[] = $xml_obj->publisher;
|
||||
else $publisher_list = $xml_obj->publisher;
|
||||
if(!is_array($xml_obj->publisher))
|
||||
{
|
||||
$publisher_list = array();
|
||||
$publisher_list[] = $xml_obj->publisher;
|
||||
}
|
||||
else
|
||||
{
|
||||
$publisher_list = $xml_obj->publisher;
|
||||
}
|
||||
|
||||
$theme_info->publisher = array();
|
||||
foreach($publisher_list as $publisher)
|
||||
{
|
||||
$publisher_obj = new stdClass();
|
||||
|
|
@ -424,28 +464,26 @@ class adminAdminModel extends admin
|
|||
|
||||
$layout = $xml_obj->layout;
|
||||
$layout_path = $layout->directory->attrs->path;
|
||||
$layout_parse = explode('/',$layout_path);
|
||||
$layout_parse = explode('/', $layout_path);
|
||||
$layout_info = new stdClass();
|
||||
switch($layout_parse[1])
|
||||
{
|
||||
case 'themes' :
|
||||
{
|
||||
$layout_info->name = $theme_name.'|@|'.$layout_parse[count($layout_parse)-1];
|
||||
$layout_info->name = $theme_name . '|@|' . $layout_parse[count($layout_parse) - 1];
|
||||
break;
|
||||
}
|
||||
|
||||
case 'layouts' :
|
||||
{
|
||||
$layout_info->name = $layout_parse[count($layout_parse)-1];
|
||||
break;
|
||||
}
|
||||
$layout_info->name = $layout_parse[count($layout_parse) - 1];
|
||||
break;
|
||||
|
||||
}
|
||||
$layout_info->title = $layout_parse[count($layout_parse)-1];
|
||||
$layout_info->title = $layout_parse[count($layout_parse) - 1];
|
||||
$layout_info->path = $layout_path;
|
||||
|
||||
$site_info = Context::get('site_module_info');
|
||||
// check layout instance
|
||||
$is_new_layout = true;
|
||||
$oLayoutModel = &getModel('layout');
|
||||
$is_new_layout = TRUE;
|
||||
$oLayoutModel = getModel('layout');
|
||||
$layout_info_list = array();
|
||||
$layout_list = $oLayoutModel->getLayoutList($site_info->site_srl);
|
||||
if($layout_list)
|
||||
|
|
@ -454,24 +492,24 @@ class adminAdminModel extends admin
|
|||
{
|
||||
if($val->layout == $layout_info->name)
|
||||
{
|
||||
$is_new_layout = false;
|
||||
$is_new_layout = FALSE;
|
||||
$layout_info->layout_srl = $val->layout_srl;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($is_new_layout)
|
||||
if($is_new_layout)
|
||||
{
|
||||
$site_module_info = Context::get('site_module_info');
|
||||
$args = new stdClass();
|
||||
$args->site_srl = (int)$site_module_info->site_srl;
|
||||
$args->site_srl = (int) $site_module_info->site_srl;
|
||||
$args->layout_srl = getNextSequence();
|
||||
$args->layout = $layout_info->name;
|
||||
$args->title = $layout_info->title;
|
||||
$args->layout_type = "P";
|
||||
// Insert into the DB
|
||||
$oLayoutAdminController = &getAdminController('layout');
|
||||
$oLayoutAdminController = getAdminController('layout');
|
||||
$output = $oLayoutAdminController->insertLayout($args);
|
||||
$layout_info->layout_srl = $args->layout_srl;
|
||||
}
|
||||
|
|
@ -479,35 +517,39 @@ class adminAdminModel extends admin
|
|||
$theme_info->layout_info = $layout_info;
|
||||
|
||||
$skin_infos = $xml_obj->skininfos;
|
||||
if(is_array($skin_infos->skininfo))$skin_list = $skin_infos->skininfo;
|
||||
else $skin_list = array($skin_infos->skininfo);
|
||||
if(is_array($skin_infos->skininfo))
|
||||
{
|
||||
$skin_list = $skin_infos->skininfo;
|
||||
}
|
||||
else
|
||||
{
|
||||
$skin_list = array($skin_infos->skininfo);
|
||||
}
|
||||
|
||||
$oModuleModel = &getModel('module');
|
||||
$oModuleModel = getModel('module');
|
||||
$skins = array();
|
||||
foreach($skin_list as $val)
|
||||
{
|
||||
$skin_info = new stdClass();
|
||||
unset($skin_parse);
|
||||
$skin_parse = explode('/',$val->directory->attrs->path);
|
||||
$skin_parse = explode('/', $val->directory->attrs->path);
|
||||
switch($skin_parse[1])
|
||||
{
|
||||
case 'themes' :
|
||||
{
|
||||
$is_theme = true;
|
||||
$module_name = $skin_parse[count($skin_parse)-1];
|
||||
$skin_info->name = $theme_name.'|@|'.$module_name;
|
||||
$is_theme = TRUE;
|
||||
$module_name = $skin_parse[count($skin_parse) - 1];
|
||||
$skin_info->name = $theme_name . '|@|' . $module_name;
|
||||
break;
|
||||
}
|
||||
|
||||
case 'modules' :
|
||||
{
|
||||
$is_theme = false;
|
||||
$module_name = $skin_parse[2];
|
||||
$skin_info->name = $skin_parse[count($skin_parse)-1];
|
||||
break;
|
||||
}
|
||||
$is_theme = FALSE;
|
||||
$module_name = $skin_parse[2];
|
||||
$skin_info->name = $skin_parse[count($skin_parse) - 1];
|
||||
break;
|
||||
|
||||
}
|
||||
$skin_info->path = $val->directory->attrs->path;
|
||||
$skin_info->is_theme = $is_theme;
|
||||
$skin_info->is_theme = $is_theme;
|
||||
$skins[$module_name] = $skin_info;
|
||||
|
||||
if($is_theme)
|
||||
|
|
@ -532,20 +574,27 @@ class adminAdminModel extends admin
|
|||
* Return theme module skin list
|
||||
* @return array
|
||||
*/
|
||||
function getModulesSkinList(){
|
||||
if ($GLOBALS['__ThemeModuleSkin__']['__IS_PARSE__']) return $GLOBALS['__ThemeModuleSkin__'];
|
||||
function getModulesSkinList()
|
||||
{
|
||||
if($GLOBALS['__ThemeModuleSkin__']['__IS_PARSE__'])
|
||||
{
|
||||
return $GLOBALS['__ThemeModuleSkin__'];
|
||||
}
|
||||
$searched_list = FileHandler::readDir('./modules');
|
||||
sort($searched_list);
|
||||
|
||||
$searched_count = count($searched_list);
|
||||
if(!$searched_count) return;
|
||||
if(!$searched_count)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
$exceptionModule = array('editor', 'poll', 'homepage', 'textyle');
|
||||
|
||||
$oModuleModel = &getModel('module');
|
||||
$oModuleModel = getModel('module');
|
||||
foreach($searched_list as $val)
|
||||
{
|
||||
$skin_list = $oModuleModel->getSkins('./modules/'.$val);
|
||||
$skin_list = $oModuleModel->getSkins('./modules/' . $val);
|
||||
|
||||
if(is_array($skin_list) && count($skin_list) > 0 && !in_array($val, $exceptionModule))
|
||||
{
|
||||
|
|
@ -559,7 +608,7 @@ class adminAdminModel extends admin
|
|||
$GLOBALS['__ThemeModuleSkin__'][$val]['skins'] = array_merge($GLOBALS['__ThemeModuleSkin__'][$val]['skins'], $skin_list);
|
||||
}
|
||||
}
|
||||
$GLOBALS['__ThemeModuleSkin__']['__IS_PARSE__'] = true;
|
||||
$GLOBALS['__ThemeModuleSkin__']['__IS_PARSE__'] = TRUE;
|
||||
|
||||
return $GLOBALS['__ThemeModuleSkin__'];
|
||||
}
|
||||
|
|
@ -576,16 +625,17 @@ class adminAdminModel extends admin
|
|||
// Update if no cache file exists or it is older than xml file
|
||||
if(!is_readable($cacheFile))
|
||||
{
|
||||
$oModuleModel = &getModel('module');
|
||||
$lang = new stdClass();
|
||||
$oModuleModel = getModel('module');
|
||||
$installed_module_list = $oModuleModel->getModulesXmlInfo();
|
||||
|
||||
$this->gnbLangBuffer = '<?php ';
|
||||
foreach($installed_module_list AS $key=>$value)
|
||||
$this->gnbLangBuffer = '<?php $lang = new stdClass();';
|
||||
foreach($installed_module_list AS $key => $value)
|
||||
{
|
||||
$moduleActionInfo = $oModuleModel->getModuleActionXml($value->module);
|
||||
if(is_object($moduleActionInfo->menu))
|
||||
{
|
||||
foreach($moduleActionInfo->menu AS $key2=>$value2)
|
||||
foreach($moduleActionInfo->menu AS $key2 => $value2)
|
||||
{
|
||||
$lang->menu_gnb_sub[$key2] = $value2->title;
|
||||
$this->gnbLangBuffer .=sprintf('$lang->menu_gnb_sub[\'%s\'] = \'%s\';', $key2, $value2->title);
|
||||
|
|
@ -595,7 +645,10 @@ class adminAdminModel extends admin
|
|||
$this->gnbLangBuffer .= ' ?>';
|
||||
FileHandler::writeFile($cacheFile, $this->gnbLangBuffer);
|
||||
}
|
||||
else include $cacheFile;
|
||||
else
|
||||
{
|
||||
include $cacheFile;
|
||||
}
|
||||
|
||||
return $lang->menu_gnb_sub;
|
||||
}
|
||||
|
|
@ -606,18 +659,24 @@ class adminAdminModel extends admin
|
|||
* @param bool $isGetModuleInfo
|
||||
* @return object
|
||||
*/
|
||||
function getFavoriteList($siteSrl = 0, $isGetModuleInfo = false)
|
||||
function getFavoriteList($siteSrl = 0, $isGetModuleInfo = FALSE)
|
||||
{
|
||||
$args = new stdClass();
|
||||
$args->site_srl = $siteSrl;
|
||||
$output = executeQueryArray('admin.getFavoriteList', $args);
|
||||
if(!$output->toBool()) return $output;
|
||||
if(!$output->data) return new Object();
|
||||
if(!$output->toBool())
|
||||
{
|
||||
return $output;
|
||||
}
|
||||
if(!$output->data)
|
||||
{
|
||||
return new Object();
|
||||
}
|
||||
|
||||
if($isGetModuleInfo && is_array($output->data))
|
||||
{
|
||||
$oModuleModel = &getModel('module');
|
||||
foreach($output->data AS $key=>$value)
|
||||
$oModuleModel = getModel('module');
|
||||
foreach($output->data AS $key => $value)
|
||||
{
|
||||
$moduleInfo = $oModuleModel->getModuleInfoXml($value->module);
|
||||
$output->data[$key]->admin_index_act = $moduleInfo->admin_index_act;
|
||||
|
|
@ -642,17 +701,20 @@ class adminAdminModel extends admin
|
|||
$args->site_srl = $siteSrl;
|
||||
$args->module = $module;
|
||||
$output = executeQuery('admin.getFavorite', $args);
|
||||
if (!$output->toBool()) return $output;
|
||||
if(!$output->toBool())
|
||||
{
|
||||
return $output;
|
||||
}
|
||||
|
||||
$returnObject = new Object();
|
||||
if($output->data)
|
||||
{
|
||||
$returnObject->add('result', true);
|
||||
$returnObject->add('result', TRUE);
|
||||
$returnObject->add('favoriteSrl', $output->data->admin_favorite_srl);
|
||||
}
|
||||
else
|
||||
{
|
||||
$returnObject->add('result', false);
|
||||
$returnObject->add('result', FALSE);
|
||||
}
|
||||
|
||||
return $returnObject;
|
||||
|
|
@ -664,7 +726,10 @@ class adminAdminModel extends admin
|
|||
*/
|
||||
function getSiteAllList()
|
||||
{
|
||||
if(Context::get('domain')) $domain = Context::get('domain');
|
||||
if(Context::get('domain'))
|
||||
{
|
||||
$domain = Context::get('domain');
|
||||
}
|
||||
$siteList = $this->getAllSitesThatHaveModules($domain);
|
||||
$this->add('site_list', $siteList);
|
||||
}
|
||||
|
|
@ -675,17 +740,23 @@ class adminAdminModel extends admin
|
|||
*
|
||||
* @return array
|
||||
*/
|
||||
function getAllSitesThatHaveModules($domain = null)
|
||||
function getAllSitesThatHaveModules($domain = NULL)
|
||||
{
|
||||
$args = new stdClass();
|
||||
if($domain) $args->domain = $domain;
|
||||
if($domain)
|
||||
{
|
||||
$args->domain = $domain;
|
||||
}
|
||||
$columnList = array('domain', 'site_srl');
|
||||
|
||||
$siteList = array();
|
||||
$output = executeQueryArray('admin.getSiteAllList', $args, $columnList);
|
||||
if($output->toBool()) $siteList = $output->data;
|
||||
if($output->toBool())
|
||||
{
|
||||
$siteList = $output->data;
|
||||
}
|
||||
|
||||
$oModuleModel = &getModel('module');
|
||||
$oModuleModel = getModel('module');
|
||||
foreach($siteList as $key => $value)
|
||||
{
|
||||
$args->site_srl = $value->site_srl;
|
||||
|
|
@ -719,37 +790,46 @@ class adminAdminModel extends admin
|
|||
*/
|
||||
function getSiteCountByDate($date = '')
|
||||
{
|
||||
if($date) $args->regDate = date('Ymd', strtotime($date));
|
||||
$args = new stdClass();
|
||||
|
||||
if($date)
|
||||
{
|
||||
$args->regDate = date('Ymd', strtotime($date));
|
||||
}
|
||||
|
||||
$output = executeQuery('admin.getSiteCountByDate', $args);
|
||||
if(!$output->toBool()) return 0;
|
||||
if(!$output->toBool())
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
return $output->data->count;
|
||||
}
|
||||
|
||||
function getFaviconUrl()
|
||||
{
|
||||
return $this->iconUrlCheck('favicon.ico','faviconSample.png');
|
||||
return $this->iconUrlCheck('favicon.ico', 'faviconSample.png');
|
||||
}
|
||||
|
||||
function getMobileIconUrl()
|
||||
{
|
||||
return $this->iconUrlCheck('mobicon.png','mobiconSample.png');
|
||||
return $this->iconUrlCheck('mobicon.png', 'mobiconSample.png');
|
||||
}
|
||||
|
||||
function iconUrlCheck($iconname,$default_icon_name)
|
||||
function iconUrlCheck($iconname, $default_icon_name)
|
||||
{
|
||||
$file_exsit = FileHandler::readFile(_XE_PATH_.'files/attach/xeicon/'.$iconname);
|
||||
$file_exsit = FileHandler::readFile(_XE_PATH_ . 'files/attach/xeicon/' . $iconname);
|
||||
if(!$file_exsit)
|
||||
{
|
||||
$icon_url = './modules/admin/tpl/img/'.$default_icon_name ;
|
||||
$icon_url = './modules/admin/tpl/img/' . $default_icon_name;
|
||||
}
|
||||
else
|
||||
{
|
||||
$icon_url = $db_info->default_url.'files/attach/xeicon/'.$iconname;
|
||||
$icon_url = $db_info->default_url . 'files/attach/xeicon/' . $iconname;
|
||||
}
|
||||
return $icon_url;
|
||||
}
|
||||
|
||||
}
|
||||
/* End of file admin.admin.model.php */
|
||||
/* Location: ./modules/admin/admin.admin.model.php */
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* adminAdminView class
|
||||
* Admin view class of admin module
|
||||
|
|
@ -9,11 +10,13 @@
|
|||
*/
|
||||
class adminAdminView extends admin
|
||||
{
|
||||
|
||||
/**
|
||||
* layout list
|
||||
* @var array
|
||||
*/
|
||||
var $layout_list;
|
||||
|
||||
/**
|
||||
* easy install check file
|
||||
* @var array
|
||||
|
|
@ -27,12 +30,15 @@ class adminAdminView extends admin
|
|||
function init()
|
||||
{
|
||||
// forbit access if the user is not an administrator
|
||||
$oMemberModel = &getModel('member');
|
||||
$oMemberModel = getModel('member');
|
||||
$logged_info = $oMemberModel->getLoggedInfo();
|
||||
if($logged_info->is_admin!='Y') return $this->stop("msg_is_not_administrator");
|
||||
if($logged_info->is_admin != 'Y')
|
||||
{
|
||||
return $this->stop("msg_is_not_administrator");
|
||||
}
|
||||
|
||||
// change into administration layout
|
||||
$this->setTemplatePath($this->module_path.'tpl');
|
||||
$this->setTemplatePath($this->module_path . 'tpl');
|
||||
$this->setLayoutPath($this->getTemplatePath());
|
||||
$this->setLayoutFile('layout.html');
|
||||
|
||||
|
|
@ -44,17 +50,23 @@ class adminAdminView extends admin
|
|||
|
||||
Context::set('time_zone_list', $GLOBALS['time_zone']);
|
||||
Context::set('time_zone', $GLOBALS['_time_zone']);
|
||||
Context::set('use_rewrite', $db_info->use_rewrite=='Y'?'Y':'N');
|
||||
Context::set('use_sso', $db_info->use_sso=='Y'?'Y':'N');
|
||||
Context::set('use_html5', $db_info->use_html5=='Y'?'Y':'N');
|
||||
Context::set('use_spaceremover', $db_info->use_spaceremover?$db_info->use_spaceremover:'Y');//not use
|
||||
Context::set('qmail_compatibility', $db_info->qmail_compatibility=='Y'?'Y':'N');
|
||||
Context::set('use_db_session', $db_info->use_db_session=='N'?'N':'Y');
|
||||
Context::set('use_mobile_view', $db_info->use_mobile_view =='Y'?'Y':'N');
|
||||
Context::set('use_ssl', $db_info->use_ssl?$db_info->use_ssl:"none");
|
||||
Context::set('use_cdn', $db_info->use_cdn?$db_info->use_cdn:"none");
|
||||
if($db_info->http_port) Context::set('http_port', $db_info->http_port);
|
||||
if($db_info->https_port) Context::set('https_port', $db_info->https_port);
|
||||
Context::set('use_rewrite', $db_info->use_rewrite == 'Y' ? 'Y' : 'N');
|
||||
Context::set('use_sso', $db_info->use_sso == 'Y' ? 'Y' : 'N');
|
||||
Context::set('use_html5', $db_info->use_html5 == 'Y' ? 'Y' : 'N');
|
||||
Context::set('use_spaceremover', $db_info->use_spaceremover ? $db_info->use_spaceremover : 'Y'); //not use
|
||||
Context::set('qmail_compatibility', $db_info->qmail_compatibility == 'Y' ? 'Y' : 'N');
|
||||
Context::set('use_db_session', $db_info->use_db_session == 'N' ? 'N' : 'Y');
|
||||
Context::set('use_mobile_view', $db_info->use_mobile_view == 'Y' ? 'Y' : 'N');
|
||||
Context::set('use_ssl', $db_info->use_ssl ? $db_info->use_ssl : "none");
|
||||
Context::set('use_cdn', $db_info->use_cdn ? $db_info->use_cdn : "none");
|
||||
if($db_info->http_port)
|
||||
{
|
||||
Context::set('http_port', $db_info->http_port);
|
||||
}
|
||||
if($db_info->https_port)
|
||||
{
|
||||
Context::set('https_port', $db_info->https_port);
|
||||
}
|
||||
|
||||
$this->showSendEnv();
|
||||
$this->checkEasyinstall();
|
||||
|
|
@ -66,10 +78,13 @@ class adminAdminView extends admin
|
|||
*/
|
||||
function checkEasyinstall()
|
||||
{
|
||||
$lastTime = (int)FileHandler::readFile($this->easyinstallCheckFile);
|
||||
if ($lastTime > time() - 60*60*24*30) return;
|
||||
$lastTime = (int) FileHandler::readFile($this->easyinstallCheckFile);
|
||||
if($lastTime > time() - 60 * 60 * 24 * 30)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
$oAutoinstallModel = &getModel('autoinstall');
|
||||
$oAutoinstallModel = getModel('autoinstall');
|
||||
$params = array();
|
||||
$params["act"] = "getResourceapiLastupdate";
|
||||
$body = XmlGenerater::generate($params);
|
||||
|
|
@ -78,7 +93,7 @@ class adminAdminView extends admin
|
|||
$lUpdateDoc = $xml_lUpdate->parse($buff);
|
||||
$updateDate = $lUpdateDoc->response->updatedate->body;
|
||||
|
||||
if (!$updateDate)
|
||||
if(!$updateDate)
|
||||
{
|
||||
$this->_markingCheckEasyinstall();
|
||||
return;
|
||||
|
|
@ -87,7 +102,7 @@ class adminAdminView extends admin
|
|||
$item = $oAutoinstallModel->getLatestPackage();
|
||||
if(!$item || $item->updatedate < $updateDate)
|
||||
{
|
||||
$oController = &getAdminController('autoinstall');
|
||||
$oController = getAdminController('autoinstall');
|
||||
$oController->_updateinfo();
|
||||
}
|
||||
$this->_markingCheckEasyinstall();
|
||||
|
|
@ -112,23 +127,23 @@ class adminAdminView extends admin
|
|||
{
|
||||
global $lang;
|
||||
|
||||
$oAdminAdminModel = &getAdminModel('admin');
|
||||
$oAdminAdminModel = getAdminModel('admin');
|
||||
$lang->menu_gnb_sub = $oAdminAdminModel->getAdminMenuLang();
|
||||
|
||||
$result = $oAdminAdminModel->checkAdminMenu();
|
||||
if(!$result->php_file)
|
||||
{
|
||||
header('Location: '.getNotEncodedUrl('', 'module','admin'));
|
||||
header('Location: ' . getNotEncodedUrl('', 'module', 'admin'));
|
||||
Context::close();
|
||||
}
|
||||
include $result->php_file;
|
||||
|
||||
$oModuleModel = &getModel('module');
|
||||
$oModuleModel = getModel('module');
|
||||
$moduleActionInfo = $oModuleModel->getModuleActionXml($module);
|
||||
|
||||
$currentAct = Context::get('act');
|
||||
$currentAct = Context::get('act');
|
||||
$subMenuTitle = '';
|
||||
foreach((array)$moduleActionInfo->menu as $key=>$value)
|
||||
foreach((array) $moduleActionInfo->menu as $key => $value)
|
||||
{
|
||||
if(isset($value->acts) && is_array($value->acts) && in_array($currentAct, $value->acts))
|
||||
{
|
||||
|
|
@ -138,29 +153,32 @@ class adminAdminView extends admin
|
|||
}
|
||||
|
||||
$parentSrl = 0;
|
||||
$oMenuAdminConroller = &getAdminController('menu');
|
||||
foreach((array)$menu->list as $parentKey=>$parentMenu)
|
||||
$oMenuAdminConroller = getAdminController('menu');
|
||||
foreach((array) $menu->list as $parentKey => $parentMenu)
|
||||
{
|
||||
if(!$parentMenu['text'])
|
||||
{
|
||||
$oMenuAdminConroller->makeXmlFile($result->menu_srl);
|
||||
header('Location: '.getNotEncodedUrl('', 'module','admin'));
|
||||
header('Location: ' . getNotEncodedUrl('', 'module', 'admin'));
|
||||
break;
|
||||
}
|
||||
|
||||
if(!is_array($parentMenu['list']) || !count($parentMenu['list'])) continue;
|
||||
if(!is_array($parentMenu['list']) || !count($parentMenu['list']))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if($parentMenu['href'] == '#' && count($parentMenu['list']))
|
||||
{
|
||||
$firstChild = current($parentMenu['list']);
|
||||
$menu->list[$parentKey]['href'] = $firstChild['href'];
|
||||
}
|
||||
|
||||
foreach($parentMenu['list'] as $childKey=>$childMenu)
|
||||
foreach($parentMenu['list'] as $childKey => $childMenu)
|
||||
{
|
||||
if(!$childMenu['text'])
|
||||
{
|
||||
$oMenuAdminConroller->makeXmlFile($result->menu_srl);
|
||||
header('Location: '.getNotEncodedUrl('', 'module','admin'));
|
||||
header('Location: ' . getNotEncodedUrl('', 'module', 'admin'));
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
@ -175,13 +193,13 @@ class adminAdminView extends admin
|
|||
// Admin logo, title setup
|
||||
$objConfig = $oModuleModel->getModuleConfig('admin');
|
||||
$gnbTitleInfo = new stdClass();
|
||||
$gnbTitleInfo->adminTitle = $objConfig->adminTitle ? $objConfig->adminTitle:'XE Admin';
|
||||
$gnbTitleInfo->adminLogo = $objConfig->adminLogo ? $objConfig->adminLogo:'modules/admin/tpl/img/xe.h1.png';
|
||||
$gnbTitleInfo->adminTitle = $objConfig->adminTitle ? $objConfig->adminTitle : 'XE Admin';
|
||||
$gnbTitleInfo->adminLogo = $objConfig->adminLogo ? $objConfig->adminLogo : 'modules/admin/tpl/img/xe.h1.png';
|
||||
|
||||
$browserTitle = ($subMenuTitle ? $subMenuTitle : 'Dashboard').' - '.$gnbTitleInfo->adminTitle;
|
||||
$browserTitle = ($subMenuTitle ? $subMenuTitle : 'Dashboard') . ' - ' . $gnbTitleInfo->adminTitle;
|
||||
|
||||
// Get list of favorite
|
||||
$oAdminAdminModel = &getAdminModel('admin');
|
||||
$oAdminAdminModel = getAdminModel('admin');
|
||||
$output = $oAdminAdminModel->getFavoriteList(0, true);
|
||||
Context::set('favorite_list', $output->get('favoriteList'));
|
||||
|
||||
|
|
@ -189,12 +207,12 @@ class adminAdminView extends admin
|
|||
// move from index method, because use in admin footer
|
||||
$newest_news_url = sprintf("http://news.xpressengine.com/%s/news.php?version=%s&package=%s", _XE_LOCATION_, __ZBXE_VERSION__, _XE_PACKAGE_);
|
||||
$cache_file = sprintf("%sfiles/cache/newest_news.%s.cache.php", _XE_PATH_, _XE_LOCATION_);
|
||||
if(!file_exists($cache_file) || filemtime($cache_file)+ 60*60 < time())
|
||||
if(!file_exists($cache_file) || filemtime($cache_file) + 60 * 60 < time())
|
||||
{
|
||||
// Considering if data cannot be retrieved due to network problem, modify filemtime to prevent trying to reload again when refreshing administration page
|
||||
// Ensure to access the administration page even though news cannot be displayed
|
||||
FileHandler::writeFile($cache_file,'');
|
||||
FileHandler::getRemoteFile($newest_news_url, $cache_file, null, 1, 'GET', 'text/html', array('REQUESTURL'=>getFullUrl('')));
|
||||
FileHandler::writeFile($cache_file, '');
|
||||
FileHandler::getRemoteFile($newest_news_url, $cache_file, null, 1, 'GET', 'text/html', array('REQUESTURL' => getFullUrl('')));
|
||||
}
|
||||
|
||||
if(file_exists($cache_file))
|
||||
|
|
@ -205,7 +223,10 @@ class adminAdminView extends admin
|
|||
$item = $buff->zbxe_news->item;
|
||||
if($item)
|
||||
{
|
||||
if(!is_array($item)) $item = array($item);
|
||||
if(!is_array($item))
|
||||
{
|
||||
$item = array($item);
|
||||
}
|
||||
|
||||
foreach($item as $key => $val)
|
||||
{
|
||||
|
|
@ -226,8 +247,8 @@ class adminAdminView extends admin
|
|||
}
|
||||
|
||||
Context::set('subMenuTitle', $subMenuTitle);
|
||||
Context::set('gnbUrlList', $menu->list);
|
||||
Context::set('parentSrl', $parentSrl);
|
||||
Context::set('gnbUrlList', $menu->list);
|
||||
Context::set('parentSrl', $parentSrl);
|
||||
Context::set('gnb_title_info', $gnbTitleInfo);
|
||||
Context::setBrowserTitle($browserTitle);
|
||||
}
|
||||
|
|
@ -240,18 +261,18 @@ class adminAdminView extends admin
|
|||
{
|
||||
// Get statistics
|
||||
$args = new stdClass();
|
||||
$args->date = date("Ymd000000", time()-60*60*24);
|
||||
$args->date = date("Ymd000000", time() - 60 * 60 * 24);
|
||||
$today = date("Ymd");
|
||||
|
||||
|
||||
// Member Status
|
||||
$oMemberAdminModel = &getAdminModel('member');
|
||||
$oMemberAdminModel = getAdminModel('member');
|
||||
$status = new stdClass();
|
||||
$status->member = new stdClass();
|
||||
$status->member->todayCount = $oMemberAdminModel->getMemberCountByDate($today);
|
||||
$status->member->totalCount = $oMemberAdminModel->getMemberCountByDate();
|
||||
|
||||
// Document Status
|
||||
$oDocumentAdminModel = &getAdminModel('document');
|
||||
$oDocumentAdminModel = getAdminModel('document');
|
||||
$statusList = array('PUBLIC', 'SECRET');
|
||||
$status->document = new stdClass();
|
||||
$status->document->todayCount = $oDocumentAdminModel->getDocumentCountByDate($today, array(), $statusList);
|
||||
|
|
@ -260,24 +281,25 @@ class adminAdminView extends admin
|
|||
Context::set('status', $status);
|
||||
|
||||
// Latest Document
|
||||
$oDocumentModel = &getModel('document');
|
||||
$oDocumentModel = getModel('document');
|
||||
$columnList = array('document_srl', 'module_srl', 'category_srl', 'title', 'nick_name', 'member_srl');
|
||||
$args->list_count = 5;;
|
||||
$output = $oDocumentModel->getDocumentList($args, false, false, $columnList);
|
||||
$args->list_count = 5;
|
||||
;
|
||||
$output = $oDocumentModel->getDocumentList($args, FALSE, FALSE, $columnList);
|
||||
Context::set('latestDocumentList', $output->data);
|
||||
$security = new Security();
|
||||
$security->encodeHTML('latestDocumentList..variables.nick_name');
|
||||
unset($args, $output, $columnList);
|
||||
|
||||
// Latest Comment
|
||||
$oCommentModel = &getModel('comment');
|
||||
$oCommentModel = getModel('comment');
|
||||
$columnList = array('comment_srl', 'module_srl', 'document_srl', 'content', 'nick_name', 'member_srl');
|
||||
$args = new stdClass();
|
||||
$args->list_count = 5;
|
||||
$output = $oCommentModel->getNewestCommentList($args, $columnList);
|
||||
if(is_array($output))
|
||||
{
|
||||
foreach($output AS $key=>$value)
|
||||
foreach($output AS $key => $value)
|
||||
{
|
||||
$value->content = strip_tags($value->content);
|
||||
}
|
||||
|
|
@ -286,21 +308,21 @@ class adminAdminView extends admin
|
|||
unset($args, $output, $columnList);
|
||||
|
||||
// Get list of modules
|
||||
$oModuleModel = &getModel('module');
|
||||
$oModuleModel = getModel('module');
|
||||
$module_list = $oModuleModel->getModuleList();
|
||||
if(is_array($module_list))
|
||||
{
|
||||
$needUpdate = false;
|
||||
$addTables = false;
|
||||
foreach($module_list AS $key=>$value)
|
||||
$needUpdate = FALSE;
|
||||
$addTables = FALSE;
|
||||
foreach($module_list AS $key => $value)
|
||||
{
|
||||
if($value->need_install)
|
||||
{
|
||||
$addTables = true;
|
||||
$addTables = TRUE;
|
||||
}
|
||||
if($value->need_update)
|
||||
{
|
||||
$needUpdate = true;
|
||||
$needUpdate = TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -311,7 +333,7 @@ class adminAdminView extends admin
|
|||
|
||||
if(is_array($needUpdateList))
|
||||
{
|
||||
foreach($needUpdateList AS $key=>$value)
|
||||
foreach($needUpdateList AS $key => $value)
|
||||
{
|
||||
$helpUrl = './help/index.html#';
|
||||
switch($value->type)
|
||||
|
|
@ -347,11 +369,14 @@ class adminAdminView extends admin
|
|||
|
||||
// gathering enviroment check
|
||||
$mainVersion = join('.', array_slice(explode('.', __ZBXE_VERSION__), 0, 2));
|
||||
$path = FileHandler::getRealPath('./files/env/'.$mainVersion);
|
||||
$isEnviromentGatheringAgreement = false;
|
||||
if(file_exists($path)) $isEnviromentGatheringAgreement = true;
|
||||
$path = FileHandler::getRealPath('./files/env/' . $mainVersion);
|
||||
$isEnviromentGatheringAgreement = FALSE;
|
||||
if(file_exists($path))
|
||||
{
|
||||
$isEnviromentGatheringAgreement = TRUE;
|
||||
}
|
||||
Context::set('isEnviromentGatheringAgreement', $isEnviromentGatheringAgreement);
|
||||
Context::set('layout','none');
|
||||
Context::set('layout', 'none');
|
||||
|
||||
$this->setTemplateFile('index');
|
||||
}
|
||||
|
|
@ -373,32 +398,32 @@ class adminAdminView extends admin
|
|||
|
||||
Context::set('lang_selected', Context::loadLangSelected());
|
||||
|
||||
$admin_ip_list = preg_replace("/[,]+/","\r\n",$db_info->admin_ip_list);
|
||||
$admin_ip_list = preg_replace("/[,]+/", "\r\n", $db_info->admin_ip_list);
|
||||
Context::set('admin_ip_list', $admin_ip_list);
|
||||
|
||||
$oAdminModel = &getAdminModel('admin');
|
||||
$oAdminModel = getAdminModel('admin');
|
||||
$favicon_url = $oAdminModel->getFaviconUrl();
|
||||
$mobicon_url = $oAdminModel->getMobileIconUrl();
|
||||
Context::set('favicon_url', $favicon_url);
|
||||
Context::set('mobicon_url', $mobicon_url);
|
||||
|
||||
$oDocumentModel = &getModel('document');
|
||||
$oDocumentModel = getModel('document');
|
||||
$config = $oDocumentModel->getDocumentConfig();
|
||||
Context::set('thumbnail_type',$config->thumbnail_type);
|
||||
Context::set('thumbnail_type', $config->thumbnail_type);
|
||||
|
||||
Context::set('IP',$_SERVER['REMOTE_ADDR']);
|
||||
Context::set('IP', $_SERVER['REMOTE_ADDR']);
|
||||
|
||||
$oModuleModel = &getModel('module');
|
||||
$oModuleModel = getModel('module');
|
||||
$config = $oModuleModel->getModuleConfig('module');
|
||||
Context::set('siteTitle',$config->siteTitle);
|
||||
Context::set('htmlFooter',$config->htmlFooter);
|
||||
Context::set('siteTitle', $config->siteTitle);
|
||||
Context::set('htmlFooter', $config->htmlFooter);
|
||||
|
||||
|
||||
$columnList = array('modules.mid', 'modules.browser_title', 'sites.index_module_srl');
|
||||
$start_module = $oModuleModel->getSiteInfo(0, $columnList);
|
||||
Context::set('start_module', $start_module);
|
||||
|
||||
Context::set('pwd',$pwd);
|
||||
Context::set('pwd', $pwd);
|
||||
$this->setTemplateFile('config_general');
|
||||
|
||||
$security = new Security();
|
||||
|
|
@ -429,11 +454,11 @@ class adminAdminView extends admin
|
|||
*/
|
||||
function dispAdminSetup()
|
||||
{
|
||||
$oModuleModel = &getModel('module');
|
||||
$oModuleModel = getModel('module');
|
||||
$configObject = $oModuleModel->getModuleConfig('admin');
|
||||
|
||||
$oAdmin = &getClass('admin');
|
||||
$oMenuAdminModel = &getAdminModel('menu');
|
||||
$oAdmin = getClass('admin');
|
||||
$oMenuAdminModel = getAdminModel('menu');
|
||||
$output = $oMenuAdminModel->getMenuByTitle($oAdmin->getAdminMenuName());
|
||||
|
||||
Context::set('menu_srl', $output->menu_srl);
|
||||
|
|
@ -442,14 +467,16 @@ class adminAdminView extends admin
|
|||
$this->setTemplateFile('admin_setup');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Enviroment information send to XE collect server
|
||||
* @return void
|
||||
*/
|
||||
function showSendEnv()
|
||||
{
|
||||
if(Context::getResponseMethod() != 'HTML') return;
|
||||
if(Context::getResponseMethod() != 'HTML')
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
$server = 'http://collect.xpressengine.com/env/img.php?';
|
||||
$path = './files/env/';
|
||||
|
|
@ -458,29 +485,30 @@ class adminAdminView extends admin
|
|||
|
||||
if(file_exists(FileHandler::getRealPath($install_env)))
|
||||
{
|
||||
$oAdminAdminModel = &getAdminModel('admin');
|
||||
$oAdminAdminModel = getAdminModel('admin');
|
||||
$params = $oAdminAdminModel->getEnv('INSTALL');
|
||||
$img = sprintf('<img src="%s" alt="" style="height:0px;width:0px" />', $server.$params);
|
||||
$img = sprintf('<img src="%s" alt="" style="height:0px;width:0px" />', $server . $params);
|
||||
Context::addHtmlFooter($img);
|
||||
|
||||
FileHandler::removeDir($path);
|
||||
FileHandler::writeFile($path.$mainVersion,'1');
|
||||
FileHandler::writeFile($path . $mainVersion, '1');
|
||||
}
|
||||
else if(isset($_SESSION['enviroment_gather']) && !file_exists(FileHandler::getRealPath($path.$mainVersion)))
|
||||
else if(isset($_SESSION['enviroment_gather']) && !file_exists(FileHandler::getRealPath($path . $mainVersion)))
|
||||
{
|
||||
if($_SESSION['enviroment_gather']=='Y')
|
||||
if($_SESSION['enviroment_gather'] == 'Y')
|
||||
{
|
||||
$oAdminAdminModel = &getAdminModel('admin');
|
||||
$oAdminAdminModel = getAdminModel('admin');
|
||||
$params = $oAdminAdminModel->getEnv();
|
||||
$img = sprintf('<img src="%s" alt="" style="height:0px;width:0px" />', $server.$params);
|
||||
$img = sprintf('<img src="%s" alt="" style="height:0px;width:0px" />', $server . $params);
|
||||
Context::addHtmlFooter($img);
|
||||
}
|
||||
|
||||
FileHandler::removeDir($path);
|
||||
FileHandler::writeFile($path.$mainVersion,'1');
|
||||
FileHandler::writeFile($path . $mainVersion, '1');
|
||||
unset($_SESSION['enviroment_gather']);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
/* End of file admin.admin.view.php */
|
||||
/* Location: ./modules/admin/admin.admin.view.php */
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* admin class
|
||||
* Base class of admin module
|
||||
|
|
@ -9,6 +10,7 @@
|
|||
*/
|
||||
class admin extends ModuleObject
|
||||
{
|
||||
|
||||
private $adminMenuName = '__ADMINMENU_V17__';
|
||||
|
||||
public function getAdminMenuName()
|
||||
|
|
@ -31,10 +33,13 @@ class admin extends ModuleObject
|
|||
*/
|
||||
function checkUpdate()
|
||||
{
|
||||
$oDB = &DB::getInstance();
|
||||
if(!$oDB->isColumnExists("admin_favorite", "type")) return true;
|
||||
$oDB = DB::getInstance();
|
||||
if(!$oDB->isColumnExists("admin_favorite", "type"))
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return false;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -43,21 +48,21 @@ class admin extends ModuleObject
|
|||
*/
|
||||
function moduleUpdate()
|
||||
{
|
||||
$oDB = &DB::getInstance();
|
||||
$oDB = DB::getInstance();
|
||||
if(!$oDB->isColumnExists("admin_favorite", "type"))
|
||||
{
|
||||
$oAdminAdminModel = &getAdminModel('admin');
|
||||
$oAdminAdminModel = getAdminModel('admin');
|
||||
$output = $oAdminAdminModel->getFavoriteList();
|
||||
$favoriteList = $output->get('favoriteList');
|
||||
|
||||
$oDB->dropColumn('admin_favorite', 'admin_favorite_srl');
|
||||
$oDB->addColumn('admin_favorite',"admin_favorite_srl","number",11,0);
|
||||
$oDB->addColumn('admin_favorite',"type","varchar",30, 'module');
|
||||
$oDB->addColumn('admin_favorite', "admin_favorite_srl", "number", 11, 0);
|
||||
$oDB->addColumn('admin_favorite', "type", "varchar", 30, 'module');
|
||||
if(is_array($favoriteList))
|
||||
{
|
||||
$oAdminAdminController = &getAdminController('admin');
|
||||
$oAdminAdminController = getAdminController('admin');
|
||||
$oAdminAdminController->_deleteAllFavorite();
|
||||
foreach($favoriteList AS $key=>$value)
|
||||
foreach($favoriteList AS $key => $value)
|
||||
{
|
||||
$oAdminAdminController->_insertFavorite($value->site_srl, $value->module);
|
||||
}
|
||||
|
|
@ -72,6 +77,7 @@ class admin extends ModuleObject
|
|||
*/
|
||||
function recompileCache()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function checkAdminMenu()
|
||||
|
|
@ -79,19 +85,19 @@ class admin extends ModuleObject
|
|||
// for admin menu
|
||||
if(Context::isInstalled())
|
||||
{
|
||||
$oMenuAdminModel = &getAdminModel('menu');
|
||||
$oMenuAdminModel = getAdminModel('menu');
|
||||
$output = $oMenuAdminModel->getMenuByTitle($this->adminMenuName);
|
||||
|
||||
if(!$output->menu_srl)
|
||||
{
|
||||
$oAdminClass = &getClass('admin');
|
||||
$oAdminClass = getClass('admin');
|
||||
$oAdminClass->createXeAdminMenu();
|
||||
}
|
||||
else
|
||||
{
|
||||
if(!is_readable(FileHandler::getRealPath($output->php_file)))
|
||||
{
|
||||
$oMenuAdminController = &getAdminController('menu');
|
||||
$oMenuAdminController = getAdminController('menu');
|
||||
$oMenuAdminController->makeXmlFile($output->menu_srl);
|
||||
}
|
||||
Context::set('admin_menu_srl', $output->menu_srl);
|
||||
|
|
@ -125,28 +131,31 @@ class admin extends ModuleObject
|
|||
|
||||
// gnb item create
|
||||
$gnbList = array('dashboard', 'menu', 'user', 'content', 'configuration', 'advanced');
|
||||
foreach($gnbList AS $key=>$value)
|
||||
foreach($gnbList AS $key => $value)
|
||||
{
|
||||
//insert menu item
|
||||
$args = new stdClass();
|
||||
$args->menu_srl = $menuSrl;
|
||||
$args->menu_item_srl = getNextSequence();
|
||||
$args->name = '{$lang->menu_gnb[\''.$value.'\']}';
|
||||
$args->name = '{$lang->menu_gnb[\'' . $value . '\']}';
|
||||
if($value == 'dashboard')
|
||||
{
|
||||
$args->url = 'index.php?module=admin';
|
||||
}
|
||||
else $args->url = '#';
|
||||
$args->listorder = -1*$args->menu_item_srl;
|
||||
else
|
||||
{
|
||||
$args->url = '#';
|
||||
}
|
||||
$args->listorder = -1 * $args->menu_item_srl;
|
||||
$output = executeQuery('menu.insertMenuItem', $args);
|
||||
}
|
||||
|
||||
$oMenuAdminModel = &getAdminModel('menu');
|
||||
$oMenuAdminModel = getAdminModel('menu');
|
||||
$columnList = array('menu_item_srl', 'name');
|
||||
$output = $oMenuAdminModel->getMenuItems($menuSrl, 0, $columnList);
|
||||
if(is_array($output->data))
|
||||
{
|
||||
foreach($output->data AS $key=>$value)
|
||||
foreach($output->data AS $key => $value)
|
||||
{
|
||||
preg_match('/\{\$lang->menu_gnb\[(.*?)\]\}/i', $value->name, $m);
|
||||
$gnbDBList[$m[1]] = $value->menu_item_srl;
|
||||
|
|
@ -155,97 +164,97 @@ class admin extends ModuleObject
|
|||
unset($args);
|
||||
|
||||
$gnbModuleList = array(
|
||||
0=>array(
|
||||
'module'=>'menu',
|
||||
'subMenu'=>array('siteMap', 'siteDesign'),
|
||||
),
|
||||
1=>array(
|
||||
'module'=>'member',
|
||||
'subMenu'=>array('userList', 'userSetting', 'userGroup'),
|
||||
),
|
||||
2=>array(
|
||||
'module'=>'document',
|
||||
'subMenu'=>array('document'),
|
||||
),
|
||||
3=>array(
|
||||
'module'=>'comment',
|
||||
'subMenu'=>array('comment'),
|
||||
),
|
||||
4=>array(
|
||||
'module'=>'trackback',
|
||||
'subMenu'=>array('trackback'),
|
||||
),
|
||||
5=>array(
|
||||
'module'=>'file',
|
||||
'subMenu'=>array('file'),
|
||||
),
|
||||
6=>array(
|
||||
'module'=>'poll',
|
||||
'subMenu'=>array('poll'),
|
||||
),
|
||||
7=>array(
|
||||
'module'=>'rss',
|
||||
'subMenu'=>array('rss'),
|
||||
),
|
||||
8=>array(
|
||||
'module'=>'module',
|
||||
'subMenu'=>array('multilingual'),
|
||||
),
|
||||
9=>array(
|
||||
'module'=>'importer',
|
||||
'subMenu'=>array('importer'),
|
||||
),
|
||||
10=>array(
|
||||
'module'=>'trash',
|
||||
'subMenu'=>array('trash'),
|
||||
),
|
||||
11=>array(
|
||||
'module'=>'autoinstall',
|
||||
'subMenu'=>array('easyInstall'),
|
||||
),
|
||||
12=>array(
|
||||
'module'=>'layout',
|
||||
'subMenu'=>array('installedLayout'),
|
||||
),
|
||||
13=>array(
|
||||
'module'=>'module',
|
||||
'subMenu'=>array('installedModule'),
|
||||
),
|
||||
14=>array(
|
||||
'module'=>'widget',
|
||||
'subMenu'=>array('installedWidget'),
|
||||
),
|
||||
15=>array(
|
||||
'module'=>'addon',
|
||||
'subMenu'=>array('installedAddon'),
|
||||
),
|
||||
16=>array(
|
||||
'module'=>'editor',
|
||||
'subMenu'=>array('editor'),
|
||||
),
|
||||
17=>array(
|
||||
'module'=>'spamfilter',
|
||||
'subMenu'=>array('spamFilter'),
|
||||
),
|
||||
18=>array(
|
||||
'module'=>'admin',
|
||||
'subMenu'=>array('adminConfigurationGeneral', 'adminConfigurationFtp', 'adminMenuSetup'),
|
||||
),
|
||||
19=>array(
|
||||
'module'=>'file',
|
||||
'subMenu'=>array('fileUpload'),
|
||||
),
|
||||
20=>array(
|
||||
'module'=>'module',
|
||||
'subMenu'=>array('filebox'),
|
||||
),
|
||||
21=>array(
|
||||
'module'=>'point',
|
||||
'subMenu'=>array('point')
|
||||
),
|
||||
);
|
||||
0 => array(
|
||||
'module' => 'menu',
|
||||
'subMenu' => array('siteMap', 'siteDesign'),
|
||||
),
|
||||
1 => array(
|
||||
'module' => 'member',
|
||||
'subMenu' => array('userList', 'userSetting', 'userGroup'),
|
||||
),
|
||||
2 => array(
|
||||
'module' => 'document',
|
||||
'subMenu' => array('document'),
|
||||
),
|
||||
3 => array(
|
||||
'module' => 'comment',
|
||||
'subMenu' => array('comment'),
|
||||
),
|
||||
4 => array(
|
||||
'module' => 'trackback',
|
||||
'subMenu' => array('trackback'),
|
||||
),
|
||||
5 => array(
|
||||
'module' => 'file',
|
||||
'subMenu' => array('file'),
|
||||
),
|
||||
6 => array(
|
||||
'module' => 'poll',
|
||||
'subMenu' => array('poll'),
|
||||
),
|
||||
7 => array(
|
||||
'module' => 'rss',
|
||||
'subMenu' => array('rss'),
|
||||
),
|
||||
8 => array(
|
||||
'module' => 'module',
|
||||
'subMenu' => array('multilingual'),
|
||||
),
|
||||
9 => array(
|
||||
'module' => 'importer',
|
||||
'subMenu' => array('importer'),
|
||||
),
|
||||
10 => array(
|
||||
'module' => 'trash',
|
||||
'subMenu' => array('trash'),
|
||||
),
|
||||
11 => array(
|
||||
'module' => 'autoinstall',
|
||||
'subMenu' => array('easyInstall'),
|
||||
),
|
||||
12 => array(
|
||||
'module' => 'layout',
|
||||
'subMenu' => array('installedLayout'),
|
||||
),
|
||||
13 => array(
|
||||
'module' => 'module',
|
||||
'subMenu' => array('installedModule'),
|
||||
),
|
||||
14 => array(
|
||||
'module' => 'widget',
|
||||
'subMenu' => array('installedWidget'),
|
||||
),
|
||||
15 => array(
|
||||
'module' => 'addon',
|
||||
'subMenu' => array('installedAddon'),
|
||||
),
|
||||
16 => array(
|
||||
'module' => 'editor',
|
||||
'subMenu' => array('editor'),
|
||||
),
|
||||
17 => array(
|
||||
'module' => 'spamfilter',
|
||||
'subMenu' => array('spamFilter'),
|
||||
),
|
||||
18 => array(
|
||||
'module' => 'admin',
|
||||
'subMenu' => array('adminConfigurationGeneral', 'adminConfigurationFtp', 'adminMenuSetup'),
|
||||
),
|
||||
19 => array(
|
||||
'module' => 'file',
|
||||
'subMenu' => array('fileUpload'),
|
||||
),
|
||||
20 => array(
|
||||
'module' => 'module',
|
||||
'subMenu' => array('filebox'),
|
||||
),
|
||||
21 => array(
|
||||
'module' => 'point',
|
||||
'subMenu' => array('point')
|
||||
),
|
||||
);
|
||||
|
||||
$oMemberModel = &getModel('member');
|
||||
$oMemberModel = getModel('member');
|
||||
$output = $oMemberModel->getAdminGroup(array('group_srl'));
|
||||
$adminGroupSrl = $output->group_srl;
|
||||
|
||||
|
|
@ -259,29 +268,29 @@ class admin extends ModuleObject
|
|||
$args->hover_btn = '';
|
||||
$args->active_btn = '';
|
||||
$args->group_srls = $adminGroupSrl;
|
||||
$oModuleModel = &getModel('module');
|
||||
$oModuleModel = getModel('module');
|
||||
|
||||
foreach($gnbModuleList AS $key=>$value)
|
||||
foreach($gnbModuleList AS $key => $value)
|
||||
{
|
||||
if(is_array($value['subMenu']))
|
||||
{
|
||||
$moduleActionInfo = $oModuleModel->getModuleActionXml($value['module']);
|
||||
foreach($value['subMenu'] AS $key2=>$value2)
|
||||
foreach($value['subMenu'] AS $key2 => $value2)
|
||||
{
|
||||
$gnbKey = "'".$this->_getGnbKey($value2)."'";
|
||||
$gnbKey = "'" . $this->_getGnbKey($value2) . "'";
|
||||
|
||||
//insert menu item
|
||||
$args->menu_item_srl = getNextSequence();
|
||||
$args->parent_srl = $gnbDBList[$gnbKey];
|
||||
$args->name = '{$lang->menu_gnb_sub[\''.$value2.'\']}';
|
||||
$args->url = 'index.php?module=admin&act='.$moduleActionInfo->menu->{$value2}->index;
|
||||
$args->listorder = -1*$args->menu_item_srl;
|
||||
$args->name = '{$lang->menu_gnb_sub[\'' . $value2 . '\']}';
|
||||
$args->url = 'index.php?module=admin&act=' . $moduleActionInfo->menu->{$value2}->index;
|
||||
$args->listorder = -1 * $args->menu_item_srl;
|
||||
$output = executeQuery('menu.insertMenuItem', $args);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$oMenuAdminConroller = &getAdminController('menu');
|
||||
$oMenuAdminConroller = getAdminController('menu');
|
||||
$oMenuAdminConroller->makeXmlFile($menuSrl);
|
||||
}
|
||||
|
||||
|
|
@ -386,7 +395,7 @@ class admin extends ModuleObject
|
|||
|
||||
private function _oldAdminmenuDelete()
|
||||
{
|
||||
$oMenuAdminModel = &getAdminModel('menu');
|
||||
$oMenuAdminModel = getAdminModel('menu');
|
||||
|
||||
$output = $oMenuAdminModel->getMenuByTitle($this->adminMenuName);
|
||||
$newAdminmenuSrl = $output->menu_srl;
|
||||
|
|
@ -394,7 +403,7 @@ class admin extends ModuleObject
|
|||
$newAdminParentMenuList = array();
|
||||
if(is_array($output->data))
|
||||
{
|
||||
foreach($output->data AS $key=>$value)
|
||||
foreach($output->data AS $key => $value)
|
||||
{
|
||||
$tmp = explode('\'', $value->name);
|
||||
$newAdminParentMenuList[$tmp[1]] = $value;
|
||||
|
|
@ -408,13 +417,13 @@ class admin extends ModuleObject
|
|||
|
||||
if($menuSrl)
|
||||
{
|
||||
$oMenuAdminController = &getAdminController('menu');
|
||||
$oMenuAdminController = getAdminController('menu');
|
||||
|
||||
$output = $oMenuAdminModel->getMenuItems($menuSrl);
|
||||
if(is_array($output->data))
|
||||
{
|
||||
$parentMenu = array();
|
||||
foreach($output->data AS $key=>$menuItem)
|
||||
foreach($output->data AS $key => $menuItem)
|
||||
{
|
||||
if($menuItem->parent_srl == 0)
|
||||
{
|
||||
|
|
@ -424,8 +433,8 @@ class admin extends ModuleObject
|
|||
}
|
||||
}
|
||||
|
||||
$isUserAddedMenuMoved = false;
|
||||
foreach($output->data AS $key=>$menuItem)
|
||||
$isUserAddedMenuMoved = FALSE;
|
||||
foreach($output->data AS $key => $menuItem)
|
||||
{
|
||||
if($menuItem->parent_srl != 0)
|
||||
{
|
||||
|
|
@ -436,11 +445,11 @@ class admin extends ModuleObject
|
|||
if($result == 'user_added_menu')
|
||||
{
|
||||
// theme menu use not anymore
|
||||
/*if($parentMenu[$menuItem->parent_srl] == 'theme')
|
||||
/* if($parentMenu[$menuItem->parent_srl] == 'theme')
|
||||
{
|
||||
$newParentItem = $newAdminParentMenuList['menu'];
|
||||
}
|
||||
else*/
|
||||
}
|
||||
else */
|
||||
if($parentMenu[$menuItem->parent_srl] == 'extensions')
|
||||
{
|
||||
$newParentItem = $newAdminParentMenuList['advanced'];
|
||||
|
|
@ -453,7 +462,7 @@ class admin extends ModuleObject
|
|||
$menuItem->parent_srl = $newParentItem->menu_item_srl;
|
||||
|
||||
$output = executeQuery('menu.updateMenuItem', $menuItem);
|
||||
$isUserAddedMenuMoved = true;
|
||||
$isUserAddedMenuMoved = TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -467,6 +476,7 @@ class admin extends ModuleObject
|
|||
$oMenuAdminController->deleteMenu($menuSrl);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
/* End of file admin.class.php */
|
||||
/* Location: ./modules/admin/admin.class.php */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue