Index: branches/5.2.x/core/admin_templates/categories/relations_edit.tpl
===================================================================
diff -u -r14572 -r15539
--- branches/5.2.x/core/admin_templates/categories/relations_edit.tpl (.../relations_edit.tpl) (revision 14572)
+++ branches/5.2.x/core/admin_templates/categories/relations_edit.tpl (.../relations_edit.tpl) (revision 15539)
@@ -1,3 +1,5 @@
+
+
@@ -34,7 +36,7 @@
a_toolbar.HideButton('prev');
a_toolbar.HideButton('next');
- a_toolbar.HideButton('sep1');
+ a_toolbar.HideButton('sep1');
a_toolbar.DisableButton('next');
Index: branches/5.2.x/core/admin_templates/categories/related_searches_edit.tpl
===================================================================
diff -u -r14572 -r15539
--- branches/5.2.x/core/admin_templates/categories/related_searches_edit.tpl (.../related_searches_edit.tpl) (revision 14572)
+++ branches/5.2.x/core/admin_templates/categories/related_searches_edit.tpl (.../related_searches_edit.tpl) (revision 15539)
@@ -1,3 +1,5 @@
+
+
@@ -23,14 +25,14 @@
go_to_id('c-search', '');
}
));
-
+
a_toolbar.AddButton( new ToolBarButton('next', '', function() {
go_to_id('c-search', '');
}
));
-
+
a_toolbar.Render();
-
+
a_toolbar.HideButton('prev');
a_toolbar.HideButton('next');
Index: branches/5.2.x/core/admin_templates/users/user_edit_group.tpl
===================================================================
diff -u -r14572 -r15539
--- branches/5.2.x/core/admin_templates/users/user_edit_group.tpl (.../user_edit_group.tpl) (revision 14572)
+++ branches/5.2.x/core/admin_templates/users/user_edit_group.tpl (.../user_edit_group.tpl) (revision 15539)
@@ -1,3 +1,5 @@
+
+
Fisheye: Tag 15539 refers to a dead (removed) revision in file `branches/5.2.x/core/admin_templates/ajax/popup_manager.tpl'.
Fisheye: No comparison available. Pass `N' to diff?
Index: branches/5.2.x/core/admin_templates/categories/images_edit.tpl
===================================================================
diff -u -r14572 -r15539
--- branches/5.2.x/core/admin_templates/categories/images_edit.tpl (.../images_edit.tpl) (revision 14572)
+++ branches/5.2.x/core/admin_templates/categories/images_edit.tpl (.../images_edit.tpl) (revision 15539)
@@ -1,3 +1,5 @@
+
+
@@ -26,14 +28,14 @@
go_to_id('c-img', '');
}
));
-
+
a_toolbar.AddButton( new ToolBarButton('next', '', function() {
go_to_id('c-img', '');
}
));
-
+
a_toolbar.Render();
-
+
a_toolbar.HideButton('prev');
a_toolbar.HideButton('next');
Index: branches/5.2.x/core/admin_templates/js/ajax.js
===================================================================
diff -u -r14620 -r15539
--- branches/5.2.x/core/admin_templates/js/ajax.js (.../ajax.js) (revision 14620)
+++ branches/5.2.x/core/admin_templates/js/ajax.js (.../ajax.js) (revision 15539)
@@ -318,44 +318,35 @@
// AJAX PopupManager class
function AjaxPopupManager($url) {
this.URL = $url;
- this.ResponceFunction = null;
- this.PopupSizes = new Array();
+ this.PopupSizes = [];
}
-AjaxPopupManager.prototype.GetSize = function ($template) {
- if (this.ResponceFunction == null) {
- alert ('Please define responce function first (type: '+typeof(this.ResponceFunction)+')');
+AjaxPopupManager.prototype.GetSize = function ($template, $callback) {
+ if ( $callback === undefined || !$.isFunction($callback) ) {
+ alert('Please specify callback');
}
- if (!isset(this.PopupSizes[$template])) {
- var $url = this.URL + '&type=GetPopupSize&template_name=' + $template;
-// alert('from ajax: '+$url);
- Request.makeRequest($url, this.BusyRequest, '', this.successCallback, this.errorCallback, ['GetSize', $template], this);
+ if ( !isset(this.PopupSizes[$template]) ) {
+ var $me = this;
+
+ $.get(
+ this.URL,
+ {
+ 'events[adm]': 'OnGetPopupSize',
+ 'template_name': $template
+ },
+ function ($popup_size) {
+ // store response to cache for future use
+ $me.PopupSizes[$template] = $popup_size;
+ $callback($popup_size);
+ }
+ );
}
else {
-// alert('from cache');
- this.ResponceFunction(this.PopupSizes[$template]);
+ $callback(this.PopupSizes[$template]);
}
-}
+};
-AjaxPopupManager.prototype.successCallback = function($request, $params, $object) {
- var $responce = $request.responseText;
-
- switch ($params[0]) {
- case 'GetSize':
- // store responce to cache for future use
- $object.PopupSizes[ $params[1] ] = $responce;
- break;
- }
-
- $object.ResponceFunction($responce);
- $object.ResponceFunction = null; // reset responce function
-}
-
-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, $has_empty) {
this.URL = $url;
Index: branches/5.2.x/core/admin_templates/head.tpl
===================================================================
diff -u -r14635 -r15539
--- branches/5.2.x/core/admin_templates/head.tpl (.../head.tpl) (revision 14635)
+++ branches/5.2.x/core/admin_templates/head.tpl (.../head.tpl) (revision 15539)
@@ -5,7 +5,7 @@
Index: branches/5.2.x/core/admin_templates/users/admin_edit_group.tpl
===================================================================
diff -u -r14244 -r15539
--- branches/5.2.x/core/admin_templates/users/admin_edit_group.tpl (.../admin_edit_group.tpl) (revision 14244)
+++ branches/5.2.x/core/admin_templates/users/admin_edit_group.tpl (.../admin_edit_group.tpl) (revision 15539)
@@ -1,5 +1,6 @@
-
+
+
Index: branches/5.2.x/core/units/admin/admin_tag_processor.php
===================================================================
diff -u -r15421 -r15539
--- branches/5.2.x/core/units/admin/admin_tag_processor.php (.../admin_tag_processor.php) (revision 15421)
+++ branches/5.2.x/core/units/admin/admin_tag_processor.php (.../admin_tag_processor.php) (revision 15539)
@@ -1,6 +1,6 @@
Application->GetVar('ajax') == 'yes') {
+ if ( $this->Application->GetVar('ajax') == 'yes' ) {
// during AJAX request just output size
- die($width.'x'.$height);
+ die($width . 'x' . $height);
}
- if (!$this->UsePopups($params)) {
- return ;
+ if ( !$this->UsePopups($params) ) {
+ return;
}
$t = $this->Application->GetVar('t');
+
$sql = 'SELECT *
- FROM '.TABLE_PREFIX.'PopupSizes
- WHERE TemplateName = '.$this->Conn->qstr($t);
+ FROM ' . TABLE_PREFIX . 'PopupSizes
+ WHERE TemplateName = ' . $this->Conn->qstr($t);
$popup_info = $this->Conn->GetRow($sql);
- if (!$popup_info) {
+
+ if ( !$popup_info ) {
// create new popup size record
- $fields_hash = Array (
- 'TemplateName' => $t,
- 'PopupWidth' => $width,
- 'PopupHeight' => $height,
- );
- $this->Conn->doInsert($fields_hash, TABLE_PREFIX.'PopupSizes');
+ $fields_hash = Array (
+ 'TemplateName' => $t,
+ 'PopupWidth' => $width,
+ 'PopupHeight' => $height,
+ );
+
+ $this->Conn->doInsert($fields_hash, TABLE_PREFIX . 'PopupSizes');
}
- elseif ($popup_info['PopupWidth'] != $width || $popup_info['PopupHeight'] != $height) {
+ elseif ( $popup_info['PopupWidth'] != $width || $popup_info['PopupHeight'] != $height ) {
// popup found and size in tag differs from one in db -> update in db
- $fields_hash = Array (
- 'PopupWidth' => $width,
- 'PopupHeight' => $height,
- );
- $this->Conn->doUpdate($fields_hash, TABLE_PREFIX.'PopupSizes', 'PopupId = '.$popup_info['PopupId']);
- }
- }
+ $fields_hash = Array (
+ 'PopupWidth' => $width,
+ 'PopupHeight' => $height,
+ );
- /**
- * Returns popup size (by template), if not cached, then parse template to get value
- *
- * @param Array $params
- * @return string
- */
- function GetPopupSize($params)
- {
- $t = $this->Application->GetVar('template_name');
- $sql = 'SELECT *
- FROM '.TABLE_PREFIX.'PopupSizes
- WHERE TemplateName = '.$this->Conn->qstr($t);
- $popup_info = $this->Conn->GetRow($sql);
- if (!$popup_info) {
- $this->Application->InitParser();
- $this->Application->ParseBlock(array('name' => $t)); // dies when SetPopupSize tag found & in ajax requrest
- return '750x400'; // tag SetPopupSize not found in template -> use default size
+ $this->Conn->doUpdate($fields_hash, TABLE_PREFIX . 'PopupSizes', 'PopupId = ' . $popup_info['PopupId']);
}
- return $popup_info['PopupWidth'].'x'.$popup_info['PopupHeight'];
}
/**
Index: branches/5.2.x/core/admin_templates/js/script.js
===================================================================
diff -u -r15411 -r15539
--- branches/5.2.x/core/admin_templates/js/script.js (.../script.js) (revision 15411)
+++ branches/5.2.x/core/admin_templates/js/script.js (.../script.js) (revision 15539)
@@ -468,16 +468,15 @@
if ( $pm ) {
// popup manager was found in head frame
- $pm.ResponceFunction = function ($responce) {
- if ( !$responce.match(/([\d]+)x([\d]+)/) ) {
- // invalid responce was received, may be php fatal error during AJAX request
- $responce = $default_size;
+ $pm.GetSize($t, function ($response) {
+ if ( !$response.match(/([\d]+)x([\d]+)/) ) {
+ // invalid response was received, may be php fatal error during AJAX request
+ $response = $default_size;
}
- open_popup($prefix_special, $event, $t, $responce, $onAfterOpenPopup);
- }
+ open_popup($prefix_special, $event, $t, $response, $onAfterOpenPopup);
+ });
- $pm.GetSize($t);
return;
}
Index: branches/5.2.x/core/admin_templates/users/image_edit.tpl
===================================================================
diff -u -r14572 -r15539
--- branches/5.2.x/core/admin_templates/users/image_edit.tpl (.../image_edit.tpl) (revision 14572)
+++ branches/5.2.x/core/admin_templates/users/image_edit.tpl (.../image_edit.tpl) (revision 15539)
@@ -1,3 +1,5 @@
+
+
@@ -25,14 +27,14 @@
go_to_id('u-img', '');
}
));
-
+
a_toolbar.AddButton( new ToolBarButton('next', '', function() {
go_to_id('u-img', '');
}
));
-
+
a_toolbar.Render();
-
+
a_toolbar.HideButton('prev');
a_toolbar.HideButton('next');
Index: branches/5.2.x/core/units/admin/admin_events_handler.php
===================================================================
diff -u -r15261 -r15539
--- branches/5.2.x/core/units/admin/admin_events_handler.php (.../admin_events_handler.php) (revision 15261)
+++ branches/5.2.x/core/units/admin/admin_events_handler.php (.../admin_events_handler.php) (revision 15539)
@@ -1,6 +1,6 @@
Conn->Query('OPTIMIZE TABLE ' . $table_name);
}
}
+
+ /**
+ * Returns popup size (by template), if not cached, then parse template to get value
+ *
+ * @param kEvent $event
+ * @return void
+ * @access protected
+ */
+ protected function OnGetPopupSize(kEvent $event)
+ {
+ $event->status = kEvent::erSTOP;
+
+ if ( $this->Application->GetVar('ajax') != 'yes' ) {
+ return;
+ }
+
+ $t = $this->Application->GetVar('template_name');
+
+ $sql = 'SELECT *
+ FROM ' . TABLE_PREFIX . 'PopupSizes
+ WHERE TemplateName = ' . $this->Conn->qstr($t);
+ $popup_info = $this->Conn->GetRow($sql);
+
+ $this->Application->setContentType('text/plain');
+
+ if ( !$popup_info ) {
+ // dies when SetPopupSize tag found & in ajax request
+ $this->Application->InitParser();
+ $this->Application->ParseBlock(Array ('name' => $t));
+
+ // tag SetPopupSize not found in template -> use default size
+ echo '750x400';
+ }
+ else {
+ echo $popup_info['PopupWidth'] . 'x' . $popup_info['PopupHeight'];
+ }
+ }
}
Index: branches/5.2.x/core/admin_templates/config/config_search_edit.tpl
===================================================================
diff -u -r14572 -r15539
--- branches/5.2.x/core/admin_templates/config/config_search_edit.tpl (.../config_search_edit.tpl) (revision 14572)
+++ branches/5.2.x/core/admin_templates/config/config_search_edit.tpl (.../config_search_edit.tpl) (revision 15539)
@@ -1,3 +1,5 @@
+
+