コード例 #1
0
ファイル: autocomplete.php プロジェクト: raeldc/nooku-server
 /**
  * Search the mixin method map and call the method or trigger an error
  * 
  * This function check to see if the method exists in the mixing map if not
  * it will call the 'autocomplete' function. The method name will become the 'name'
  * in the config array.
  * 
  * This can be used to auto-magically create autocomplete select lists based on the 
  * function name.
  *
  * @param  string   The function name
  * @param  array    The function arguments
  * @throws BadMethodCallException   If method could not be found
  * @return mixed The result of the function
  */
 public function __call($method, array $arguments)
 {
     if (!in_array($method, $this->getMethods())) {
         $config = $arguments[0];
         $config['model'] = KInflector::pluralize(strtolower($method));
         return $this->_autocomplete($config);
     }
     return parent::__call($method, $arguments);
 }
コード例 #2
0
ファイル: behavior.php プロジェクト: stonyyi/anahita
 /**
  * Keep session alive
  *
  * This will send an ascynchronous request to the server via AJAX on an interval
  *
  * @return string   The html output
  */
 public function keepalive($config = array())
 {
     //Get the config session lifetime
     $lifetime = JFactory::getSession()->getExpire() * 1000;
     //Refresh time is 1 minute less than the liftime
     $refresh = $lifetime <= 60000 ? 30000 : $lifetime - 60000;
     $config = new KConfig($config);
     $config->append(array('refresh' => $refresh));
     return parent::keepalive($config);
 }
コード例 #3
0
ファイル: debug.php プロジェクト: daodaoliang/nooku-framework
 /**
  * Constructor
  *
  * @param   KObjectConfig $config Configuration options
  */
 public function __construct(KObjectConfig $config)
 {
     parent::__construct($config);
     //Set the editors
     $this->_editor = $config->editor;
     $this->_editors = $config->editors;
     if (ini_get('xdebug.file_link_format') || extension_loaded('xdebug')) {
         // Register editor using xdebug's file_link_format option.
         $this->_editors['xdebug'] = array($this, '_getXdebugPath');
         // If no editor is set use xdebug
         if (empty($this->_editor)) {
             $this->_editor = 'xdebug';
         }
     }
 }
コード例 #4
0
 /**
  * Loads the Koowa customized jQtree behavior and renders a sidebar-nav list useful in split views
  *
  * @see    http://mbraak.github.io/jqTree/
  *
  * @note   If no 'element' option is passed, then only assets will be loaded.
  *
  * @param  array|KObjectConfig $config
  * @throws InvalidArgumentException
  * @return string    The html output
  */
 public function tree($config = array())
 {
     $config = new KObjectConfigJson($config);
     $config->append(array('debug' => JFactory::getApplication()->getCfg('debug')));
     return parent::tree($config);
 }
コード例 #5
0
 /**
  * Constructor
  *
  * @param array Associative array of values
  */
 public function __construct(KConfig $params)
 {
     parent::__construct($params);
     //Load mootools javascript
     $this->mootools();
 }