PluginProbe
Super RSS Reader – Add attractive RSS Feed Widget / 4.7
Super RSS Reader – Add attractive RSS Feed Widget v4.7
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
← All changes | includes/options.php +123 -37 3.24.7 View file →
@@ -9,108 +9,194 @@
9 9 class SRR_Options{
10 10
11 11 public static function options(){
12 12
13 - return array(
13 + return apply_filters( 'srr_mod_options', array(
14 14 'urls' => array(
15 15 'default' => '',
16 - 'description' => __( 'The URLs to display RSS feed for. Multiple RSS feed URLs can be separated by a new line or comma' )
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 17 ),
18 18 'tab_titles' => array(
19 19 'default' => '',
20 - 'description' => __( 'The title of the tab for the respective RSS feed.' )
20 + 'description' => __( 'The title of the tab for the respective RSS feed.', 'super-rss-reader' )
21 21 ),
22 22 'count' => array(
23 23 'default' => 5,
24 - 'description' => __( 'The total number of feed items to fetch.' )
24 + 'description' => __( 'The total number of feed items to fetch.', 'super-rss-reader' )
25 25 ),
26 26 'show_date' => array(
27 27 'default' => 0,
28 - 'description' => __( 'Display the date of the feed item' )
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 + )
29 33 ),
30 34 'show_desc' => array(
31 35 'default' => 1,
32 - 'description' => __( 'Display the description/excerpt of the feed item' )
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 + )
33 41 ),
34 42 'show_author' => array(
35 43 'default' => 0,
36 - 'description' => __( 'Display the author of the feed item' )
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 + )
37 49 ),
38 50 'show_thumb' => array(
39 51 'default' => 1,
40 - 'description' => __( 'Display the thumbnail of the feed item' )
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 + )
41 57 ),
42 58 'strip_desc' => array(
43 59 'default' => 30,
44 - 'description' => __( 'Trim the description to certain number of words' )
60 + 'description' => __( 'Trim the description to certain number of words.', 'super-rss-reader' )
45 61 ),
46 62 'strip_title' => array(
47 63 'default' => 0,
48 - 'description' => __( 'Trim the title text to certain number of words.' )
64 + 'description' => __( 'Trim the title text to certain number of words.', 'super-rss-reader' )
49 65 ),
66 + 'date_format' => array(
67 + 'default' => 'j F Y',
68 + 'description' => __( 'The format of the feed item date.', 'super-rss-reader' )
69 + ),
70 + 'date_timezone' => array(
71 + 'default' => 'UTC',
72 + 'description' => __( 'The timezone of the feed item date.', 'super-rss-reader' )
73 + ),
74 + 'order_by' => array(
75 + 'default' => 'default',
76 + 'description' => __( 'The order of the feed', 'super-rss-reader' ),
77 + 'options' => array(
78 + 'default' => __( 'Default', 'super-rss-reader' ),
79 + 'date' => __( 'Date', 'super-rss-reader' ),
80 + 'date_reverse' => __( 'Date reverse', 'super-rss-reader' ),
81 + 'random' => __( 'Random', 'super-rss-reader' )
82 + )
83 + ),
50 84 'read_more' => array(
51 85 'default' => '[...]',
52 - 'description' => __( 'The read more text if the description is stripped.' )
86 + 'description' => __( 'The read more text if the description is trimmed.', 'super-rss-reader' )
53 87 ),
54 88 'rich_desc' => array(
55 89 'default' => 0,
56 - 'description' => __( 'Display rich description with all the formatting present in the feed.' )
90 + 'description' => __( 'Display rich description with all the formatting. Note: With rich description text cannot be trimmed.', 'super-rss-reader' ),
91 + 'options' => array(
92 + 0 => __( 'Normal description', 'super-rss-reader' ),
93 + 1 => __( 'Rich description', 'super-rss-reader' )
94 + )
57 95 ),
96 + 'desc_type' => array(
97 + 'default' => 'summary',
98 + 'description' => __( 'Type of description to prefer', 'super-rss-reader' ),
99 + 'options' => array(
100 + 'summary' => __( 'Summary', 'super-rss-reader' ),
101 + 'full_content' => __( 'Full content', 'super-rss-reader' )
102 + )
103 + ),
58 104 'add_nofollow' => array(
59 105 'default' => 1,
60 - 'description' => __( 'Add "nofollow" attribute to feed links' )
106 + 'description' => __( 'Add "nofollow" attribute to feed links.', 'super-rss-reader' ),
107 + 'options' => array(
108 + 0 => __( 'Do not add nofollow attribute', 'super-rss-reader' ),
109 + 1 => __( 'Add nofollow attribute', 'super-rss-reader' )
110 + )
61 111 ),
62 112 'open_newtab' => array(
63 113 'default' => 1,
64 - 'description' => __( 'Display the thumbnail of the feed item' )
114 + 'description' => __( 'Open the feed links in new tab.', 'super-rss-reader' ),
115 + 'options' => array(
116 + 0 => __( 'Open in same tab', 'super-rss-reader' ),
117 + 1 => __( 'Open in new tab', 'super-rss-reader' )
118 + )
65 119 ),
120 + 'thumbnail_position' => array(
121 + 'default' => 'align_left',
122 + 'description' => __( 'The position of the thumbnail.', 'super-rss-reader' ),
123 + 'options' => array(
124 + 'align_left' => __( 'Align left', 'super-rss-reader' ),
125 + 'align_right' => __( 'Align right', 'super-rss-reader' ),
126 + 'cover' => __( 'Cover', 'super-rss-reader' )
127 + )
128 + ),
129 + 'thumbnail_size' => array(
130 + 'default' => '64px',
131 + 'description' => __( 'The size of the thumbnail including the units. Example: 64px, 10%', 'super-rss-reader' )
132 + ),
133 + 'thumbnail_default' => array(
134 + 'default' => '',
135 + 'description' => __( 'The URL of the default thumbnail image if not present. Leave empty to not display any thumbnail.', 'super-rss-reader' )
136 + ),
137 + 'no_feed_text' => array(
138 + 'default' => __( 'No items', 'super-rss-reader' ),
139 + 'description' => __( 'Text to display when there are no feed items', 'super-rss-reader' )
140 + ),
66 141 'color_style' => array(
67 142 'default' => 'none',
68 - 'description' => __( 'The style of the feed display' )
143 + 'description' => __( 'The style of the feed display.', 'super-rss-reader' ),
144 + 'options' => array(
145 + 'none' => 'No style',
146 + 'grey' => 'Grey',
147 + 'dark' => 'Dark',
148 + 'orange' => 'Orange',
149 + 'smodern' => 'Simple modern'
150 + )
69 151 ),
70 152 'display_type' => array(
71 153 'default' => 'vertical_ticker',
72 - 'description' => __( 'The type of feed display mode.' )
154 + 'description' => __( 'The type of feed display mode.', 'super-rss-reader' ),
155 + 'options' => array(
156 + 'normal' => __( 'Normal', 'super-rss-reader' ),
157 + 'vertical_ticker' => __( 'Ticker', 'super-rss-reader' ),
158 + )
73 159 ),
74 160 'visible_items' => array(
75 161 'default' => 5,
76 - 'description' => __( 'The number of feed items to be visible when ticker is enabled.' )
162 + 'description' => __( 'The number of feed items to be visible when ticker is enabled.', 'super-rss-reader' )
77 163 ),
78 164 'ticker_speed' => array(
79 165 'default' => 4,
80 - 'description' => __( 'The speed of the ticker animation in seconds' )
166 + 'description' => __( 'The speed of the ticker animation in seconds. Without units.', 'super-rss-reader' )
81 167 ),
82 - );
168 + ));
83 169
84 170 }
85 171
86 - public static function color_themes(){
87 - return array(
88 - 'No style' => 'none',
89 - 'Grey' => 'grey',
90 - 'Dark' => 'dark',
91 - 'Orange' => 'orange',
92 - 'Simple modern' => 'smodern'
93 - );
94 - }
172 + public static function defaults(){
95 173
96 - public static function display_types(){
97 - return array(
98 - 'normal' => 'Only feed list',
99 - 'vertical_ticker' => 'Feed list + Ticker',
100 - );
174 + $defaults = array();
175 + $all_options = self::options();
176 +
177 + foreach( $all_options as $id => $props ){
178 + $defaults[ $id ] = $props[ 'default' ];
179 + }
180 +
181 + return $defaults;
182 +
101 183 }
102 184
103 - public static function default_options(){
185 + public static function select_options(){
104 186
105 - $defaults = array();
187 + $select_options = array();
106 188 $all_options = self::options();
107 189
108 190 foreach( $all_options as $id => $props ){
109 - $defaults[ $id ] = $props[ 'default' ];
191 + $list = array();
192 + if( array_key_exists( 'options', $props ) && is_array( $props[ 'options' ] ) ){
193 + $list = $props[ 'options' ];
194 + }
195 + $select_options[ $id ] = $list;
110 196 }
111 197
112 - return $defaults;
198 + return $select_options;
113 199
114 200 }
115 201
116 202 }