本文整理汇总了PHP中Action::initialize方法的典型用法代码示例。如果您正苦于以下问题:PHP Action::initialize方法的具体用法?PHP Action::initialize怎么用?PHP Action::initialize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Action
的用法示例。
在下文中一共展示了Action::initialize方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: action_index
/**
* 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: action_index
/**
* 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: action_index
/**
* 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: action_index
/**
* 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: action_index
/**
* 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: action_index
/**
* 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: action_index
/**
* 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: action_index
/**
* 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: action_index
/**
* 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: action_index
/**
* 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: action_index
/**
* 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: action_index
/**
* 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: action_index
/**
* 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: action_index
/**
* 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: action_index
/**
* 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);
}