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


PHP SendPress_Admin::access方法代码示例

本文整理汇总了PHP中SendPress_Admin::access方法的典型用法代码示例。如果您正苦于以下问题:PHP SendPress_Admin::access方法的具体用法?PHP SendPress_Admin::access怎么用?PHP SendPress_Admin::access使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SendPress_Admin的用法示例。


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

示例1: column_default

 /** ************************************************************************
  * Recommended. This method is called when the parent class can't find a method
  * specifically build for a given column. Generally, it's recommended to include
  * one method for each column you want to render, keeping your package class
  * neat and organized. For example, if the class needs to process a column
  * named 'title', it would first see if a method named $this->column_title() 
  * exists - if it does, that method will be used. If it doesn't, this one will
  * be used. Generally, you should try to use custom column methods as much as 
  * possible. 
  * 
  * Since we have defined a column_title() method later on, this method doesn't
  * need to concern itself with any column with a name of 'title'. Instead, it
  * needs to handle everything else.
  * 
  * For more detailed insight into how columns are handled, take a look at 
  * WP_List_Table::single_row_columns()
  * 
  * @param array $item A singular item (one full row's worth of data)
  * @param array $column_name The name/slug of the column to be processed
  * @return string Text or HTML to be placed inside the column <td>
  **************************************************************************/
 function column_default($item, $column_name)
 {
     switch ($column_name) {
         /* case 'firstname':
         			case 'lastname':
         				return $item->$column_name;
         			case 'status':
         			   return $item->$column_name;
         		   
         		   */
         case 'subject':
             $sub = get_post_meta($item->ID, "_sendpress_subject", true);
             return $sub;
         case 'lastsend':
             $date = get_post_meta($item->ID, "send_date", true);
             if (!empty($date)) {
                 return date_i18n(get_option('date_format'), strtotime($date));
             }
             return '';
         case 'created':
             return date_i18n(get_option('date_format'), strtotime($item->post_date));
         case 'actions':
             $a = '<div class="inline-buttons">';
             $a .= '<a class="btn btn-default view-btn" title="' . get_post_meta($item->ID, "_sendpress_subject", true) . '" href="' . get_permalink($item->ID) . '"><span class="glyphicon  glyphicon-eye-open"></span> ' . __('View', 'sendpress') . '</a> ';
             $editwindow = 'style';
             if (get_post_meta($item->ID, '_sendpress_system', true) == 'new') {
                 $editwindow = 'edit';
             }
             $a .= '<a class="btn btn-primary" href="?page=' . SPNL()->validate->page($_REQUEST['page']) . '&view=' . $editwindow . '&emailID=' . $item->ID . '"><span class="glyphicon glyphicon-edit"></span> ' . __('Edit', 'sendpress') . '</a> ';
             $a = apply_filters('sendpress_email_table', $a, $item);
             if (SendPress_Admin::access('Emails_Send')) {
                 $a .= '<a class="btn  btn-success " href="' . SendPress_Admin::link('Emails_Send') . '&emailID=' . $item->ID . '"><span class="glyphicon glyphicon-send"></span> ' . __('Send', 'sendpress') . '</a>';
             }
             $a .= '</div>';
             return $a;
         default:
             return print_r($item, true);
             //Show the whole array for troubleshooting purposes
     }
 }
开发者ID:richardsweeney,项目名称:sendpress,代码行数:61,代码来源:class-sendpress-emails-table.php

示例2: render

 /**
  * Renders the view.
  */
 function render($sp = false)
 {
     $this->page_start();
     $this->sub_menu($sp);
     if (SendPress_Admin::access($this)) {
         $this->html($sp);
     } else {
         $this->noaccess($sp);
     }
     $this->page_end();
 }
开发者ID:radscheit,项目名称:unicorn,代码行数:14,代码来源:class-sendpress-view.php

示例3: html

    function html($sp)
    {
        global $post_ID, $post;
        $view = isset($_GET['view']) ? $_GET['view'] : '';
        $list = '';
        if (isset($_GET['emailID'])) {
            $emailID = SPNL()->validate->int($_GET['emailID']);
            $post = get_post($emailID);
            $post_ID = $post->ID;
        }
        if ($post->post_type !== 'sp_newsletters') {
            SendPress_Admin::redirect('Emails');
        }
        ?>
		<form method="POST" name="post" id="post">
		<!--
		<div style="float:left">
			<a href="?page=sp-emails" class="spbutton supersize" >Edit Content</a>
		</div>
		-->
		<div style="float:right;" class="btn-toolbar">
            <div id="sp-cancel-btn" class="btn-group">
                <a href="?page=<?php 
        echo SPNL()->validate->page($_GET['page']);
        ?>
" id="cancel-update" class="btn btn-default"><?php 
        echo __('Cancel', 'sendpress');
        ?>
</a>&nbsp;
            </div>
            <div class="btn-group">
            <button class="btn btn-default " type="submit" value="save" name="submit"><i class="icon-white icon-ok"></i> <?php 
        echo __('Update', 'sendpress');
        ?>
</button>
            <?php 
        if (SendPress_Admin::access('Emails_Send')) {
            ?>
            <button class="btn btn-primary " type="submit" value="save-next" name="submit"><i class="icon-envelope icon-white"></i> <?php 
            echo __('Send', 'sendpress');
            ?>
</button>
            <?php 
        }
        ?>
            </div>
        </div>
		<?php 
        require_once SENDPRESS_PATH . 'inc/forms/email-style.2.0.php';
        ?>
		
        <div class="well clear">
            <h2><?php 
        _e('Test This Email', 'sendpress');
        ?>
</h2>
            <p><input type="text" name="test-email" value="" class="sp-text" placeholder="Email to send test to." /></p>
            <button class="btn btn-success" name="submit" type="submit" value="send-test"><i class=" icon-white icon-inbox"></i> <?php 
        _e('Send Test', 'sendpress');
        ?>
</button>
        </div>
        </form>
	<?php 
    }
开发者ID:richardsweeney,项目名称:sendpress,代码行数:65,代码来源:class-sendpress-view-emails-style.php

示例4: html

    function html()
    {
        global $is_IE;
        global $post_ID, $post;
        /*
        if (  wp_is_mobile() &&
        	 ! ( $is_IE && preg_match( '/MSIE [5678]/', $_SERVER['HTTP_USER_AGENT'] ) ) ) {
        
        	wp_enqueue_script('editor-expand');
        	$_wp_autoresize_on = true;
        }
        */
        $emailID = SPNL()->validate->_int('emailID');
        if ($emailID > 0) {
            $post = get_post($emailID);
            $post_ID = $post->ID;
        }
        if ($post->post_type !== 'sp_newsletters') {
            SendPress_Admin::redirect('Emails');
        }
        $template_id = get_post_meta($post->ID, '_sendpress_template', true);
        ?>
     <form method="post" id="post" role="form">
        <input type="hidden" name="post_ID" id="post_ID" value="<?php 
        echo $post->ID;
        ?>
" />
        <input type="hidden" name="post_type" id="post_type" value="sp_newsletters" />
        <input type="hidden" name="action" id="action" value="save-email" />
       <div  >
       <div style="float:right;" class="btn-toolbar">
            <div id="sp-cancel-btn" class="btn-group">
               <?php 
        if ($post->post_status != 'sp-autoresponder') {
            ?>
                <a href="?page=<?php 
            echo SPNL()->validate->page();
            ?>
" id="cancel-update" class="btn btn-default"><?php 
            echo __('Cancel', 'sendpress');
            ?>
</a>&nbsp;
            
            <?php 
        } else {
            ?>
     		<a href="<?php 
            echo SendPress_Admin::link('Emails_Autoresponder');
            ?>
" id="cancel-update" class="btn btn-default"><?php 
            echo __('Cancel', 'sendpress');
            ?>
</a>&nbsp;
           
            <?php 
        }
        ?>
            </div>
            <div class="btn-group">
            
             <button class="btn btn-default " type="submit" value="save" name="submit"><i class="icon-white icon-ok"></i> <?php 
        echo __('Update', 'sendpress');
        ?>
</button>
           
            <?php 
        if (SendPress_Admin::access('Emails_Send') && $post->post_status != 'sp-autoresponder') {
            ?>
            <button class="btn btn-primary " type="submit" value="save-next" name="submit"><i class="icon-envelope icon-white"></i> <?php 
            echo __('Send', 'sendpress');
            ?>
</button>
            <?php 
        }
        ?>
            </div>
        </div>
	

</div>
        <h2><?php 
        _e('Edit Email Content', 'sendpress');
        ?>
</h2>
        <br>
        <?php 
        $this->panel_start('<span class="glyphicon glyphicon-envelope"></span> ' . __('Subject', 'sendpress'));
        ?>
        <input type="text" name="post_subject" size="30" tabindex="1" class="form-control" value="<?php 
        echo esc_attr(htmlspecialchars(get_post_meta($post->ID, '_sendpress_subject', true)));
        ?>
" id="email-subject" autocomplete="off" />
        <?php 
        $this->panel_end();
        ?>
        <div class="sp-row">
<div class="sp-75 sp-first">
<!-- Nav tabs -->
<?php 
        $enable_edits = SendPress_Option::get('enable_email_template_edit');
//.........这里部分代码省略.........
开发者ID:redelivre,项目名称:jaiminho,代码行数:101,代码来源:class-jaiminho-view-emails-edit.php

示例5: styler_menu

    function styler_menu($active)
    {
        ?>
		<div id="styler-menu">
			<div style="float:right;" class="btn-group">
				<?php 
        if ($this->_current_view == 'edit-email') {
            ?>
					<a href="#" id="save-update" class="btn btn-primary btn-large "><i
							class="icon-white icon-ok"></i> <?php 
            echo __('Update', 'sendpress');
            ?>
</a><a href="#"
					                                                                                         id="save-update"
					                                                                                         class="btn btn-primary btn-large"><i
							class="icon-ok icon-white"></i> <?php 
            echo __('Save & Next', 'sendpress');
            ?>
</a>
				<?php 
        }
        ?>
				<?php 
        if ($this->_current_view == 'style') {
            ?>
					<a href="#" id="save-update" class="btn btn-primary btn-large "><i
							class="icon-white icon-ok"></i> <?php 
            echo __('Update', 'sendpress');
            ?>
</a>
					<?php 
            if (SendPress_Admin::access('Emails_Send')) {
                ?>
						<a href="#" id="save-send-email" class="btn btn-primary btn-large "><i
								class="icon-envelope icon-white"></i> <?php 
                echo __('Send', 'sendpress');
                ?>
</a>
					<?php 
            }
            ?>
				<?php 
        }
        ?>
				<?php 
        if ($this->_current_view == 'styles') {
            ?>
					<a href="#" id="save-update" class="btn btn-primary btn-large "><i
							class="icon-white icon-ok"></i> <?php 
            echo __('Update', 'sendpress');
            ?>
</a><a href="#"
					                                                                                         id="save-send-email"
					                                                                                         class="btn btn-primary btn-large "><i
							class="icon-envelope icon-white"></i> <?php 
            echo __('Send', 'sendpress');
            ?>
</a>
				<?php 
        }
        ?>
				<?php 
        if ($this->_current_view == 'send') {
            ?>
					<a href="?page=<?php 
            echo SPNL()->validate->page($_GET['page']);
            ?>
&view=style&emailID=<?php 
            echo $_GET['emailID'];
            ?>
"
					   class="btn btn-primary btn-large "><i
							class="icon-white icon-pencil"></i> <?php 
            echo __('Edit', 'sendpress');
            ?>
</a><a href="#"
					                                                                                           id="save-update"
					                                                                                           class="btn btn-primary btn-large"><i
							class="icon-white icon-envelope"></i> <?php 
            echo __('Send', 'sendpress');
            ?>
</a>
				<?php 
        }
        ?>
				<?php 
        if ($this->_current_view == 'create') {
            ?>
					<a href="#" id="save-update" class="btn btn-primary btn-large"><i
							class="icon-ok icon-white"></i> <?php 
            echo __('Save & Next', 'sendpress');
            ?>
</a>
				<?php 
        }
        ?>
			</div>
			<div id="sp-cancel-btn" style="float:right; margin-top: 5px;">
				<a href="?page=<?php 
        echo SPNL()->validate->page($_GET['page']);
//.........这里部分代码省略.........
开发者ID:pmatheus,项目名称:participacao-sitebase,代码行数:101,代码来源:sendpress.php


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