All pastes #2073550 Raw Edit

Someone

public text v1 · immutable
#2073550 ·published 2011-06-02 05:43 UTC
rendered paste body
<?

	class Evocode_Options extends Backend_Controller
	{
		protected $access_for_groups = array(Users_Groups::admin);

        public $implement = 'Db_FormBehavior';

		public $form_edit_title = 'Customize';
		public $form_model_class = 'Evocode_CustomizeParams';
		
		public $form_redirect = null;
		public $form_edit_save_flash = 'The customization options have been saved.';

        public $list_control_panel_partial = null;

        public $setting_page = null;

		public function __construct()
		{
			parent::__construct();
			$this->app_module = 'evocode';
			$this->app_tab = 'evocode';
			$this->app_module_name = 'Evocode';
			$this->app_page = 'options';
		}
		  
		public function index()
		{
  			try
  			{
  				$record = Evocode_CustomizeParams::get();
  				if (!$record)
  					throw new Phpr_ApplicationException('Configuration is not 
  			}
  			catch (exception $ex)
  			{
  				$this->handlePageError($ex);
  			}
		}

		protected function index_onSave()
		{
			$record = Evocode_CustomizeParams::get();
			$this->edit_onSave($record->id);
		}
		
		protected function index_onCancel()
		{
			$record = Evocode_CustomizeParams::get();
			$this->edit_onCancel($record->id);
		}
        
		public function formCreateModelObject()
		{
        var_dump("ok");
        exit;
			$modelClass = $this->form_model_class;
            $controllerSetting = $this->setting_page;

			$obj = new $modelClass();
			$this->set_action_class($obj);

			$obj->init_columns_info();
			$obj->define_form_fields($this->formGetContext(), $controllerSetting);

			return $obj;
		}
      
	}

?>