public function __construct($aObject, $oTemplate = null) { parent::__construct($aObject); if ($oTemplate) { $this->_oTemplate = $oTemplate; } else { $this->_oTemplate = BxDolTemplate::getInstance(); } }
function genViewRowValueForSelect(&$aInput) { $s = isset($aInput['value']) && isset($aInput['values'][$aInput['value']]) ? $aInput['values'][$aInput['value']] : null; if (isset($aInput['values_list_name']) && ($oCategory = BxDolCategory::getObjectInstanceByFormAndList($this->aFormAttrs['name'], $aInput['values_list_name']))) { return $oCategory->getCategoryLink($s, $aInput['value']); } return $s; }
/** * Set class fields condition params and paginate array */ function setConditionParams() { // keyword $sKeyword = bx_process_input(bx_get('keyword')); if ($sKeyword !== false) { $this->aCurrent['restriction']['keyword'] = array('value' => $sKeyword, 'field' => '', 'operator' => 'against'); } // owner if (isset($_GET['ownerName'])) { $sName = bx_process_input($_GET['ownerName']); $iUser = (int) BxDolProfileQuery::getInstance()->getIdByNickname($sName); BxDolMenu::getInstance()->setCurrentProfileID($iUser); } elseif (isset($_GET['userID'])) { $iUser = bx_process_input($_GET['userID'], BX_DATA_INT); } if (!empty($iUser)) { $this->aCurrent['restriction']['owner']['value'] = $iUser; } // meta info if ($this->_sMetaType && !empty($this->aCurrent['object_metatags'])) { $o = BxDolMetatags::getObjectInstance($this->aCurrent['object_metatags']); if ($o) { unset($this->aCurrent['restriction']['keyword']); switch ($this->_sMetaType) { case 'location_country': $o->locationsSetSearchCondition($this, $sKeyword); break; case 'location_country_city': $o->locationsSetSearchCondition($this, $sKeyword, bx_process_input(bx_get('state')), bx_process_input(bx_get('city'))); break; case 'mention': // TODO: break; case 'keyword': $o->keywordsSetSearchCondition($this, $sKeyword); break; } } } // category if ($this->_sCategoryObject && ($o = BxDolCategory::getObjectInstance($this->_sCategoryObject))) { unset($this->aCurrent['restriction']['keyword']); $o->setSearchCondition($this, $sKeyword); } $this->setPaginate(); $iNum = $this->getNum(); if ($iNum > 0) { $this->aCurrent['paginate']['num'] = $iNum; } else { $this->aCurrent['paginate']['num'] = 0; } }