Index: branches/1.0.x/units/widgets/widgets_config.php =================================================================== diff -u -r13008 -r13235 --- branches/1.0.x/units/widgets/widgets_config.php (.../widgets_config.php) (revision 13008) +++ branches/1.0.x/units/widgets/widgets_config.php (.../widgets_config.php) (revision 13235) @@ -9,12 +9,12 @@ defined('FULL_PATH') or die('restricted access!'); - $config = Array( + $config = Array ( 'Prefix' => 'widget', 'ItemClass' => Array ('class' => 'kDBItem', 'file' => '', 'build_event' => 'OnItemBuild'), - 'ListClass' => Array ('class' => 'kDBList', 'file'=> '', 'build_event' => 'OnListBuild'), + 'ListClass' => Array ('class' => 'kDBList', 'file' => '', 'build_event' => 'OnListBuild'), 'EventHandlerClass' => Array ('class' => 'WidgetEventHandler', 'file' => 'widget_eh.php', 'build_event' => 'OnBuild'), 'TagProcessorClass' => Array ('class' => 'WidgetTagProcessor', 'file' => 'widget_tp.php', 'build_event' => 'OnBuild'), @@ -65,10 +65,8 @@ 'toolbar_buttons' => Array ('select', 'cancel', 'reset_edit', 'prev', 'next'), ), ), - - - 'PermSection' => Array('main' => 'custom:widgets'), + 'PermSection' => Array ('main' => 'custom:widgets'), 'Sections' => Array ( 'custom:widgets' => Array ( @@ -77,7 +75,7 @@ 'label' => 'la_tab_Widgets', 'url' => Array ('t' => 'custom/widgets/widget_list', 'pass' => 'm'), 'permissions' => Array ('view', 'add', 'edit', 'delete'), - 'priority' => 1, + 'priority' => 1, 'type' => stTREE, ), ), @@ -105,17 +103,24 @@ 'VirtualFields' => Array ( 'VirtualActionField' => Array ('type' => 'string', 'default' => ''), ), - + 'Fields' => Array ( 'WidgetId' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0), - 'Title' => Array ('type' => 'string', 'not_null' => '1', 'default' => '', 'required' => true, 'max_len' => 255), - 'Description' => Array ('type' => 'string', 'formatter' => 'kFormatter', 'using_fck' => 1, 'default' => null), - 'Email' => Array( + 'Title' => Array ( + 'type' => 'string', 'max_len' => 255, + 'required' => 1, 'default' => '', 'not_null' => 1, + ), + 'Description' => Array ( + 'type' => 'string', + 'formatter' => 'kFormatter', 'using_fck' => 1, + 'default' => null, + ), + 'Email' => Array ( 'type' => 'string', 'formatter' => 'kFormatter', - 'regexp'=> '/^(' . REGEX_EMAIL_USER . '@' . REGEX_EMAIL_DOMAIN . ')$/i', + 'regexp' => '/^(' . REGEX_EMAIL_USER . '@' . REGEX_EMAIL_DOMAIN . ')$/i', 'sample_value' => 'email@domain.com', 'not_null' => 1, 'default' => '', - 'error_msgs' => Array ('invalid_format' => '!la_invalid_email!') + 'error_msgs' => Array ('invalid_format' => '!la_invalid_email!'), ), 'Type' => Array ( 'type' => 'int', @@ -129,40 +134,46 @@ 'required' => 1, ), 'Phone' => Array ( - 'type' => 'string', 'formatter' => 'kFormatter', + 'type' => 'string', + 'formatter' => 'kFormatter', 'default' => '', 'using_fck' => 1, 'not_null' => 1), - 'Qty' => Array ('type' => 'double', 'required' => 0, 'not_null' => 1, 'default' => 0), + 'Qty' => Array ( + 'type' => 'double', + 'required' => 0, 'not_null' => 1, 'default' => 0 + ), 'Status' => Array ( 'type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => array (1 => 'la_Active', 2 => 'la_Pending', 0 => 'la_Disabled'), 'use_phrases' => 1, 'not_null' => 1, 'default' => 2, ), 'CreatedOn' => Array ( - 'type' => 'int', 'formatter' => 'kDateFormatter', - 'time_format' => '', 'input_time_format' => '', 'default'=>'#NOW#'), - + 'type' => 'int', + 'formatter' => 'kDateFormatter', + 'time_format' => '', 'input_time_format' => '', + 'default' => '#NOW#', + ), 'Good' => Array ( 'type' => 'int', 'formatter' => 'kOptionsFormatter', - 'options' => Array(1 => 'la_Yes', 0 => 'la_No'), + 'options' => Array (1 => 'la_Yes', 0 => 'la_No'), 'use_phrases' => 1, 'not_null' => 1, 'default' => 0 ), 'BirthTime' => Array ( 'type' => 'int', 'formatter' => 'kDateFormatter', 'date_format' => '', 'input_date_format' => '', 'default' => null ), - 'Image' => Array( + 'Image' => Array ( 'type' => 'string', 'formatter' => 'kUploadFormatter', 'max_size' => MAX_UPLOAD_SIZE, // in Bytes ! - 'file_types' => '*.jpg;*.gif;*.png', 'files_description'=>'!la_hint_ImageFiles!', + 'file_types' => '*.jpg;*.gif;*.png', 'files_description' => '!la_hint_ImageFiles!', 'upload_dir' => '/system/user_files/', // relative to project's home 'as_image' => true, 'thumb_width' => 100, 'thumb_height' => 100, 'multiple' => false, // false or max number of files - will be stored as serialized array of paths 'direct_links' => false, // use direct file urls or send files through wrapper (requires mod_mime_magic) 'required' => 1, 'default' => null ), - 'DataFile' => Array( - 'type' => 'string', 'formatter'=>'kUploadFormatter', + 'DataFile' => Array ( + 'type' => 'string', 'formatter' => 'kUploadFormatter', 'max_size' => MAX_UPLOAD_SIZE, // in Bytes ! 'file_types' => '*.*', 'files_description' => '!la_hint_AllFiles!', @@ -179,7 +190,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_custom_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'),