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


PHP nxt_create_nonce函数代码示例

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


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

示例1: et_epanel_admin_js

 function et_epanel_admin_js()
 {
     $epanel_jsfolder = get_template_directory_uri() . '/epanel/js';
     nxt_enqueue_script('jquery-ui-tabs');
     nxt_enqueue_script('jquery-form');
     nxt_enqueue_script('epanel_checkbox', $epanel_jsfolder . '/checkbox.js');
     nxt_enqueue_script('epanel_functions_init', $epanel_jsfolder . '/functions-init.js');
     nxt_localize_script('epanel_functions_init', 'ePanelSettings', array('clearpath' => get_template_directory_uri() . '/epanel/images/empty.png', 'epanel_nonce' => nxt_create_nonce('epanel_nonce')));
     nxt_enqueue_script('epanel_colorpicker', $epanel_jsfolder . '/colorpicker.js');
     nxt_enqueue_script('epanel_eye', $epanel_jsfolder . '/eye.js');
 }
开发者ID:nxtclass,项目名称:NXTClass-themes,代码行数:11,代码来源:core_functions.php

示例2: addTopJs

    /**
     * Add the Javascript to the top
     **/
    function addTopJs()
    {
        ?>
		<script type="text/javascript">
		
			jQuery(document).ready(function(){
				
				// Add a link to see full stats on the Analytics website
				jQuery('#google-analytics-summary h3.hndle span').append('<span class="postbox-title-action"><a href="http://google.com/analytics/" class="edit-box open-box"><?php 
        _e('View Full Stat Report', 'google-analyticator');
        ?>
</a></span>');
				
				// Grab the widget data
				jQuery.ajax({
					type: 'post',
					url: 'admin-ajax.php',
					data: {
						action: 'ga_stats_widget',
						_ajax_nonce: '<?php 
        echo nxt_create_nonce("google-analyticator-statsWidget_get");
        ?>
'
					},
					success: function(html) {
						// Hide the loading message
						jQuery('#google-analytics-summary .inside small').remove();
						
						// Place the widget data in the area
						jQuery('#google-analytics-summary .inside .target').html(html);
						
						// Display the widget data
						jQuery('#google-analytics-summary .inside .target').slideDown();
						
						// Handle displaying the graph
						jQuery('.ga_visits').sparkline(ga_visits, { type:'line', width:'100%', height:'75px', lineColor:'#aaa', fillColor:'#f0f0f0', spotColor:false, minSpotColor:false, maxSpotColor:false, chartRangeMin:0 });
					}
				});
			
			});
		
		</script>
		<?php 
    }
开发者ID:nxtclass,项目名称:NXTClass-Plugin,代码行数:47,代码来源:google-analytics-summary-widget.php

示例3: openid_finish_login

/**
 * Action method for completing the 'login' action.  This action is used when a user is logging in from
 * nxt-login.php.
 *
 * @param string $identity_url verified OpenID URL
 */
function openid_finish_login($identity_url, $action)
{
    if ($action != 'login') {
        return;
    }
    // create new user account if appropriate
    $user_id = get_user_by_openid($identity_url);
    if ($identity_url && !$user_id && get_option('users_can_register')) {
        $user_data =& openid_get_user_data($identity_url);
        openid_create_new_user($identity_url, $user_data);
    }
    // return to nxt-login page
    $url = get_option('siteurl') . '/nxt-login.php';
    if (empty($identity_url)) {
        $url = add_query_arg('openid_error', openid_message(), $url);
    }
    $url = add_query_arg(array('finish_openid' => 1, 'identity_url' => urlencode($identity_url), 'redirect_to' => $_SESSION['openid_finish_url'], '_nxtnonce' => nxt_create_nonce('openid_login_' . md5($identity_url))), $url);
    nxt_safe_redirect($url);
    exit;
}
开发者ID:nxtclass,项目名称:NXTClass-Plugin,代码行数:26,代码来源:login.php

示例4: htmlspecialchars

echo htmlspecialchars($this->_config->get_string('minify.ccjs.path.java'));
?>
" size="60" /></td>
</tr>
<tr>
    <th><label for="minify_ccjs_path_jar">Path to JAR file:</label></th>
    <td><input id="minify_ccjs_path_jar" class="js_enabled" type="text" name="minify.ccjs.path.jar" value="<?php 
echo htmlspecialchars($this->_config->get_string('minify.ccjs.path.jar'));
?>
" size="60" /></td>
</tr>
<tr>
    <th>&nbsp;</th>
    <td>
        <input class="minifier_test button {type: 'ccjs', nonce: '<?php 
echo nxt_create_nonce('w3tc');
?>
'}" type="button" value="Test Closure Compiler" />
        <span class="minifier_test_status w3tc-status w3tc-process"></span>
    </td>
</tr>
<tr>
    <th><label for="minify_ccjs_options_compilation_level">Compilation level:</label></th>
    <td>
        <select id="minify_ccjs_options_compilation_level" class="js_enabled" name="minify.ccjs.options.compilation_level">
            <?php 
foreach ($compilation_levels as $compilation_level_key => $compilation_level_name) {
    ?>
            <option value="<?php 
    echo $compilation_level_key;
    ?>
开发者ID:nxtclass,项目名称:NXTClass,代码行数:31,代码来源:ccjs2.php

示例5: edit_assignment_screen

 /**
  * edit_assignment_screen( $vars )
  *
  * Hooks into screen_handler
  * Edit assignment screen
  *
  * @param Array $vars a set of variables received for this screen template
  * @return Array $vars a set of variable passed to this screen template
  */
 function edit_assignment_screen($vars)
 {
     global $bp;
     $nonce_name = 'edit_assignment';
     $updated_assignment_id = $this->current_assignment;
     $old_assignment = $this->is_assignment($this->current_assignment);
     if (!$this->has_assignment_caps($bp->loggedin_user->id) && !is_super_admin() || $bp->loggedin_user->id != $old_assignment->post_author) {
         $vars['die'] = __('BuddyPress Courseware Error while forbidden user tried to update the assignment.', 'bpsp');
         return $vars;
     }
     // Update assignment
     if (isset($_POST['assignment']) && $_POST['assignment']['object'] == 'group' && BPSP_Lectures::is_lecture($_POST['assignment']['lecture_id']) && isset($_POST['_nxtnonce'])) {
         $updated_assignment = $_POST['assignment'];
         $is_nonce = nxt_verify_nonce($_POST['_nxtnonce'], $nonce_name);
         if (true != $is_nonce) {
             $vars['error'] = __('Nonce Error while editing the assignment.', 'bpsp');
         } else {
             if (isset($updated_assignment['title']) && isset($updated_assignment['content']) && isset($updated_assignment['course_id']) && is_numeric($updated_assignment['group_id'])) {
                 $updated_assignment['title'] = strip_tags($updated_assignment['title']);
                 $updated_assignment_id = nxt_update_post(array('ID' => $old_assignment->ID, 'post_title' => $updated_assignment['title'], 'post_content' => $updated_assignment['content']));
                 if (is_object($updated_assignment_id) && isset($updated_assignment_id->ID)) {
                     $updated_assignment_id = $updated_assignment_id->ID;
                 }
                 if ($updated_assignment_id) {
                     nxt_set_post_terms($updated_assignment_id, $updated_assignment['course_id'], 'course_id');
                     if (strtotime($updated_assignment['due_date'])) {
                         update_post_meta($updated_assignment_id, 'due_date', $updated_assignment['due_date'], $old_assignment->due_date);
                     }
                     if (isset($updated_assignment['lecture_id'])) {
                         update_post_meta($updated_assignment_id, 'lecture_id', $updated_assignment['lecture_id']);
                     }
                     // Save the formbuilder
                     if (isset($updated_assignment['form']) && !empty($updated_assignment['form'])) {
                         $this->frmb->load_serialized($updated_assignment['form']);
                         if ($this->frmb->get_data()) {
                             update_post_meta($updated_assignment_id, 'form_data', $this->frmb->get_data(), $old_assignment->form_data);
                         }
                     }
                     $vars['message'] = __('Assignment was updated.', 'bpsp');
                     do_action('courseware_assignment_activity', $this->is_assignment($updated_assignment_id), 'update');
                 } else {
                     $vars['error'] = __('Assignment could not be updated.', 'bpsp');
                 }
             }
         }
     }
     $vars['name'] = 'edit_assignment';
     $vars['group_id'] = $bp->groups->current_group->id;
     $vars['user_id'] = $bp->loggedin_user->id;
     $vars['lecture_id'] = get_post_meta(isset($new_assignment_id) ? $new_assignment_id : $old_assignment->ID, 'lecture_id', true);
     $vars['lectures'] = BPSP_Lectures::has_lectures($bp->groups->current_group->id);
     $vars['assignment'] = $this->is_assignment($updated_assignment_id);
     $vars['assignment_edit_uri'] = $vars['current_uri'] . '/assignment/' . $this->current_assignment->post_name . '/edit/';
     $vars['assignment_delete_uri'] = $vars['current_uri'] . '/assignment/' . $this->current_assignment->post_name . '/delete/';
     $vars['assignment_permalink'] = $vars['current_uri'] . '/assignment/' . $this->current_assignment->post_name;
     $vars['nonce'] = nxt_nonce_field($nonce_name, '_nxtnonce', true, false);
     $vars['delete_nonce'] = add_query_arg('_nxtnonce', nxt_create_nonce('delete_assignment'), $vars['assignment_delete_uri']);
     $vars['trail'] = array($vars['assignment']->lecture->post_title => $vars['assignment']->lecture->permalink, __('Editing Assignment: ') . $vars['assignment']->post_title => $vars['assignment']->permalink);
     return $vars;
 }
开发者ID:nxtclass,项目名称:NXTClass-Plugin,代码行数:69,代码来源:assignments.class.php

示例6: bibs_screen

 /**
  * bibs_screen()
  *
  * Hooks into courseware_below_* for handling bibs screen
  */
 function bibs_screen($vars)
 {
     global $bp;
     $nonce_name = 'bibs';
     $nonce_delete_name = 'delete_bib';
     $nonce_edit_name = 'edit_bib';
     // Are we dealing with courses or assignments?
     if (isset($vars['assignment'])) {
         $post_id = $vars['assignment']->ID;
     } elseif (isset($vars['course'])) {
         $post_id = $vars['course']->ID;
     } else {
         $post_id = null;
     }
     if ($post_id) {
         $this->current_parent = $post_id;
     }
     $is_nonce = isset($_POST['_nxtnonce']) ? nxt_verify_nonce($_POST['_nxtnonce'], $nonce_name) : false;
     if ($is_nonce && isset($_POST['bib'])) {
         if (!$this->has_bib_caps($bp->loggedin_user->id) && !is_super_admin()) {
             $vars['die'] = __('BuddyPress Courseware Error while forbidden user tried to add bibliography entries.', 'bpsp');
             return $vars;
         }
         // Add an existing bib
         if (isset($_POST['bib']['existing']) && !empty($_POST['bib']['existing'])) {
             $data = $this->get_bib($_POST['bib']['existing']);
             if ($this->add_bib($data, false, $post_id)) {
                 $vars['message'] = __('Bibliography added', 'bpsp');
             } else {
                 $vars['error'] = __('Bibliography could not be added', 'bpsp');
             }
         } elseif (!empty($_POST['bib']['www']['title']) && !empty($_POST['bib']['www']['url'])) {
             if ($this->add_www($_POST['bib']['www'], $post_id)) {
                 $vars['message'] = __('Entry added', 'bpsp');
             } else {
                 $vars['error'] = __('Entry could not be added', 'bpsp');
             }
         } elseif (!empty($_POST['bib']['book'])) {
             if ($this->add_book($_POST['bib']['book'], $post_id)) {
                 $vars['message'] = __('Book added', 'bpsp');
             } else {
                 $vars['error'] = __('Book could not be added', 'bpsp');
             }
         } else {
             $vars['error'] = __('No bibliography entry could be added.', 'bpsp');
         }
     }
     if (isset($vars['course']) && $vars['course']->ID) {
         $this->current_parent = $vars['course']->ID;
     }
     if (isset($vars['assignment']) && $vars['assignment']->ID) {
         $this->current_parent = $vars['assignment']->ID;
     }
     $vars['has_bibs'] = true;
     $vars['post_id'] = $this->current_parent;
     $vars['has_bib_caps'] = $this->has_bib_caps($bp->loggedin_user->id);
     $vars['bibs'] = $this->has_bibs($this->current_parent);
     $vars['bibdb'] = $this->load_bibs(true);
     $vars['bibs_nonce'] = nxt_nonce_field($nonce_name, '_nxtnonce', true, false);
     $vars['bibs_delete_permalink'] = $vars['current_uri'] . '/delete_bibliography';
     $vars['bibs_edit_permalink'] = $vars['current_uri'] . '/edit_bibliography';
     $vars['bibs_delete_uri'] = add_query_arg('_nxtnonce', nxt_create_nonce($nonce_delete_name), $vars['bibs_delete_permalink']);
     $vars['bibs_edit_uri'] = $vars['current_uri'] . '/edit_bibliography';
     return $vars;
 }
开发者ID:nxtclass,项目名称:NXTClass,代码行数:70,代码来源:bibliography.class.php

示例7: woo_admin_head

function woo_admin_head()
{
    ?>
		<script type="text/javascript">
			jQuery(document).ready( function() {
				// Create sanitary variable for use in the JavaScript conditional.
				<?php 
    $is_reset = 'false';
    if (isset($_REQUEST['reset'])) {
        $is_reset = $_REQUEST['reset'];
        $is_reset = strtolower(strip_tags(trim($is_reset)));
    } else {
        $is_reset = 'false';
    }
    // End IF Statement
    ?>
			if( '<?php 
    echo $is_reset;
    ?>
' == 'true' ) {

				var reset_popup = jQuery( '#woo-popup-reset' );
				reset_popup.fadeIn();
				window.setTimeout(function() {
					   reset_popup.fadeOut();
					}, 2000);
			}

			//Update Message popup
			jQuery.fn.center = function () {
				this.animate({"top":( jQuery(window).height() - this.height() - 200 ) / 2+jQuery(window).scrollTop() + "px"},100);
				this.css( "left", 250 );
				return this;
			}

			jQuery( '#woo-popup-save' ).center();
			jQuery( '#woo-popup-reset' ).center();
			jQuery(window).scroll(function() {

				jQuery( '#woo-popup-save' ).center();
				jQuery( '#woo-popup-reset' ).center();

			});

			//Save everything else
			jQuery( '#wooform' ).submit(function() {

					function newValues() {
					  var serializedValues = jQuery( "#wooform *").not( '.woo-ignore').serialize();
					  return serializedValues;
					}
					jQuery( ":checkbox, :radio").click(newValues);
					jQuery( "select").change(newValues);
					jQuery( '.ajax-loading-img').fadeIn();
					var serializedReturn = newValues();

					// var ajax_url = '<?php 
    echo admin_url("admin-ajax.php");
    ?>
';

					 //var data = {data : serializedReturn};
					var data = {
						<?php 
    if (isset($_REQUEST['page']) && $_REQUEST['page'] == 'woothemes') {
        ?>
						type: 'options',
						<?php 
    }
    ?>
						<?php 
    if (isset($_REQUEST['page']) && $_REQUEST['page'] == 'woothemes_framework_settings') {
        ?>
						type: 'framework',
						<?php 
    }
    ?>
						<?php 
    if (isset($_REQUEST['page']) && $_REQUEST['page'] == 'woothemes_seo') {
        ?>
						type: 'seo',
						<?php 
    }
    ?>
						<?php 
    if (isset($_REQUEST['page']) && $_REQUEST['page'] == 'woothemes_tumblog') {
        ?>
						type: 'tumblog',
						<?php 
    }
    ?>

						action: 'woo_ajax_post_action',
						data: serializedReturn,

						<?php 
    // Nonce Security
    ?>
						<?php 
    if (function_exists('nxt_create_nonce')) {
//.........这里部分代码省略.........
开发者ID:nxtclass,项目名称:NXTClass-themes,代码行数:101,代码来源:admin-interface.php

示例8: single_response_screen

 /**
  * single_response_screen( $vars )
  *
  * Hooks into screen_handler
  * Displays a single response screen
  *
  * @param Array $vars a set of variables received for this screen template
  * @return Array $vars a set of variable passed to this screen template
  */
 function single_response_screen($vars)
 {
     global $bp;
     $nonce_delete_name = 'response_delete';
     $response = null;
     if (!empty($this->current_response)) {
         $response = $this->current_response;
     } else {
         $response = $this->has_response();
     }
     if ($this->group_responses_status() && !$this->has_response_caps() && $bp->loggedin_user->id != $response->post_author) {
         $vars['die'] = __('BuddyPress Courseware Error while forbidden user tried to access a private response.', 'bpsp');
         return $vars;
     }
     $vars['name'] = 'single_response';
     $vars['assignment_permalink'] = $vars['current_uri'] . '/assignment/' . $this->current_assignment->post_name;
     $vars['assignment'] = $this->current_assignment;
     $vars['response'] = $response;
     if (is_super_admin() || $this->has_response_caps()) {
         $vars['response_delete_permalink'] = $vars['assignment_permalink'] . '/response/' . $response->post_name . '/delete';
         $vars['response_delete_uri'] = add_query_arg('_nxtnonce', nxt_create_nonce($nonce_delete_name), $vars['response_delete_permalink']);
     }
     $vars['trail'] = array($this->current_assignment->lecture->post_title => $this->current_assignment->lecture->permalink, $this->current_assignment->post_title => $this->current_assignment->permalink, $response->post_title => '');
     return apply_filters('courseware_response', $vars);
 }
开发者ID:nxtclass,项目名称:NXTClass,代码行数:34,代码来源:responses.class.php

示例9: column_comment

    function column_comment($comment)
    {
        global $post, $comment_status;
        $user_can = $this->user_can;
        $comment_url = esc_url(get_comment_link($comment->comment_ID));
        $the_comment_status = nxt_get_comment_status($comment->comment_ID);
        $ptime = date('G', strtotime($comment->comment_date));
        if (abs(time() - $ptime) < 86400) {
            $ptime = sprintf(__('%s ago'), human_time_diff($ptime));
        } else {
            $ptime = mysql2date(__('Y/m/d \\a\\t g:i A'), $comment->comment_date);
        }
        if ($user_can) {
            $del_nonce = esc_html('_nxtnonce=' . nxt_create_nonce("delete-comment_{$comment->comment_ID}"));
            $approve_nonce = esc_html('_nxtnonce=' . nxt_create_nonce("approve-comment_{$comment->comment_ID}"));
            $url = "comment.php?c={$comment->comment_ID}";
            $approve_url = esc_url($url . "&action=approvecomment&{$approve_nonce}");
            $unapprove_url = esc_url($url . "&action=unapprovecomment&{$approve_nonce}");
            $spam_url = esc_url($url . "&action=spamcomment&{$del_nonce}");
            $unspam_url = esc_url($url . "&action=unspamcomment&{$del_nonce}");
            $trash_url = esc_url($url . "&action=trashcomment&{$del_nonce}");
            $untrash_url = esc_url($url . "&action=untrashcomment&{$del_nonce}");
            $delete_url = esc_url($url . "&action=deletecomment&{$del_nonce}");
        }
        echo '<div class="submitted-on">';
        /* translators: 2: comment date, 3: comment time */
        printf(__('Submitted on <a href="%1$s">%2$s at %3$s</a>'), $comment_url, get_comment_date(__('Y/m/d')), get_comment_date(get_option('time_format')));
        if ($comment->comment_parent) {
            $parent = get_comment($comment->comment_parent);
            $parent_link = esc_url(get_comment_link($comment->comment_parent));
            $name = get_comment_author($parent->comment_ID);
            printf(' | ' . __('In reply to <a href="%1$s">%2$s</a>.'), $parent_link, $name);
        }
        echo '</div>';
        comment_text();
        if ($user_can) {
            ?>
		<div id="inline-<?php 
            echo $comment->comment_ID;
            ?>
" class="hidden">
		<textarea class="comment" rows="1" cols="1"><?php 
            echo esc_textarea(apply_filters('comment_edit_pre', $comment->comment_content));
            ?>
</textarea>
		<div class="author-email"><?php 
            echo esc_attr($comment->comment_author_email);
            ?>
</div>
		<div class="author"><?php 
            echo esc_attr($comment->comment_author);
            ?>
</div>
		<div class="author-url"><?php 
            echo esc_attr($comment->comment_author_url);
            ?>
</div>
		<div class="comment_status"><?php 
            echo $comment->comment_approved;
            ?>
</div>
		</div>
		<?php 
        }
        if ($user_can) {
            // preorder it: Approve | Reply | Quick Edit | Edit | Spam | Trash
            $actions = array('approve' => '', 'unapprove' => '', 'reply' => '', 'quickedit' => '', 'edit' => '', 'spam' => '', 'unspam' => '', 'trash' => '', 'untrash' => '', 'delete' => '');
            if ($comment_status && 'all' != $comment_status) {
                // not looking at all comments
                if ('approved' == $the_comment_status) {
                    $actions['unapprove'] = "<a href='{$unapprove_url}' class='delete:the-comment-list:comment-{$comment->comment_ID}:e7e7d3:action=dim-comment&amp;new=unapproved vim-u vim-destructive' title='" . esc_attr__('Unapprove this comment') . "'>" . __('Unapprove') . '</a>';
                } else {
                    if ('unapproved' == $the_comment_status) {
                        $actions['approve'] = "<a href='{$approve_url}' class='delete:the-comment-list:comment-{$comment->comment_ID}:e7e7d3:action=dim-comment&amp;new=approved vim-a vim-destructive' title='" . esc_attr__('Approve this comment') . "'>" . __('Approve') . '</a>';
                    }
                }
            } else {
                $actions['approve'] = "<a href='{$approve_url}' class='dim:the-comment-list:comment-{$comment->comment_ID}:unapproved:e7e7d3:e7e7d3:new=approved vim-a' title='" . esc_attr__('Approve this comment') . "'>" . __('Approve') . '</a>';
                $actions['unapprove'] = "<a href='{$unapprove_url}' class='dim:the-comment-list:comment-{$comment->comment_ID}:unapproved:e7e7d3:e7e7d3:new=unapproved vim-u' title='" . esc_attr__('Unapprove this comment') . "'>" . __('Unapprove') . '</a>';
            }
            if ('spam' != $the_comment_status && 'trash' != $the_comment_status) {
                $actions['spam'] = "<a href='{$spam_url}' class='delete:the-comment-list:comment-{$comment->comment_ID}::spam=1 vim-s vim-destructive' title='" . esc_attr__('Mark this comment as spam') . "'>" . _x('Spam', 'verb') . '</a>';
            } elseif ('spam' == $the_comment_status) {
                $actions['unspam'] = "<a href='{$unspam_url}' class='delete:the-comment-list:comment-{$comment->comment_ID}:66cc66:unspam=1 vim-z vim-destructive'>" . _x('Not Spam', 'comment') . '</a>';
            } elseif ('trash' == $the_comment_status) {
                $actions['untrash'] = "<a href='{$untrash_url}' class='delete:the-comment-list:comment-{$comment->comment_ID}:66cc66:untrash=1 vim-z vim-destructive'>" . __('Restore') . '</a>';
            }
            if ('spam' == $the_comment_status || 'trash' == $the_comment_status || !EMPTY_TRASH_DAYS) {
                $actions['delete'] = "<a href='{$delete_url}' class='delete:the-comment-list:comment-{$comment->comment_ID}::delete=1 delete vim-d vim-destructive'>" . __('Delete Permanently') . '</a>';
            } else {
                $actions['trash'] = "<a href='{$trash_url}' class='delete:the-comment-list:comment-{$comment->comment_ID}::trash=1 delete vim-d vim-destructive' title='" . esc_attr__('Move this comment to the trash') . "'>" . _x('Trash', 'verb') . '</a>';
            }
            if ('spam' != $the_comment_status && 'trash' != $the_comment_status) {
                $actions['edit'] = "<a href='comment.php?action=editcomment&amp;c={$comment->comment_ID}' title='" . esc_attr__('Edit comment') . "'>" . __('Edit') . '</a>';
                $actions['quickedit'] = '<a onclick="commentReply.open( \'' . $comment->comment_ID . '\',\'' . $post->ID . '\',\'edit\' );return false;" class="vim-q" title="' . esc_attr__('Quick Edit') . '" href="#">' . __('Quick&nbsp;Edit') . '</a>';
                $actions['reply'] = '<a onclick="commentReply.open( \'' . $comment->comment_ID . '\',\'' . $post->ID . '\' );return false;" class="vim-r" title="' . esc_attr__('Reply to this comment') . '" href="#">' . __('Reply') . '</a>';
            }
            $actions = apply_filters('comment_row_actions', array_filter($actions), $comment);
            $i = 0;
            echo '<div class="row-actions">';
//.........这里部分代码省略.........
开发者ID:nxtclass,项目名称:NXTClass,代码行数:101,代码来源:class-nxt-comments-list-table.php

示例10: ga_admin_ajax

/**
 * Adds AJAX to the GA settings page
 **/
function ga_admin_ajax()
{
    if (function_exists('register_widget')) {
        # Only attempt to replace code if we're authenticated or attempting to authenticate
        if (isset($_REQUEST['token']) && $_REQUEST['token'] != '' || trim(get_option('ga_google_token')) != '') {
            ?>
		<script type="text/javascript">
	
			jQuery(document).ready(function(){
			
				// Grab the widget data
				jQuery.ajax({
					type: 'post',
					url: 'admin-ajax.php',
					data: {
						action: 'ga_ajax_accounts',
						_ajax_nonce: '<?php 
            echo nxt_create_nonce("google-analyticator-accounts_get");
            ?>
'<?php 
            if (isset($_GET['token'])) {
                ?>
,
						token: '<?php 
                echo esc_js($_GET["token"]);
                ?>
'
						<?php 
            }
            ?>
					},
					success: function(html) {
						if ( html != '' )
							jQuery('#ga_ajax_accounts').html(html);
						else
							jQuery('#ga_connect_error').show();
					}
				});
		
			});
	
		</script>
		<?php 
        }
    }
}
开发者ID:nxtclass,项目名称:NXTClass-Plugin,代码行数:49,代码来源:google-analyticator.php

示例11: _nxt_dashboard_recent_comments_row

function _nxt_dashboard_recent_comments_row(&$comment, $show_date = true)
{
    $GLOBALS['comment'] =& $comment;
    $comment_post_url = get_edit_post_link($comment->comment_post_ID);
    $comment_post_title = strip_tags(get_the_title($comment->comment_post_ID));
    $comment_post_link = "<a href='{$comment_post_url}'>{$comment_post_title}</a>";
    $comment_link = '<a class="comment-link" href="' . esc_url(get_comment_link()) . '">#</a>';
    $actions_string = '';
    if (current_user_can('edit_comment', $comment->comment_ID)) {
        // preorder it: Approve | Reply | Edit | Spam | Trash
        $actions = array('approve' => '', 'unapprove' => '', 'reply' => '', 'edit' => '', 'spam' => '', 'trash' => '', 'delete' => '');
        $del_nonce = esc_html('_nxtnonce=' . nxt_create_nonce("delete-comment_{$comment->comment_ID}"));
        $approve_nonce = esc_html('_nxtnonce=' . nxt_create_nonce("approve-comment_{$comment->comment_ID}"));
        $approve_url = esc_url("comment.php?action=approvecomment&p={$comment->comment_post_ID}&c={$comment->comment_ID}&{$approve_nonce}");
        $unapprove_url = esc_url("comment.php?action=unapprovecomment&p={$comment->comment_post_ID}&c={$comment->comment_ID}&{$approve_nonce}");
        $spam_url = esc_url("comment.php?action=spamcomment&p={$comment->comment_post_ID}&c={$comment->comment_ID}&{$del_nonce}");
        $trash_url = esc_url("comment.php?action=trashcomment&p={$comment->comment_post_ID}&c={$comment->comment_ID}&{$del_nonce}");
        $delete_url = esc_url("comment.php?action=deletecomment&p={$comment->comment_post_ID}&c={$comment->comment_ID}&{$del_nonce}");
        $actions['approve'] = "<a href='{$approve_url}' class='dim:the-comment-list:comment-{$comment->comment_ID}:unapproved:e7e7d3:e7e7d3:new=approved vim-a' title='" . esc_attr__('Approve this comment') . "'>" . __('Approve') . '</a>';
        $actions['unapprove'] = "<a href='{$unapprove_url}' class='dim:the-comment-list:comment-{$comment->comment_ID}:unapproved:e7e7d3:e7e7d3:new=unapproved vim-u' title='" . esc_attr__('Unapprove this comment') . "'>" . __('Unapprove') . '</a>';
        $actions['edit'] = "<a href='comment.php?action=editcomment&amp;c={$comment->comment_ID}' title='" . esc_attr__('Edit comment') . "'>" . __('Edit') . '</a>';
        $actions['reply'] = '<a onclick="commentReply.open(\'' . $comment->comment_ID . '\',\'' . $comment->comment_post_ID . '\');return false;" class="vim-r hide-if-no-js" title="' . esc_attr__('Reply to this comment') . '" href="#">' . __('Reply') . '</a>';
        $actions['spam'] = "<a href='{$spam_url}' class='delete:the-comment-list:comment-{$comment->comment_ID}::spam=1 vim-s vim-destructive' title='" . esc_attr__('Mark this comment as spam') . "'>" . _x('Spam', 'verb') . '</a>';
        if (!EMPTY_TRASH_DAYS) {
            $actions['delete'] = "<a href='{$delete_url}' class='delete:the-comment-list:comment-{$comment->comment_ID}::trash=1 delete vim-d vim-destructive'>" . __('Delete Permanently') . '</a>';
        } else {
            $actions['trash'] = "<a href='{$trash_url}' class='delete:the-comment-list:comment-{$comment->comment_ID}::trash=1 delete vim-d vim-destructive' title='" . esc_attr__('Move this comment to the trash') . "'>" . _x('Trash', 'verb') . '</a>';
        }
        $actions = apply_filters('comment_row_actions', array_filter($actions), $comment);
        $i = 0;
        foreach ($actions as $action => $link) {
            ++$i;
            ('approve' == $action || 'unapprove' == $action) && 2 === $i || 1 === $i ? $sep = '' : ($sep = ' | ');
            // Reply and quickedit need a hide-if-no-js span
            if ('reply' == $action || 'quickedit' == $action) {
                $action .= ' hide-if-no-js';
            }
            $actions_string .= "<span class='{$action}'>{$sep}{$link}</span>";
        }
    }
    ?>

		<div id="comment-<?php 
    echo $comment->comment_ID;
    ?>
" <?php 
    comment_class(array('comment-item', nxt_get_comment_status($comment->comment_ID)));
    ?>
>
			<?php 
    if (!$comment->comment_type || 'comment' == $comment->comment_type) {
        ?>

			<?php 
        echo get_avatar($comment, 50);
        ?>

			<div class="dashboard-comment-wrap">
			<h4 class="comment-meta">
				<?php 
        printf(__('From %1$s on %2$s%3$s'), '<cite class="comment-author">' . get_comment_author_link() . '</cite>', $comment_post_link . ' ' . $comment_link, ' <span class="approve">' . __('[Pending]') . '</span>');
        ?>
			</h4>

			<?php 
    } else {
        switch ($comment->comment_type) {
            case 'pingback':
                $type = __('Pingback');
                break;
            case 'trackback':
                $type = __('Trackback');
                break;
            default:
                $type = ucwords($comment->comment_type);
        }
        $type = esc_html($type);
        ?>
			<div class="dashboard-comment-wrap">
			<?php 
        /* translators: %1$s is type of comment, %2$s is link to the post */
        ?>
			<h4 class="comment-meta"><?php 
        printf(_x('%1$s on %2$s', 'dashboard'), "<strong>{$type}</strong>", $comment_post_link . " " . $comment_link);
        ?>
</h4>
			<p class="comment-author"><?php 
        comment_author_link();
        ?>
</p>

			<?php 
    }
    // comment_type
    ?>
			<blockquote><p><?php 
    comment_excerpt();
    ?>
</p></blockquote>
			<p class="row-actions"><?php 
//.........这里部分代码省略.........
开发者ID:nxtclass,项目名称:NXTClass,代码行数:101,代码来源:dashboard.php

示例12: openid_parse_request

/**
 * Parse the NXTClass request.  If the query var 'openid' is present, then
 * handle the request accordingly.
 *
 * @param nxt $nxt nxt instance for the current request
 */
function openid_parse_request($nxt)
{
    if (array_key_exists('openid', $nxt->query_vars)) {
        openid_clean_request();
        switch ($nxt->query_vars['openid']) {
            case 'consumer':
                @session_start();
                $action = $_SESSION['openid_action'];
                // no action, which probably means OP-initiated login.  Set
                // action to 'login', and redirect to home page when finished
                if (empty($action)) {
                    $action = 'login';
                    if (empty($_SESSION['openid_finish_url'])) {
                        //$_SESSION['openid_finish_url'] = get_option('home');
                    }
                }
                finish_openid($action);
                break;
            case 'server':
                openid_server_request($_REQUEST['action']);
                break;
            case 'ajax':
                if (check_admin_referer('openid_ajax')) {
                    header('Content-Type: application/json');
                    echo '{ "valid":' . (is_url_openid($_REQUEST['url']) ? 'true' : 'false') . ', "nonce":"' . nxt_create_nonce('openid_ajax') . '" }';
                    exit;
                }
        }
    }
}
开发者ID:nxtclass,项目名称:NXTClass-Plugin,代码行数:36,代码来源:common.php

示例13: members_content_permissions_meta_box

/**
 * @since 0.1.0
 */
function members_content_permissions_meta_box($object, $box)
{
    global $nxt_roles;
    /* Get the roles saved for the post. */
    $roles = get_post_meta($object->ID, '_members_access_role', false);
    /* Convert old post meta to the new system if no roles were found. */
    if (empty($roles)) {
        $roles = members_convert_old_post_meta($object->ID);
    }
    ?>

	<input type="hidden" name="content_permissions_meta_nonce" value="<?php 
    echo nxt_create_nonce(plugin_basename(__FILE__));
    ?>
" />

	<div style="overflow: hidden; margin-left: 5px;">

		<p>
		<?php 
    _e("Limit access to this post's content to users of the selected roles.", 'members');
    ?>
		</p>

		<?php 
    /* Loop through each of the available roles. */
    foreach ($nxt_roles->role_names as $role => $name) {
        $checked = false;
        /* If the role has been selected, make sure it's checked. */
        if (is_array($roles) && in_array($role, $roles)) {
            $checked = ' checked="checked" ';
        }
        ?>

			<div style="width: 32%; float: left; margin: 0 0 5px 0;">
				<label for="members_access_role-<?php 
        echo $role;
        ?>
">
					<input type="checkbox" name="members_access_role[<?php 
        echo $role;
        ?>
]" id="members_access_role-<?php 
        echo $role;
        ?>
" <?php 
        echo $checked;
        ?>
 value="<?php 
        echo $role;
        ?>
" /> 
					<?php 
        echo esc_html($name);
        ?>
				</label>
			</div>
		<?php 
    }
    ?>

	</div>

	<p style="clear: left;">
		<span class="howto"><?php 
    printf(__('If no roles are selected, everyone can view the content. The post author, any users who can edit this post, and users with the %s capability can view the content regardless of role.', 'members'), '<code>restrict_content</code>');
    ?>
</span>
	</p>

	<p>
		<label for="members_access_error"><?php 
    _e('Custom error messsage:', 'members');
    ?>
</label>
		<textarea id="members_access_error" name="members_access_error" cols="60" rows="2" tabindex="30" style="width: 99%;"><?php 
    echo esc_html(get_post_meta($object->ID, '_members_access_error', true));
    ?>
</textarea>
		<br />
		<span class="howto"><?php 
    _e('Message shown to users that do no have permission to view the post.', 'members');
    ?>
</span>
	</p>

<?php 
}
开发者ID:nxtclass,项目名称:NXTClass-Plugin,代码行数:91,代码来源:meta-box-post-content-permissions.php

示例14: woothemes_framework_settings_page

function woothemes_framework_settings_page()
{
    $themename = get_option('woo_themename');
    $manualurl = get_option('woo_manual');
    $shortname = 'framework_woo';
    //Framework Version in Backend Head
    $woo_framework_version = get_option('woo_framework_version');
    //Version in Backend Head
    $theme_data = get_theme_data(get_template_directory() . '/style.css');
    $local_version = $theme_data['Version'];
    //GET themes update RSS feed and do magic
    include_once ABSPATH . nxtINC . '/feed.php';
    $pos = strpos($manualurl, 'documentation');
    $theme_slug = str_replace("/", '', substr($manualurl, $pos + 13));
    //13 for the word documentation
    //add filter to make the rss read cache clear every 4 hours
    add_filter('nxt_feed_cache_transient_lifetime', create_function('$a', 'return 14400;'));
    $framework_options = array();
    $framework_options[] = array('name' => __('Admin Settings', 'woothemes'), 'icon' => 'general', 'type' => 'heading');
    $framework_options[] = array('name' => __('Super User (username)', 'woothemes'), 'desc' => sprintf(__('Enter your %s to hide the Framework Settings and Update Framework from other users. Can be reset from the %s under %s.', 'woothemes'), '<strong>' . __('username', 'woothemes') . '</strong>', '<a href="' . admin_url('options.php') . '">' . __('nxt options page', 'woothemes') . '</a>', '<code>framework_woo_super_user</code>'), 'id' => $shortname . '_super_user', 'std' => '', 'class' => 'text', 'type' => 'text');
    $framework_options[] = array('name' => __('Disable SEO Menu Item', 'woothemes'), 'desc' => sprintf(__('Disable the %s menu item in the theme menu.', 'woothemes'), '<strong>' . __('SEO', 'woothemes') . '</strong>'), 'id' => $shortname . '_seo_disable', 'std' => '', 'type' => 'checkbox');
    $framework_options[] = array('name' => __('Disable Sidebar Manager Menu Item', 'woothemes'), 'desc' => sprintf(__('Disable the %s menu item in the theme menu.', 'woothemes'), '<strong>' . __('Sidebar Manager', 'woothemes') . '</strong>'), 'id' => $shortname . '_sbm_disable', 'std' => '', 'type' => 'checkbox');
    $framework_options[] = array('name' => __('Disable Backup Settings Menu Item', 'woothemes'), 'desc' => sprintf(__('Disable the %s menu item in the theme menu.', 'woothemes'), '<strong>' . __('Backup Settings', 'woothemes') . '</strong>'), 'id' => $shortname . '_backupmenu_disable', 'std' => '', 'type' => 'checkbox');
    $framework_options[] = array('name' => __('Disable Buy Themes Menu Item', 'woothemes'), 'desc' => sprintf(__('Disable the %s menu item in the theme menu.', 'woothemes'), '<strong>' . __('Buy Themes', 'woothemes') . '</strong>'), 'id' => $shortname . '_buy_themes_disable', 'std' => '', 'type' => 'checkbox');
    $framework_options[] = array('name' => __('Enable Custom Navigation', 'woothemes'), 'desc' => sprintf(__('Enable the old %s menu item. Try to use %s instead, as this function is outdated.', 'woothemes'), '<strong>' . __('Custom Navigation', 'woothemes') . '</strong>', '<a href="' . admin_url('nav-menus.php') . '">' . __('nxt Menus', 'woothemes') . '</a>'), 'id' => $shortname . '_woonav', 'std' => '', 'type' => 'checkbox');
    $framework_options[] = array('name' => __('Theme Update Notification', 'woothemes'), 'desc' => __('This will enable notices on your theme options page that there is an update available for your theme.', 'woothemes'), 'id' => $shortname . '_theme_version_checker', 'std' => '', 'type' => 'checkbox');
    $framework_options[] = array('name' => __('WooFramework Update Notification', 'woothemes'), 'desc' => __('This will enable notices on your theme options page that there is an update available for the WooFramework.', 'woothemes'), 'id' => $shortname . '_framework_version_checker', 'std' => '', 'type' => 'checkbox');
    $framework_options[] = array('name' => __('Theme Settings', 'woothemes'), 'icon' => 'general', 'type' => 'heading');
    $framework_options[] = array('name' => __('Remove Generator Meta Tags', 'woothemes'), 'desc' => __('This disables the output of generator meta tags in the HEAD section of your site.', 'woothemes'), 'id' => $shortname . '_disable_generator', 'std' => '', 'type' => 'checkbox');
    $framework_options[] = array('name' => __('Image Placeholder', 'woothemes'), 'desc' => __('Set a default image placeholder for your thumbnails. Use this if you want a default image to be shown if you haven\'t added a custom image to your post.', 'woothemes'), 'id' => $shortname . '_default_image', 'std' => '', 'type' => 'upload');
    $framework_options[] = array('name' => __('Disable Shortcodes Stylesheet', 'woothemes'), 'desc' => __('This disables the output of shortcodes.css in the HEAD section of your site.', 'woothemes'), 'id' => $shortname . '_disable_shortcodes', 'std' => '', 'type' => 'checkbox');
    $framework_options[] = array('name' => __('Output "Tracking Code" Option in Header', 'woothemes'), 'desc' => sprintf(__('This will output the %s option in your header instead of the footer of your website.', 'woothemes'), '<strong>' . __('Tracking Code', 'woothemes') . '</strong>'), 'id' => $shortname . '_move_tracking_code', 'std' => 'false', 'type' => 'checkbox');
    $framework_options[] = array('name' => __('Branding', 'woothemes'), 'icon' => 'misc', 'type' => 'heading');
    $framework_options[] = array('name' => __('Options panel header', 'woothemes'), 'desc' => __('Change the header image for the WooThemes Backend.', 'woothemes'), 'id' => $shortname . '_backend_header_image', 'std' => '', 'type' => 'upload');
    $framework_options[] = array('name' => __('Options panel icon', 'woothemes'), 'desc' => __('Change the icon image for the NXTClass backend sidebar.', 'woothemes'), 'id' => $shortname . '_backend_icon', 'std' => '', 'type' => 'upload');
    $framework_options[] = array('name' => __('NXTClass login logo', 'woothemes'), 'desc' => __('Change the logo image for the NXTClass login page.', 'woothemes'), 'id' => $shortname . '_custom_login_logo', 'std' => '', 'type' => 'upload');
    $framework_options[] = array('name' => __('NXTClass login URL', 'woothemes'), 'desc' => __('Change the URL that the logo image on the NXTClass login page links to.', 'woothemes'), 'id' => $shortname . '_custom_login_logo_url', 'std' => '', 'class' => 'text', 'type' => 'text');
    $framework_options[] = array('name' => __('NXTClass login logo Title', 'woothemes'), 'desc' => __('Change the title of the logo image on the NXTClass login page.', 'woothemes'), 'id' => $shortname . '_custom_login_logo_title', 'std' => '', 'class' => 'text', 'type' => 'text');
    /*
    	$framework_options[] = array( 	'name' => __( 'Font Stacks (Beta)', 'woothemes' ),
    									'icon' => 'typography',
    									'type' => 'heading' );
    
    	$framework_options[] = array( 	'name' => __( 'Font Stack Builder', 'woothemes' ),
    									'desc' => __( 'Use the font stack builder to add your own custom font stacks to your theme.
    									To create a new stack, fill in the name and a CSS ready font stack.
    									Once you have added a stack you can select it from the font menu on any of the
    									Typography settings in your theme options.', 'woothemes' ),
    									'id' => $shortname . '_font_stack',
    									'std' => 'Added Font Stacks',
    									'type' => 'string_builder" );
    */
    global $nxt_version;
    if ($nxt_version >= '3.1') {
        $framework_options[] = array('name' => __('NXTClass Toolbar', 'woothemes'), 'icon' => 'header', 'type' => 'heading');
        $framework_options[] = array('name' => __('Disable NXTClass Toolbar', 'woothemes'), 'desc' => __('Disable the NXTClass Toolbar.', 'woothemes'), 'id' => $shortname . '_admin_bar_disable', 'std' => '', 'type' => 'checkbox');
        $framework_options[] = array('name' => __('Enable the WooFramework Toolbar enhancements', 'woothemes'), 'desc' => __('Enable several WooFramework-specific enhancements to the NXTClass Toolbar, such as custom navigation items for "Theme Options".', 'woothemes'), 'id' => $shortname . '_admin_bar_enhancements', 'std' => '', 'type' => 'checkbox');
    }
    // PressTrends Integration
    if (defined('WOO_PRESSTRENDS_THEMEKEY')) {
        $framework_options[] = array('name' => __('PressTrends', 'woothemes'), 'icon' => 'presstrends', 'type' => 'heading');
        $framework_options[] = array('name' => __('Enable PressTrends Tracking', 'woothemes'), 'desc' => __('Enable sending of usage data to PressTrends.', 'woothemes'), 'id' => $shortname . '_presstrends_enable', 'std' => 'false', 'type' => 'checkbox');
        $framework_options[] = array('name' => __('What is PressTrends?', 'woothemes'), 'desc' => '', 'id' => $shortname . '_presstrends_info', 'std' => sprintf(__('PressTrends is a simple usage tracker that allows us to see how our customers are using WooThemes themes - so that we can help improve them for you. %sNone%s of your personal data is sent to PressTrends.%sFor more information, please view the PressTrends %s.', 'woothemes'), '<strong>', '</strong>', '<br /><br />', '<a href="http://presstrends.io/privacy" target="_blank">' . __('privacy policy', 'woothemes') . '</a>'), 'type' => 'info');
    }
    update_option('woo_framework_template', $framework_options);
    ?>

    <div class="wrap" id="woo_container">
    <div id="woo-popup-save" class="woo-save-popup"><div class="woo-save-save"><?php 
    _e('Options Updated', 'woothemes');
    ?>
</div></div>
    <div id="woo-popup-reset" class="woo-save-popup"><div class="woo-save-reset"><?php 
    _e('Options Reset', 'woothemes');
    ?>
</div></div>
        <form action='' enctype="multipart/form-data" id="wooform" method="post">
        <?php 
    // Add nonce for added security.
    if (function_exists('nxt_nonce_field')) {
        nxt_nonce_field('wooframework-framework-options-update');
    }
    // End IF Statement
    $woo_nonce = '';
    if (function_exists('nxt_create_nonce')) {
        $woo_nonce = nxt_create_nonce('wooframework-framework-options-update');
    }
    // End IF Statement
    if ($woo_nonce == '') {
    } else {
        ?>
	    	<input type="hidden" name="_ajax_nonce" value="<?php 
        echo $woo_nonce;
        ?>
" />
	    <?php 
    }
    // End IF Statement
    ?>
            <div id="header">
//.........这里部分代码省略.........
开发者ID:nxtclass,项目名称:NXTClass-themes,代码行数:101,代码来源:admin-framework-settings.php

示例15: signup_nonce_check

/**
 * Process the signup nonce created in signup_nonce_fields().
 *
 * @since MU
 * @uses nxt_create_nonce()
 *
 * @param array $result
 * @return array
 */
function signup_nonce_check($result)
{
    if (!strpos($_SERVER['PHP_SELF'], 'nxt-signup.php')) {
        return $result;
    }
    if (nxt_create_nonce('signup_form_' . $_POST['signup_form_id']) != $_POST['_signup_form']) {
        nxt_die(__('Please try again!'));
    }
    return $result;
}
开发者ID:nxtclass,项目名称:NXTClass,代码行数:19,代码来源:ms-functions.php


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