save(); } catch (ORM_Validation_Exception $e) { SystemMessage::factory() ->title('Record NOT updated') ->type('error') ->body(join('
',array_values($e->errors('models')))); return FALSE; } } protected function setup(array $config_items=array()) { $mo = ORM::factory('Module',array('name'=>Request::current()->controller())); if (! $mo->loaded()) throw HTTP_Exception::factory(501,'Unknown module :module',array(':module'=>Request::current()->controller())); if ($_POST AND isset($_POST['module_config'][$mo->id])) Config::instance()->module_config($mo->name,$_POST['module_config'][$mo->id])->save(); if ($config_items) { Block::factory() ->title('Update Module Configuration') ->title_icon('icon-wrench') ->type('form-horizontal') ->body(View::factory('setup/admin/module')->set('o',Company::instance()->so())->set('mid',$mo->id)); } } } ?>