add phpDoc comment to admin module

git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@10781 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
ovclas 2012-06-20 01:26:21 +00:00
parent ebc5edeec7
commit dbec33b7ca
4 changed files with 202 additions and 92 deletions

View file

@ -1,15 +1,16 @@
<?php <?php
/** /**
* @class adminAdminController * adminAdminController class
* @author NHN (developers@xpressengine.com) * admin controller class of admin module
* @brief admin controller class of admin module * @author NHN (developers@xpressengine.com)
**/ * @package /modules/admin
* @version 0.1
*/
class adminAdminController extends admin { class adminAdminController extends admin {
/** /**
* @brief initialization * initialization
* @return none * @return void
**/ */
function init() { function init() {
// forbit access if the user is not an administrator // forbit access if the user is not an administrator
$oMemberModel = &getModel('member'); $oMemberModel = &getModel('member');
@ -17,6 +18,10 @@
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");
} }
/**
* Admin menu reset
* @return void
*/
function procAdminMenuReset(){ function procAdminMenuReset(){
$menuSrl = Context::get('menu_srl'); $menuSrl = Context::get('menu_srl');
if (!$menuSrl) return $this->stop('msg_invalid_request'); if (!$menuSrl) return $this->stop('msg_invalid_request');
@ -30,10 +35,10 @@
$this->setRedirectUrl(Context::get('error_return_url')); $this->setRedirectUrl(Context::get('error_return_url'));
} }
/** /**
* @brief Regenerate all cache files * Regenerate all cache files
* @return none * @return void
**/ */
function procAdminRecompileCacheFile() { function procAdminRecompileCacheFile() {
// rename cache dir // rename cache dir
$temp_cache_dir = './files/cache_'. time(); $temp_cache_dir = './files/cache_'. time();
@ -92,10 +97,10 @@
$this->setMessage('success_updated'); $this->setMessage('success_updated');
} }
/** /**
* @brief Logout * Logout
* @return none * @return void
**/ */
function procAdminLogout() { function procAdminLogout() {
$oMemberController = &getController('member'); $oMemberController = &getController('member');
$oMemberController->procMemberLogout(); $oMemberController->procMemberLogout();
@ -103,6 +108,10 @@
header('Location: '.getNotEncodedUrl('', 'module','admin')); header('Location: '.getNotEncodedUrl('', 'module','admin'));
} }
/**
* Insert theme information
* @return void|object
*/
function procAdminInsertThemeInfo(){ function procAdminInsertThemeInfo(){
$vars = Context::getRequestVars(); $vars = Context::getRequestVars();
$theme_file = _XE_PATH_.'files/theme/theme_info.php'; $theme_file = _XE_PATH_.'files/theme/theme_info.php';
@ -169,8 +178,9 @@
} }
/** /**
* @brief Toggle favorite * Toggle favorite
**/ * @return void
*/
function procAdminToggleFavorite() function procAdminToggleFavorite()
{ {
$siteSrl = Context::get('site_srl'); $siteSrl = Context::get('site_srl');
@ -203,8 +213,9 @@
} }
/** /**
* @brief enviroment gathering agreement * Enviroment gathering agreement
**/ * @return void
*/
function procAdminEnviromentGatheringAgreement() function procAdminEnviromentGatheringAgreement()
{ {
$isAgree = Context::get('is_agree'); $isAgree = Context::get('is_agree');
@ -216,8 +227,9 @@
} }
/** /**
* @brief admin config update * Admin config update
**/ * @return void
*/
function procAdminUpdateConfig() function procAdminUpdateConfig()
{ {
$adminTitle = Context::get('adminTitle'); $adminTitle = Context::get('adminTitle');
@ -260,8 +272,9 @@
} }
/** /**
* @brief admin logo delete * Admin logo delete
**/ * @return void
*/
function procAdminDeleteLogo() function procAdminDeleteLogo()
{ {
$oModuleModel = &getModel('module'); $oModuleModel = &getModel('module');
@ -282,8 +295,9 @@
} }
/** /**
* @brief Insert favorite * Insert favorite
**/ * @return object query result
*/
function _insertFavorite($siteSrl, $module, $type = 'module') function _insertFavorite($siteSrl, $module, $type = 'module')
{ {
$args->adminFavoriteSrl = getNextSequence(); $args->adminFavoriteSrl = getNextSequence();
@ -295,8 +309,9 @@
} }
/** /**
* @brief Delete favorite * Delete favorite
**/ * @return object query result
*/
function _deleteFavorite($favoriteSrl) function _deleteFavorite($favoriteSrl)
{ {
$args->admin_favorite_srl = $favoriteSrl; $args->admin_favorite_srl = $favoriteSrl;
@ -305,8 +320,9 @@
} }
/** /**
* @brief Delete favorite * Delete all favorite
**/ * @return object query result
*/
function _deleteAllFavorite() function _deleteAllFavorite()
{ {
$args = null; $args = null;
@ -314,6 +330,10 @@
return $output; return $output;
} }
/**
* Remove admin icon
* @return object|void
*/
function procAdminRemoveIcons(){ function procAdminRemoveIcons(){
$iconname = Context::get('iconname'); $iconname = Context::get('iconname');
$file_exist = FileHandler::readFile(_XE_PATH_.'files/attach/xeicon/'.$iconname); $file_exist = FileHandler::readFile(_XE_PATH_.'files/attach/xeicon/'.$iconname);

View file

@ -1,10 +1,28 @@
<?php <?php
/**
* adminAdminModel class
* admin model class of admin module
* @author NHN (developers@xpressengine.com)
* @package /modules/admin
* @version 0.1
*/
class adminAdminModel extends admin class adminAdminModel extends admin
{ {
/**
* Ftp root path
* @var string
*/
var $pwd; var $pwd;
/**
* Buffer for Admin GNB menu
* @var string
*/
var $gnbLangBuffer; var $gnbLangBuffer;
/**
* Add file list to Object after sftp connect
* @return void|Object
*/
function getSFTPList() function getSFTPList()
{ {
$ftp_info = Context::getRequestVars(); $ftp_info = Context::getRequestVars();
@ -38,6 +56,10 @@
$this->add('list', $list); $this->add('list', $list);
} }
/**
* Add file list to Object after ftp connect
* @return void|Object
*/
function getAdminFTPList() function getAdminFTPList()
{ {
Context::loadLang('./modules/autoinstall/lang'); Context::loadLang('./modules/autoinstall/lang');
@ -98,6 +120,11 @@
$this->add('list', $list); $this->add('list', $list);
} }
/**
* Parameter arrange for send to XE collect server
* @param string $type 'WORKING', 'INSTALL'
* @return string
*/
function getEnv($type='WORKING') { function getEnv($type='WORKING') {
$skip = array( $skip = array(
@ -156,6 +183,10 @@
return $param; return $param;
} }
/**
* Return theme info list by theme directory list
* @return array
*/
function getThemeList(){ function getThemeList(){
$path = _XE_PATH_.'themes'; $path = _XE_PATH_.'themes';
$list = FileHandler::readDir($path); $list = FileHandler::readDir($path);
@ -170,6 +201,12 @@
return $theme_info; return $theme_info;
} }
/**
* Return theme info
* @param string $theme_name
* @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];
@ -294,6 +331,10 @@
return $theme_info; return $theme_info;
} }
/**
* Return theme module skin list
* @return array
*/
function getModulesSkinList(){ function getModulesSkinList(){
if ($GLOBALS['__ThemeModuleSkin__']['__IS_PARSE__']) return $GLOBALS['__ThemeModuleSkin__']; if ($GLOBALS['__ThemeModuleSkin__']['__IS_PARSE__']) return $GLOBALS['__ThemeModuleSkin__'];
$searched_list = FileHandler::readDir('./modules'); $searched_list = FileHandler::readDir('./modules');
@ -323,6 +364,10 @@
return $GLOBALS['__ThemeModuleSkin__']; return $GLOBALS['__ThemeModuleSkin__'];
} }
/**
* Return admin menu language
* @return array
*/
function getAdminMenuLang() function getAdminMenuLang()
{ {
$currentLang = Context::getLangType(); $currentLang = Context::getLangType();
@ -356,8 +401,11 @@
} }
/** /**
* @brief Get admin favorite list * Get admin favorite list
**/ * @param int $siteSrl if default site, siteSrl is zero
* @param bool $isGetModuleInfo
* @return object
*/
function getFavoriteList($siteSrl = 0, $isGetModuleInfo = false) function getFavoriteList($siteSrl = 0, $isGetModuleInfo = false)
{ {
$args->site_srl = $siteSrl; $args->site_srl = $siteSrl;
@ -382,8 +430,11 @@
} }
/** /**
* @brief Check available insert favorite * Check available insert favorite
**/ * @param int $siteSrl if default site, siteSrl is zero
* @param string $module
* @return object
*/
function isExistsFavorite($siteSrl, $module) function isExistsFavorite($siteSrl, $module)
{ {
$args->site_srl = $siteSrl; $args->site_srl = $siteSrl;
@ -406,8 +457,9 @@
} }
/** /**
* @brief Return site list * Return site list
**/ * @return void
*/
function getSiteAllList() function getSiteAllList()
{ {
if(Context::get('domain')) $args->domain = Context::get('domain'); if(Context::get('domain')) $args->domain = Context::get('domain');
@ -421,8 +473,10 @@
} }
/** /**
* @brief Return site count * Return site count
**/ * @param string $date
* @return int
*/
function getSiteCountByDate($date = '') function getSiteCountByDate($date = '')
{ {
if($date) $args->regDate = date('Ymd', strtotime($date)); if($date) $args->regDate = date('Ymd', strtotime($date));

View file

@ -1,19 +1,28 @@
<?php <?php
/** /**
* @class adminAdminView * adminAdminView class
* @author NHN (developers@xpressengine.com) * Admin view class of admin module
* @brief admin view class of admin module *
**/ * @author NHN (developers@xpressengine.com)
* @package /modules/admin
* @version 0.1
*/
class adminAdminView extends admin { class adminAdminView extends admin {
/**
* layout list
* @var array
*/
var $layout_list; var $layout_list;
/**
* easy install check file
* @var array
*/
var $easyinstallCheckFile = './files/env/easyinstall_last'; var $easyinstallCheckFile = './files/env/easyinstall_last';
/** /**
* @brief Initilization * Initilization
* @return none * @return void
**/ */
function init() { function init() {
// forbit access if the user is not an administrator // forbit access if the user is not an administrator
$oMemberModel = &getModel('member'); $oMemberModel = &getModel('member');
@ -49,6 +58,10 @@
$this->checkEasyinstall(); $this->checkEasyinstall();
} }
/**
* check easy install
* @return void
*/
function checkEasyinstall() function checkEasyinstall()
{ {
$lastTime = (int)FileHandler::readFile($this->easyinstallCheckFile); $lastTime = (int)FileHandler::readFile($this->easyinstallCheckFile);
@ -78,12 +91,21 @@
$this->_markingCheckEasyinstall(); $this->_markingCheckEasyinstall();
} }
/**
* update easy install file content
* @return void
*/
function _markingCheckEasyinstall() function _markingCheckEasyinstall()
{ {
$currentTime = time(); $currentTime = time();
FileHandler::writeFile($this->easyinstallCheckFile, $currentTime); FileHandler::writeFile($this->easyinstallCheckFile, $currentTime);
} }
/**
* Include admin menu php file and make menu url
* Setting admin logo, newest news setting
* @return void
*/
function makeGnbUrl($module = 'admin') function makeGnbUrl($module = 'admin')
{ {
global $lang; global $lang;
@ -188,10 +210,10 @@
Context::setBrowserTitle($browserTitle); Context::setBrowserTitle($browserTitle);
} }
/** /**
* @brief Display Super Admin Dashboard * Display Super Admin Dashboard
* @return none * @return void
**/ */
function dispAdminIndex() { function dispAdminIndex() {
// Get statistics // Get statistics
$args->date = date("Ymd000000", time()-60*60*24); $args->date = date("Ymd000000", time()-60*60*24);
@ -293,10 +315,10 @@
$this->setTemplateFile('index'); $this->setTemplateFile('index');
} }
/** /**
* @brief Display Configuration(settings) page * Display Configuration(settings) page
* @return none * @return void
**/ */
function dispAdminConfigGeneral() { function dispAdminConfigGeneral() {
Context::loadLang('modules/install/lang'); Context::loadLang('modules/install/lang');
@ -340,10 +362,10 @@
$security->encodeHTML('news..', 'released_version', 'download_link', 'selected_lang', 'module_list..', 'module_list..author..', 'addon_list..', 'addon_list..author..', 'start_module.'); $security->encodeHTML('news..', 'released_version', 'download_link', 'selected_lang', 'module_list..', 'module_list..author..', 'addon_list..', 'addon_list..author..', 'start_module.');
} }
/** /**
* @brief Display Configuration(settings) page * Display FTP Configuration(settings) page
* @return none * @return void
**/ */
function dispAdminConfigFtp() { function dispAdminConfigFtp() {
Context::loadLang('modules/install/lang'); Context::loadLang('modules/install/lang');
@ -359,9 +381,9 @@
} }
/** /**
* @brief Display Admin Menu Configuration(settings) page * Display Admin Menu Configuration(settings) page
* @return none * @return void
**/ */
function dispAdminSetup() function dispAdminSetup()
{ {
$oModuleModel = &getModel('module'); $oModuleModel = &getModel('module');
@ -377,6 +399,10 @@
} }
/**
* Enviroment information send to XE collect server
* @return void
*/
function showSendEnv() { function showSendEnv() {
if(Context::getResponseMethod() != 'HTML') return; if(Context::getResponseMethod() != 'HTML') return;
@ -411,6 +437,10 @@
} }
} }
/**
* Display Admin theme Configuration(settings) page
* @return void
*/
function dispAdminTheme(){ function dispAdminTheme(){
// choice theme file // choice theme file
$theme_file = _XE_PATH_.'files/theme/theme_info.php'; $theme_file = _XE_PATH_.'files/theme/theme_info.php';

View file

@ -1,23 +1,25 @@
<?php <?php
/** /**
* @class admin * admin class
* @author NHN (developers@xpressengine.com) * @brief base class of admin module
* @brief base class of admin module *
**/ * @author NHN (developers@xpressengine.com)
* @package /modules/admin
* @version 0.1
*/
class admin extends ModuleObject { class admin extends ModuleObject {
/**
/** * Install admin module
* @brief install admin module * @return Object
* @return new Object */
**/
function moduleInstall() { function moduleInstall() {
return new Object(); return new Object();
} }
/** /**
* @brief if update is necessary it returns true * If update is necessary it returns true
**/ * @return bool
*/
function checkUpdate() { function checkUpdate() {
$oDB = &DB::getInstance(); $oDB = &DB::getInstance();
if(!$oDB->isColumnExists("admin_favorite", "type")) return true; if(!$oDB->isColumnExists("admin_favorite", "type")) return true;
@ -25,10 +27,10 @@
return false; return false;
} }
/** /**
* @brief update module * Update module
* @return new Object * @return Object
**/ */
function moduleUpdate() { function moduleUpdate() {
$oDB = &DB::getInstance(); $oDB = &DB::getInstance();
if(!$oDB->isColumnExists("admin_favorite", "type")) if(!$oDB->isColumnExists("admin_favorite", "type"))
@ -53,17 +55,17 @@
return new Object(); return new Object();
} }
/** /**
* @brief regenerate cache file * Regenerate cache file
* @return none * @return void
**/ */
function recompileCache() { function recompileCache() {
} }
/** /**
* @brief regenerate xe admin default menu * Regenerate xe admin default menu
* @return none * @return void
**/ */
function createXeAdminMenu() function createXeAdminMenu()
{ {
//insert menu //insert menu
@ -238,6 +240,10 @@
$oMenuAdminConroller->makeXmlFile($menuSrl); $oMenuAdminConroller->makeXmlFile($menuSrl);
} }
/**
* Return parent menu key by child menu
* @return string
*/
function _getGnbKey($menuName) function _getGnbKey($menuName)
{ {
switch($menuName) { switch($menuName) {