Index: trunk/kernel/parser.php
===================================================================
diff -u -r5254 -r6093
--- trunk/kernel/parser.php (.../parser.php) (revision 5254)
+++ trunk/kernel/parser.php (.../parser.php) (revision 6093)
@@ -189,7 +189,7 @@
global $var_list, $objSession, $objUsers, $objTemplate;
$userid = $objSession->Get('PortalUserId');
-
+
if ($userid <= 0) {
if ( getArrayValue($attribs, '_logintemplate')) {
$t = $objTemplate->ParseTemplate($attribs['_logintemplate']);
@@ -233,7 +233,7 @@
function m_subscribe_address()
{
global $objSession;
-
+
return $objSession->GetVariable('SubscribeAddress');
}
@@ -448,9 +448,14 @@
}
else
{
- $value = (int)$FormValues[$form][$field];
- if($value==1)
- $checked=' CHECKED';
+ $value = $FormValues[$form][$field];
+ if (is_array($value)) {
+ $value = $value['value'];
+ }
+
+ if ((int)$value==1) {
+ $checked = ' CHECKED';
+ }
}
//echo $form.".".$field."=".$value."
\n";
$ret = "";
@@ -797,7 +802,7 @@
$FormValues[$FormName]["country"] = $u->Get("Country");
$FormValues[$FormName]["minpwresetdelay"] = $u->Get("MinPwResetDelay");
-
+
// $FormValues[$FormName]["dob"] = LangDate($u->Get("dob"), 0, true);
$FormValues[$FormName]["dob_day"] = adodb_date("d", $u->Get("dob"));
$FormValues[$FormName]["dob_year"] = adodb_date("Y", $u->Get("dob"));
@@ -1258,10 +1263,13 @@
$c = $objCatList->GetCategory($CurrentCat);
if($attribs["_fullpath"])
{
- $path = $c->Get("CachedNavbar");
+ $application =& kApplication::Instance();
+ $ml_formatter =& $application->recallObject('kMultiLanguage');
+ $path = $c->Get($ml_formatter->LangFieldName('CachedNavbar'));
- if(strlen($path))
- $ret .= " - ".$path;
+ if (strlen($path)) {
+ $ret .= " - ".str_replace('&|&', ' > ', $path);
+ }
}
else
{
@@ -1708,14 +1716,14 @@
// echo "TEST:
$sql
\n";
$objSearchCats->Query_Item($sql);
$where = "ItemType=1";
-
+
$Keywords = GetKeywords($objSession->GetVariable("Search_Keywords"));
//echo "SQL Loaded ItemCount (".get_class($this).'): '.$this->NumItems().'
';
for($i = 0; $i < $objSearchCats->NumItems(); $i++)
{
$objSearchCats->Items[$i]->Keywords = $Keywords;
}
-
+
if(is_numeric($CountVal[1]))
{
$objSearchCats->QueryItemCount = $CountVal[1];
@@ -2924,21 +2932,21 @@
function m_meta_keywords($attribs = array())
{
global $objCatList, $objConfig;
-
+
$keywords = '';
$catid = (int)getArrayValue($attribs, '_catid');
-
+
if (!$catid)
{
$catid = $objCatList->CurrentCategoryID();
}
-
+
if ($catid)
{
$c = $objCatList->GetItem($catid);
$keywords = $c->Get('MetaKeywords');
}
-
+
if (!$keywords)
{
$keywords = $objConfig->Get('Category_MetaKey');
@@ -2960,13 +2968,13 @@
{
$catid = $objCatList->CurrentCategoryID();
}
-
+
if ($catid)
{
$c = $objCatList->GetItem($catid);
$description = $c->Get('MetaDescription');
}
-
+
if (!$description)
{
$description = $objConfig->Get('Category_MetaDesc');
@@ -3722,7 +3730,7 @@
function m_IsDebugMode($params)
{
- echo 'kool';
+// echo 'kool';
return IsDebugMode() ? true : '';
}
@@ -3731,64 +3739,64 @@
$parser_params = GetVar('parser_params');
$param_name = strtolower($params['_name']);
$value = getArrayValue($parser_params, $param_name);
-
+
if ($value) {
if (getArrayValue($params, '_asphrase')) {
$value = language($value);
}
}
-
+
return $value;
}
function m_set_category($params)
{
global $m_var_list;
-
+
if (getArrayValue($params, '_onlyonce') && $m_var_list['cat']) return ;
-
+
$db =& GetADODBConnection();
$category_id = getArrayValue($params, '_catid');
if (!$category_id) {
$module = getArrayValue($params, '_module');
if ($module) {
-
+
$sql = 'SELECT RootCat FROM '.GetTablePrefix().'Modules WHERE LOWER(Name) = '.$db->qstr( strtolower($module) );
$category_id = $db->GetOne($sql);
}
}
-
+
if ($category_id) {
$m_var_list['cat'] = $category_id;
}
}
-
+
function m_template_equals($params)
{
$t = preg_replace('/(.*)\.tpl/', '\\1', $params['_template']);
return $GLOBALS['var_list']['t'] == $t ? true : '';
}
-
+
function m_ShowSearchError($params)
{
global $objSession, $objTemplate;
-
+
$error_phrase = $objSession->GetVariable('search_error');
if (!$error_phrase) {
return '';
}
-
+
$template = getArrayValue($params, '_itemtemplate');
if (!$template) {
$ret = '';
}
-
+
$ret = $objTemplate->GetTemplate($template, true);
$ret = $ret->source;
-
+
return str_replace('', language($error_phrase), $ret);
}
-
+
/*function m_object($attribs=Array())
{
$element = new clsHtmlTag();