This repository has been archived on 2024-04-08. You can view files and clone it, but cannot push or open issues or pull requests.
khosb/application/classes/controller/templatedefault/admin.php

48 lines
1.3 KiB
PHP
Raw Normal View History

2011-08-26 01:16:48 +00:00
<?php defined('SYSPATH') or die('No direct access allowed.');
/**
* lnApp User Main home page controller
2011-08-26 01:16:48 +00:00
*
* @package lnApp
2011-08-26 01:16:48 +00:00
* @subpackage Page/Admin
* @category Controllers
* @author Deon George
* @copyright (c) 2010 Deon George
* @license http://dev.leenooks.net/license.html
*/
class Controller_TemplateDefault_Admin extends Controller_TemplateDefault_User {
protected function setup(array $config_items=array()) {
$module = Request::current()->controller();
if ($_POST AND isset($_POST['module_config'][$module]))
Config::instance()->so->module_config($module,$_POST['module_config'][$module])->save();
if ($config_items) {
$output = '';
$mc = Config::instance()->so->module_config($module);
$output .= Form::open();
$output .= View::factory('setup/admin/module/head');
foreach ($config_items as $k=>$v)
$output .= View::factory('setup/admin/module/body')
->set('module',$module)
->set('mc',$mc)
->set('key',$k)
->set('info',$v)
->set('val',empty($mc[$k]) ? '' : $mc[$k]);
$output .= View::factory('setup/admin/module/foot');
$output .= Form::submit('submit',_('Submit'),array('class'=>'form_button'));
$output .= Form::close();
Block::add(array(
'title'=>sprintf('%s: %s',strtoupper($module),_('Configuration')),
'body'=>$output,
));
}
}
2011-08-26 01:16:48 +00:00
}
?>