mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-07 10:41:40 +09:00
kind가 admin이 아닐 경우 (ex. *.controller.php) 확장 모듈로 등록할 수 없는 문제 수정
This commit is contained in:
parent
9a83e71bff
commit
5bdf95932f
2 changed files with 20 additions and 27 deletions
|
|
@ -134,25 +134,32 @@ class moduleController extends module
|
|||
* @brief Add module extend
|
||||
*
|
||||
*/
|
||||
function insertModuleExtend($parent_module, $extend_module, $type, $kind='')
|
||||
function insertModuleExtend($parent_module, $extend_module, $type, $kind = '')
|
||||
{
|
||||
if($kind != 'admin') $kind = '';
|
||||
if(!in_array($type,array('model','controller','view','api','mobile'))) return false;
|
||||
if(in_array($parent_module, array('module','addon','widget','layout'))) return false;
|
||||
|
||||
$cache_file = './files/cache/common/module_extend.php';
|
||||
FileHandler::removeFile($cache_file);
|
||||
|
||||
if(!in_array($type, array('model', 'controller', 'view', 'api', 'mobile')))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if(in_array($parent_module, array('module', 'addon', 'widget', 'layout')))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
$args = new stdClass;
|
||||
$args->parent_module = $parent_module;
|
||||
$args->extend_module = $extend_module;
|
||||
$args->type = $type;
|
||||
$args->kind = $kind;
|
||||
|
||||
$output = executeQuery('module.getModuleExtendCount', $args);
|
||||
if($output->data->count>0) return false;
|
||||
|
||||
$args->kind = $kind == 'admin' ? 'admin' : '';
|
||||
|
||||
$output = executeQuery('module.insertModuleExtend', $args);
|
||||
if($output->toBool())
|
||||
{
|
||||
//remove from cache
|
||||
unset($GLOBALS['__MODULE_EXTEND__']);
|
||||
FileHandler::removeFile('files/cache/common/module_extend.php');
|
||||
}
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,14 +0,0 @@
|
|||
<query id="getModuleExtendCount" action="select">
|
||||
<tables>
|
||||
<table name="module_extend" />
|
||||
</tables>
|
||||
<columns>
|
||||
<column name="count(*)" alias="count" />
|
||||
</columns>
|
||||
<conditions>
|
||||
<condition operation="equal" column="parent_module" var="parent_module" />
|
||||
<condition operation="equal" column="extend_module" var="extend_module" pipe="and" />
|
||||
<condition operation="equal" column="type" var="type" pipe="and" />
|
||||
<condition operation="equal" column="kind" var="kind" pipe="and" />
|
||||
</conditions>
|
||||
</query>
|
||||
Loading…
Add table
Add a link
Reference in a new issue