Index: trunk/themes/default/incs/inportal_main.css =================================================================== diff -u -N -r842 -r904 --- trunk/themes/default/incs/inportal_main.css (.../inportal_main.css) (revision 842) +++ trunk/themes/default/incs/inportal_main.css (.../inportal_main.css) (revision 904) @@ -636,6 +636,11 @@ .field-content-input, .field-content-input-top { padding: 1px 0px 1px 5px; } + +.field-content-no-border { + padding: 4px 0px 4px 5px; +} + .field-content-top { border-top: none; } Index: trunk/kernel/include/parseditem.php =================================================================== diff -u -N -r881 -r904 --- trunk/kernel/include/parseditem.php (.../parseditem.php) (revision 881) +++ trunk/kernel/include/parseditem.php (.../parseditem.php) (revision 904) @@ -2070,12 +2070,12 @@ { global $objCountCache; - $cc = $objCountCache->GetValue($this->CacheListType("_"),$this->ItemType,$this->CacheListExtraId("_"),(int)$attribs["_today"], 3600); + $cc = $objCountCache->GetValue($this->CacheListType("_"),$this->ItemType,$this->CacheListExtraId("_"),(int)getArrayValue($attribs,'_today'), 3600); if(!is_numeric($cc)) { $sql = $this->SqlGlobalCount($attribs); $ret = QueryCount($sql); - $objCountCache->SetValue($this->CacheListType("_"),$this->ItemType,$this->CacheListExtraId("_"),(int)$attribs["_today"],$ret); + $objCountCache->SetValue($this->CacheListType("_"),$this->ItemType,$this->CacheListExtraId("_"),(int)getArrayValue($attribs,'_today'),$ret); } else $ret = $cc; @@ -2158,7 +2158,7 @@ global $objCountCache, $objSession; $ret = ""; - $ListType = $attribs["_listtype"]; + $ListType = getArrayValue($attribs,'_listtype'); if(!strlen($ListType)) $ListType="_"; @@ -2169,43 +2169,43 @@ { case "_": $ret = $this->DoGlobalCount($attribs); - break; + break; case "category": $ret = $this->CategoryCount($attribs); - break; + break; case "myitems": $sql = $this->SqlMyItems($attribs); - break; + break; case "hot": $sql = $this->SqlHotItems($attribs); - break; + break; case "pop": $sql = $this->SqlPopItems($attribs); - break; + break; case "pick": $sql = $this->SqlPickItems($attribs); - break; + break; case "favorites": $sql = $this->SqlFavorites($attribs); - break; + break; case "search": $sql = $this->SqlSearchItems($attribs); - break; + break; case "new": $sql = $this->SqlNewItems($attribs); - break; + break; } //echo "SQL: $sql
"; - if(strlen($sql)) + if(isset($sql)&&$sql) { if(is_numeric($ListTypeId)) { - $cc = $objCountCache->GetValue($ListTypeId,$this->ItemType,$ExtraId,(int)$attribs["_today"], 3600); + $cc = $objCountCache->GetValue($ListTypeId,$this->ItemType,$ExtraId,(int)getArrayValue($attribs,'_today'), 3600); if(!is_numeric($cc) || $attribs['_nocache'] == 1) { $ret = QueryCount($sql); - $objCountCache->SetValue($ListTypeId,$this->ItemType,$ExtraId,(int)$attribs["_today"],$ret); + $objCountCache->SetValue($ListTypeId,$this->ItemType,$ExtraId,(int)getArrayValue($attribs,'_today'),$ret); } else $ret = $cc; @@ -2432,8 +2432,8 @@ { global $objSession, $objCatList; - $catid = (int)$attribs["_catid"]; - $scope = (int)$attribs["_scope"]; + $catid = (int)getArrayValue($attribs,'_catid'); + $scope = (int)getArrayValue($attribs,'_scope'); //$JoinCats = (int)$attribs["_catinfo"] || $scope; $TableName = $this->SourceTable; @@ -2450,15 +2450,15 @@ $where = $TableName.".EditorsPick=1 AND ".$TableName.".Status=1 "; $catid=NULL; } - if($attribs["_today"]) + if(getArrayValue($attribs,'_today')) { $today = mktime(0,0,0,date("m"),date("d"),date("Y")); $where .= " AND ($TableName.CreatedOn>=$today)"; } $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; @@ -2480,11 +2480,11 @@ else $this->PerPageVar = $this->PerPageVarLong; - $CachedCount = $objCountCache->GetValue($this->CacheListType("pick"),$this->ItemType,$this->CacheListExtraId("pick"),(int)$attribs["_today"],3600); + $CachedCount = $objCountCache->GetValue($this->CacheListType("pick"),$this->ItemType,$this->CacheListExtraId("pick"),(int)getArrayValue($attribs,'_today'),3600); if(!is_numeric($CachedCount)) { $this->QueryItemCount= QueryCount($sql); - $objCountCache->SetValue($this->CacheListType("pick"),$this->ItemType,$this->CacheListExtraId("pick"),(int)$attribs["_today"],$this->QueryItemCount); + $objCountCache->SetValue($this->CacheListType("pick"),$this->ItemType,$this->CacheListExtraId("pick"),(int)getArrayValue($attribs,'_today'),$this->QueryItemCount); } else $this->QueryItemCount=$CachedCount; @@ -2498,15 +2498,15 @@ $TableName = $this->SourceTable; $where = " ".$TableName.".Status>-1 AND ".$TableName.".CreatedById=".$objSession->Get("PortalUserId"); - if($attribs["_today"]) + if(getArrayValue($attribs,'_today')) { $today = mktime(0,0,0,date("m"),date("d"),date("Y")); $where .= " AND ($TableName.CreatedOn>=$today)"; } $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,null,$where); // maybe null should be replaced by some CategoryId $OrderBy = $this->QueryOrderByClause(TRUE,TRUE,TRUE); $sql .= " ".$OrderBy; Index: trunk/kernel/parser.php =================================================================== diff -u -N -r898 -r904 --- trunk/kernel/parser.php (.../parser.php) (revision 898) +++ trunk/kernel/parser.php (.../parser.php) (revision 904) @@ -366,13 +366,13 @@ $form = $attribs["_form"]; $field = strtolower($attribs["_field"]); // $field = $attribs["_field"]; - - if(isset($_POST[$field]) && $attribs['_forgetvalue'] != 1) + $value=''; + if(isset($_POST[$field]) && getArrayValue($attribs,'_forgetvalue') != 1) { $value = inp_htmlize($_POST[$field],1); } else { - if ($attribs['_forgetvalue'] != 1) { + if (getArrayValue($attribs,'_forgetvalue') != 1 && getArrayValue($FormValues[$form],$field) ) { $value = inp_htmlize($FormValues[$form][$field]); } } @@ -386,7 +386,7 @@ $ret = ""; if($attribs["_required"]) $ret .= ""; - if($attribs["_custom"]) + if(getArrayValue($attribs,'_custom')) $ret .= ""; } return $ret; @@ -561,7 +561,7 @@ { $ret .= ""; } - if($attribs["_custom"]) + if(getArrayValue($attribs,'_custom')) { $ret .= ""; } @@ -583,10 +583,10 @@ $html_attribs = ExtraAttributes($attribs); $field = $attribs["_field"]; $form = $attribs["_form"]; - $TypesAllowed = $attribs["_imagetypes"]; - $isthumb = (int)$attribs["_thumbnail"]; - $imgname = $attribs["_imagename"]; - $maxsize = $attribs["_maxsize"]; + $TypesAllowed = getArrayValue($attribs,'_imagetypes'); + $isthumb = (int)getArrayValue($attribs,'_thumbnail'); + $imgname = getArrayValue($attribs,'_imagename'); + $maxsize = getArrayValue($attribs,'_maxsize'); $ret = ""; $ret .= ""; @@ -653,7 +653,7 @@ //echo $f."
"; //echo $t."
"; // echo "
"; print_r($FormError); echo "
"; - if(is_array($FormError[$f])) + if( getArrayValue($FormError,$f) && is_array($FormError[$f])) { foreach($FormError[$f] as $e) { @@ -771,7 +771,7 @@ { global $var_list, $var_list_update, $m_var_list_update, $objSession, $objConfig, $objCatList; - $target_template = $attribs["_template"]; + $target_template = getArrayValue($attribs,'_template'); if(strlen($target_template)) { $var_list_update["t"] = $target_template; @@ -792,12 +792,12 @@ else { $ret = GetIndexURL(2)."?env=" . BuildEnv()."&Action=m_login"; - if($attribs["_successtemplate"]) + if(getArrayValue($attribs,'_successtemplate')) { $ret .= "&dest=".$attribs["_successtemplate"]; } else - if(strlen($var_list["dest"])) + if(getArrayValue($var_list,'dest')) $ret .= "&dest=".$var_list["dest"]; } break; @@ -1181,7 +1181,7 @@ $CurrentTheme = $objThemes->GetItem($m_var_list["theme"]); $theme_url = "http://". ThisDomain().$objConfig->Get("Site_Path")."themes/".$CurrentTheme->Get("Name")."/"; - if($attribs["_page"]) + if(getArrayValue($attribs,'_page')) { if ($attribs["_page"] != 'current') { @@ -1218,7 +1218,7 @@ global $objConfig, $objCatList; $ret = $objConfig->Get("Site_Name"); - if($attribs["_fullpath"] || $attribs["_currentcategory"]) + if(getArrayValue($attribs,'_fullpath') || getArrayValue($attribs,'_currentcategory')) { $CurrentCat = $objCatList->CurrentCategoryID(); if((int)$CurrentCat>0) @@ -1336,7 +1336,7 @@ $sql = "SELECT * FROM ".GetTablePrefix()."Language WHERE Enabled=1"; $objLanguages->Clear(); $objLanguages->Query_Item($sql); - + $o=''; if($objLanguages->NumItems()>0) { foreach($objLanguages->Items as $l) @@ -1382,7 +1382,7 @@ if(!strlen($attribs["_field"])) return ""; - $lang = $attribs["_lang"]; + $lang = getArrayValue($attribs,'_lang'); if(!strlen($lang)) { $LangId = $objSession->Get("Language"); @@ -1474,11 +1474,11 @@ $cols = $attribs["_columns"]; if($cols<1) $cols =1; - $CategoryId = $attribs["_catid"]; + $CategoryId = getArrayValue($attribs,'_catid'); if(!is_numeric($CategoryId)) $CategoryId = $objCatList->CurrentCategoryID(); - $cat_count = (int)$attribs["_maxlistcount"]; + $cat_count = (int)getArrayValue($attribs,'_maxlistcount'); /* validation */ if(strlen($attribs["_itemtemplate"])==0) { @@ -2043,7 +2043,7 @@ { global $objCatList, $objSession; - $permission = $attribs["_perm"]; + $permission = getArrayValue($attribs,'_perm'); $o = ""; $tpath = GetModuleArray("template"); if(strlen($permission)) @@ -2090,10 +2090,10 @@ $o = " "; - $text = $attribs["_text"]; + $text = getArrayValue($attribs,'_text'); if(!strlen($text)) { - $text = $attribs["_plaintext"]; + $text = getArrayValue($attribs,'_plaintext'); if(!strlen($text)) { if(strlen($attribs["_image"])) @@ -2222,14 +2222,14 @@ { global $var_list, $var_list_update, $m_var_list_update, $objCatList; - $template = $attribs["_template"]; + $template = getArrayValue($attribs,'_template'); - $query = trim($attribs["_query"]); + $query = trim( getArrayValue($attribs,'_query') ); $query = !ereg("^&", $query)? "&$query" : $query; if(!strlen($template)) $template = $var_list["t"]; - $cat = $attribs["_category"]; + $cat = getArrayValue($attribs,'_category'); $var_list_update["t"] = $template; if(strlen($cat)) @@ -2247,7 +2247,7 @@ $link_type = getArrayValue($attribs,'_relative') ? 0 : 2; $ret = GetIndexURL($link_type)."?env=".BuildEnv().$query; - if(strlen($attribs["_anchor"])) + if(strlen(getArrayValue($attribs,'_anchor'))) $ret .= "#".$attribs["_anchor"]; unset($var_list_update["t"]); if(strlen($cat)) @@ -2272,7 +2272,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") @@ -2340,7 +2340,7 @@ $ret = GetIndexURL(2)."?env=".BuildEnv(); unset($var_list_update["t"]); - if(strlen($dest)) + if(isset($dest)&&$dest) $ret .= "&dest=$dest"; return $ret; } @@ -2559,7 +2559,7 @@ global $objCatList; $ret = ""; - $catid = (int)$attribs["_catid"]; + $catid = (int)getArrayValue($attribs,'_catid'); $field = $attribs["_field"]; if(!$catid) $catid = $objCatList->CurrentCategoryID(); @@ -2575,7 +2575,7 @@ $ret = $cat->ParseObject($element); } } - if($attribs["_striphtml"]) + if(getArrayValue($attribs,'_striphtml')) $ret = strip_tags($ret); return $ret; } @@ -2592,7 +2592,7 @@ $ado = &GetADODBConnection(); - if($attribs["_local"] && $objCatList->CurrentCategoryID() != 0) + if(getArrayValue($attribs,'_local') && $objCatList->CurrentCategoryID() != 0) { $c =& $objCatList->GetItem($objCatList->CurrentCategoryID()); $catlist = $c->GetSubCatIds(); @@ -2610,7 +2610,7 @@ $mod = $rs->fields["ModDate"]; if($mod) { - $part = strtolower($attribs["_part"]); + $part = strtolower(getArrayValue($attribs,'_part')); if(strlen($part)) { $ret = ExtractDatePart($part,$mod); @@ -2637,10 +2637,11 @@ $IncludeList = explode(",",trim($attribs["_modules"])); $tpath = GetModuleArray("template"); + $ret=''; for($inc=0;$incCurrentCategoryID(); @@ -2762,10 +2761,9 @@ */ function m_related_count($attribs) { - global $objItemTypes, $objCatList, $content_set; + global $objItemTypes, $objCatList, $content_set, $CatRelations; + $cat = getArrayValue($attribs,'_catid'); - $cat = $attribs["_catid"]; - if(!is_numeric($cat)) { $cat = $objCatList->CurrentCategoryID(); @@ -2782,7 +2780,7 @@ LoadRelatedItems($Related, $CatRelations, $c->Get("ResourceId")); } - $item_type = $attribs["_itemtype"]; + $item_type = getArrayValue($attribs,'_itemtype'); if(strlen($item_type)) { $objType = $objItemTypes->GetTypeByName($item_type); @@ -2793,7 +2791,7 @@ else $TargetType=""; } - + $count=0; if($CatRelations->NumItems()>0) { for($x=0;$x<$CatRelations->NumItems();$x++) @@ -2880,14 +2878,14 @@ $Bit_Global = 4; $Bit_SubCats=8; - if($attribs["_categorycount"]) + if(getArrayValue($attribs,'_categorycount')) { $evar = m_BuildEnv(); } else $evar = ""; - $cat = $attribs["_catid"]; + $cat = getArrayValue($attribs,'_catid'); if(!is_numeric($cat)) { $cat = $objCatList->CurrentCategoryID(); @@ -3444,4 +3442,13 @@ return GetRegionalOption($attribs['_name']); } +/*function m_object($attribs=Array()) +{ + $element = new clsHtmlTag(); + $element->name=$attribs['_prefix']; + $element->attributes = $attribs; + $ret = $cat->ParseObject($element); +}*/ + + ?> Index: trunk/kernel/include/category.php =================================================================== diff -u -N -r889 -r904 --- trunk/kernel/include/category.php (.../category.php) (revision 889) +++ trunk/kernel/include/category.php (.../category.php) (revision 904) @@ -1444,7 +1444,7 @@ function CountCategories($attribs) { global $objSession; - + $ParentWhere=''; $cat = getArrayValue($attribs,'_catid'); if(!is_numeric($cat)) { Index: trunk/kernel/include/debugger.php =================================================================== diff -u -N -r903 -r904 --- trunk/kernel/include/debugger.php (.../debugger.php) (revision 903) +++ trunk/kernel/include/debugger.php (.../debugger.php) (revision 904) @@ -6,6 +6,7 @@ if(!defined('DBG_USE_SHUTDOWN_FUNC')) define('DBG_USE_SHUTDOWN_FUNC',1); if(!defined('DBG_HANDLE_ERRORS')) define('DBG_HANDLE_ERRORS', isset($_REQUEST['debug_host']) ? 0 : 1); + if(!defined('DBG_RAISE_ON_WARNINGS')) define('DBG_RAISE_ON_WARNINGS',0); if(!defined('DOC_ROOT')) define('DOC_ROOT',$_SERVER['DOCUMENT_ROOT']); if(!defined('WINDOWS_ROOT')) define('WINDOWS_ROOT','w:'); @@ -30,6 +31,8 @@ var $ProfilerData = Array(); var $RecursionStack = Array(); // prevent recursion when processing debug_backtrace() function results + var $TraceNextError=false; + var $Options = 0; var $OptionsMap = Array('shutdown_func' => 1, 'error_handler' => 2, 'output_buffer' => 4, 'highlight_output' => 8); @@ -64,6 +67,16 @@ return ($this->Options & $this->OptionsMap[$name]) == $this->OptionsMap[$name]; } + /** + * Set's flag, that next error that occurs will + * be prepended by backtrace results + * + */ + function traceNext() + { + $this->TraceNextError=true; + } + function dumpVars() { $dumpVars = func_get_args(); @@ -93,22 +106,32 @@ break; case 'trace': + ini_set('memory_limit','500M'); $trace =& $Data['trace']; + + //return 'sorry'; + //return $this->highlightString(print_r($trace,true)); + + $i = 0; $traceCount = count($trace); $ret = ''; while($i < $traceCount) { $traceRec =& $trace[$i]; $argsID = 'trace_args_'.$dataIndex.'_'.$i; - $ret .= 'Function: '.$this->getFileLink($traceRec['file'],$traceRec['line'],$traceRec['class'].$traceRec['type'].$traceRec['function']).''; - $ret .= ' in '.basename($traceRec['file']).' on line '.$traceRec['line'].'
'; - + if(isset($traceRec['file'])) + { + $ret .= 'Function: '.$this->getFileLink($traceRec['file'],$traceRec['line'],$traceRec['class'].$traceRec['type'].$traceRec['function']); + $ret .= ' in '.basename($traceRec['file']).' on line '.$traceRec['line'].'
'; + } + else + { + $ret .= 'no file information available'; + } // ensure parameter value is not longer then 200 symbols $this->processTraceArguments($traceRec['args']); - $args = $this->highlightString(print_r($traceRec['args'], true)); $ret .= ''; - $i++; } return $ret; @@ -581,9 +604,12 @@ window.onresize = resizeDebugLayer; window.onscroll = resizeDebugLayer; window.focus(); - if( typeof($isFatalError) != 'undefined' && $isFatalError == 1 ) + if( typeof($isFatalError) != 'undefined' && $isFatalError == 1 || ) { toggleDebugLayer(); + } + if( typeof($isFatalError) != 'undefined' && $isFatalError == 1) + { document.getElementById('debug_layer').scrollTop = 10000000; } @@ -628,7 +654,11 @@ $pos++; $errline = substr($tmpStr,$pos,strpos($tmpStr,')',$pos)-$pos); } - + if($this->TraceNextError) + { + $this->appendTrace(); + $this->TraceNextError=false; + } $this->Data[] = Array('no' => $errno, 'str' => $errstr, 'file' => $errfile, 'line' => $errline, 'context' => $errcontext, 'debug_type' => 'error'); if( substr($errorType,0,5) == 'Fatal')