Ejemplo n.º 1
0
 public function users($config = array())
 {
     $config = new KConfig($config);
     $config->append(array('model' => 'users', 'name' => 'id', 'filter' => array('group' => 18, 'group_tree' => true)));
     //@TODO : Fix - Forcing config option because of name collisions
     $config->text = 'name';
     $config->sort = 'name';
     return parent::_render($config);
 }
Ejemplo n.º 2
0
 /**
  * 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 'listbox' function. The method name will become the 'name'
  * in the config array.
  * 
  * This can be used to auto-magically create select filters based on the 
  * function name.
  *
  * Overriden as we only want to set the name if we haven't provided one @todo report this
  *
  * @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];
         if (!$config['name']) {
             $config['name'] = KInflector::singularize(strtolower($method));
         }
         return $this->_render($config);
     }
     return parent::__call($method, $arguments);
 }
Ejemplo n.º 3
0
    public function category( $config = array())
	{
		$config = new KConfig($config);
		$config->append(array(
			'model'		=> 'categories',
			'name' 		=> 'category',
			'value'		=> 'id',
			'text'		=> 'title',
		));

		return parent::_listbox($config);
	}
Ejemplo n.º 4
0
    public function authors($config = array())
    {
        $config = new KConfig($config);
		$config->append(array(
			'model'		=> 'articles',
			'name' 		=> 'created_by',
			'value'		=> 'created_by_id',
			'text'		=> 'created_by_name',
		));

		return parent::_listbox($config);
    }
Ejemplo n.º 5
0
	public function groups( $config = array())
	{	
	    $config = new KConfig($config);
		$config->append(array(
			'model'		=> 'groups',
			'name' 		=> 'group',
			'value'		=> 'name',
			'text'		=> 'name'
		));
	
		return parent::_listbox($config);
	}
Ejemplo n.º 6
0
  	public function sites( $config = array() )
   	{
     	$config = new KConfig($config);
       	$config->append(array(
          	'model' => 'sites',
           	'name' => 'site',
            'value' => 'name',
        	'text' => 'name',
          	'deselect' => false
       	));

      	return parent::_listbox($config);
 	}
Ejemplo n.º 7
0
 public function category($config = array())
 {
     $config = new KConfig($config);
     $config->append(array('identifier' => 'com://admin/categories.model.categories', 'name' => 'category', 'value' => 'id', 'text' => 'title', 'filter' => array('section' => 'com_contact')));
     return parent::_listbox($config);
 }
Ejemplo n.º 8
0
 public function adapters($config = array())
 {
     $config = new KConfig($config);
     $config->append(array('value' => 'value', 'text' => 'text', 'name' => 'adapter', 'options' => array(array('text' => 'Please select your adapter', 'value' => null), array('text' => 'YouTube', 'value' => 'youtube'), array('text' => 'Vimeo', 'value' => 'vimeo'))));
     return parent::optionlist($config);
 }
Ejemplo n.º 9
0
 public function business($config = array())
 {
     $config = new KConfig($config);
     $config->append(array('model' => 'businesses', 'value' => 'id', 'text' => 'title'));
     return parent::_listbox($config);
 }
Ejemplo n.º 10
0
 /**
  * Overridden to fix the Bootstrap problem with size=1 select boxes
  *
  * @see KTemplateHelperSelect::optionlist()
  */
 public function optionlist($config = array())
 {
     $html = parent::optionlist($config);
     $html = preg_replace('#size="1"#', '', $html, 1);
     return $html;
 }
Ejemplo n.º 11
0
 public function forms($config = array())
 {
     $config = new KConfig($config);
     $config->append(array('model' => 'forms', 'value' => 'id', 'text' => 'title', 'name' => 'wufoo_form_id', 'deselect' => true));
     return parent::_listbox($config);
 }