Index: trunk/core/kernel/startup.php
===================================================================
diff -u -r2608 -r2659
--- trunk/core/kernel/startup.php (.../startup.php) (revision 2608)
+++ trunk/core/kernel/startup.php (.../startup.php) (revision 2659)
@@ -9,16 +9,8 @@
define('INPORTAL_ENV', 1);
# New path detection method
-
-//echo "FULL_PATH: ".FULL_PATH.'
';
-
-//$fp = str_replace('\\', '/', dirname(FULL_PATH));
$ps = preg_replace("/\/admin$/", '', str_replace('\\', '/', dirname($_SERVER['PHP_SELF'])));
-//echo "fp: $fp
";
-//echo "ps: $ps
";
-
-//$_SERVER['DOCUMENT_ROOT'] = $fp;
define('BASE_PATH', $ps);
# /New method
Index: trunk/core/kernel/application.php
===================================================================
diff -u -r2604 -r2659
--- trunk/core/kernel/application.php (.../application.php) (revision 2604)
+++ trunk/core/kernel/application.php (.../application.php) (revision 2659)
@@ -667,13 +667,15 @@
if( isset($params['index_file']) ) $index_file = $params['index_file'];
+ $ssl = isset($params['__SSL__']) ? $params['__SSL__'] : null;
+
if (getArrayValue($params, 'opener') == 'u') {
$opener_stack=$this->RecallVar('opener_stack');
if($opener_stack) {
$opener_stack=unserialize($opener_stack);
if (count($opener_stack) > 0) {
list($index_file, $env) = explode('|', $opener_stack[count($opener_stack)-1]);
- $ret = $this->BaseURL($prefix).$index_file.'?'.ENV_VAR_NAME.'='.$env;
+ $ret = $this->BaseURL($prefix, $ssl).$index_file.'?'.ENV_VAR_NAME.'='.$env;
if( getArrayValue($params,'escape') ) $ret = addslashes($ret);
return $ret;
}
@@ -691,21 +693,19 @@
$pass = isset($params['pass']) ? $params['pass'] : '';
$pass_events = isset($params['pass_events']) ? $params['pass_events'] : false; // pass events with url
-
-
if (defined('MOD_REWRITE') && MOD_REWRITE) {
$env = $this->BuildEnv('', $params, $pass, $pass_events, false);
$env = ltrim($env, ':-');
$session =& $this->recallObject('Session');
$sid = $session->NeedQueryString() ? '?sid='.$this->GetSID() : '';
// $env = str_replace(':', '/', $env);
- $ret = rtrim($this->BaseURL($prefix).$t.'.html/'.$env.'/'.$sid, '/');
+ $ret = rtrim($this->BaseURL($prefix, $ssl).$t.'.html/'.$env.'/'.$sid, '/');
}
else {
$env = $this->BuildEnv($t, $params, $pass, $pass_events);
- $ret = $this->BaseURL($prefix).$index_file.'?'.$env;
+ $ret = $this->BaseURL($prefix, $ssl).$index_file.'?'.$env;
}
return $ret;
@@ -788,9 +788,19 @@
return $ret;
}
- function BaseURL($prefix='')
+ function BaseURL($prefix='', $ssl=null)
{
- return PROTOCOL.SERVER_NAME.(defined('PORT')?':'.PORT : '').BASE_PATH.$prefix.'/';
+ if ($ssl == null) {
+ return PROTOCOL.SERVER_NAME.(defined('PORT')?':'.PORT : '').BASE_PATH.$prefix.'/';
+ }
+ else {
+ if ($ssl) {
+ return $this->ConfigValue('SSL_URL').$prefix.'/';
+ }
+ else {
+ return 'http://'.SERVER_NAME.(defined('PORT')?':'.PORT : '').BASE_PATH.$prefix.'/';
+ }
+ }
}
function Redirect($t='', $params=null, $prefix='', $index_file=null)
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 = \'