git-svn-id: http://xe-core.googlecode.com/svn/trunk@161 201d5d3c-b55e-5fd7-737f-ddc643e51545

This commit is contained in:
zero 2007-02-23 02:16:47 +00:00
parent b3a839ae94
commit c054d03df0
7 changed files with 34 additions and 24 deletions

View file

@ -93,14 +93,13 @@
$xml_info = $oModuleModel->getModuleXmlInfo($this->module); $xml_info = $oModuleModel->getModuleXmlInfo($this->module);
// 현재 요청된 act가 있으면 $xml_info에서 type을 찾음, 없다면 기본 action을 이용 // 현재 요청된 act가 있으면 $xml_info에서 type을 찾음, 없다면 기본 action을 이용
if(!$this->act || !$xml_info->action->{$this->act}) $this->act = $xml_info->default_action; if(!$this->act || !$xml_info->action->{$this->act}) $this->act = $xml_info->default_index_act;
// 설정된 mid가 없을 경우 요청된 act의 standalone 여부 체크 // 설정된 mid가 없을 경우 요청된 act의 standalone 여부 체크
if(!$this->mid && !$xml_info->action->{$this->act}->standalone) { if(!$this->mid && !$xml_info->action->{$this->act}->standalone) {
$this->error = 'msg_module_is_not_standalone'; $this->error = 'msg_module_is_not_standalone';
return; return;
} }
// type, grant 값 구함 // type, grant 값 구함
$type = $xml_info->action->{$this->act}->type; $type = $xml_info->action->{$this->act}->type;
$grant = $xml_info->action->{$this->act}->grant; $grant = $xml_info->action->{$this->act}->grant;

View file

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<module default_action="dispIndex"> <module>
<actions> <actions>
<action name="dispIndex" type="view" standalone="true" /> <action name="dispIndex" type="view" standalone="true" index="true"/>
<action name="dispModuleList" type="view" standalone="true" /> <action name="dispModuleList" type="view" standalone="true" />
<action name="dispLogin" type="view" standalone="true" /> <action name="dispLogin" type="view" standalone="true" />

View file

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<module default_action="dispIntroduce"> <module>
<grants /> <grants />
<actions> <actions>
<action name="dispIntroduce" type="view" standalone="true" /> <action name="dispIntroduce" type="view" standalone="true" index="true" />
<action name="dispInstallForm" type="view" standalone="true" /> <action name="dispInstallForm" type="view" standalone="true" />
<action name="procInstall" type="controller" standalone="true" /> <action name="procInstall" type="controller" standalone="true" />
</actions> </actions>

View file

@ -1,8 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<module default_action="viewIntroduce"> <module>
<actions> <actions>
<action name="viewIntroduce" type="view" />
<action name="viewDBInfoForm" type="view" />
<action name="doInstall" type="controller" />
</actions> </actions>
</module> </module>

View file

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<module default_action="dispMessage"> <module>
<grants /> <grants />
<actions> <actions>
<action name="dispMessage" type="view" standalone="true" /> <action name="dispMessage" type="view" standalone="true" index="true"/>
</actions> </actions>
</module> </module>

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<module default_action="dispContent"> <module>
<actions> <actions>
<action name="dispContent" type="view" standalone="true" /> <action name="dispContent" type="view" standalone="true" index="true" />
</actions> </actions>
</module> </module>

View file

@ -21,7 +21,6 @@
* 이게 퍼포먼스 상으로는 좋은데 어떤 부정적인 결과를 유도할지는 모르겠... * 이게 퍼포먼스 상으로는 좋은데 어떤 부정적인 결과를 유도할지는 모르겠...
**/ **/
function getModuleXmlInfo($module) { function getModuleXmlInfo($module) {
$module = "board";
// 요청된 모듈의 경로를 구한다. 없으면 return // 요청된 모듈의 경로를 구한다. 없으면 return
$class_path = ModuleHandler::getModulePath($module); $class_path = ModuleHandler::getModulePath($module);
if(!$class_path) return; if(!$class_path) return;
@ -57,8 +56,11 @@
$default = $grant->attrs->default?$grant->attrs->default:'guest'; $default = $grant->attrs->default?$grant->attrs->default:'guest';
$title = $grant->title->body; $title = $grant->title->body;
$buff .= sprintf('$info->grant->%s->title=\'%s\';%s', $name, $title, chr(13)); $info->grant->{$name}->title = $title;
$buff .= sprintf('$info->grant->%s->default=\'%s\';%s', $name, $default, chr(13)); $info->grant->{$name}->default = $default;
$buff .= sprintf('$info->grant->%s->title=\'%s\';', $name, $title);
$buff .= sprintf('$info->grant->%s->default=\'%s\';', $name, $default);
} }
} }
@ -81,20 +83,32 @@
$output->action->{$name}->grant = $grant; $output->action->{$name}->grant = $grant;
$output->action->{$name}->standalone= $standalone; $output->action->{$name}->standalone= $standalone;
$buff .= sprintf('$info->action->%s->type=\'%s\';%s', $name, $type, chr(13)); $info->action->{$name}->type = $type;
$buff .= sprintf('$info->action->%s->grant=\'%s\';%s', $name, $grant, chr(13)); $info->action->{$name}->grant = $grant;
$buff .= sprintf('$info->action->%s->standalone=%s;%s', $name, $standalone, chr(13)); $info->action->{$name}->standalone = $standalone=='true'?true:false;
if($index=='true') $default_index_act = $name; $buff .= sprintf('$info->action->%s->type=\'%s\';', $name, $type);
if($admin_index=='true') $admin_index_act = $name; $buff .= sprintf('$info->action->%s->grant=\'%s\';', $name, $grant);
$buff .= sprintf('$info->action->%s->standalone=%s;', $name, $standalone);
if($index=='true') {
$default_index_act = $name;
$info->default_index_act = $name;
}
if($admin_index=='true') {
$admin_index_act = $name;
$info->admin_index_act = $name;
} }
} }
$buff = sprintf('<?php%sif(!__ZB5__) exit();%s$info->default_index = \'%s\';%s$info->admin_index = \'%s\';%s%s?>', chr(13), chr(13), $default_index_act, chr(13), $admin_index_act, chr(13), $buff); }
$buff = sprintf('<?php if(!__ZB5__) exit();$info->default_index_act = \'%s\';$info->admin_index_act = \'%s\';%s?>', $default_index_act, $admin_index_act, $buff);
FileHandler::writeFile($cache_file, $buff); FileHandler::writeFile($cache_file, $buff);
return $info;
} }
if(file_exists($cache_file)) include $cache_file; include $cache_file;
return $info; return $info;
} }