'file', 'ItemClass' => Array('class'=>'FilesItem','file'=>'files.php','build_event'=>'OnItemBuild'), 'ListClass' => Array('class'=>'kDBList','file'=>'','build_event'=>'OnListBuild'), 'EventHandlerClass' => Array('class'=>'FilesEventHandler','file'=>'files_event_handler.php','build_event'=>'OnBuild'), 'TagProcessorClass' => Array('class'=>'kDBTagProcessor','file'=>'','build_event'=>'OnBuild'), 'AutoLoad' => true, 'AggregateTags' => Array( Array( 'AggregateTo' => '#PARENT#', 'AggregatedTagName' => 'ListFiles', 'LocalTagName' => 'PrintList', 'LocalSpecial' => 'downl', ), ), 'Hooks' => Array( /*Array( 'Mode' => hBEFORE, 'Conditional' => true, 'HookToPrefix' => 'p', 'HookToSpecial' => '', 'HookToEvent' => Array( 'onPreSave' ), 'DoPrefix' => 'pr', 'DoSpecial' => 'tang', 'DoEvent' => 'OnArrange', ),*/ ), 'QueryString' => Array( 1 => 'id', 2 => 'page', 3 => 'event', ), 'StatusField' => Array('Status', 'IsPrimary'), 'IDField' => 'FileId', 'TitleField' => 'Name', 'TableName' => TABLE_PREFIX.'ProductFiles', 'ForeignKey' => 'ProductId', 'ParentTableKey' => 'ProductId', 'ParentPrefix' => 'p', 'AutoDelete' => true, 'AutoClone' => true, 'ListSQLs' => Array( ''=>'SELECT * FROM %s', ), // key - special, value - list select sql 'ItemSQLs' => Array( ''=>'SELECT * FROM %s', ), 'FilterMenu' => Array( 'Groups' => Array( Array('mode' => 'AND', 'filters' => Array('show_active','show_disabled'), 'type' => WHERE_FILTER), ), 'Filters' => Array( 'show_active' => Array('label' => 'la_Active', 'on_sql' => '', 'off_sql' => '%1$s.Status != 1' ), 'show_disabled' => Array('label' => 'la_Disabled', 'on_sql' => '', 'off_sql' => '%1$s.Status != 0' ), ) ), 'ListSortings' => Array( '' => Array( 'ForcedSorting' => Array('IsPrimary' => 'desc','Priority' => 'desc'), 'Sorting' => Array('AddedOn' => 'desc','Version' => 'desc'), ) ), 'Fields' => Array( 'FileId' => Array('type' => 'int', 'not_null' => 1, 'default' => 0,), 'ProductId' => Array('type' => 'int', 'not_null' => 1, 'default' => 0,), 'Name' => Array('type' => 'string','not_null' => '1','default' => ''), 'Version' => Array('type' => 'string','not_null' => '1','default' => ''), 'FilePath' => Array('type' => 'string','not_null' => '1','default' => ''), 'RealPath' => Array('type' => 'string', 'not_null' => 1, 'formatter'=>'kUploadFormatter', 'skip_empty'=>1, 'default' => '', 'upload_dir' => '/kernel/downloads/', 'include_path' => 0, 'size_field' => 'Size', 'orig_name_field' => 'FilePath', 'content_type_field' => 'MIMEType', 'max_size' => 50000000, 'error_msgs' => Array( 'bad_file_format' => '!la_error_InvalidFileFormat!', 'bad_file_size' => '!la_error_FileTooLarge!', 'cant_save_file' => '!la_error_cant_save_file!' ) ), 'Size' => Array('type' => 'int', 'formatter' => 'kFilesizeFormatter', 'not_null' => 1, 'default' => 0), 'Status' => Array('type' => 'int', 'not_null' => 1, 'default' => 0), 'IsPrimary' => Array('type' => 'int', 'not_null' => 1, 'default' => 0), 'Priority' => Array('type' => 'int', 'not_null' => 1, 'default' => 0), 'AddedOn' => Array('type' => 'int','formatter' => 'kDateFormatter','not_null' => '1','default' => '#NOW#'), 'AddedById' => Array('type' => 'int', 'not_null' => 1, 'default' => 0), 'MIMEType' => Array('type' => 'string','not_null' => '1','default' => ''), ), 'VirtualFields' => Array( ), 'Grids' => Array( 'Default' => Array( 'Icons' => Array('default'=>'icon16_custom.gif', '1_0' => 'icon16_file.gif', '1_1' => 'icon16_file_primary.gif', '0_0' => 'icon16_file_disabled.gif'), // icons for each StatusField values, if no matches or no statusfield selected, then "default" icon is used 'Fields' => Array( 'Name' => Array( 'title'=>'la_col_FileName', 'data_block' => 'file_caption_td'), 'FilePath' => Array( 'title'=>'la_col_FilePath' ), 'Version' => Array( 'title'=>'la_col_Version' ), 'Size' => Array( 'title'=>'la_col_Size' ), 'AddedOn' => Array( 'title'=>'la_col_AddedOn', 'format'=>'_regional_DateFormat' ), ), ), ), ); ?>