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


PHP JavaScriptEscape函数代码示例

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


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

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

示例2: action_sportal_admin_permission_profiles_list

    /**
     * Show page listing of all permission groups in the system
     */
    public function action_sportal_admin_permission_profiles_list()
    {
        global $context, $scripturl, $txt, $modSettings;
        // Removing some permission profiles?
        if (!empty($_POST['remove_profiles']) && !empty($_POST['remove']) && is_array($_POST['remove'])) {
            checkSession();
            $remove = array();
            foreach ($_POST['remove'] as $index => $profile_id) {
                $remove[(int) $index] = (int) $profile_id;
            }
            sp_delete_profiles($remove);
        }
        // Build the listoption array to display the permission profiles
        $listOptions = array('id' => 'portal_permisssions', 'title' => $txt['sp_admin_permission_profiles_list'], 'items_per_page' => $modSettings['defaultMaxMessages'], 'no_items_label' => $txt['error_sp_no_articles'], 'base_href' => $scripturl . '?action=admin;area=portalprofiles;sa=listpermission;', 'default_sort_col' => 'name', 'get_items' => array('function' => array($this, 'list_spLoadProfiles')), 'get_count' => array('function' => array($this, 'list_spCountProfiles')), 'columns' => array('name' => array('header' => array('value' => $txt['sp_admin_profiles_col_name']), 'data' => array('db' => 'label'), 'sort' => array('default' => 'name', 'reverse' => 'name DESC')), 'articles' => array('header' => array('value' => $txt['sp_admin_profiles_col_articles'], 'class' => 'centertext'), 'data' => array('function' => create_function('$row', '
							return empty($row[\'articles\']) ? \'0\' : $row[\'articles\'];
						'), 'class' => 'centertext')), 'blocks' => array('header' => array('value' => $txt['sp_admin_profiles_col_blocks'], 'class' => 'centertext'), 'data' => array('function' => create_function('$row', '
							return empty($row[\'blocks\']) ? \'0\' : $row[\'blocks\'];
						'), 'class' => 'centertext')), 'categories' => array('header' => array('value' => $txt['sp_admin_profiles_col_categories'], 'class' => 'centertext'), 'data' => array('function' => create_function('$row', '
							return empty($row[\'categories\']) ? \'0\' : $row[\'categories\'];
						'), 'class' => 'centertext')), 'pages' => array('header' => array('value' => $txt['sp_admin_profiles_col_pages'], 'class' => 'centertext'), 'data' => array('function' => create_function('$row', '
							return empty($row[\'pages\']) ? \'0\' : $row[\'pages\'];
						'), 'class' => 'centertext')), 'shoutboxes' => array('header' => array('value' => $txt['sp_admin_profiles_col_shoutboxes'], 'class' => 'centertext'), 'data' => array('function' => create_function('$row', '
							return empty($row[\'shoutboxes\']) ? \'0\' : $row[\'shoutboxes\'];
						'), 'class' => 'centertext')), 'action' => array('header' => array('value' => $txt['sp_admin_articles_col_actions'], 'class' => 'centertext'), 'data' => array('sprintf' => array('format' => '<a href="?action=admin;area=portalprofiles;sa=editpermission;profile_id=%1$s;' . $context['session_var'] . '=' . $context['session_id'] . '" accesskey="e">' . sp_embed_image('modify') . '</a>&nbsp;
								<a href="?action=admin;area=portalprofiles;sa=deletepermission;profile_id=%1$s;' . $context['session_var'] . '=' . $context['session_id'] . '" onclick="return confirm(' . JavaScriptEscape($txt['sp_admin_articles_delete_confirm']) . ') && submitThisOnce(this);" accesskey="d">' . sp_embed_image('delete') . '</a>', 'params' => array('id' => true)), 'class' => 'centertext', 'style' => "width: 40px")), 'check' => array('header' => array('value' => '<input type="checkbox" onclick="invertAll(this, this.form);" class="input_check" />', 'class' => 'centertext'), 'data' => array('function' => create_function('$row', '
							return \'<input type="checkbox" name="remove[]" value="\' . $row[\'id\'] . \'" class="input_check" />\';
						'), 'class' => 'centertext'))), 'form' => array('href' => $scripturl . '?action=admin;area=portalprofiles;sa=listpermission', 'include_sort' => true, 'include_start' => true, 'hidden_fields' => array($context['session_var'] => $context['session_id'])));
        // Set the context values
        $context['page_title'] = $txt['sp_admin_permission_profiles_list'];
        $context['sub_template'] = 'show_list';
        $context['default_list'] = 'portal_permisssions';
        // Create the list.
        require_once SUBSDIR . '/GenericList.class.php';
        createList($listOptions);
    }
开发者ID:emanuele45,项目名称:SimplePortal_ElkArte,代码行数:38,代码来源:PortalAdminProfiles.controller.php

示例3: action_sportal_admin_article_list

    /**
     * Show a listing of articles in the system
     */
    public function action_sportal_admin_article_list()
    {
        global $context, $scripturl, $txt, $modSettings;
        // Build the listoption array to display the categories
        $listOptions = array('id' => 'portal_articles', 'title' => $txt['sp_admin_articles_list'], 'items_per_page' => $modSettings['defaultMaxMessages'], 'no_items_label' => $txt['error_sp_no_articles'], 'base_href' => $scripturl . '?action=admin;area=portalarticles;sa=list;', 'default_sort_col' => 'title', 'get_items' => array('function' => array($this, 'list_spLoadArticles')), 'get_count' => array('function' => array($this, 'list_spCountArticles')), 'columns' => array('title' => array('header' => array('value' => $txt['sp_admin_articles_col_title']), 'data' => array('db' => 'title'), 'sort' => array('default' => 'title', 'reverse' => 'title DESC')), 'namespace' => array('header' => array('value' => $txt['sp_admin_articles_col_namespace']), 'data' => array('db' => 'article_id'), 'sort' => array('default' => 'article_namespace', 'reverse' => 'article_namespace DESC')), 'category' => array('header' => array('value' => $txt['sp_admin_articles_col_category']), 'data' => array('db' => 'category_name'), 'sort' => array('default' => 'name', 'reverse' => 'name DESC')), 'author' => array('header' => array('value' => $txt['sp_admin_articles_col_author']), 'data' => array('db' => 'author_name'), 'sort' => array('default' => 'author_name', 'reverse' => 'author_name DESC')), 'type' => array('header' => array('value' => $txt['sp_admin_articles_col_type']), 'data' => array('db' => 'type'), 'sort' => array('default' => 'type', 'reverse' => 'type DESC')), 'date' => array('header' => array('value' => $txt['sp_admin_articles_col_date']), 'data' => array('db' => 'date'), 'sort' => array('default' => 'date', 'reverse' => 'date DESC')), 'status' => array('header' => array('value' => $txt['sp_admin_articles_col_status'], 'class' => 'centertext'), 'data' => array('db' => 'status_image', 'class' => 'centertext'), 'sort' => array('default' => 'status', 'reverse' => 'status DESC')), 'action' => array('header' => array('value' => $txt['sp_admin_articles_col_actions'], 'class' => 'centertext'), 'data' => array('sprintf' => array('format' => '<a href="?action=admin;area=portalarticles;sa=edit;article_id=%1$s;' . $context['session_var'] . '=' . $context['session_id'] . '" accesskey="e">' . sp_embed_image('modify') . '</a>&nbsp;
								<a href="?action=admin;area=portalarticles;sa=delete;article_id=%1$s;' . $context['session_var'] . '=' . $context['session_id'] . '" onclick="return confirm(' . JavaScriptEscape($txt['sp_admin_articles_delete_confirm']) . ') && submitThisOnce(this);" accesskey="d">' . sp_embed_image('delete') . '</a>', 'params' => array('id' => true)), 'class' => 'centertext nowrap')), 'check' => array('header' => array('value' => '<input type="checkbox" onclick="invertAll(this, this.form);" class="input_check" />', 'class' => 'centertext'), 'data' => array('function' => create_function('$row', '
							return \'<input type="checkbox" name="remove[]" value="\' . $row[\'id\'] . \'" class="input_check" />\';
						'), 'class' => 'centertext'))), 'form' => array('href' => $scripturl . '?action=admin;area=portalarticles;sa=remove', 'include_sort' => true, 'include_start' => true, 'hidden_fields' => array($context['session_var'] => $context['session_id'])), 'additional_rows' => array(array('position' => 'below_table_data', 'value' => '<input type="submit" name="remove_articles" value="' . $txt['sp_admin_articles_remove'] . '" class="right_submit" />')));
        // Set the context values
        $context['page_title'] = $txt['sp_admin_articles_title'];
        $context['sub_template'] = 'show_list';
        $context['default_list'] = 'portal_articles';
        // Create the list.
        require_once SUBSDIR . '/GenericList.class.php';
        createList($listOptions);
    }
开发者ID:emanuele45,项目名称:SimplePortal_ElkArte,代码行数:19,代码来源:PortalAdminArticles.controller.php

示例4: template_latest_news

function template_latest_news()
{
    global $settings, $options, $context, $txt, $scripturl;
    echo '
		<div class="cat_bar">
			<h3 class="catbg">
				<span class="ie6_header floatleft"><a href="', $scripturl, '?action=helpadmin;help=live_news" onclick="return reqWin(this.href);" class="help"><img src="', $settings['images_url'], '/helptopics.gif" alt="', $txt['help'], '" class="icon" /></a> ', $txt['mc_latest_news'], '</span>
			</h3>
		</div>
		<div class="windowbg">
			<span class="topslice"><span></span></span>
			<div class="content">
				<div id="smfAnnouncements" class="smalltext">', $txt['mc_cannot_connect_sm'], '</div>
			</div>
			<span class="botslice"><span></span></span>
		</div>';
    // This requires a lot of javascript...
    //!!! Put this in it's own file!!
    echo '
		<script type="text/javascript" src="', $scripturl, '?action=viewsmfile;filename=current-version.js"></script>
		<script type="text/javascript" src="', $scripturl, '?action=viewsmfile;filename=latest-news.js"></script>
		<script type="text/javascript" src="', $settings['default_theme_url'], '/scripts/admin.js?fin20"></script>
		<script type="text/javascript"><!-- // --><![CDATA[
			var oAdminIndex = new smf_AdminIndex({
				sSelf: \'oAdminCenter\',

				bLoadAnnouncements: true,
				sAnnouncementTemplate: ', JavaScriptEscape('
					<dl>
						%content%
					</dl>
				'), ',
				sAnnouncementMessageTemplate: ', JavaScriptEscape('
					<dt><a href="%href%">%subject%</a> ' . $txt['on'] . ' %time%</dt>
					<dd>
						%message%
					</dd>
				'), ',
				sAnnouncementContainerId: \'smfAnnouncements\'
			});
		// ]]></script>';
}
开发者ID:abdulhadikaryana,项目名称:kebudayaan,代码行数:42,代码来源:ModerationCenter.template.php

示例5: template_download_language


//.........这里部分代码省略.........
				</tr>';
            $alternate = !$alternate;
        }
    }
    echo '
			</tbody>
			</table>';
    // Do we want some FTP baby?
    if (!empty($context['still_not_writable'])) {
        if (!empty($context['package_ftp']['error'])) {
            echo '
			<div id="errorbox">
				<tt>', $context['package_ftp']['error'], '</tt>
			</div>';
        }
        echo '
			<div class="cat_bar">
				<h3 class="catbg">
					', $txt['package_ftp_necessary'], '
				</h3>
			</div>
			<div class="windowbg">
				<span class="topslice"><span></span></span>
				<div class="content">
					<p>', $txt['package_ftp_why'], '</p>
					<dl class="settings">
						<dt
							<label for="ftp_server">', $txt['package_ftp_server'], ':</label>
						</dt>
						<dd>
							<div class="floatright" style="margin-right: 1px;"><label for="ftp_port" style="padding-top: 2px; padding-right: 2ex;">', $txt['package_ftp_port'], ':&nbsp;</label> <input type="text" size="3" name="ftp_port" id="ftp_port" value="', isset($context['package_ftp']['port']) ? $context['package_ftp']['port'] : (isset($modSettings['package_port']) ? $modSettings['package_port'] : '21'), '" class="input_text" /></div>
							<input type="text" size="30" name="ftp_server" id="ftp_server" value="', isset($context['package_ftp']['server']) ? $context['package_ftp']['server'] : (isset($modSettings['package_server']) ? $modSettings['package_server'] : 'localhost'), '" style="width: 70%;" class="input_text" />
						</dd>

						<dt>
							<label for="ftp_username">', $txt['package_ftp_username'], ':</label>
						</dt>
						<dd>
							<input type="text" size="50" name="ftp_username" id="ftp_username" value="', isset($context['package_ftp']['username']) ? $context['package_ftp']['username'] : (isset($modSettings['package_username']) ? $modSettings['package_username'] : ''), '" style="width: 99%;" class="input_text" />
						</dd>

						<dt>
							<label for="ftp_password">', $txt['package_ftp_password'], ':</label>
						</dt>
						<dd>
							<input type="password" size="50" name="ftp_password" id="ftp_password" style="width: 99%;" class="input_text" />
						</dd>

						<dt>
							<label for="ftp_path">', $txt['package_ftp_path'], ':</label>
						</dt>
						<dd>
							<input type="text" size="50" name="ftp_path" id="ftp_path" value="', $context['package_ftp']['path'], '" style="width: 99%;" class="input_text" />
						</dd>
					</dl>
				</div>
				<span class="botslice"><span></span></span>
			</div>';
    }
    // Install?
    echo '
			<div class="righttext padding">
				<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
				<input type="submit" name="do_install" value="', $txt['add_language_smf_install'], '" class="button_submit" />
			</div>
		</form>
	</div>
	<br class="clear" />';
    // The javascript for expand and collapse of sections.
    echo '
	<script type="text/javascript"><!-- // --><![CDATA[';
    // Each theme gets its own handler.
    foreach ($context['files']['images'] as $theme => $group) {
        $count = 0;
        echo '
			var oTogglePanel_', $theme, ' = new smc_Toggle({
				bToggleEnabled: true,
				bCurrentlyCollapsed: true,
				aSwappableContainers: [';
        foreach ($group as $file) {
            echo '
					', JavaScriptEscape($theme . '-' . $count++), ',';
        }
        echo '
					null
				],
				aSwapImages: [
					{
						sId: \'toggle_image_', $theme, '\',
						srcExpanded: smf_images_url + \'/sort_down.gif\',
						altExpanded: \'*\',
						srcCollapsed: smf_images_url + \'/selected.gif\',
						altCollapsed: \'*\'
					}
				]
			});';
    }
    echo '
	// ]]></script>';
}
开发者ID:valek0972,项目名称:hackits,代码行数:101,代码来源:Admin.template.php

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

示例7: template_viewmodreport

/**
 * View the details of a moderation report
 */
function template_viewmodreport()
{
    global $context, $scripturl, $txt;
    echo '
					<div id="modcenter">
						<form action="', $scripturl, '?action=moderate;area=reports;report=', $context['report']['id'], '" method="post" accept-charset="UTF-8">
							<h3 class="category_header">
								', sprintf($txt['mc_viewmodreport'], $context['report']['message_link'], $context['report']['author']['link']), '
							</h3>
							<div class="windowbg2">
								<p class="warningbox">', sprintf($txt['mc_modreport_summary'], $context['report']['num_reports'], $context['report']['last_updated']), '</p>
								<div class="content">
									', $context['report']['body'], '
								</div>
								<ul class="quickbuttons">
									<li class="listlevel1">
										<a class="linklevel1 close_button" href="', $scripturl, '?action=moderate;area=reports;close=', (int) (!$context['report']['closed']), ';rid=', $context['report']['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $context['report']['closed'] ? $txt['mc_reportedp_open'] : $txt['mc_reportedp_close'], '</a>
									</li>
									<li class="listlevel1">
										<a class="linklevel1 ignore_button" href="', $scripturl, '?action=moderate;area=reports;ignore=', (int) (!$context['report']['ignore']), ';rid=', $context['report']['id'], ';', $context['session_var'], '=', $context['session_id'], '" ', !$context['report']['ignore'] ? 'onclick="return confirm(' . JavaScriptEscape($txt['mc_reportedp_ignore_confirm']) . ');"' : '', '>', $context['report']['ignore'] ? $txt['mc_reportedp_unignore'] : $txt['mc_reportedp_ignore'], '</a>
									</li>
								</ul>
							</div>
							<h3 class="category_header">', $txt['mc_modreport_whoreported_title'], '</h3>';
    foreach ($context['report']['comments'] as $comment) {
        echo '
							<div class="windowbg">
								<div class="content">
									<p class="smalltext">', sprintf($txt['mc_modreport_whoreported_data'], $comment['member']['link'] . (empty($comment['member']['id']) && !empty($comment['member']['ip']) ? ' (' . $comment['member']['ip'] . ')' : ''), $comment['time']), '</p>
									<p>', $comment['message'], '</p>
								</div>
							</div>';
    }
    echo '
							<h3 class="category_header">', $txt['mc_modreport_mod_comments'], '</h3>
							<div class="windowbg2">
								<div class="content">';
    if (empty($context['report']['mod_comments'])) {
        echo '
									<p class="successbox">', $txt['mc_modreport_no_mod_comment'], '</p>';
    }
    foreach ($context['report']['mod_comments'] as $comment) {
        echo '<p>', $comment['member']['link'], ': ', $comment['message'], ' <em class="smalltext">(', $comment['time'], ')</em></p>';
    }
    echo '
									<textarea rows="2" cols="60" style="' . (isBrowser('is_ie8') ? 'width: 635px; max-width: 60%; min-width: 60%' : 'width: 100%') . ';" name="mod_comment"></textarea>
									<div class="submitbutton">
										<input type="submit" name="add_comment" value="', $txt['mc_modreport_add_mod_comment'], '" class="button_submit" />
									</div>
								</div>
							</div>';
    template_show_list('moderation_actions_list');
    echo '
							<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
						</form>
					</div>';
}
开发者ID:kode54,项目名称:hydrogenaudio-elkarte-theme,代码行数:60,代码来源:ModerationCenter.template.php

示例8: template_info_center

/**
 * The infocenter ... stats, recent topics, other important information that never gets seen :P
 */
function template_info_center()
{
    global $context, $txt;
    // Here's where the "Info Center" starts...
    echo '
	<div id="info_center" class="forum_category">
		<h2 class="category_header">
			<span id="category_toggle">&nbsp;
				<span id="upshrink_ic" class="', empty($context['minmax_preferences']['info']) ? 'collapse' : 'expand', '" style="display: none;" title="', $txt['hide'], '"></span>
			</span>
			<a href="#" id="upshrink_link">', sprintf($txt['info_center_title'], $context['forum_name_html_safe']), '</a>
		</h2>
		<ul id="upshrinkHeaderIC" class="category_boards"', empty($context['minmax_preferences']['info']) ? '' : ' style="display: none;"', '>';
    call_template_callbacks('ic', $context['info_center_callbacks']);
    echo '
		</ul>
	</div>';
    // Info center collapse object.
    echo '
	<script><!-- // --><![CDATA[
		var oInfoCenterToggle = new elk_Toggle({
			bToggleEnabled: true,
			bCurrentlyCollapsed: ', empty($context['minmax_preferences']['info']) ? 'false' : 'true', ',
			aSwappableContainers: [
				\'upshrinkHeaderIC\'
			],
			aSwapClasses: [
				{
					sId: \'upshrink_ic\',
					classExpanded: \'collapse\',
					titleExpanded: ', JavaScriptEscape($txt['hide']), ',
					classCollapsed: \'expand\',
					titleCollapsed: ', JavaScriptEscape($txt['show']), '
				}
			],
			aSwapLinks: [
				{
					sId: \'upshrink_link\',
					msgExpanded: ', JavaScriptEscape(sprintf($txt['info_center_title'], $context['forum_name_html_safe'])), ',
					msgCollapsed: ', JavaScriptEscape(sprintf($txt['info_center_title'], $context['forum_name_html_safe'])), '
				}
			],
			oThemeOptions: {
				bUseThemeSettings: ', $context['user']['is_guest'] ? 'false' : 'true', ',
				sOptionName: \'minmax_preferences\',
				sSessionId: elk_session_id,
				sSessionVar: elk_session_var,
				sAdditionalVars: \';minmax_key=info\'
			},
			oCookieOptions: {
				bUseCookie: ', $context['user']['is_guest'] ? 'true' : 'false', ',
				sCookieName: \'upshrinkIC\'
			}
		});
	// ]]></script>';
}
开发者ID:kode54,项目名称:hydrogenaudio-elkarte-theme,代码行数:59,代码来源:BoardIndex.template.php

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

示例10: template_arcade_game_above

/**
 * SMF Arcade
 *
 * @package SMF Arcade
 * @version 2.6 Alpha
 * @license http://download.smfarcade.info/license.php New-BSD
 */
function template_arcade_game_above()
{
    global $scripturl, $txt, $context, $settings;
    // Play link
    $context['arcade']['buttons']['play'] = array('text' => 'arcade_play', 'image' => 'arcade_play.gif', 'url' => !empty($context['arcade']['play']) ? $scripturl . '?action=arcade;sa=play;game=' . $context['game']['id'] . '" onclick="arcadeRestart(); return false;' : $scripturl . '?action=arcade;sa=play;game=' . $context['game']['id'], 'lang' => true);
    // Highscores link if it is supported
    if ($context['game']['highscore_support']) {
        $context['arcade']['buttons']['score'] = array('text' => 'arcade_viewscore', 'image' => 'arcade_viewscore.gif', 'url' => $scripturl . '?action=arcade;sa=highscore;game=' . $context['game']['id'], 'lang' => true);
    }
    // Random game
    $context['arcade']['buttons']['random'] = array('text' => 'arcade_random_game', 'image' => 'arcade_random.gif', 'url' => $scripturl . '?action=arcade;sa=play;random', 'lang' => true);
    if ($context['arcade']['can_admin_arcade']) {
        $context['arcade']['buttons']['edit'] = array('text' => 'arcade_edit_game', 'image' => 'arcade_edit_game.gif', 'url' => $scripturl . '?action=admin;area=managegames;sa=edit;game=' . $context['game']['id'], 'lang' => true);
    }
    $ratecode = '';
    $rating = $context['game']['rating'];
    if ($context['arcade']['can_rate']) {
        // Can rate
        for ($i = 1; $i <= 5; $i++) {
            if ($i <= $rating) {
                $ratecode .= '<a href="' . $scripturl . '?action=arcade;sa=rate;game=' . $context['game']['id'] . ';rate=' . $i . ';' . $context['session_var'] . '=' . $context['session_id'] . '" onclick="arcade_rate(' . $i . ', ' . $context['game']['id'] . '); return false;"><img id="imgrate' . $i . '" src="' . $settings['images_url'] . '/arcade_star.gif" alt="*" /></a>';
            } else {
                $ratecode .= '<a href="' . $scripturl . '?action=arcade;sa=rate;game=' . $context['game']['id'] . ';rate=' . $i . ';' . $context['session_var'] . '=' . $context['session_id'] . '" onclick="arcade_rate(' . $i . ', ' . $context['game']['id'] . '); return false;"><img id="imgrate' . $i . '" src="' . $settings['images_url'] . '/arcade_star2.gif" alt="*" /></a>';
            }
        }
    } else {
        // Can't rate
        $ratecode = str_repeat('<img src="' . $settings['images_url'] . '/arcade_star.gif" alt="*" />', $rating);
        $ratecode .= str_repeat('<img src="' . $settings['images_url'] . '/arcade_star2.gif" alt="" />', 5 - $rating);
    }
    echo '
	<div class="cat_bar">
		<h3 class="catbg">
			<span class="floatleft">', $context['game']['name'], '</span>
			<img id="game_toggle" class="floatright" src="', $settings['images_url'], '/collapse.gif', '" alt="*" title="', $txt['upshrink_description'], '" align="bottom" style="margin: 10px 5px 0 1em; display: none;" />
		</h3>
	</div>
	<div id="game_panel" class="windowbg2" style="', empty($options['game_panel_collapse']) ? '' : ' display: none;', '">
		<span class="topslice"><span></span></span>
		', !empty($context['game']['thumbnail']) ? '<img class="floatleft thumb" src="' . $context['game']['thumbnail'] . '" alt="" />' : '', '
		<div class="floatleft scores">';
    if ($context['game']['is_champion']) {
        echo '
				<strong>', $txt['arcade_champion'], ':</strong> ', $context['game']['champion']['link'], ' - ', $context['game']['champion']['score'], '<br />';
    }
    if ($context['game']['is_personal_best']) {
        echo '
				<strong>', $txt['arcade_personal_best'], ':</strong> ', $context['game']['personal_best'], '<br />';
    }
    echo '
		</div>
		<div class="floatright rating" style="text-align: right">';
    if ($context['arcade']['can_favorite']) {
        echo '
			<a href="', $context['game']['url']['favorite'], '" onclick="arcade_favorite(', $context['game']['id'], '); return false;">', !$context['game']['is_favorite'] ? '<img id="favgame' . $context['game']['id'] . '" src="' . $settings['images_url'] . '/favorite.gif" alt="' . $txt['arcade_add_favorites'] . '" />' : '<img id="favgame' . $context['game']['id'] . '" src="' . $settings['images_url'] . '/favorite2.gif" alt="' . $txt['arcade_remove_favorite'] . '" />', '</a><br />';
    }
    if ($context['arcade']['can_rate']) {
        echo '
			', $ratecode, '<br />';
    }
    echo '
		</div>
		<br class="clear" />
		<span class="botslice"><span></span></span>
	</div>
	<script type="text/javascript"><!-- // --><![CDATA[
		var oGameHeaderToggle = new smc_Toggle({
			bToggleEnabled: true,
			bCurrentlyCollapsed: ', empty($options['game_panel_collapse']) ? 'false' : 'true', ',
			aSwappableContainers: [
				\'game_panel\'
			],
			aSwapImages: [
				{
					sId: \'game_toggle\',
					srcExpanded: smf_images_url + \'/collapse.gif\',
					altExpanded: ', JavaScriptEscape($txt['upshrink_description']), ',
					srcCollapsed: smf_images_url + \'/expand.gif\',
					altCollapsed: ', JavaScriptEscape($txt['upshrink_description']), '
				}
			],
			oThemeOptions: {
				bUseThemeSettings: ', $context['user']['is_guest'] ? 'false' : 'true', ',
				sOptionName: \'game_panel_collapse\',
				sSessionVar: ', JavaScriptEscape($context['session_var']), ',
				sSessionId: ', JavaScriptEscape($context['session_id']), '
			},
			oCookieOptions: {
				bUseCookie: ', $context['user']['is_guest'] ? 'true' : 'false', ',
				sCookieName: \'arcadegameupshrink\'
			}
		});
	// ]]></script>';
//.........这里部分代码省略.........
开发者ID:nikop,项目名称:SMF-Arcade,代码行数:101,代码来源:ArcadeGame.template.php

示例11: template_quickreply_below

/**
 * This is quick reply area below all the message body's
 */
function template_quickreply_below()
{
    global $context, $options, $settings, $txt, $modSettings, $scripturl;
    // Yeah, I know, though at the moment is the only way...
    global $removableMessageIDs, $ignoredMsgs;
    // Using the quick reply box below the messages and you can reply?
    if ($context['can_reply'] && !empty($options['display_quick_reply'])) {
        echo '
			<a id="quickreply"></a>
			<div class="forumposts" id="quickreplybox">
				<h2 class="category_header">
					<span id="category_toggle">&nbsp;
						<a href="javascript:oQuickReply.swap();">
							<span id="quickReplyExpand" class="', empty($context['minmax_preferences']['qreply']) ? 'collapse' : 'expand', '" title="', $txt['hide'], '"></span>
						</a>
					</span>
					<a href="javascript:oQuickReply.swap();">', $txt['quick_reply'], '</a>
				</h2>
				<div id="quickReplyOptions" class="windowbg"', empty($context['minmax_preferences']['qreply']) ? '' : ' style="display: none"', '>
					<div class="editor_wrapper">
						', $context['is_locked'] ? '<p class="alert smalltext">' . $txt['quick_reply_warning'] . '</p>' : '', $context['oldTopicError'] ? '<p class="alert smalltext">' . sprintf($txt['error_old_topic'], $modSettings['oldTopicDays']) . '</p>' : '', '
						', $context['can_reply_approved'] ? '' : '<em>' . $txt['wait_for_approval'] . '</em>', '
						', !$context['can_reply_approved'] && $context['require_verification'] ? '<br />' : '', '
						<form action="', $scripturl, '?board=', $context['current_board'], ';action=post2" method="post" accept-charset="UTF-8" name="postmodify" id="postmodify" onsubmit="submitonce(this);', !empty($modSettings['mentions_enabled']) ? 'revalidateMentions(\'postmodify\', \'' . (empty($options['use_editor_quick_reply']) ? 'message' : $context['post_box_name']) . '\');' : '', '">
							<input type="hidden" name="topic" value="', $context['current_topic'], '" />
							<input type="hidden" name="subject" value="', $context['response_prefix'], $context['subject'], '" />
							<input type="hidden" name="icon" value="xx" />
							<input type="hidden" name="from_qr" value="1" />
							<input type="hidden" name="notify" value="', $context['is_marked_notify'] || !empty($options['auto_notify']) ? '1' : '0', '" />
							<input type="hidden" name="not_approved" value="', !$context['can_reply_approved'], '" />
							<input type="hidden" name="goback" value="', empty($options['return_to_post']) ? '0' : '1', '" />
							<input type="hidden" name="last_msg" value="', $context['topic_last_message'], '" />
							<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
							<input type="hidden" name="seqnum" value="', $context['form_sequence_number'], '" />';
        // Guests just need more.
        if ($context['user']['is_guest']) {
            echo '
							<dl>
								<dt>
									<strong><label for="guestname">', $txt['name'], '</label>:</strong> <input type="text" name="guestname" id="guestname" value="', $context['name'], '" size="25" class="input_text" tabindex="', $context['tabindex']++, '" />
								</dd>
								<dt>
									<strong><label for="email">', $txt['email'], '</label>:</strong> <input type="text" name="email" id="email" value="', $context['email'], '" size="25" class="input_text" tabindex="', $context['tabindex']++, '" />
								</dd>
							</dl>';
        }
        // Is visual verification enabled?
        if ($context['require_verification']) {
            template_verification_controls($context['visual_verification_id'], '
							<strong>' . $txt['verification'] . ':</strong>', '<br />');
        }
        // Using the full editor or a plain text box?
        if (empty($options['use_editor_quick_reply'])) {
            echo '
							<div class="quickReplyContent">
								<textarea cols="600" rows="7" class="quickreply" name="message" id="message" tabindex="', $context['tabindex']++, '"></textarea>
							</div>';
        } else {
            echo '
							', template_control_richedit($context['post_box_name'], 'smileyBox_message', 'bbcBox_message');
        }
        echo '
							<div id="post_confirm_buttons" class="submitbutton">
								<input type="submit" name="post" value="', $txt['post'], '" onclick="return submitThisOnce(this);" accesskey="s" tabindex="', $context['tabindex']++, '" class="button_submit" />
								<input type="submit" name="preview" value="', $txt['preview'], '" onclick="return submitThisOnce(this);" accesskey="p" tabindex="', $context['tabindex']++, '" class="button_submit" />';
        // Spellcheck button?
        if ($context['show_spellchecking']) {
            echo '
								<input type="button" value="', $txt['spell_check'], '" onclick="spellCheck(\'postmodify\', \'message\', ', empty($options['use_editor_quick_reply']) ? 'false' : 'true', ')" tabindex="', $context['tabindex']++, '" class="button_submit" />';
        }
        // Draft save button?
        if (!empty($context['drafts_save'])) {
            echo '
								<input type="submit" name="save_draft" value="', $txt['draft_save'], '" onclick="return confirm(' . JavaScriptEscape($txt['draft_save_note']) . ') && submitThisOnce(this);" accesskey="d" tabindex="', $context['tabindex']++, '" class="button_submit" />
								<input type="hidden" id="id_draft" name="id_draft" value="', empty($context['id_draft']) ? 0 : $context['id_draft'], '" />';
        }
        echo '
							</div>';
        // Show the draft last saved on area
        if (!empty($context['drafts_autosave']) && !empty($options['drafts_autosave_enabled'])) {
            echo '
							<div class="draftautosave">
								<span id="throbber" style="display:none"><i class="fa fa-spinner fa-spin"></i>&nbsp;</span>
								<span id="draft_lastautosave"></span>
							</div>';
        }
        echo '
						</form>
					</div>
				</div>
			</div>';
        // Using the plain text box we need to load in some additonal javascript
        if (empty($options['use_editor_quick_reply'])) {
            echo '
			<script><!-- // --><![CDATA[';
            // Draft autosave available and the user has it enabled?
            if (!empty($context['drafts_autosave']) && !empty($options['drafts_autosave_enabled'])) {
//.........这里部分代码省略.........
开发者ID:KeiroD,项目名称:Elkarte,代码行数:101,代码来源:Display.template.php

示例12: constructPageIndex

function constructPageIndex($base_url, &$start, $max_value, $num_per_page, $flexible_start = false)
{
    global $modSettings;
    // Save whether $start was less than 0 or not.
    $start = (int) $start;
    $start_invalid = $start < 0;
    // Make sure $start is a proper variable - not less than 0.
    if ($start_invalid) {
        $start = 0;
    } elseif ($start >= $max_value) {
        $start = max(0, (int) $max_value - ((int) $max_value % (int) $num_per_page == 0 ? $num_per_page : (int) $max_value % (int) $num_per_page));
    } else {
        $start = max(0, (int) $start - (int) $start % (int) $num_per_page);
    }
    // Wireless will need the protocol on the URL somewhere.
    if (WIRELESS) {
        $base_url .= ';' . WIRELESS_PROTOCOL;
    }
    $base_link = '<a class="navPages" href="' . ($flexible_start ? $base_url : strtr($base_url, array('%' => '%%')) . ';start=%1$d') . '">%2$s</a> ';
    // Compact pages is off or on?
    if (empty($modSettings['compactTopicPagesEnable'])) {
        // Show the left arrow.
        $pageindex = $start == 0 ? ' ' : sprintf($base_link, $start - $num_per_page, '&#171;');
        // Show all the pages.
        $display_page = 1;
        for ($counter = 0; $counter < $max_value; $counter += $num_per_page) {
            $pageindex .= $start == $counter && !$start_invalid ? '<strong>' . $display_page++ . '</strong> ' : sprintf($base_link, $counter, $display_page++);
        }
        // Show the right arrow.
        $display_page = $start + $num_per_page > $max_value ? $max_value : $start + $num_per_page;
        if ($start != $counter - $max_value && !$start_invalid) {
            $pageindex .= $display_page > $counter - $num_per_page ? ' ' : sprintf($base_link, $display_page, '&#187;');
        }
    } else {
        // If they didn't enter an odd value, pretend they did.
        $PageContiguous = (int) ($modSettings['compactTopicPagesContiguous'] - $modSettings['compactTopicPagesContiguous'] % 2) / 2;
        // Show the first page. (>1< ... 6 7 [8] 9 10 ... 15)
        if ($start > $num_per_page * $PageContiguous) {
            $pageindex = sprintf($base_link, 0, '1');
        } else {
            $pageindex = '';
        }
        // Show the ... after the first page.  (1 >...< 6 7 [8] 9 10 ... 15)
        if ($start > $num_per_page * ($PageContiguous + 1)) {
            $pageindex .= '<span style="font-weight: bold;" onclick="' . htmlspecialchars('expandPages(this, ' . JavaScriptEscape($flexible_start ? $base_url : strtr($base_url, array('%' => '%%')) . ';start=%1$d') . ', ' . $num_per_page . ', ' . ($start - $num_per_page * $PageContiguous) . ', ' . $num_per_page . ');') . '" onmouseover="this.style.cursor = \'pointer\';"> ... </span>';
        }
        // Show the pages before the current one. (1 ... >6 7< [8] 9 10 ... 15)
        for ($nCont = $PageContiguous; $nCont >= 1; $nCont--) {
            if ($start >= $num_per_page * $nCont) {
                $tmpStart = $start - $num_per_page * $nCont;
                $pageindex .= sprintf($base_link, $tmpStart, $tmpStart / $num_per_page + 1);
            }
        }
        // Show the current page. (1 ... 6 7 >[8]< 9 10 ... 15)
        if (!$start_invalid) {
            $pageindex .= '[<strong>' . ($start / $num_per_page + 1) . '</strong>] ';
        } else {
            $pageindex .= sprintf($base_link, $start, $start / $num_per_page + 1);
        }
        // Show the pages after the current one... (1 ... 6 7 [8] >9 10< ... 15)
        $tmpMaxPages = (int) (($max_value - 1) / $num_per_page) * $num_per_page;
        for ($nCont = 1; $nCont <= $PageContiguous; $nCont++) {
            if ($start + $num_per_page * $nCont <= $tmpMaxPages) {
                $tmpStart = $start + $num_per_page * $nCont;
                $pageindex .= sprintf($base_link, $tmpStart, $tmpStart / $num_per_page + 1);
            }
        }
        // Show the '...' part near the end. (1 ... 6 7 [8] 9 10 >...< 15)
        if ($start + $num_per_page * ($PageContiguous + 1) < $tmpMaxPages) {
            $pageindex .= '<span style="font-weight: bold;" onclick="expandPages(this, \'' . ($flexible_start ? strtr($base_url, array('\'' => '\\\'')) : strtr($base_url, array('%' => '%%', '\'' => '\\\'')) . ';start=%1$d') . '\', ' . ($start + $num_per_page * ($PageContiguous + 1)) . ', ' . $tmpMaxPages . ', ' . $num_per_page . ');" onmouseover="this.style.cursor=\'pointer\';"> ... </span>';
        }
        // Show the last number in the list. (1 ... 6 7 [8] 9 10 ... >15<)
        if ($start + $num_per_page * $PageContiguous < $tmpMaxPages) {
            $pageindex .= sprintf($base_link, $tmpMaxPages, $tmpMaxPages / $num_per_page + 1);
        }
    }
    return $pageindex;
}
开发者ID:AhoyLemon,项目名称:ballpit,代码行数:78,代码来源:Subs.backup.2.php

示例13: template_maintain_topics

function template_maintain_topics()
{
    global $scripturl, $txt, $context, $settings, $modSettings;
    // If maintenance has finished tell the user.
    if (!empty($context['maintenance_finished'])) {
        echo '
			<div class="maintenance_finished">
				', sprintf($txt['maintain_done'], $context['maintenance_finished']), '
			</div>';
    }
    // Bit of javascript for showing which boards to prune in an otherwise hidden list.
    echo '
		<script type="text/javascript"><!-- // --><![CDATA[
			var rotSwap = false;
			function swapRot()
			{
				rotSwap = !rotSwap;

				// Toggle icon
				document.getElementById("rotIcon").src = smf_images_url + (rotSwap ? "/collapse.gif" : "/expand.gif");
				setInnerHTML(document.getElementById("rotText"), rotSwap ? ', JavaScriptEscape($txt['maintain_old_choose']), ' : ', JavaScriptEscape($txt['maintain_old_all']), ');

				// Toggle panel
				document.getElementById("rotPanel").style.display = !rotSwap ? "none" : "";

				// Toggle checkboxes
				var rotPanel = document.getElementById(\'rotPanel\');
				var oBoardCheckBoxes = rotPanel.getElementsByTagName(\'input\');
				for (var i = 0; i < oBoardCheckBoxes.length; i++)
				{
					if (oBoardCheckBoxes[i].type.toLowerCase() == "checkbox")
						oBoardCheckBoxes[i].checked = !rotSwap;
				}
			}
		// ]]></script>';
    echo '
	<div id="manage_maintenance">
		<div class="cat_bar">
			<h3>', $txt['maintain_old'], '</h3>
		</div>
		<div class="blue_container cleantop">
			<div class="content flow_auto">
				<form action="', $scripturl, '?action=admin;area=maintain;sa=topics;activity=pruneold" method="post" accept-charset="UTF-8">';
    // The otherwise hidden "choose which boards to prune".
    echo '
					<p>
						<a id="rotLink"></a>', $txt['maintain_old_since_days1'], '<input type="text" name="maxdays" value="30" size="3" />', $txt['maintain_old_since_days2'], '
					</p>
					<p>
						<label for="delete_type_nothing"><input type="radio" name="delete_type" id="delete_type_nothing" value="nothing" class="input_radio" /> ', $txt['maintain_old_nothing_else'], '</label><br />
						<label for="delete_type_moved"><input type="radio" name="delete_type" id="delete_type_moved" value="moved" class="input_radio" checked="checked" /> ', $txt['maintain_old_are_moved'], '</label><br />
						<label for="delete_type_locked"><input type="radio" name="delete_type" id="delete_type_locked" value="locked" class="input_radio" /> ', $txt['maintain_old_are_locked'], '</label><br />
					</p>';
    if (!empty($modSettings['enableStickyTopics'])) {
        echo '
					<p>
						<label for="delete_old_not_sticky"><input type="checkbox" name="delete_old_not_sticky" id="delete_old_not_sticky" class="input_check" checked="checked" /> ', $txt['maintain_old_are_not_stickied'], '</label><br />
					</p>';
    }
    echo '
					<p>
						<a href="#rotLink" onclick="swapRot();"><img src="', $settings['images_url'], '/expand.gif" alt="+" id="rotIcon" /></a> <a href="#rotLink" onclick="swapRot();" id="rotText" style="font-weight: bold;">', $txt['maintain_old_all'], '</a>
					</p>
					<div style="display: none;" id="rotPanel" class="flow_hidden">
						<div class="floatleft" style="width: 49%">';
    // This is the "middle" of the list.
    $middle = ceil(count($context['categories']) / 2);
    $i = 0;
    foreach ($context['categories'] as $category) {
        echo '
							<fieldset>
								<legend>', $category['name'], '</legend>
								<ul class="reset">';
        // Display a checkbox with every board.
        foreach ($category['boards'] as $board) {
            echo '
									<li style="margin-', $context['right_to_left'] ? 'right' : 'left', ': ', $board['child_level'] * 1.5, 'em;"><label for="boards_', $board['id'], '"><input type="checkbox" name="boards[', $board['id'], ']" id="boards_', $board['id'], '" checked="checked" class="input_check" />', $board['name'], '</label></li>';
        }
        echo '
								</ul>
							</fieldset>';
        // Increase $i, and check if we're at the middle yet.
        if (++$i == $middle) {
            echo '
						</div>
						<div class="floatright" style="width: 49%;">';
        }
    }
    echo '
						</div>
					</div>
					<span><input type="submit" value="', $txt['maintain_old_remove'], '" onclick="return confirm(\'', $txt['maintain_old_confirm'], '\');" class="button_submit" /></span>
					<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
				</form>
			</div>
		</div>
		<br>
		<div class="cat_bar">
			<h3>', $txt['move_topics_maintenance'], '</h3>
		</div>
//.........这里部分代码省略.........
开发者ID:norv,项目名称:EosAlpha,代码行数:101,代码来源:ManageMaintenance.template.php

示例14: template_find_members

function template_find_members()
{
    global $context, $settings, $options, $scripturl, $modSettings, $txt;
    echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"', $context['right_to_left'] ? ' dir="rtl"' : '', '>
	<head>
		<title>', $txt['find_members'], '</title>
		<meta http-equiv="Content-Type" content="text/html; charset=', $context['character_set'], '" />
		<meta name="robots" content="noindex" />
		<link rel="stylesheet" type="text/css" href="', $settings['theme_url'], '/css/index.css" />
		<script type="text/javascript" src="', $settings['default_theme_url'], '/scripts/script.js"></script>
		<script type="text/javascript"><!-- // --><![CDATA[
			var membersAdded = [];
			function addMember(name)
			{
				var theTextBox = window.opener.document.getElementById("', $context['input_box_name'], '");

				if (name in membersAdded)
					return;

				// If we only accept one name don\'t remember what is there.
				if (', JavaScriptEscape($context['delimiter']), ' != \'null\')
					membersAdded[name] = true;

				if (theTextBox.value.length < 1 || ', JavaScriptEscape($context['delimiter']), ' == \'null\')
					theTextBox.value = ', $context['quote_results'] ? '"\\"" + name + "\\""' : 'name', ';
				else
					theTextBox.value += ', JavaScriptEscape($context['delimiter']), ' + ', $context['quote_results'] ? '"\\"" + name + "\\""' : 'name', ';

				window.focus();
			}
		// ]]></script>
	</head>
	<body id="help_popup">
		<form action="', $scripturl, '?action=findmember;', $context['session_var'], '=', $context['session_id'], '" method="post" accept-charset="', $context['character_set'], '" class="padding description">
			<span class="upperframe"><span></span></span>
			<div class="roundframe">
				<div class="innerframe">
					<div class="cat_bar">
						<h3 class="catbg">', $txt['find_members'], '</h3>
					</div>
					<div class="padding">
						<strong>', $txt['find_username'], ':</strong><br />
						<input type="text" name="search" id="search" value="', isset($context['last_search']) ? $context['last_search'] : '', '" style="margin-top: 4px; width: 96%;" class="input_text" /><br />
						<span class="smalltext"><em>', $txt['find_wildcards'], '</em></span><br />';
    // Only offer to search for buddies if we have some!
    if (!empty($context['show_buddies'])) {
        echo '
						<span class="smalltext"><label for="buddies"><input type="checkbox" class="input_check" name="buddies" id="buddies"', !empty($context['buddy_search']) ? ' checked="checked"' : '', ' /> ', $txt['find_buddies'], '</label></span><br />';
    }
    echo '
						<div class="padding righttext">
							<input type="submit" value="', $txt['search'], '" class="button_submit" />
							<input type="button" value="', $txt['find_close'], '" onclick="window.close();" class="button_submit" />
						</div>
					</div>
				</div>
			</div>
			<span class="lowerframe"><span></span></span>
			<br />
			<span class="upperframe"><span></span></span>
			<div class="roundframe">
				<div class="innerframe">
					<div class="cat_bar">
						<h3 class="catbg">', $txt['find_results'], '</h3>
					</div>';
    if (empty($context['results'])) {
        echo '
					<p class="error">', $txt['find_no_results'], '</p>';
    } else {
        echo '
					<ul class="reset padding">';
        $alternate = true;
        foreach ($context['results'] as $result) {
            echo '
						<li class="', $alternate ? 'windowbg2' : 'windowbg', '">
							<a href="', $result['href'], '" target="_blank" class="new_win"><img src="', $settings['images_url'], '/icons/profile_sm.gif" alt="', $txt['view_profile'], '" title="', $txt['view_profile'], '" /></a>
							<a href="javascript:void(0);" onclick="addMember(this.innerHTML); return false;">', $result['name'], '</a>
						</li>';
            $alternate = !$alternate;
        }
        echo '
					</ul>
					<div class="pagesection">
						', $txt['pages'], ': ', $context['page_index'], '
					</div>';
    }
    echo '
				</div>
			</div>
			<span class="lowerframe"><span></span></span>
			<input type="hidden" name="input" value="', $context['input_box_name'], '" />
			<input type="hidden" name="delim" value="', $context['delimiter'], '" />
			<input type="hidden" name="quote" value="', $context['quote_results'] ? '1' : '0', '" />
		</form>';
    if (empty($context['results'])) {
        echo '
		<script type="text/javascript"><!-- // --><![CDATA[
			document.getElementById("search").focus();
		// ]]></script>';
//.........这里部分代码省略.........
开发者ID:chenhao6593,项目名称:smf,代码行数:101,代码来源:Help.template.php

示例15: template_main


//.........这里部分代码省略.........
    echo '
<script type="text/javascript" src="' . $settings['default_theme_url'] . '/scripts/topic.js"></script>
<script type="text/javascript"><!-- // --><![CDATA[';
    if (!empty($options['display_quick_reply'])) {
        echo '
	var oQuickReply = new QuickReply({
		bDefaultCollapsed: ', !empty($options['display_quick_reply']) && $options['display_quick_reply'] == 2 ? 'false' : 'true', ',
		iTopicId: ', $context['current_topic'], ',
		iStart: ', $context['start'], ',
		sScriptUrl: smf_scripturl,
		sImagesUrl: "', $settings['images_url'], '",
		sContainerId: "quickReplyOptions",
		sImageId: "quickReplyExpand",
		sImageCollapsed: "collapse.gif",
		sImageExpanded: "expand.gif",
		sJumpAnchor: "quickreply"
	});';
    }
    if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && $context['can_remove_post']) {
        echo '
	var oInTopicModeration = new InTopicModeration({
		sSelf: \'oInTopicModeration\',
		sCheckboxContainerMask: \'in_topic_mod_check_\',
		aMessageIds: [\'', implode('\', \'', $removableMessageIDs), '\'],
		sSessionId: \'', $context['session_id'], '\',
		sSessionVar: \'', $context['session_var'], '\',
		sButtonStrip: \'moderationbuttons\',
		bUseImageButton: true,
		bCanRemove: ', $context['can_remove_post'] ? 'true' : 'false', ',
		sRemoveButtonLabel: \'', $txt['quickmod_delete_selected'], '\',
		sRemoveButtonImage: \'', $settings['lang_images_url'], '/delete_selected.gif\',
		sRemoveButtonConfirm: \'', $txt['quickmod_confirm'], '\',
		bCanRestore: ', $context['can_restore_msg'] ? 'true' : 'false', ',
		sRestoreButtonLabel: \'', $txt['quick_mod_restore'], '\',
		sRestoreButtonImage: \'', $settings['lang_images_url'], '/restore_selected.gif\',
		sRestoreButtonConfirm: \'', $txt['quickmod_confirm'], '\',
		sFormId: \'quickModForm\'
	});';
    }
    echo '
	if (\'XMLHttpRequest\' in window)
	{
		var oQuickModify = new QuickModify({
			sScriptUrl: smf_scripturl,
			bShowModify: ', $settings['show_modify'] ? 'true' : 'false', ',
			iTopicId: ', $context['current_topic'], ',
			sTemplateBodyEdit: ', JavaScriptEscape('
				<div id="quick_edit_body_container" style="width: 90%">
					<div id="error_box" style="padding: 4px;" class="error"></div>
					<textarea class="editor" name="message" rows="12" style="' . ($context['browser']['is_ie8'] ? 'max-width: 100%; min-width: 100%' : 'width: 100%') . '; margin-bottom: 10px;" tabindex="' . $context['tabindex']++ . '">%body%</textarea><br />
					<input type="hidden" name="' . $context['session_var'] . '" value="' . $context['session_id'] . '" />
					<input type="hidden" name="topic" value="' . $context['current_topic'] . '" />
					<input type="hidden" name="msg" value="%msg_id%" />
					<div class="righttext">
						<input type="submit" name="post" value="' . $txt['save'] . '" tabindex="8" onclick="return oQuickModify.modifySave(\'' . $context['session_id'] . '\', \'' . $context['session_var'] . '\');" accesskey="s" class="button_submit" />&nbsp;&nbsp;' . ($context['show_spellchecking'] ? '<input type="button" value="' . $txt['spell_check'] . '" tabindex="9" onclick="spellCheck(\'quickModForm\', \'message\');" class="button_submit" />&nbsp;&nbsp;' : '') . '<input type="submit" name="cancel" value="' . $txt['modify_cancel'] . '" tabindex="9" onclick="return oQuickModify.modifyCancel();" class="button_submit" />
					</div>
				</div>'), ',
			sTemplateSubjectEdit: ', JavaScriptEscape('<input type="text" style="width: 90%" name="subject" value="%subject%" size="80" maxlength="80" tabindex="6" class="input_text" />'), ',
			sTemplateBodyNormal: ', JavaScriptEscape('%body%'), ',
			sTemplateSubjectNormal: ', JavaScriptEscape('<a href="' . $scripturl . '?topic=' . $context['current_topic'] . '.msg%msg_id%#msg%msg_id%" rel="nofollow">%subject%</a>'), ',
			sTemplateTopSubject: ', JavaScriptEscape($txt['topic'] . ': %subject% &nbsp;(' . $txt['read'] . ' ' . $context['num_views'] . ' ' . $txt['times'] . ')'), ',
			sErrorBorderStyle: ', JavaScriptEscape('1px solid red'), '
		});
		aJumpTo[aJumpTo.length] = new JumpTo({
			sContainerId: "display_jump_to",
			sJumpToTemplate: "<label class=\\"smalltext\\" for=\\"%select_id%\\">', $context['jump_to']['label'], ':<" + "/label> %dropdown_list%",
			iCurBoardId: ', $context['current_board'], ',
			iCurBoardChildLevel: ', $context['jump_to']['child_level'], ',
			sCurBoardName: "', $context['jump_to']['board_name'], '",
			sBoardChildLevelIndicator: "==",
			sBoardPrefix: "=> ",
			sCatSeparator: "-----------------------------",
			sCatPrefix: "",
			sGoButtonLabel: "', $txt['go'], '"
		});

		aIconLists[aIconLists.length] = new IconList({
			sBackReference: "aIconLists[" + aIconLists.length + "]",
			sIconIdPrefix: "msg_icon_",
			sScriptUrl: smf_scripturl,
			bShowModify: ', $settings['show_modify'] ? 'true' : 'false', ',
			iBoardId: ', $context['current_board'], ',
			iTopicId: ', $context['current_topic'], ',
			sSessionId: "', $context['session_id'], '",
			sSessionVar: "', $context['session_var'], '",
			sLabelIconList: "', $txt['message_icon'], '",
			sBoxBackground: "transparent",
			sBoxBackgroundHover: "#ffffff",
			iBoxBorderWidthHover: 1,
			sBoxBorderColorHover: "#adadad" ,
			sContainerBackground: "#ffffff",
			sContainerBorder: "1px solid #adadad",
			sItemBorder: "1px solid #ffffff",
			sItemBorderHover: "1px dotted gray",
			sItemBackground: "transparent",
			sItemBackgroundHover: "#e0e0f0"
		});
	}
// ]]></script>';
}
开发者ID:dailinjie,项目名称:babylon,代码行数:101,代码来源:Display.template.php


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