PluginProbe
Super RSS Reader – Add attractive RSS Feed Widget / 4.1
Super RSS Reader – Add attractive RSS Feed Widget v4.1
trunk 0.8 2.0 2.1 2.2 2.3 2.4 2.5 2.6 2.7 2.8 3.0 3.1 3.2 4.0 4.0.1 4.1 4.2 4.3 4.4 4.4.1 4.5 4.6 4.7 4.8 All 33 releases
super-rss-reader / includes / options.php

options.php in Super RSS Reader – Add attractive RSS Feed Widget 4.1, at includes/options.php

178 lines 7.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Plugin options
4 *
5 */
6
7 if( ! defined( 'ABSPATH' ) ) exit;
8
9 class SRR_Options{
10
11 public static function options(){
12
13 return apply_filters( 'srr_mod_options', array(
14 'urls' => array(
15 'default' => '',
16 'description' => __( 'The URLs to display RSS feed for. Multiple RSS feed URLs can be separated by a new line or comma.', 'super-rss-reader' ),
17 ),
18 'tab_titles' => array(
19 'default' => '',
20 'description' => __( 'The title of the tab for the respective RSS feed.', 'super-rss-reader' )
21 ),
22 'count' => array(
23 'default' => 5,
24 'description' => __( 'The total number of feed items to fetch.', 'super-rss-reader' )
25 ),
26 'show_date' => array(
27 'default' => 0,
28 'description' => __( 'Display the date of the feed item.', 'super-rss-reader' ),
29 'options' => array(
30 0 => __( 'Hide date', 'super-rss-reader' ),
31 1 => __( 'Show date', 'super-rss-reader' )
32 )
33 ),
34 'show_desc' => array(
35 'default' => 1,
36 'description' => __( 'Display the description/excerpt of the feed item.', 'super-rss-reader' ),
37 'options' => array(
38 0 => __( 'Hide description', 'super-rss-reader' ),
39 1 => __( 'Show description', 'super-rss-reader' )
40 )
41 ),
42 'show_author' => array(
43 'default' => 0,
44 'description' => __( 'Display the author of the feed item.', 'super-rss-reader' ),
45 'options' => array(
46 0 => __( 'Hide author', 'super-rss-reader' ),
47 1 => __( 'Show author', 'super-rss-reader' )
48 )
49 ),
50 'show_thumb' => array(
51 'default' => 1,
52 'description' => __( 'Display the thumbnail of the feed item.', 'super-rss-reader' ),
53 'options' => array(
54 0 => __( 'Hide thumbnail', 'super-rss-reader' ),
55 1 => __( 'Show thumbnail', 'super-rss-reader' )
56 )
57 ),
58 'strip_desc' => array(
59 'default' => 30,
60 'description' => __( 'Trim the description to certain number of words.', 'super-rss-reader' )
61 ),
62 'strip_title' => array(
63 'default' => 0,
64 'description' => __( 'Trim the title text to certain number of words.', 'super-rss-reader' )
65 ),
66 'date_format' => array(
67 'default' => 'j F Y',
68 'description' => __( 'The format of the feed item date.', 'super-rss-reader' )
69 ),
70 'read_more' => array(
71 'default' => '[...]',
72 'description' => __( 'The read more text if the description is trimmed.', 'super-rss-reader' )
73 ),
74 'rich_desc' => array(
75 'default' => 0,
76 'description' => __( 'Display rich description with all the formatting. Note: With rich description text cannot be trimmed.', 'super-rss-reader' ),
77 'options' => array(
78 0 => __( 'Normal description', 'super-rss-reader' ),
79 1 => __( 'Rich description', 'super-rss-reader' )
80 )
81 ),
82 'add_nofollow' => array(
83 'default' => 1,
84 'description' => __( 'Add "nofollow" attribute to feed links.', 'super-rss-reader' ),
85 'options' => array(
86 0 => __( 'Do not add nofollow attribute', 'super-rss-reader' ),
87 1 => __( 'Add nofollow attribute', 'super-rss-reader' )
88 )
89 ),
90 'open_newtab' => array(
91 'default' => 1,
92 'description' => __( 'Open the feed links in new tab.', 'super-rss-reader' ),
93 'options' => array(
94 0 => __( 'Open in same tab', 'super-rss-reader' ),
95 1 => __( 'Open in new tab', 'super-rss-reader' )
96 )
97 ),
98 'thumbnail_position' => array(
99 'default' => 'align_left',
100 'description' => __( 'The position of the thumbnail.', 'super-rss-reader' ),
101 'options' => array(
102 'align_left' => __( 'Align left', 'super-rss-reader' ),
103 'align_right' => __( 'Align right', 'super-rss-reader' ),
104 'cover' => __( 'Cover', 'super-rss-reader' )
105 )
106 ),
107 'thumbnail_size' => array(
108 'default' => '64px',
109 'description' => __( 'The size of the thumbnail including the units. Example: 64px, 10%', 'super-rss-reader' )
110 ),
111 'thumbnail_default' => array(
112 'default' => '',
113 'description' => __( 'The URL of the default thumbnail image if not present. Leave empty to not display any thumbnail.', 'super-rss-reader' )
114 ),
115 'color_style' => array(
116 'default' => 'none',
117 'description' => __( 'The style of the feed display.', 'super-rss-reader' ),
118 'options' => array(
119 'none' => 'No style',
120 'grey' => 'Grey',
121 'dark' => 'Dark',
122 'orange' => 'Orange',
123 'smodern' => 'Simple modern'
124 )
125 ),
126 'display_type' => array(
127 'default' => 'vertical_ticker',
128 'description' => __( 'The type of feed display mode.', 'super-rss-reader' ),
129 'options' => array(
130 'normal' => __( 'Normal', 'super-rss-reader' ),
131 'vertical_ticker' => __( 'Ticker', 'super-rss-reader' ),
132 )
133 ),
134 'visible_items' => array(
135 'default' => 5,
136 'description' => __( 'The number of feed items to be visible when ticker is enabled.', 'super-rss-reader' )
137 ),
138 'ticker_speed' => array(
139 'default' => 4,
140 'description' => __( 'The speed of the ticker animation in seconds. Without units.', 'super-rss-reader' )
141 ),
142 ));
143
144 }
145
146 public static function defaults(){
147
148 $defaults = array();
149 $all_options = self::options();
150
151 foreach( $all_options as $id => $props ){
152 $defaults[ $id ] = $props[ 'default' ];
153 }
154
155 return $defaults;
156
157 }
158
159 public static function select_options(){
160
161 $select_options = array();
162 $all_options = self::options();
163
164 foreach( $all_options as $id => $props ){
165 $list = array();
166 if( array_key_exists( 'options', $props ) && is_array( $props[ 'options' ] ) ){
167 $list = $props[ 'options' ];
168 }
169 $select_options[ $id ] = $list;
170 }
171
172 return $select_options;
173
174 }
175
176 }
177
178 ?>