Index: branches/5.0.x/units/polls/polls_config.php =================================================================== diff -u -r12916 -r13237 --- branches/5.0.x/units/polls/polls_config.php (.../polls_config.php) (revision 12916) +++ branches/5.0.x/units/polls/polls_config.php (.../polls_config.php) (revision 13237) @@ -1,6 +1,6 @@ 'poll', - 'ItemClass' => Array('class' => 'kDBItem', 'file' => '', 'build_event' => 'OnItemBuild'), - 'ListClass' => Array('class' => 'kDBList', 'file' => '', 'build_event' => 'OnListBuild'), - 'EventHandlerClass' => Array('class' => 'PollEventHandler', 'file' => 'poll_eh.php', 'build_event' => 'OnBuild'), - 'TagProcessorClass' => Array('class' => 'PollTagProcessor', 'file' => 'poll_tp.php', 'build_event' => 'OnBuild'), + 'ItemClass' => Array ('class' => 'kDBItem', 'file' => '', 'build_event' => 'OnItemBuild'), + 'ListClass' => Array ('class' => 'kDBList', 'file' => '', 'build_event' => 'OnListBuild'), + 'EventHandlerClass' => Array ('class' => 'PollEventHandler', 'file' => 'poll_eh.php', 'build_event' => 'OnBuild'), + 'TagProcessorClass' => Array ('class' => 'PollTagProcessor', 'file' => 'poll_tp.php', 'build_event' => 'OnBuild'), 'AutoLoad' => true, - 'QueryString' => Array( + 'QueryString' => Array ( 1 => 'id', 2 => 'page', 3 => 'event', @@ -32,18 +32,18 @@ 'IDField' => 'PollId', 'TitleField' => 'Name', - 'StatusField' => Array('Status'), + 'StatusField' => Array ('Status'), - 'TitlePresets' => Array( - 'default' => Array( - 'new_status_labels' => Array('poll' => '!la_title_Adding_Poll!'), - 'edit_status_labels' => Array('poll' => '!la_title_Editing_Poll!'), - 'new_titlefield' => Array('poll' => '!la_title_NewPoll!'), + 'TitlePresets' => Array ( + 'default' => Array ( + 'new_status_labels' => Array ('poll' => '!la_title_Adding_Poll!'), + 'edit_status_labels' => Array ('poll' => '!la_title_Editing_Poll!'), + 'new_titlefield' => Array ('poll' => '!la_title_NewPoll!'), ), - 'poll_list' => Array('prefixes' => Array('poll_List'), 'format' => "!la_title_Polls!", ), - 'poll_edit' => Array('prefixes' => Array('poll'), 'format' => "#poll_status# '#poll_titlefield#' - !la_title_General!", ), + 'poll_list' => Array ('prefixes' => Array ('poll_List'), 'format' => "!la_title_Polls!", ), + 'poll_edit' => Array ('prefixes' => Array ('poll'), 'format' => "#poll_status# '#poll_titlefield#' - !la_title_General!", ), 'poll_edit_answers' => Array ('prefixes' => Array ('poll', 'poll-answer_List'), 'format' => "#poll_status# '#poll_titlefield#' - !la_title_PollAnswers!"), 'poll_edit_comments' => Array ('prefixes' => Array ('poll', 'poll-comment_List'), 'format' => "#poll_status# '#poll_titlefield#' - !la_title_PollComments!"), @@ -67,66 +67,90 @@ ), - 'PermSection' => Array('main' => 'in-bulletin:polls'), + 'PermSection' => Array ('main' => 'in-bulletin:polls'), 'Sections' => Array ( 'in-bulletin:polls' => Array ( 'parent' => 'in-portal:site', 'icon' => 'polls', 'label' => 'la_title_Polls', - 'url' => Array('t' => 'in-bulletin/polls/poll_list', 'pass' => 'm'), - 'permissions' => Array('view', 'add', 'edit', 'delete'), + 'url' => Array ('t' => 'in-bulletin/polls/poll_list', 'pass' => 'm'), + 'permissions' => Array ('view', 'add', 'edit', 'delete'), 'priority' => 3.6, 'type' => stTREE, ), ), 'TableName' => TABLE_PREFIX.'Polls', - 'ListSQLs' => Array('' => 'SELECT %1$s.* %2$s + 'ListSQLs' => Array ('' => 'SELECT %1$s.* %2$s FROM %1$s', ), - 'ItemSQLs' => Array('' => 'SELECT %1$s.* %2$s + 'ItemSQLs' => Array ('' => 'SELECT %1$s.* %2$s FROM %1$s', ), - 'ListSortings' => Array( + 'ListSortings' => Array ( '' => Array ( - 'Sorting' => Array('PollId' => 'asc'), + 'Sorting' => Array ('PollId' => 'asc'), ) ), 'Fields' => Array ( - 'PollId' => Array('type' => 'int', 'not_null' => 1, 'default' => 0,), - 'Name' => Array('type' => 'string', 'not_null' => '1','default' => '', 'required'=> 1, 'max_len' => 255), - 'Question' => Array('type' => 'string', 'formatter' => 'kMultiLanguage', 'using_fck' => 1, 'default' => null, 'required' => 1), - 'CreatedOn' => Array ('type' => 'int', 'formatter' => 'kDateFormatter', 'required' => 1, 'default' => '#NOW#'), - 'StartDate' => Array('type' => 'int', 'formatter' => 'kDateFormatter', 'required' => 1, 'default' => '#NOW#'), - 'EndDate' => Array('type' => 'int', 'formatter' => 'kDateFormatter', 'default' => null), - 'Image' => Array ( - 'type' => 'string', - 'formatter' => 'kPictureFormatter', - 'max_size' => MAX_UPLOAD_SIZE, 'upload_dir' => IMAGES_PATH . 'polls/', - 'file_types' => '*.jpg;*.gif;*.png', 'files_description' => '!la_hint_ImageFiles!', - 'multiple' => false, - 'max_len' => 255, 'not_null' => 1, 'default' => '' - ), - 'Priority' => Array('type' => 'int', 'not_null' => 1, 'default' => 0), - 'RequireLogin' => Array('type' => 'int', 'not_null' => 1, 'default' => 0,), - 'AllowComments' => Array('type' => 'int', 'not_null' => 1, 'default' => 1,), - 'AllowMultipleVotings' => Array('type' => 'int', 'not_null' => 1, 'default' => 1,), - 'CachedVotesQty'=> Array('type' => 'int', 'not_null' => 1, 'default' => 0), - 'Status' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_opt_Active', 0 => 'la_opt_Disabled'), 'use_phrases' => 1, 'required' => 1, 'not_null' => 1, 'default' => 1), + 'PollId' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0,), + 'Name' => Array ('type' => 'string', 'not_null' => '1', 'default' => '', 'required' => 1, 'max_len' => 255), + 'Question' => Array ( + 'type' => 'string', + 'formatter' => 'kMultiLanguage', 'using_fck' => 1, + 'default' => null, 'required' => 1, + ), + 'CreatedOn' => Array ('type' => 'int', 'formatter' => 'kDateFormatter', 'required' => 1, 'default' => '#NOW#'), + 'StartDate' => Array ('type' => 'int', 'formatter' => 'kDateFormatter', 'required' => 1, 'default' => '#NOW#'), + 'EndDate' => Array ('type' => 'int', 'formatter' => 'kDateFormatter', 'default' => null), + 'Image' => Array ( + 'type' => 'string', + 'formatter' => 'kPictureFormatter', + 'max_size' => MAX_UPLOAD_SIZE, 'upload_dir' => IMAGES_PATH . 'polls/', + 'file_types' => '*.jpg;*.gif;*.png', 'files_description' => '!la_hint_ImageFiles!', + 'multiple' => false, + 'max_len' => 255, 'not_null' => 1, 'default' => '' + ), + 'Priority' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0), + 'RequireLogin' => Array ( + 'type' => 'int', + 'formatter' => 'kOptionsFormatter', + 'options' => Array (0 => 'la_No', 1 => 'la_Yes',), 'use_phrases' => 1, + 'default' => 0, 'not_null' => 1, + ), + 'AllowComments' => Array ( + 'type' => 'int', + 'formatter' => 'kOptionsFormatter', + 'options' => Array (0 => 'la_No', 1 => 'la_Yes',), 'use_phrases' => 1, + 'default' => 1, 'not_null' => 1, + ), + 'AllowMultipleVotings' => Array ( + 'type' => 'int', + 'formatter' => 'kOptionsFormatter', + 'options' => Array (0 => 'la_No', 1 => 'la_Yes',), 'use_phrases' => 1, + 'default' => 1, 'not_null' => 1, + ), + 'CachedVotesQty' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0), + 'Status' => Array ( + 'type' => 'int', + 'formatter' => 'kOptionsFormatter', + 'options' => Array (0 => 'la_opt_Disabled', 1 => 'la_opt_Active',), 'use_phrases' => 1, + 'required' => 1, 'default' => 1, 'not_null' => 1, + ), - ), + ), 'SubItems' => Array ('poll-answer', 'poll-comment'), 'VirtualFields' => Array ( -// 'PollId' => Array('type' => 'int', 'not_null' => 1, 'default' => 0,), +// 'PollId' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0,), ), 'CalculatedFields' => Array (