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:
mosmartin 2011-05-30 13:20:28 +00:00
parent 64d268ab6b
commit 68f068cf88
3 changed files with 22 additions and 15 deletions

View file

@ -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(){

View file

@ -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;