mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-17 18:29:55 +09:00
fix query "limit" tag in other cases than page select
git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0-DB@8409 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
64d268ab6b
commit
68f068cf88
3 changed files with 22 additions and 15 deletions
|
|
@ -5,20 +5,23 @@
|
|||
var $page_count;
|
||||
var $page;
|
||||
|
||||
function Limit($page, $list_count, $page_count){
|
||||
$this->start = ($page-1)*$list_count;
|
||||
function Limit($list_count, $page= NULL, $page_count= NULL){
|
||||
$this->list_count = $list_count;
|
||||
$this->page_count = $page_count;
|
||||
$this->page = $page;
|
||||
if ($page){
|
||||
$this->start = ($page-1)*$list_count;
|
||||
$this->page_count = $page_count;
|
||||
$this->page = $page;
|
||||
}
|
||||
}
|
||||
|
||||
function isPageHandler(){//in case you choose to use query limit in other cases than page select
|
||||
return true;
|
||||
if ($this->page)return true;
|
||||
else return false;
|
||||
}
|
||||
|
||||
function toString(){
|
||||
return $this->start . ' , ' . $this->list_count;
|
||||
if ($this->page) return $this->start . ' , ' . $this->list_count;
|
||||
else return $this->list_count;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
@ -7,18 +7,22 @@
|
|||
var $list_count;
|
||||
|
||||
function LimitTag($index){
|
||||
$this->page = $index->page->attrs;
|
||||
$this->page_count = $index->page_count->attrs;
|
||||
$this->list_count = $index->list_count->attrs;
|
||||
|
||||
require_once(_XE_PATH_.'classes/xml/xmlquery/queryargument/QueryArgument.class.php');
|
||||
$this->arguments[] = new QueryArgument($index->page);
|
||||
|
||||
if($index->page->attrs && $index->page_count->attrs){
|
||||
$this->page = $index->page->attrs;
|
||||
$this->page_count = $index->page_count->attrs;
|
||||
$this->arguments[] = new QueryArgument($index->page);
|
||||
$this->arguments[] = new QueryArgument($index->page_count);
|
||||
}
|
||||
|
||||
$this->list_count = $index->list_count->attrs;
|
||||
$this->arguments[] = new QueryArgument($index->list_count);
|
||||
$this->arguments[] = new QueryArgument($index->page_count);
|
||||
}
|
||||
|
||||
function toString(){
|
||||
return sprintf("new Limit(\$%s_argument->getValue(), \$%s_argument->getValue(), \$%s_argument->getValue())", $this->page->var, $this->list_count->var, $this->page_count->var);
|
||||
if ($this->page)return sprintf("new Limit(\$%s_argument->getValue(), \$%s_argument->getValue(), \$%s_argument->getValue())",$this->list_count->var, $this->page->var, $this->page_count->var);
|
||||
else return sprintf("new Limit(\$%s_argument->getValue())", $this->list_count->var);
|
||||
}
|
||||
|
||||
function getArguments(){
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@
|
|||
}
|
||||
}
|
||||
|
||||
if($xml_navigation->page->attrs && $xml_navigation->list_count->attrs)
|
||||
if($xml_navigation->page->attrs || $xml_navigation->list_count->attrs)
|
||||
$this->limit = new LimitTag($xml_navigation);
|
||||
|
||||
$list_count = $xml_navigation->list_count->attrs;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue