Index: branches/RC/core/units/images/image_tag_processor.php
===================================================================
diff -u -r9633 -r9638
--- branches/RC/core/units/images/image_tag_processor.php (.../image_tag_processor.php) (revision 9633)
+++ branches/RC/core/units/images/image_tag_processor.php (.../image_tag_processor.php) (revision 9638)
@@ -16,14 +16,29 @@
return ;
}
+ $parent_prefix = $this->Application->getUnitOption($object->Prefix, 'ParentPrefix');
+ $parent_item =& $this->Application->recallObject($parent_prefix);
+
$block_params['img_path'] = $image_url;
$image_dimensions = $this->ImageSize($block_params);
$block_params['img_size'] = $image_dimensions ? $image_dimensions : ' width="'.$block_params['DefaultWidth'].'"';
- $block_params['alt'] = htmlspecialchars($object->GetField('AltName')); // really used ?
+ $block_params['alt'] = htmlspecialchars($this->getItemTitle($parent_item)); // $object->GetField('AltName') really used ?
$block_params['align'] = array_key_exists('align', $block_params) ? $block_params['align'] : 'left';
}
/**
+ * Returns value of object's title field
+ *
+ * @param kDBItem $object
+ * @return string
+ */
+ function getItemTitle(&$object)
+ {
+ $title_field = $this->Application->getUnitOption($object->Prefix, 'TitleField');
+ return $object->GetField($title_field);
+ }
+
+ /**
* [AGGREGATED TAGS] works as
*
* @param Array $params
@@ -69,6 +84,8 @@
) {
$object->SetDefaultValues();
$object->SetDBField('Url', $parent_item->GetDBField('FullUrl'));
+ $object->SetDBField('AltName', $this->getItemTitle($parent_item));
+
$object->SetDBFieldsFromHash($parent_item->GetFieldValues(), Array('SameImages', 'LocalThumb', 'ThumbPath', 'ThumbUrl', 'LocalImage', 'LocalPath'));
$object->Loaded = true;
}
Index: branches/RC/kernel/units/images/image_tag_processor.php
===================================================================
diff -u -r9633 -r9638
--- branches/RC/kernel/units/images/image_tag_processor.php (.../image_tag_processor.php) (revision 9633)
+++ branches/RC/kernel/units/images/image_tag_processor.php (.../image_tag_processor.php) (revision 9638)
@@ -16,14 +16,29 @@
return ;
}
+ $parent_prefix = $this->Application->getUnitOption($object->Prefix, 'ParentPrefix');
+ $parent_item =& $this->Application->recallObject($parent_prefix);
+
$block_params['img_path'] = $image_url;
$image_dimensions = $this->ImageSize($block_params);
$block_params['img_size'] = $image_dimensions ? $image_dimensions : ' width="'.$block_params['DefaultWidth'].'"';
- $block_params['alt'] = htmlspecialchars($object->GetField('AltName')); // really used ?
+ $block_params['alt'] = htmlspecialchars($this->getItemTitle($parent_item)); // $object->GetField('AltName') really used ?
$block_params['align'] = array_key_exists('align', $block_params) ? $block_params['align'] : 'left';
}
/**
+ * Returns value of object's title field
+ *
+ * @param kDBItem $object
+ * @return string
+ */
+ function getItemTitle(&$object)
+ {
+ $title_field = $this->Application->getUnitOption($object->Prefix, 'TitleField');
+ return $object->GetField($title_field);
+ }
+
+ /**
* [AGGREGATED TAGS] works as
*
* @param Array $params
@@ -69,6 +84,8 @@
) {
$object->SetDefaultValues();
$object->SetDBField('Url', $parent_item->GetDBField('FullUrl'));
+ $object->SetDBField('AltName', $this->getItemTitle($parent_item));
+
$object->SetDBFieldsFromHash($parent_item->GetFieldValues(), Array('SameImages', 'LocalThumb', 'ThumbPath', 'ThumbUrl', 'LocalImage', 'LocalPath'));
$object->Loaded = true;
}