47 lines
1.3 KiB
PHP
47 lines
1.3 KiB
PHP
<?php defined('SYSPATH') or die('No direct access allowed.');
|
|
|
|
/**
|
|
* lnApp User Main home page controller
|
|
*
|
|
* @package OSB
|
|
* @category Controllers/Admin
|
|
* @author Deon George
|
|
* @copyright (c) 2009-2013 Open Source Billing
|
|
* @license http://dev.osbill.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()->module_config($module,$_POST['module_config'][$module])->save();
|
|
|
|
if ($config_items) {
|
|
$output = '';
|
|
$mc = Config::instance()->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',isset($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,
|
|
));
|
|
}
|
|
}
|
|
}
|
|
?>
|