| 1 |
|
| 2 |
<p> |
| 3 |
<input type="hidden" name="wpcomplete[completable]" value="false"> |
| 4 |
<label><input type="checkbox" id="completable" name="wpcomplete[completable]" value="true"<?php if ($completable) echo " checked"; ?> onclick="jQuery('#completable-enabled').toggle();"><?php echo __( 'Yes, I want this page to be completable.', $this->plugin_name ); ?></label> |
| 5 |
</p> |
| 6 |
|
| 7 |
<div id="completable-enabled"<?php if (!$completable) echo " style='display:none;'"; ?>> |
| 8 |
<p style="margin-top: -10px;"><em><small> |
| 9 |
<?php if (get_option( $this->plugin_name . '_auto_append', 'true' )) { ?> |
| 10 |
As per your <a href="options-general.php?page=<?php echo $this->plugin_name; ?>">settings</a>, if you do not include the shortcode <code>[wpc_button]</code> anywhere inside your page content, we will auto append a button at the end of this page. |
| 11 |
<?php } else { ?> |
| 12 |
As per your <a href="options-general.php?page=<?php echo $this->plugin_name; ?>">settings</a>, you are responsible for using the <code>[wpc_button]</code> shortcode to place your button(s) on this page. |
| 13 |
<?php } ?> |
| 14 |
</small></em></p> |
| 15 |
|
| 16 |
<?php if ( !WPCOMPLETE_IS_ACTIVATED ) : ?> |
| 17 |
<!-- FREE: --> |
| 18 |
<p> |
| 19 |
<?php echo __( 'Upgrade to the <a href="https://wpcomplete.co">PRO version</a> for support and to unlock all available features.', $this->plugin_name ); ?> |
| 20 |
</p> |
| 21 |
|
| 22 |
<?php else : ?> |
| 23 |
<!-- PREMIUM: --> |
| 24 |
<p> |
| 25 |
<label for="course-assigned"><?php echo __( 'This is a part of:', $this->plugin_name ); ?></label> |
| 26 |
<select name="wpcomplete[course]" id="course-assigned" class="course-toggle" onchange="if (this.value == '--new--') { jQuery('.course-toggle').toggle(); jQuery('.course-toggle select').attr('disabled', 'disabled'); jQuery('.course-toggle input').attr('disabled', false); jQuery('.course-toggle input').focus(); this.selectedIndex = 0; }"> |
| 27 |
<option value="true"><?php echo get_bloginfo( 'name' ); ?></option> |
| 28 |
<?php foreach ( $this->get_course_names() as $course_name ) : ?> |
| 29 |
<option value="<?php echo $course_name; ?>"<?php if ($course_name == $post_course) echo ' selected'; ?>><?php echo $course_name; ?></option> |
| 30 |
<?php endforeach; ?> |
| 31 |
<option value="--new--">-- <?php echo __( 'Add a specific course', $this->plugin_name ); ?> --</option> |
| 32 |
</select> |
| 33 |
<span class="course-toggle" style="display: none;"> |
| 34 |
<input type="text" name="wpcomplete[course-custom]" disabled> or <a href="javascript:void();" onclick="jQuery('.course-toggle').toggle(); jQuery('.course-toggle select').attr('disabled', false); jQuery('.course-toggle input').attr('disabled', 'disabled'); ">cancel</a> |
| 35 |
</span> |
| 36 |
</p> |
| 37 |
|
| 38 |
<p> |
| 39 |
<label for="completion_redirect_url"><?php echo __( 'Where would you like to redirect your students upon marking all buttons on this page as completed?', $this->plugin_name ); ?></label><br> |
| 40 |
<input type="text" id="completion_redirect_to" name="wpcomplete[completion-redirect-to]" value="<?php echo $redirect['title']; ?>" placeholder=""> |
| 41 |
<input type="hidden" id="completion_redirect_url" name="wpcomplete[completion-redirect-url]" value="<?php echo $redirect['url']; ?>"> |
| 42 |
<span class="howto"><?php echo __( 'Leave empty to not redirect.', $this->plugin_name ); ?></span> |
| 43 |
</p> |
| 44 |
|
| 45 |
<?php if ( isset($post_meta['buttons']) && count($post_meta['buttons']) > 0 ) : ?> |
| 46 |
<h4>Registered Buttons</h4> |
| 47 |
<p><em><small>Note: Buttons are added when present in the post's content body or when a user views the button for the first time. If you delete the button below, but do not remove the shortcode from the post content, the button will continue to appear and re-register.</small></em></p> |
| 48 |
|
| 49 |
<ul style="list-style: disc; margin: 1em;"> |
| 50 |
<?php |
| 51 |
foreach ($post_meta['buttons'] as $key => $button) : |
| 52 |
list($post_id, $button_id) = $this->extract_button_info($button); |
| 53 |
?> |
| 54 |
<li> |
| 55 |
<?php echo (empty($button_id)) ? 'Default' : $button_id; ?> - <a href="#" class="wpc_delete_button" data-post-id="<?php echo $post_id; ?>" data-button="<?php echo $button; ?>">(delete)</a> |
| 56 |
</li> |
| 57 |
<?php endforeach; ?> |
| 58 |
</ul> |
| 59 |
<?php endif; ?> |
| 60 |
|
| 61 |
<?php endif; ?> |
| 62 |
</div> |
| 63 |
|