Index: branches/RC/core/units/admin/admin_tag_processor.php =================================================================== diff -u -N -r9639 -r9643 --- branches/RC/core/units/admin/admin_tag_processor.php (.../admin_tag_processor.php) (revision 9639) +++ branches/RC/core/units/admin/admin_tag_processor.php (.../admin_tag_processor.php) (revision 9643) @@ -783,12 +783,19 @@ return $this->Application->HREF($t, '', $vars, $index_file); } + /** + * Returns menu frame width or 200 in case, when invalid width specified in config + * + * @param Array $params + * @return string + */ function MenuFrameWidth($params) { - $w = $this->Application->ConfigValue('MenuFrameWidth'); - if (!$w) $w = 200; - return $w; + $width = (int)$this->Application->ConfigValue('MenuFrameWidth'); + + return $width > 0 ? $width : 200; } + function AdminSkin($params) { static $style; @@ -862,7 +869,7 @@ $this->Application->RemoveVar('compile_errors'); return $o; } - + function ExportData($params) { $export_helper =& $this->Application->recallObject('CSVHelper'); Index: branches/RC/core/units/admin/admin_events_handler.php =================================================================== diff -u -N -r9639 -r9643 --- branches/RC/core/units/admin/admin_events_handler.php (.../admin_events_handler.php) (revision 9639) +++ branches/RC/core/units/admin/admin_events_handler.php (.../admin_events_handler.php) (revision 9643) @@ -253,6 +253,7 @@ function OnBeforeShutdown(&$event) { } + /** * Is called after tree was build (when not from cache) * Index: branches/RC/core/admin_templates/index.tpl =================================================================== diff -u -N -r9639 -r9643 --- branches/RC/core/admin_templates/index.tpl (.../index.tpl) (revision 9639) +++ branches/RC/core/admin_templates/index.tpl (.../index.tpl) (revision 9643) @@ -31,7 +31,7 @@ " name="head" scrolling="no" noresize="noresize"> - ,0,*" border="0"> + 0,*" border="0"> " name="menu" target="main" noresize scrolling="auto" marginwidth="0" marginheight="0"> " name="main" marginwidth="0" marginheight="0" frameborder="no" noresize scrolling="auto"> Index: branches/RC/core/kernel/utility/temp_handler.php =================================================================== diff -u -N -r9639 -r9643 --- branches/RC/core/kernel/utility/temp_handler.php (.../temp_handler.php) (revision 9639) +++ branches/RC/core/kernel/utility/temp_handler.php (.../temp_handler.php) (revision 9643) @@ -76,9 +76,9 @@ } } else { - $this->savedIDs[$prefix.($special ? '.' : '').$special][] = $id; + $this->savedIDs[$prefix.($special ? '.' : '').$special][] = $id; + } } - } /** * Get temp table name @@ -245,7 +245,7 @@ if (!preg_match('/(.*)-item$/', $special)) { $special .= '-item'; } - + $object =& $this->Application->recallObject($prefix.'.'.$special, $prefix, Array('skip_autoload' => true)); $object->PopulateMultiLangFields(); @@ -585,17 +585,19 @@ } else { // zero or negaitve ids should be copied one by one to get their InsertId // reseting to 0 so it get inserted into live table with autoincrement - $query = 'UPDATE '.$this->GetTempName($master['TableName']).' + $query = 'UPDATE '.$this->GetTempName($master['TableName']).' SET '.$master['IdField'].' = 0 WHERE '.$master['IdField'].' = '.$an_id; // constrain is not needed here because ID is already unique - $this->Conn->Query($query); + $this->Conn->Query($query); + // copying $query = 'INSERT INTO '.$master['TableName'].' SELECT * FROM '.$this->GetTempName($master['TableName']).' WHERE '.$master['IdField'].' = 0'; $this->Conn->Query($query); $live_ids[$an_id] = $this->Conn->getInsertID(); //storing newly created live id + //delete already copied record from master temp table $query = 'DELETE FROM '.$this->GetTempName($master['TableName']).' WHERE '.$master['IdField'].' = 0'; @@ -614,8 +616,6 @@ $this->saveID($master['Prefix'], '', $live_ids); - - // no need to clear temp table - it will be dropped by next statement } } @@ -716,7 +716,7 @@ array_push($this->DroppedTables, $table); $this->DroppedTables = array_unique($this->DroppedTables); $this->Conn->Query($query); - + return true; } @@ -743,10 +743,12 @@ } } } + function CheckSimultaniousEdit() { $tables = $this->Conn->GetCol('SHOW TABLES'); $mask_edit_table = '/'.TABLE_PREFIX.'ses_(.*)_edit_'.$this->MasterTable.'$/'; + $sql='SELECT COUNT(*) FROM '.$this->TableName.' WHERE '.$this->IDField.' = \'%s\''; $my_sid = $this->Application->GetSID(); $ids = join(',',$this->Tables['IDs']); @@ -760,6 +762,7 @@ if ($sid == $my_sid) continue; $found = $this->Conn->GetOne("SELECT COUNT({$this->Tables['IdField']}) FROM $table WHERE {$this->Tables['IdField']} IN ($ids)"); if (!$found || in_array($sid, $sids)) continue; + $sids[] = $sid; } } Index: branches/RC/core/units/general/helpers/search_helper.php =================================================================== diff -u -N -r9639 -r9643 --- branches/RC/core/units/general/helpers/search_helper.php (.../search_helper.php) (revision 9639) +++ branches/RC/core/units/general/helpers/search_helper.php (.../search_helper.php) (revision 9643) @@ -521,15 +521,15 @@ { $includes_or_filter =& $this->Application->makeClass('kMultipleFilter', FLT_TYPE_OR); $excepts_and_filter =& $this->Application->makeClass('kMultipleFilter', FLT_TYPE_AND); - + $includes_or_filter_h =& $this->Application->makeClass('kMultipleFilter', FLT_TYPE_OR); $excepts_and_filter_h =& $this->Application->makeClass('kMultipleFilter', FLT_TYPE_AND); - + if ($types) { $types = explode(',', $types); foreach ($types as $type) { $type = trim($type); - + if (isset($type_clauses[$type])) { if ($type_clauses[$type]['having_filter']) { $includes_or_filter_h->addFilter('filter_'.$type, $type_clauses[$type]['include']); @@ -539,12 +539,12 @@ } } } - + if ($except_types) { $except_types = explode(',', $except_types); foreach ($except_types as $type) { $type = trim($type); - + if (isset($type_clauses[$type])) { if ($type_clauses[$type]['having_filter']) { $excepts_and_filter_h->addFilter('filter_'.$type, $type_clauses[$type]['except']); @@ -554,12 +554,12 @@ } } } - + $object =& $event->getObject(); - + $object->addFilter('includes_filter', $includes_or_filter); $object->addFilter('excepts_filter', $excepts_and_filter); - + $object->addFilter('includes_filter_h', $includes_or_filter_h, HAVING_FILTER); $object->addFilter('excepts_filter_h', $excepts_and_filter_h, HAVING_FILTER); } Index: branches/RC/core/kernel/db/db_tag_processor.php =================================================================== diff -u -N -r9642 -r9643 --- branches/RC/core/kernel/db/db_tag_processor.php (.../db_tag_processor.php) (revision 9642) +++ branches/RC/core/kernel/db/db_tag_processor.php (.../db_tag_processor.php) (revision 9643) @@ -2055,11 +2055,13 @@ /** * Performs image resize to required dimensions and returns resulting url (cached resized image) + * Do not uncomment this method, because kCatDBTagProcessor uses same method, + * but it is invoked via aggregated tag, which brokes down, when this method is uncommented * * @param Array $params * @return string */ - function ImageSrc($params) + /*function ImageSrc($params) { $max_width = isset($params['MaxWidth']) ? $params['MaxWidth'] : false; $max_height = isset($params['MaxHeight']) ? $params['MaxHeight'] : false; @@ -2071,7 +2073,7 @@ $field = $this->SelectParam($params, 'name,field'); return $object->GetField($field, 'resize:'.$max_width.'x'.$max_height.';wm:'.$logo_filename.'|'.$logo_h_margin.'|'.$logo_v_margin); - } + }*/ } ?> \ No newline at end of file Index: branches/RC/core/kernel/session/session.php =================================================================== diff -u -N -r9639 -r9643 --- branches/RC/core/kernel/session/session.php (.../session.php) (revision 9639) +++ branches/RC/core/kernel/session/session.php (.../session.php) (revision 9643) @@ -41,7 +41,7 @@ Usage: -$session =& new Session(smAUTO); //smAUTO is default, you could just leave the brackets empty, or provide another mode +$session = new Session(smAUTO); //smAUTO is default, you could just leave the brackets empty, or provide another mode $session->SetCookieDomain('my.domain.com'); $session->SetCookiePath('/myscript'); @@ -418,7 +418,7 @@ $this->Checkers = Array(); $this->InitStorage($special); - $this->Data =& new Params(); + $this->Data = new Params(); $tmp_sid = $this->GetPassedSIDValue(); @@ -734,7 +734,7 @@ function Destroy() { $this->Storage->DeleteSession($this); - $this->Data =& new Params(); + $this->Data = new Params(); $this->SID = ''; if ($this->CookiesEnabled) $this->SetSessionCookie(); //will remove the cookie due to value (sid) is empty $this->SetSession(); //will create a new session Index: branches/RC/core/admin_templates/incs/header.tpl =================================================================== diff -u -N -r8929 -r9643 --- branches/RC/core/admin_templates/incs/header.tpl (.../header.tpl) (revision 8929) +++ branches/RC/core/admin_templates/incs/header.tpl (.../header.tpl) (revision 9643) @@ -19,6 +19,7 @@ + Index: branches/RC/core/admin_templates/js/ajax.js =================================================================== diff -u -N -r9639 -r9643 --- branches/RC/core/admin_templates/js/ajax.js (.../ajax.js) (revision 9639) +++ branches/RC/core/admin_templates/js/ajax.js (.../ajax.js) (revision 9643) @@ -335,6 +335,7 @@ AjaxPopupManager.prototype.errorCallback = function($request, $params, $object) { alert('AJAX Error; class: AjaxPopupManager; ' + Request.getErrorHtml($request)); } + // AJAX DropdownPreloader class function AjaxDropdownPreloader($url, $input_mask, $filter_field, $dependend_field, value) { this.URL = $url; @@ -345,10 +346,12 @@ this.Value = value; this.BusyRequest = false; } + AjaxDropdownPreloader.prototype.prepareURL = function() { return this.URL.replace('#DEPENDEND#', this.Dependend).replace('#FILTER_VALUE#', this.getValue(this.FilterField)); } + AjaxDropdownPreloader.prototype.prepareTitles = function() { var $control = this.getControl(this.DependendField); var $i = 0; @@ -359,22 +362,26 @@ } return $ret; } + AjaxDropdownPreloader.prototype.getValue = function($field_name) { var $control = this.getControl($field_name); if ($control.tagName == 'INPUT') return $control.value; return $control.selectedIndex > 0 ? $control.options[$control.selectedIndex].value : ''; } + AjaxDropdownPreloader.prototype.Query = function () { var $url = this.prepareURL(); var $selected_value = this.Value || this.getValue(this.DependendField); // remove all existing options this.removeOptions(); Request.makeRequest($url, this.BusyRequest, '', this.successCallback, this.errorCallback, $selected_value, this); } + AjaxDropdownPreloader.prototype.getControl = function($field) { var $id = this.InputMask.replace('#FIELD#', $field); return document.getElementById($id); } + AjaxDropdownPreloader.prototype.successCallback = function($request, $params, $object) { if (Request.processRedirect($request) === true) { return ; @@ -384,6 +391,7 @@ runOnChange(control); $object.AfterProcess(); } + AjaxDropdownPreloader.prototype.ProcessXMLNode = function($node, $dst_field, $selected_value) { for (var i = 0; i < $node.childNodes.length; i++) { var $child = $node.childNodes.item(i); @@ -414,9 +422,11 @@ } } } -AjaxDropdownPreloader.prototype.AfterProcess = function() -{ + +AjaxDropdownPreloader.prototype.AfterProcess = function() { + } + AjaxDropdownPreloader.prototype.removeOptions = function($object) { if (!$object) $object = this.getControl(this.DependendField); if ($object.options.length > 0) { @@ -425,6 +435,7 @@ } } } + AjaxDropdownPreloader.prototype.addOption = function($object, $value, $title, attributes) { var $option = document.createElement('OPTION'); $object.options.add($option, $object.options.length); @@ -438,6 +449,7 @@ } } } + AjaxDropdownPreloader.prototype.errorCallback = function($request, $params, $object) { alert('AJAX Error; class: AjaxDropdownPreloader; ' + Request.getErrorHtml($request)); } \ No newline at end of file