add trash module config

This commit is contained in:
BJRambo 2016-05-12 17:23:34 +09:00
parent ad19805049
commit af75450611
5 changed files with 53 additions and 0 deletions

View file

@ -7,10 +7,12 @@
</permissions>
<actions>
<action name="dispTrashAdminList" type="view" admin_index="true" menu_name="trash" menu_index="true" />
<action name="dispTrashAdminConfig" type="view" />
<action name="procTrashAdminEmptyTrash" type="controller" ruleset="emptyTrash" />
<action name="procTrashAdminRestore" type="controller" />
<action name="procTrashAdminGetList" type="controller" />
<action name="procTrashAdminConfig" type="controller" />
<action name="dispTrashAdminView" type="view" />
</actions>

View file

@ -0,0 +1 @@
<include target="./header.html" />

View file

@ -226,6 +226,23 @@ class trashAdminController extends trash
return true;
}
/**
* set trash module config
* @return void|Object
*/
function procTrashAdminConfig()
{
$oTrashModel = getModel('trash');
$config = $oTrashModel->getConfig();
$obj = Context::getRequestVars();
$this->setMessage('success_updated');
$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispTrashAdminConfig');
$this->setRedirectUrl($returnUrl);
}
}
/* End of file trash.admin.controller.php */
/* Location: ./modules/trash/trash.admin.controller.php */

View file

@ -111,6 +111,15 @@ class trashAdminView extends trash
$this->setTemplateFile('trash_view');
}
function dispTrashAdminConfig()
{
$oTrashModel = getModel('trash');
$config = $oTrashModel->getConfig();
Context::set('config', $config);
$this->setTemplateFile('config');
}
}
/* End of file trash.admin.view.php */
/* Location: ./modules/trash/trash.admin.view.php */

View file

@ -10,6 +10,30 @@
*/
class trashModel extends trash
{
private static $config = NULL;
/**
* get Tresh Module Config
*
* @return trash config
*/
function getConfig()
{
if(self::$config === NULL)
{
$oModuleModel = getModel('module');
$config = $oModuleModel->getModuleConfig('trash');
if(!$config)
{
$config = new stdClass();
}
self::$config = $config;
}
return self::$config;
}
/**
* Get one trash object
* @param int $trashSrl