本文整理汇总了PHP中SendPress_Admin::link方法的典型用法代码示例。如果您正苦于以下问题:PHP SendPress_Admin::link方法的具体用法?PHP SendPress_Admin::link怎么用?PHP SendPress_Admin::link使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SendPress_Admin
的用法示例。
在下文中一共展示了SendPress_Admin::link方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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)
{
$settings = SendPress_Data::get_post_meta_object($item->ID);
switch ($column_name) {
case 'name':
return $item->post_title;
break;
case 'type':
return ucwords(str_replace('_', ' ', $settings['_form_type']));
break;
case 'shortcode':
return '[sp-form formid=' . $item->ID . ']';
break;
case 'actions':
//$type = get_post_meta($item->ID, "_template_type", true);
$a = '<div class="inline-buttons" style="text-align:right;">';
$a .= '<a class="btn btn-default" href="' . SendPress_Admin::link('Settings_Widgets', array('id' => $item->ID, 'create' => 1)) . '">' . __('Clone', 'sendpress') . '</a> <a class="btn btn-primary" href="' . SendPress_Admin::link('Settings_Widgets', array('id' => $item->ID)) . '">' . __('Edit', 'sendpress') . '</a>' . '</a> <a class="btn btn-danger" href="' . SendPress_Admin::link('Settings_Widgets', array('id' => $item->ID, 'delete' => 1)) . '">' . __('Delete', 'sendpress') . '</a>';
$a .= '</div>';
return $a;
break;
default:
return print_r($item, true);
//Show the whole array for troubleshooting purposes
}
}
示例2: html
function html($sp)
{
global $sendpress_html_templates;
//print_r($sendpress_html_templates[$_GET['templateID']]);
$postdata = get_post($_GET['templateID']);
//print_r( $postdata );
?>
<form method="post" name="post" >
<input type="hidden" value="<?php
echo $_GET['templateID'];
?>
" name="templateID" />
<div class="pull-right">
<a href="<?php
echo SendPress_Admin::link('Emails_Tempstyle', array('templateID' => $_GET['templateID']));
?>
"><?php
_e('Back to Template', 'sendpress');
?>
</a> <button class="btn btn-primary " type="submit" value="save" name="submit"><i class="icon-white icon-ok"></i> <?php
echo __('Save', 'sendpress');
?>
</button>
</div>
<h2><?php
echo $postdata->post_title;
?>
<?php
_e('Template Footer', 'sendpress');
?>
</h2><br>
<div class="tab-pane fade in active" id="home"><?php
wp_editor(get_post_meta($postdata->ID, '_footer_content', true), 'footer-content');
?>
</div>
<?php
SendPress_Data::nonce_field();
?>
</form><br><br><?php
_e('Default Content', 'sendpress');
?>
<textarea class="form-control" rows="3">
<?php
echo SendPress_Tag_Footer_Content::content();
?>
</textarea>
<br>
<?php
echo spnl_get_emails_tags_list();
$this->popup();
?>
<?php
}
示例3: footer
static function footer()
{
?>
<div class="sp-footer">
<a href="<?php
echo SendPress_Admin::link('Help_Whatsnew');
?>
">What's New</a> | <a href="http://docs.sendpress.com/" target="_blank">Knowledge Base</a> | <a href="http://sendpress.uservoice.com/" target="_blank">Feedback</a> | SendPress Version: <?php
echo SENDPRESS_VERSION;
?>
</div>
<!-- src/templates/metabox.templ.php -->
<!-- Template -->
<script id="tmpl-my-awesome-template" type="text/template">
<div class="spnl-modal">
test info here....
</div>
</script>
<!-- End template -->
<?php
}
示例4: html
function html()
{
SendPress_Tracking::event('Emails Tab');
//SendPress_Template_Manager::update_template_content();
//Create an instance of our package class...
$testListTable = new Jaiminho_Email_Local_Table();
//Fetch, prepare, sort, and filter our data...
$testListTable->prepare_items();
?>
<!-- Forms are NOT created automatically, so you need to wrap the table in one to use features like bulk actions -->
<form id="email-filter" method="get">
<div id="taskbar" class="lists-dashboard rounded group">
<h2><?php
_e('Templates', 'sendpress');
?>
</h2>
<small><?php
_e('Help', 'sendpress');
?>
: <a target="_blank" href="http://docs.sendpress.com/article/58-setting-up-a-newsletter-template/"><?php
_e('Getting Started with Templates', 'sendpress');
?>
</a></small>
</div>
<!-- For plugins, we also need to ensure that the form posts back to our current page -->
<input type="hidden" name="page" value="<?php
echo SPNL()->validate->page();
?>
" />
<!-- Now we can render the completed list table -->
<?php
$testListTable->display();
?>
<?php
wp_nonce_field($this->_nonce_value);
?>
</form><br>
<!--a href="<?php
echo SendPress_Admin::link('Emails_Temp', array('action' => 'install'));
?>
" class="btn btn-primary">Install Starter Templates</a-->
<a href="<?php
echo SendPress_Admin::link('Emails_Temp', array('action' => 'install'));
?>
" class="btn btn-primary">Install Starter Templates</a>
<?php
}
示例5: html
function html($sp)
{
?>
<?php
$template = get_post($_GET['templateID']);
?>
<h2><?php
_e('You are about to delete template', 'sendpress');
?>
: <?php
echo $template->post_title;
?>
</h2>
<br>
<a class="btn btn-danger" href="<?php
echo SendPress_Admin::link('Emails_Temp', array('templateID' => $_GET['templateID'], 'action' => 'delete'));
?>
"><?php
_e('Delete Template', 'sendpress');
?>
</a>
<a class="btn btn-default" href="<?php
echo SendPress_Admin::link('Emails_Temp');
?>
"><?php
_e('Cancel', 'sendpress');
?>
</a>
<?php
//wp_editor($post->post_content,'textversion');
?>
<?php
wp_nonce_field($sp->_nonce_value);
?>
<br><br>
</form>
<?php
}
示例6: html
function html($sp)
{
$count = SendPress_Data::get_bad_post_count();
echo __("We see", "sendpress") . " " . $count . " " . __("bad posts.", "sendpress");
$link = SendPress_Admin::link('Settings_Fixposts', array('action' => 'posts-repair'));
echo "<br><br><a href='{$link}' class='btn btn-primary' >" . __('Attempt to Delete These', 'sendpress') . "</a>";
/*
echo "<h2>Attempting to install or repair missing data</h2><br>";
SendPress_Data::install();
echo "<pre>";
echo SendPress_DB_Tables::check_setup_support();
echo "</pre>";
*/
}
示例7: html
function html($sp)
{
global $sendpress_html_templates;
//print_r($sendpress_html_templates[$_GET['templateID']]);
$templateID = SPNL()->validate->int($_GET['templateID']);
$postdata = get_post($templateID);
//print_r( $postdata );
?>
<form method="post" name="post" >
<input type="hidden" value="<?php
echo $templateID;
?>
" name="templateID" />
<div class="pull-right">
<a href="<?php
echo SendPress_Admin::link('Emails_Tempstyle', array('templateID' => $templateID));
?>
"><?php
_e('Back to Template', 'sendpress');
?>
</a> <button class="btn btn-primary " type="submit" value="save" name="submit"><i class="icon-white icon-ok"></i> <?php
echo __('Save', 'sendpress');
?>
</button>
</div>
<h2><?php
echo $postdata->post_title;
?>
<?php
_e('Template Page Header', 'sendpress');
?>
</h2><br>
<div class="tab-pane fade in active" id="home"><?php
wp_editor(get_post_meta($postdata->ID, '_header_page', true), 'header-content');
?>
</div>
<?php
SendPress_Data::nonce_field();
?>
</form>
<?php
$this->popup();
}
示例8: footer
static function footer()
{
?>
<div class="sp-footer">
<a href="<?php
echo SendPress_Admin::link('Help_Whatsnew');
?>
">What's New</a> | <a href="http://docs.sendpress.com/" target="_blank">Knowledge Base</a> | <a href="http://sendpress.uservoice.com/" target="_blank">Feedback</a> | SendPress Version: <?php
echo SENDPRESS_VERSION;
?>
| System <span id="sendpress-system-icon" class="glyphicon glyphicon-ok-sign" aria-hidden="true"></span>
</div>
<?php
$url = home_url('/');
?>
<script>
jQuery(function() {
jQuery.getJSON( "<?php
echo $url;
?>
spnl-api/system-check", function( data ) {
if(data.status){
if(data.status === "active"){
jQuery("#sendpress-system-icon").addClass("glyphicon-ok-sign").removeClass("glyphicon-remove-sign").css("color","#5cb85c");
} else {
jQuery("#sendpress-system-icon").removeClass("glyphicon-ok-sign").addClass("glyphicon-remove-sign").css("color","#d9534f");
}
}
});
});
</script>
<!-- src/templates/metabox.templ.php -->
<!-- Template -->
<script id="tmpl-my-awesome-template" type="text/template">
<div class="spnl-modal">
test info here....
</div>
</script>
<!-- End template -->
<?php
}
示例9: 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;
}
?>
<form method="post" id="post">
<br class="clear">
<!--
<div style="float:right;" >
<a href="<?php
echo SendPress_Admin::link('Settings_Styles');
?>
" class="btn btn-default btn-large" ><i class="icon-remove"></i> <?php
_e('Cancel', 'sendpress');
?>
</a> <a href="#" id="save-update" class="btn btn-primary btn-large"><i class="icon-white icon-ok"></i> <?php
_e('Save', 'sendpress');
?>
</a>
</div>
-->
<br class="clear">
<?php
define('SENDPRESS_STYLER_PAGE', true);
require_once SENDPRESS_PATH . 'inc/forms/email-style.2.0.php';
?>
<br class="clear">
<?php
wp_nonce_field($sp->_nonce_value);
?>
</form>
<?php
}
示例10: 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 'gravatar':
return get_avatar($item->email, 30);
case 'joindate':
return date_i18n(get_option('date_format'), strtotime($item->join_date));
case 'actions':
$a = '<div class="inline-buttons">';
$a .= '<a class="btn btn-primary" href="' . SendPress_Admin::link('Subscribers_Subscriber', array('subscriberID' => $item->subscriberID)) . '"><span class="glyphicon glyphicon-pencil"></span> ' . __('Edit', 'sendpress') . '</a> ';
$a .= '</div>';
return $a;
default:
return print_r($item, true);
//Show the whole array for troubleshooting purposes
}
}
示例11: html
function html($sp)
{
SendPress_Tracking::event('Queue Tab');
$testListTable = new SendPress_Queue_Errors_Table();
$testListTable->prepare_items();
SendPress_Option::set('no_cron_send', 'false');
$sp->cron_start();
$open_info = array("id" => 13, "report" => 10, "view" => "open");
?>
<h2><?php
_e('Error history for the last 2 Weeks', 'sendpress');
?>
.</h2>
<!-- Forms are NOT created automatically, so you need to wrap the table in one to use features like bulk actions -->
<form id="email-filter" action="<?php
echo SendPress_Admin::link('Queue_Errors');
?>
" method="get">
<!-- For plugins, we also need to ensure that the form posts back to our current page -->
<input type="hidden" name="page" value="<?php
echo SPNL()->validate->page($_REQUEST['page']);
?>
" />
<!-- Now we can render the completed list table -->
<?php
$testListTable->display();
?>
<?php
wp_nonce_field($sp->_nonce_value);
?>
</form>
<br>
<?php
}
示例12: 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 'rating':
case 'director':
return $item[$column_name];
case 'count_subscribers':
$role = get_post_meta($item->ID, 'sync_role', true);
$add = '';
if ($role != 'none' && $role != false) {
$add = " - <a href='" . SendPress_Admin::link('Subscribers_Sync') . "&listID=" . $item->ID . "'>" . __('Sync', 'sendpress') . "</a>";
}
return SendPress_data::get_count_subscribers($item->ID) . $add;
case 'count_unsubscribes':
return SendPress_data::get_count_subscribers($item->ID, 3);
case 'count_bounced':
return SendPress_data::get_count_subscribers($item->ID, 4);
case 'last_send_date':
return date('Y-m-d');
case 'actions':
$role = get_post_meta($item->ID, 'sync_role', true);
$add = '';
if ($role != 'none' && $role != false) {
$add = " - <a href='" . SendPress_Admin::link('Subscribers_Sync') . "&listID=" . $item->ID . "'>" . __('Sync', 'sendpress') . "</a>";
}
$str = '<div class="inline-buttons">
<a class="btn btn-info" href="?page=' . SPNL()->validate->page($_REQUEST['page']) . '&view=subscribers&listID=' . $item->ID . '"><span class="glyphicon glyphicon-edit"></span> ' . __('View', 'sendpress') . '/' . __('Edit', 'sendpress') . '</a> ';
$role = get_post_meta($item->ID, 'sync_role', true);
$add = '';
if ($role != 'none' && $role != false) {
$str .= "<a class='btn btn-primary' href='" . SendPress_Admin::link('Subscribers_Sync') . "&listID=" . $item->ID . "'><span class='glyphicon glyphicon-refresh'></span> " . __('Sync', 'sendpress') . "</a> ";
} else {
if (apply_filters('sendpress_show_import_button', true, $this->_sendpress)) {
$str .= '<a class="list-import btn btn-primary" href="?page=' . SPNL()->validate->page($_REQUEST['page']) . '&view=csvimport&listID=' . $item->ID . '"><span class="glyphicon glyphicon-upload"></span> ' . __('Import', 'sendpress') . '</a> ';
}
$str .= '<a class="btn btn-primary" href="?page=' . SPNL()->validate->page($_REQUEST['page']) . '&view=add&listID=' . $item->ID . '"><span class="glyphicon glyphicon-user"></span> ' . __('Add', 'sendpress') . '</a> ';
$str .= '<a class="btn btn-primary" href="?page=' . SPNL()->validate->page($_REQUEST['page']) . '&action=export-list&listID=' . $item->ID . '"><span class="glyphicon glyphicon-download"></span> ' . __('Export', 'sendpress') . '</a> ';
$str .= '<a class="btn btn-primary" href="' . SendPress_Admin::link('Subscribers_Listform', array('listID' => $item->ID)) . '"><span class="glyphicon glyphicon-list"></span> ' . __('Form', 'sendpress') . '</a> ';
}
$str .= '<a class="btn " href="?page=' . SPNL()->validate->page($_REQUEST['page']) . '&view=listedit&listID=' . $item->ID . '"><i class="icon-cog"></i></a>
</div>';
return $str;
default:
return print_r($item, true);
//Show the whole array for troubleshooting purposes
}
}
示例13: sub_menu
function sub_menu($sp = false)
{
SendPress_Tracking::event('Settings Tab');
?>
<div class="navbar navbar-default" >
<div class="pull-right top-action-buttons navbar-right btn-group">
<?php
$this->view_buttons();
?>
</div>
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
<span class="sr-only"><?php
_e('Toggle navigation', 'sendpress');
?>
</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#"><?php
_e('Settings', 'sendpress');
?>
</a>
</div>
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<!--
<li <?php
if ($sp->_current_view == '') {
?>
class="active"<?php
}
?>
><a href="<?php
echo SendPress_Admin::link('Settings');
?>
"><i class="icon-envelope"></i> <?php
_e('Basic Setup', 'sendpress');
?>
</a></li>
-->
<!--
<li <?php
if ($sp->_current_view == 'shared') {
?>
class="active"<?php
}
?>
>
<a href="<?php
echo SendPress_Admin::link('Settings_Shared');
?>
"><i class="icon-pencil "></i> <?php
_e('Shared Content', 'sendpress');
?>
</a>
</li>
-->
<li <?php
if ($sp->_current_view == 'account') {
?>
class="active"<?php
}
?>
><a href="<?php
echo SendPress_Admin::link('Settings_Account');
?>
"><i class="icon-envelope "></i> <?php
_e('Sending', 'sendpress');
?>
</a></li>
<li <?php
if ($sp->_current_view == 'activation') {
?>
class="active"<?php
}
?>
><a <?php
if ($sp->_current_view == 'activation') {
?>
class="wp-ui-primary"<?php
}
?>
href="<?php
echo SendPress_Admin::link('Settings_Activation');
?>
"><i class=" icon-bullhorn"></i> <?php
_e('Confirmation', 'sendpress');
?>
</a></li>
<!--
<li <?php
if (strpos($sp->_current_view, 'systememail') !== false) {
?>
class="active"<?php
//.........这里部分代码省略.........
示例14: sub_menu
function sub_menu($sp = false)
{
?>
<div class="navbar navbar-default" >
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
<span class="sr-only"><?php
_e('Toggle navigation', 'sendpress');
?>
</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#"><?php
_e('Subscribers', 'sendpress');
?>
</a>
</div>
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<li <?php
if (!isset($_GET['view'])) {
?>
class="active"<?php
}
?>
>
<a href="<?php
echo SendPress_Admin::link('Subscribers');
?>
"><i class="icon-list "></i> <?php
_e('Lists', 'sendpress');
?>
</a>
</li>
<?php
do_action('sendpress-add-submenu-item', $sp);
?>
<li <?php
if (isset($_GET['view']) && $_GET['view'] === 'all') {
?>
class="active"<?php
}
?>
>
<a href="<?php
echo SendPress_Admin::link('Subscribers_All');
?>
"><i class="icon-user "></i> <?php
_e('All Subscribers', 'sendpress');
?>
</a>
</li>
<?php
if (SendPress_Option::get('beta')) {
?>
<li <?php
if (isset($_GET['view']) && $_GET['view'] === 'custom') {
?>
class="active"<?php
}
?>
>
<a href="<?php
echo SendPress_Admin::link('Subscribers_Custom');
?>
"><i class="icon-list "></i> <?php
_e('Custom Fields', 'sendpress');
?>
</a>
</li>
<?php
}
?>
</ul>
</div>
</div>
<?php
do_action('sendpress-subscribers-sub-menu');
}
示例15: sub_menu
function sub_menu($sp = false)
{
?>
<div class="navbar navbar-default" >
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
<span class="sr-only"><?php
_e('Toggle navigation', 'sendpress');
?>
</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#"><?php
_e('Reports', 'sendpress');
?>
</a>
</div>
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<li <?php
if (!isset($_GET['view'])) {
?>
class="active"<?php
}
?>
>
<a href="<?php
echo SendPress_Admin::link('Reports');
?>
"><?php
_e('Newsletters', 'sendpress');
?>
</a>
</li>
<li <?php
if (isset($_GET['view']) && $_GET['view'] === 'tests') {
?>
class="active"<?php
}
?>
>
<a href="<?php
echo SendPress_Admin::link('Reports_Tests');
?>
"><?php
_e('Tests', 'sendpress');
?>
</a>
</li>
</ul>
</div>
</div>
<?php
do_action('sendpress-reports-sub-menu');
}