2011-12-30 07:10:02 +00:00
|
|
|
<?php defined('SYSPATH') or die('No direct access allowed.');
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This class provides Siet Configuration Setup
|
|
|
|
*
|
|
|
|
* @package lnApp
|
|
|
|
* @subpackage Page/Setup
|
|
|
|
* @category Controllers
|
|
|
|
* @author Deon George
|
|
|
|
* @copyright (c) 2010 Deon George
|
|
|
|
* @license http://dev.leenooks.net/license.html
|
|
|
|
*/
|
|
|
|
class Controller_Admin_Setup extends Controller_TemplateDefault_Admin {
|
|
|
|
protected $secure_actions = array(
|
|
|
|
'edit'=>TRUE,
|
|
|
|
);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* View/Update the site configuration
|
|
|
|
*/
|
|
|
|
public function action_edit() {
|
|
|
|
$o = Config::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();
|
2012-01-02 01:35:47 +00:00
|
|
|
|
|
|
|
// site_details
|
2011-12-30 07:10:02 +00:00
|
|
|
$output .= View::factory($this->viewpath())
|
|
|
|
->set('o',$o);;
|
2012-01-02 01:35:47 +00:00
|
|
|
|
|
|
|
$output .= '<div>'.Form::submit('submit','submit',array('class'=>'form_button')).'</div>';
|
2011-12-30 07:10:02 +00:00
|
|
|
$output .= Form::close();
|
|
|
|
|
|
|
|
Block::add(array(
|
|
|
|
'title'=>_('Update Site Configuration'),
|
|
|
|
'body'=>$output,
|
|
|
|
));
|
2012-01-02 01:35:47 +00:00
|
|
|
|
|
|
|
// module_config
|
|
|
|
$output = '';
|
|
|
|
$output .= View::factory($this->viewpath().'/module/head');
|
|
|
|
|
|
|
|
foreach ($o->module_config as $mid => $detail) {
|
2012-11-09 23:13:57 +00:00
|
|
|
$mo = ORM::factory('Module',$mid);
|
2012-01-02 01:35:47 +00:00
|
|
|
|
|
|
|
$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::site('admin/'.$mo->name.'/setup').'");
|
|
|
|
});'
|
|
|
|
));
|
|
|
|
}
|
|
|
|
|
|
|
|
$output .= View::factory($this->viewpath().'/module/foot');
|
|
|
|
|
|
|
|
Block::add(array(
|
|
|
|
'title'=>_('Update Module Specific Configuration'),
|
|
|
|
'body'=>$output,
|
|
|
|
));
|
2011-12-30 07:10:02 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
?>
|