Index: branches/5.1.x/core/units/reviews/reviews_config.php =================================================================== diff -u -N -r13159 -r13545 --- branches/5.1.x/core/units/reviews/reviews_config.php (.../reviews_config.php) (revision 13159) +++ branches/5.1.x/core/units/reviews/reviews_config.php (.../reviews_config.php) (revision 13545) @@ -1,6 +1,6 @@ 'rev', - 'Clones' => Array ( - 'l-rev' => Array( - 'ParentPrefix' => 'l', - 'ConfigMapping' => Array ( - 'PerPage' => 'Perpage_LinkReviews', - 'ShortListPerPage' => 'Perpage_LinkReviews_Short', - 'DefaultSorting1Field' => 'Link_ReviewsSort', - 'DefaultSorting2Field' => 'Link_ReviewsSort2', - 'DefaultSorting1Dir' => 'Link_ReviewsOrder', - 'DefaultSorting2Dir' => 'Link_ReviewsOrder2', - - 'ReviewDelayInterval' => 'link_ReviewDelay_Interval', - 'ReviewDelayValue' => 'link_ReviewDelay_Value', - ), - ), - - 'n-rev' => Array ( - 'ParentPrefix' => 'n', - 'ConfigMapping' => Array ( - 'PerPage' => 'Perpage_NewsReviews', - 'ShortListPerPage' => 'Perpage_NewsReviews_Short', - 'DefaultSorting1Field' => 'News_SortReviews', - 'DefaultSorting2Field' => 'News_SortReviews2', - 'DefaultSorting1Dir' => 'News_SortReviewsOrder', - 'DefaultSorting2Dir' => 'News_SortReviewsOrder2', - - 'ReviewDelayInterval' => 'News_ReviewDelay_Interval', - 'ReviewDelayValue' => 'News_ReviewDelay_Value', - ), - ), - - 'bb-rev' => Array ( - 'ParentPrefix' => 'bb', - 'ConfigMapping' => Array ( - 'PerPage' => 'Perpage_TopicReviews', - - 'ReviewDelayInterval' => 'topic_ReviewDelay_Interval', - 'ReviewDelayValue' => 'topic_ReviewDelay_Value', - ), - ), - - 'p-rev' => Array ( - 'ParentPrefix' => 'p', - 'ConfigMapping' => Array ( - 'PerPage' => 'Comm_Perpage_Reviews', - - 'ReviewDelayInterval' => 'product_ReviewDelay_Value', - 'ReviewDelayValue' => 'product_ReviewDelay_Interval', - ), - ), - ), - - 'ItemClass' => Array('class'=>'kDBItem','file'=>'','build_event'=>'OnItemBuild'), - 'ListClass' => Array('class'=>'kDBList','file'=>'','build_event'=>'OnListBuild'), - 'EventHandlerClass' => Array('class'=>'ReviewsEventHandler','file'=>'reviews_event_handler.php','build_event'=>'OnBuild'), - 'TagProcessorClass' => Array('class'=>'ReviewsTagProcessor','file'=>'reviews_tag_processor.php','build_event'=>'OnBuild'), + 'ItemClass' => Array ('class' => 'kDBItem', 'file' => '', 'build_event' => 'OnItemBuild'), + 'ListClass' => Array ('class' => 'kDBList', 'file' => '', 'build_event' => 'OnListBuild'), + 'EventHandlerClass' => Array ('class' => 'ReviewsEventHandler', 'file' => 'reviews_event_handler.php', 'build_event' => 'OnBuild'), + 'TagProcessorClass' => Array ('class' => 'ReviewsTagProcessor', 'file' => 'reviews_tag_processor.php', 'build_event' => 'OnBuild'), 'AutoLoad' => true, 'QueryString' => Array ( @@ -92,7 +40,7 @@ ), 'IDField' => 'ReviewId', - 'StatusField' => Array('Status'), // field, that is affected by Approve/Decline events + 'StatusField' => Array ('Status'), // field, that is affected by Approve/Decline events 'TableName' => TABLE_PREFIX.'ItemReview', 'ParentTableKey' => 'ResourceId', // linked field in master table 'ForeignKey' => 'ItemId', // linked field in subtable @@ -101,21 +49,21 @@ 'AutoClone' => true, 'TitlePresets' => Array ( - 'reviews_edit' => Array('format' => "!la_title_Editing_Review!"), + 'reviews_edit' => Array ('format' => "!la_title_Editing_Review!"), - 'reviews' => Array( - 'toolbar_buttons' => Array('edit', 'delete', 'approve', 'decline', 'view', 'dbl-click'), + 'reviews' => Array ( + 'toolbar_buttons' => Array ('edit', 'delete', 'approve', 'decline', 'view', 'dbl-click'), ), ), 'FilterMenu' => Array ( - 'Groups' => Array( - Array('mode' => 'AND', 'filters' => Array('show_active','show_pending','show_disabled'), 'type' => WHERE_FILTER), + 'Groups' => Array ( + Array ('mode' => 'AND', 'filters' => Array ('show_active', 'show_pending', 'show_disabled'), 'type' => WHERE_FILTER), ), - 'Filters' => Array( - 'show_active' => Array('label' =>'la_Active', 'on_sql' => '', 'off_sql' => '%1$s.Status != 1' ), - 'show_pending' => Array('label' => 'la_Pending', 'on_sql' => '', 'off_sql' => '%1$s.Status != 2' ), - 'show_disabled' => Array('label' => 'la_Disabled', 'on_sql' => '', 'off_sql' => '%1$s.Status != 0' ), + 'Filters' => Array ( + 'show_active' => Array ('label' => 'la_Active', 'on_sql' => '', 'off_sql' => '%1$s.Status != 1' ), + 'show_pending' => Array ('label' => 'la_Pending', 'on_sql' => '', 'off_sql' => '%1$s.Status != 2' ), + 'show_disabled' => Array ('label' => 'la_Disabled', 'on_sql' => '', 'off_sql' => '%1$s.Status != 0' ), ) ), @@ -140,46 +88,95 @@ // key - special, value - list select sql 'ListSQLs' => Array ( '' => ' SELECT %1$s.* %2$s - FROM %1$s - LEFT JOIN '.TABLE_PREFIX.'PortalUser pu ON pu.PortalUserId = %1$s.CreatedById', + FROM %1$s + LEFT JOIN ' . TABLE_PREFIX . 'PortalUser pu ON pu.PortalUserId = %1$s.CreatedById', 'products' => ' SELECT %1$s.* %2$s - FROM %1$s - LEFT JOIN '.TABLE_PREFIX.'Products pr ON pr.ResourceId = %1$s.ItemId - LEFT JOIN '.TABLE_PREFIX.'PortalUser pu ON pu.PortalUserId = %1$s.CreatedById', + FROM %1$s + LEFT JOIN ' . TABLE_PREFIX . 'Products pr ON pr.ResourceId = %1$s.ItemId + LEFT JOIN ' . TABLE_PREFIX . 'PortalUser pu ON pu.PortalUserId = %1$s.CreatedById', 'product' => ' SELECT %1$s.* %2$s - FROM %1$s - LEFT JOIN '.TABLE_PREFIX.'Products pr ON pr.ResourceId = %1$s.ItemId - LEFT JOIN '.TABLE_PREFIX.'PortalUser pu ON pu.PortalUserId = %1$s.CreatedById', + FROM %1$s + LEFT JOIN ' . TABLE_PREFIX . 'Products pr ON pr.ResourceId = %1$s.ItemId + LEFT JOIN ' . TABLE_PREFIX . 'PortalUser pu ON pu.PortalUserId = %1$s.CreatedById', ), 'ItemSQLs' => Array ('' => 'SELECT * FROM %s'), 'ListSortings' => Array ( - '' => Array( - 'ForcedSorting' => Array('Priority' => 'desc'), - 'Sorting' => Array('CreatedOn' => 'desc'), + '' => Array ( + 'ForcedSorting' => Array ('Priority' => 'desc'), + 'Sorting' => Array ('CreatedOn' => 'desc'), ) ), 'Fields' => Array ( - 'ReviewId' => Array('type' => 'int', 'not_null' => 1, 'default' => 0), - 'CreatedOn' => Array('type' => 'int', 'formatter'=>'kDateFormatter', 'default'=>'#NOW#'), - 'ReviewText' => Array('type' => 'string', 'formatter' => 'kFormatter', 'required' => 1, 'using_fck' => 1, 'default' => NULL), - 'Rating' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (0 => 'lu_None', 1 => 'lu_Rating_1', 2 => 'lu_Rating_2', 3 => 'lu_Rating_3', 4 => 'lu_Rating_4', 5 => 'lu_Rating_5'), 'use_phrases' => 1, 'min_value_inc' => 0, 'max_value_inc' => 5, 'default' => 0), - 'IPAddress' => Array('type'=>'string', 'max_value_inc'=>15, 'not_null'=>1, 'default'=>'', ), - 'ItemId' => Array('type'=>'int','not_null'=>1,'default'=>0), - 'CreatedById' => Array('type' => 'int', 'formatter'=>'kLEFTFormatter', 'error_msgs' => Array ('invalid_option' => '!la_error_UserNotFound!'), 'options' => Array(-1 => 'root', -2 => 'Guest'), 'left_sql'=>'SELECT %s FROM '.TABLE_PREFIX.'PortalUser WHERE `%s` = \'%s\'','left_key_field'=>'PortalUserId', 'left_title_field'=>'Login', 'required'=>1, 'not_null'=>1, 'default'=>-1), - 'ItemType' => Array('type'=>'int', 'not_null'=>1, 'default'=>0), - 'Priority' => Array('type'=>'int', 'not_null'=>1, 'default'=>0), - 'Status' => Array('type' => 'int', 'formatter'=>'kOptionsFormatter', 'use_phrases' => 1, 'options'=>Array(1=>'la_Active', 2=>'la_Pending', 0=>'la_Disabled'), 'not_null'=>1, 'default'=>2 ), - 'TextFormat' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (0 => 'la_text', 1 => 'la_html'), 'use_phrases' => 1, 'not_null' => 1, 'default' => 0), - 'Module' => Array('type'=>'string', 'not_null'=>1, 'default'=>''), + 'ReviewId' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0), + 'CreatedOn' => Array ( + 'type' => 'int', + 'formatter' => 'kDateFormatter', 'default' => '#NOW#', + ), + 'ReviewText' => Array ( + 'type' => 'string', + 'formatter' => 'kFormatter', + 'using_fck' => 1, 'default' => null, 'required' => 1, + ), + 'Rating' => Array ( + 'type' => 'int', + 'formatter' => 'kOptionsFormatter', + 'options' => Array ( + 0 => 'lu_None', + 1 => 'lu_Rating_1', + 2 => 'lu_Rating_2', + 3 => 'lu_Rating_3', + 4 => 'lu_Rating_4', + 5 => 'lu_Rating_5'), + 'use_phrases' => 1, + 'min_value_inc' => 0, 'max_value_inc' => 5, 'default' => 0, + ), + 'IPAddress' => Array ( + 'type' => 'string', + 'max_value_inc' => 15, 'not_null' =>1, 'default' => '', + ), + 'ItemId' => Array ( + 'type' => 'int', + 'not_null' => 1, 'default' => 0 + ), + 'CreatedById' => Array ( + 'type' => 'int', + 'formatter' => 'kLEFTFormatter', + 'options' => Array (-1 => 'root', -2 => 'Guest'), + 'left_sql' => 'SELECT %s FROM ' . TABLE_PREFIX . 'PortalUser + WHERE `%s` = \'%s\' ', + 'left_key_field' => 'PortalUserId', + 'left_title_field' => 'Login', + 'required' => 1, 'not_null' => 1, 'default' => -1, + 'error_msgs' => Array ('invalid_option' => '!la_error_UserNotFound!'), + ), + 'ItemType' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0), + 'Priority' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0), + 'Status' => Array ( + 'type' => 'int', + 'formatter' => 'kOptionsFormatter', 'use_phrases' => 1, + 'options' => Array ( + 0 => 'la_Disabled', + 1 => 'la_Active', + 2 => 'la_Pending', + ), + 'not_null' =>1, 'default' => 2, + ), + 'TextFormat' => Array ( + 'type' => 'int', + 'formatter' => 'kOptionsFormatter', + 'options' => Array (0 => 'la_text', 1 => 'la_html'), 'use_phrases' => 1, + 'not_null' => 1, 'default' => 0, + ), + 'Module' => Array ('type' => 'string', 'not_null' => 1, 'default' => ''), ), 'VirtualFields' => Array ( - 'ReviewedBy' => Array('type' => 'string', 'default' => ''), + 'ReviewedBy' => Array ('type' => 'string', 'default' => ''), 'CatalogItemName' => Array ('type' => 'string', 'default' => ''), 'CatalogItemId' => Array ('type' => 'int', 'default' => 0), 'CatalogItemCategory' => Array ('type' => 'int', 'default' => 0), @@ -195,11 +192,11 @@ ), 'Fields' => Array ( 'ReviewId' => Array ('title' => 'la_col_Id', 'data_block' => 'grid_checkbox_td', 'filter_block' => 'grid_range_filter', 'width' => 60, ), - 'ReviewText' => Array( 'title'=>'la_col_ReviewText', 'filter_block' => 'grid_like_filter', 'width' => 210, 'first_chars' => 200, ), - 'ReviewedBy' => Array( 'title'=>'la_col_ReviewedBy', 'filter_block' => 'grid_like_filter', 'width' => 100, ), - 'CreatedOn' => Array( 'title'=>'la_col_CreatedOn', 'filter_block' => 'grid_date_range_filter', 'width' => 145, ), - 'Status' => Array( 'title'=>'la_col_Status', 'filter_block' => 'grid_options_filter', 'width' => 80, ), - 'Rating' => Array( 'title'=>'la_col_Rating', 'filter_block' => 'grid_options_filter', 'width' => 80, ), + 'ReviewText' => Array ( 'title' => 'la_col_ReviewText', 'filter_block' => 'grid_like_filter', 'width' => 210, 'first_chars' => 200, ), + 'ReviewedBy' => Array ( 'title' => 'la_col_ReviewedBy', 'filter_block' => 'grid_like_filter', 'width' => 100, ), + 'CreatedOn' => Array ( 'title' => 'la_col_CreatedOn', 'filter_block' => 'grid_date_range_filter', 'width' => 145, ), + 'Status' => Array ( 'title' => 'la_col_Status', 'filter_block' => 'grid_options_filter', 'width' => 80, ), + 'Rating' => Array ( 'title' => 'la_col_Rating', 'filter_block' => 'grid_options_filter', 'width' => 80, ), ), ), @@ -212,11 +209,11 @@ ), 'Fields' => Array ( 'ReviewId' => Array ('title' => 'la_col_Id', 'data_block' => 'grid_checkbox_td', 'filter_block' => 'grid_range_filter', 'width' => 60, ), - 'ReviewText' => Array( 'title'=>'la_col_ReviewText', 'data_block' => 'grid_reviewtext_td', 'filter_block' => 'grid_like_filter', 'width' => 210, 'first_chars' => 200, ), - 'ReviewedBy' => Array( 'title'=>'la_col_ReviewedBy', 'filter_block' => 'grid_like_filter', 'width' => 100, ), - 'CreatedOn' => Array( 'title'=>'la_col_CreatedOn', 'filter_block' => 'grid_date_range_filter', 'width' => 145, ), - 'Status' => Array( 'title'=>'la_col_Status', 'filter_block' => 'grid_options_filter', 'width' => 80, ), - 'Rating' => Array( 'title'=>'la_col_Rating', 'filter_block' => 'grid_options_filter', 'width' => 80, ), + 'ReviewText' => Array ( 'title' => 'la_col_ReviewText', 'data_block' => 'grid_reviewtext_td', 'filter_block' => 'grid_like_filter', 'width' => 210, 'first_chars' => 200, ), + 'ReviewedBy' => Array ( 'title' => 'la_col_ReviewedBy', 'filter_block' => 'grid_like_filter', 'width' => 100, ), + 'CreatedOn' => Array ( 'title' => 'la_col_CreatedOn', 'filter_block' => 'grid_date_range_filter', 'width' => 145, ), + 'Status' => Array ( 'title' => 'la_col_Status', 'filter_block' => 'grid_options_filter', 'width' => 80, ), + 'Rating' => Array ( 'title' => 'la_col_Rating', 'filter_block' => 'grid_options_filter', 'width' => 80, ), ), ), ),