コード例 #1
0
    function html($sp)
    {
        global $current_user;
        global $post_ID, $post;
        $view = isset($_GET['view']) ? $_GET['view'] : '';
        $list = '';
        if (isset($_GET['emailID'])) {
            $emailID = $_GET['emailID'];
            $post = get_post($_GET['emailID']);
            $post_ID = $post->ID;
        }
        $post_type = $sp->_email_post_type;
        $post_type_object = get_post_type_object($sp->_email_post_type);
        ?>
<div class="alert alert-danger fade hide">
  <?php 
        _e('<strong>Notice!</strong> You must select a list below before an email can be sent.', 'sendpress');
        ?>
</div>
<form method="POST" name="sendpress_post" id="sendpress_post">
<div style="float:right;"  class="btn-toolbar">
<div id="sp-cancel-btn" class="btn-group">
<a href="?page=<?php 
        echo $_GET['page'];
        ?>
"  class="btn btn-default "><?php 
        echo __('Cancel', 'sendpress');
        ?>
</a>
</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 __('Edit', 'sendpress');
        ?>
</button>-->
    <button class="btn btn-primary " type="submit" value="save-next" id="sp-send-next" name="submit"><i class="icon-envelope icon-white"></i> <?php 
        echo __('Send', 'sendpress');
        ?>
</button>
</div>
</div>

<input type="hidden" id="user-id" name="user_ID" value="<?php 
        echo $current_user->ID;
        ?>
" />
<input type="hidden" id="post_ID" name="post_ID" value="<?php 
        echo $post->ID;
        ?>
" />
<input type="hidden" id="post_type" name="post_type" value="sp_newsletters" />

<h2><?php 
        _e('Send Email', 'sendpress');
        ?>
</h2>
<br>
<div class="boxer">
<div class="boxer-inner">

<?php 
        $this->panel_start('<span class="glyphicon glyphicon-inbox"></span> ' . __('Subject', 'sendpress'));
        ?>
<input type="text" class="form-control" name="post_subject" size="30" tabindex="1" 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="leftcol">
<?php 
        $this->panel_start('<span class="glyphicon glyphicon-calendar"></span> ' . __('Date & Time', 'sendpress'));
        ?>
<input type="radio" name="send-date" value="now" checked/> <?php 
        _e('Start Sending Now', 'sendpress');
        ?>
<br>
<input type="radio" name="send-date" value="later"/> <?php 
        _e('Send Later', 'sendpress');
        ?>
<br>
<div class="date-holder" style="display:none">
	<br>
<input type="text" name="date-pickit" id="date-pickit" class=" fifty float-left" value="<?php 
        echo date_i18n('Y/m/d');
        ?>
"/>&nbsp;at
<script type="text/javascript">
jQuery(document).ready(function($) {
$(".date-holder").hide();

$('input[type=radio][name=send-date]').change(function() {
        if (this.value == 'now') {
            $(".date-holder").hide();
        }
        else if (this.value == 'later') {
           $(".date-holder").show();
        }
    });
$('#date-pickit').datepicker({
dateFormat : 'yy/mm/dd'
});
});
</script>
<select name="send-later-time" id="datepicker-time" class="fifty">
<option value="00:00:00">12:00 am</option>
<option value="01:00:00">1:00 am</option>
<option value="02:00:00">2:00 am</option>
<option value="03:00:00">3:00 am</option>
<option value="04:00:00">4:00 am</option>
<option value="05:00:00">5:00 am</option>
<option value="06:00:00">6:00 am</option>
<option value="07:00:00">7:00 am</option>
<option value="08:00:00">8:00 am</option>
<option value="09:00:00">9:00 am</option>
<option value="10:00:00">10:00 am</option>
<option value="11:00:00">11:00 am</option>
<option value="12:00:00">12:00 pm</option>
<option value="13:00:00">1:00 pm</option>
<option value="14:00:00">2:00 pm</option>
<option value="15:00:00">3:00 pm</option>
<option value="16:00:00">4:00 pm</option>
<option value="17:00:00">5:00 pm</option>
<option value="18:00:00">6:00 pm</option>
<option value="19:00:00">7:00 pm</option>
<option value="20:00:00">8:00 pm</option>
<option value="21:00:00">9:00 pm</option>
<option value="22:00:00">10:00 pm</option>
<option value="23:00:00">11:00 pm</option>
</select>
</div>
<?php 
        $this->panel_end();
        do_action('spnl_add_to_sending', $this);
        $this->panel_start('<span class="glyphicon glyphicon-list"></span> ' . __('Lists', 'sendpress'));
        $post_args = array('post_type' => 'sendpress_list', 'numberposts' => -1, 'offset' => 0, 'orderby' => 'post_title', 'order' => 'DESC');
        $current_lists = get_posts($post_args);
        foreach ($current_lists as $list) {
            $t = '';
            $tlist = '';
            if (get_post_meta($list->ID, '_test_list', true) == 1) {
                $t = '  <span class="label label-info">Test List</span>';
                $tlist = ' test-list-add';
            }
            echo "<input name='listIDS[]' type='checkbox' id='listIDS' class='sp-send-lists " . $tlist . "' value=" . $list->ID . "> " . $list->post_title . " <small>(" . SendPress_Data::get_count_subscribers($list->ID) . ")</small>{$t}<br>";
        }
        $this->panel_end();
        $this->panel_start('<span class="glyphicon glyphicon-tag"></span> ' . __('Mark as Test', 'sendpress'));
        echo "<input name='test_report' type='checkbox' id='test_report' value='1'> " . __('Test', 'sendpress') . "<br>";
        echo "<small class='text-muted'> " . __('This puts the report into the Test tab on the Reports screen', 'sendpress') . ".</small>";
        $this->panel_end();
        ?>

<!--
<div class="style-unit">
<h4><?php 
        _e('Settings', 'sendpress');
        ?>
</h4>
<input type="checkbox" name="test-send" value="1" /> Mark as Test

<textarea name="test-add" cols='26' rows='6'></textarea>


</div>
-->
<?php 
        wp_nonce_field($sp->_nonce_value);
        ?>
</div>
<div style="margin-left: 250px;">
<div class="widerightcol">
<?php 
        $url = get_site_url();
        //$link =  get_permalink( $post->ID );
        $open_info = array("id" => $post->ID, "view" => "email");
        $code = SendPress_Data::encrypt($open_info);
        $url = SendPress_Manager::public_url($code);
        $sep = strstr($url, '?') ? '&' : '?';
        $link = $url . $sep . 'inline=true';
        ?>
<iframe src="<?php 
        echo $link;
        ?>
" width="100%" height="600px"></iframe>
<small><?php 
        _e('Displaying a 404? Please try saving your permalinks', 'sendpress');
        ?>
 <a href="<?php 
        echo admin_url('options-permalink.php');
        ?>
"><?php 
        _e('here', 'sendpress');
        ?>
</a>.</small>

</div>
</div>
<br class="clear" />
</div>
</form>
<?php 
    }
コード例 #2
0
    function html($sp)
    {
        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;
        }
        */
        $view = isset($_GET['view']) ? $_GET['view'] : '';
        if (isset($_GET['emailID'])) {
            $emailID = $_GET['emailID'];
            $post = get_post($_GET['emailID']);
            $post_ID = $post->ID;
        }
        if ($post->post_type !== 'sp_newsletters') {
            SendPress_Admin::redirect('Emails');
        }
        $options = SendPress_Option::email_get('autoresponder_' . $post_ID);
        ?>
     <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="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 $_GET['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-primary " type="submit" value="save-next" name="submit"><i class="icon-envelope icon-white"></i> <?php 
        echo __('Save', 'sendpress');
        ?>
</button>
            </div>
        </div>
	

</div>
        <h2>Autoresponder Settings</h2>
        <br>
        <h4>Subject: <?php 
        echo esc_attr(htmlspecialchars(get_post_meta($post->ID, '_sendpress_subject', true)));
        ?>
</h4>
        
        <div class="sp-row">
<div class="sp-75 sp-first">
<br>
<select name="sp-autoresponder-type" id="params-auto" >
<option value="subscribe"  <?php 
        if ($options['type'] == 'subscribe') {
            echo "selected";
        }
        ?>
 >When someone subscribes to the list...</option>
<!--<option value="user-new" <?php 
        if ($options['type'] == 'user-new') {
            echo "selected";
        }
        ?>
 >When a new WordPress user is added to your site...</option>-->
</select>
<select name="" id="params-list">
<?php 
        $post_args = array('post_type' => 'sendpress_list', 'numberposts' => -1, 'offset' => 0, 'orderby' => 'post_title', 'order' => 'DESC');
        $current_lists = get_posts($post_args);
        foreach ($current_lists as $list) {
            $t = '';
            $tlist = '';
            echo "<option value=" . $list->ID . "> " . $list->post_title . " <small>(" . SendPress_Data::get_count_subscribers($list->ID) . ")</small></option>";
        }
        ?>
</select>
<input type="text"  name="sp-delay" style="width:30px; <?php 
        if ($options['when'] == 'immediate') {
            echo "display:none;";
        }
        ?>
"   class="text" id="timer" value="<?php 
        echo $options['delay'];
        ?>
" />
<select name="sp-timing"  id="when-to-send" >
<option value="immediate" <?php 
        if ($options['when'] == 'immediate') {
            echo "selected";
        }
        ?>
  >immediately.</option>
<option value="hours" <?php 
        if ($options['when'] == 'hours') {
            echo "selected";
        }
        ?>
  >hour(s) after.</option>
<option value="days" <?php 
        if ($options['when'] == 'days') {
            echo "selected";
        }
        ?>
  >day(s) after.</option>
<option value="weeks" <?php 
        if ($options['when'] == 'weeks') {
            echo "selected";
        }
        ?>
  >week(s) after.</option>
</select>

<br><br>
</div>
<div class="sp-25">
<br><br>

</div>
</div>
<script>
(function($){
	$(document).ready(function($){
		$('#params-auto').change(function(){
			var it = $(this);
			var v = it.val();
			
		});


		$('#when-to-send').change(function(){
			var it = $(this);
			var v = it.val();
			if(v !== 'immediate'){
				$('#timer').show();
			} else {
				$('#timer').hide();
			}


		});
	});


}(jQuery));


</script>




	<?php 
        SendPress_Data::nonce_field();
        ?>
        </form>
	<?php 
    }
コード例 #3
0
    function html($sp)
    {
        global $post_ID, $post;
        $view = isset($_GET['view']) ? $_GET['view'] : '';
        $list = '';
        if (isset($_GET['emailID'])) {
            $emailID = $_GET['emailID'];
            $post = get_post($_GET['emailID']);
            $post_ID = $post->ID;
        }
        ?>
		<form  method="POST" name="post" id="post">
<?php 
        $info = SendPress_Option::get('current_send_' . $post->ID);
        $subject = SendPress_Option::get('current_send_subject_' . $post->ID, true);
        ?>
<div id="styler-menu">
    <div style="float:right;" class="btn-group">
<a class="btn btn-primary btn-large " id="confirm-send" href="#"><i class="icon-white  icon-thumbs-up"></i> <?php 
        _e('Confirm Send', 'sendpress');
        ?>
</a>
  </div>
</div>
<div id="sp-cancel-btn" style="float:right; ">
<a class="btn btn-default" href="<?php 
        echo '?page=' . $_GET['page'] . '&view=send&emailID=' . $_GET['emailID'];
        ?>
"><?php 
        _e('Cancel Send', 'sendpress');
        ?>
</a>&nbsp;
</div>
<h2><?php 
        _e('Confirm Send', 'sendpress');
        ?>
</h2>
<br>

<input type="hidden" id="user-id" name="user_ID" value="<?php 
        //echo $current_user->ID;
        ?>
" />
<input type="hidden" id="post_ID" name="post_ID" value="<?php 
        echo $post->ID;
        ?>
" />
<div class="boxer">
<div class="boxer-inner">
<?php 
        $this->panel_start('<span class="glyphicon glyphicon-inbox"></span> ' . __('Subject', 'sendpress'));
        ?>
<input type="text" class="form-control" value="<?php 
        echo stripslashes(esc_attr(htmlspecialchars($subject)));
        ?>
" disabled />
<?php 
        $this->panel_end();
        ?>
<div class="leftcol">
<?php 
        $this->panel_start('<span class="glyphicon glyphicon-calendar"></span> ' . __('Date & Time', 'sendpress'));
        if ($info['send_at'] == '0000-00-00 00:00:00') {
            echo "Your email will start sending right away!";
        } else {
            echo "Your email will start sending on " . date('Y/m/d', strtotime($info['send_at'])) . " at " . date('h:i A', strtotime($info['send_at']));
        }
        $this->panel_end();
        $this->panel_start('<span class="glyphicon glyphicon-list"></span> ' . __('Lists', 'sendpress'));
        ?>



<?php 
        if (!empty($info['listIDS'])) {
            foreach ($info['listIDS'] as $list_id) {
                $list = $sp->get_list_details($list_id);
                echo $list->post_title . " <small>(" . SendPress_Data::get_count_subscribers($list_id) . ")</small><br>";
            }
        } else {
            _e('No Lists Selected', 'sendpress');
            echo "<br>";
        }
        $this->panel_end();
        $this->panel_start('<span class="glyphicon glyphicon-tag"></span> ' . __('Mark as Test', 'sendpress'));
        $sel = '';
        if (get_post_meta($post_ID, 'istest', true) == true) {
            $sel = 'checked';
        }
        echo "<input {$sel} name='test_report' type='checkbox' id='test_report' value='1' disabled> Test<br>";
        echo "<small class='text-muted'>" . __('This puts the report into the Test tab on the Reports screen', 'sendpress') . ".</small>";
        $this->panel_end();
        ?>

</div>
<div style="margin-left: 250px;">
<div class="widerightcol">
<?php 
        $link = get_permalink($post->ID);
        $sep = strstr($link, '?') ? '&' : '?';
        $link = $link . $sep . 'inline=true';
        $open_info = array("id" => $post->ID, "view" => "email");
        $code = SendPress_Data::encrypt($open_info);
        $url = SendPress_Manager::public_url($code);
        $sep = strstr($url, '?') ? '&' : '?';
        $link = $url . $sep . 'inline=true';
        ?>
<iframe src="<?php 
        echo $link;
        ?>
" width="100%" height="600px"></iframe>

<small><?php 
        _e('Displaying a 404? Please try saving your permalinks', 'sendpress');
        ?>
 <a href="<?php 
        echo admin_url('options-permalink.php');
        ?>
"><?php 
        _e('here', 'sendpress');
        ?>
</a>.</small>
</div>
<?php 
        wp_nonce_field($sp->_nonce_value);
        ?>
<br><br>
</div>
</div>
<br class="clear" />
	</div>
	</form>
	<?php 
    }