Index: branches/1.0.x/install/install_schema.sql =================================================================== diff -u -N -r12914 -r13008 --- branches/1.0.x/install/install_schema.sql (.../install_schema.sql) (revision 12914) +++ branches/1.0.x/install/install_schema.sql (.../install_schema.sql) (revision 13008) @@ -9,11 +9,11 @@ Phone varchar(50) NOT NULL DEFAULT '', Qty double NOT NULL DEFAULT '0', `Status` tinyint(4) NOT NULL DEFAULT '2', - CreatedOn int(11) DEFAULT NULL, + CreatedOn int(10) unsigned DEFAULT NULL, Good tinyint(4) NOT NULL DEFAULT '0', BirthTime int(10) unsigned DEFAULT NULL, Image text, - `DataFile` text, + DataFile text, PRIMARY KEY (WidgetId) ); Index: branches/1.0.x/units/widgets/widgets_config.php =================================================================== diff -u -N -r12914 -r13008 --- branches/1.0.x/units/widgets/widgets_config.php (.../widgets_config.php) (revision 12914) +++ branches/1.0.x/units/widgets/widgets_config.php (.../widgets_config.php) (revision 13008) @@ -43,6 +43,10 @@ 'AutoDelete' => true, // delete these items when parent is being deleted 'AutoClone' => true, // clone these items when parent is being cloned */ + + // used to build editing links in admin grids + 'AdminTemplatePath' => 'widgets', + 'AdminTemplatePrefix' => 'widget_', 'TitlePresets' => Array ( 'default' => Array ( @@ -61,6 +65,8 @@ 'toolbar_buttons' => Array ('select', 'cancel', 'reset_edit', 'prev', 'next'), ), ), + + 'PermSection' => Array('main' => 'custom:widgets'), @@ -95,6 +101,10 @@ 'Sorting' => Array ('Title' => 'asc'), ) ), + + 'VirtualFields' => Array ( + 'VirtualActionField' => Array ('type' => 'string', 'default' => ''), + ), 'Fields' => Array ( 'WidgetId' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0), @@ -129,7 +139,7 @@ ), 'CreatedOn' => Array ( 'type' => 'int', 'formatter' => 'kDateFormatter', - 'time_format' => '', 'input_time_format' => '', 'default'=>'#NOW#', 'default' => NULL), + 'time_format' => '', 'input_time_format' => '', 'default'=>'#NOW#'), 'Good' => Array ( 'type' => 'int', 'formatter' => 'kOptionsFormatter', @@ -169,7 +179,7 @@ // 'Icons' => Array ('default' => 'icon16_custom.gif'), 'Fields' => Array ( 'WidgetId' => Array ('title' => 'la_col_Id', 'data_block' => 'grid_checkbox_td', 'filter_block' => 'grid_range_filter'), - 'Title' => Array ('title' => 'la_col_Name', 'data_block' => 'grid_delete_td'), + 'Title' => Array ('title' => 'la_col_Name', 'data_block' => 'grid_custom_td'), 'Image' => Array ('title' => 'la_col_Image', 'data_block' => 'grid_image_td'), 'Type' => Array ('title' => 'la_col_Type', 'filter_block' => 'grid_options_filter'), 'Status' => Array ('title' => 'la_col_Status', 'filter_block' => 'grid_options_filter'), @@ -180,6 +190,7 @@ 'CreatedOn' => Array ('title' => 'la_col_CreatedOn', 'filter_block' => 'grid_date_range_filter'), 'Description' => Array ('title' => 'la_col_Description'), // 'BirthTime' => Array ('title' => 'la_col_BirthTime', 'filter_block' => 'grid_date_range_filter'), + 'VirtualActionField' => Array ('title' => 'la_col_Action', 'data_block' => 'grid_delete_td'), ), ), ), Index: branches/1.0.x/units/widgets/widget_tp.php =================================================================== diff -u -N -r12914 -r13008 --- branches/1.0.x/units/widgets/widget_tp.php (.../widget_tp.php) (revision 12914) +++ branches/1.0.x/units/widgets/widget_tp.php (.../widget_tp.php) (revision 13008) @@ -18,5 +18,30 @@ { return 'Hello world!'; } + + /** + * Returns a link for editing product + * + * @param Array $params + * @return string + */ + function ItemEditLink($params) + { + $object =& $this->getObject(); + /* @var $object kDBList */ + + $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, + ); + + return $this->Application->HREF($edit_template, '', $url_params); + } } \ No newline at end of file Index: branches/1.0.x/install/english.lang =================================================================== diff -u -N -r12914 -r13008 --- branches/1.0.x/install/english.lang (.../english.lang) (revision 12914) +++ branches/1.0.x/install/english.lang (.../english.lang) (revision 13008) @@ -3,8 +3,11 @@ R29vZA== UGhvbmU= + UXVhbnRpdHk= RGF0YSBmaWxl R29vZA== + SW1hZ2U= + UXVhbnRpdHk= Q3VzdG9t RGVmYXVsdA== V2lkZ2V0cw== Index: branches/1.0.x/admin_templates/widgets/widget_list.tpl =================================================================== diff -u -N -r12914 -r13008 --- branches/1.0.x/admin_templates/widgets/widget_list.tpl (.../widget_list.tpl) (revision 12914) +++ branches/1.0.x/admin_templates/widgets/widget_list.tpl (.../widget_list.tpl) (revision 13008) @@ -124,9 +124,12 @@ - + Delete + + ', this.href);"> +