mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-03 16:51:40 +09:00
Extend action_forward feature to include route info
This commit is contained in:
parent
a08ec31f2b
commit
5dcb0d332b
4 changed files with 30 additions and 3 deletions
|
|
@ -131,6 +131,11 @@ class module extends ModuleObject
|
|||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
// check route columns in action_forward table
|
||||
if(!$oDB->isColumnExists('action_forward', 'route_method')) return true;
|
||||
if(!$oDB->isColumnExists('action_forward', 'route_regexp')) return true;
|
||||
if(!$oDB->isColumnExists('action_forward', 'route_config')) return true;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -448,6 +453,20 @@ class module extends ModuleObject
|
|||
$oDB->addIndex('module_part_config', 'unique_module_part_config', array('module', 'module_srl'), false);
|
||||
}
|
||||
}
|
||||
|
||||
// check route columns in action_forward table
|
||||
if(!$oDB->isColumnExists('action_forward', 'route_method'))
|
||||
{
|
||||
$oDB->addColumn('action_forward', 'route_method', 'varchar', 30);
|
||||
}
|
||||
if(!$oDB->isColumnExists('action_forward', 'route_regexp'))
|
||||
{
|
||||
$oDB->addColumn('action_forward', 'route_regexp', 'varchar', 180);
|
||||
}
|
||||
if(!$oDB->isColumnExists('action_forward', 'route_config'))
|
||||
{
|
||||
$oDB->addColumn('action_forward', 'route_config', 'text');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -19,13 +19,15 @@ class moduleController extends module
|
|||
* Action forward finds and forwards if an action is not in the requested module
|
||||
* This is used when installing a module
|
||||
*/
|
||||
function insertActionForward($module, $type, $act)
|
||||
function insertActionForward($module, $type, $act, $route_method = null, $route_regexp = null, $route_config = null)
|
||||
{
|
||||
$args = new stdClass();
|
||||
$args->module = $module;
|
||||
$args->type = $type;
|
||||
$args->act = $act;
|
||||
|
||||
$args->route_method = $route_method;
|
||||
$args->route_regexp = $route_regexp;
|
||||
$args->route_config = $route_config;
|
||||
$output = executeQuery('module.insertActionForward', $args);
|
||||
|
||||
Rhymix\Framework\Cache::delete('action_forward');
|
||||
|
|
|
|||
|
|
@ -6,5 +6,8 @@
|
|||
<column name="act" var="act" notnull="notnull" />
|
||||
<column name="module" var="module" notnull="notnull" />
|
||||
<column name="type" var="type" notnull="notnull" />
|
||||
<column name="route_method" var="route_method" />
|
||||
<column name="route_regexp" var="route_regexp" />
|
||||
<column name="route_config" var="route_config" />
|
||||
</columns>
|
||||
</query>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,8 @@
|
|||
<table name="action_forward">
|
||||
<column name="act" type="varchar" size="80" notnull="notnull" unique="idx_foward" />
|
||||
<column name="act" type="varchar" size="80" notnull="notnull" primary_key="primary_key" />
|
||||
<column name="module" type="varchar" size="60" notnull="notnull" />
|
||||
<column name="type" type="varchar" size="15" notnull="notnull" />
|
||||
<column name="route_method" type="varchar" size="30" />
|
||||
<column name="route_regexp" type="varchar" size="180" />
|
||||
<column name="route_config" type="text" />
|
||||
</table>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue