本文整理汇总了PHP中BxDolMenu::getInstance方法的典型用法代码示例。如果您正苦于以下问题:PHP BxDolMenu::getInstance方法的具体用法?PHP BxDolMenu::getInstance怎么用?PHP BxDolMenu::getInstance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BxDolMenu
的用法示例。
在下文中一共展示了BxDolMenu::getInstance方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setConditionParams
/**
* Set class fields condition params and paginate array
*/
function setConditionParams()
{
$aWhere = array();
$aWhere[] = '1';
$sKeyword = bx_process_input(bx_get('keyword'));
if ($sKeyword !== false) {
$this->aCurrent['restriction']['keyword'] = array('value' => $sKeyword, 'field' => '', 'operator' => 'against');
}
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;
}
$this->setPaginate();
$iNum = $this->getNum();
if ($iNum > 0) {
$this->aCurrent['paginate']['num'] = $iNum;
} else {
$this->aCurrent['paginate']['num'] = 0;
}
}
示例2: setConditionParams
/**
* 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'])) {
bx_import('BxDolMetatags');
$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;
}
}
}
$this->setPaginate();
$iNum = $this->getNum();
if ($iNum > 0) {
$this->aCurrent['paginate']['num'] = $iNum;
} else {
$this->aCurrent['paginate']['num'] = 0;
}
}