Ejemplo n.º 1
0
 /**
  * Constructor
  *
  * @param 	object 	An optional KConfig object with configuration options.
  */
 public function __construct(KConfig $config)
 {
     parent::__construct($config);
     // Set the view identifier
     if (!empty($config->view)) {
         $this->setView($config->view);
     }
 }
Ejemplo n.º 2
0
 /**
  * Constructor
  *
  * @param array An optional associative array of configuration settings.
  */
 public function __construct(array $options = array())
 {
     parent::__construct($options);
     // Register extra tasks
     $this->registerTask('disable', 'enable');
     $this->registerTask('apply', 'save');
     $this->registerTask('add', 'edit');
 }
 /**
  * @param KObjectConfig $config
  */
 public function __construct(KObjectConfig $config)
 {
     parent::__construct($config);
     @set_time_limit(60);
     @ini_set('memory_limit', '256M');
     @ignore_user_abort(true);
     // Set the model identifier
     $this->_model = $config->model;
 }
Ejemplo n.º 4
0
 /**
  * Constructor.
  *
  * @param 	object 	An optional KConfig object with configuration options.
  */
 public function __construct(KConfig $config)
 {
     parent::__construct($config);
     //Set the controller
     $this->_controller = $config->controller;
     if (KRequest::method() != 'GET') {
         $this->registerCallback('after.dispatch', array($this, 'forward'));
     }
     $this->registerCallback('after.dispatch', array($this, 'render'));
 }
Ejemplo n.º 5
0
 /**
  * Constructor
  *
  * @param 	object 	An optional KConfig object with configuration options.
  */
 public function __construct(KConfig $config)
 {
     parent::__construct($config);
     // Set the model identifier
     $this->_model = $config->model;
     // Set the view identifier
     $this->_view = $config->view;
     //Register display as alias for get
     $this->registerActionAlias('display', 'get');
     //Made the executable behavior read-only
     if ($this->isExecutable()) {
         $this->getBehavior('executable')->setReadOnly($config->readonly);
     }
 }
Ejemplo n.º 6
0
 /**
  * Constructor
  *
  * @param   KObjectConfig $config Configuration options
  */
 public function __construct(KObjectConfig $config)
 {
     parent::__construct($config);
     // Set the view identifier
     $this->_view = $config->view;
     //Set the supported formats
     $this->_formats = KObjectConfig::unbox($config->formats);
     // Mixin the toolbar interface
     $this->mixin('lib:controller.toolbar.mixin');
     //Attach the toolbars
     $this->addCommandCallback('before.render', '_addToolbars', array('toolbars' => $config->toolbars));
     //Load the controller translations
     $this->addCommandCallback('before.render', '_loadTranslations');
 }
Ejemplo n.º 7
0
 /**
  * Constructor.
  *
  * @param 	object 	An optional KConfig object with configuration options.
  */
 public function __construct(KConfig $config)
 {
     parent::__construct($config);
     //Set the request persistency
     $this->_request_persistent = $config->request_persistent;
     //Set the controller default
     $this->_controller_default = $config->controller_default;
     if ($config->controller !== null) {
         $this->setController($config->controller);
     }
     if (KRequest::method() != 'GET') {
         $this->registerCallback('after.dispatch', array($this, 'forward'));
     }
     $this->registerCallback('after.dispatch', array($this, 'render'));
 }
Ejemplo n.º 8
0
 /**
  * Constructor.
  *
  * @param   KObjectConfig $config Configuration options
  */
 public function __construct(KObjectConfig $config)
 {
     parent::__construct($config);
     //Set the controller
     $this->_controller = $config->controller;
     //Add the authenticators
     $authenticators = (array) KObjectConfig::unbox($config->authenticators);
     foreach ($authenticators as $key => $value) {
         if (is_numeric($key)) {
             $this->addAuthenticator($value);
         } else {
             $this->addAuthenticator($key, $value);
         }
     }
 }
Ejemplo n.º 9
0
 /**
  * Constructor
  *
  * @param 	object 	An optional KConfig object with configuration options.
  */
 public function __construct(KConfig $config)
 {
     parent::__construct($config);
     // Set the model identifier
     $this->_model = $config->model;
     // Set the view identifier
     $this->_view = $config->view;
     //Register display as alias for get
     $this->registerActionAlias('display', 'get');
     // Mixin the toolbar
     if ($config->dispatch_events) {
         $this->mixin(new KMixinToolbar($config->append(array('mixer' => $this))));
     }
     //Made the executable behavior read-only
     if ($this->isExecutable()) {
         $this->getBehavior('executable')->setReadOnly($config->readonly);
     }
 }
Ejemplo n.º 10
0
 /**
  * Constructor.
  *
  * @param   object  An optional KConfig object with configuration options.
  */
 public function __construct(KConfig $config)
 {
     parent::__construct($config);
     $this->_response = $config->response;
 }