css 및 js 호출순서 조정기능 추가

git-svn-id: http://xe-core.googlecode.com/svn/sandbox@5785 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
ngleader 2009-03-06 05:33:56 +00:00
parent 4f380d9c48
commit 61851f1dfe
2149 changed files with 109090 additions and 18689 deletions

View file

@ -11,15 +11,6 @@
* @brief 설치시 추가 작업이 필요할시 구현
**/
function moduleInstall() {
// action forward에 등록 (관리자 모드에서 사용하기 위함)
$oModuleController = &getController('module');
$oModuleController->insertActionForward('layout', 'view', 'dispLayoutAdminContent');
$oModuleController->insertActionForward('layout', 'view', 'dispLayoutAdminInsert');
$oModuleController->insertActionForward('layout', 'view', 'dispLayoutAdminModify');
$oModuleController->insertActionForward('layout', 'view', 'dispLayoutAdminEdit');
$oModuleController->insertActionForward('layout', 'view', 'dispLayoutAdminDownloadedList');
$oModuleController->insertActionForward('layout', 'view', 'dispLayoutAdminInfo');
// 레이아웃에서 사용할 디렉토리 생성
FileHandler::makeDir('./files/cache/layout');
@ -30,6 +21,18 @@
* @brief 설치가 이상이 없는지 체크하는 method
**/
function checkUpdate() {
$oDB = &DB::getInstance();
// 2009. 02. 11 layout 테이블에 site_srl 추가
if(!$oDB->isColumnExists('layouts', 'site_srl')) return true;
// 2009. 02. 26 faceOff에 맞춰 기존 레이아웃 편집본을 이동
$files = FileHandler::readDir('./files/cache/layout');
for($i=0,$c=count($files);$i<$c;$i++) {
$filename = $files[$i];
if(preg_match('/([0-9]+)\.html/i',$filename)) return true;
}
return false;
}
@ -37,9 +40,31 @@
* @brief 업데이트 실행
**/
function moduleUpdate() {
return new Object();
$oDB = &DB::getInstance();
// 2009. 02. 11 menu 테이블에 site_srl 추가
if(!$oDB->isColumnExists('layouts', 'site_srl')) {
$oDB->addColumn('layouts','site_srl','number',11,0,true);
}
// 2009. 02. 26 faceOff에 맞춰 기존 레이아웃 편집본을 이동
$oLayoutModel = &getModel('layout');
$files = FileHandler::readDir('./files/cache/layout');
for($i=0,$c=count($files);$i<$c;$i++) {
$filename = $files[$i];
if(!preg_match('/([0-9]+)\.html/i',$filename,$match)) continue;
$layout_srl = $match[1];
if(!$layout_srl) continue;
$path = $oLayoutModel->getUserLayoutPath($layout_srl);
if(!is_dir($path)) FileHandler::makeDir($path);
FileHandler::copyFile('./files/cache/layout/'.$filename, $path.'layout.html');
@unlink('./files/cache/layout/'.$filename);
}
return new Object(0, 'success_updated');
}
/**
* @brief 캐시 파일 재생성
**/
@ -50,6 +75,7 @@
FileHandler::makeDir($path);
return;
}
$directory = dir($path);
while($entry = $directory->read()) {
if ($entry == "." || $entry == ".." || preg_match('/\.html$/i',$entry) ) continue;
@ -57,52 +83,5 @@
}
$directory->close();
}
/**
* @brief 권한 체크를 실행하는 method
* 모듈 객체가 생성된 경우는 직접 권한을 체크하지만 기능성 모듈등 스스로 객체를 생성하지 않는 모듈들의 경우에는
* ModuleObject에서 직접 method를 호출하여 권한을 확인함
*
* isAdminGrant는 관리권한 이양시에만 사용되도록 하고 기본은 false로 return 되도록 하여 잘못된 권한 취약점이 생기지 않도록 주의하여야
**/
function isAdmin() {
// 로그인이 되어 있지 않으면 무조건 return false
$is_logged = Context::get('is_logged');
if(!$is_logged) return false;
// 사용자 아이디를 구함
$logged_info = Context::get('logged_info');
// 모듈 요청에 사용된 변수들을 가져옴
$args = Context::getRequestVars();
// act의 값에 따라서 관리 권한 체크
switch($args->act) {
case 'procLayoutAdminUpdate' :
case 'dispLayoutAdminPreview' :
case 'procLayoutAdminCodeReset' :
case 'procLayoutAdminCodeUpdate' :
// 레이아웃 정보에 할당된 srl이 없으면 패스
if(!$args->layout_srl) return false;
// 모듈중 레이아웃이 해당 srl에 연결될 것이 있는지 확인
$oModuleModel = &getModel('module');
$module_list = $oModuleModel->getModulesInfoByLayout($args->layout_srl);
$module_count = count($module_list);
$is_granted = false;
for($i=0;$i<$module_count;$i++) {
$module_info = $module_list[$i];
if($oModuleModel->isModuleAdmin($module_list[$i],$logged_info)) {
$is_granted = true;
break;
}
}
return $is_granted;
break;
}
return false;
}
}
?>