74 lines
1.7 KiB
PHP
74 lines
1.7 KiB
PHP
|
<?php defined('SYSPATH') or die('No direct access allowed.');
|
||
|
|
||
|
/**
|
||
|
* This class provides Siet Configuration Setup
|
||
|
*
|
||
|
* @package OSB
|
||
|
* @category Controllers/Admin
|
||
|
* @author Deon George
|
||
|
* @copyright (c) 2009-2013 Open Source Billing
|
||
|
* @license http://dev.osbill.net/license.html
|
||
|
*/
|
||
|
class Controller_Admin_Setup extends Controller_TemplateDefault {
|
||
|
protected $secure_actions = array(
|
||
|
'edit'=>TRUE,
|
||
|
);
|
||
|
|
||
|
/**
|
||
|
* View/Update the site configuration
|
||
|
*/
|
||
|
public function action_edit() {
|
||
|
$o = Company::instance()->so();
|
||
|
$output = '';
|
||
|
|
||
|
if ($_POST) {
|
||
|
// Entry updated
|
||
|
if ($o->values($_POST)->check() AND $o->save())
|
||
|
SystemMessage::add(array(
|
||
|
'title'=>'Site Configuration Recorded',
|
||
|
'type'=>'info',
|
||
|
'body'=>'Site Config successfully recorded.',
|
||
|
));
|
||
|
}
|
||
|
|
||
|
$output .= Form::open();
|
||
|
|
||
|
// site_details
|
||
|
$output .= View::factory($this->viewpath())
|
||
|
->set('o',$o);;
|
||
|
|
||
|
$output .= '<div>'.Form::submit('submit','submit',array('class'=>'form_button')).'</div>';
|
||
|
$output .= Form::close();
|
||
|
|
||
|
Block::add(array(
|
||
|
'title'=>_('Update Site Configuration'),
|
||
|
'body'=>$output,
|
||
|
));
|
||
|
|
||
|
// module_config
|
||
|
$output = '';
|
||
|
$output .= View::factory($this->viewpath().'/module/head');
|
||
|
|
||
|
foreach ($o->module_config as $mid => $detail) {
|
||
|
$mo = ORM::factory('Module',$mid);
|
||
|
|
||
|
$output .= View::factory($this->viewpath().'/module/body')
|
||
|
->set('mo',$mo);
|
||
|
|
||
|
Script::add(array('type'=>'stdin','data'=>'
|
||
|
$(document).ready(function() {
|
||
|
$("div[id='.$mo->name.']").load("'.URL::link('admin',$mo->name.'/setup',TRUE).'");
|
||
|
});'
|
||
|
));
|
||
|
}
|
||
|
|
||
|
$output .= View::factory($this->viewpath().'/module/foot');
|
||
|
|
||
|
Block::add(array(
|
||
|
'title'=>_('Update Module Specific Configuration'),
|
||
|
'body'=>$output,
|
||
|
));
|
||
|
}
|
||
|
}
|
||
|
?>
|