Index: branches/5.2.x/core/units/admin/admin_tag_processor.php =================================================================== diff -u -N -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']; } /**