Index: branches/1.2.x/units/widgets/widget_tp.php =================================================================== diff -u -N -r15153 -r15342 --- branches/1.2.x/units/widgets/widget_tp.php (.../widget_tp.php) (revision 15153) +++ branches/1.2.x/units/widgets/widget_tp.php (.../widget_tp.php) (revision 15342) @@ -1,47 +1,66 @@ getObject($params); + /* @var $object kDBList */ - /** - * Returns a link for editing product - * - * @param Array $params - * @return string - */ - function ItemEditLink($params) - { - $object = $this->getObject($params); - /* @var $object kDBList */ + $edit_template = $this->Application->getUnitOption($this->Prefix, 'AdminTemplatePath') . '/' . $this->Application->getUnitOption($this->Prefix, 'AdminTemplatePrefix') . 'edit'; - $edit_template = $this->Application->getUnitOption($this->Prefix, 'AdminTemplatePath') . '/' . $this->Application->getUnitOption($this->Prefix, 'AdminTemplatePrefix') . 'edit'; + $url_params = Array ( + 'm_opener' => 'd', + $this->Prefix.'_mode' => 't', + $this->Prefix.'_event' => 'OnEdit', + $this->Prefix.'_id' => $object->GetID(), + 'pass' => 'all,'.$this->Prefix, + 'no_pass_through' => 1, + ); - $url_params = Array ( - 'm_opener' => 'd', - $this->Prefix.'_mode' => 't', - $this->Prefix.'_event' => 'OnEdit', - $this->Prefix.'_id' => $object->GetID(), - 'pass' => 'all,'.$this->Prefix, - 'no_pass_through' => 1, - ); + return $this->Application->HREF($edit_template, '', $url_params); + } - return $this->Application->HREF($edit_template, '', $url_params); - } - } \ No newline at end of file + /** + * Creates link to an item including only it's id + * + * @param Array $params + * @return string + * @access protected + */ + protected function ItemLink($params) + { + $object = $this->getObject($params); + /* @var $object kDBItem */ + + $params['pass'] = 'm,' . $this->Prefix; + $params[$object->Prefix . '_id'] = $object->GetID(); + $params[$object->Prefix . '_filename'] = $object->GetDBField('Title'); + + return $this->Application->ProcessParsedTag('m', 'Link', $params); + } + +} \ No newline at end of file