Index: trunk/core/kernel/session/session.php
===================================================================
diff -u -r3884 -r4528
--- trunk/core/kernel/session/session.php (.../session.php) (revision 3884)
+++ trunk/core/kernel/session/session.php (.../session.php) (revision 4528)
@@ -650,7 +650,7 @@
$last_template = basename($_SERVER['PHP_SELF']).'|';
$last_template .= substr($last_env, strlen(ENV_VAR_NAME) + 1);
$this->StoreVar('last_template', $last_template);
- $this->StoreVar('last_env', substr($this->Application->BuildEnv($this->Application->GetVar('t'),Array('pass'=>'all')), strlen(ENV_VAR_NAME)+1 ));
+ $this->StoreVar('last_env', substr($this->Application->BuildEnv($this->Application->GetVar('t'),Array('pass'=>'all', '__URLENCODE__' => 1)), strlen(ENV_VAR_NAME)+1 ));
}
$this->PrintSession('after save');
Index: trunk/core/kernel/application.php
===================================================================
diff -u -r4524 -r4528
--- trunk/core/kernel/application.php (.../application.php) (revision 4524)
+++ trunk/core/kernel/application.php (.../application.php) (revision 4528)
@@ -196,7 +196,7 @@
$rewrite_on = $this->ConfigValue('UseModRewrite');
$admin_on = getArrayValue($_REQUEST, 'admin') || $this->IsAdmin();
- define('MOD_REWRITE', ($rewrite_on || constOn('CMS') ) && !$admin_on ? 1 : 0);
+ define('MOD_REWRITE', $rewrite_on && !$admin_on ? 1 : 0);
$this->Factory = new kFactory();
@@ -535,15 +535,12 @@
$template_cache =& $this->recallObject('TemplatesCache');
$t = $this->GetVar('t');
- if( constOn('CMS') )
- {
+ if ($this->findModule('Name', 'In-CMS', 'Loaded')) {
$cms_handler =& $this->recallObject('cms_EventHandler');
- if( !$template_cache->TemplateExists($t) )
- {
+ if (!$template_cache->TemplateExists($t)) {
$t = $cms_handler->GetDesignTemplate();
}
- else
- {
+ else {
$cms_handler->SetCatByTemplate();
}
}
Index: trunk/core/kernel/utility/http_query.php
===================================================================
diff -u -r4446 -r4528
--- trunk/core/kernel/utility/http_query.php (.../http_query.php) (revision 4446)
+++ trunk/core/kernel/utility/http_query.php (.../http_query.php) (revision 4528)
@@ -517,7 +517,7 @@
}while (!$template_found && $template_parts);
// try to find template in virtual templates in case if such ability exists
- if (constOn('CMS') && !$template_found) {
+ if ($this->Application->findModule('Name', 'In-CMS', 'Loaded') && !$template_found) {
$template_parts = $url_parts;
$url_parts = Array();
Index: trunk/core/kernel/db/db_event_handler.php
===================================================================
diff -u -r4471 -r4528
--- trunk/core/kernel/db/db_event_handler.php (.../db_event_handler.php) (revision 4471)
+++ trunk/core/kernel/db/db_event_handler.php (.../db_event_handler.php) (revision 4528)
@@ -70,12 +70,10 @@
*/
function getPassedID(&$event)
{
- // ?? We don't need to store selected id in session, as long as we have pass=all by default, which
- // means that main item id will be passed to all sub-item screens by default
- // another prove of that is that sub-items relay on main item '_mode' = 't' for switching to temp tables
- // Also having id in session raised problems with the id of deleted item stuck in session
+ if ($event->getEventParam('raise_warnings') === false) {
+ $event->setEventParam('raise_warnings', 1);
+ }
-
// 1. get id from post (used in admin)
$ret = $this->Application->GetVar($event->getPrefixSpecial(true).'_id');
if($ret) return $ret;
@@ -139,10 +137,9 @@
// This is critical - otherwise getPassedID will return last ID stored in session! (not exactly true)
// this smells... needs to be refactored
$first_id = getArrayValue($ret,0);
- if ($first_id === false) {
+ if (($first_id === false) && ($event->getEventParam('raise_warnings') == 1)) {
trigger_error('Requested ID for prefix '.$event->getPrefixSpecial().' not passed',E_USER_NOTICE);
}
-
$this->Application->SetVar($event->getPrefixSpecial(true).'_id', $first_id);
return $ret;
}
@@ -295,7 +292,7 @@
if ($object->Load($id) )
{
$actions =& $this->Application->recallObject('kActions');
- $actions->Set($event->Prefix_Special.'_id', $object->GetId() );
+ $actions->Set($event->Prefix_Special.'_id', $object->GetID() );
}
else
{