public function getClientData()
 {
     $rez = array('f' => $this->field, 'title' => $this->getTitle(), 'items' => array());
     $dbnode = new TreeNode\Dbnode();
     foreach ($this->solrData as $k => $v) {
         $rez['items'][$k] = array('name' => $dbnode->getName($k), 'count' => $v);
     }
     //check if have default sorting set in cofig
     if (!empty($this->config['sort'])) {
         $sp = $this->getSortParams();
         Util\sortRecordsArray($rez['items'], $sp['property'], $sp['direction'], $sp['type'], true);
         //add sort param for client side
         $rez['sort'] = $sp;
     }
     return $rez;
 }
Beispiel #2
0
 /**
  * get view config for given view or default view if set in config
  * @param  array &$pathArray
  * @param  array &$rp        requestParams
  * @return array
  */
 public function getViewConfig(&$pathArray, &$rp)
 {
     $copyParams = array('view', 'stats');
     $sp = $this->getSearchParams($rp);
     foreach ($copyParams as $k) {
         if (isset($sp[$k])) {
             $this->config[$k] = $sp[$k];
         }
     }
     $rez = parent::getViewConfig($pathArray, $rp);
     return $rez;
 }