本文整理汇总了PHP中getAdminController函数的典型用法代码示例。如果您正苦于以下问题:PHP getAdminController函数的具体用法?PHP getAdminController怎么用?PHP getAdminController使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getAdminController函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: moduleInstall
/**
* @brief 설치시 추가 작업이 필요할시 구현
**/
function moduleInstall()
{
// action forward에 등록 (관리자 모드에서 사용하기 위함)
$oModuleController =& getController('module');
// 기본 에디터 컴포넌트를 추가
$oEditorController =& getAdminController('editor');
$oEditorController->insertComponent('colorpicker_text', true);
$oEditorController->insertComponent('colorpicker_bg', true);
$oEditorController->insertComponent('emoticon', true);
$oEditorController->insertComponent('url_link', true);
$oEditorController->insertComponent('image_link', true);
$oEditorController->insertComponent('multimedia_link', true);
$oEditorController->insertComponent('quotation', true);
$oEditorController->insertComponent('table_maker', true);
$oEditorController->insertComponent('poll_maker', true);
$oEditorController->insertComponent('image_gallery', true);
// 에디터 모듈에서 사용할 디렉토리 생성
FileHandler::makeDir('./files/cache/editor');
// 2007. 10. 17 글의 입력(신규 or 수정)이 일어날때마다 자동 저장된 문서를 삭제하는 trigger 추가
$oModuleController->insertTrigger('document.insertDocument', 'editor', 'controller', 'triggerDeleteSavedDoc', 'after');
$oModuleController->insertTrigger('document.updateDocument', 'editor', 'controller', 'triggerDeleteSavedDoc', 'after');
// 2007. 10. 23 모듈의 추가 설정에서 에디터 trigger 추가
$oModuleController->insertTrigger('module.dispAdditionSetup', 'editor', 'view', 'triggerDispEditorAdditionSetup', 'before');
// 2009. 04. 14 editor component 변환 코드를 trigger로 독립
$oModuleController->insertTrigger('display', 'editor', 'controller', 'triggerEditorComponentCompile', 'before');
return new Object();
}
开发者ID:hottaro,项目名称:xpressengine,代码行数:30,代码来源:editor.class.php
示例2: dispMenuMenu
/**
* Display menu
* @return void
*/
function dispMenuMenu()
{
$menu_srl = Context::get('menu_srl');
$oAdminModel =& getAdminModel('menu');
$menu_info = $oAdminModel->getMenu($menu_srl);
if (!$menu_srl) {
$oMenuAdminController = getAdminController('menu');
$homeMenuCacheFile = $oMenuAdminController->getHomeMenuCacheFile();
if (file_exists($homeMenuCacheFile)) {
@(include $homeMenuCacheFile);
}
$menu_info->php_file = './files/cache/menu/' . $homeMenuSrl . '.php';
}
if (file_exists($menu_info->php_file)) {
@(include $menu_info->php_file);
}
if (is_array($menu->list)) {
foreach ($menu->list as $menu_item) {
$this->straightenMenu($menu_item, 0);
}
}
Context::set('menu', $this->result);
$this->setTemplatePath(sprintf("%stpl/", $this->module_path));
$this->setTemplateFile('menu.html');
}
开发者ID:umjinsun12,项目名称:dngshin,代码行数:29,代码来源:menu.mobile.php
示例3: moduleInstall
/**
* @brief Implement if additional tasks are necessary when installing
*/
function moduleInstall()
{
// Register action forward (to use in administrator mode)
$oModuleController = getController('module');
// Add the default editor component
$oEditorController = getAdminController('editor');
$oEditorController->insertComponent('colorpicker_text', true);
$oEditorController->insertComponent('colorpicker_bg', true);
$oEditorController->insertComponent('emoticon', true);
$oEditorController->insertComponent('url_link', true);
$oEditorController->insertComponent('image_link', true);
$oEditorController->insertComponent('multimedia_link', true);
$oEditorController->insertComponent('quotation', true);
$oEditorController->insertComponent('table_maker', true);
$oEditorController->insertComponent('poll_maker', true);
$oEditorController->insertComponent('image_gallery', true);
// Create a directory to use in the editor module
FileHandler::makeDir('./files/cache/editor');
// 2007. 10. 17 Add a trigger to delete automatically saved document whenever the document(insert or update) is modified
$oModuleController->insertTrigger('document.insertDocument', 'editor', 'controller', 'triggerDeleteSavedDoc', 'after');
$oModuleController->insertTrigger('document.updateDocument', 'editor', 'controller', 'triggerDeleteSavedDoc', 'after');
// 2007. 10. 23 Add an editor trigger on the module addition setup
$oModuleController->insertTrigger('module.dispAdditionSetup', 'editor', 'view', 'triggerDispEditorAdditionSetup', 'before');
// 2009. 04. 14 Add a trigger from compiled codes of the editor component
$oModuleController->insertTrigger('display', 'editor', 'controller', 'triggerEditorComponentCompile', 'before');
return new Object();
}
开发者ID:rhymix,项目名称:rhymix,代码行数:30,代码来源:editor.class.php
示例4: moduleInstall
/**
* @brief 설치시 추가 작업이 필요할시 구현
**/
function moduleInstall()
{
// 몇가지 애드온을 등록
$oAddonController =& getAdminController('addon');
$oAddonController->doInsert('autolink');
$oAddonController->doInsert('blogapi');
$oAddonController->doInsert('counter');
$oAddonController->doInsert('member_communication');
$oAddonController->doInsert('member_extra_info');
$oAddonController->doInsert('mobile');
$oAddonController->doInsert('referer');
$oAddonController->doInsert('resize_image');
$oAddonController->doInsert('openid_delegation_id');
$oAddonController->doInsert('point_level_icon');
// 몇가지 애드온을 기본 활성화 상태로 변경
$oAddonController->doActivate('autolink');
$oAddonController->doActivate('counter');
$oAddonController->doActivate('member_communication');
$oAddonController->doActivate('member_extra_info');
$oAddonController->doActivate('mobile');
$oAddonController->doActivate('referer');
$oAddonController->doActivate('resize_image');
$oAddonController->makeCacheFile(0);
return new Object();
}
开发者ID:hottaro,项目名称:xpressengine,代码行数:28,代码来源:addon.class.php
示例5: __makeMenu
function __makeMenu(&$list, $parent_srl)
{
$oMenuAdminController = getAdminController('menu');
foreach ($list as $idx => &$item) {
Context::set('parent_srl', $parent_srl, TRUE);
Context::set('menu_name', $item['menu_name'], TRUE);
Context::set('module_type', $item['module_type'], TRUE);
Context::set('module_id', $item['module_id'], TRUE);
if ($item['is_shortcut'] === 'Y') {
Context::set('is_shortcut', $item['is_shortcut'], TRUE);
Context::set('shortcut_target', $item['shortcut_target'], TRUE);
} else {
Context::set('is_shortcut', 'N', TRUE);
Context::set('shortcut_target', null, TRUE);
}
$output = $oMenuAdminController->procMenuAdminInsertItem();
if ($output instanceof Object && !$output->toBool()) {
return $output;
}
$menu_srl = $oMenuAdminController->get('menu_item_srl');
$item['menu_srl'] = $menu_srl;
if ($item['list']) {
__makeMenu($item['list'], $menu_srl);
}
}
}
开发者ID:kimkucheol,项目名称:xe-core,代码行数:26,代码来源:ko.install.php
示例6: procInstallAdminUpdateIndexModule
function procInstallAdminUpdateIndexModule()
{
if (!Context::get('index_module_srl') || !Context::get('menu_item_srl')) {
return new Object(-1, 'msg_invalid_request');
}
$site_args = new stdClass();
$site_args->site_srl = 0;
$site_args->index_module_srl = Context::get('index_module_srl');
$oModuleController = getController('module');
$oModuleController->updateSite($site_args);
// get menu item info
$menuItemSrl = Context::get('menu_item_srl');
$oMenuAdminModel = getAdminModel('menu');
$output = $oMenuAdminModel->getMenuItemInfo($menuItemSrl);
// update homeSitemap.php cache file
$oMenuAdminController = getAdminController('menu');
$homeMenuCacheFile = $oMenuAdminController->getHomeMenuCacheFile();
if (file_exists($homeMenuCacheFile)) {
include $homeMenuCacheFile;
}
if (!$homeMenuSrl || $homeMenuSrl != $output->menu_srl) {
$oMenuAdminController->makeHomemenuCacheFile($output->menu_srl);
}
$this->setMessage('success_updated');
}
开发者ID:kkkyyy03,项目名称:coffeemix,代码行数:25,代码来源:install.admin.controller.php
示例7: triggerDeleteModuleComments
/**
* @brief module 삭제시 해당 댓글을 모두 삭제하는 trigger
**/
function triggerDeleteModuleComments(&$obj)
{
$module_srl = $obj->module_srl;
if (!$module_srl) {
return new Object();
}
$oCommentController =& getAdminController('comment');
return $oCommentController->deleteModuleComments($module_srl);
}
开发者ID:hottaro,项目名称:xpressengine,代码行数:12,代码来源:comment.controller.php
示例8: getAddonList
/**
* Returns addon list
*
* @param int $site_srl Site srl
* @param string $gtype site or global
* @return array Returns addon list
*/
function getAddonList($site_srl = 0, $gtype = 'site')
{
// Wanted to add a list of activated
$inserted_addons = $this->getInsertedAddons($site_srl, $gtype);
// Downloaded and installed add-on to the list of Wanted
$searched_list = FileHandler::readDir('./addons', '/^([a-zA-Z0-9-_]+)$/');
$searched_count = count($searched_list);
if (!$searched_count) {
return;
}
sort($searched_list);
$oAddonAdminController = getAdminController('addon');
for ($i = 0; $i < $searched_count; $i++) {
// Add the name of
$addon_name = $searched_list[$i];
if ($addon_name == "smartphone") {
continue;
}
// Add the path (files/addons precedence)
$path = $this->getAddonPath($addon_name);
// Wanted information on the add-on
$info = $this->getAddonInfoXml($addon_name, $site_srl, $gtype);
if (!$info) {
$info = new stdClass();
}
$info->addon = $addon_name;
$info->path = $path;
$info->activated = FALSE;
$info->mactivated = FALSE;
$info->fixed = FALSE;
// Check if a permossion is granted entered in DB
if (!in_array($addon_name, array_keys($inserted_addons))) {
// If not, type in the DB type (model, perhaps because of the hate doing this haneungeo .. ㅡ. ㅜ)
$oAddonAdminController->doInsert($addon_name, $site_srl, $type, 'N', new stdClass());
// Is activated
} else {
if ($inserted_addons[$addon_name]->is_used == 'Y') {
$info->activated = TRUE;
}
if ($inserted_addons[$addon_name]->is_used_m == 'Y') {
$info->mactivated = TRUE;
}
if ($gtype == 'global' && $inserted_addons[$addon_name]->is_fixed == 'Y') {
$info->fixed = TRUE;
}
}
$list[] = $info;
}
return $list;
}
开发者ID:rhymix,项目名称:rhymix,代码行数:57,代码来源:addon.admin.model.php
示例9: procAdminMenuReset
/**
* Admin menu reset
* @return void
*/
function procAdminMenuReset()
{
$menuSrl = Context::get('menu_srl');
if (!$menuSrl) {
return $this->stop('msg_invalid_request');
}
$oMenuAdminController = getAdminController('menu');
$output = $oMenuAdminController->deleteMenu($menuSrl);
if (!$output->toBool()) {
return $output;
}
FileHandler::removeDir('./files/cache/menu/admin_lang/');
$this->setRedirectUrl(Context::get('error_return_url'));
}
开发者ID:Gunmania,项目名称:xe-core,代码行数:18,代码来源:admin.admin.controller.php
示例10: recompileCache
/**
* Re-generate the cache file
* @return void
*/
function recompileCache()
{
$oMenuAdminController =& getAdminController('menu');
// Wanted list of all the blog module
$output = executeQueryArray("menu.getMenus");
$list = $output->data;
if (!count($list)) {
return;
}
// The menu module is used in the re-create all the menu list
foreach ($list as $menu_item) {
$menu_srl = $menu_item->menu_srl;
$oMenuAdminController->makeXmlFile($menu_srl);
}
}
开发者ID:relip,项目名称:xe-core,代码行数:19,代码来源:menu.class.php
示例11: moduleInstall
/**
* Implement if additional tasks are necessary when installing
*
* @return Object
*/
function moduleInstall()
{
// Register to add a few
$oAddonController = getAdminController('addon');
$oAddonController->doInsert('autolink', 0, 'site', 'Y');
$oAddonController->doInsert('blogapi');
$oAddonController->doInsert('member_communication', 0, 'site', 'Y');
$oAddonController->doInsert('member_extra_info', 0, 'site', 'Y');
$oAddonController->doInsert('mobile', 0, 'site', 'Y');
$oAddonController->doInsert('resize_image', 0, 'site', 'Y');
$oAddonController->doInsert('openid_delegation_id');
$oAddonController->doInsert('point_level_icon');
$oAddonController->makeCacheFile(0);
return new Object();
}
开发者ID:kimkucheol,项目名称:xe-core,代码行数:20,代码来源:addon.class.php
示例12: recompileCache
/**
* @brief 캐시 파일 재생성
**/
function recompileCache()
{
// 메뉴 모듈의 캐시 파일 모두 삭제
FileHandler::removeFilesInDir("./files/cache/menu");
$oMenuAdminController =& getAdminController('menu');
// 블로그 모듈 목록을 모두 구함
$output = executeQueryArray("menu.getMenus");
$list = $output->data;
if (!count($list)) {
return;
}
// 메뉴 모듈에서 사용되는 모든 메뉴 목록을 재 생성
foreach ($list as $menu_item) {
$menu_srl = $menu_item->menu_srl;
$oMenuAdminController->makeXmlFile($menu_srl);
}
}
开发者ID:hottaro,项目名称:xpressengine,代码行数:20,代码来源:menu.class.php
示例13: _updateinfo
/**
* Update easy install information
*
* @return void
*/
function _updateinfo()
{
$oModel = getModel('autoinstall');
$item = $oModel->getLatestPackage();
if ($item) {
$params["updatedate"] = $item->updatedate;
}
$params["act"] = "getResourceapiUpdate";
$body = XmlGenerater::generate($params);
$buff = FileHandler::getRemoteResource(_XE_DOWNLOAD_SERVER_, $body, 3, "POST", "application/xml");
$xml = new XmlParser();
$xmlDoc = $xml->parse($buff);
$this->updateCategory($xmlDoc);
$this->updatePackages($xmlDoc);
$this->checkInstalled();
$oAdminController = getAdminController('admin');
$output = $oAdminController->cleanFavorite();
}
开发者ID:Gunmania,项目名称:xe-core,代码行数:23,代码来源:autoinstall.admin.controller.php
示例14: moduleInstall
/**
* Implement if additional tasks are necessary when installing
*
* @return Object
*/
function moduleInstall()
{
// Register to add a few
$oAddonController = getAdminController('addon');
$oAddonController->doInsert('autolink', 0, 'site', 'Y');
$oAddonController->doInsert('blogapi');
$oAddonController->doInsert('member_extra_info', 0, 'site', 'Y');
$oAddonController->doInsert('mobile', 0, 'site', 'Y');
$oAddonController->doInsert('resize_image', 0, 'site', 'Y');
$oAddonController->doInsert('openid_delegation_id');
$oAddonController->doInsert('point_level_icon');
$args = new stdClass();
$args->xe_validator_id = 'module/addon/tpl/setup_addon/1';
$args->apply_signup = 'apply';
$args->xe_run_method = 'run_selected';
$oAddonController->doInsert('captcha_member', 0, 'site', 'Y', $args);
$oAddonController->makeCacheFile(0);
return new Object();
}
开发者ID:rhymix,项目名称:rhymix,代码行数:24,代码来源:addon.class.php
示例15: __construct
/**
* Constructor
*
* Checks to see if a menu cache file exists, and
* if not it creates it <br />
* Loads the menu from the cache file and saves it
* in the $_menu private property
*
* @param $menu_srl
*/
public function __construct($menu_srl)
{
if (!isset($menu_srl)) {
return NULL;
}
/**
* @var menuAdminModel $menuModel
*/
$menuModel = getAdminModel('menu');
$shop_menu = $menuModel->getMenu($menu_srl);
if (!file_exists($shop_menu->php_file)) {
$menuAdminController = getAdminController('menu');
$menuAdminController->makeXmlFile($menu_srl);
}
$menu = NULL;
@(include $shop_menu->php_file);
// Populates $menu with menu data
$this->_menu = $menu;
return $menu;
}
开发者ID:haegyung,项目名称:xe-module-shop,代码行数:30,代码来源:ShopMenu.php
示例16: getAddonList
/**
* @brief 애드온의 종류와 정보를 구함
**/
function getAddonList($site_srl = 0)
{
// activated된 애드온 목록을 구함
$inserted_addons = $this->getInsertedAddons($site_srl);
// 다운받은 애드온과 설치된 애드온의 목록을 구함
$searched_list = FileHandler::readDir('./addons');
$searched_count = count($searched_list);
if (!$searched_count) {
return;
}
sort($searched_list);
for ($i = 0; $i < $searched_count; $i++) {
// 애드온의 이름
$addon_name = $searched_list[$i];
// 애드온의 경로 (files/addons가 우선)
$path = $this->getAddonPath($addon_name);
// 해당 애드온의 정보를 구함
unset($info);
$info = $this->getAddonInfoXml($addon_name, $site_srl);
$info->addon = $addon_name;
$info->path = $path;
$info->activated = false;
// DB에 입력되어 있는지 확인
if (!in_array($addon_name, array_keys($inserted_addons))) {
// DB에 입력되어 있지 않으면 입력 (model에서 이런짓 하는거 싫지만 귀찮아서.. ㅡ.ㅜ)
$oAddonAdminController =& getAdminController('addon');
$oAddonAdminController->doInsert($addon_name, $site_srl);
// 활성화 되어 있는지 확인
} else {
if ($inserted_addons[$addon_name]->is_used == 'Y') {
$info->activated = true;
}
}
$list[] = $info;
}
return $list;
}
开发者ID:hottaro,项目名称:xpressengine,代码行数:40,代码来源:addon.admin.model.php
示例17: procDocumentManageCheckedDocument
/**
* Move/ Delete the document in the seession
* @return void|Object
*/
function procDocumentManageCheckedDocument()
{
@set_time_limit(0);
if (!Context::get('is_logged')) {
return new Object(-1, 'msg_not_permitted');
}
if (!checkCSRF()) {
return new Object(-1, 'msg_invalid_request');
}
$type = Context::get('type');
$target_module = Context::get('target_module');
$module_srl = Context::get('module_srl');
if ($target_module && !$module_srl) {
$module_srl = $target_module;
}
$category_srl = Context::get('target_category');
// send default message - misol 2015-07-23
$send_default_message = Context::get('send_default_message');
if ($send_default_message === 'Y') {
$logged_info = Context::get('logged_info');
$message_content = '';
$default_message_verbs = lang('default_message_verbs');
if (isset($default_message_verbs[$type]) && is_string($default_message_verbs[$type])) {
$message_content = sprintf(lang('default_message_format'), $logged_info->nick_name, $default_message_verbs[$type]);
}
} else {
$message_content = Context::get('message_content');
if ($message_content) {
$message_content = nl2br($message_content);
}
}
$cart = Context::get('cart');
if (!is_array($cart)) {
$document_srl_list = explode('|@|', $cart);
} else {
$document_srl_list = $cart;
}
$document_srl_count = count($document_srl_list);
$oDocumentModel = getModel('document');
$document_items = array();
foreach ($document_srl_list as $document_srl) {
$oDocument = $oDocumentModel->getDocument($document_srl);
$document_items[] = $oDocument;
if (!$oDocument->isGranted()) {
return $this->stop('msg_not_permitted');
}
}
// Set a spam-filer not to be filtered to spams
$oSpamController = getController('spamfilter');
$oSpamController->setAvoidLog();
$oDocumentAdminController = getAdminController('document');
if ($type == 'move') {
if (!$module_srl) {
return new Object(-1, 'fail_to_move');
}
$output = $oDocumentAdminController->moveDocumentModule($document_srl_list, $module_srl, $category_srl);
if (!$output->toBool()) {
return new Object(-1, 'fail_to_move');
}
$msg_code = 'success_moved';
} else {
if ($type == 'copy') {
if (!$module_srl) {
return new Object(-1, 'fail_to_move');
}
$output = $oDocumentAdminController->copyDocumentModule($document_srl_list, $module_srl, $category_srl);
if (!$output->toBool()) {
return new Object(-1, 'fail_to_move');
}
$msg_code = 'success_copied';
} else {
if ($type == 'delete') {
$oDB =& DB::getInstance();
$oDB->begin();
for ($i = 0; $i < $document_srl_count; $i++) {
$document_srl = $document_srl_list[$i];
$output = $this->deleteDocument($document_srl, true);
if (!$output->toBool()) {
return new Object(-1, 'fail_to_delete');
}
}
$oDB->commit();
$msg_code = 'success_deleted';
} else {
if ($type == 'trash') {
$args = new stdClass();
$args->description = $message_content;
$oDB =& DB::getInstance();
$oDB->begin();
for ($i = 0; $i < $document_srl_count; $i++) {
$args->document_srl = $document_srl_list[$i];
$output = $this->moveDocumentToTrash($args);
if (!$output || !$output->toBool()) {
return new Object(-1, 'fail_to_trash');
}
}
//.........这里部分代码省略.........
开发者ID:rhymix,项目名称:rhymix,代码行数:101,代码来源:document.controller.php
示例18: _replaceLangCode
function _replaceLangCode($matches)
{
static $lang = null;
if (is_null($lang)) {
$site_module_info = Context::get('site_module_info');
if (!$site_module_info) {
$oModuleModel =& getModel('module');
$site_module_info = $oModuleModel->getDefaultMid();
Context::set('site_module_info', $site_module_info);
}
$cache_file = sprintf('%sfiles/cache/lang_defined/%d.%s.php', _XE_PATH_, $site_module_info->site_srl, Context::getLangType());
if (!file_exists($cache_file)) {
$oModuleAdminController =& getAdminController('module');
$oModuleAdminController->makeCacheDefinedLangCode($site_module_info->site_srl);
}
if (file_exists($cache_file)) {
$moduleAdminControllerMtime = filemtime(_XE_PATH_ . 'modules/module/module.admin.controller.php');
$cacheFileMtime = filemtime($cache_file);
if ($cacheFileMtime < $moduleAdminControllerMtime) {
$oModuleAdminController =& getAdminController('module');
$oModuleAdminController->makeCacheDefinedLangCode($site_module_info->site_srl);
}
require_once $cache_file;
}
}
if (!Context::get($matches[1]) && $lang[$matches[1]]) {
return $lang[$matches[1]];
}
return str_replace('$user_lang->', '', $matches[0]);
}
开发者ID:relip,项目名称:xe-core,代码行数:30,代码来源:module.controller.php
示例19: moduleUninstall
/**
* @bvrief 모듈 제거
*/
function moduleUninstall()
{
// allianceXE의 model class
$oAllianceModel = getModel('alliance');
// 연합 정보를 구함
$alliance_info = $oAllianceModel->getAllianceInfo();
// 연합 정보가 있다면 처리
if ($alliance_info) {
// allianceXE의 admin controller class
$oAllianceAdminController = getAdminController('alliance');
// 연합 관리자일 경우 연합 해체
if ($oAllianceModel->isGranted($alliance_info)) {
$oAllianceAdminController->procAllianceAdminBreakup($alliance_info);
} else {
// 아니면 탈퇴 처리
$oAllianceAdminController->procAllianceAdminLeave($alliance_info);
}
}
return new Object();
}
开发者ID:haegyung,项目名称:alliancexe,代码行数:23,代码来源:alliance.class.php
示例20: procInstall
/**
* @brief Install with received information
*/
function procInstall()
{
// Check if it is already installed
if (Context::isInstalled()) {
return new Object(-1, 'msg_already_installed');
}
// Assign a temporary administrator when installing
$logged_info = new stdClass();
$logged_info->is_admin = 'Y';
Context::set('logged_info', $logged_info);
// check install config
if (Context::get('install_config')) {
$db_info = $this->_makeDbInfoByInstallConfig();
} else {
if (FileHandler::exists($this->db_tmp_config_file)) {
include $this->db_tmp_config_file;
}
if (FileHandler::exists($this->etc_tmp_config_file)) {
include $this->etc_tmp_config_file;
}
}
// Set DB type and information
Context::setDBInfo($db_info);
// Create DB Instance
$oDB =& DB::getInstance();
// Check if available to connect to the DB
if (!$oDB->isConnected()) {
return $oDB->getError();
}
// Install all the modules
try {
$oDB->begin();
$this->installDownloadedModule();
$oDB->commit();
} catch (Exception $e) {
$oDB->rollback();
return new Object(-1, $e->getMessage());
}
// Create a config file
if (!$this->makeConfigFile()) {
return new Object(-1, 'msg_install_failed');
}
// load script
$scripts = FileHandler::readDir(_XE_PATH_ . 'modules/install/script', '/(\\.php)$/');
if (count($scripts) > 0) {
sort($scripts);
foreach ($scripts as $script) {
$script_path = FileHandler::getRealPath('./modules/install/script/');
$output = (include $script_path . $script);
}
}
// save selected lang info
$oInstallAdminController = getAdminController('install');
$oInstallAdminController->saveLangSelected(array(Context::getLangType()));
// Display a message that installation is completed
$this->setMessage('msg_install_completed');
unset($_SESSION['use_rewrite']);
if (!in_array(Context::getRequestMethod(), array('XMLRPC', 'JSON'))) {
$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('');
header('location:' . $returnUrl);
return new Object();
}
}
开发者ID:rubythonode,项目名称:xe-core,代码行数:66,代码来源:install.controller.php
注:本文中的getAdminController函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论