本文整理汇总了PHP中loadJavascriptFile函数的典型用法代码示例。如果您正苦于以下问题:PHP loadJavascriptFile函数的具体用法?PHP loadJavascriptFile怎么用?PHP loadJavascriptFile使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了loadJavascriptFile函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: pmxc_InitContent
/**
* InitContent.
*/
function pmxc_InitContent()
{
global $user_info, $modSettings, $txt;
if ($this->visible) {
// show current time as realtime?
if (!empty($this->cfg['config']['settings']['show_time']) && !empty($this->cfg['config']['settings']['show_realtime'])) {
$cdate = date('Y,n-1,j,G,', Forum_Time()) . intval(date('i', Forum_Time())) . ',' . intval(date('s', Forum_Time()));
if (empty($modSettings['pmxUserLoginLoaded'])) {
addInlineJavascript('
var pmx_rtcFormat = {};');
}
if (empty($this->cfg['config']['settings']['rtc_format'])) {
addInlineJavascript('
pmx_rtcFormat[' . $this->cfg['id'] . '] = "' . (empty($user_info['time_format']) ? $modSettings['time_format'] : $user_info['time_format']) . '";');
} else {
addInlineJavascript('
pmx_rtcFormat[' . $this->cfg['id'] . '] = "' . $this->cfg['config']['settings']['rtc_format'] . '";');
}
if (empty($modSettings['pmxUserLoginLoaded'])) {
addInlineJavascript('
var pmx_rctMonths = new Array("' . implode('","', $txt['months']) . '");
var pmx_rctShortMonths = new Array("' . implode('","', $txt['months_short']) . '");
var pmx_rctDays = new Array("' . implode('","', $txt['days']) . '");
var pmx_rctShortDays = new Array("' . implode('","', $txt['days_short']) . '");
var pmx_rtcFormatTypes = new Array("%a", "%A", "%d", "%b", "%B", "%m", "%Y", "%y", "%H", "%I", "%M", "%S", "%p", "%%", "%D", "%e", "%R", "%T");
var pmx_rtcOffset = new Date(' . $cdate . ') - new Date();');
loadJavascriptFile(PortaMx_loadCompressed('PortaMxUser.js'), array('external' => true));
$modSettings['pmxUserLoginLoaded'] = true;
}
}
}
// return the visibility flag (true/false)
return $this->visible;
}
开发者ID:thunderamur,项目名称:PortaMx-Virgo-2.0-Beta-2,代码行数:37,代码来源:user_login.php
示例2: ModerationHome
/**
* This function basically is the home page of the moderation center.
*/
function ModerationHome()
{
global $txt, $context, $scripturl, $modSettings, $user_info, $user_settings;
loadTemplate('ModerationCenter');
loadJavascriptFile('admin.js', array('default_theme' => true), 'admin.js');
$context['page_title'] = $txt['moderation_center'];
$context['sub_template'] = 'moderation_center';
// Load what blocks the user actually can see...
$valid_blocks = array('n' => 'LatestNews', 'p' => 'Notes');
if ($context['can_moderate_groups']) {
$valid_blocks['g'] = 'GroupRequests';
}
if ($context['can_moderate_boards']) {
$valid_blocks['r'] = 'ReportedPosts';
$valid_blocks['w'] = 'WatchedUsers';
}
if (empty($user_settings['mod_prefs'])) {
$user_blocks = 'n' . ($context['can_moderate_boards'] ? 'wr' : '') . ($context['can_moderate_groups'] ? 'g' : '');
} else {
list(, $user_blocks) = explode('|', $user_settings['mod_prefs']);
}
$user_blocks = str_split($user_blocks);
$context['mod_blocks'] = array();
foreach ($valid_blocks as $k => $block) {
if (in_array($k, $user_blocks)) {
$block = 'ModBlock' . $block;
if (function_exists($block)) {
$context['mod_blocks'][] = $block();
}
}
}
}
开发者ID:Glyph13,项目名称:SMF2.1,代码行数:35,代码来源:ModerationCenter.php
示例3: showVerification
public function showVerification($isNew, $force_refresh = true)
{
loadTemplate('reCaptcha');
loadTemplate('VerificationControls');
loadJavascriptFile('https://www.google.com/recaptcha/api.js');
return true;
}
开发者ID:kode54,项目名称:elkarte-recaptcha,代码行数:7,代码来源:reCaptcha.class.php
示例4: load_theme
public static function load_theme()
{
global $context, $modSettings, $txt, $settings, $user_info;
if (($themes = cache_get_data('TS_themes_list', 3600)) === null) {
loadLanguage('ManageThemes');
require_once SUBSDIR . '/Themes.subs.php';
$themes = availableThemes($user_info['theme'], $user_info['id']);
cache_put_data('TS_themes_list', $themes, 3600);
}
foreach ($themes[0] as $theme_id => $theme) {
$name = $theme['name'];
$selected = !empty($user_info['theme']) && $user_info['theme'] == $theme_id;
$context['ThemeSelector'][$theme_id] = array('name' => $name, 'selected' => $selected, 'variants' => array());
if (isset($theme['variants'])) {
foreach ($theme['variants'] as $key => $variant) {
$context['ThemeSelector'][$theme_id]['variants'][$key] = array('name' => $variant['label'], 'selected' => $context['theme_variant'] == '_' . $key);
}
}
}
if (!isset($context['theme_header_callbacks'])) {
$context['theme_header_callbacks'] = array();
}
$context['theme_header_callbacks'][] = 'themeselector';
loadTemplate('ThemeSelector');
loadJavascriptFile('ThemeSelector.js');
loadCSSFile('ThemeSelector.css');
}
开发者ID:CrimeS,项目名称:ThemeSelector,代码行数:27,代码来源:ThemeSelector.integrate.php
示例5: ibb_fa_button
/**
* ibb_fa_button
*
* - Editor hook, integrate_bbc_buttons hook, Called from Editor.subs.php
* - Used to add buttons to the editor menu bar
*
* @param mixed[] $bbc_tags
*/
function ibb_fa_button(&$bbc_tags)
{
// This is the group we intend to modify
$where = $bbc_tags['row1'][2];
// And here we insert the new value after font
$bbc_tags['row1'][2] = elk_array_insert($where, 'font', array('fontawesome'), 'after', false);
// Add the javascript, this tells the editor what to do with the new button
loadJavascriptFile('faButton.plugin.js', array(), 'faButton');
// CSS specific to this button presentation in the editor toolbar
loadCSSFile('faButton.css', array(), 'fa44');
}
开发者ID:Spuds,项目名称:Elk_BBC_FontA,代码行数:19,代码来源:FaButton.subs.php
示例6: ibb_gist_button
/**
* ibb_gist_button
*
* - Editor hook, integrate_bbc_buttons hook, Called from Editor.subs.php
* - Used to add buttons to the editor menu bar
*
* @param mixed[] $bbc_tags
*/
function ibb_gist_button(&$bbc_tags)
{
global $context;
// This is the group we intend to modify
$where = $bbc_tags['row2'][0];
// And here we insert the new value after code
$bbc_tags['row2'][0] = elk_array_insert($where, 'code', array('gist'), 'after', false);
// Add the javascript, this tells the editor what to do with the new button
loadJavascriptFile('GistButton.js', array(), 'GistButton');
// We need to supply the css for the button image, here we use a data-url to save an image call
$context['html_headers'] .= '<style>.sceditor-button-gist div {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAVpJREFUeNqM0s0rRGEUx/F7x0RKxob4A6bZKBYWFkLZqIkkC7FUsrCwoCxsZcN/IFmIP4E9ZWnyurBR3krZeH8b1/dMv5vTpDue+szzzL33nJ5znieIoihIGCGmMIt0+ctSbIUETbhHEbm/EqSD5PGOC2TwgHo04xaPv9tIHhbUoPUMXjAcx4aln9BKDcYxgRR20IJNDKEO69hCFie2JnYx3sGYJcQ5jrU2PTjEDbpwpeeXWPZN3NOLnLb8hm1UoaBAG3P6btR26pt4rblDDarRs6KOMh7fmr/idZxgAW3Y0H/r/IqCfYKU5o/yB1b7kY5tGp04Uwmh++5Vcx59PoGNWtV3pznQXK2SbLf76s8kVv09yLpGRro0SwoawIgrt1fNzPtT2FVd/WjVCdiL9qQb5k8ho3Ia8eTKea50TeMd2LZOXQmfmP9PrL/K3RjURTrAmk4lMcGPAAMAEvmJGW+ZZPAAAAAASUVORK5CYII=)}</style>';
}
开发者ID:Spuds,项目名称:Elk_BBC_Gist,代码行数:20,代码来源:GistButton.subs.php
示例7: AdminMain
/**
* The main admin handling function.
* It initialises all the basic context required for the admin center.
* It passes execution onto the relevant admin section.
* If the passed section is not found it shows the admin home page.
*/
function AdminMain()
{
global $txt, $context, $scripturl, $sc, $modSettings, $user_info, $settings, $sourcedir, $options, $smcFunc, $boarddir;
// Load the language and templates....
loadLanguage('Admin');
loadTemplate('Admin', 'admin');
loadJavascriptFile('admin.js', array('default_theme' => true), 'admin.js');
// No indexing evil stuff.
$context['robot_no_index'] = true;
require_once $sourcedir . '/Subs-Menu.php';
// Some preferences.
$context['admin_preferences'] = !empty($options['admin_preferences']) ? unserialize($options['admin_preferences']) : array();
// Define all the menu structure - see Subs-Menu.php for details!
$admin_areas = array('forum' => array('title' => $txt['admin_main'], 'permission' => array('admin_forum', 'manage_permissions', 'moderate_forum', 'manage_membergroups', 'manage_bans', 'send_mail', 'edit_news', 'manage_boards', 'manage_smileys', 'manage_attachments'), 'areas' => array('index' => array('label' => $txt['admin_center'], 'function' => 'AdminHome', 'icon' => 'administration.png'), 'credits' => array('label' => $txt['support_credits_title'], 'function' => 'AdminHome', 'icon' => 'support.png'), 'news' => array('label' => $txt['news_title'], 'file' => 'ManageNews.php', 'function' => 'ManageNews', 'icon' => 'news.png', 'permission' => array('edit_news', 'send_mail', 'admin_forum'), 'subsections' => array('editnews' => array($txt['admin_edit_news'], 'edit_news'), 'mailingmembers' => array($txt['admin_newsletters'], 'send_mail'), 'settings' => array($txt['settings'], 'admin_forum'))), 'packages' => array('label' => $txt['package'], 'file' => 'Packages.php', 'function' => 'Packages', 'permission' => array('admin_forum'), 'icon' => 'packages.png', 'subsections' => array('browse' => array($txt['browse_packages']), 'packageget' => array($txt['download_packages'], 'url' => $scripturl . '?action=admin;area=packages;sa=packageget;get'), 'installed' => array($txt['installed_packages']), 'perms' => array($txt['package_file_perms']), 'options' => array($txt['package_settings']))), 'search' => array('function' => 'AdminSearch', 'permission' => array('admin_forum'), 'select' => 'index'), 'adminlogoff' => array('label' => $txt['admin_logoff'], 'function' => 'AdminEndSession', 'enabled' => empty($modSettings['securityDisable']), 'icon' => 'exit.png'))), 'config' => array('title' => $txt['admin_config'], 'permission' => array('admin_forum'), 'areas' => array('corefeatures' => array('label' => $txt['core_settings_title'], 'file' => 'ManageSettings.php', 'function' => 'ModifyCoreFeatures', 'icon' => 'corefeatures.png'), 'featuresettings' => array('label' => $txt['modSettings_title'], 'file' => 'ManageSettings.php', 'function' => 'ModifyFeatureSettings', 'icon' => 'features.png', 'subsections' => array('basic' => array($txt['mods_cat_features']), 'layout' => array($txt['mods_cat_layout']), 'karma' => array($txt['karma'], 'enabled' => in_array('k', $context['admin_features'])), 'sig' => array($txt['signature_settings_short']), 'profile' => array($txt['custom_profile_shorttitle'], 'enabled' => in_array('cp', $context['admin_features'])))), 'securitysettings' => array('label' => $txt['admin_security_moderation'], 'file' => 'ManageSettings.php', 'function' => 'ModifySecuritySettings', 'icon' => 'security.png', 'subsections' => array('general' => array($txt['mods_cat_security_general']), 'spam' => array($txt['antispam_title']), 'moderation' => array($txt['moderation_settings_short'], 'enabled' => substr($modSettings['warning_settings'], 0, 1) == 1))), 'languages' => array('label' => $txt['language_configuration'], 'file' => 'ManageLanguages.php', 'function' => 'ManageLanguages', 'icon' => 'languages.png', 'subsections' => array('edit' => array($txt['language_edit']), 'add' => array($txt['language_add']), 'settings' => array($txt['language_settings']))), 'serversettings' => array('label' => $txt['admin_server_settings'], 'file' => 'ManageServer.php', 'function' => 'ModifySettings', 'icon' => 'server.png', 'subsections' => array('general' => array($txt['general_settings']), 'database' => array($txt['database_paths_settings']), 'cookie' => array($txt['cookies_sessions_settings']), 'cache' => array($txt['caching_settings']), 'loads' => array($txt['load_balancing_settings']), 'phpinfo' => array($txt['phpinfo_settings']))), 'current_theme' => array('label' => $txt['theme_current_settings'], 'file' => 'Themes.php', 'function' => 'ThemesMain', 'custom_url' => $scripturl . '?action=admin;area=theme;sa=list;th=' . $settings['theme_id'], 'icon' => 'current_theme.png'), 'theme' => array('label' => $txt['theme_admin'], 'file' => 'Themes.php', 'function' => 'ThemesMain', 'custom_url' => $scripturl . '?action=admin;area=theme', 'icon' => 'themes.png', 'subsections' => array('admin' => array($txt['themeadmin_admin_title']), 'list' => array($txt['themeadmin_list_title']), 'reset' => array($txt['themeadmin_reset_title']), 'edit' => array($txt['themeadmin_edit_title']))), 'modsettings' => array('label' => $txt['admin_modifications'], 'file' => 'ManageSettings.php', 'function' => 'ModifyModSettings', 'icon' => 'modifications.png', 'subsections' => array('hooks' => array($txt['hooks_title_list']), 'general' => array($txt['mods_cat_modifications_misc']))))), 'layout' => array('title' => $txt['layout_controls'], 'permission' => array('manage_boards', 'admin_forum', 'manage_smileys', 'manage_attachments', 'moderate_forum'), 'areas' => array('manageboards' => array('label' => $txt['admin_boards'], 'file' => 'ManageBoards.php', 'function' => 'ManageBoards', 'icon' => 'boards.png', 'permission' => array('manage_boards'), 'subsections' => array('main' => array($txt['boardsEdit']), 'newcat' => array($txt['mboards_new_cat']), 'settings' => array($txt['settings'], 'admin_forum'))), 'postsettings' => array('label' => $txt['manageposts'], 'file' => 'ManagePosts.php', 'function' => 'ManagePostSettings', 'permission' => array('admin_forum'), 'icon' => 'posts.png', 'subsections' => array('posts' => array($txt['manageposts_settings']), 'bbc' => array($txt['manageposts_bbc_settings']), 'censor' => array($txt['admin_censored_words']), 'topics' => array($txt['manageposts_topic_settings']))), 'managedrafts' => array('label' => $txt['manage_drafts'], 'file' => 'Drafts.php', 'function' => 'ModifyDraftSettings', 'icon' => 'logs.png', 'permission' => array('admin_forum'), 'enabled' => in_array('dr', $context['admin_features'])), 'managecalendar' => array('label' => $txt['manage_calendar'], 'file' => 'ManageCalendar.php', 'function' => 'ManageCalendar', 'icon' => 'calendar.png', 'permission' => array('admin_forum'), 'enabled' => in_array('cd', $context['admin_features']), 'subsections' => array('holidays' => array($txt['manage_holidays'], 'admin_forum', 'enabled' => !empty($modSettings['cal_enabled'])), 'settings' => array($txt['calendar_settings'], 'admin_forum'))), 'managesearch' => array('label' => $txt['manage_search'], 'file' => 'ManageSearch.php', 'function' => 'ManageSearch', 'icon' => 'search.png', 'permission' => array('admin_forum'), 'subsections' => array('weights' => array($txt['search_weights']), 'method' => array($txt['search_method']), 'settings' => array($txt['settings']))), 'smileys' => array('label' => $txt['smileys_manage'], 'file' => 'ManageSmileys.php', 'function' => 'ManageSmileys', 'icon' => 'smiley.png', 'permission' => array('manage_smileys'), 'subsections' => array('editsets' => array($txt['smiley_sets']), 'addsmiley' => array($txt['smileys_add'], 'enabled' => !empty($modSettings['smiley_enable'])), 'editsmileys' => array($txt['smileys_edit'], 'enabled' => !empty($modSettings['smiley_enable'])), 'setorder' => array($txt['smileys_set_order'], 'enabled' => !empty($modSettings['smiley_enable'])), 'editicons' => array($txt['icons_edit_message_icons'], 'enabled' => !empty($modSettings['messageIcons_enable'])), 'settings' => array($txt['settings']))), 'manageattachments' => array('label' => $txt['attachments_avatars'], 'file' => 'ManageAttachments.php', 'function' => 'ManageAttachments', 'icon' => 'attachment.png', 'permission' => array('manage_attachments'), 'subsections' => array('browse' => array($txt['attachment_manager_browse']), 'attachments' => array($txt['attachment_manager_settings']), 'avatars' => array($txt['attachment_manager_avatar_settings']), 'attachpaths' => array($txt['attach_directories']), 'maintenance' => array($txt['attachment_manager_maintenance']))))), 'members' => array('title' => $txt['admin_manage_members'], 'permission' => array('moderate_forum', 'manage_membergroups', 'manage_bans', 'manage_permissions', 'admin_forum'), 'areas' => array('viewmembers' => array('label' => $txt['admin_users'], 'file' => 'ManageMembers.php', 'function' => 'ViewMembers', 'icon' => 'members.png', 'permission' => array('moderate_forum'), 'subsections' => array('all' => array($txt['view_all_members']), 'search' => array($txt['mlist_search']))), 'membergroups' => array('label' => $txt['admin_groups'], 'file' => 'ManageMembergroups.php', 'function' => 'ModifyMembergroups', 'icon' => 'membergroups.png', 'permission' => array('manage_membergroups'), 'subsections' => array('index' => array($txt['membergroups_edit_groups'], 'manage_membergroups'), 'add' => array($txt['membergroups_new_group'], 'manage_membergroups'), 'settings' => array($txt['settings'], 'admin_forum'))), 'permissions' => array('label' => $txt['edit_permissions'], 'file' => 'ManagePermissions.php', 'function' => 'ModifyPermissions', 'icon' => 'permissions.png', 'permission' => array('manage_permissions'), 'subsections' => array('index' => array($txt['permissions_groups'], 'manage_permissions'), 'board' => array($txt['permissions_boards'], 'manage_permissions'), 'profiles' => array($txt['permissions_profiles'], 'manage_permissions'), 'postmod' => array($txt['permissions_post_moderation'], 'manage_permissions', 'enabled' => $modSettings['postmod_active']), 'settings' => array($txt['settings'], 'admin_forum'))), 'regcenter' => array('label' => $txt['registration_center'], 'file' => 'ManageRegistration.php', 'function' => 'RegCenter', 'icon' => 'regcenter.png', 'permission' => array('admin_forum', 'moderate_forum'), 'subsections' => array('register' => array($txt['admin_browse_register_new'], 'moderate_forum'), 'agreement' => array($txt['registration_agreement'], 'admin_forum'), 'reservednames' => array($txt['admin_reserved_set'], 'admin_forum'), 'settings' => array($txt['settings'], 'admin_forum'))), 'ban' => array('label' => $txt['ban_title'], 'file' => 'ManageBans.php', 'function' => 'Ban', 'icon' => 'ban.png', 'permission' => 'manage_bans', 'subsections' => array('list' => array($txt['ban_edit_list']), 'add' => array($txt['ban_add_new']), 'browse' => array($txt['ban_trigger_browse']), 'log' => array($txt['ban_log']))), 'paidsubscribe' => array('label' => $txt['paid_subscriptions'], 'enabled' => in_array('ps', $context['admin_features']), 'file' => 'ManagePaid.php', 'icon' => 'paid.png', 'function' => 'ManagePaidSubscriptions', 'permission' => 'admin_forum', 'subsections' => array('view' => array($txt['paid_subs_view']), 'settings' => array($txt['settings']))), 'sengines' => array('label' => $txt['search_engines'], 'enabled' => in_array('sp', $context['admin_features']), 'file' => 'ManageSearchEngines.php', 'icon' => 'engines.png', 'function' => 'SearchEngines', 'permission' => 'admin_forum', 'subsections' => array('stats' => array($txt['spider_stats']), 'logs' => array($txt['spider_logs']), 'spiders' => array($txt['spiders']), 'settings' => array($txt['settings']))))), 'maintenance' => array('title' => $txt['admin_maintenance'], 'permission' => array('admin_forum'), 'areas' => array('maintain' => array('label' => $txt['maintain_title'], 'file' => 'ManageMaintenance.php', 'icon' => 'maintain.png', 'function' => 'ManageMaintenance', 'subsections' => array('routine' => array($txt['maintain_sub_routine'], 'admin_forum'), 'database' => array($txt['maintain_sub_database'], 'admin_forum'), 'members' => array($txt['maintain_sub_members'], 'admin_forum'), 'topics' => array($txt['maintain_sub_topics'], 'admin_forum'))), 'scheduledtasks' => array('label' => $txt['maintain_tasks'], 'file' => 'ManageScheduledTasks.php', 'icon' => 'scheduled.png', 'function' => 'ManageScheduledTasks', 'subsections' => array('tasks' => array($txt['maintain_tasks'], 'admin_forum'), 'tasklog' => array($txt['scheduled_log'], 'admin_forum'))), 'mailqueue' => array('label' => $txt['mailqueue_title'], 'file' => 'ManageMail.php', 'function' => 'ManageMail', 'icon' => 'mail.png', 'subsections' => array('browse' => array($txt['mailqueue_browse'], 'admin_forum'), 'settings' => array($txt['mailqueue_settings'], 'admin_forum'))), 'reports' => array('enabled' => in_array('rg', $context['admin_features']), 'label' => $txt['generate_reports'], 'file' => 'Reports.php', 'function' => 'ReportsMain', 'icon' => 'reports.png'), 'logs' => array('label' => $txt['logs'], 'function' => 'AdminLogs', 'icon' => 'logs.png', 'subsections' => array('errorlog' => array($txt['errlog'], 'admin_forum', 'enabled' => !empty($modSettings['enableErrorLogging']), 'url' => $scripturl . '?action=admin;area=logs;sa=errorlog;desc'), 'adminlog' => array($txt['admin_log'], 'admin_forum', 'enabled' => in_array('ml', $context['admin_features'])), 'modlog' => array($txt['moderation_log'], 'admin_forum', 'enabled' => in_array('ml', $context['admin_features'])), 'banlog' => array($txt['ban_log'], 'manage_bans'), 'spiderlog' => array($txt['spider_logs'], 'admin_forum', 'enabled' => in_array('sp', $context['admin_features'])), 'tasklog' => array($txt['scheduled_log'], 'admin_forum'), 'pruning' => array($txt['pruning_title'], 'admin_forum'))), 'repairboards' => array('label' => $txt['admin_repair'], 'file' => 'RepairBoards.php', 'function' => 'RepairBoards', 'select' => 'maintain', 'hidden' => true))));
// Any files to include for administration?
if (!empty($modSettings['integrate_admin_include'])) {
$admin_includes = explode(',', $modSettings['integrate_admin_include']);
foreach ($admin_includes as $include) {
$include = strtr(trim($include), array('$boarddir' => $boarddir, '$sourcedir' => $sourcedir, '$themedir' => $settings['theme_dir']));
if (file_exists($include)) {
require_once $include;
}
}
}
// Make sure the administrator has a valid session...
validateSession();
// Actually create the menu!
$admin_include_data = createMenu($admin_areas);
unset($admin_areas);
// Nothing valid?
if ($admin_include_data == false) {
fatal_lang_error('no_access', false);
}
// Build the link tree.
$context['linktree'][] = array('url' => $scripturl . '?action=admin', 'name' => $txt['admin_center']);
if (isset($admin_include_data['current_area']) && $admin_include_data['current_area'] != 'index') {
$context['linktree'][] = array('url' => $scripturl . '?action=admin;area=' . $admin_include_data['current_area'] . ';' . $context['session_var'] . '=' . $context['session_id'], 'name' => $admin_include_data['label']);
}
if (!empty($admin_include_data['current_subsection']) && $admin_include_data['subsections'][$admin_include_data['current_subsection']][0] != $admin_include_data['label']) {
$context['linktree'][] = array('url' => $scripturl . '?action=admin;area=' . $admin_include_data['current_area'] . ';sa=' . $admin_include_data['current_subsection'] . ';' . $context['session_var'] . '=' . $context['session_id'], 'name' => $admin_include_data['subsections'][$admin_include_data['current_subsection']][0]);
}
// Make a note of the Unique ID for this menu.
$context['admin_menu_id'] = $context['max_menu_id'];
$context['admin_menu_name'] = 'menu_data_' . $context['admin_menu_id'];
// Where in the admin are we?
$context['admin_area'] = $admin_include_data['current_area'];
// Now - finally - call the right place!
if (isset($admin_include_data['file'])) {
require_once $sourcedir . '/' . $admin_include_data['file'];
}
$admin_include_data['function']();
}
开发者ID:Glyph13,项目名称:SMF2.1,代码行数:58,代码来源:Admin.php
示例8: buildTemplate
protected static function buildTemplate($notices)
{
global $context, $user_info;
loadTemplate('DismissibleNotices');
loadLanguage('DismissibleNotices');
Template_Layers::getInstance()->addAfter('notices', 'body');
loadJavascriptFile('notify.js', array('defer' => true));
loadCSSFile('notify.css');
foreach ($notices as $key => $notice) {
$notice['body'] = str_replace('{username}', $user_info['name'], $notice['body']);
$context['notices'][$key] = $notice;
}
$context['notices'] = $notices;
}
开发者ID:emanuele45,项目名称:DismissibleNotices,代码行数:14,代码来源:DismissibleNotices.integrate.php
示例9: action_index
/**
* The main admin handling function.
*
* What it does:
* - It initialises all the basic context required for the admin center.
* - It passes execution onto the relevant admin section.
* - If the passed section is not found it shows the admin home page.
* - Accessed by ?action=admin.
*/
public function action_index()
{
global $txt, $context, $scripturl, $modSettings, $settings;
// Make sure the administrator has a valid session...
validateSession();
// Load the language and templates....
loadLanguage('Admin');
loadTemplate('Admin', 'admin');
loadJavascriptFile('admin.js', array(), 'admin_script');
// The Admin functions require Jquery UI ....
$modSettings['jquery_include_ui'] = true;
// No indexing evil stuff.
$context['robot_no_index'] = true;
// Need these to do much
require_once SUBSDIR . '/Menu.subs.php';
require_once SUBSDIR . '/Action.class.php';
// Define the menu structure - see subs/Menu.subs.php for details!
$admin_areas = array('forum' => array('title' => $txt['admin_main'], 'permission' => array('admin_forum', 'manage_permissions', 'moderate_forum', 'manage_membergroups', 'manage_bans', 'send_mail', 'edit_news', 'manage_boards', 'manage_smileys', 'manage_attachments'), 'areas' => array('index' => array('label' => $txt['admin_center'], 'controller' => 'Admin_Controller', 'function' => 'action_home', 'icon' => 'transparent.png', 'class' => 'admin_img_administration'), 'credits' => array('label' => $txt['support_credits_title'], 'controller' => 'Admin_Controller', 'function' => 'action_credits', 'icon' => 'transparent.png', 'class' => 'admin_img_support'), 'maillist' => array('label' => $txt['mail_center'], 'file' => 'ManageMaillist.controller.php', 'controller' => 'ManageMaillist_Controller', 'function' => 'action_index', 'icon' => 'mail.png', 'class' => 'admin_img_mail', 'permission' => array('approve_emails', 'admin_forum'), 'enabled' => in_array('pe', $context['admin_features']), 'subsections' => array('emaillist' => array($txt['mm_emailerror'], 'approve_emails'), 'emailfilters' => array($txt['mm_emailfilters'], 'admin_forum'), 'emailparser' => array($txt['mm_emailparsers'], 'admin_forum'), 'emailtemplates' => array($txt['mm_emailtemplates'], 'approve_emails'), 'emailsettings' => array($txt['mm_emailsettings'], 'admin_forum'))), 'news' => array('label' => $txt['news_title'], 'file' => 'ManageNews.controller.php', 'controller' => 'ManageNews_Controller', 'function' => 'action_index', 'icon' => 'transparent.png', 'class' => 'admin_img_news', 'permission' => array('edit_news', 'send_mail', 'admin_forum'), 'subsections' => array('editnews' => array($txt['admin_edit_news'], 'edit_news'), 'mailingmembers' => array($txt['admin_newsletters'], 'send_mail'), 'settings' => array($txt['settings'], 'admin_forum'))), 'packages' => array('label' => $txt['package'], 'file' => 'Packages.controller.php', 'controller' => 'Packages_Controller', 'function' => 'action_index', 'permission' => array('admin_forum'), 'icon' => 'transparent.png', 'class' => 'admin_img_packages', 'subsections' => array('browse' => array($txt['browse_packages']), 'installed' => array($txt['installed_packages']), 'perms' => array($txt['package_file_perms']), 'options' => array($txt['package_settings']), 'servers' => array($txt['download_packages']), 'upload' => array($txt['upload_packages']))), 'packageservers' => array('label' => $txt['package_servers'], 'file' => 'PackageServers.controller.php', 'controller' => 'PackageServers_Controller', 'function' => 'action_index', 'permission' => array('admin_forum'), 'icon' => 'transparent.png', 'class' => 'admin_img_packages', 'hidden' => true), 'search' => array('controller' => 'Admin_Controller', 'function' => 'action_search', 'permission' => array('admin_forum'), 'select' => 'index'), 'adminlogoff' => array('controller' => 'Admin_Controller', 'function' => 'action_endsession', 'label' => $txt['admin_logoff'], 'enabled' => empty($modSettings['securityDisable']), 'icon' => 'transparent.png', 'class' => 'admin_img_exit'))), 'config' => array('title' => $txt['admin_config'], 'permission' => array('admin_forum'), 'areas' => array('corefeatures' => array('label' => $txt['core_settings_title'], 'file' => 'CoreFeatures.controller.php', 'controller' => 'CoreFeatures_Controller', 'function' => 'action_index', 'icon' => 'transparent.png', 'class' => 'admin_img_corefeatures'), 'featuresettings' => array('label' => $txt['modSettings_title'], 'file' => 'ManageFeatures.controller.php', 'controller' => 'ManageFeatures_Controller', 'function' => 'action_index', 'icon' => 'transparent.png', 'class' => 'admin_img_features', 'subsections' => array('basic' => array($txt['mods_cat_features']), 'layout' => array($txt['mods_cat_layout']), 'pmsettings' => array($txt['personal_messages']), 'karma' => array($txt['karma'], 'enabled' => in_array('k', $context['admin_features'])), 'likes' => array($txt['likes'], 'enabled' => in_array('l', $context['admin_features'])), 'mention' => array($txt['mention']), 'sig' => array($txt['signature_settings_short']), 'profile' => array($txt['custom_profile_shorttitle'], 'enabled' => in_array('cp', $context['admin_features'])))), 'serversettings' => array('label' => $txt['admin_server_settings'], 'file' => 'ManageServer.controller.php', 'controller' => 'ManageServer_Controller', 'function' => 'action_index', 'icon' => 'transparent.png', 'class' => 'admin_img_server', 'subsections' => array('general' => array($txt['general_settings']), 'database' => array($txt['database_paths_settings']), 'cookie' => array($txt['cookies_sessions_settings']), 'cache' => array($txt['caching_settings']), 'loads' => array($txt['load_balancing_settings']), 'phpinfo' => array($txt['phpinfo_settings']))), 'securitysettings' => array('label' => $txt['admin_security_moderation'], 'file' => 'ManageSecurity.controller.php', 'controller' => 'ManageSecurity_Controller', 'function' => 'action_index', 'icon' => 'transparent.png', 'class' => 'admin_img_security', 'subsections' => array('general' => array($txt['mods_cat_security_general']), 'spam' => array($txt['antispam_title']), 'badbehavior' => array($txt['badbehavior_title']), 'moderation' => array($txt['moderation_settings_short'], 'enabled' => !empty($modSettings['warning_enable'])))), 'theme' => array('label' => $txt['theme_admin'], 'file' => 'ManageThemes.controller.php', 'controller' => 'ManageThemes_Controller', 'function' => 'action_index', 'custom_url' => $scripturl . '?action=admin;area=theme', 'icon' => 'transparent.png', 'class' => 'admin_img_themes', 'subsections' => array('admin' => array($txt['themeadmin_admin_title']), 'list' => array($txt['themeadmin_list_title']), 'reset' => array($txt['themeadmin_reset_title']), 'themelist' => array($txt['themeadmin_edit_title'], 'active' => array('edit', 'browse')), 'edit' => array($txt['themeadmin_edit_title'], 'enabled' => false), 'browse' => array($txt['themeadmin_edit_title'], 'enabled' => false))), 'current_theme' => array('label' => $txt['theme_current_settings'], 'file' => 'ManageThemes.controller.php', 'controller' => 'ManageThemes_Controller', 'function' => 'action_index', 'custom_url' => $scripturl . '?action=admin;area=theme;sa=list;th=' . $settings['theme_id'], 'icon' => 'transparent.png', 'class' => 'admin_img_current_theme'), 'languages' => array('label' => $txt['language_configuration'], 'file' => 'ManageLanguages.controller.php', 'controller' => 'ManageLanguages_Controller', 'function' => 'action_index', 'icon' => 'transparent.png', 'class' => 'admin_img_languages', 'subsections' => array('edit' => array($txt['language_edit']), 'settings' => array($txt['language_settings']))), 'addonsettings' => array('label' => $txt['admin_modifications'], 'file' => 'AddonSettings.controller.php', 'controller' => 'AddonSettings_Controller', 'function' => 'action_index', 'icon' => 'transparent.png', 'class' => 'admin_img_modifications', 'subsections' => array('general' => array($txt['mods_cat_modifications_misc']))))), 'layout' => array('title' => $txt['layout_controls'], 'permission' => array('manage_boards', 'admin_forum', 'manage_smileys', 'manage_attachments', 'moderate_forum'), 'areas' => array('manageboards' => array('label' => $txt['admin_boards'], 'file' => 'ManageBoards.controller.php', 'controller' => 'ManageBoards_Controller', 'function' => 'action_index', 'icon' => 'transparent.png', 'class' => 'admin_img_boards', 'permission' => array('manage_boards'), 'subsections' => array('main' => array($txt['boardsEdit']), 'newcat' => array($txt['mboards_new_cat']), 'settings' => array($txt['settings'], 'admin_forum'))), 'postsettings' => array('label' => $txt['manageposts'], 'file' => 'ManagePosts.controller.php', 'controller' => 'ManagePosts_Controller', 'function' => 'action_index', 'permission' => array('admin_forum'), 'icon' => 'transparent.png', 'class' => 'admin_img_posts', 'subsections' => array('posts' => array($txt['manageposts_settings']), 'bbc' => array($txt['manageposts_bbc_settings']), 'censor' => array($txt['admin_censored_words']), 'topics' => array($txt['manageposts_topic_settings']))), 'smileys' => array('label' => $txt['smileys_manage'], 'file' => 'ManageSmileys.controller.php', 'controller' => 'ManageSmileys_Controller', 'function' => 'action_index', 'icon' => 'transparent.png', 'class' => 'admin_img_smiley', 'permission' => array('manage_smileys'), 'subsections' => array('editsets' => array($txt['smiley_sets']), 'addsmiley' => array($txt['smileys_add'], 'enabled' => !empty($modSettings['smiley_enable'])), 'editsmileys' => array($txt['smileys_edit'], 'enabled' => !empty($modSettings['smiley_enable'])), 'setorder' => array($txt['smileys_set_order'], 'enabled' => !empty($modSettings['smiley_enable'])), 'editicons' => array($txt['icons_edit_message_icons'], 'enabled' => !empty($modSettings['messageIcons_enable'])), 'settings' => array($txt['settings']))), 'manageattachments' => array('label' => $txt['attachments_avatars'], 'file' => 'ManageAttachments.controller.php', 'controller' => 'ManageAttachments_Controller', 'function' => 'action_index', 'icon' => 'transparent.png', 'class' => 'admin_img_attachment', 'permission' => array('manage_attachments'), 'subsections' => array('browse' => array($txt['attachment_manager_browse']), 'attachments' => array($txt['attachment_manager_settings']), 'avatars' => array($txt['attachment_manager_avatar_settings']), 'attachpaths' => array($txt['attach_directories']), 'maintenance' => array($txt['attachment_manager_maintenance']))), 'managesearch' => array('label' => $txt['manage_search'], 'file' => 'ManageSearch.controller.php', 'controller' => 'ManageSearch_Controller', 'function' => 'action_index', 'icon' => 'transparent.png', 'class' => 'admin_img_search', 'permission' => array('admin_forum'), 'subsections' => array('weights' => array($txt['search_weights']), 'method' => array($txt['search_method']), 'managesphinx' => array($txt['search_sphinx']), 'settings' => array($txt['settings']))), 'managecalendar' => array('label' => $txt['manage_calendar'], 'file' => 'ManageCalendar.controller.php', 'controller' => 'ManageCalendar_Controller', 'function' => 'action_index', 'icon' => 'transparent.png', 'class' => 'admin_img_calendar', 'permission' => array('admin_forum'), 'enabled' => in_array('cd', $context['admin_features']), 'subsections' => array('holidays' => array($txt['manage_holidays'], 'admin_forum', 'enabled' => !empty($modSettings['cal_enabled'])), 'settings' => array($txt['calendar_settings'], 'admin_forum'))), 'managedrafts' => array('label' => $txt['manage_drafts'], 'file' => 'ManageDrafts.controller.php', 'controller' => 'ManageDrafts_Controller', 'function' => 'action_index', 'icon' => 'transparent.png', 'class' => 'admin_img_logs', 'permission' => array('admin_forum'), 'enabled' => in_array('dr', $context['admin_features'])))), 'members' => array('title' => $txt['admin_manage_members'], 'permission' => array('moderate_forum', 'manage_membergroups', 'manage_bans', 'manage_permissions', 'admin_forum'), 'areas' => array('viewmembers' => array('label' => $txt['admin_users'], 'file' => 'ManageMembers.controller.php', 'controller' => 'ManageMembers_Controller', 'function' => 'action_index', 'icon' => 'transparent.png', 'class' => 'admin_img_members', 'permission' => array('moderate_forum'), 'subsections' => array('all' => array($txt['view_all_members']), 'search' => array($txt['mlist_search']))), 'membergroups' => array('label' => $txt['admin_groups'], 'file' => 'ManageMembergroups.controller.php', 'controller' => 'ManageMembergroups_Controller', 'function' => 'action_index', 'icon' => 'transparent.png', 'class' => 'admin_img_membergroups', 'permission' => array('manage_membergroups'), 'subsections' => array('index' => array($txt['membergroups_edit_groups'], 'manage_membergroups'), 'add' => array($txt['membergroups_new_group'], 'manage_membergroups'), 'settings' => array($txt['settings'], 'admin_forum'))), 'permissions' => array('label' => $txt['edit_permissions'], 'file' => 'ManagePermissions.controller.php', 'controller' => 'ManagePermissions_Controller', 'function' => 'action_index', 'icon' => 'transparent.png', 'class' => 'admin_img_permissions', 'permission' => array('manage_permissions'), 'subsections' => array('index' => array($txt['permissions_groups'], 'manage_permissions'), 'board' => array($txt['permissions_boards'], 'manage_permissions'), 'profiles' => array($txt['permissions_profiles'], 'manage_permissions'), 'postmod' => array($txt['permissions_post_moderation'], 'manage_permissions', 'enabled' => $modSettings['postmod_active']), 'settings' => array($txt['settings'], 'admin_forum'))), 'ban' => array('label' => $txt['ban_title'], 'file' => 'ManageBans.controller.php', 'controller' => 'ManageBans_Controller', 'function' => 'action_index', 'icon' => 'transparent.png', 'class' => 'admin_img_ban', 'permission' => 'manage_bans', 'subsections' => array('list' => array($txt['ban_edit_list']), 'add' => array($txt['ban_add_new']), 'browse' => array($txt['ban_trigger_browse']), 'log' => array($txt['ban_log']))), 'regcenter' => array('label' => $txt['registration_center'], 'file' => 'ManageRegistration.controller.php', 'controller' => 'ManageRegistration_Controller', 'function' => 'action_index', 'icon' => 'transparent.png', 'class' => 'admin_img_regcenter', 'permission' => array('admin_forum', 'moderate_forum'), 'subsections' => array('register' => array($txt['admin_browse_register_new'], 'moderate_forum'), 'agreement' => array($txt['registration_agreement'], 'admin_forum'), 'reservednames' => array($txt['admin_reserved_set'], 'admin_forum'), 'settings' => array($txt['settings'], 'admin_forum'))), 'sengines' => array('label' => $txt['search_engines'], 'enabled' => in_array('sp', $context['admin_features']), 'file' => 'ManageSearchEngines.controller.php', 'controller' => 'ManageSearchEngines_Controller', 'function' => 'action_index', 'icon' => 'transparent.png', 'class' => 'admin_img_engines', 'permission' => 'admin_forum', 'subsections' => array('stats' => array($txt['spider_stats']), 'logs' => array($txt['spider_logs']), 'spiders' => array($txt['spiders']), 'settings' => array($txt['settings']))), 'paidsubscribe' => array('label' => $txt['paid_subscriptions'], 'enabled' => in_array('ps', $context['admin_features']), 'file' => 'ManagePaid.controller.php', 'controller' => 'ManagePaid_Controller', 'icon' => 'transparent.png', 'class' => 'admin_img_paid', 'function' => 'action_index', 'permission' => 'admin_forum', 'subsections' => array('view' => array($txt['paid_subs_view']), 'settings' => array($txt['settings']))))), 'maintenance' => array('title' => $txt['admin_maintenance'], 'permission' => array('admin_forum'), 'areas' => array('maintain' => array('label' => $txt['maintain_title'], 'file' => 'Maintenance.controller.php', 'controller' => 'Maintenance_Controller', 'function' => 'action_index', 'icon' => 'transparent.png', 'class' => 'admin_img_maintain', 'subsections' => array('routine' => array($txt['maintain_sub_routine'], 'admin_forum'), 'database' => array($txt['maintain_sub_database'], 'admin_forum'), 'members' => array($txt['maintain_sub_members'], 'admin_forum'), 'topics' => array($txt['maintain_sub_topics'], 'admin_forum'), 'hooks' => array($txt['maintain_sub_hooks_list'], 'admin_forum'), 'attachments' => array($txt['maintain_sub_attachments'], 'admin_forum'))), 'logs' => array('label' => $txt['logs'], 'file' => 'AdminLog.controller.php', 'controller' => 'AdminLog_Controller', 'function' => 'action_index', 'icon' => 'transparent.png', 'class' => 'admin_img_logs', 'subsections' => array('errorlog' => array($txt['errlog'], 'admin_forum', 'enabled' => !empty($modSettings['enableErrorLogging']), 'url' => $scripturl . '?action=admin;area=logs;sa=errorlog;desc'), 'adminlog' => array($txt['admin_log'], 'admin_forum', 'enabled' => in_array('ml', $context['admin_features'])), 'modlog' => array($txt['moderation_log'], 'admin_forum', 'enabled' => in_array('ml', $context['admin_features'])), 'banlog' => array($txt['ban_log'], 'manage_bans'), 'spiderlog' => array($txt['spider_logs'], 'admin_forum', 'enabled' => in_array('sp', $context['admin_features'])), 'tasklog' => array($txt['scheduled_log'], 'admin_forum'), 'badbehaviorlog' => array($txt['badbehavior_log'], 'admin_forum', 'enabled' => !empty($modSettings['badbehavior_enabled']), 'url' => $scripturl . '?action=admin;area=logs;sa=badbehaviorlog;desc'), 'pruning' => array($txt['pruning_title'], 'admin_forum'))), 'scheduledtasks' => array('label' => $txt['maintain_tasks'], 'file' => 'ManageScheduledTasks.controller.php', 'controller' => 'ManageScheduledTasks_Controller', 'function' => 'action_index', 'icon' => 'transparent.png', 'class' => 'admin_img_scheduled', 'subsections' => array('tasks' => array($txt['maintain_tasks'], 'admin_forum'), 'tasklog' => array($txt['scheduled_log'], 'admin_forum'))), 'mailqueue' => array('label' => $txt['mailqueue_title'], 'file' => 'ManageMail.controller.php', 'controller' => 'ManageMail_Controller', 'function' => 'action_index', 'icon' => 'transparent.png', 'class' => 'admin_img_mail', 'subsections' => array('browse' => array($txt['mailqueue_browse'], 'admin_forum'), 'settings' => array($txt['mailqueue_settings'], 'admin_forum'))), 'reports' => array('enabled' => in_array('rg', $context['admin_features']), 'label' => $txt['generate_reports'], 'file' => 'Reports.controller.php', 'controller' => 'Reports_Controller', 'function' => 'action_index', 'icon' => 'transparent.png', 'class' => 'admin_img_reports'), 'repairboards' => array('label' => $txt['admin_repair'], 'file' => 'RepairBoards.controller.php', 'controller' => 'RepairBoards_Controller', 'function' => 'action_repairboards', 'select' => 'maintain', 'hidden' => true))));
// Any files to include for administration?
call_integration_include_hook('integrate_admin_include');
$menuOptions = array('hook' => 'admin', 'default_include_dir' => ADMINDIR);
// Actually create the menu!
$admin_include_data = createMenu($admin_areas, $menuOptions);
unset($admin_areas);
// Nothing valid?
if ($admin_include_data == false) {
fatal_lang_error('no_access', false);
}
// Build the link tree.
$context['linktree'][] = array('url' => $scripturl . '?action=admin', 'name' => $txt['admin_center']);
if (isset($admin_include_data['current_area']) && $admin_include_data['current_area'] != 'index') {
$context['linktree'][] = array('url' => $scripturl . '?action=admin;area=' . $admin_include_data['current_area'] . ';' . $context['session_var'] . '=' . $context['session_id'], 'name' => $admin_include_data['label']);
}
if (!empty($admin_include_data['current_subsection']) && $admin_include_data['subsections'][$admin_include_data['current_subsection']][0] != $admin_include_data['label']) {
$context['linktree'][] = array('url' => $scripturl . '?action=admin;area=' . $admin_include_data['current_area'] . ';sa=' . $admin_include_data['current_subsection'] . ';' . $context['session_var'] . '=' . $context['session_id'], 'name' => $admin_include_data['subsections'][$admin_include_data['current_subsection']][0]);
}
// Make a note of the Unique ID for this menu.
$context['admin_menu_id'] = $context['max_menu_id'];
$context['admin_menu_name'] = 'menu_data_' . $context['admin_menu_id'];
// Where in the admin are we?
$context['admin_area'] = $admin_include_data['current_area'];
// Now - finally - call the right place!
if (isset($admin_include_data['file'])) {
require_once $admin_include_data['file'];
}
callMenu($admin_include_data);
}
开发者ID:scripple,项目名称:Elkarte,代码行数:56,代码来源:Admin.controller.php
示例10: pmx_eclnonemodal
/**
* System none modal ECL init
*/
function pmx_eclnonemodal()
{
global $context, $settings, $modSettings, $maintenance, $scripturl, $options, $txt;
if (!empty($modSettings['pmx_eclmodal']) && !pmx_checkECL_Cookie()) {
if (!empty($modSettings['pmxportal_disabled'])) {
loadJavascriptFile(PortaMx_loadCompressed('PortaMx.js', array('dir' => $settings['default_theme_dir'] . '/PortaMx/Scripts/', 'url' => $settings['default_theme_url'] . '/PortaMx/Scripts/')), array('external' => true));
addInlineJavascript('
var pmxIsInit = true;');
loadLanguage('PortaMx/PortaMx');
}
addInlineJavascript('
var eclOverlay = true;
function Setlang(elm){window.location.href = elm.options[elm.selectedIndex].value;}');
loadCSSFile(PortaMx_loadCompressed('pmx_ecl.css', array('dir' => $settings['default_theme_dir'] . '/PortaMx/SysCss/', 'url' => $settings['default_theme_url'] . '/PortaMx/SysCss/')), array('external' => true));
loadtemplate('PortaMx/EclMain');
$context['template_layers'][] = 'eclmain';
}
}
开发者ID:thunderamur,项目名称:PortaMx-Virgo-2.0-Beta-2,代码行数:21,代码来源:SubsCompat.php
|
请发表评论