本文整理汇总了PHP中CB\User::setGridMaxRows方法的典型用法代码示例。如果您正苦于以下问题:PHP User::setGridMaxRows方法的具体用法?PHP User::setGridMaxRows怎么用?PHP User::setGridMaxRows使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CB\User
的用法示例。
在下文中一共展示了User::setGridMaxRows方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getChildren
public function getChildren($p)
{
$rez = array();
//unset restricted query params from user input
unset($p['fq']);
/* prepare params */
$path = '/';
if (!isset($p['path']) || strlen($p['path']) < 1) {
if (!empty($p['pid'])) {
$path = $p['pid'];
}
} else {
$path = $p['path'];
}
$p['path'] = $path;
//check if user have changed the row limit in grid
if (!empty($p['setMaxRows']) && !empty($p['rows'])) {
User::setGridMaxRows($p['rows']);
}
//the navigation goes from search results. We should get the real path of the node
if (!empty($p['lastQuery']) && empty($p['query'])) {
while (substr($path, -1) == '/') {
$path = substr($path, 0, strlen($path) - 1);
}
$a = explode('/', $path);
if (!empty($a) && is_numeric($a[sizeof($a) - 1])) {
$p['path'] = @Path::getPath(array_pop($a))['path'];
}
}
$this->showFoldersContent = isset($p['showFoldersContent']) ? $p['showFoldersContent'] : false;
$this->requestParams = $p;
/* end of prepare params */
/* we should:
1. load available plugins for the tree with their configs
2. fire the on treeInitialize event
3. call each plugin with received params
4. join and sort received data
*/
//detect tree nodes config,
//but leave only SearchResults plugin when searching
if (empty($p['search'])) {
if (empty($p['query'])) {
$this->treeNodeConfigs = Config::get('treeNodes');
}
// default is only DBNode if nothing defined in cofig
if (empty($this->treeNodeConfigs)) {
$this->treeNodeConfigs = array('Dbnode' => array());
}
} else {
$this->treeNodeConfigs = array('SearchResults' => $p['search']);
$path = Path::getGUID('SearchResults') . '-';
}
$params = array('params' => &$p, 'plugins' => &$this->treeNodeConfigs);
fireEvent('treeInitialize', $params);
// array of all available classes defined in treeNodes
// used to check if any class should add its nodes based
// on last node from current path
$this->treeNodeClasses = Path::getNodeClasses($this->treeNodeConfigs);
foreach ($this->treeNodeClasses as &$nodeClass) {
$cfg = $nodeClass->getConfig();
$this->treeNodeGUIDConfigs[$cfg['guid']] = $cfg;
}
$this->path = Path::createNodesPath($path, $this->treeNodeGUIDConfigs);
//set path and input params for last node
//because iterating each class and requesting children can
//invoke a search that will use last node to get facets and DC
if (!empty($this->path)) {
$lastNode = $this->path[sizeof($path) - 1];
$lastNode->path = $this->path;
$lastNode->requestParams = $this->requestParams;
}
Cache::set('current_path', $this->path);
$this->result = array('data' => array(), 'facets' => array(), 'pivot' => array(), 'search' => array(), 'view' => array(), 'sort' => array(), 'group' => array(), 'stats' => array(), 'DC' => array(), 'total' => 0);
//get view config and apply to request params and for result
$viewConfig = $this->detectViewConfig();
$this->requestParams = array_merge($this->requestParams, $viewConfig);
$this->result = array_merge($this->result, $viewConfig);
$this->requestParams['facets'] = $this->detectFacets();
$this->collectAllChildren();
$this->prepareResult();
$rez = array('success' => true, 'pathtext' => $this->getPathText($p), 'folderProperties' => $this->getPathProperties($p), 'page' => @$p['page'], 'data' => array());
foreach ($this->result as $k => &$v) {
if (!empty($this->result[$k])) {
$rez[$k] =& $v;
}
}
return $rez;
}