本文整理汇总了PHP中ResultPrinter::startingNumberParam方法的典型用法代码示例。如果您正苦于以下问题:PHP ResultPrinter::startingNumberParam方法的具体用法?PHP ResultPrinter::startingNumberParam怎么用?PHP ResultPrinter::startingNumberParam使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ResultPrinter
的用法示例。
在下文中一共展示了ResultPrinter::startingNumberParam方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: registerState
/**
* Register the search and page state of this collection so that the
* next time that we return to it, we will get the same view.
*
* @return void
* @access public
* @since 5/11/06
*/
function registerState()
{
$this->_state = $this->getState($this->getAssetId());
// unset our starting number if we have the new search terms
if (RequestContext::value('form_submitted') || isset($_REQUEST[ResultPrinter::startingNumberParam()]) || !isset($this->_state['numPerPage']) || $this->_state['numPerPage'] != $_SESSION['assets_per_page']) {
$this->_state['startingNumber'] = ResultPrinter::startingNumberParam();
$this->_state['numPerPage'] = $_SESSION['assets_per_page'];
} else {
if (!isset($this->_state['startingNumber'])) {
$this->_state['startingNumber'] = 1;
$this->_state['numPerPage'] = $_SESSION['assets_per_page'];
}
}
}
示例2: registerState
/**
* Register the search and page state of this collection so that the
* next time that we return to it, we will get the same view.
*
* @return void
* @access public
* @since 5/11/06
*/
function registerState()
{
$this->_state = $this->getState($this->getRepositoryId());
// top-level properties
$properties = array('limit_by_type' => 'false');
foreach ($properties as $name => $default) {
if (RequestContext::value('form_submitted')) {
$this->_state[$name] = RequestContext::value($name);
} else {
if (!isset($this->_state[$name])) {
$this->_state[$name] = $default;
}
}
}
// Search type
if (RequestContext::value('searchtype')) {
$this->_state['searchtype'] = HarmoniType::fromString(RequestContext::value('searchtype'));
} else {
if (!isset($this->_state['searchtype'])) {
$this->_state['searchtype'] = new Type("Repository", "edu.middlebury.harmoni", "Keyword", "Search with a string for keywords.");
}
}
// Search Criteria
$searchModuleManager = Services::getService("RepositorySearchModules");
if (RequestContext::value('form_submitted')) {
$this->_state['currentSearchValues'] = $searchModuleManager->getCurrentValues($this->_state['searchtype']);
} else {
if (isset($this->_state['currentSearchValues'])) {
$searchModuleManager->setCurrentValues($this->_state['searchtype'], $this->_state['currentSearchValues']);
}
}
// if we are limiting by type
if ($this->_state["limit_by_type"] == 'true') {
if (!isset($this->_state["selectedTypes"])) {
$this->_state["selectedTypes"] = array();
}
$repository = $this->getRepository();
$types = $repository->getAssetTypes();
while ($types->hasNext()) {
$type = $types->next();
if (RequestContext::value("type___" . $type->asString()) == 'true') {
$this->_state["selectedTypes"][$type->asString()] = $type;
} else {
if (RequestContext::value('form_submitted')) {
unset($this->_state["selectedTypes"][$type->asString()]);
}
}
}
}
// unset our starting number if we have the new search terms
if (RequestContext::value('form_submitted') || isset($_REQUEST[ResultPrinter::startingNumberParam()]) || !isset($this->_state['numPerPage']) || $this->_state['numPerPage'] != $_SESSION['assets_per_page']) {
if (isset($_REQUEST[ResultPrinter::startingNumberParam()])) {
$this->_state['startingNumber'] = $_REQUEST[ResultPrinter::startingNumberParam()];
} else {
$this->_state['startingNumber'] = 1;
}
$this->_state['numPerPage'] = $_SESSION['assets_per_page'];
} else {
if (!isset($this->_state['startingNumber'])) {
$this->_state['startingNumber'] = 1;
$this->_state['numPerPage'] = $_SESSION['assets_per_page'];
}
}
}