Page MenuHomeIn-Portal Phabricator

in-portal
No OneTemporary

File Metadata

Created
Fri, Jul 18, 2:57 PM

in-portal

Index: trunk/kernel/units/general/cat_tag_processor.php
===================================================================
--- trunk/kernel/units/general/cat_tag_processor.php (revision 3826)
+++ trunk/kernel/units/general/cat_tag_processor.php (revision 3827)
@@ -1,106 +1,106 @@
<?php
class kCatDBTagProcessor extends kDBTagProcessor {
function ItemIcon($params)
{
$object =& $this->Application->recallObject($this->getPrefixSpecial(),$this->Prefix, $params);
$grids = $this->Application->getUnitOption($this->Prefix,'Grids');
$icons =& $grids[ $params['grid'] ]['Icons'];
$status_fields = $this->Application->getUnitOption($this->Prefix,'StatusField');
if(!$status_fields) return $icons['default'];
$value = $object->GetDBField($status_fields[0]); // sets base status icon
if($value == STATUS_ACTIVE)
{
if( $object->GetDBField('IsPop') ) $value = 'POP';
if( $object->GetDBField('IsHot') ) $value = 'HOT';
if( $object->GetDBField('IsNew') ) $value = 'NEW';
if( $object->GetDBField('EditorsPick') ) $value = 'PICK';
}
return isset($icons[$value]) ? $icons[$value] : $icons['default'];
}
/**
* Returns path where exported category items should be saved
*
* @param Array $params
*/
function ExportPath($params)
{
$ret = EXPORT_PATH.'/';
if( getArrayValue($params, 'as_url') )
{
$ret = str_replace( FULL_PATH.'/', $this->Application->BaseURL(), $ret);
}
$export_options = unserialize($this->Application->RecallVar($this->getPrefixSpecial().'_options'));
$ret .= $export_options['ExportFilename'].'.'.($export_options['ExportFormat'] == 1 ? 'csv' : 'xml');
return $ret;
}
function CategoryPath($params)
{
if (!isset($params['cat_id']))
{
$params['cat_id'] = $this->Application->RecallVar($params['session_var'], 0);
}
$block_params['separator'] = $params['separator'];
if($params['cat_id'] == 0)
{
$block_params['name'] = $params['rootcatblock'];
return $this->Application->ParseBlock($block_params);
}
else
{
$cat_object =& $this->Application->recallObject('c', 'c_List');
$sql = 'SELECT CategoryId, ParentId, Name FROM '.$cat_object->TableName.' WHERE CategoryId = '.$params['cat_id'];
$res = $this->Conn->GetRow($sql);
$block_params['name'] = $params['block'];
$block_params['cat_name'] = $res['Name'];
$block_params['cat_id'] = $res['CategoryId'];
$next_params['separator'] = $params['separator'];
$next_params['rootcatblock'] = $params['rootcatblock'];
$next_params['block'] = $params['block'];
$next_params['cat_id'] = $res['ParentId'];
return $this->CategoryPath($next_params).$this->Application->ParseBlock($block_params);
}
}
function BuildListSpecial($params)
{
if ($this->Special != '') return $this->Special;
if ( isset($params['parent_cat_id']) ) {
$parent_cat_id = $params['parent_cat_id'];
}
else {
$parent_cat_id = $this->Application->GetVar('c_id');
if (!$parent_cat_id) {
$parent_cat_id = $this->Application->GetVar('m_cat_id');
}
}
$recursive = isset($params['recursive']);
$types = $this->SelectParam($params, 'types');
$except = $this->SelectParam($params, 'except');
if ($types.$except.$recursive == '') {
return parent::BuildListSpecial($params);
}
- $special = crc32($parent_cat_id.$types.$except.$recursive.$manufacturer);
+ $special = crc32($parent_cat_id.$types.$except.$recursive);
return $special;
}
}
?>
\ No newline at end of file
Property changes on: trunk/kernel/units/general/cat_tag_processor.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.3
\ No newline at end of property
+1.4
\ No newline at end of property
Index: trunk/core/units/general/cat_tag_processor.php
===================================================================
--- trunk/core/units/general/cat_tag_processor.php (revision 3826)
+++ trunk/core/units/general/cat_tag_processor.php (revision 3827)
@@ -1,106 +1,106 @@
<?php
class kCatDBTagProcessor extends kDBTagProcessor {
function ItemIcon($params)
{
$object =& $this->Application->recallObject($this->getPrefixSpecial(),$this->Prefix, $params);
$grids = $this->Application->getUnitOption($this->Prefix,'Grids');
$icons =& $grids[ $params['grid'] ]['Icons'];
$status_fields = $this->Application->getUnitOption($this->Prefix,'StatusField');
if(!$status_fields) return $icons['default'];
$value = $object->GetDBField($status_fields[0]); // sets base status icon
if($value == STATUS_ACTIVE)
{
if( $object->GetDBField('IsPop') ) $value = 'POP';
if( $object->GetDBField('IsHot') ) $value = 'HOT';
if( $object->GetDBField('IsNew') ) $value = 'NEW';
if( $object->GetDBField('EditorsPick') ) $value = 'PICK';
}
return isset($icons[$value]) ? $icons[$value] : $icons['default'];
}
/**
* Returns path where exported category items should be saved
*
* @param Array $params
*/
function ExportPath($params)
{
$ret = EXPORT_PATH.'/';
if( getArrayValue($params, 'as_url') )
{
$ret = str_replace( FULL_PATH.'/', $this->Application->BaseURL(), $ret);
}
$export_options = unserialize($this->Application->RecallVar($this->getPrefixSpecial().'_options'));
$ret .= $export_options['ExportFilename'].'.'.($export_options['ExportFormat'] == 1 ? 'csv' : 'xml');
return $ret;
}
function CategoryPath($params)
{
if (!isset($params['cat_id']))
{
$params['cat_id'] = $this->Application->RecallVar($params['session_var'], 0);
}
$block_params['separator'] = $params['separator'];
if($params['cat_id'] == 0)
{
$block_params['name'] = $params['rootcatblock'];
return $this->Application->ParseBlock($block_params);
}
else
{
$cat_object =& $this->Application->recallObject('c', 'c_List');
$sql = 'SELECT CategoryId, ParentId, Name FROM '.$cat_object->TableName.' WHERE CategoryId = '.$params['cat_id'];
$res = $this->Conn->GetRow($sql);
$block_params['name'] = $params['block'];
$block_params['cat_name'] = $res['Name'];
$block_params['cat_id'] = $res['CategoryId'];
$next_params['separator'] = $params['separator'];
$next_params['rootcatblock'] = $params['rootcatblock'];
$next_params['block'] = $params['block'];
$next_params['cat_id'] = $res['ParentId'];
return $this->CategoryPath($next_params).$this->Application->ParseBlock($block_params);
}
}
function BuildListSpecial($params)
{
if ($this->Special != '') return $this->Special;
if ( isset($params['parent_cat_id']) ) {
$parent_cat_id = $params['parent_cat_id'];
}
else {
$parent_cat_id = $this->Application->GetVar('c_id');
if (!$parent_cat_id) {
$parent_cat_id = $this->Application->GetVar('m_cat_id');
}
}
$recursive = isset($params['recursive']);
$types = $this->SelectParam($params, 'types');
$except = $this->SelectParam($params, 'except');
if ($types.$except.$recursive == '') {
return parent::BuildListSpecial($params);
}
- $special = crc32($parent_cat_id.$types.$except.$recursive.$manufacturer);
+ $special = crc32($parent_cat_id.$types.$except.$recursive);
return $special;
}
}
?>
\ No newline at end of file
Property changes on: trunk/core/units/general/cat_tag_processor.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.3
\ No newline at end of property
+1.4
\ No newline at end of property

Event Timeline