Modes renamed - easier to remember

git-svn-id: file:///svn/phpbb/trunk@3764 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Ludovic Arnaud 2003-03-30 21:05:58 +00:00
parent 5e92d8c8f6
commit 930e6a7e6b
2 changed files with 15 additions and 105 deletions

View file

@ -512,7 +512,7 @@ else
// Do major work ...
//
// Current modes:
// - set_* Change topic type
// - make_* Change topic type
// - resync Resyncs topics
// - delete_posts Delete posts, displays confirmation if unconfirmed
// - delete_topics Delete topics, displays confirmation
@ -533,17 +533,16 @@ else
// - post_details Displays post details. Has quick links to (un)approve post.
// - mod_queue Displays a list or unapproved posts and/or topics. I haven't designed the interface yet but it will have to be able to filter/order them by type (posts/topics), by timestamp or by forum.
// - post_reports Displays a list of reported posts. No interface yet, must be able to order them by priority(?), type, timestamp or forum. Action: view all (default), read, delete.
// - approve/unapprove Actually un/approve selected topic(s) or post(s). NOTE: after some second thoughts we'll need three modes: (which names are still to be decided) the first to approve items, the second to set them back as "unapproved" and a third one to "disapprove" them. (IOW, delete them and eventually send a notification to the user)
// - notes Displays moderators notes for current forum or for all forums the user is a moderator of. Actions: view all (default), read, add, delete, edit(?).
// - a hell lot of other things
//
switch ($mode)
{
case 'set_announce':
case 'set_sticky':
case 'set_normal':
$topic_type = constant('POST_' . strtoupper(preg_replace('/set_([a-z]+)/', '\1', $mode)));
case 'make_announce':
case 'smake_sticky':
case 'make_normal':
$topic_type = constant('POST_' . strtoupper(preg_replace('/make_([a-z]+)/', '\1', $mode)));
$sql = 'UPDATE ' . TOPICS_TABLE . "
SET topic_type = $topic_type
@ -602,6 +601,8 @@ switch ($mode)
add_log('mod', $forum_id, $post_data[$post_id]['topic_id'], $logm_mode, $post_id);
//NOTE: hey, who removed the enable_post_count field?! lol ^ ^
$forum_data[$post_data[$post_id]['forum_id']]['enable_post_count'] = 1;
if ($forum_data[$post_data[$post_id]['forum_id']]['enable_post_count'])
{
if (isset($user_posts[$post_data[$post_id]['poster_id']]))
@ -643,6 +644,10 @@ switch ($mode)
add_log('mod', $forum_id, $topic_id, $logm_mode);
}
}
else
{
trigger_error($user->lang['NO_POST_SELECTED']);
}
// Resync last post infos, replies count et caetera
sync('topic', 'topic_id', $topic_id_list);
@ -1501,101 +1506,6 @@ Temp function
function very_temporary_lang_strings()
{
global $user;
$lang = array(
'ALL_FORUMS' => 'All forums',
'LOOK_UP_FORUM' => 'Select a forum',
'FORUM_NOT_POSTABLE' => 'This forum is not postable',
'FORUM_NOT_EXIST' => 'The forum you selected does not exist',
'TOPIC_NOT_EXIST' => 'The topic you selected does not exist',
'SELECT_TOPIC' => 'Select topic',
'TOPIC_NUMBER_IS' => 'Topic #%d is %s',
'POST_DETAILS' => 'Post details',
'CONFIRM_DELETE_POSTS' => 'Are you sure you want to delete these posts?',
'POST_REMOVED' => 'The selected post has been successfully removed from the database',
'POSTS_REMOVED' => 'The selected posts have been successfully removed from the database',
'RESYNC' => 'Resync',
'TOPIC_RESYNCHRONISED' => 'The selected topic has been resynchronised',
'TOPICS_RESYNCHRONISED' => 'The selected topics have been resynchronised',
'SELECT_DESTINATION_FORUM' => 'Please select a forum for destination',
'SELECTED_TOPICS' => 'You selected the following topic(s)',
'LEAVE_SHADOW' => 'Leave a shadow topic in the old forum',
'TOPIC_MOVED' => 'The selected topic has been successfully moved.',
'TOPICS_MOVED' => 'The selected topics have been successfully moved.',
'RETURN_NEW_TOPIC' => 'Click %sHere%s to go to the new topic',
'RETURN_NEW_FORUM' => 'Click %sHere%s to go to the destination forum',
'DISPLAY_OPTIONS' => 'Display options',
'POSTS_PER_PAGE' => 'Posts per page',
'POSTS_PER_PAGE_EXPLAIN' => '(Set to 0 to view all posts)',
'MERGE_TOPIC' => 'Merge topic',
'MERGE_TOPIC_EXPLAIN' => 'Using the form below you can merge selected posts into another topic. These posts will not be reordered and will appear as if the users posted them to the new topic. Please enter the destination topic id or click on the "Select" button to search for one',
'MERGE_TOPIC_ID' => 'Destination topic id',
'MERGE_POSTS' => 'Merge posts',
'POSTS_MERGED' => 'The selected posts have been merged',
'SPLIT_TOPIC' => 'Split topic',
'SPLIT_TOPIC_EXPLAIN' => 'Using the form below you can split a topic in two, either by selecting the posts individually or by splitting at a selected post',
'SPLIT_SUBJECT' => 'New topic title',
'SPLIT_FORUM' => 'Forum for new topic',
'SPLIT_POSTS' => 'Split selected posts',
'SPLIT_AFTER' => 'Split from selected post',
'TOPIC_SPLIT' => 'The selected topic has been split successfully',
'CANNOT_SPLIT_FIRST_POST' => 'You cannot split the first post of a topic',
'DELETE_POSTS' => 'Delete posts',
'APPROVE_POSTS' => 'Approve posts',
'POST_APPROVED' => 'The selected post has been approved',
'POSTS_APPROVED' => 'The selected posts have been approved',
'POST_UNAPPROVED' => 'The selected post has been unapproved',
'POSTS_UNAPPROVED' => 'The selected posts have been unapproved',
'TOPIC_APPROVED' => 'The selected topic has been approved',
'TOPICS_APPROVED' => 'The selected topics have been approved',
'TOPIC_UNAPPROVED' => 'The selected topic has been unapproved',
'TOPICS_UNAPPROVED' => 'The selected topics have been unapproved',
'MOVE' => 'Move',
'LOCK' => 'Lock',
'UNLOCK' => 'Unlock',
'TOPIC_LOCKED' => 'The selected topic has been locked',
'TOPICS_LOCKED' => 'The selected topics have been locked',
'TOPIC_UNLOCKED' => 'The selected topic has been unlocked',
'TOPICS_UNLOCKED' => 'The selected topics have been unlocked',
'NOT_ALLOWED' => 'You are not allowed to perform this action.',
'TOPIC_TYPE_CHANGED' => 'Topic type successfully changed',
'NO_TOPIC_SELECTED' => 'You must select at least one topic to perform this action',
'NO_POST_SELECTED' => 'You must select at least one post to perform this action',
'NO_SUBJECT' => '<No subject>',
'MOD_QUEUE' => 'Moderation queue',
'logm_lock' => 'Locked topic',
'logm_unlock' => 'Unlocked topic',
'logm_move' => 'Moved topic from forum #%s',
'logm_split' => 'Split topic from topic #%s',
'logm_delete_topic' => 'Deleted topic',
'logm_delete_post' => 'Deleted post #%s',
'logm_delete_posts' => 'Deleted posts %s',
'logm_approve_topic' => 'Approved topic',
'logm_approve_post' => 'Approved post #%s',
'logm_unapprove_topic' => 'Unapproved topic',
'logm_unapprove_post' => 'Unapproved post #%s',
'logm_merge' => 'Merged posts from topic #%s',
'logm_set_announce' => 'Topic type changed to Announcement',
'logm_set_sticky' => 'Topic type changed to Sticky',
'logm_set_normal' => 'Topic type changed to Regular'
);
$user->lang = array_merge($user->lang, $lang);
// TODO: probably better to drop it
$user->lang['mod_tabs'] = array(

View file

@ -282,10 +282,10 @@ $topic_mod .= ($auth->acl_get('m_delete', $forum_id)) ? '<option value="delete">
$topic_mod .= ($auth->acl_get('m_move', $forum_id)) ? '<option value="move">' . $user->lang['MOVE_TOPIC'] . '</option>' : '';
$topic_mod .= ($auth->acl_get('m_split', $forum_id)) ? '<option value="split">' . $user->lang['SPLIT_TOPIC'] . '</option>' : '';
$topic_mod .= ($auth->acl_get('m_merge', $forum_id)) ? '<option value="merge">' . $user->lang['MERGE_TOPIC'] . '</option>' : '';
$topic_mod .= ($auth->acl_get('m_', $forum_id) && $topic_type != POST_NORMAL) ? '<option value="set_normal">' . $user->lang['MAKE_NORMAL'] . '</option>' : '';
$topic_mod .= ($auth->acl_get('f_sticky', $forum_id) && $topic_type != POST_STICKY) ? '<option value="set_sticky">' . $user->lang['MAKE_STICKY'] . '</option>' : '';
$topic_mod .= ($auth->acl_get('f_announce', $forum_id) && $topic_type != POST_ANNOUNCE) ? '<option value="set_announce">' . $user->lang['MAKE_ANNOUNCE'] . '</option>' : '';
$topic_mod .= ($auth->acl_get('f_announce', $forum_id) && $topic_type != POST_ANNOUNCE) ? '<option value="set_global">' . $user->lang['MAKE_GLOBAL'] . '</option>' : '';
$topic_mod .= ($auth->acl_get('m_', $forum_id) && $topic_type != POST_NORMAL) ? '<option value="make_normal">' . $user->lang['MAKE_NORMAL'] . '</option>' : '';
$topic_mod .= ($auth->acl_get('f_sticky', $forum_id) && $topic_type != POST_STICKY) ? '<option value="make_sticky">' . $user->lang['MAKE_STICKY'] . '</option>' : '';
$topic_mod .= ($auth->acl_get('f_announce', $forum_id) && $topic_type != POST_ANNOUNCE) ? '<option value="make_announce">' . $user->lang['MAKE_ANNOUNCE'] . '</option>' : '';
$topic_mod .= ($auth->acl_get('f_announce', $forum_id) && $topic_type != POST_ANNOUNCE) ? '<option value="make_global">' . $user->lang['MAKE_GLOBAL'] . '</option>' : '';
// If we've got a hightlight set pass it on to pagination.
$pagination_url = "viewtopic.$phpEx$SID&amp;t=$topic_id&amp;st=$sort_days&amp;sk=$sort_key&amp;sd=$sort_dir" . (($highlight_match) ? "&amp;hilit=$highlight" : '');