Example #1
0
 /**
  * Constructor
  *
  * @param 	object 	An optional KConfig object with configuration options
  */
 public function __construct(KConfig $config)
 {
     if (!$config->request) {
         $config->request = new KConfig();
     }
     $config->request->append(array('layout' => 'default'));
     parent::__construct($config);
 }
Example #2
0
 /**
  * Constructor
  *
  * @param 	object 	An optional KConfig object with configuration options
  */
 public function __construct(KConfig $options)
 {
     parent::__construct($options);
     $this->registerCallback('after.add', array($this, 'addColumn'));
     $this->registerCallback('before.edit', array($this, 'setColumnName'));
     $this->registerCallback('after.edit', array($this, 'changeColumn'));
     $this->registerCallback('after.delete', array($this, 'dropColumn'));
 }
Example #3
0
 /**
  * Constructor
  *
  * @param 	object 	An optional KConfig object with configuration options.
  */
 public function __construct(KConfig $config)
 {
     parent::__construct($config);
     $this->registerCallback('before.browse', array($this, 'setDefault'));
     $this->registerCallback('before.save', array($this, 'resetDefaults'));
     $this->registerCallback('before.apply', array($this, 'resetDefaults'));
     $this->registerCallback('before.edit', array($this, 'resetDefaults'));
     $this->registerCallback('after.save', array($this, 'overrideRedirect'));
     $this->registerCallback('after.cancel', array($this, 'overrideRedirect'));
 }
Example #4
0
 /**
  * Constructor
  *
  * @param 	object 	An optional KConfig object with configuration options
  */
 public function __construct(KConfig $config)
 {
     parent::__construct($config);
     $this->registerCallback('before.display', array($this, 'checkInstall'));
     $cache = JPATH_ROOT . '/cache/com_' . $this->getIdentifier()->package . '/maintenance.txt';
     if (!JFile::exists($cache)) {
         if (KFactory::get('admin::com.ninjaboard.controller.maintenance')->topics() && KFactory::get('admin::com.ninjaboard.controller.maintenance')->forums()) {
             JFile::write($cache, date('r'));
         }
     }
 }
Example #5
0
 /**
  * Constructor
  *
  * @param array An optional associative array of configuration settings.
  */
 public function __construct(KConfig $options)
 {
     parent::__construct($options);
     //Set template path
     if (empty($options->extension) && empty($options->group)) {
         $options->extension = $this->_identifier->package;
         $options->group = KInflector::pluralize($this->_identifier->name);
     }
     $this->_basepath = KInflector::pluralize($options->extension) == 'modules' ? JPATH_SITE . DS . 'modules' . DS . 'mod_' . $options->group . DS . 'tmpl' : JPATH_SITE . DS . 'components' . DS . 'com_' . $options->extension . DS . KInflector::pluralize($options->group);
     $this->installer = !empty($options->installer) ? $options->installer : null;
 }
Example #6
0
 /**
  * Constructor
  *
  * @param 	object 	An optional KConfig object with configuration options
  */
 public function __construct(KConfig $config)
 {
     $config->append(array('request' => array('import' => 'demo')));
     parent::__construct($config);
     // Make sure that only super admins can do imports
     $this->registerCallback(array('before.display', 'before.import'), array($this, 'authorize'));
     $this->registerCallback('before.display', array($this, 'raiseNotice'));
     //If there's a shortcut, run the fireShortcut function
     if (isset($this->_request->shortcut)) {
         $this->registerCallback('after.display', array($this, 'fireShortcut'));
     }
     $cache = JPATH_ROOT . '/cache/com_' . $this->getIdentifier()->package;
     if (JFolder::exists($cache)) {
         JFolder::delete($cache);
     }
 }
Example #7
0
 /**
  * Constructor
  *
  * @param 	object 	An optional KConfig object with configuration options
  */
 public function __construct(KConfig $options)
 {
     parent::__construct($options);
     $this->registerActionAlias('add', 'edit')->registerActionAlias('apply', 'save');
 }