Page MenuHomeIn-Portal Phabricator

in-portal
No OneTemporary

File Metadata

Created
Tue, Aug 12, 6:25 PM

in-portal

Index: branches/5.2.x/core/units/promo_blocks/promo_block_tp.php
===================================================================
--- branches/5.2.x/core/units/promo_blocks/promo_block_tp.php (revision 15173)
+++ branches/5.2.x/core/units/promo_blocks/promo_block_tp.php (revision 15174)
@@ -1,91 +1,91 @@
<?php
/**
* @version $Id$
* @package In-Portal
* @copyright Copyright (C) 1997 - 2011 Intechnic. All rights reserved.
* @license GNU/GPL
* In-Portal is Open Source software.
* This means that this software may have been modified pursuant
* the GNU General Public License, and as distributed it includes
* or is derivative of works licensed under the GNU General Public License
* or other free or open source software licenses.
* See http://www.in-portal.org/license for copyright notices and details.
*/
defined('FULL_PATH') or die('restricted access!');
-class PromoBlockTagProcessor extends kDBtagProcessor {
+class PromoBlockTagProcessor extends kDBTagProcessor {
/**
* Returns link that registers promotion click and redirect user to the page, associated with the promotion
*
* @param Array $params
* @return string
* @access protected
*/
protected function PromoLink($params)
{
$object = $this->getObject($params);
/* @var $object kDBItem */
$url_params = Array (
$this->Prefix . '_event' => 'OnFollowLink',
'pass' => 'm,' . $this->Prefix,
'__NO_REWRITE__' => 1,
);
return $this->Application->HREF('index', '', $url_params);
}
/**
* Checks, that link should be opened in new window
*
* @param Array $params
* @return bool
* @access protected
*/
protected function LinkInNewWindow($params)
{
$object = $this->getObject($params);
/* @var $object kDBItem */
if ( $object->GetDBField('LinkType') == 1 ) { // Internal
return false;
}
return $object->GetDBField('OpenInNewWindow');
}
/**
* Get value from corresponding PromoGroupBlocks record
*
* @param Array $params
* @return bool
* @access protected
*/
protected function GetGroupSetting(Array $params)
{
static $group_data = null;
if ( !isset($group_data) ) {
if ( isset($params['group_id']) && $params['group_id'] ) {
$group_id = $params['group_id'];
}
else {
$page = $this->Application->recallObject('st');
/* @var $page CategoriesItem */
$group_id = $page->GetDBField('PromoBlockGroupId');
}
$sql = 'SELECT *
FROM ' . TABLE_PREFIX . 'PromoBlockGroups
WHERE PromoBlockGroupId = ' . (int)$group_id;
$group_data = $this->Conn->GetRow($sql);
}
$setting_name = $params['name'];
return isset($group_data[$setting_name]) ? $group_data[$setting_name] : '';
}
}
Index: branches/5.2.x/core/units/promo_block_groups/promo_block_group_tp.php
===================================================================
--- branches/5.2.x/core/units/promo_block_groups/promo_block_group_tp.php (revision 15173)
+++ branches/5.2.x/core/units/promo_block_groups/promo_block_group_tp.php (revision 15174)
@@ -1,73 +1,73 @@
<?php
/**
* @version $Id$
* @package In-Portal
* @copyright Copyright (C) 1997 - 2011 Intechnic. All rights reserved.
* @license GNU/GPL
* In-Portal is Open Source software.
* This means that this software may have been modified pursuant
* the GNU General Public License, and as distributed it includes
* or is derivative of works licensed under the GNU General Public License
* or other free or open source software licenses.
* See http://www.in-portal.org/license for copyright notices and details.
*/
defined('FULL_PATH') or die('restricted access!');
-class PromoBlockGroupTagProcessor extends kDBtagProcessor {
+class PromoBlockGroupTagProcessor extends kDBTagProcessor {
/**
* Print list of categories
*
* @param Array $params
* @return string
* @access protected
*/
protected function PrintCategories(Array $params)
{
$object = $this->getObject($params);
/* @var $object kDBItem */
$ret = '';
$field = $this->SelectParam($params, 'name,field');
$categories = explode(';', $object->GetDBField($field));
$block_params = $this->prepareTagParams($params);
$block_params['name'] = $params['render_as'];
foreach ($categories as $category_id) {
if ( $category_id ) {
$block_params['cat_id'] = $category_id;
$ret .= $this->Application->ParseBlock($block_params);
}
}
return $ret;
}
/**
* Returns link to edit promo block group, associated with this promo block list
*
* @param Array $params
* @return string
* @return protected
*/
protected function EditLink(Array $params)
{
$object = $this->getObject($params);
/* @var $object kDBItem */
$prefix = $object->getPrefixSpecial();
$url_params = Array (
'm_opener' => 'd',
$prefix . '_mode' => 't',
$prefix . '_event' => 'OnEdit',
$prefix . '_id' => $object->GetID(),
'pass' => 'all,' . $prefix,
'no_pass_through' => 1,
);
return $this->Application->HREF($params['edit_template'], '', $url_params);
}
}

Event Timeline