initial commit

This commit is contained in:
2016-09-07 20:59:59 +02:00
commit 429c836ff1
11 changed files with 1791 additions and 0 deletions

120
includes/settings.php Normal file
View File

@@ -0,0 +1,120 @@
<?php
if (preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])) {
die('You are not allowed to call this page directly.');
}
/**
* settings.php - View for the Settings page.
*
* @package Better Twitter Widget
* @subpackage includes
* @author Max Mehl
* @copyright 2016
* @access public
* @since 2.1
*/
?>
<div class = "wrap">
<h2><?php echo $this->pluginName; ?></h2>
<div style="width:49%; float:left">
<div class="postbox">
<form method="post" action="options.php">
<?php wp_nonce_field('update-options'); ?>
<input type="hidden" name="action" value="update" />
<input type="hidden" name="page_options" value="<?php echo $this->optionsName; ?>" />
<table class="form-table">
<thead></thead>
<tfoot>
<tr>
<td colspan="2">
<input type="submit" class="button-primary" value="<?php _e('Save Changes') ?>" />
</td>
</tr>
</tfoot>
<tbody>
<tr align="top">
<th scope="row"><label class="primary" for="<?php echo $this->optionsName; ?>_allow_intro"><?php _e('Use Intro Text?', 'better-twitter-widget'); ?></label></th>
<td>
<input type="checkbox" name="<?php echo $this->optionsName; ?>[allow_intro]" id="<?php echo $this->optionsName; ?>_allow_intro" value="1" <?php checked($this->options->allow_intro, 1); ?>>
</td>
</tr>
<tr align="top">
<th scope="row"><label class="primary" for="<?php echo $this->optionsName; ?>_link_target"><?php _e('Default Link Target', 'better-twitter-widget'); ?> : </label></th>
<td>
<select name="<?php echo $this->optionsName; ?>[link_target]" id="<?php echo $this->optionsName; ?>_link_target">
<option>None</option>
<option value="_blank" <?php selected($this->options->link_target, '_blank'); ?>><?php _e('New Window', 'better-twitter-widget'); ?></option>
<option value="_top" <?php selected($this->options->link_target, '_top'); ?>><?php _e('Top Window', 'better-twitter-widget'); ?></option>
</select>
</td>
</tr>
<tr align="top">
<th scope="row"><label class="primary"><?php _e('Display items', 'better-twitter-widget'); ?> : </label></th>
<td>
<p>
<label>
<input name="<?php echo $this->optionsName; ?>[show_summary]" type="checkbox" id="better_twitter_widget_show_summary" value="1" <?php checked($this->options->show_summary, 1); ?> />
<?php _e('Item Summary', 'better-twitter-widget'); ?>
</label>
</p>
<p>
<label>
<input name="<?php echo $this->optionsName; ?>[show_author]" type="checkbox" id="better_twitter_widget_show_summary" value="1" <?php checked($this->options->show_author, 1); ?> />
<?php _e('Item Author', 'better-twitter-widget'); ?>
</label>
</p>
<p>
<label>
<input name="<?php echo $this->optionsName; ?>[show_date]" type="checkbox" id="<?php echo $this->optionsName; ?>[show_date]" value="1" <?php checked($this->options->show_date, 1); ?> />
<?php _e('Item Date', 'better-twitter-widget'); ?>
</label>
</p>
<p>
<label>
<input name="<?php echo $this->optionsName; ?>[show_time]" type="checkbox" id="<?php echo $this->optionsName; ?>_show_time" value="1" <?php checked($this->options->show_time, 1); ?> />
<?php _e('Item Time', 'better-twitter-widget'); ?>
</label>
</p>
</td>
</tr>
<tr align="top">
<th scope="row"><label class="primary" for="<?php echo $this->optionsName; ?>_nofollow"><?php _e('Add nofollow to links', 'better-twitter-widget'); ?> : </label></th>
<td><input name="<?php echo $this->optionsName; ?>[nofollow]" type="checkbox" id="<?php echo $this->optionsName; ?>_nofollow" value="1" <?php checked($this->options->nofollow, 1); ?> /> </td>
</tr>
<tr align="top">
<th scope="row"><label class="primary" for="<?php echo $this->optionsName; ?>_items"><?php _e('Default Items to Display', 'better-twitter-widget'); ?></label> : </th>
<td>
<input type="number" name="<?php echo $this->optionsName; ?>[items]" id="<?php echo $this->optionsName; ?>_items" value="<?php echo $this->options->items; ?>" min="1" max="25" />
</td>
</tr>
<tr align="top">
<th scope="row"><label class="primary" for="<?php echo $this->optionsName; ?>_title_length"><?php _e('Max Length of Title', 'better-twitter-widget'); ?> : </label></th>
<td colspan="2">
<input name="<?php echo $this->optionsName; ?>[title_length]" type="number" id="<?php echo $this->optionsName; ?>_title_length" value="<?php echo $this->options->title_length; ?>" min="0" max="100" />
<?php _e('( Enter "0" for no limit. )', 'better-twitter-widget'); ?>
</td>
</tr>
<tr align="top">
<th scope="row"><label class="primary" for="<?php echo $this->optionsName; ?>_excerpt"><?php _e('Length of Excerpt', 'better-twitter-widget'); ?> : </label></th>
<td colspan="2"><input name="<?php echo $this->optionsName; ?>[excerpt]" type="number" id="<?php echo $this->optionsName; ?>_excerpt" value="<?php echo $this->options->excerpt; ?>" min="25" /></td>
</tr>
<tr align="top">
<th scope="row"><label class="primary" for="<?php echo $this->optionsName; ?>_suffix"><?php _e('Add after the excerpt', 'better-twitter-widget'); ?> : </label></th>
<td colspan="2"><input name="<?php echo $this->optionsName; ?>[suffix]" type="text" id="<?php echo $this->optionsName; ?>_suffix" value="<?php echo $this->options->suffix; ?>" /></td>
</tr>
<tr align="top">
<th scope="row"><label class="primary" for="<?php echo $this->optionsName; ?>_enable_cache"><?php _e('RSS Cache', 'better-twitter-widget'); ?> : </label></th>
<td>
<label><input name="<?php echo $this->optionsName; ?>[enable_cache]" type="radio" id="better_twitter_widget_enable_cache" value="1" <?php checked($this->options->enable_cache, 1); ?> /> <?php _e('Enabled', 'better-twitter-widget'); ?></label>
<label><input name="<?php echo $this->optionsName; ?>[enable_cache]" type="radio" id="better_twitter_widget_disable_cache" value="0" <?php checked($this->options->enable_cache, 0); ?> /> <?php _e('Disabled', 'better-twitter-widget'); ?></label>
</td>
</tr>
<tr align="top">
<th scope="row"><label class="primary" for="<?php echo $this->optionsName; ?>_cache_duration"><?php _e('Cache Duration (seconds)<br /><small>ex. 3600 seconds = 60 minutes</small>', 'better-twitter-widget'); ?> : </label></th>
<td><input name="<?php echo $this->optionsName; ?>[cache_duration]" type="number" id="<?php echo $this->optionsName; ?>_cache_duration" value="<?php echo $this->options->cache_duration; ?>" min="3600" /> <?php _e('seconds', 'better-twitter-widget'); ?>. </td>
</tr>
</tbody>
</table>
</form>
</div>
</div>