コード例 #1
0
 /**
  * This is the dispatcher of smileys administration.
  *
  * @uses ManageSmileys language
  * @uses ManageSmileys template
  * @see Action_Controller::action_index()
  */
 public function action_index()
 {
     global $context, $txt, $modSettings;
     loadLanguage('ManageSmileys');
     loadTemplate('ManageSmileys');
     $subActions = array('addsmiley' => array($this, 'action_addsmiley', 'enabled' => !empty($modSettings['smiley_enable']), 'permission' => 'manage_smileys'), 'editicon' => array($this, 'action_editicon', 'enabled' => !empty($modSettings['messageIcons_enable']), 'permission' => 'manage_smileys'), 'editicons' => array($this, 'action_editicon', 'enabled' => !empty($modSettings['messageIcons_enable']), 'permission' => 'manage_smileys'), 'editsets' => array($this, 'action_edit', 'permission' => 'admin_forum'), 'editsmileys' => array($this, 'action_editsmiley', 'enabled' => !empty($modSettings['smiley_enable']), 'permission' => 'manage_smileys'), 'import' => array($this, 'action_edit', 'permission' => 'manage_smileys'), 'modifyset' => array($this, 'action_edit', 'permission' => 'manage_smileys'), 'modifysmiley' => array($this, 'action_editsmiley', 'enabled' => !empty($modSettings['smiley_enable']), 'permission' => 'manage_smileys'), 'setorder' => array($this, 'action_setorder', 'enabled' => !empty($modSettings['smiley_enable']), 'permission' => 'manage_smileys'), 'settings' => array($this, 'action_smileySettings_display', 'permission' => 'manage_smileys'), 'install' => array($this, 'action_install', 'permission' => 'manage_smileys'));
     // Action controller
     $action = new Action('manage_smileys');
     // Set the smiley context.
     $this->_initSmileyContext();
     // Load up all the tabs...
     $context[$context['admin_menu_name']]['tab_data'] = array('title' => $txt['smileys_manage'], 'help' => 'smileys', 'description' => $txt['smiley_settings_explain'], 'tabs' => array('editsets' => array('description' => $txt['smiley_editsets_explain']), 'addsmiley' => array('description' => $txt['smiley_addsmiley_explain']), 'editsmileys' => array('description' => $txt['smiley_editsmileys_explain']), 'setorder' => array('description' => $txt['smiley_setorder_explain']), 'editicons' => array('description' => $txt['icons_edit_icons_explain']), 'settings' => array('description' => $txt['smiley_settings_explain'])));
     // Default the sub-action to 'edit smiley settings'. call integrate_sa_manage_smileys
     $subAction = $action->initialize($subActions, 'editsets');
     // Set up the template
     $context['page_title'] = $txt['smileys_manage'];
     $context['sub_action'] = $subAction;
     // Some settings may not be enabled, disallow these from the tabs as appropriate.
     if (empty($modSettings['messageIcons_enable'])) {
         $context[$context['admin_menu_name']]['tab_data']['tabs']['editicons']['disabled'] = true;
     }
     if (empty($modSettings['smiley_enable'])) {
         $context[$context['admin_menu_name']]['tab_data']['tabs']['addsmiley']['disabled'] = true;
         $context[$context['admin_menu_name']]['tab_data']['tabs']['editsmileys']['disabled'] = true;
         $context[$context['admin_menu_name']]['tab_data']['tabs']['setorder']['disabled'] = true;
     }
     // Call the right function for this sub-action.
     $action->dispatch($subAction);
 }
コード例 #2
0
 /**
  * Subaction handler - manages the action and delegates control to the proper
  * sub-action.
  *
  * What it does:
  * - It loads both the Themes and Settings language files.
  * - Checks the session by GET or POST to verify the sent data.
  * - Requires the user to not be a guest.
  * - Accessed via ?action=admin;area=theme.
  *
  * @see Action_Controller::action_index()
  */
 public function action_index()
 {
     global $txt, $context;
     if (isset($_REQUEST['api'])) {
         return $this->action_index_api();
     }
     // Load the important language files...
     loadLanguage('ManageThemes');
     loadLanguage('Settings');
     require_once SUBSDIR . '/Action.class.php';
     // No guests in here.
     is_not_guest();
     // Theme administration, removal, choice, or installation...
     $subActions = array('admin' => array($this, 'action_admin', 'permission' => 'admin_forum'), 'list' => array($this, 'action_list', 'permission' => 'admin_forum'), 'reset' => array($this, 'action_options', 'permission' => 'admin_forum'), 'options' => array($this, 'action_options', 'permission' => 'admin_forum'), 'install' => array($this, 'action_install', 'permission' => 'admin_forum'), 'remove' => array($this, 'action_remove', 'permission' => 'admin_forum'), 'pick' => array($this, 'action_pick'), 'edit' => array($this, 'action_edit', 'permission' => 'admin_forum'), 'copy' => array($this, 'action_copy', 'permission' => 'admin_forum'), 'themelist' => array($this, 'action_themelist', 'permission' => 'admin_forum'), 'browse' => array($this, 'action_browse', 'permission' => 'admin_forum'));
     // Action controller
     $action = new Action('manage_themes');
     // @todo Layout Settings?
     if (!empty($context['admin_menu_name'])) {
         $context[$context['admin_menu_name']]['tab_data'] = array('title' => $txt['themeadmin_title'], 'description' => $txt['themeadmin_description'], 'tabs' => array('admin' => array('description' => $txt['themeadmin_admin_desc']), 'list' => array('description' => $txt['themeadmin_list_desc']), 'reset' => array('description' => $txt['themeadmin_reset_desc']), 'edit' => array('description' => $txt['themeadmin_edit_desc']), 'themelist' => array('description' => $txt['themeadmin_edit_desc']), 'browse' => array('description' => $txt['themeadmin_edit_desc'])));
     }
     // Follow the sa or just go to administration, call integrate_sa_manage_themes
     $subAction = $action->initialize($subActions, 'admin');
     // Default the page title to Theme Administration by default.
     $context['page_title'] = $txt['themeadmin_title'];
     $context['sub_action'] = $subAction;
     // Go to the action, if you have permissions
     $action->dispatch($subAction);
 }
コード例 #3
0
 /**
  * The default action is to download an attachment.
  * This allows ?action=attachment to be forwarded to action_dlattach()
  */
 public function action_index()
 {
     require_once SUBSDIR . '/Action.class.php';
     // add an subaction array to act accordingly
     $subActions = array('dlattach' => array($this, 'action_dlattach'), 'ulattach' => array($this, 'action_ulattach'), 'rmattach' => array($this, 'action_rmattach'));
     // Setup the action handler
     $action = new Action();
     $subAction = $action->initialize($subActions, 'dlattach');
     // Call the action
     $action->dispatch($subAction);
 }
コード例 #4
0
 /**
  * Entry point in ExtAuth controller
  */
 public function action_index()
 {
     require_once SUBSDIR . '/Action.class.php';
     // Where to go
     $subActions = array('login' => array($this, 'action_extlogin'), 'deauth' => array($this, 'action_deauth'), 'register' => array($this, 'action_register'));
     $action = new Action();
     // Default action is to login
     $subAction = $action->initialize($subActions, 'login');
     // Do the action
     $action->dispatch($subAction);
 }
コード例 #5
0
 /**
  * Default method, just forwards
  */
 public function action_index()
 {
     require_once SUBSDIR . '/Action.class.php';
     // Where do you want to go today?
     $subActions = array('index' => array($this, 'action_sportal_index'), 'credits' => array($this, 'action_sportal_credits'), 'resetlayout' => array($this, 'action_sportal_resetLayout'), 'userorder' => array($this, 'action_userblockorder'));
     // We like action, so lets get ready for some
     $action = new Action('');
     // Get the subAction, or just go to action_sportal_index
     $subAction = $action->initialize($subActions, 'index');
     // Finally go to where we want to go
     $action->dispatch($subAction);
 }
コード例 #6
0
ファイル: Groups.controller.php プロジェクト: KeiroD/Elkarte
 /**
  * Entry point to groups.
  * It allows moderators and users to access the group showing functions.
  *
  * @see Action_Controller::action_index()
  */
 public function action_index()
 {
     global $context;
     require_once SUBSDIR . '/Action.class.php';
     // Little short on the list here
     $subActions = array('list' => array($this, 'action_list', 'permission' => 'view_mlist'), 'members' => array($this, 'action_members', 'permission' => 'view_mlist'), 'requests' => array($this, 'action_requests'));
     // I don't think we know what to do... throw dies?
     $action = new Action();
     $subAction = $action->initialize($subActions, 'list');
     $context['sub_action'] = $subAction;
     $action->dispatch($subAction);
 }
コード例 #7
0
ファイル: Members.controller.php プロジェクト: KeiroD/Elkarte
 /**
  * Forwards to an action method.
  *
  * @see Action_Controller::action_index()
  */
 public function action_index()
 {
     global $context;
     require_once SUBSDIR . '/Action.class.php';
     // Little short on the list here
     $subActions = array('add' => array($this, 'action_addbuddy', 'permission' => 'profile_identity_own'), 'remove' => array($this, 'action_removebuddy', 'permission' => 'profile_identity_own'));
     // I don't think we know what to do... throw dies?
     $action = new Action();
     $subAction = $action->initialize($subActions, 'none');
     $context['sub_action'] = $subAction;
     $action->dispatch($subAction);
 }
コード例 #8
0
 /**
  * The main entrance point for the Manage Members screen.
  *
  * What it does:
  * - As everyone else, it calls a function based on the given sub-action.
  * - Called by ?action=admin;area=viewmembers.
  * - Requires the moderate_forum permission.
  *
  * @uses ManageMembers template
  * @uses ManageMembers language file.
  * @see Action_Controller::action_index()
  */
 public function action_index()
 {
     global $txt, $scripturl, $context, $modSettings;
     // Load the essentials.
     loadLanguage('ManageMembers');
     loadTemplate('ManageMembers');
     $subActions = array('all' => array('controller' => $this, 'function' => 'action_list', 'permission' => 'moderate_forum'), 'approve' => array('controller' => $this, 'function' => 'action_approve', 'permission' => 'moderate_forum'), 'browse' => array('controller' => $this, 'function' => 'action_browse', 'permission' => 'moderate_forum'), 'search' => array('controller' => $this, 'function' => 'action_search', 'permission' => 'moderate_forum'), 'query' => array('controller' => $this, 'function' => 'action_list', 'permission' => 'moderate_forum'));
     // Prepare our action control
     $action = new Action();
     // Default to sub action 'all', needed for the tabs array below
     $subAction = $action->initialize($subActions, 'all');
     // You can't pass!
     $action->isAllowedTo($subAction);
     // Get counts on every type of activation - for sections and filtering alike.
     require_once SUBSDIR . '/Members.subs.php';
     $context['awaiting_activation'] = 0;
     $context['awaiting_approval'] = 0;
     $context['activation_numbers'] = countInactiveMembers();
     foreach ($context['activation_numbers'] as $activation_type => $total_members) {
         if (in_array($activation_type, array(0, 2))) {
             $context['awaiting_activation'] += $total_members;
         } elseif (in_array($activation_type, array(3, 4, 5))) {
             $context['awaiting_approval'] += $total_members;
         }
     }
     // For the page header... do we show activation?
     $context['show_activate'] = !empty($modSettings['registration_method']) && $modSettings['registration_method'] == 1 || !empty($context['awaiting_activation']);
     // What about approval?
     $context['show_approve'] = !empty($modSettings['registration_method']) && $modSettings['registration_method'] == 2 || !empty($context['awaiting_approval']) || !empty($modSettings['approveAccountDeletion']);
     // Setup the admin tabs.
     $context[$context['admin_menu_name']]['tab_data'] = array('title' => $txt['admin_members'], 'help' => 'view_members', 'description' => $txt['admin_members_list'], 'tabs' => array());
     $context['tabs'] = array('viewmembers' => array('label' => $txt['view_all_members'], 'description' => $txt['admin_members_list'], 'url' => $scripturl . '?action=admin;area=viewmembers;sa=all', 'is_selected' => $subAction == 'all'), 'search' => array('label' => $txt['mlist_search'], 'description' => $txt['admin_members_list'], 'url' => $scripturl . '?action=admin;area=viewmembers;sa=search', 'is_selected' => $subAction == 'search' || $subAction == 'query'), 'approve' => array('label' => sprintf($txt['admin_browse_awaiting_approval'], $context['awaiting_approval']), 'description' => $txt['admin_browse_approve_desc'], 'url' => $scripturl . '?action=admin;area=viewmembers;sa=browse;type=approve', 'is_selected' => false), 'activate' => array('label' => sprintf($txt['admin_browse_awaiting_activate'], $context['awaiting_activation']), 'description' => $txt['admin_browse_activate_desc'], 'url' => $scripturl . '?action=admin;area=viewmembers;sa=browse;type=activate', 'is_selected' => false, 'is_last' => true));
     // Call integrate_manage_members
     call_integration_hook('integrate_manage_members', array(&$subActions));
     // Sort out the tabs for the ones which may not exist!
     if (!$context['show_activate'] && ($subAction != 'browse' || $_REQUEST['type'] != 'activate')) {
         $context['tabs']['approve']['is_last'] = true;
         unset($context['tabs']['activate']);
     }
     // Unset approval tab if it shouldn't be there.
     if (!$context['show_approve'] && ($subAction != 'browse' || $_REQUEST['type'] != 'approve')) {
         if (!$context['show_activate'] && ($subAction != 'browse' || $_REQUEST['type'] != 'activate')) {
             $context['tabs']['search']['is_last'] = true;
         }
         unset($context['tabs']['approve']);
     }
     // Last items for the template
     $context['page_title'] = $txt['admin_members'];
     $context['sub_action'] = $subAction;
     // Off we go
     $action->dispatch($subAction);
 }
コード例 #9
0
 /**
  * This is the entry point for all things post moderation.
  *
  * @uses ModerationCenter template
  * @uses ModerationCenter language file
  * @see Action_Controller::action_index()
  */
 public function action_index()
 {
     // @todo We'll shift these later bud.
     loadLanguage('ModerationCenter');
     loadTemplate('ModerationCenter');
     require_once SUBSDIR . '/Action.class.php';
     // Allowed sub-actions, you know the drill by now!
     $subActions = array('approve' => array($this, 'action_approve'), 'attachments' => array($this, 'action_unapproved_attachments'), 'replies' => array($this, 'action_unapproved'), 'topics' => array($this, 'action_unapproved'));
     // Pick something valid...
     $action = new Action();
     $subAction = $action->initialize($subActions, 'replies');
     $action->dispatch($subAction);
 }
コード例 #10
0
 /**
  * Check permissions and forward to the right method.
  *
  * @see Action_Controller::action_index()
  */
 public function action_index()
 {
     global $context, $txt;
     $subActions = array('display' => array('controller' => $this, 'function' => 'action_topicSettings_display', 'permission' => 'admin_forum'));
     // Control for an action, why not!
     $action = new Action('manage_topics');
     // Only one option I'm afraid, but integrate_sa_manage_topics may add more
     $subAction = $action->initialize($subActions, 'display');
     // Page items for the template
     $context['sub_action'] = $subAction;
     $context['page_title'] = $txt['manageposts_topic_settings'];
     // Set up action/subaction stuff.
     $action->dispatch($subAction);
 }
コード例 #11
0
 /**
  * The BBC admin area
  *
  * What it does:
  * - This method is the entry point for index.php?action=admin;area=postsettings;sa=bbc
  * and it calls a function based on the sub-action, here only display.
  * - requires admin_forum permissions
  *
  * @see Action_Controller::action_index()
  */
 public function action_index()
 {
     global $context, $txt;
     // We're working with them settings here.
     require_once SUBSDIR . '/SettingsForm.class.php';
     $subActions = array('display' => array('controller' => $this, 'function' => 'action_bbcSettings_display', 'permission' => 'admin_forum'));
     // Set up
     $action = new Action('manage_bbc');
     // Only one option I'm afraid, but integrate_sa_manage_bbc can add more
     $subAction = $action->initialize($subActions, 'display');
     $context['sub_action'] = $subAction;
     $context['page_title'] = $txt['manageposts_bbc_settings_title'];
     // Make the call
     $action->dispatch($subAction);
 }
コード例 #12
0
ファイル: Xml.controller.php プロジェクト: KeiroD/Elkarte
 /**
  * Main dispatcher for action=xmlhttp.
  *
  * @see Action_Controller::action_index()
  */
 public function action_index()
 {
     loadTemplate('Xml');
     require_once SUBSDIR . '/Action.class.php';
     $subActions = array('jumpto' => array('controller' => $this, 'function' => 'action_jumpto'), 'messageicons' => array('controller' => $this, 'function' => 'action_messageicons'), 'groupicons' => array('controller' => $this, 'function' => 'action_groupicons'), 'corefeatures' => array('controller' => $this, 'function' => 'action_corefeatures', 'permission' => 'admin_forum'), 'profileorder' => array('controller' => $this, 'function' => 'action_profileorder', 'permission' => 'admin_forum'), 'messageiconorder' => array('controller' => $this, 'function' => 'action_messageiconorder', 'permission' => 'admin_forum'), 'smileyorder' => array('controller' => $this, 'function' => 'action_smileyorder', 'permission' => 'admin_forum'), 'boardorder' => array('controller' => $this, 'function' => 'action_boardorder', 'permission' => 'manage_boards'), 'parserorder' => array('controller' => $this, 'function' => 'action_parserorder', 'permission' => 'admin_forum'));
     // Easy adding of xml sub actions with integrate_xmlhttp
     $action = new Action('xmlhttp');
     $subAction = $action->initialize($subActions);
     // Act a bit special for XML, probably never see it anyway :P
     if (empty($subAction)) {
         fatal_lang_error('no_access', false);
     }
     // Off we go then, (it will check permissions)
     $action->dispatch($subAction);
 }
コード例 #13
0
 /**
  * Entry point for this section.
  *
  * @see Action_Controller::action_index()
  */
 public function action_index()
 {
     global $context, $txt;
     loadLanguage('Search');
     loadTemplate('ManageSearch');
     $subActions = array('editspiders' => array($this, 'action_editspiders', 'permission' => 'admin_forum'), 'logs' => array($this, 'action_logs', 'permission' => 'admin_forum'), 'settings' => array($this, 'action_engineSettings_display', 'permission' => 'admin_forum'), 'spiders' => array($this, 'action_spiders', 'permission' => 'admin_forum'), 'stats' => array($this, 'action_stats', 'permission' => 'admin_forum'));
     // Control
     $action = new Action('manage_search_engines');
     // Some more tab data.
     $context[$context['admin_menu_name']]['tab_data'] = array('title' => $txt['search_engines'], 'description' => $txt['search_engines_description']);
     // Ensure we have a valid subaction. call integrate_sa_manage_search_engines
     $subAction = $action->initialize($subActions, 'stats');
     // Some contextual data for the template.
     $context['sub_action'] = $subAction;
     $context['page_title'] = $txt['search_engines'];
     // Call the right function for this sub-action.
     $action->dispatch($subAction);
 }
コード例 #14
0
 /**
  * The main dispatcher; delegates.
  *
  * What it does:
  * - This is the main entry point for all the manageboards admin screens.
  * - Called by ?action=admin;area=manageboards.
  * - It checks the permissions, based on the sub-action, and calls a function based on the sub-action.
  *
  * @uses ManageBoards language file.
  */
 public function action_index()
 {
     global $context, $txt;
     // Everything's gonna need this.
     loadLanguage('ManageBoards');
     // We're working with them settings here.
     require_once SUBSDIR . '/SettingsForm.class.php';
     // Format: 'sub-action' => array('controller', 'function', 'permission'=>'need')
     $subActions = array('board' => array('controller' => $this, 'function' => 'action_board', 'permission' => 'manage_boards'), 'board2' => array('controller' => $this, 'function' => 'action_board2', 'permission' => 'manage_boards'), 'cat' => array('controller' => $this, 'function' => 'action_cat', 'permission' => 'manage_boards'), 'cat2' => array('controller' => $this, 'function' => 'action_cat2', 'permission' => 'manage_boards'), 'main' => array('controller' => $this, 'function' => 'action_main', 'permission' => 'manage_boards'), 'move' => array('controller' => $this, 'function' => 'action_main', 'permission' => 'manage_boards'), 'newcat' => array('controller' => $this, 'function' => 'action_cat', 'permission' => 'manage_boards'), 'newboard' => array('controller' => $this, 'function' => 'action_board', 'permission' => 'manage_boards'), 'settings' => array('controller' => $this, 'function' => 'action_boardSettings_display', 'permission' => 'admin_forum'));
     // Create the tabs for the template.
     $context[$context['admin_menu_name']]['tab_data'] = array('title' => $txt['boards_and_cats'], 'help' => 'manage_boards', 'description' => $txt['boards_and_cats_desc'], 'tabs' => array('main' => array(), 'newcat' => array(), 'settings' => array('description' => $txt['mboards_settings_desc'])));
     // You way will end here if you don't have permission.
     $action = new Action('manage_boards');
     // Default to sub-action 'main' or 'settings' depending on permissions.
     $subAction = $action->initialize($subActions, allowedTo('manage_boards') ? 'main' : 'settings');
     $context['sub_action'] = $subAction;
     $action->dispatch($subAction);
 }
コード例 #15
0
 /**
  * Scheduled tasks management dispatcher.
  *
  * - This function checks permissions and delegates to the appropriate function
  * based on the sub-action.
  * - Everything here requires admin_forum permission.
  *
  * @uses ManageScheduledTasks template file
  * @uses ManageScheduledTasks language file
  *
  * @see Action_Controller::action_index()
  */
 public function action_index()
 {
     global $context, $txt;
     loadLanguage('ManageScheduledTasks');
     loadTemplate('ManageScheduledTasks');
     $subActions = array('taskedit' => array($this, 'action_edit', 'permission' => 'admin_forum'), 'tasklog' => array($this, 'action_log', 'permission' => 'admin_forum'), 'tasks' => array($this, 'action_tasks', 'permission' => 'admin_forum'));
     // Control those actions
     $action = new Action('manage_scheduled_tasks');
     // Now for the lovely tabs. That we all love.
     $context[$context['admin_menu_name']]['tab_data'] = array('title' => $txt['scheduled_tasks_title'], 'help' => '', 'description' => $txt['maintain_info'], 'tabs' => array('tasks' => array('description' => $txt['maintain_tasks_desc']), 'tasklog' => array('description' => $txt['scheduled_log_desc'])));
     // We need to find what's the action. call integrate_sa_manage_scheduled_tasks
     $subAction = $action->initialize($subActions, 'tasks');
     // Page details
     $context['page_title'] = $txt['maintain_info'];
     $context['sub_action'] = $subAction;
     // Call the right function for this sub-action.
     $action->dispatch($subAction);
 }
コード例 #16
0
 /**
  * The main entrance point for the 'Posts and topics' screen.
  *
  * What it does:
  * - Like all others, it checks permissions, then forwards to the right function
  * based on the given sub-action.
  * - Defaults to sub-action 'posts'.
  * - Accessed from ?action=admin;area=postsettings.
  * - Requires (and checks for) the admin_forum permission.
  *
  * @see Action_Controller::action_index()
  */
 public function action_index()
 {
     global $context, $txt;
     // We're working with them settings here.
     require_once SUBSDIR . '/SettingsForm.class.php';
     $subActions = array('posts' => array($this, 'action_postSettings_display', 'permission' => 'admin_forum'), 'bbc' => array('function' => 'action_index', 'file' => 'ManageBBC.controller.php', 'controller' => 'ManageBBC_Controller', 'permission' => 'admin_forum'), 'censor' => array($this, 'action_censor', 'permission' => 'admin_forum'), 'topics' => array('function' => 'action_index', 'file' => 'ManageTopics.controller.php', 'controller' => 'ManageTopics_Controller', 'permission' => 'admin_forum'));
     // Good old action handle
     $action = new Action('manage_posts');
     // Tabs for browsing the different post functions.
     $context[$context['admin_menu_name']]['tab_data'] = array('title' => $txt['manageposts_title'], 'help' => 'posts_and_topics', 'description' => $txt['manageposts_description'], 'tabs' => array('posts' => array('description' => $txt['manageposts_settings_description']), 'bbc' => array('description' => $txt['manageposts_bbc_settings_description']), 'censor' => array('description' => $txt['admin_censored_desc']), 'topics' => array('description' => $txt['manageposts_topic_settings_description'])));
     // Default the sub-action to 'posts'. call integrate_sa_manage_posts
     $subAction = $action->initialize($subActions, 'posts');
     // Just for the template
     $context['page_title'] = $txt['manageposts_title'];
     $context['sub_action'] = $subAction;
     // Call the right function for this sub-action.
     $action->dispatch($subAction);
 }
 /**
  * Main dispatcher.
  * This function checks permissions and passes control through.
  */
 public function action_index()
 {
     global $context, $txt;
     // You must have admin or shoutbox privileges to be here
     if (!allowedTo('sp_admin')) {
         isAllowedTo('sp_manage_shoutbox');
     }
     loadTemplate('PortalAdminShoutbox');
     $subActions = array('list' => array($this, 'action_sportal_admin_shoutbox_list'), 'add' => array($this, 'action_sportal_admin_shoutbox_edit'), 'edit' => array($this, 'action_sportal_admin_shoutbox_edit'), 'prune' => array($this, 'action_sportal_admin_shoutbox_prune'), 'delete' => array($this, 'action_sportal_admin_shoutbox_delete'), 'status' => array($this, 'action_sportal_admin_shoutbox_status'), 'blockredirect' => array($this, 'action_sportal_admin_shoutbox_block_redirect'));
     // Start up the controller, provide a hook since we can
     $action = new Action('portal_shoutbox');
     $context[$context['admin_menu_name']]['tab_data'] = array('title' => $txt['sp_admin_shoutbox_title'], 'help' => 'sp_ShoutboxArea', 'description' => $txt['sp_admin_shoutbox_desc'], 'tabs' => array('list' => array(), 'add' => array()));
     // Default the action to list if none or no valid option is given
     $subAction = $action->initialize($subActions, 'list');
     $context['sub_action'] = $subAction;
     // Shout it on out
     $action->dispatch($subAction);
 }
コード例 #18
0
 /**
  * The Avatars admin area
  *
  * What it does:
  * - This method is the entry point for index.php?action=admin;area=manageattachments;sa=avatars
  * - It calls a function based on the sub-action.
  * - Is called from ManageAttachments.controller.php
  * - requires manage_attachments permissions
  *
  * @see Action_Controller::action_index()
  */
 public function action_index()
 {
     global $context, $txt;
     // You have to be able to moderate the forum to do this.
     isAllowedTo('manage_attachments');
     // We're working with them settings here.
     require_once SUBSDIR . '/SettingsForm.class.php';
     $subActions = array('display' => array($this, 'action_avatarSettings_display'));
     // Set up for some action
     $action = new Action('manage_avatars');
     // Get the sub action or set a default, call integrate_sa_avatar_settings
     $subAction = $action->initialize($subActions, 'display');
     // Final page details
     $context['sub_action'] = $subAction;
     $context['page_title'] = $txt['avatar_settings'];
     // Now go!
     $action->dispatch($subAction);
 }
コード例 #19
0
 /**
  * Main entry point for the admin search settings screen.
  *
  * What it does:
  * - It checks permissions, and it forwards to the appropriate function based on
  * the given sub-action.
  * - Defaults to sub-action 'settings'.
  * - Called by ?action=admin;area=managesearch.
  * - Requires the admin_forum permission.
  *
  * @uses ManageSearch template.
  * @uses Search language file.
  * @see Action_Controller::action_index()
  */
 public function action_index()
 {
     global $context, $txt;
     loadLanguage('Search');
     loadTemplate('ManageSearch');
     $subActions = array('settings' => array($this, 'action_searchSettings_display', 'permission' => 'admin_forum'), 'weights' => array($this, 'action_weight', 'permission' => 'admin_forum'), 'method' => array($this, 'action_edit', 'permission' => 'admin_forum'), 'createfulltext' => array($this, 'action_edit', 'permission' => 'admin_forum'), 'removecustom' => array($this, 'action_edit', 'permission' => 'admin_forum'), 'removefulltext' => array($this, 'action_edit', 'permission' => 'admin_forum'), 'createmsgindex' => array($this, 'action_create', 'permission' => 'admin_forum'), 'managesphinx' => array($this, 'action_managesphinx', 'permission' => 'admin_forum'), 'managesphinxql' => array($this, 'action_managesphinx', 'permission' => 'admin_forum'));
     // Control for actions
     $action = new Action('manage_search');
     // Create the tabs for the template.
     $context[$context['admin_menu_name']]['tab_data'] = array('title' => $txt['manage_search'], 'help' => 'search', 'description' => $txt['search_settings_desc'], 'tabs' => array('method' => array('description' => $txt['search_method_desc']), 'weights' => array('description' => $txt['search_weights_desc']), 'settings' => array('description' => $txt['search_settings_desc'])));
     // Default the sub-action to 'edit search method'.  Call integrate_sa_manage_search
     $subAction = $action->initialize($subActions, 'method');
     // Final bits
     $context['sub_action'] = $subAction;
     $context['page_title'] = $txt['search_settings_title'];
     // Call the right function for this sub-action.
     $action->dispatch($subAction);
 }
 /**
  * Main dispatcher.
  * This function checks permissions and passes control through.
  */
 public function action_index()
 {
     global $context, $txt;
     // Helpers
     require_once SUBSDIR . '/PortalAdmin.subs.php';
     loadTemplate('PortalAdminProfiles');
     // What can we do
     $subActions = array('listpermission' => array($this, 'action_sportal_admin_permission_profiles_list', 'permission' => 'sp_manage_profiles'), 'addpermission' => array($this, 'action_sportal_admin_permission_profiles_edit', 'permission' => 'sp_manage_profiles'), 'editpermission' => array($this, 'action_sportal_admin_permission_profiles_edit', 'permission' => 'sp_manage_profiles'), 'deletepermission' => array($this, 'action_sportal_admin_permission_profiles_delete', 'permission' => 'sp_manage_profiles'));
     // Start up the controller, provide a hook since we can
     $action = new Action('portal_profile');
     // Leave some breadcrumbs so we know our way back
     $context[$context['admin_menu_name']]['tab_data'] = array('title' => $txt['sp_admin_profiles_title'], 'help' => 'sp_ProfilesArea', 'description' => $txt['sp_admin_profiles_desc'], 'tabs' => array('listpermission' => array(), 'addpermission' => array()));
     // Default to the listpermission action
     $subAction = $action->initialize($subActions, 'listpermission');
     $context['sub_action'] = $subAction;
     // Call the right function for this sub-action, if you have permission
     $action->dispatch($subAction);
 }
コード例 #21
0
 /**
  * This function passes control through to the relevant security tab.
  *
  * @see Action_Controller::action_index()
  */
 public function action_index()
 {
     global $context, $txt;
     loadLanguage('Help');
     loadLanguage('ManageSettings');
     $subActions = array('general' => array($this, 'action_securitySettings_display', 'permission' => 'admin_forum'), 'spam' => array($this, 'action_spamSettings_display', 'permission' => 'admin_forum'), 'badbehavior' => array($this, 'action_bbSettings_display', 'permission' => 'admin_forum'), 'moderation' => array($this, 'action_moderationSettings_display', 'enabled' => in_array('w', $context['admin_features']), 'permission' => 'admin_forum'));
     // Action control
     $action = new Action('modify_security');
     // Load up all the tabs...
     $context[$context['admin_menu_name']]['tab_data'] = array('title' => $txt['admin_security_moderation'], 'help' => 'securitysettings', 'description' => $txt['security_settings_desc'], 'tabs' => array('general' => array(), 'spam' => array('description' => $txt['antispam_Settings_desc']), 'badbehavior' => array('description' => $txt['badbehavior_desc']), 'moderation' => array()));
     // By default do the basic settings, call integrate_sa_modify_security
     $subAction = $action->initialize($subActions, 'general');
     // Last pieces of the puzzle
     $context['sub_action'] = $subAction;
     $context['page_title'] = $txt['admin_security_moderation'];
     $context['sub_template'] = 'show_settings';
     // Call the right function for this sub-action.
     $action->dispatch($subAction);
 }
コード例 #22
0
 /**
  * This is the main function for the languages area.
  *
  * What it does:
  * - It dispatches the requests.
  * - Loads the ManageLanguages template. (sub-actions will use it)
  *
  * @uses ManageSettings language file
  * @see Action_Controller::action_index()
  */
 public function action_index()
 {
     global $context, $txt;
     loadTemplate('ManageLanguages');
     loadLanguage('ManageSettings');
     $subActions = array('edit' => array($this, 'action_edit', 'permission' => 'admin_forum'), 'settings' => array($this, 'action_languageSettings_display', 'permission' => 'admin_forum'), 'downloadlang' => array($this, 'action_downloadlang', 'permission' => 'admin_forum'), 'editlang' => array($this, 'action_editlang', 'permission' => 'admin_forum'));
     // Get ready for action
     $action = new Action('manage_languages');
     // Load up all the tabs...
     $context[$context['admin_menu_name']]['tab_data'] = array('title' => $txt['language_configuration'], 'description' => $txt['language_description']);
     // By default we're managing languages, call integrate_sa_manage_languages
     $subAction = $action->initialize($subActions, 'edit');
     // Some final bits
     $context['sub_action'] = $subAction;
     $context['page_title'] = $txt['edit_languages'];
     $context['sub_template'] = 'show_settings';
     // Call the right function for this sub-action.
     $action->dispatch($subAction);
 }
コード例 #23
0
 /**
  * Splits a topic into two topics.
  * delegates to the other functions (based on the URL parameter 'sa').
  * loads the SplitTopics template.
  * requires the split_any permission.
  * is accessed with ?action=splittopics.
  */
 public function action_splittopics()
 {
     global $topic;
     // And... which topic were you splitting, again?
     if (empty($topic)) {
         fatal_lang_error('numbers_one_to_nine', false);
     }
     // Load up the "dependencies" - the template, getMsgMemberID().
     if (!isset($_REQUEST['xml'])) {
         loadTemplate('SplitTopics');
     }
     require_once SUBSDIR . '/Boards.subs.php';
     require_once SUBSDIR . '/Post.subs.php';
     require_once SUBSDIR . '/Action.class.php';
     $subActions = array('selectTopics' => array($this, 'action_splitSelectTopics', 'permission' => 'split_any'), 'execute' => array($this, 'action_splitExecute', 'permission' => 'split_any'), 'index' => array($this, 'action_splitIndex', 'permission' => 'split_any'), 'splitSelection' => array($this, 'action_splitSelection', 'permission' => 'split_any'));
     // ?action=splittopics;sa=LETSBREAKIT won't work, sorry.
     $action = new Action();
     $subAction = $action->initialize($subActions, 'index');
     $action->dispatch($subAction);
 }
コード例 #24
0
 /**
  * Main dispatcher.
  *
  * - This function checks permissions and passes control through to the relevant section.
  *
  * @see Action_Controller::action_index()
  * @uses Help and MangeMail language files
  */
 public function action_index()
 {
     global $context, $txt;
     loadLanguage('Help');
     loadLanguage('ManageMail');
     // We'll need the utility functions from here.
     require_once SUBSDIR . '/SettingsForm.class.php';
     $subActions = array('browse' => array($this, 'action_browse', 'permission' => 'admin_forum'), 'clear' => array($this, 'action_clear', 'permission' => 'admin_forum'), 'settings' => array($this, 'action_mailSettings_display', 'permission' => 'admin_forum'));
     // Action control
     $action = new Action('manage_mail');
     // Load up all the tabs...
     $context[$context['admin_menu_name']]['tab_data'] = array('title' => $txt['mailqueue_title'], 'help' => '', 'description' => $txt['mailqueue_desc']);
     // By default we want to browse, call integrate_sa_manage_mail
     $subAction = $action->initialize($subActions, 'browse');
     // Final bits
     $context['sub_action'] = $subAction;
     $context['page_title'] = $txt['mailqueue_title'];
     // Call the right function for this sub-action.
     $action->dispatch($subAction);
 }
コード例 #25
0
 /**
  * Entrance point for the registration center, it checks permisions and forwards
  * to the right method based on the subaction.
  *
  * - Accessed by ?action=admin;area=regcenter.
  * - Requires either the moderate_forum or the admin_forum permission.
  *
  * @uses Login language file
  * @uses Register template.
  * @see Action_Controller::action_index()
  */
 public function action_index()
 {
     global $context, $txt;
     // Loading, always loading.
     loadLanguage('Login');
     loadTemplate('Register');
     loadJavascriptFile('register.js');
     $subActions = array('register' => array('controller' => $this, 'function' => 'action_register', 'permission' => 'moderate_forum'), 'agreement' => array('controller' => $this, 'function' => 'action_agreement', 'permission' => 'admin_forum'), 'reservednames' => array('controller' => $this, 'function' => 'action_reservednames', 'permission' => 'admin_forum'), 'settings' => array('controller' => $this, 'function' => 'action_registerSettings_display', 'permission' => 'admin_forum'));
     // Action controller
     $action = new Action('manage_registrations');
     // Next create the tabs for the template.
     $context[$context['admin_menu_name']]['tab_data'] = array('title' => $txt['registration_center'], 'help' => 'registrations', 'description' => $txt['admin_settings_desc'], 'tabs' => array('register' => array('description' => $txt['admin_register_desc']), 'agreement' => array('description' => $txt['registration_agreement_desc']), 'reservednames' => array('description' => $txt['admin_reserved_desc']), 'settings' => array('description' => $txt['admin_settings_desc'])));
     // Work out which to call... call integrate_sa_manage_registrations
     $subAction = $action->initialize($subActions, 'register');
     // Final bits
     $context['page_title'] = $txt['maintain_title'];
     $context['sub_action'] = $subAction;
     // Call the right function for this sub-action.
     $action->dispatch($subAction);
 }
コード例 #26
0
 /**
  * Main dispatcher, the entrance point for all 'Manage Membergroup' actions.
  *
  * What it does:
  * - It forwards to a function based on the given subaction, default being subaction 'index', or, without manage_membergroup
  * permissions, then 'settings'.
  * - Called by ?action=admin;area=membergroups.
  * - Requires the manage_membergroups or the admin_forum permission.
  *
  * @uses ManageMembergroups template.
  * @uses ManageMembers language file.
  * @see Action_Controller::action_index()
  */
 public function action_index()
 {
     global $context, $txt;
     // Language and template stuff, the usual.
     loadLanguage('ManageMembers');
     loadTemplate('ManageMembergroups');
     $subActions = array('add' => array('controller' => $this, 'function' => 'action_add', 'permission' => 'manage_membergroups'), 'delete' => array('controller' => $this, 'function' => 'action_delete', 'permission' => 'manage_membergroups'), 'edit' => array('controller' => $this, 'function' => 'action_edit', 'permission' => 'manage_membergroups'), 'index' => array('controller' => $this, 'function' => 'action_list', 'permission' => 'manage_membergroups'), 'members' => array('controller' => 'Groups_Controller', 'function' => 'action_index', 'permission' => 'manage_membergroups', 'file' => 'Groups.controller.php', 'dir' => CONTROLLERDIR), 'settings' => array('controller' => $this, 'function' => 'action_groupSettings_display', 'permission' => 'admin_forum'));
     $action = new Action('manage_membergroups');
     // Setup the admin tabs.
     $context[$context['admin_menu_name']]['tab_data'] = array('title' => $txt['membergroups_title'], 'help' => 'membergroups', 'description' => $txt['membergroups_description']);
     // Default to sub action 'index' or 'settings' depending on permissions.
     $subAction = isset($_REQUEST['sa']) && isset($subActions[$_REQUEST['sa']]) ? $_REQUEST['sa'] : (allowedTo('manage_membergroups') ? 'index' : 'settings');
     // Set that subaction, call integrate_sa_manage_membergroups
     $subAction = $action->initialize($subActions, $subAction);
     // Final items for the template
     $context['page_title'] = $txt['membergroups_title'];
     $context['sub_action'] = $subAction;
     // Call the right function.
     $action->dispatch($subAction);
 }
 /**
  * Main article dispatcher.
  *
  * This function checks permissions and passes control through.
  */
 public function action_index()
 {
     global $context, $txt;
     // You need to be an admin or have manage article permissions
     if (!allowedTo('sp_admin')) {
         isAllowedTo('sp_manage_articles');
     }
     loadTemplate('PortalAdminArticles');
     // This are all the actions that we know
     $subActions = array('list' => array($this, 'action_sportal_admin_article_list'), 'add' => array($this, 'action_sportal_admin_article_edit'), 'edit' => array($this, 'action_sportal_admin_article_edit'), 'status' => array($this, 'action_sportal_admin_article_status'), 'delete' => array($this, 'action_sportal_admin_article_delete'));
     // Start up the controller, provide a hook since we can
     $action = new Action('portal_articles');
     // Set up the tab data
     $context[$context['admin_menu_name']]['tab_data'] = array('title' => $txt['sp_admin_articles_title'], 'help' => 'sp_ArticlesArea', 'description' => $txt['sp_admin_articles_desc'], 'tabs' => array('list' => array(), 'add' => array()));
     // By default we want to list articles
     $subAction = $action->initialize($subActions, 'list');
     $context['sub_action'] = $subAction;
     // Call the right function for this sub-action
     $action->dispatch($subAction);
 }
コード例 #28
0
 /**
  * This function passes control through to the relevant tab.
  *
  * @see Action_Controller::action_index()
  * @uses Help, ManageSettings languages
  * @uses sub_template show_settings
  */
 public function action_index()
 {
     global $context, $txt, $settings, $scripturl;
     // Often Helpful
     loadLanguage('Help');
     loadLanguage('ManageSettings');
     // All the actions we know about
     $subActions = array('basic' => array('controller' => $this, 'function' => 'action_basicSettings_display', 'permission' => 'admin_forum'), 'layout' => array('controller' => $this, 'function' => 'action_layoutSettings_display', 'permission' => 'admin_forum'), 'karma' => array('controller' => $this, 'function' => 'action_karmaSettings_display', 'enabled' => in_array('k', $context['admin_features']), 'permission' => 'admin_forum'), 'pmsettings' => array('controller' => $this, 'function' => 'action_pmsettings', 'permission' => 'admin_forum'), 'likes' => array('controller' => $this, 'function' => 'action_likesSettings_display', 'enabled' => in_array('l', $context['admin_features']), 'permission' => 'admin_forum'), 'mention' => array('controller' => $this, 'function' => 'action_mentionSettings_display', 'permission' => 'admin_forum'), 'sig' => array('controller' => $this, 'function' => 'action_signatureSettings_display', 'permission' => 'admin_forum'), 'profile' => array('controller' => $this, 'function' => 'action_profile', 'enabled' => in_array('cp', $context['admin_features']), 'permission' => 'admin_forum'), 'profileedit' => array('controller' => $this, 'function' => 'action_profileedit', 'permission' => 'admin_forum'));
     // Set up the action control
     $action = new Action('modify_features');
     // Load up all the tabs...
     $context[$context['admin_menu_name']]['tab_data'] = array('title' => $txt['modSettings_title'], 'help' => 'featuresettings', 'description' => sprintf($txt['modSettings_desc'], $scripturl . '?action=admin;area=theme;sa=list;th=' . $settings['theme_id'] . ';' . $context['session_id'] . '=' . $context['session_var']), 'tabs' => array('basic' => array(), 'layout' => array(), 'pmsettings' => array(), 'karma' => array(), 'likes' => array(), 'mention' => array('description' => $txt['mentions_settings_desc']), 'sig' => array('description' => $txt['signature_settings_desc']), 'profile' => array('description' => $txt['custom_profile_desc'])));
     // By default do the basic settings, call integrate_sa_modify_features
     $subAction = $action->initialize($subActions, 'basic');
     // Some final pieces for the template
     $context['sub_template'] = 'show_settings';
     $context['sub_action'] = $subAction;
     $context['page_title'] = $txt['modSettings_title'];
     // Call the right function for this sub-action.
     $action->dispatch($subAction);
 }
コード例 #29
0
 /**
  * The main controlling function doesn't have much to do... yet.
  * Just check permissions and delegate to the rest.
  *
  * @uses ManageCalendar language file.
  */
 public function action_index()
 {
     global $context, $txt;
     // Everything's gonna need this.
     loadLanguage('ManageCalendar');
     // We're working with them settings here.
     require_once SUBSDIR . '/SettingsForm.class.php';
     // Default text.
     $context['explain_text'] = $txt['calendar_desc'];
     // Little short on the ground of functions here... but things can and maybe will change...
     $subActions = array('editholiday' => array($this, 'action_editholiday', 'permission' => 'admin_forum'), 'holidays' => array($this, 'action_holidays', 'permission' => 'admin_forum'), 'settings' => array($this, 'action_calendarSettings_display', 'permission' => 'admin_forum'));
     // Action control
     $action = new Action('manage_calendar');
     // Set up the two tabs here...
     $context[$context['admin_menu_name']]['tab_data'] = array('title' => $txt['manage_calendar'], 'help' => 'calendar', 'description' => $txt['calendar_settings_desc'], 'tabs' => array('holidays' => array('description' => $txt['manage_holidays_desc']), 'settings' => array('description' => $txt['calendar_settings_desc'])));
     // Set up the default subaction, call integrate_sa_manage_calendar
     $subAction = $action->initialize($subActions, 'settings');
     $context['sub_action'] = $subAction;
     // Off we go
     $action->dispatch($subAction);
 }
コード例 #30
0
 /**
  * The main entrance point for the 'Paid Subscription' screen,
  *
  * What it does:
  * - calling the right function based on the given sub-action.
  * - It defaults to sub-action 'view'.
  * - Accessed from ?action=admin;area=paidsubscribe.
  * - It requires admin_forum permission for admin based actions.
  *
  * @see Action_Controller::action_index()
  */
 public function action_index()
 {
     global $context, $txt, $modSettings;
     // Load the required language and template.
     loadLanguage('ManagePaid');
     loadTemplate('ManagePaid');
     $subActions = array('modify' => array('controller' => $this, 'function' => 'action_modify', 'permission' => 'admin_forum'), 'modifyuser' => array('controller' => $this, 'function' => 'action_modifyuser', 'permission' => 'admin_forum'), 'settings' => array('controller' => $this, 'function' => 'action_paidSettings_display', 'permission' => 'admin_forum'), 'view' => array('controller' => $this, 'function' => 'action_view', 'permission' => 'admin_forum'), 'viewsub' => array('controller' => $this, 'function' => 'action_viewsub', 'permission' => 'admin_forum'));
     // Some actions
     $action = new Action('manage_subscriptions');
     // Tabs for browsing the different subscription functions.
     $context[$context['admin_menu_name']]['tab_data'] = array('title' => $txt['paid_subscriptions'], 'help' => '', 'description' => $txt['paid_subscriptions_desc'], 'tabs' => array('view' => array('description' => $txt['paid_subs_view_desc']), 'settings' => array('description' => $txt['paid_subs_settings_desc'])));
     // Default the sub-action to 'view subscriptions', but only if they have already set things up..
     $subAction = isset($_REQUEST['sa']) && isset($subActions[$_REQUEST['sa']]) ? $_REQUEST['sa'] : (!empty($modSettings['paid_currency_symbol']) ? 'view' : 'settings');
     // Load in the subActions, call integrate_sa_manage_subscriptions
     $action->initialize($subActions, 'settings');
     // Final things for the template
     $context['page_title'] = $txt['paid_subscriptions'];
     $context['sub_action'] = $subAction;
     // Call the right function for this sub-action.
     $action->dispatch($subAction);
 }