Index: trunk/core/kernel/processors/main_processor.php
===================================================================
diff -u -r2346 -r2659
--- trunk/core/kernel/processors/main_processor.php (.../main_processor.php) (revision 2346)
+++ trunk/core/kernel/processors/main_processor.php (.../main_processor.php) (revision 2659)
@@ -1,18 +1,18 @@
Application->recallObject('kActions');
$actions->Set('t', $this->Application->GetVar('t'));
$actions->Set('sid', $this->Application->GetSID());
$actions->Set('m_opener', $this->Application->GetVar('m_opener') );
-
+
}
-
+
/**
* Used to handle calls where tag name
* match with existing php function name
@@ -25,7 +25,7 @@
if ($tag->Tag=='include') $tag->Tag='MyInclude';
return parent::ProcessTag($tag);
}
-
+
/**
* Creates
";
}
else
echo "Object $name does not exist in the appliaction
";
}*/
-
+
/**
* Tag, that always returns true.
* For parser testing purposes
@@ -165,7 +165,7 @@
{
return true;
}
-
+
/**
* Tag, that always returns false.
* For parser testing purposes
@@ -178,7 +178,7 @@
{
return false;
}
-
+
/**
* Returns block parameter by name
*
@@ -191,11 +191,11 @@
//$parser =& $this->Application->recallObject('TemplateParser');
$res = $this->Application->Parser->GetParam($params['name']);
if ($res === false) $res = '';
- if (isset($params['plus']))
+ if (isset($params['plus']))
$res += $params['plus'];
return $res;
}
-
+
/**
* Compares block parameter with value specified
*
@@ -210,13 +210,13 @@
$value = $params['value'];
return ($this->Application->Parser->GetParam($name) == $value);
}
-
+
/*function PHP_Self($params)
{
return $HTTP_SERVER_VARS['PHP_SELF'];
}
*/
-
+
/**
* Returns session variable value by name
*
@@ -241,7 +241,7 @@
$value = $params['value'];
$this->Application->StoreVar($name,$value);
}
-
+
/**
* Sets application variable value(-s)
*
@@ -254,7 +254,7 @@
$this->Application->SetVar($param, $value);
}
}
-
+
/**
* Increment application variable
* specified by number specified
@@ -266,7 +266,7 @@
{
$this->Application->SetVar($params['param'], $this->Application->GetVar($params['param']) + $params['by']);
}
-
+
/**
* Retrieves application variable
* value by name
@@ -278,9 +278,9 @@
function Get($params)
{
$ret = $this->Application->GetVar($this->SelectParam($params, 'name,var,param'), EMPTY_ON_NULL);
- return getArrayValue($params, 'htmlchars') ? htmlspecialchars($ret) : $ret;
+ return getArrayValue($params, 'htmlchars') ? htmlspecialchars($ret) : $ret;
}
-
+
/**
* Retrieves application constant
* value by name
@@ -293,13 +293,13 @@
{
return defined($this->SelectParam($params, 'name,const')) ? constant($this->SelectParam($params, 'name,const,param')) : '';
}
-
+
function ConfigEquals($params)
{
$option = $this->SelectParam($params, 'name,option,var');
return $this->Application->ConfigValue($option) == getArrayValue($params, 'value');
}
-
+
/**
* Creates all hidden fields
* needed for kernel_form
@@ -312,7 +312,7 @@
{
$actions =& $this->Application->recallObject('kActions');
$actions->Set('t', $this->Application->GetVar('t') );
-
+
$params = $actions->GetParams();
$o='';
foreach ($params AS $name => $val)
@@ -321,7 +321,7 @@
}
return $o;
}
-
+
function GetFormHiddens($params)
{
$sid = $this->Application->GetSID();
@@ -340,7 +340,7 @@
}
return $o;
}
-
+
function Odd_Even($params)
{
$odd = $params['odd'];
@@ -351,7 +351,7 @@
else {
$var = $params['var'];
}
-
+
if ($this->Application->GetVar($var) == 'even') {
$this->Application->SetVar($var, 'odd');
return $even;
@@ -361,7 +361,7 @@
return $odd;
}
}
-
+
/**
* Returns phrase translation by name
*
@@ -390,35 +390,35 @@
$if_true=$params['true'];
$if_false=$params['false'];
}
-
+
if ( preg_match("/^".str_replace('/', '\/', $test_templ)."/", $this->Application->GetVar('t'))) {
return $if_true;
}
else {
return $if_false;
}
}
-
+
function IsNotActive($params)
{
return !$this->is_active($params);
}
-
+
function IsActive($params)
{
return $this->is_active($params);
}
-
+
function is_t_active($params)
{
return $this->is_active($params);
}
-
+
function CurrentTemplate($params)
{
return $this->is_active($params);
}
-
+
/**
* Checks if session variable
* specified by name value match
@@ -452,7 +452,7 @@
return 1;
}
}
-
+
/**
* Includes template
* and returns it's
@@ -468,18 +468,18 @@
$BlockParser->SetParams($params);
$parser =& $this->Application->Parser;
$this->Application->Parser =& $BlockParser;
-
+
$t = $this->SelectParam($params, 't,template,block,name');
$t = eregi_replace("\.tpl$", '', $t);
-
+
$templates_cache =& $this->Application->recallObject('TemplatesCache');
-
+
$res = $BlockParser->Parse( $templates_cache->GetTemplateBody($t), $t );
-
+
if ( !$BlockParser->DataExists && (isset($params['data_exists']) || isset($params['block_no_data'])) ) {
if ($block_no_data = getArrayValue($params, 'block_no_data')) {
$res = $BlockParser->Parse(
- $templates_cache->GetTemplateBody($block_no_data, $silent),
+ $templates_cache->GetTemplateBody($block_no_data, $silent),
$t
);
}
@@ -491,11 +491,11 @@
$this->Application->Parser->DataExists = $this->Application->Parser->DataExists || $BlockParser->DataExists;
return $res;
}
-
+
/*function Kernel_Scripts($params)
{
return '';
- }*/
+ }*/
/*function GetUserPermission($params)
@@ -510,8 +510,8 @@
return $aPermissions[$perm_name];
}
}*/
-
-
+
+
/**
* Set's parser block param value
*
@@ -527,31 +527,31 @@
$parser->AddParam('/\$'.$param.'/', $value);
}
}
-
+
/*function ParseToVar($params)
{
$var = $params['var'];
$tagdata = $params['tag'];
$parser =& $this->Application->Parser; //recallObject('TemplateParser');
$res = $this->Application->ProcessTag($tagdata);
-
+
$parser->SetParam($var, $res);
$parser->AddParam('/\$'.$var.'/', $res);
return '';
}*/
-
+
/*function TagNotEmpty($params)
{
$tagdata = $params['tag'];
$res = $this->Application->ProcessTag($tagdata);
return $res != '';
}*/
-
+
/*function TagEmpty($params)
{
return !$this->TagNotEmpty($params);
}*/
-
+
/**
* Parses block and returns result
*
@@ -564,12 +564,12 @@
$parser =& $this->Application->Parser; // recallObject('TemplateParser');
return $parser->ParseBlock($params);
}
-
+
function RenderElement($params)
{
return $this->ParseBlock($params);
}
-
+
/**
* Checks if debug mode is on
*
@@ -580,7 +580,7 @@
{
return $this->Application->isDebugMode();
}
-
+
function MassParse($params)
{
$qty = $params['qty'];
@@ -590,7 +590,7 @@
$o = '';
if ($mode == 'func') {
$func = create_function('$params', '
- $o = \'