当前位置: 首页>>代码示例>>PHP>>正文


PHP addInlineJavascript函数代码示例

本文整理汇总了PHP中addInlineJavascript函数的典型用法代码示例。如果您正苦于以下问题:PHP addInlineJavascript函数的具体用法?PHP addInlineJavascript怎么用?PHP addInlineJavascript使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了addInlineJavascript函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: template_notices_above

/**
 * @name      Dismissible Notices
 * @copyright Dismissible Notices contributors
 * @license   BSD http://opensource.org/licenses/BSD-3-Clause
 *
 * @version 0.0.1
 *
 */
function template_notices_above()
{
    global $context, $txt, $scripturl;
    echo '
	<noscript>
		<div id="notices">';
    foreach ($context['notices'] as $notice) {
        addInlineJavascript('
		setTimeout(function() {
			$' . ($notice['positioning']['element'] !== 'global' && !empty($notice['positioning']['element_name']) ? '(".' . $notice['positioning']['element_name'] . '")' : '') . '.notify({
				title: ' . JavaScriptEscape($notice['body']) . ',
				button: ' . JavaScriptEscape($txt['dismiss_notice_dismis']) . ',
				cancel: ' . JavaScriptEscape($txt['dismiss_notice_cancel']) . ',
				id: ' . JavaScriptEscape($notice['id_notice']) . '
			}, {
				style: \'default\',
				className:  ' . javaScriptEscape($notice['class']) . ',
				autoHide: ' . ($context['user']['is_guest'] ? 'true' : 'false') . ',
				position: ' . javaScriptEscape(dismissnotices_translate_positions($notice['positioning']['position'])) . ',
				clickToHide: false
			});
		}, 500);', true);
        echo '
			<div class="' . $notice['class'] . '">
				' . $notice['body'] . '<br />
				<a href="' . $scripturl . '?action=dismissnotice;url=' . urlencode($_SERVER['REQUEST_URL']) . $txt['dismiss_notice_dismis'] . '">X</a>,
			</div>';
    }
    echo '
		</div>
	</noscript>';
}
开发者ID:emanuele45,项目名称:DismissibleNotices,代码行数:40,代码来源:DismissibleNotices.template.php

示例3: urlFavicon

/**
 * Url Favicon
 *
 * @author emanuele & BurkeKnight
 * @license   BSD http://opensource.org/licenses/BSD-3-Clause
 *
 * @version 0.0.2
 */
function urlFavicon()
{
    addInlineJavascript('
		$(\'.inner .bbc_link\').each(function() {
			var url = $(this).attr(\'href\'),
				domain = url.match(/:\\/\\/(.[^/]+)/)[1],
				schema = url.match(/^(http[s]*):\\/\\//)[1];
			$(this).css({
				\'background-image\': \'url(//www.google.com/s2/favicons?domain=\' + schema + \'://\' + domain + \')\',
				\'background-repeat\': \'no-repeat\',
				\'background-position\': \'0 2px\',
				\'padding-left\': \'18px\'
			});
		})', true);
}
开发者ID:BurkeKnight,项目名称:Url-Favicon,代码行数:23,代码来源:UrlFavicon.subs.php

示例4: template_profile_above

/**
 * Template for the profile header - goes before any other profile template.
 */
function template_profile_above()
{
    global $context;
    // Prevent browssers from auto completing fields when viewing/editing other members profiles
    if (!$context['user']['is_owner']) {
        addInlineJavascript('disableAutoComplete();', true);
    }
    // If an error occurred while trying to save previously, give the user a clue!
    echo '
					', template_error_message();
    // If the profile was update successfully, let the user know this.
    if (!empty($context['profile_updated'])) {
        echo '
					<div class="successbox">
						', $context['profile_updated'], '
					</div>';
    }
}
开发者ID:kode54,项目名称:hydrogenaudio-elkarte-theme,代码行数:21,代码来源:Profile.template.php

示例5: 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

示例6: pmxc_InitContent

    /**
     * InitContent.
     */
    function pmxc_InitContent()
    {
        global $context, $user_info, $modSettings, $pmxCacheFunc;
        // if visible init the content
        if ($this->visible) {
            $cbtopic = isset($_GET['topic']) ? $_GET['topic'] : 0;
            if ($this->cfg['cache'] > 0) {
                // check the block cache
                if (($cachedata = $pmxCacheFunc['get']($this->cache_key, $this->cache_mode)) !== null) {
                    list($this->topics, $isRead, $this->boards, $this->cat_board) = $cachedata;
                    if (isset($isRead[$user_info['id']]) && array_key_exists($cbtopic, $isRead[$user_info['id']]) && empty($isRead[$user_info['id']][$cbtopic])) {
                        $isRead[$user_info['id']][$cbtopic] = 1;
                        $cachedata = array($this->topics, $isRead, $this->boards, $this->cat_board);
                        $pmxCacheFunc['put']($this->cache_key, $cachedata, $this->cache_time, $this->cache_mode);
                    }
                } else {
                    $cachedata = $this->cbt_fetchdata();
                    $pmxCacheFunc['put']($this->cache_key, $cachedata, $this->cache_time, $this->cache_mode);
                    list($this->topics, $isRead, $this->boards, $this->cat_board) = $cachedata;
                }
            } else {
                $cachedata = $this->cbt_fetchdata();
                list($this->topics, $isRead, $this->boards, $this->cat_board) = $cachedata;
            }
            unset($cachedata);
            $this->isRead = isset($isRead[$user_info['id']]) ? $isRead[$user_info['id']] : null;
            // no boards .. disable the block
            if (!empty($this->boards)) {
                if (empty($modSettings['pmxCBTNavLoaded'])) {
                    addInlineJavascript('
	var pmxCBTimages = new Array("' . $context['pmx_imageurl'] . 'minus.png", "' . $context['pmx_imageurl'] . 'plus.png");
	var pmxCBTallBoards = {};');
                    loadJavascriptFile(PortaMx_loadCompressed('PortaMxCBTNav.js'), array('external' => true));
                    $modSettings['pmxCBTNavLoaded'] = true;
                }
                addInlineJavascript('
	pmxCBTallBoards[' . $this->cfg['id'] . '] = new Array("' . implode('", "', $this->boards) . '");');
            } else {
                $this->visible = false;
            }
        }
        // return the visibility flag (true/false)
        return $this->visible;
    }
开发者ID:thunderamur,项目名称:PortaMx-Virgo-2.0-Beta-2,代码行数:47,代码来源:cbt_navigator.php

示例7: template_view_category

function template_view_category()
{
    global $context, $txt;
    echo '
	<div id="sp_view_category">
		<h3 class="category_header">
			', $context['page_title'], '
		</h3>';
    if (empty($context['articles'])) {
        echo '
			<div class="sp_content_padding">', $txt['error_sp_no_articles'], '</div>';
    }
    foreach ($context['articles'] as $article) {
        echo '
 		<div class="sp_content_padding">
			<div class="sp_article_detail">';
        if (!empty($article['author']['avatar']['image'])) {
            echo $article['author']['avatar']['image'];
        }
        echo '
				<span class="sp_article_latest">
					', sprintf(!empty($context['using_relative_time']) ? $txt['sp_posted_on_in_by'] : $txt['sp_posted_in_on_by'], $article['category']['link'], $article['date'], $article['author']['link']), '
					<br />
					', sprintf($article['view_count'] == 1 ? $txt['sp_viewed_time'] : $txt['sp_viewed_times'], $article['view_count']), ', ', sprintf($article['comment_count'] == 1 ? $txt['sp_commented_on_time'] : $txt['sp_commented_on_times'], $article['comment_count']), '
				</span>
				<h4>', $article['link'], '</h4>
			</div>
			<hr />
			<p>', $article['preview'], '<a href="', $article['href'], '">...</a></p>
			<div class="sp_article_extra">
				<a href="', $article['href'], '">', $txt['sp_read_more'], '</a> | <a href="', $article['href'], '#sp_view_comments">', $txt['sp_write_comment'], '</a>
			</div>
		</div>';
    }
    echo '
	</div>';
    // Pages as well?
    if (!empty($context['page_index'])) {
        template_pagesection();
    }
    if (!empty($context['using_relative_time'])) {
        addInlineJavascript('$(\'.sp_article_latest\').addClass(\'relative\');', true);
    }
}
开发者ID:emanuele45,项目名称:SimplePortal_ElkArte,代码行数:44,代码来源:PortalCategories.template.php

示例8: action_bbcSettings_display

    /**
     * Administration page in Posts and Topics > BBC.
     *
     * - This method handles displaying and changing which BBC tags are enabled on the forum.
     *
     * @uses Admin template, edit_bbc_settings sub-template.
     */
    public function action_bbcSettings_display()
    {
        global $context, $txt, $modSettings, $scripturl;
        // Initialize the form
        $this->_initBBCSettingsForm();
        $config_vars = $this->_bbcSettings->settings();
        // Make sure a nifty javascript will enable/disable checkboxes, according to BBC globally set or not.
        addInlineJavascript('
			toggleBBCDisabled(\'disabledBBC\', ' . (empty($modSettings['enableBBC']) ? 'true' : 'false') . ');', true);
        // We'll need this forprepare_db() and save_db()
        require_once SUBSDIR . '/SettingsForm.class.php';
        // Make sure we check the right tags!
        $modSettings['bbc_disabled_disabledBBC'] = empty($modSettings['disabledBBC']) ? array() : explode(',', $modSettings['disabledBBC']);
        // Save page
        if (isset($_GET['save'])) {
            checkSession();
            // Security: make a pass through all tags and fix them as necessary
            $bbcTags = array();
            foreach (parse_bbc(false) as $tag) {
                $bbcTags[] = $tag['tag'];
            }
            if (!isset($_POST['disabledBBC_enabledTags'])) {
                $_POST['disabledBBC_enabledTags'] = array();
            } elseif (!is_array($_POST['disabledBBC_enabledTags'])) {
                $_POST['disabledBBC_enabledTags'] = array($_POST['disabledBBC_enabledTags']);
            }
            // Work out what is actually disabled!
            $_POST['disabledBBC'] = implode(',', array_diff($bbcTags, $_POST['disabledBBC_enabledTags']));
            // Notify addons and integrations
            call_integration_hook('integrate_save_bbc_settings', array($bbcTags));
            // Save the result
            Settings_Form::save_db($config_vars);
            // And we're out of here!
            redirectexit('action=admin;area=postsettings;sa=bbc');
        }
        // Make sure the template stuff is ready now...
        $context['sub_template'] = 'show_settings';
        $context['page_title'] = $txt['manageposts_bbc_settings_title'];
        $context['post_url'] = $scripturl . '?action=admin;area=postsettings;save;sa=bbc';
        $context['settings_title'] = $txt['manageposts_bbc_settings_title'];
        Settings_Form::prepare_db($config_vars);
    }
开发者ID:KeiroD,项目名称:Elkarte,代码行数:49,代码来源:ManageBBC.controller.php

示例9: action_draftSettings_display

    /**
     * Modify any setting related to drafts.
     *
     * - Requires the admin_forum permission.
     * - Accessed from ?action=admin;area=managedrafts
     *
     * @uses Admin template, edit_topic_settings sub-template.
     */
    public function action_draftSettings_display()
    {
        global $context, $txt, $scripturl;
        isAllowedTo('admin_forum');
        loadLanguage('Drafts');
        // Initialize the form
        $this->_initDraftSettingsForm();
        $config_vars = $this->_draftSettings->settings();
        // Setup the template.
        $context['page_title'] = $txt['managedrafts_settings'];
        $context['sub_template'] = 'show_settings';
        $context[$context['admin_menu_name']]['tab_data'] = array('title' => $txt['drafts'], 'help' => '', 'description' => $txt['managedrafts_settings_description']);
        // Saving them ?
        if (isset($_GET['save'])) {
            checkSession();
            call_integration_hook('integrate_save_drafts_settings');
            // Protect them from themselves.
            $_POST['drafts_autosave_frequency'] = $_POST['drafts_autosave_frequency'] < 30 ? 30 : $_POST['drafts_autosave_frequency'];
            Settings_Form::save_db($config_vars);
            redirectexit('action=admin;area=managedrafts');
        }
        // Some javascript to enable / disable the frequency input box
        addInlineJavascript('
			var autosave = document.getElementById(\'drafts_autosave_enabled\');

			createEventListener(autosave);
			autosave.addEventListener(\'change\', toggle);
			toggle();

			function toggle()
			{
				var select_elem = document.getElementById(\'drafts_autosave_frequency\');

				select_elem.disabled = !autosave.checked;
			}', true);
        // Final settings...
        $context['post_url'] = $scripturl . '?action=admin;area=managedrafts;save';
        $context['settings_title'] = $txt['managedrafts_settings'];
        // Prepare the settings...
        Settings_Form::prepare_db($config_vars);
    }
开发者ID:KeiroD,项目名称:Elkarte,代码行数:49,代码来源:ManageDrafts.controller.php

示例10: action_list

 public function action_list()
 {
     global $txt, $context, $scripturl, $modSettings, $settings;
     loadJavascriptFile('notify.js', array('defer' => true));
     loadJavascriptFile('jquery.knob.js', array('defer' => true));
     loadCSSFile('notify.css');
     addInlineJavascript('dismissnotice_editable();', true);
     $modSettings['jquery_include_ui'] = true;
     loadCSSFile('dism/jquery.ui.theme.css');
     loadCSSFile('dism/jquery.ui.datepicker.css');
     loadCSSFile('dism/jquery.ui.d.theme.css');
     loadCSSFile('dism/jquery.ui.core.css');
     $possible_locals = array($txt['lang_locale']);
     $b = explode('_', $txt['lang_locale']);
     foreach ($b as $a) {
         $possible_locals[] = $a;
     }
     foreach ($possible_locals as $local) {
         if (file_exists($settings['default_theme_dir'] . '/scripts/datepicker-i18n/datepicker-' . $local . '.js')) {
             loadJavascriptFile('datepicker-i18n/datepicker-' . $local . '.js', array('defer' => true));
             break;
             $context['datepicker_local'] = $local;
         }
     }
     $list_options = array('id' => 'list_dismissible_notices', 'title' => $txt['dismissnotices_title_list'], 'items_per_page' => 20, 'base_href' => $scripturl . '?action=admin;area=dismissnotice;sa=list' . $context['session_var'] . '=' . $context['session_id'], 'default_sort_col' => 'timeadded', 'get_items' => array('function' => array($this, 'getItems')), 'get_count' => array('function' => array($this, 'countItems')), 'data_check' => array('class' => function ($rowData) {
         return 'editable_' . $rowData['id_notice'];
     }), 'no_items_label' => $txt['hooks_no_hooks'], 'columns' => array('timeadded' => array('header' => array('value' => $txt['dismissnotices_time_added']), 'data' => array('function' => function ($rowData) {
         return standardTime($rowData['added']);
     }), 'sort' => array('default' => 'added', 'reverse' => 'added DESC')), 'body' => array('header' => array('value' => $txt['dismissnotices_body']), 'data' => array('db' => 'body')), 'class' => array('header' => array('value' => $txt['dismissnotices_class']), 'data' => array('db_htmlsafe' => 'class'), 'sort' => array('default' => 'class', 'reverse' => 'class DESC')), 'expire' => array('header' => array('value' => $txt['dismissnotices_expire']), 'data' => array('function' => function ($rowData) {
         return Dismissible_Notices_Integrate::formatExpireCol($rowData['expire']);
     }), 'sort' => array('default' => 'expire', 'reverse' => 'expire DESC')), 'edit' => array('header' => array('value' => ''), 'data' => array('function' => function ($rowData) {
         global $txt;
         return '<a data-idnotice="' . $rowData['id_notice'] . '" class="dismissnotice_editable" href="#">' . $txt['modify'] . '</a>';
     }))), 'additional_rows' => array(array('position' => 'bottom_of_list', 'value' => '<a id="dismissnotice_new" class="floatright linkbutton" href="#">' . $txt['new'] . '</a>')));
     require_once SUBSDIR . '/GenericList.class.php';
     createList($list_options);
 }
开发者ID:emanuele45,项目名称:DismissibleNotices,代码行数:37,代码来源:ManageDismissnotice.controller.php

示例11: template_settings

/**
 * Set the theme settings for display and edit in admin panel.
 */
function template_settings()
{
    global $context, $txt;
    $context['theme_settings'] = array(array('id' => 'header_logo_url', 'label' => $txt['header_logo_url'], 'description' => $txt['header_logo_url_desc'], 'type' => 'text'), array('id' => 'site_slogan', 'label' => $txt['site_slogan'], 'description' => $txt['site_slogan_desc'], 'type' => 'text'), array('id' => 'custom_favicon', 'label' => $txt['custom_favicon'], 'description' => $txt['custom_favicon_desc'], 'type' => 'text'), array('id' => 'custom_copyright', 'label' => $txt['custom_copyright'], 'description' => $txt['custom_copyright_desc'], 'type' => 'text'), '', array('id' => 'smiley_sets_default', 'label' => $txt['smileys_default_set_for_theme'], 'options' => $context['smiley_sets'], 'type' => 'text'), array('id' => 'forum_width', 'label' => $txt['forum_width'], 'description' => $txt['forum_width_desc'], 'type' => 'text', 'size' => 8), '', array('id' => 'linktree_link', 'label' => $txt['current_pos_text_img']), array('id' => 'show_mark_read', 'label' => $txt['enable_mark_as_read']), array('id' => 'enable_news', 'label' => $txt['enable_news'], 'options' => array(0 => $txt['enable_news_off'], 1 => $txt['enable_news_random'], 2 => $txt['enable_news_fader']), 'type' => 'number', 'description' => array('main' => '', 'options' => array(0 => array('enable_news_off_name', 'enable_news_off_desc'), 1 => array('enable_news_random_name', 'enable_news_random_desc'), 2 => array('enable_news_fader_name', 'enable_news_fader_desc')))), array('id' => 'newsfader_time', 'label' => $txt['admin_fader_delay'], 'type' => 'number'), '', array('id' => 'number_recent_posts', 'label' => $txt['number_recent_posts'], 'description' => $txt['number_recent_posts_desc'], 'type' => 'number'), array('id' => 'show_stats_index', 'label' => $txt['show_stats_index']), array('id' => 'show_latest_member', 'label' => $txt['latest_members']), array('id' => 'show_group_key', 'label' => $txt['show_group_key']), array('id' => 'display_who_viewing', 'label' => $txt['who_display_viewing'], 'options' => array(0 => $txt['who_display_viewing_off'], 1 => $txt['who_display_viewing_numbers'], 2 => $txt['who_display_viewing_names']), 'type' => 'number'), '', array('id' => 'show_modify', 'label' => $txt['last_modification']), array('id' => 'show_profile_buttons', 'label' => $txt['show_view_profile_button']), array('id' => 'show_user_images', 'label' => $txt['user_avatars']), array('id' => 'show_blurb', 'label' => $txt['user_text']), array('id' => 'show_gender', 'label' => $txt['gender_images']), array('id' => 'hide_post_group', 'label' => $txt['hide_post_group'], 'description' => $txt['hide_post_group_desc']), '', array('id' => 'show_bbc', 'label' => $txt['admin_bbc']), array('id' => 'additional_options_collapsible', 'label' => $txt['additional_options_collapsible']), '', array('id' => 'facebook_id', 'label' => $txt['facebook_id'], 'description' => $txt['url_desc'], 'type' => 'text'), array('id' => 'googleplus_id', 'label' => $txt['googleplus_id'], 'description' => $txt['url_desc'], 'type' => 'text'), array('id' => 'github_id', 'label' => $txt['github_id'], 'description' => $txt['url_desc'], 'type' => 'text'), array('id' => 'steam_id', 'label' => $txt['steam_id'], 'description' => $txt['url_desc'], 'type' => 'text'), array('id' => 'linkedin_id', 'label' => $txt['linkedin_id'], 'description' => $txt['url_desc'], 'type' => 'text'), array('id' => 'pinterest_id', 'label' => $txt['pinterest_id'], 'description' => $txt['url_desc'], 'type' => 'text'), array('id' => 'twitter_id', 'label' => $txt['twitter_id'], 'description' => $txt['url_desc'], 'type' => 'text'), array('id' => 'youtube_id', 'label' => $txt['youtube_id'], 'description' => $txt['url_desc'], 'type' => 'text'));
    addInlineJavascript('
		// Hide the option first
		$("#dt_newsfader_time, #dd_newsfader_time").hide();

		// Update visablity based on the select value
		toggleNewsFaderTime($("#enable_news").val());

		// Set up the onchange event
		$("#enable_news").on("change", function() {
			toggleNewsFaderTime($(this).val());
		});

		function toggleNewsFaderTime(val)
		{
			if (val == 2)
				$("#dt_newsfader_time, #dd_newsfader_time").fadeIn();
			else
				$("#dt_newsfader_time, #dd_newsfader_time").fadeOut();
		}', true);
}
开发者ID:BurkeKnight-Enterprises,项目名称:BKE-Blue-Elk-Theme,代码行数:27,代码来源:Settings.template.php

示例12: template_pages_edit


//.........这里部分代码省略.........
					</dt>
					<dd>
						<select name="permissions" id="page_permissions">';
    foreach ($context['SPortal']['page']['permission_profiles'] as $profile) {
        echo '
							<option value="', $profile['id'], '"', $profile['id'] == $context['SPortal']['page']['permissions'] ? ' selected="selected"' : '', '>', $profile['label'], '</option>';
    }
    echo '
						</select>
					</dd>
					<dt>
						<label for="page_blocks">', $txt['sp_admin_pages_col_blocks'], ':</label>
					</dt>
					<dd>
						<select name="blocks[]" id="page_blocks" size="7" multiple="multiple">';
    foreach ($context['sides'] as $side => $label) {
        if (empty($context['page_blocks'][$side])) {
            continue;
        }
        echo '
							<optgroup label="', $label, '">';
        foreach ($context['page_blocks'][$side] as $block) {
            echo '
								<option value="', $block['id'], '"', $block['shown'] ? ' selected="selected"' : '', '>', $block['label'], '</option>';
        }
        echo '
							</optgroup>';
    }
    echo '
						</select>
					</dd>
					<dt>
						<label for="page_status">', $txt['sp_admin_pages_col_status'], ':</label>
					</dt>
					<dd>
						<input type="checkbox" name="status" id="page_status" value="1"', $context['SPortal']['page']['status'] ? ' checked="checked"' : '', ' class="input_check" />
					</dd>
					<dt>
						', $txt['sp_admin_pages_col_body'], ':
					</dt>
					<dd>
					</dd>
				</dl>
				<div>', template_control_richedit($context['post_box_name'], 'smileyBox_message', 'bbcBox_message'), '</div>
				<input type="submit" name="submit" value="', $context['page_title'], '" class="right_submit" />
				<input type="submit" name="preview" value="', $txt['sp_admin_pages_preview'], '" class="right_submit" />
				<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
			</div>';
    $style_sections = array('title' => 'left', 'body' => 'right');
    $style_types = array('default' => 'DefaultClass', 'class' => 'CustomClass', 'style' => 'CustomStyle');
    $style_parameters = array('title' => array('category_header', 'secondary_header'), 'body' => array('content', 'information', 'roundframe'));
    echo '
			<br />
			<h3 class="category_header">
				', $txt['sp_admin_pages_style'], '
			</h3>
			<div class="sp_content_padding">';
    foreach ($style_sections as $section => $float) {
        echo '
				<dl id="sp_edit_style_', $section, '" class="sp_form sp_float_', $float, '">';
        foreach ($style_types as $type => $label) {
            echo '
					<dt>
						', $txt['sp-blocks' . ucfirst($section) . $label], ':
					</dt>
					<dd>';
            if ($type == 'default') {
                echo '
						<select name="', $section, '_default_class" id="', $section, '_default_class">';
                foreach ($style_parameters[$section] as $class) {
                    echo '
							<option value="', $class, '"', $context['SPortal']['page']['style'][$section . '_default_class'] == $class ? ' selected="selected"' : '', '>', $class, '</option>';
                }
                echo '
						</select>';
            } else {
                echo '
						<input type="text" name="', $section, '_custom_', $type, '" id="', $section, '_custom_', $type, '" value="', $context['SPortal']['page']['style'][$section . '_custom_' . $type], '" class="input_text" />';
            }
            echo '
					</dd>';
        }
        echo '
					<dt>
						', $txt['sp-blocksNo' . ucfirst($section)], ':
					</dt>
					<dd>
						<input type="checkbox" name="no_', $section, '" id="no_', $section, '" value="1"', !empty($context['SPortal']['page']['style']['no_' . $section]) ? ' checked="checked"' : '', ' onclick="check_style_options();" class="input_check" />
					</dd>
				</dl>';
    }
    echo '
				<input type="submit" name="submit" value="', $context['page_title'], '" class="right_submit" />
				<input type="submit" name="preview" value="', $txt['sp_admin_pages_preview'], '" class="right_submit" />
			</div>
			<input type="hidden" name="page_id" value="', $context['SPortal']['page']['id'], '" />
		</form>
	</div>';
    addInlineJavascript('sp_editor_change_type("page_type");', true);
}
开发者ID:emanuele45,项目名称:SimplePortal_ElkArte,代码行数:101,代码来源:PortalAdminPages.template.php

示例13: create_control_richedit


//.........这里部分代码省略.........
                }
                // If the row is not empty, and the last added tag is not a space, add a space.
                if (!empty($tagsRow) && $tagsRow[count($tagsRow) - 1] != 'space') {
                    $tagsRow[] = 'space';
                }
            }
            // Build that beautiful button row
            if (!empty($tagsRow)) {
                $context['bbc_toolbar'][$row][] = implode(',', $tagsRow);
            }
        }
    }
    // Initialize smiley array... if not loaded before.
    if (empty($context['smileys']) && empty($editorOptions['disable_smiley_box'])) {
        $context['smileys'] = array('postform' => array(), 'popup' => array());
        // Load smileys - don't bother to run a query if we're not using the database's ones anyhow.
        if (empty($modSettings['smiley_enable']) && $user_info['smiley_set'] != 'none') {
            $context['smileys']['postform'][] = array('smileys' => array(array('code' => ':)', 'filename' => 'smiley.gif', 'description' => $txt['icon_smiley']), array('code' => ';)', 'filename' => 'wink.gif', 'description' => $txt['icon_wink']), array('code' => ':D', 'filename' => 'cheesy.gif', 'description' => $txt['icon_cheesy']), array('code' => ';D', 'filename' => 'grin.gif', 'description' => $txt['icon_grin']), array('code' => '>:(', 'filename' => 'angry.gif', 'description' => $txt['icon_angry']), array('code' => ':))', 'filename' => 'laugh.gif', 'description' => $txt['icon_laugh']), array('code' => ':(', 'filename' => 'sad.gif', 'description' => $txt['icon_sad']), array('code' => ':o', 'filename' => 'shocked.gif', 'description' => $txt['icon_shocked']), array('code' => '8)', 'filename' => 'cool.gif', 'description' => $txt['icon_cool']), array('code' => '???', 'filename' => 'huh.gif', 'description' => $txt['icon_huh']), array('code' => '::)', 'filename' => 'rolleyes.gif', 'description' => $txt['icon_rolleyes']), array('code' => ':P', 'filename' => 'tongue.gif', 'description' => $txt['icon_tongue']), array('code' => ':-[', 'filename' => 'embarrassed.gif', 'description' => $txt['icon_embarrassed']), array('code' => ':-X', 'filename' => 'lipsrsealed.gif', 'description' => $txt['icon_lips']), array('code' => ':-\\', 'filename' => 'undecided.gif', 'description' => $txt['icon_undecided']), array('code' => ':-*', 'filename' => 'kiss.gif', 'description' => $txt['icon_kiss']), array('code' => 'O:)', 'filename' => 'angel.gif', 'description' => $txt['icon_angel']), array('code' => ':\'(', 'filename' => 'cry.gif', 'description' => $txt['icon_cry'], 'isLast' => true)), 'isLast' => true);
        } elseif ($user_info['smiley_set'] != 'none') {
            if (($temp = cache_get_data('posting_smileys', 480)) == null) {
                $request = $db->query('', '
					SELECT code, filename, description, smiley_row, hidden
					FROM {db_prefix}smileys
					WHERE hidden IN (0, 2)
					ORDER BY smiley_row, smiley_order', array());
                while ($row = $db->fetch_assoc($request)) {
                    $row['filename'] = htmlspecialchars($row['filename'], ENT_COMPAT, 'UTF-8');
                    $row['description'] = htmlspecialchars($row['description'], ENT_COMPAT, 'UTF-8');
                    $context['smileys'][empty($row['hidden']) ? 'postform' : 'popup'][$row['smiley_row']]['smileys'][] = $row;
                }
                $db->free_result($request);
                foreach ($context['smileys'] as $section => $smileyRows) {
                    $last_row = null;
                    foreach ($smileyRows as $rowIndex => $smileys) {
                        $context['smileys'][$section][$rowIndex]['smileys'][count($smileys['smileys']) - 1]['isLast'] = true;
                        $last_row = $rowIndex;
                    }
                    if ($last_row !== null) {
                        $context['smileys'][$section][$last_row]['isLast'] = true;
                    }
                }
                cache_put_data('posting_smileys', $context['smileys'], 480);
            } else {
                $context['smileys'] = $temp;
            }
            // The smiley popup may take advantage of Jquery UI ....
            if (!empty($context['smileys']['popup'])) {
                $modSettings['jquery_include_ui'] = true;
            }
        }
    }
    // Set a flag so the sub template knows what to do...
    $context['show_bbc'] = !empty($modSettings['enableBBC']) && !empty($settings['show_bbc']);
    // Switch the URLs back... now we're back to whatever the main sub template is.  (like folder in PersonalMessage.)
    if (isset($settings['use_default_images']) && $settings['use_default_images'] == 'defaults' && isset($settings['default_template'])) {
        $settings['theme_url'] = $temp1;
        $settings['images_url'] = $temp2;
        $settings['theme_dir'] = $temp3;
    }
    if (!empty($editorOptions['live_errors'])) {
        loadLanguage('Errors');
        addInlineJavascript('
	error_txts[\'no_subject\'] = ' . JavaScriptEscape($txt['error_no_subject']) . ';
	error_txts[\'no_message\'] = ' . JavaScriptEscape($txt['error_no_message']) . ';

	var subject_err = new errorbox_handler({
		self: \'subject_err\',
		error_box_id: \'post_error\',
		error_checks: [{
			code: \'no_subject\',
			efunction: function(box_value) {
				if (box_value.length === 0)
					return true;
				else
					return false;
			}
		}],
		check_id: "post_subject"
	});

	var body_err_' . $editorOptions['id'] . ' = new errorbox_handler({
		self: \'body_err_' . $editorOptions['id'] . '\',
		error_box_id: \'post_error\',
		error_checks: [{
			code: \'no_message\',
			efunction: function(box_value) {
				if (box_value.length === 0)
					return true;
				else
					return false;
			}
		}],
		editor_id: \'' . $editorOptions['id'] . '\',
		editor: ' . JavaScriptEscape('
		(function () {
			return $editor_data[\'' . $editorOptions['id'] . '\'].val();
		});') . '
	});', true);
    }
}
开发者ID:scripple,项目名称:Elkarte,代码行数:101,代码来源:Editor.subs.php

示例14: settings

    /**
     * Configuration settings for the admin template
     *
     * @return string
     */
    public function settings()
    {
        global $txt, $scripturl, $modSettings;
        // Generate a sample registration image.
        $verification_image = $scripturl . '?action=verificationcode;rand=' . md5(mt_rand());
        // Visual verification.
        $config_vars = array(array('title', 'configure_verification_means'), array('desc', 'configure_verification_means_desc'), array('int', 'visual_verification_num_chars'), 'vv' => array('select', 'visual_verification_type', array($txt['setting_image_verification_off'], $txt['setting_image_verification_vsimple'], $txt['setting_image_verification_simple'], $txt['setting_image_verification_medium'], $txt['setting_image_verification_high'], $txt['setting_image_verification_extreme']), 'subtext' => $txt['setting_visual_verification_type_desc']));
        // Save it
        if (isset($_GET['save'])) {
            if (isset($_POST['visual_verification_num_chars']) && $_POST['visual_verification_num_chars'] < 6) {
                $_POST['visual_verification_num_chars'] = 5;
            }
        }
        $_SESSION['visual_verification_code'] = '';
        for ($i = 0; $i < $this->_num_chars; $i++) {
            $_SESSION['visual_verification_code'] .= $this->_standard_captcha_range[array_rand($this->_standard_captcha_range)];
        }
        // Some javascript for CAPTCHA.
        if ($this->_use_graphic_library) {
            loadJavascriptFile('jquery.captcha.js');
            addInlineJavascript('
		$(\'#visual_verification_type\').Elk_Captcha({
			\'imageURL\': ' . JavaScriptEscape($verification_image) . ',
			\'useLibrary\': true,
			\'letterCount\': ' . $this->_num_chars . ',
			\'refreshevent\': \'change\',
			\'admin\': true
		});', true);
        }
        // Show the image itself, or text saying we can't.
        if ($this->_use_graphic_library) {
            $config_vars['vv']['postinput'] = '<br /><img src="' . $verification_image . ';type=' . (empty($modSettings['visual_verification_type']) ? 0 : $modSettings['visual_verification_type']) . '" alt="' . $txt['setting_image_verification_sample'] . '" id="verification_image" /><br />';
        } else {
            $config_vars['vv']['postinput'] = '<br /><span class="smalltext">' . $txt['setting_image_verification_nogd'] . '</span>';
        }
        return $config_vars;
    }
开发者ID:KeiroD,项目名称:Elkarte,代码行数:42,代码来源:VerificationControls.class.php

示例15: template_pick_boards

/**
 * A template that displays a list of boards subdivided by categories, with
 * a checkbox to allow select them, toggle selection on the category title
 *
 * @param string $form_name The name of the form that contains the list
 * @param string $input_names Name that should be assigned to the inputs
 * @param bool $select_all if true the a "select all" option is shown
 */
function template_pick_boards($form_name, $input_names = 'brd', $select_all = true)
{
    global $context, $txt;
    if ($select_all) {
        echo '
						<h3 class="secondary_header">
							<span id="category_toggle">&nbsp;
								<span id="advanced_panel_toggle" class="', $context['boards_check_all'] ? 'expand' : 'collapse', '" style="display: none;" title="', $txt['hide'], '"></span>
							</span>
							<a href="#" id="advanced_panel_link">', $txt['choose_board'], '</a>
						</h3>
						<div id="advanced_panel_div"', $context['boards_check_all'] ? ' style="display: none;"' : '', '>';
    }
    // Make two nice columns of boards, link each category header to toggle select all boards in each
    $group_cats = optimizeBoardsSubdivision($context['boards_in_category'], $context['num_boards']);
    foreach ($group_cats as $groups) {
        echo '
							<ul class="ignoreboards floatleft">';
        foreach ($groups as $cat_id) {
            $category = $context['categories'][$cat_id];
            echo '
								<li class="category">
									<a href="javascript:void(0);" onclick="selectBoards([', implode(', ', $category['child_ids']), '], \'', $form_name, '\', \'', $input_names, '\'); return false;">', $category['name'], '</a>
									<ul>';
            foreach ($category['boards'] as $board) {
                echo '
										<li class="board" style="margin-', $context['right_to_left'] ? 'right' : 'left', ': ', $board['child_level'], 'em;">
											<label for="', $input_names, $board['id'], '">
												<input type="checkbox" id="', $input_names, $board['id'], '" name="', $input_names, '[', $board['id'], ']" value="', $board['id'], '"', $board['selected'] ? ' checked="checked"' : '', ' class="input_check" /> ', $board['name'], '
											</label>
										</li>';
            }
            echo '
									</ul>
								</li>';
        }
        echo '
							</ul>';
    }
    // Provide an easy way to select all boards
    if ($select_all) {
        echo '
						</div>
						<div class="submitbutton">
							<span class="floatleft">
								<input type="checkbox" name="all" id="check_all" value=""', $context['boards_check_all'] ? ' checked="checked"' : '', ' onclick="invertAll(this, this.form, \'', $input_names, '\');" class="input_check" />
								<label for="check_all">
									<em> ', $txt['check_all'], '</em>
								</label>
							</span>
						</div>';
        // And now all the JS to make this work
        addInlineJavascript('
		// Some javascript for the advanced board select toggling
		var oAdvancedPanelToggle = new elk_Toggle({
			bToggleEnabled: true,
			bCurrentlyCollapsed: ' . ($context['boards_check_all'] ? 'true' : 'false') . ',
			aSwappableContainers: [
				\'advanced_panel_div\'
			],
			aSwapClasses: [
				{
					sId: \'advanced_panel_toggle\',
					classExpanded: \'collapse\',
					titleExpanded: ' . JavaScriptEscape($txt['hide']) . ',
					classCollapsed: \'expand\',
					titleCollapsed: ' . JavaScriptEscape($txt['show']) . '
				}
			],
			aSwapLinks: [
				{
					sId: \'advanced_panel_link\',
					msgExpanded: ' . JavaScriptEscape($txt['choose_board']) . ',
					msgCollapsed: ' . JavaScriptEscape($txt['choose_board']) . '
				}
			],
		});', true);
    }
}
开发者ID:Fironet,项目名称:hydrogenaudio-elkarte-theme,代码行数:87,代码来源:GenericBoards.template.php


注:本文中的addInlineJavascript函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。