initial commit
This commit is contained in:
94
includes/better-twitter-widget-admin.css
Normal file
94
includes/better-twitter-widget-admin.css
Normal file
@@ -0,0 +1,94 @@
|
||||
@charset "UTF-8";
|
||||
/**
|
||||
* better-rss-widget-admin.css - Stylesheet for the settings page.
|
||||
*
|
||||
* @package Better Twitter Widget
|
||||
* @subpackage templates
|
||||
* @author Max Mehl
|
||||
* @copyright 2016
|
||||
* @access public
|
||||
* @since 2.1
|
||||
*/
|
||||
|
||||
label.primary {
|
||||
text-align: right;
|
||||
width: 200px;
|
||||
display: block;
|
||||
float: left;
|
||||
font-weight: bold;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
label.better-rss-widget-post-type {
|
||||
width: 125px;
|
||||
float: left;
|
||||
font-size: 12px;
|
||||
}
|
||||
label.better-rss-widget-hide-word {
|
||||
width: 100px;
|
||||
float: left;
|
||||
}
|
||||
|
||||
ul#better_rss_widget_tabs {
|
||||
border-bottom:1px solid #A2B6CB;
|
||||
font-family:Verdana,Arial;
|
||||
font-size:12px;
|
||||
font-weight:bold;
|
||||
list-style-type:none;
|
||||
margin-bottom:12px;
|
||||
padding-bottom:28px;
|
||||
z-index:1;
|
||||
}
|
||||
|
||||
#better_rss_widget_tabs li {
|
||||
background-color: #EBEBEB;
|
||||
border: 1px solid #A2B6CB;
|
||||
float: left;
|
||||
height: 25px;
|
||||
margin: 2px 0px 0px 5px;
|
||||
}
|
||||
|
||||
#better_rss_widget_tabs li a {
|
||||
color: #666;
|
||||
display: block;
|
||||
float: right;
|
||||
padding: 5px;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
|
||||
|
||||
#better_rss_widget_tabs li.save-tab {
|
||||
background-color: #666666;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
#better_rss_widget_tabs li.save-tab a {
|
||||
color: #FFFFFF;
|
||||
}
|
||||
|
||||
#better_rss_widget_tabs li.better-rss-widget-selected {
|
||||
background-color: #A2B6CB;
|
||||
}
|
||||
|
||||
#better_rss_widget_tabs li.better-rss-widget-selected a{
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.better-rss-widget-settings-table {
|
||||
min-height: 350px;
|
||||
}
|
||||
|
||||
#better_rss_widget_footer {
|
||||
clear: both;
|
||||
margin-top: 15px;
|
||||
}
|
||||
|
||||
#better_rss_widget_footer div.postbox {
|
||||
min-height: 150px;
|
||||
}
|
||||
|
||||
.form-table tr {
|
||||
border-bottom: solid 1px #ddd;
|
||||
padding: 5px;
|
||||
}
|
||||
120
includes/settings.php
Normal file
120
includes/settings.php
Normal 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>
|
||||
129
includes/widget-form.php
Normal file
129
includes/widget-form.php
Normal file
@@ -0,0 +1,129 @@
|
||||
<?php
|
||||
if ( preg_match( '#' . basename( __FILE__ ) . '#', $_SERVER['PHP_SELF'] ) ) {
|
||||
die( 'You are not allowed to call this page directly.' );
|
||||
}
|
||||
/**
|
||||
* widget-form.php - View for the Settings page.
|
||||
*
|
||||
* @package Better Twitter Widget
|
||||
* @subpackage includes
|
||||
* @author Max Mehl
|
||||
* @copyright 2016
|
||||
* @access public
|
||||
* @since 0.1
|
||||
*/
|
||||
?>
|
||||
<p>
|
||||
<label for="<?php print $this->get_field_id( 'title' ); ?>">
|
||||
<?php _e( 'Give the Feed a Title (optional):', 'better-rss-widget' ); ?>
|
||||
</label>
|
||||
<input id="<?php print $this->get_field_id( 'title' ); ?>" name="<?php print $this->get_field_name( 'title' ); ?>" type="text" value="<?php print $instance['title']; ?>" />
|
||||
<label>
|
||||
<input type="checkbox" id="<?php print $this->get_field_id( 'no_link_title' ); ?>" name="<?php print $this->get_field_name( 'no_link_title' ); ?>" value="1" <?php checked( $instance['no_link_title'], true ); ?> />
|
||||
<?php _e( 'Do not link', 'better-rss-widget' ); ?>
|
||||
</label>
|
||||
</p>
|
||||
<p>
|
||||
<label for="<?php print $this->get_field_id( 'title_url' ); ?>">
|
||||
<?php _e( 'Title URL (blank for RSS feed):', 'better-rss-widget' ); ?>
|
||||
</label>
|
||||
<input style="width:300px;" id="<?php print $this->get_field_id( 'title_url' ); ?>" name="<?php print $this->get_field_name( 'title_url' ); ?>" type="text" value="<?php print $instance['title_url']; ?>" />
|
||||
</p>
|
||||
<?php if ( true == $this->options->allow_intro ) : ?>
|
||||
<p>
|
||||
<label for="<?php print $this->get_field_id( 'intro_text' ); ?>">
|
||||
<?php _e( 'Text to display above the links:', 'better-rss-widget' ); ?>
|
||||
</label>
|
||||
</p>
|
||||
<p>
|
||||
<textarea style="width:485px;height: 75px;" name="<?php print $this->get_field_name( 'intro_text' ); ?>" id="<?php print $this->get_field_id( 'intro_text' ); ?>"><?php echo $instance['intro_text']; ?></textarea>
|
||||
</p>
|
||||
<?php endif; ?>
|
||||
<p>
|
||||
<label for="<?php print $this->get_field_id( 'items' ); ?>"><?php _e( 'Show', 'better-rss-widget' ); ?></label>
|
||||
<select name="<?php print $this->get_field_name( 'items' ); ?>" id="<?php print $this->get_field_id( 'items' ); ?>">
|
||||
<?php
|
||||
for ( $i = 1; $i <= 20; ++$i )
|
||||
print "<option value='$i' " . selected( $instance['items'], $i, true ) . ">$i</option>";
|
||||
?>
|
||||
</select>
|
||||
<label for="<?php print $this->get_field_id( 'rss_url' ); ?>">
|
||||
<?php _e( 'items from', 'better-rss-widget' ); ?>
|
||||
</label>
|
||||
<input style="width:330px;" id="<?php print $this->get_field_id( 'rss_url' ); ?>" name="<?php print $this->get_field_name( 'rss_url' ); ?>" type="text" value="<?php print $instance['rss_url']; ?>" />
|
||||
</p>
|
||||
<p>
|
||||
<input name="<?php print $this->get_field_name( 'show_icon' ); ?>" type="checkbox" id="<?php print $this->get_field_id( 'show_icon' ); ?>" value="1" <?php checked( $instance['show_icon'], 1 ); ?> />
|
||||
<label for="<?php print $this->get_field_id( 'show_icon' ); ?>">
|
||||
<?php _e( 'Show feed icon before title', 'better-rss-widget' ); ?>
|
||||
</label>
|
||||
<label><?php _e( 'and link icon to', 'better-rss-widget' ); ?></label>
|
||||
<label><input type="radio" name="<?php print $this->get_field_name( 'link_icon' ); ?>" value="rss_url" <?php checked( $instance['link_icon'], 'rss_url' ); ?> /> <?php _e( 'RSS Url', 'better-rss-widget' ); ?></label>
|
||||
<label><input type="radio" name="<?php print $this->get_field_name( 'link_icon' ); ?>" value="title_url" <?php checked( $instance['link_icon'], 'title_url' ); ?> /> <?php _e( 'Title Url', 'better-rss-widget' ); ?></label>
|
||||
</p>
|
||||
<p>
|
||||
<input name="<?php print $this->get_field_name( 'limit_title_length' ); ?>" type="checkbox" id="<?php print $this->get_field_id( 'limit_title_length' ); ?>" value="1" <?php checked( $instance['limit_title_length'], 1 ); ?> />
|
||||
<label for="<?php print $this->get_field_id( 'limit_title_length' ); ?>">
|
||||
<?php _e( 'Limit length of title to', 'better-rss-widget' ); ?>
|
||||
</label>
|
||||
<input id="<?php print $this->get_field_id( 'title_length' ); ?>" name="<?php print $this->get_field_name( 'title_length' ); ?>" type="text" value="<?php print $instance['title_length']; ?>" />
|
||||
|
||||
<label for="<?php print $this->get_field_id( 'title_length' ); ?>">
|
||||
<?php _e( 'characters.', 'better-rss-widget' ); ?>
|
||||
</label>
|
||||
</p>
|
||||
<p>
|
||||
<input name="<?php print $this->get_field_name( 'show_summary' ); ?>" type="checkbox" id="<?php print $this->get_field_id( 'show_summary' ); ?>" value="1" <?php checked( $instance['show_summary'], 1 ); ?> />
|
||||
<label for="<?php print $this->get_field_id( 'show_summary' ); ?>">
|
||||
<?php _e( 'Display item summary limited to', 'better-rss-widget' ); ?>
|
||||
</label>
|
||||
<input id="<?php print $this->get_field_id( 'excerpt' ); ?>" name="<?php print $this->get_field_name( 'excerpt' ); ?>" type="text" value="<?php print $instance['excerpt']; ?>" />
|
||||
|
||||
<label for="<?php print $this->get_field_id( 'excerpt' ); ?>">
|
||||
<?php _e( 'characters.', 'better-rss-widget' ); ?>
|
||||
</label>
|
||||
</p>
|
||||
<h3><?php _e( 'Additional Fields', 'better-rss-widget' ); ?></h3>
|
||||
<p>
|
||||
<input type="checkbox" value="1" name="<?php print $this->get_field_name( 'show_author' ); ?>" id="<?php print $this->get_field_id( 'show_author' ); ?>" <?php checked( $instance['show_author'], 1 ); ?> />
|
||||
<label for="<?php print $this->get_field_id( 'show_author' ); ?>">
|
||||
<?php _e( 'Author', 'better-rss-widget' ); ?>
|
||||
</label>
|
||||
<input type="checkbox" value="1" name="<?php print $this->get_field_name( 'show_date' ); ?>" id="<?php print $this->get_field_id( 'show_date' ); ?>" <?php checked( $instance['show_date'], 1 ); ?> />
|
||||
<label for="<?php print $this->get_field_id( 'show_date' ); ?>">
|
||||
<?php _e( 'Date', 'better-rss-widget' ); ?>
|
||||
</label>
|
||||
<input type="checkbox" value="1" name="<?php print $this->get_field_name( 'show_time' ); ?>" id="<?php print $this->get_field_id( 'show_time' ); ?>" <?php checked( $instance['show_time'], 1 ); ?> />
|
||||
<label for="<?php print $this->get_field_id( 'show_time' ); ?>">
|
||||
<?php _e( 'Time', 'better-rss-widget' ); ?>
|
||||
</label>
|
||||
<input type="checkbox" value="1" name="<?php print $this->get_field_name( 'nofollow' ); ?>" id="<?php print $this->get_field_id( 'nofollow' ); ?>" <?php checked( $instance['nofollow'], 1 ); ?> />
|
||||
<label for="<?php print $this->get_field_id( 'nofollow' ); ?>">
|
||||
<?php _e( 'Add nofollow to links', 'better-rss-widget' ); ?>
|
||||
</label>
|
||||
</p>
|
||||
<p>
|
||||
<label for="<?php print $this->get_field_id( 'link_target' ); ?>">
|
||||
<?php _e( 'Link Target:', 'better-rss-widget' ); ?>
|
||||
</label>
|
||||
<select name="<?php print $this->get_field_name( 'link_target' ); ?>" id="<?php print $this->get_field_id( 'link_target' ); ?>">
|
||||
<option value="none" <?php selected( $instance['link_target'], 'none' ); ?>><?php _e( 'None', 'better-rss-widget' ); ?></option>
|
||||
<option value="_blank" <?php selected( $instance['link_target'], '_blank' ); ?>><?php _e( 'New Window', 'better-rss-widget' ); ?></option>
|
||||
<option value="_top" <?php selected( $instance['link_target'], '_top' ); ?>><?php _e( 'Top Window', 'better-rss-widget' ); ?></option>
|
||||
</select>
|
||||
</p>
|
||||
|
||||
<h3><?php _e( 'Cache Settings', 'better-rss-widget' ); ?></h3>
|
||||
<p>
|
||||
<input type="checkbox" value="1" name="<?php print $this->get_field_name( 'enable_cache' ); ?>" id="<?php print $this->get_field_id( 'enable_cache' ); ?>" <?php checked( $instance['enable_cache'], 1 ); ?> />
|
||||
<label for="<?php print $this->get_field_id( 'enable_cache' ); ?>">
|
||||
<?php _e( 'Enable Cache?', 'better-rss-widget' ); ?>
|
||||
</label>
|
||||
</p>
|
||||
<p>
|
||||
<label for="<?php print $this->get_field_id( 'cache_duration' ); ?>">
|
||||
<?php _e( 'Cache Duration (seconds)<br /><small>ex. 3600 seconds = 60 minutes</small>', 'better-rss-widget' ); ?>
|
||||
</label>
|
||||
<input id="<?php print $this->get_field_id( 'cache_duration' ); ?>" name="<?php print $this->get_field_name( 'cache_duration' ); ?>" type="text" value="<?php print $instance['cache_duration']; ?>" />
|
||||
<?php _e( 'seconds', 'better-rss-widget' ); ?>.
|
||||
</p>
|
||||
Reference in New Issue
Block a user