/**
  * Generates status list box
  *
  * @todo rename to status list
  * 
  * @param array $config [optional]
  * 
  * @return html
  */
 public function statusList($config = array())
 {
     $config = new KObjectConfig($config);
     $config->append(array('name' => 'status', 'selected' => null, 'options' => $this->getConfig()->status, 'filter' => array()));
     return parent::optionlist($config);
 }
Beispiel #2
0
 public function pagecategories($config = array())
 {
     $config = new KObjectConfigJson($config);
     $config->append(array('model' => 'categories', 'select2' => true, 'page' => 'all', 'value' => 'id', 'label' => 'title', 'filter' => array('page' => $config->page), 'tree' => false))->append(array('identifier' => 'com://' . $this->getIdentifier()->domain . '/' . $this->getIdentifier()->package . '.model.' . KStringInflector::pluralize($config->model)));
     if ($config->tree) {
         $config->indent = '- ';
         $list = $this->_treelistbox($config);
     } else {
         $categories = $this->getObject($config->identifier)->setState(KObjectConfig::unbox($config->filter))->fetch();
         $options = array();
         foreach ($categories as $category) {
             $options[] = array('value' => $category->{$config->value}, 'label' => $category->{$config->label});
         }
         $config->options = $options;
         $list = parent::optionlist($config);
     }
     return $list;
 }