diff --git a/application/classes/Company.php b/application/classes/Company.php index 88ac3aed..0ff9b283 100644 --- a/application/classes/Company.php +++ b/application/classes/Company.php @@ -62,6 +62,10 @@ class Company { return $this->so->site_details('fax'); } + public function faq() { + return $this->so->site_details('faqurl'); + } + public function language() { return $this->so->language; } @@ -80,8 +84,8 @@ class Company { return $this->so->site_details('name'); } - public function module_config($item) { - return $this->so->module_config($item); + public function module_config($item,array $value=NULL) { + return $this->so->module_config($item,$value); } public function pcode() { diff --git a/application/classes/Config.php b/application/classes/Config.php index 7cb7a8d5..525cbe11 100644 --- a/application/classes/Config.php +++ b/application/classes/Config.php @@ -130,8 +130,8 @@ class Config extends Kohana_Config { return $result; } - public static function module_config($item) { - return Company::instance()->module_config($item); + public static function module_config($item,array $value=NULL) { + return Company::instance()->module_config($item,$value); } public static function module_exist($module) { diff --git a/application/classes/Controller/Admin/Setup.php b/application/classes/Controller/Admin/Setup.php index 6594e2e2..8b45a2f5 100644 --- a/application/classes/Controller/Admin/Setup.php +++ b/application/classes/Controller/Admin/Setup.php @@ -19,55 +19,29 @@ class Controller_Admin_Setup extends Controller_TemplateDefault { */ 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.', - )); - } + // Store our new values + $o->values($_POST); - $output .= Form::open(); + // Run validation and save + if ($o->changed()) + if ($o->check() AND $o->save()) + SystemMessage::factory() + ->title('Record updated') + ->type('success') + ->body(_('Your setup record has been updated.')); - // site_details - $output .= View::factory($this->viewpath()) - ->set('o',$o);; + Block::factory() + ->title('Update Site Configuration') + ->title_icon('icon-wrench') + ->type('form-horizontal') + ->body(View::factory('setup/admin/edit')->set('o',$o)); - $output .= '