Index: branches/5.2.x/core/units/page_revisions/page_revisions_config.php =================================================================== diff -u -N -r15563 -r16388 --- branches/5.2.x/core/units/page_revisions/page_revisions_config.php (.../page_revisions_config.php) (revision 15563) +++ branches/5.2.x/core/units/page_revisions/page_revisions_config.php (.../page_revisions_config.php) (revision 16388) @@ -1,6 +1,6 @@ 'page-revision', - 'ItemClass' => Array ('class' => 'kDBItem', 'file' => '', 'build_event' => 'OnItemBuild'), - 'ListClass' => Array ('class' => 'kDBList', 'file' => '', 'build_event' => 'OnListBuild'), - 'EventHandlerClass' => Array ('class' => 'PageRevisionEventHandler', 'file' => 'page_revision_eh.php', 'build_event' => 'OnBuild'), - 'TagProcessorClass' => Array ('class' => 'PageRevisionTagProcessor', 'file' => 'page_revision_tp.php', 'build_event' => 'OnBuild'), - 'AutoLoad' => true, - 'QueryString' => Array ( - 1 => 'id', - 2 => 'Page', - 3 => 'PerPage', - 4 => 'event', - 5 => 'mode', // needed? - ), +$config = Array ( + 'Prefix' => 'page-revision', + 'ItemClass' => Array ('class' => 'kDBItem', 'file' => '', 'build_event' => 'OnItemBuild'), + 'ListClass' => Array ('class' => 'kDBList', 'file' => '', 'build_event' => 'OnListBuild'), + 'EventHandlerClass' => Array ('class' => 'PageRevisionEventHandler', 'file' => 'page_revision_eh.php', 'build_event' => 'OnBuild'), + 'TagProcessorClass' => Array ('class' => 'PageRevisionTagProcessor', 'file' => 'page_revision_tp.php', 'build_event' => 'OnBuild'), - 'IDField' => 'RevisionId', - 'ParentTableKey' => 'CategoryId', // linked field in master table - 'ForeignKey' => 'PageId', // linked field in subtable - 'ParentPrefix' => 'c', - 'AutoDelete' => true, - 'AutoClone' => true, + 'AutoLoad' => true, - 'TitleField' => 'RevisionNumber', + 'QueryString' => Array ( + 1 => 'id', + 2 => 'Page', + 3 => 'PerPage', + 4 => 'event', + 5 => 'mode', // needed? + ), - 'TableName' => TABLE_PREFIX . 'PageRevisions', + 'IDField' => 'RevisionId', + 'ParentTableKey' => 'CategoryId', // linked field in master table + 'ForeignKey' => 'PageId', // linked field in subtable + 'ParentPrefix' => 'c', + 'AutoDelete' => true, + 'AutoClone' => true, - 'ListSQLs' => Array ( - '' => ' SELECT %1$s.* %2$s - FROM %1$s - LEFT JOIN ' . TABLE_PREFIX . '%3$sCategories c ON c.CategoryId = %1$s.PageId - LEFT JOIN ' . TABLE_PREFIX . 'Users created_by ON created_by.PortalUserId = %1$s.CreatedById' - ), + 'TitleField' => 'RevisionNumber', - 'SubItems' => Array ('content'), + 'TableName' => TABLE_PREFIX . 'PageRevisions', - 'ListSortings' => Array ( - '' => Array ( - 'Sorting' => Array ('IsDraft' => 'desc', 'RevisionNumber' => 'desc'), - ) - ), + 'ListSQLs' => Array ( + '' => ' SELECT %1$s.* %2$s + FROM %1$s + LEFT JOIN ' . TABLE_PREFIX . '%3$sCategories c ON c.CategoryId = %1$s.PageId + LEFT JOIN ' . TABLE_PREFIX . 'Users created_by ON created_by.PortalUserId = %1$s.CreatedById' + ), - 'CalculatedFields' => Array ( - '' => Array ( - 'CreatedBy' => 'IF(created_by.Username = "", created_by.Email, created_by.Username)', - 'IsLive' => 'IF(%1$s.RevisionNumber = c.LiveRevisionNumber, 1, 0)', - ), - ), + 'SubItems' => Array ('content'), - 'Fields' => Array ( - 'RevisionId' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0), - 'PageId' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0), - 'RevisionNumber' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0), - 'IsDraft' => Array ( - 'type' => 'int', - 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_Yes', 0 => 'la_No'), 'use_phrases' => 1, - 'not_null' => 1, 'default' => 0 - ), - 'FromRevisionId' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0), - 'CreatedById' => Array ( - 'type' => 'int', - 'formatter' => 'kLEFTFormatter', 'options' => Array (USER_ROOT => 'root', USER_GUEST => 'Guest'), 'left_sql' => 'SELECT %s FROM ' . TABLE_PREFIX . 'Users WHERE %s', 'left_key_field' => 'PortalUserId', 'left_title_field' => USER_TITLE_FIELD, 'error_msgs' => Array ('invalid_option' => '!la_error_UserNotFound!'), 'sample_value' => 'Guest', 'required' => 1, - 'default' => NULL - ), - 'CreatedOn' => Array ('type' => 'int', 'formatter' => 'kDateFormatter', 'default' => '#NOW#'), - 'AutoSavedOn' => Array ('type' => 'int', 'formatter' => 'kDateFormatter', 'default' => NULL), - 'Status' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (2 => 'la_Pending', 1 => 'la_opt_Published', 0 => 'la_opt_Declined'), 'use_phrases' => 1, 'not_null' => 1, 'default' => 2) + 'ListSortings' => Array ( + '' => Array ( + 'Sorting' => Array ('IsDraft' => 'desc', 'RevisionNumber' => 'desc'), + ) + ), + + 'CalculatedFields' => Array ( + '' => Array ( + 'CreatedBy' => 'IF(created_by.Username = "", created_by.Email, created_by.Username)', + 'IsLive' => 'IF(%1$s.RevisionNumber = c.LiveRevisionNumber, 1, 0)', ), + ), - 'VirtualFields' => Array ( - 'CreatedBy' => Array ('type' => 'string', 'default' => ''), - 'IsLive' => Array ( - 'type' => 'int', - 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_Yes', 0 => 'la_No'), 'use_phrases' => 1, - 'default' => 0, - ) + 'Fields' => Array ( + 'RevisionId' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0), + 'PageId' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0), + 'RevisionNumber' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0), + 'IsDraft' => Array ( + 'type' => 'int', + 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_Yes', 0 => 'la_No'), 'use_phrases' => 1, + 'not_null' => 1, 'default' => 0 ), - ); + 'FromRevisionId' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0), + 'CreatedById' => Array ( + 'type' => 'int', + 'formatter' => 'kLEFTFormatter', 'options' => Array (USER_ROOT => 'root', USER_GUEST => 'Guest'), 'left_sql' => 'SELECT %s FROM ' . TABLE_PREFIX . 'Users WHERE %s', 'left_key_field' => 'PortalUserId', 'left_title_field' => USER_TITLE_FIELD, 'error_msgs' => Array ('invalid_option' => '!la_error_UserNotFound!'), 'sample_value' => 'Guest', 'required' => 1, + 'default' => NULL + ), + 'CreatedOn' => Array ('type' => 'int', 'formatter' => 'kDateFormatter', 'default' => '#NOW#'), + 'AutoSavedOn' => Array ('type' => 'int', 'formatter' => 'kDateFormatter', 'default' => NULL), + 'Status' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (2 => 'la_Pending', 1 => 'la_opt_Published', 0 => 'la_opt_Declined'), 'use_phrases' => 1, 'not_null' => 1, 'default' => 2) + ), + + 'VirtualFields' => Array ( + 'CreatedBy' => Array ('type' => 'string', 'default' => ''), + 'IsLive' => Array ( + 'type' => 'int', + 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_Yes', 0 => 'la_No'), 'use_phrases' => 1, + 'default' => 0, + ) + ), +);