Index: trunk/kernel/include/usersession.php
===================================================================
diff -u -r888 -r988
--- trunk/kernel/include/usersession.php (.../usersession.php) (revision 888)
+++ trunk/kernel/include/usersession.php (.../usersession.php) (revision 988)
@@ -456,7 +456,8 @@
}
$this->Set("PortalUserId", $result->fields["PortalUserId"]);
- unset($this->CurrentUser);
+ // unset($this->CurrentUser);
+ $this->CurrentUser=null;
if(strlen($result->fields["tz"])>0)
$this->Set("tz",$result->fields["tz"]);
$PrimaryGroup=0;
Index: trunk/kernel/include/parseditem.php
===================================================================
diff -u -r983 -r988
--- trunk/kernel/include/parseditem.php (.../parseditem.php) (revision 983)
+++ trunk/kernel/include/parseditem.php (.../parseditem.php) (revision 988)
@@ -217,7 +217,7 @@
if(strlen($url))
{
$ret .= "
";
- $ret .= $element->attributes["_separator"];
+ $ret .= $element->GetAttributeByName('_separator');
}
}
break;
@@ -1524,7 +1524,7 @@
{
if($this->MaxListCount)
{
- $limit = "LIMIT 0, $MaxListCount";
+ $limit = 'LIMIT 0, '.$this->MaxListCount;
}
}
return $limit;
@@ -2550,13 +2550,13 @@
{
global $objSession, $objCatList;
- $catid = (int)$attribs["_catid"];
- $scope = (int)$attribs["_scope"];
+ $catid = (int)getArrayValue($attribs,'_catid');
+ $scope = (int)getArrayValue($attribs,'_scope');
$show_since_last = (int)$attribs["_show_since_last"];
//$JoinCats = (int)$attribs["_catinfo"] || $scope;
//echo "Last: $scope
";
$TableName = $this->SourceTable;
- if($attribs["_today"])
+ if(getArrayValue($attribs,'_today'))
{
$cutoff = mktime(0,0,0,date("m"),date("d"),date("Y"));
}
@@ -2600,7 +2600,7 @@
$CategoryTable = GetTablePrefix()."Category";
$sql = "SELECT $TableName.*,$CategoryTable.CategoryId,$CategoryTable.CachedNavBar FROM $TableName ";
$p = $this->BasePermission.".VIEW";
- $sql .= $this->GetJoinedSQL($p,$CatUd,$where);
+ $sql .= $this->GetJoinedSQL($p,$catid,$where);
$OrderBy = $this->QueryOrderByClause(TRUE,TRUE,TRUE);
$sql .= " ".$OrderBy;
@@ -2616,18 +2616,18 @@
if($objSession->HasSystemPermission("DEBUG.LIST"))
echo htmlentities($sql,ENT_NOQUOTES)."
\n";
- if($attribs["_shortlist"])
+ if( getArrayValue($attribs,'_shortlist') )
{
$this->PerPageVar = $this->PerPageShortVar;
}
else
$this->PerPageVar = $this->PerPageVarLong;
- $CachedCount = $objCountCache->GetValue($this->CacheListType("new"),$this->ItemType,$this->CacheListExtraId("new"),(int)$attribs["_today"],3600);
+ $CachedCount = $objCountCache->GetValue($this->CacheListType("new"),$this->ItemType,$this->CacheListExtraId("new"),(int)getArrayValue($attribs,'_today'),3600);
if(!is_numeric($CachedCount))
{
$this->QueryItemCount= QueryCount($sql);
- $objCountCache->SetValue($this->CacheListType("new"),$this->ItemType,$this->CacheListExtraId("new"),(int)$attribs["_today"],$this->QueryItemCount);
+ $objCountCache->SetValue($this->CacheListType("new"),$this->ItemType,$this->CacheListExtraId("new"),(int)getArrayValue($attribs,'_today'),$this->QueryItemCount);
}
else
$this->QueryItemCount=$CachedCount;
Index: trunk/kernel/include/portaluser.php
===================================================================
diff -u -r881 -r988
--- trunk/kernel/include/portaluser.php (.../portaluser.php) (revision 881)
+++ trunk/kernel/include/portaluser.php (.../portaluser.php) (revision 988)
@@ -454,11 +454,12 @@
if($d<=0)
$d = $this->Get("CreatedOn");
- if($element->attributes["_tz"])
+ if($element->GetAttributeByName('_tz'))
{
$d = GetLocalTime($d,$objSession->Get("tz"));
}
- $part = strtolower($element->attributes["_part"]);
+
+ $part = strtolower($element->GetAttributeByName('_part'));
if(strlen($part))
{
$ret = ExtractDatePart($part,$d);
Index: trunk/kernel/parser.php
===================================================================
diff -u -r979 -r988
--- trunk/kernel/parser.php (.../parser.php) (revision 979)
+++ trunk/kernel/parser.php (.../parser.php) (revision 988)
@@ -521,7 +521,7 @@
$selected = ($val == $value)? "SELECTED" : "";
- if(strlen($attribs["_langtext"]))
+ if( getArrayValue($attribs,'_langtext') )
{
$txt = language($attribs["_langtext"]);
}
@@ -843,15 +843,15 @@
{
$ret .= "&Confirm=".$attribs["_confirmtemplate"];
}
- if(strlen($Dest))
+ /*if(strlen($Dest))
{
$ret .= "&DestTemplate=$Dest";
}
else
- {
+ {*/
if(strlen($attribs["_confirmtemplate"])>0)
$ret .="&DestTemplate=".$var_list["t"];
- }
+ //}
if(strlen($attribs["_errortemplate"])>0)
{
@@ -2118,7 +2118,7 @@
}
else
$hasperm = TRUE;
- if(!$hasperm && strlen($attribs["_deniedtemplate"])>0)
+ if(!$hasperm && getArrayValue($attribs,'_deniedtemplate') )
{
$hasperm = TRUE;
$attribs["_template"]=$attribs["_deniedtemplate"];
@@ -2419,7 +2419,7 @@
{
global $var_list, $var_list_update, $m_var_list_update, $objCatList, $objSession;
- $cat = $attribs["_category"];
+ $cat = getArrayValue($attribs,'_category');
if(strlen($cat))
{
if($cat=="NULL")
@@ -2472,37 +2472,42 @@
}
}
- if ((int)$attribs["_matchallperms"])
+ if ((int)getArrayValue($attribs,'_matchallperms'))
{
if (count($_AllPermsCount) != array_sum($_AllPermsCount))
$hasperm = FALSE;
}
- $text = $attribs["_text"];
- $plaintext = $attribs["_plaintext"];
- $denytext = $attribs["_denytext"];
- $plaindenytext = $attribs["_plaindenytext"];
- $nopermissions_status = (int)$attribs["_noperm"]? 1 : 0;
+ $text = getArrayValue($attribs,'_text');
+ $plaintext = getArrayValue($attribs,'_plaintext');
+ $denytext = getArrayValue($attribs,'_denytext');
+ $plaindenytext = getArrayValue($attribs,'_plaindenytext');
+ $nopermissions_status = (int)getArrayValue($attribs,'_noperm')? 1 : 0;
- if(!strlen($denied))
- $denied = "login";
+ //if(!strlen($denied)) $denied = "login";
- if (!$nopermissions_status)
+ if (!$nopermissions_status)
{
- if ($hasperm)
- {
- if (strlen($text) || strlen($plaintext))
- $ret = strlen($text)? language($text) : $plaintext;
- else
- $ret = "1";
- }
- else
- $ret = strlen($denytext)? language($denytext) : $plaindenytext;
+ if ($hasperm)
+ {
+ if (strlen($text) || strlen($plaintext))
+ {
+ $ret = strlen($text)? language($text) : $plaintext;
+ }
+ else
+ {
+ $ret = "1";
+ }
+ }
+ else
+ {
+ $ret = strlen($denytext)? language($denytext) : $plaindenytext;
+ }
}
elseif (!$hasperm)
- {
- $ret = "1";
- }
+ {
+ $ret = "1";
+ }
return $ret;
}
@@ -2648,7 +2653,7 @@
global $objConfig, $objCatList;
$ado = &GetADODBConnection();
-
+ $ret='';
if(getArrayValue($attribs,'_local') && $objCatList->CurrentCategoryID() != 0)
{
$c =& $objCatList->GetItem($objCatList->CurrentCategoryID());
@@ -2659,23 +2664,18 @@
$sql .= "INNER JOIN ".GetTablePrefix()."CategoryItems ON (".GetTablePrefix()."Category.ResourceId=".GetTablePrefix()."CategoryItems.ItemResourceId) ";
$sql .= "WHERE $catwhere LIMIT 1";
}
- else
+ else
+ {
$sql = "SELECT MAX(Modified) as ModDate FROM ".GetTablePrefix()."Category LIMIT 1";
+ }
$rs = $ado->Execute($sql);
if($rs && ! $rs->EOF)
{
$mod = $rs->fields["ModDate"];
if($mod)
{
$part = strtolower(getArrayValue($attribs,'_part'));
- if(strlen($part))
- {
- $ret = ExtractDatePart($part,$mod);
- }
- else
- {
- $ret = LangDate($mod);
- }
+ $ret = $part?ExtractDatePart($part,$mod):LangDate($mod);
}
}
return $ret;
@@ -2995,7 +2995,7 @@
global $objUsers, $objSession;
$o = "";
- $userid = $attribs["_userid"];
+ $userid = getArrayValue($attribs,'_userid');
if(!is_numeric($userid) || $userid=="0")
$userid = $objSession->Get("PortalUserId");
Index: trunk/kernel/include/debugger.php
===================================================================
diff -u -r983 -r988
--- trunk/kernel/include/debugger.php (.../debugger.php) (revision 983)
+++ trunk/kernel/include/debugger.php (.../debugger.php) (revision 988)
@@ -642,7 +642,7 @@
$this->memoryUsage['debugger_finish']=memory_get_usage();
$this->memoryUsage['print_report']=$this->memoryUsage['debugger_finish']-$this->memoryUsage['debugger_start'];
$this->memoryUsage['total']=$this->memoryUsage['print_report']+$this->memoryUsage['error_handling'];
-
+ $this->memoryUsage['application']=memory_get_usage()-$this->memoryUsage['total'];
if($returnResult)
{
$ret = ob_get_contents();
@@ -667,7 +667,8 @@
{
$info=Array('printReport'=>'print_report',
'saveError'=>'error_handling',
- 'Total'=>'total');
+ 'Total'=>'total',
+ 'Application'=>'application');
$ret=Array();
foreach($info as $title => $value_key)
{