本文整理汇总了PHP中js_escape函数的典型用法代码示例。如果您正苦于以下问题:PHP js_escape函数的具体用法?PHP js_escape怎么用?PHP js_escape使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了js_escape函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: googleMap
public function googleMap($divId = 'map', $options = array(), $attrs = array(), $center = array())
{
if (!$center) {
$center = array('latitude' => (double) get_option('geolocation_default_latitude'), 'longitude' => (double) get_option('geolocation_default_longitude'), 'zoomLevel' => (double) get_option('geolocation_default_zoom_level'));
}
if (!array_key_exists('params', $options)) {
$options['params'] = array();
}
if (!array_key_exists('uri', $options)) {
// This should not be a link to the public side b/c then all the URLs that
// are generated inside the KML will also link to the public side.
$options['uri'] = url('geolocation/map.kml');
}
if (!array_key_exists('mapType', $options)) {
$options['mapType'] = get_option('geolocation_map_type');
}
if (!array_key_exists('fitMarkers', $options)) {
$options['fitMarkers'] = (bool) get_option('geolocation_auto_fit_browse');
}
$class = 'map geolocation-map';
if (isset($attrs['class'])) {
$class .= ' ' . $attrs['class'];
}
$options = js_escape($options);
$center = js_escape($center);
$varDivId = Inflector::variablize($divId);
$divAttrs = array_merge($attrs, array('id' => $divId, 'class' => $class));
$html = '<div ' . tag_attributes($divAttrs) . '></div>';
$js = "var {$varDivId}" . "OmekaMapBrowse = new OmekaMapBrowse(" . js_escape($divId) . ", {$center}, {$options}); ";
$html .= "<script type='text/javascript'>{$js}</script>";
return $html;
}
开发者ID:regan008,项目名称:WearingGayHistory-Plugins,代码行数:32,代码来源:GoogleMap.php
示例2: dismissed_updates
function dismissed_updates() {
$dismissed = get_core_updates( array( 'dismissed' => true, 'available' => false ) );
if ( $dismissed ) {
$show_text = js_escape(__('Show hidden updates'));
$hide_text = js_escape(__('Hide hidden updates'));
?>
<script type="text/javascript">
jQuery(function($) {
$('dismissed-updates').show();
$('#show-dismissed').toggle(function(){$(this).text('<?php echo $hide_text; ?>');}, function() {$(this).text('<?php echo $show_text; ?>')});
$('#show-dismissed').click(function() { $('#dismissed-updates').toggle('slow');});
});
</script>
<?php
echo '<p class="hide-if-no-js"><a id="show-dismissed" href="#">'.__('Show hidden updates').'</a></p>';
echo '<ul id="dismissed-updates" class="core-updates dismissed">';
foreach( (array) $dismissed as $update) {
echo '<li>';
list_core_update( $update );
echo '</li>';
}
echo '</ul>';
}
}
开发者ID:staylor,项目名称:develop.svn.wordpress.org,代码行数:26,代码来源:update-core.php
示例3: podpress_print_localized_frontend_js_vars
function podpress_print_localized_frontend_js_vars()
{
?>
<script type="text/javascript">
//<![CDATA[
var podpressL10 = {
openblogagain : '<?php
echo js_escape(__('back to:', 'podpress'));
?>
',
theblog : '<?php
echo js_escape(__('the blog', 'podpress'));
?>
',
close : '<?php
echo js_escape(__('close', 'podpress'));
?>
',
playbutton : '<?php
echo js_escape(__('Play >', 'podpress'));
?>
'
}
//]]>
</script>
<?php
}
开发者ID:cracknel,项目名称:ubuntudanmark.dk,代码行数:27,代码来源:podpress_js_i18n.php
示例4: print_scripts_l10n
function print_scripts_l10n($handle, $echo = true)
{
if (empty($this->registered[$handle]->extra['l10n']) || empty($this->registered[$handle]->extra['l10n'][0]) || !is_array($this->registered[$handle]->extra['l10n'][1])) {
return false;
}
$object_name = $this->registered[$handle]->extra['l10n'][0];
$data = "var {$object_name} = {\n";
$eol = '';
foreach ($this->registered[$handle]->extra['l10n'][1] as $var => $val) {
if ('l10n_print_after' == $var) {
$after = $val;
continue;
}
$data .= "{$eol}\t{$var}: \"" . js_escape($val) . '"';
$eol = ",\n";
}
$data .= "\n};\n";
$data .= isset($after) ? "{$after}\n" : '';
if ($echo) {
echo "<script type='text/javascript'>\n";
echo "/* <![CDATA[ */\n";
echo $data;
echo "/* ]]> */\n";
echo "</script>\n";
return true;
} else {
return $data;
}
}
开发者ID:schr,项目名称:wordpress,代码行数:29,代码来源:class.wp-scripts.php
示例5: itemGoogleMap
public function itemGoogleMap($item = null, $width = '200px', $height = '200px', $hasBalloonForMarker = false, $markerHtmlClassName = 'geolocation_balloon')
{
$divId = "item-map-{$item->id}";
$location = get_db()->getTable('Location')->findLocationByItem($item, true);
// Only set the center of the map if this item actually has a location
// associated with it
if ($location) {
$center['latitude'] = $location->latitude;
$center['longitude'] = $location->longitude;
$center['zoomLevel'] = $location->zoom_level;
$center['show'] = true;
if ($hasBalloonForMarker) {
$titleLink = link_to_item(metadata($item, array('Dublin Core', 'Title'), array(), $item), array(), 'show', $item);
$thumbnailLink = !item_image('thumbnail') ? '' : link_to_item(item_image('thumbnail', array(), 0, $item), array(), 'show', $item);
$description = metadata($item, array('Dublin Core', 'Description'), array('snippet' => 150), $item);
$center['markerHtml'] = '<div class="' . $markerHtmlClassName . '">' . '<div class="geolocation_balloon_title">' . $titleLink . '</div>' . '<div class="geolocation_balloon_thumbnail">' . $thumbnailLink . '</div>' . '<p class="geolocation_balloon_description">' . $description . '</p></div>';
}
$options = array();
$options['mapType'] = get_option('geolocation_map_type');
$center = js_escape($center);
$options = js_escape($options);
$style = "width: {$width}; height: {$height}";
$html = '<div id="' . $divId . '" class="map geolocation-map" style="' . $style . '"></div>';
$js = "var " . Inflector::variablize($divId) . ";";
$js .= "OmekaMapSingle = new OmekaMapSingle(" . js_escape($divId) . ", {$center}, {$options}); ";
$html .= "<script type='text/javascript'>{$js}</script>";
} else {
$html = '<p class="map-notification">' . __('This item has no location info associated with it.') . '</p>';
}
return $html;
}
开发者ID:regan008,项目名称:WearingGayHistory-Plugins,代码行数:31,代码来源:ItemGoogleMap.php
示例6: tagInput
public static function tagInput($id = null) {
global $langTags, $head_content, $course_code;
// initialize the tags
$answer = '';
if (isset($id)) {
require_once 'modules/tags/moduleElement.class.php';
$moduleTag = new ModuleElement($id);
$tags_init = $moduleTag->getTags();
foreach ($tags_init as $key => $tag) {
$arrayTemp = "{id:\"" . js_escape($tag) . "\" , text:\"" . js_escape($tag) . "\"},";
$answer = $answer . $arrayTemp;
}
}
$head_content .= "
<script>
$(function () {
$('#tags').select2({
minimumInputLength: 2,
tags: true,
tokenSeparators: [', '],
createSearchChoice: function(term, data) {
if ($(data).filter(function() {
return this.text.localeCompare(term) === 0;
}).length === 0) {
return {
id: term,
text: term
};
}
},
ajax: {
url: '../tags/feed.php',
dataType: 'json',
data: function(term, page) {
return {
course: '" . js_escape($course_code) . "',
q: term
};
},
results: function(data, page) {
return {results: data};
}
}
});
$('#tags').select2('data', [".$answer."]);
});
</script>";
$input_field = "
<div class='form-group'>
<label for='tags' class='col-sm-2 control-label'>$langTags:</label>
<div class='col-sm-10'>
<input type='hidden' id='tags' class='form-control' name='tags' value=''>
</div>
</div>
";
return $input_field;
}
开发者ID:nikosv,项目名称:openeclass,代码行数:59,代码来源:tag.class.php
示例7: editInput
function editInput($table, $field, $attrs, $value)
{
if (preg_match("~date|time~", $field["type"])) {
$dateFormat = "changeYear: true, dateFormat: 'yy-mm-dd'";
//! yy-mm-dd regional
$timeFormat = "showSecond: true, timeFormat: 'hh:mm:ss'";
return "<input id='fields-" . h($field["field"]) . "' value='" . h($value) . "'" . (+$field["length"] ? " maxlength='" . +$field["length"] . "'" : "") . "{$attrs}><script type='text/javascript'>jQuery('#fields-" . js_escape($field["field"]) . "')." . ($field["type"] == "time" ? "timepicker({ {$timeFormat} })" : (preg_match("~time~", $field["type"]) ? "datetimepicker({ {$dateFormat}, {$timeFormat} })" : "datepicker({ {$dateFormat} })")) . ";</script>";
}
}
开发者ID:nafex,项目名称:adminer,代码行数:9,代码来源:edit-calendar.php
示例8: mce_escape
function mce_escape($text)
{
global $language;
if ('en' == $language) {
return $text;
} else {
return js_escape($text);
}
}
开发者ID:nurpax,项目名称:saastafi,代码行数:9,代码来源:wp-langs.php
示例9: hookPublicFooter
public function hookPublicFooter()
{
$accountId = get_option(GOOGLE_ANALYTICS_ACCOUNT_OPTION);
if (empty($accountId)) {
return;
}
$js = file_get_contents(GOOGLE_ANALYTICS_PLUGIN_DIR . '/snippet.js');
$html = '<script type="text/javascript">' . 'var accountId =' . js_escape($accountId) . ';' . $js . '</script>';
echo $html;
}
开发者ID:kyfr59,项目名称:cg35,代码行数:10,代码来源:GoogleAnalyticsPlugin.php
示例10: ui_get_action_links
function ui_get_action_links($container_field)
{
//Inline action links for bookmarks
$bookmark =& $this->get_wrapped_object();
$delete_url = admin_url(wp_nonce_url("link.php?action=delete&link_id={$this->container_id}", 'delete-bookmark_' . $this->container_id));
$actions = array();
if (current_user_can('manage_links')) {
$actions['edit'] = '<span class="edit"><a href="' . $this->get_edit_url() . '" title="' . esc_attr(__('Edit this bookmark', 'broken-link-checker')) . '">' . __('Edit') . '</a>';
$actions['delete'] = "<span class='delete'><a class='submitdelete' href='" . esc_url($delete_url) . "' onclick=\"if ( confirm('" . js_escape(sprintf(__("You are about to delete this link '%s'\n 'Cancel' to stop, 'OK' to delete."), $bookmark->link_name)) . "') ) { return true;}return false;\">" . __('Delete') . "</a>";
}
return $actions;
}
开发者ID:Weissenberger13,项目名称:web.portugalrentalcottages,代码行数:12,代码来源:blogroll.php
示例11: wp_ajax_meta_row
function wp_ajax_meta_row( $pid, $mid, $key, $value ) {
$value = attribute_escape($value);
$key_js = addslashes(wp_specialchars($key, 'double'));
$key = attribute_escape($key);
$r .= "<tr id='meta-$mid'><td valign='top'>";
$r .= "<input name='meta[$mid][key]' tabindex='6' onkeypress='return killSubmit(\"theList.ajaxUpdater('meta','meta-$mid');\",event);' type='text' size='20' value='$key' />";
$r .= "</td><td><textarea name='meta[$mid][value]' tabindex='6' rows='2' cols='30'>$value</textarea></td><td align='center'>";
$r .= "<input name='updatemeta' type='button' class='updatemeta' tabindex='6' value='".attribute_escape(__('Update'))."' onclick='return theList.ajaxUpdater('meta','meta-$mid');' /><br />";
$r .= "<input name='deletemeta[$mid]' type='submit' onclick=\"return deleteSomething( 'meta', $mid, '";
$r .= js_escape(sprintf(__("You are about to delete the '%s' custom field on this post.\n'OK' to delete, 'Cancel' to stop."), $key_js));
$r .= "' );\" class='deletemeta' tabindex='6' value='".attribute_escape(__('Delete'))."' /></td></tr>";
return $r;
}
开发者ID:staylor,项目名称:develop.svn.wordpress.org,代码行数:13,代码来源:admin-ajax.php
示例12: handle_event
function handle_event($ev)
{
switch ($ev->rem_name) {
case 'test':
if ($_POST['val'] == 'error') {
$ev->failure = '!';
break;
}
print "var a=\$i('" . js_escape($ev->context[$ev->long_name]['ret']) . "');" . "a.innerHTML='" . js_escape(htmlspecialchars($_POST['val'], ENT_QUOTES)) . "';" . "";
default:
}
editor_generic::handle_event($ev);
}
开发者ID:vladisslav2011,项目名称:nb,代码行数:13,代码来源:test_controls.php
示例13: editInput
function editInput($table, $field, $attrs, $value)
{
static $lang = "";
if (!$lang && preg_match("~text~", $field["type"]) && preg_match("~_html~", $field["field"])) {
$lang = "en";
if (function_exists('get_lang')) {
// since Adminer 3.2.0
$lang = get_lang();
$lang = $lang == "zh" || $lang == "zh-tw" ? "zh_cn" : $lang;
}
return "<textarea{$attrs} id='fields-" . h($field["field"]) . "' rows='12' cols='50'>" . h($value) . "</textarea><script type='text/javascript'>\njQuery('#fields-" . js_escape($field["field"]) . "').wymeditor({ updateSelector: '#form [type=\"submit\"]', lang: '{$lang}'" . ($this->options ? ", {$this->options}" : "") . " });\n</script>";
}
}
开发者ID:nciftci,项目名称:plugins,代码行数:13,代码来源:wymeditor.php
示例14: connect_error
function connect_error()
{
global $adminer, $connection, $token, $error, $drivers;
if (DB != "") {
header("HTTP/1.1 404 Not Found");
page_header(lang('Database') . ": " . h(DB), lang('Invalid database.'), true);
} else {
if ($_POST["db"] && !$error) {
queries_redirect(substr(ME, 0, -1), lang('Databases have been dropped.'), drop_databases($_POST["db"]));
}
//Encabezado y botones de la parte superior en la seleccion de bases de datos
page_header(lang('Select database'), $error, false);
echo "<p>\n";
foreach (array('database' => lang('Create new database'), 'privileges' => lang('Privileges'), 'processlist' => lang('Process list'), 'variables' => lang('Variables'), 'status' => lang('Status')) as $key => $val) {
if (support($key)) {
echo "<a class='btn btn-xs btn-primary' href='" . h(ME) . "{$key}='>{$val}</a>\n";
}
}
//Presenta informacion de la conexion
echo "<p><i class='fa fa-exchange fa-fw'></i> " . lang('%s version: %s through PHP extension %s', $drivers[DRIVER], "<b>" . h($connection->server_info) . "</b>", "<b>{$connection->extension}</b>") . "\n";
echo "<p><i class='fa fa-user fa-fw'></i> " . lang('Logged as: %s', "<b>" . h(logged_user()) . "</b>") . "\n";
//Presenta la lista de bases de datos existentes y los encabezados
$databases = $adminer->databases();
if ($databases) {
$scheme = support("scheme");
$collations = collations();
echo "<form action='' method='post'>\n";
echo "<table cellspacing='0' class='checkable table table-condensed table-responsive table-hover' onclick='tableClick(event);' ondblclick='tableClick(event, true);'>\n";
echo "<thead><tr>" . (support("database") ? "<th> " : "") . "<th>" . lang('Database') . " - <a class='btn btn-default btn-xs' href='" . h(ME) . "refresh=1'><i class='fa fa-refresh fa-fw'></i> " . lang('Refresh') . "</a>" . "<th>" . lang('Collation') . "<th>" . lang('Tables') . "<th>" . lang('Size') . " - <a class='btn btn-default btn-xs' href='" . h(ME) . "dbsize=1' onclick=\"return !ajaxSetHtml('" . js_escape(ME) . "script=connect');\">" . lang('Compute') . "</a>" . "</thead>\n";
//Presenta la lista de bases de datos
$databases = $_GET["dbsize"] ? count_tables($databases) : array_flip($databases);
foreach ($databases as $db => $tables) {
$root = h(ME) . "db=" . urlencode($db);
echo "<tr" . odd() . ">" . (support("database") ? "\n\t\t\t\t\t<td align=center>" . checkbox("db[]", $db, in_array($db, (array) $_POST["db"])) : "");
echo "<th><a href='{$root}'>" . h($db) . "</a>";
$collation = nbsp(db_collation($db, $collations));
echo "<td>" . (support("database") ? "<a href='{$root}" . ($scheme ? "&ns=" : "") . "&database=' title='" . lang('Alter database') . "'>{$collation}</a>" : $collation);
echo "<td align='right'><a href='{$root}&schema=' id='tables-" . h($db) . "' title='" . lang('Database schema') . "'>" . ($_GET["dbsize"] ? $tables : "?") . "</a>";
echo "<td align='right' id='size-" . h($db) . "'>" . ($_GET["dbsize"] ? db_size($db) : "?");
echo "\n";
}
echo "</table>\n";
//Agrega boton de eliminar
echo support("database") ? "<fieldset><legend>" . lang('Selected') . " <span id='selected'></span></legend><div>\n" . "<input type='hidden' name='all' value='' onclick=\"selectCount('selected', formChecked(this, /^db/));\">\n" . "<input class='btn btn-xs btn-danger' type='submit' name='drop' value='" . lang('Drop') . "'" . confirm() . ">\n" . "</div></fieldset>\n" : "";
echo "<script type='text/javascript'>tableCheck();</script>\n";
echo "<input type='hidden' name='token' value='{$token}'>\n";
echo "</form>\n";
}
}
page_footer("db");
}
开发者ID:unix4you2,项目名称:pmydb,代码行数:51,代码来源:connect.inc.php
示例15: connect_error
function connect_error()
{
global $adminer, $connection, $token, $error, $drivers;
$databases = array();
if (DB != "") {
page_header(lang('Database') . ": " . h(DB), lang('Invalid database.'), true);
} else {
if ($_POST["db"] && !$error) {
queries_redirect(substr(ME, 0, -1), lang('Databases have been dropped.'), drop_databases($_POST["db"]));
}
page_header(lang('Select database'), $error, false);
echo "<p><a href='" . h(ME) . "database='>" . lang('Create new database') . "</a>\n";
foreach (array('privileges' => lang('Privileges'), 'processlist' => lang('Process list'), 'variables' => lang('Variables'), 'status' => lang('Status')) as $key => $val) {
if (support($key)) {
echo "<a href='" . h(ME) . "{$key}='>{$val}</a>\n";
}
}
echo "<p>" . lang('%s version: %s through PHP extension %s', $drivers[DRIVER], "<b>{$connection->server_info}</b>", "<b>{$connection->extension}</b>") . "\n";
echo "<p>" . lang('Logged as: %s', "<b>" . h(logged_user()) . "</b>") . "\n";
$refresh = "<a href='" . h(ME) . "refresh=1'>" . lang('Refresh') . "</a>\n";
$databases = $adminer->databases();
if ($databases) {
$scheme = support("scheme");
$collations = collations();
echo "<form action='' method='post'>\n";
echo "<table cellspacing='0' class='checkable' onclick='tableClick(event);'>\n";
echo "<thead><tr><td> <th>" . lang('Database') . "<td>" . lang('Collation') . "<td>" . lang('Tables') . "</thead>\n";
foreach ($databases as $db) {
$root = h(ME) . "db=" . urlencode($db);
echo "<tr" . odd() . "><td>" . checkbox("db[]", $db, in_array($db, (array) $_POST["db"]));
echo "<th><a href='{$root}'>" . h($db) . "</a>";
echo "<td><a href='{$root}" . ($scheme ? "&ns=" : "") . "&database=' title='" . lang('Alter database') . "'>" . nbsp(db_collation($db, $collations)) . "</a>";
echo "<td align='right'><a href='{$root}&schema=' id='tables-" . h($db) . "' title='" . lang('Database schema') . "'>?</a>";
echo "\n";
}
echo "</table>\n";
echo "<script type='text/javascript'>tableCheck();</script>\n";
echo "<p><input type='submit' name='drop' value='" . lang('Drop') . "'" . confirm("formChecked(this, /db/)") . ">\n";
echo "<input type='hidden' name='token' value='{$token}'>\n";
echo $refresh;
echo "</form>\n";
} else {
echo "<p>{$refresh}";
}
}
page_footer("db");
if ($databases) {
echo "<script type='text/javascript'>ajaxSetHtml('" . js_escape(ME) . "script=connect');</script>\n";
}
}
开发者ID:olien,项目名称:mysql_tools,代码行数:50,代码来源:connect.inc.php
示例16: topic_delete_link
function topic_delete_link($args = '')
{
$defaults = array('id' => 0, 'before' => '[', 'after' => ']');
extract(wp_parse_args($args, $defaults), EXTR_SKIP);
$id = (int) $id;
$topic = get_topic(get_topic_id($id));
if (!$topic || !bb_current_user_can('delete_topic', $topic->topic_id)) {
return;
}
if (0 == $topic->topic_status) {
echo "{$before}<a href='" . attribute_escape(bb_nonce_url(bb_get_option('uri') . 'bb-admin/delete-topic.php?id=' . $topic->topic_id, 'delete-topic_' . $topic->topic_id)) . "' onclick=\"return confirm('" . js_escape(__('Are you sure you wanna delete that?')) . "')\"><img src=\"" . bb_get_active_theme_uri() . 'image/delete.png" width="16" height="16" alt="Delete"/></a>' . $after;
} else {
echo "{$before}<a href='" . attribute_escape(bb_nonce_url(bb_get_option('uri') . 'bb-admin/delete-topic.php?id=' . $topic->topic_id . '&view=all', 'delete-topic_' . $topic->topic_id)) . "' onclick=\"return confirm('" . js_escape(__('Are you sure you wanna undelete that?')) . "')\"><img src=\"" . bb_get_active_theme_uri() . 'image/delete.png" width="16" height="16" alt="Delete"/></a>' . $after;
}
}
开发者ID:billerby,项目名称:Surdeg,代码行数:15,代码来源:functions.php
示例17: greet
function greet() {
$title = __('Import Old Blogger');
$welcome = __('Howdy! This importer allows you to import posts and comments from your Old Blogger account into your WordPress blog.');
$noiframes = __('This feature requires iframe support.');
$warning = js_escape(__('This will delete everything saved by the Blogger importer except your posts and comments. Are you sure you want to do this?'));
$reset = __('Reset this importer');
$incompat = __('Your web server is not properly configured to use this importer. Please enable the CURL extension for PHP and then reload this page.');
echo "<div class='wrap'><h2>$title</h2><p>$welcome</p>";
echo "<p>" . __('Please note that this importer <em>does not work with new Blogger (using your Google account)</em>.') . "</p>";
if ( function_exists('curl_init') )
echo "<iframe src='admin.php?import=blogger&noheader=true' height='350px' width = '99%'>$noiframes</iframe><p><a href='admin.php?import=blogger&restart=true&noheader=true' onclick='return confirm(\"$warning\")'>$reset</a></p>";
else
echo "<p>$incompat</p>";
echo "</div>\n";
}
开发者ID:staylor,项目名称:develop.svn.wordpress.org,代码行数:16,代码来源:blogger.php
示例18: bootstrap
function bootstrap()
{
$this->long_name = editor_generic::long_name();
if (!is_array($this->editors)) {
return;
}
foreach ($this->editors as $i => $e) {
$this->context[$this->long_name . '.' . $i]['var'] = $i;
$e->context =& $this->context;
$e->keys =& $this->keys;
$e->args =& $this->args;
$e->oid = $this->oid;
}
foreach ($this->editors as $i => $e) {
$e->bootstrap();
}
$this->editors['submit']->attributes['onclick'] = "chse.send_or_push({static:'" . $this->editors['submit']->send . "',val:js2php(\$i('" . js_escape($this->btn->id_gen()) . "').result_struct),c_id:this.id});";
}
开发者ID:vladisslav2011,项目名称:nb,代码行数:18,代码来源:keyboard-test.php
示例19: link_cat_row
function link_cat_row($category)
{
global $class;
if (current_user_can('manage_categories')) {
$edit = "<a href='link-category.php?action=edit&cat_ID={$category->term_id}' class='edit'>" . __('Edit') . "</a></td>";
$default_cat_id = (int) get_option('default_link_category');
if ($category->term_id != $default_cat_id) {
$edit .= "<td><a href='" . wp_nonce_url("link-category.php?action=delete&cat_ID={$category->term_id}", 'delete-link-category_' . $category->term_id) . "' onclick=\"return deleteSomething( 'cat', {$category->term_id}, '" . js_escape(sprintf(__("You are about to delete the category '%s'.\nAll links that were only assigned to this category will be assigned to the '%s' category.\n'OK' to delete, 'Cancel' to stop."), $category->name, get_term_field('name', $default_cat_id, 'link_category'))) . "' );\" class='delete'>" . __('Delete') . "</a>";
} else {
$edit .= "<td style='text-align:center'>" . __("Default");
}
} else {
$edit = '';
}
$class = defined('DOING_AJAX') && DOING_AJAX || " class='alternate'" == $class ? '' : " class='alternate'";
$category->count = number_format_i18n($category->count);
$count = $category->count > 0 ? "<a href='link-manager.php?cat_id={$category->term_id}'>{$category->count}</a>" : $category->count;
return "<tr id='cat-{$category->term_id}'{$class}>\n\t\t<th scope='row' style='text-align: center'>{$category->term_id}</th>\n\t\t<td>" . ($name_override ? $name_override : $pad . ' ' . $category->name) . "</td>\n\t\t<td>{$category->description}</td>\n\t\t<td align='center'>{$count}</td>\n\t\t<td>{$edit}</td>\n\t</tr>\n";
}
开发者ID:helmonaut,项目名称:owb-mirror,代码行数:19,代码来源:edit-link-categories.php
示例20: print_scripts_l10n
function print_scripts_l10n($handle)
{
if (empty($this->registered[$handle]->extra['l10n']) || empty($this->registered[$handle]->extra['l10n'][0]) || !is_array($this->registered[$handle]->extra['l10n'][1])) {
return false;
}
$object_name = $this->registered[$handle]->extra['l10n'][0];
echo "<script type='text/javascript'>\n";
echo "/* <![CDATA[ */\n";
echo "\t{$object_name} = {\n";
$eol = '';
foreach ($this->registered[$handle]->extra['l10n'][1] as $var => $val) {
echo "{$eol}\t\t{$var}: \"" . js_escape($val) . '"';
$eol = ",\n";
}
echo "\n\t}\n";
echo "/* ]]> */\n";
echo "</script>\n";
return true;
}
开发者ID:nurpax,项目名称:saastafi,代码行数:19,代码来源:class.wp-scripts.php
注:本文中的js_escape函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论