Index: trunk/kernel/include/parseditem.php =================================================================== diff -u -r1462 -r1566 --- trunk/kernel/include/parseditem.php (.../parseditem.php) (revision 1462) +++ trunk/kernel/include/parseditem.php (.../parseditem.php) (revision 1566) @@ -273,7 +273,7 @@ { if($this->IsPopItem()) { - $ret = $element->attributes["_label"]; + $ret = $element->GetAttributeByName('_label'); if(!strlen($ret)) $ret = "lu_pop"; $ret = language($ret); @@ -923,6 +923,7 @@ $n = new $this->classname(); $n->tablename = $this->SourceTable; $n->LoadFromDatabase($ID); + $n->Set( $n->IdField(), $ID ); // in case if no loaded set ID anyway $index = array_push($this->Items, $n); $i =& $this->Items[count($this->Items)-1]; } @@ -1662,7 +1663,7 @@ echo "Items Queries: ".$this->QueryItemCount."
"; echo "=====
"; */ - if($this->Page > $NumPages && $PerPage != -1) + if( ($this->Page > $NumPages || $this->Page == 0) && $PerPage != -1) { switch($fix_method) { @@ -2076,29 +2077,22 @@ return $ret; } - function SqlGlobalCount($attribs=array()) - { - global $objSession; - - $p = $this->BasePermission.".VIEW"; - $t = $this->SourceTable; - if($attribs["_today"]) - { - $today = mktime(0,0,0,date("m"),date("d"),date("Y")); - $where = "($t.CreatedOn>=$today)"; - } + function SqlGlobalCount($attribs=array()) + { + global $objSession; + + $p = $this->BasePermission.".VIEW"; + $t = $this->SourceTable; + if( getArrayValue($attribs,'_today') ) + { + $today = mktime(0,0,0,date("m"),date("d"),date("Y")); + $where = "($t.CreatedOn>=$today)"; + } - if($attribs["_grouponly"]) - { - $GroupList = $objSession->Get("GroupList"); - } - else - $GroupList = NULL; - - $sql = $this->GetCountSQL($p,NULL,$GroupList,$where); - - return $sql; - } + $GroupList = getArrayValue($attribs,'_grouponly') ? $objSession->Get('GroupList') : null; + $sql = $this->GetCountSQL($p,NULL,$GroupList); + return $sql; + } function DoGlobalCount($attribs) {