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; }
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>'; } }
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 }
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; } }
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; }
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; }
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>"; } }
function mce_escape($text) { global $language; if ('en' == $language) { return $text; } else { return js_escape($text); } }
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; }
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; }
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; }
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); }
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>"; } }
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"); }
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"; } }
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; } }
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"; }
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});"; }
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"; }
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; }
<div id="postcustomstuff" class="dbx-content"> <table cellpadding="3"> <?php $metadata = has_meta($post_ID); list_meta($metadata); ?> </table> <?php meta_form(); ?> <div id="ajax-response"></div> </div> </div> </fieldset> </div> <?php do_action('dbx_post_advanced'); ?> </div> <?php if ('edit' == $action) : $delete_nonce = wp_create_nonce( 'delete-post_' . $post_ID ); ?> <input name="deletepost" class="button delete" type="submit" id="deletepost" tabindex="10" value="<?php echo ( 'draft' == $post->post_status ) ? __('Delete this draft') : __('Delete this post'); ?>" <?php echo "onclick=\"if ( confirm('" . js_escape(sprintf( ('draft' == $post->post_status) ? __("You are about to delete this draft '%s'\n 'Cancel' to stop, 'OK' to delete.") : __("You are about to delete this post '%s'\n 'Cancel' to stop, 'OK' to delete."), $post->post_title )) . "') ) { document.forms.post._wpnonce.value = '$delete_nonce'; return true;}return false;\""; ?> /> <?php endif; ?> </div> </div> </form>
}, notInitialized: function() { return this.transport ? false : true; } }); Ajax.activeSendCount = 0; Ajax.Responders.register( { onCreate: function() { Ajax.activeSendCount++; if ( 1 != Ajax.activeSendCount ) return; wpBeforeUnload = window.onbeforeunload; window.onbeforeunload = function() { return "<?php js_escape(__("Slow down, I'm still sending your data!")); ?> "; } }, onLoading: function() { // Can switch to onLoaded if we lose data Ajax.activeSendCount--; if ( 0 != Ajax.activeSendCount ) return; window.onbeforeunload = wpBeforeUnload; } }); //Pretty func adapted from ALA http://www.alistapart.com/articles/gettingstartedwithajax function getNodeValue(tree,el){try { var r = tree.getElementsByTagName(el)[0].firstChild.nodeValue; } catch(err) { var r = null; } return r; }
* @package omeka * @subpackage solr-search * @copyright 2012 Rector and Board of Visitors, University of Virginia * @license http://www.apache.org/licenses/LICENSE-2.0.html */ ?> <?php queue_css_file('results'); ?> <?php queue_js_file('moment'); queue_js_file('jquery.daterangepicker'); queue_js_string('var search_url = "' . url("solr-search") . '"; var autocompleteChoicesUrl = ' . js_escape(url('solr-search/results/autocomplete')) . ';'); queue_js_file('searchformfunctions'); $key = get_option('geolocation_gmaps_key'); // ? get_option('geolocation_gmaps_key') : 'AIzaSyD6zj4P4YxltcYJZsRVUvTqG_bT1nny30o'; $lang = "nl"; queue_js_url("https://maps.googleapis.com/maps/api/js?sensor=false&libraries=places&key={$key}&language={$lang}"); echo head(array('title' => __('Solr Search'))); ?> <script type="text/javascript" charset="utf-8"> //<![CDATA[ //]]> </script> <h1><?php
function sanitize_bookmark_field($field, $value, $bookmark_id, $context) { $int_fields = array('link_id', 'link_rating'); if (in_array($field, $int_fields)) { $value = (int) $value; } $yesno = array('link_visible'); if (in_array($field, $yesno)) { $value = preg_replace('/[^YNyn]/', '', $value); } if ('link_target' == $field) { $targets = array('_top', '_blank'); if (!in_array($value, $targets)) { $value = ''; } } if ('raw' == $context) { return $value; } if ('edit' == $context) { $format_to_edit = array('link_notes'); $value = apply_filters("edit_{$field}", $value, $bookmark_id); if (in_array($field, $format_to_edit)) { $value = format_to_edit($value); } else { $value = attribute_escape($value); } } else { if ('db' == $context) { $value = apply_filters("pre_{$field}", $value); } else { // Use display filters by default. $value = apply_filters($field, $value, $bookmark_id, $context); } } if ('attribute' == $context) { $value = attribute_escape($value); } else { if ('js' == $context) { $value = js_escape($value); } } return $value; }
echo "<tr><td>PRIMARY<td>"; foreach ($primary["columns"] as $key => $column) { echo select_input(" disabled", $fields, $column); echo "<label><input disabled type='checkbox'>" . lang('descending') . "</label> "; } echo "<td><td>\n"; } $j = 1; foreach ($row["indexes"] as $index) { if (!$_POST["drop_col"] || $j != key($_POST["drop_col"])) { echo "<tr><td>" . html_select("indexes[{$j}][type]", array(-1 => "") + $index_types, $index["type"], $j == count($row["indexes"]) ? "indexesAddRow(this);" : 1); echo "<td>"; ksort($index["columns"]); $i = 1; foreach ($index["columns"] as $key => $column) { echo "<span>" . select_input(" name='indexes[{$j}][columns][{$i}]' onchange=\"" . ($i == count($index["columns"]) ? "indexesAddColumn" : "indexesChangeColumn") . "(this, '" . js_escape($jush == "sql" ? "" : $_GET["indexes"] . "_") . "');\"", $fields ? array_combine($fields, $fields) : $fields, $column); echo $jush == "sql" || $jush == "mssql" ? "<input type='number' name='indexes[{$j}][lengths][{$i}]' class='size' value='" . h($index["lengths"][$key]) . "'>" : ""; echo $jush != "sql" ? checkbox("indexes[{$j}][descs][{$i}]", 1, $index["descs"][$key], lang('descending')) : ""; echo " </span>"; $i++; } echo "<td><input name='indexes[{$j}][name]' value='" . h($index["name"]) . "' autocapitalize='off'>\n"; echo "<td><input class='btn btn-xs btn-danger' type='submit' name='drop_col[{$j}]' data-toggle='tooltip' data-placement='top' value='X' title='" . lang('Remove') . "' onclick=\"return !editingRemoveRow(this, 'indexes\$1[type]');\">\n"; } $j++; } ?> </table> <p> <input class="btn btn-xs btn-success" type="submit" value="<?php echo lang('Save');
<td><a href="<?php the_permalink(); ?> " rel="permalink" class="edit"><?php _e('View'); ?> </a></td> <td><?php if (current_user_can('edit_pages')) { echo "<a href='post.php?action=edit&post={$post->ID}' class='edit'>" . __('Edit') . "</a>"; } ?> </td> <td><?php if (current_user_can('edit_pages')) { echo "<a href='" . wp_nonce_url("post.php?action=delete&post={$post->ID}", 'delete-post_' . $post->ID) . "' class='delete' onclick=\"return deleteSomething( 'page', " . $id . ", '" . sprintf(__("You are about to delete the "%s" page.\\n"OK" to delete, "Cancel" to stop."), js_escape(get_the_title('', '', 0))) . "' );\">" . __('Delete') . "</a>"; } ?> </td> </tr> <?php } } else { page_rows(); } ?> </table> <div id="ajax-response"></div> <?php
<?php if ($can_delete) { ?> <tr> <td colspan='<?php echo $num_columns; ?> '> <?php echo lang('bf_with_selected'); ?> <input type='submit' name='delete' id='delete-me' class='btn btn-danger' value="<?php echo lang('bf_action_delete'); ?> " onclick="return confirm('<?php e(js_escape(lang('registration_team_delete_confirm'))); ?> ')" /> </td> </tr> <?php } ?> </tfoot> <?php } ?> <tbody> <?php if ($has_records) { foreach ($records as $record) {
/** * Get the JavaScript tags that will be used on the page. * * This should generally be used with echo to print the scripts in the page * head. * * @package Omeka\Function\View\Asset * @see queue_js_file() * @param bool $includeDefaults Whether the default javascripts should be * included. Defaults to true. * @return string */ function head_js($includeDefaults = true) { $headScript = get_view()->headScript(); if ($includeDefaults) { $dir = 'javascripts'; $headScript->prependScript('jQuery.noConflict();')->prependScript('window.jQuery.ui || document.write(' . js_escape(js_tag('vendor/jquery-ui')) . ')')->prependFile('https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.2/jquery-ui.min.js')->prependScript('window.jQuery || document.write(' . js_escape(js_tag('vendor/jquery')) . ')')->prependFile('https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js'); } return $headScript; }
echo lang('bf_action_activate'); ?> " /> <input type="submit" name="deactivate" class="btn" value="<?php echo lang('bf_action_deactivate'); ?> " /> <input type="submit" name="ban" class="btn" value="<?php echo lang('bf_action_ban'); ?> " /> <input type="submit" name="delete" class="btn btn-danger" id="delete-me" value="<?php echo lang('bf_action_delete'); ?> " onclick="return confirm('<?php e(js_escape(lang('us_delete_account_confirm'))); ?> ')" /> <?php } ?> </td> </tr> </tfoot> <?php } ?> <tbody> <?php if ($has_users) { foreach ($users as $user) {
<?php if ($can_delete) { ?> <tr> <td colspan="<?php echo $num_columns; ?> "> <?php echo lang('bf_with_selected'); ?> <input type="submit" name="delete" id="delete-me" class="btn btn-danger" value="<?php echo lang('bf_action_delete'); ?> " onclick="return confirm('<?php e(js_escape(lang('product_documents_delete_confirm'))); ?> ')" /> </td> </tr> <?php } ?> </tfoot> <?php } ?> <tbody> <?php if ($has_records) { foreach ($records as $record) {