Version Description
- FIXED: "Use pagenavi-css.css" & "Always Show Page Navigation" in the options are not being saved
Download this release
Release Info
Developer | GamerZ |
Plugin | WP-PageNavi |
Version | 2.85 |
Comparing to | |
See all releases |
Code changes from version 2.83 to 2.85
- admin.php +9 -6
- core.php +31 -12
- lang/wp-pagenai.pot +183 -0
- lang/wp-pagenavi-de_DE.mo +0 -0
- lang/wp-pagenavi-de_DE.po +127 -179
- lang/wp-pagenavi-sl_SI.mo +0 -0
- lang/wp-pagenavi-sl_SI.po +198 -0
- lang/wp-pagenavi-sr_RS.mo +0 -0
- lang/wp-pagenavi-sr_RS.po +270 -198
- lang/wp-pagenavi-zh_CN.po +62 -93
- lang/wp-pagenavi-zh_TW.mo +0 -0
- lang/wp-pagenavi-zh_TW.po +68 -128
- readme.txt +22 -15
- scb/AdminPage.php +228 -149
- scb/BoxesPage.php +38 -18
- scb/Cron.php +55 -41
- scb/Forms.php +380 -121
- scb/Options.php +0 -0
- scb/PostMetabox.php +182 -0
- scb/Table.php +0 -47
- scb/Util.php +101 -0
- scb/composer.json +22 -0
- scb/load-composer.php +11 -0
- scb/load.php +2 -2
- screenshot-1.png +0 -0
- screenshot-2.png +0 -0
- wp-pagenavi.php +1 -1
admin.php
CHANGED
@@ -12,12 +12,13 @@ class PageNavi_Options_Page extends scbAdminPage {
|
|
12 |
);
|
13 |
}
|
14 |
|
15 |
-
function validate( $
|
|
|
16 |
foreach ( array( 'style', 'num_pages', 'num_larger_page_numbers', 'larger_page_numbers_multiple' ) as $key )
|
17 |
$options[$key] = absint( @$options[$key] );
|
18 |
|
19 |
foreach ( array( 'use_pagenavi_css', 'always_show' ) as $key )
|
20 |
-
$options[$key] = (
|
21 |
|
22 |
return $options;
|
23 |
}
|
@@ -100,8 +101,9 @@ class PageNavi_Options_Page extends scbAdminPage {
|
|
100 |
$rows = array(
|
101 |
array(
|
102 |
'title' => __( 'Use pagenavi-css.css', $this->textdomain ),
|
103 |
-
'type' => '
|
104 |
'name' => 'use_pagenavi_css',
|
|
|
105 |
),
|
106 |
|
107 |
array(
|
@@ -114,9 +116,10 @@ class PageNavi_Options_Page extends scbAdminPage {
|
|
114 |
|
115 |
array(
|
116 |
'title' => __( 'Always Show Page Navigation', $this->textdomain ),
|
117 |
-
'type' => '
|
118 |
'name' => 'always_show',
|
119 |
-
'
|
|
|
120 |
),
|
121 |
|
122 |
array(
|
@@ -144,7 +147,7 @@ class PageNavi_Options_Page extends scbAdminPage {
|
|
144 |
'extra' => 'class="small-text"',
|
145 |
'desc' =>
|
146 |
'<br />' . __( 'For example, if mutiple is 5, it will show: 5, 10, 15, 20, 25', $this->textdomain )
|
147 |
-
)
|
148 |
);
|
149 |
|
150 |
$out .=
|
12 |
);
|
13 |
}
|
14 |
|
15 |
+
function validate( $new_data, $old_data ) {
|
16 |
+
$options = wp_parse_args($new_data, $old_data);
|
17 |
foreach ( array( 'style', 'num_pages', 'num_larger_page_numbers', 'larger_page_numbers_multiple' ) as $key )
|
18 |
$options[$key] = absint( @$options[$key] );
|
19 |
|
20 |
foreach ( array( 'use_pagenavi_css', 'always_show' ) as $key )
|
21 |
+
$options[$key] = intval(@$options[$key]);
|
22 |
|
23 |
return $options;
|
24 |
}
|
101 |
$rows = array(
|
102 |
array(
|
103 |
'title' => __( 'Use pagenavi-css.css', $this->textdomain ),
|
104 |
+
'type' => 'radio',
|
105 |
'name' => 'use_pagenavi_css',
|
106 |
+
'choices' => array( 1 => __( 'Yes', $this->textdomain ), 0 => __( 'No', $this->textdomain ) )
|
107 |
),
|
108 |
|
109 |
array(
|
116 |
|
117 |
array(
|
118 |
'title' => __( 'Always Show Page Navigation', $this->textdomain ),
|
119 |
+
'type' => 'radio',
|
120 |
'name' => 'always_show',
|
121 |
+
'choices' => array( 1 => __( 'Yes', $this->textdomain ), 0 => __( 'No', $this->textdomain ) ),
|
122 |
+
'desc' => '<br />'.__( "Show navigation even if there's only one page.", $this->textdomain )
|
123 |
),
|
124 |
|
125 |
array(
|
147 |
'extra' => 'class="small-text"',
|
148 |
'desc' =>
|
149 |
'<br />' . __( 'For example, if mutiple is 5, it will show: 5, 10, 15, 20, 25', $this->textdomain )
|
150 |
+
)
|
151 |
);
|
152 |
|
153 |
$out .=
|
core.php
CHANGED
@@ -12,9 +12,10 @@
|
|
12 |
function wp_pagenavi( $args = array() ) {
|
13 |
if ( !is_array( $args ) ) {
|
14 |
$argv = func_get_args();
|
|
|
15 |
$args = array();
|
16 |
foreach ( array( 'before', 'after', 'options' ) as $i => $key )
|
17 |
-
$args[ $key ] = $argv[ $i ];
|
18 |
}
|
19 |
|
20 |
$args = wp_parse_args( $args, array(
|
@@ -77,12 +78,17 @@ function wp_pagenavi( $args = array() ) {
|
|
77 |
if ( $start_page >= 2 && $pages_to_show < $total_pages ) {
|
78 |
// First
|
79 |
$first_text = str_replace( '%TOTAL_PAGES%', number_format_i18n( $total_pages ), $options['first_text'] );
|
80 |
-
$out .= $instance->get_single( 1,
|
|
|
|
|
81 |
}
|
82 |
|
83 |
// Previous
|
84 |
-
if ( $paged > 1 && !empty( $options['prev_text'] ) )
|
85 |
-
$out .= $instance->get_single( $paged - 1,
|
|
|
|
|
|
|
86 |
|
87 |
if ( $start_page >= 2 && $pages_to_show < $total_pages ) {
|
88 |
if ( !empty( $options['dotleft_text'] ) )
|
@@ -98,7 +104,9 @@ function wp_pagenavi( $args = array() ) {
|
|
98 |
$larger_page_start = 0;
|
99 |
foreach ( $larger_pages_array as $larger_page ) {
|
100 |
if ( $larger_page < ($start_page - $half_page_start) && $larger_page_start < $larger_page_to_show ) {
|
101 |
-
$out .= $instance->get_single( $larger_page,
|
|
|
|
|
102 |
$larger_page_start++;
|
103 |
}
|
104 |
}
|
@@ -114,7 +122,9 @@ function wp_pagenavi( $args = array() ) {
|
|
114 |
$out .= "<span class='current'>$current_page_text</span>";
|
115 |
$timeline = 'larger';
|
116 |
} else {
|
117 |
-
$out .= $instance->get_single( $i,
|
|
|
|
|
118 |
}
|
119 |
}
|
120 |
|
@@ -123,7 +133,9 @@ function wp_pagenavi( $args = array() ) {
|
|
123 |
$larger_page_out = '';
|
124 |
foreach ( $larger_pages_array as $larger_page ) {
|
125 |
if ( $larger_page > ($end_page + $half_page_end) && $larger_page_end < $larger_page_to_show ) {
|
126 |
-
$larger_page_out .= $instance->get_single( $larger_page,
|
|
|
|
|
127 |
$larger_page_end++;
|
128 |
}
|
129 |
}
|
@@ -139,12 +151,17 @@ function wp_pagenavi( $args = array() ) {
|
|
139 |
}
|
140 |
|
141 |
// Next
|
142 |
-
if ( $paged < $total_pages && !empty( $options['next_text'] ) )
|
143 |
-
$out .= $instance->get_single( $paged + 1,
|
|
|
|
|
|
|
144 |
|
145 |
if ( $end_page < $total_pages ) {
|
146 |
// Last
|
147 |
-
$out .= $instance->get_single( $total_pages,
|
|
|
|
|
148 |
}
|
149 |
break;
|
150 |
|
@@ -223,13 +240,15 @@ class PageNavi_Call {
|
|
223 |
return array( $posts_per_page, $paged, $total_pages );
|
224 |
}
|
225 |
|
226 |
-
function get_single( $page, $
|
227 |
if ( empty( $raw_text ) )
|
228 |
return '';
|
229 |
|
230 |
$text = str_replace( $format, number_format_i18n( $page ), $raw_text );
|
231 |
|
232 |
-
|
|
|
|
|
233 |
}
|
234 |
|
235 |
function get_url( $page ) {
|
12 |
function wp_pagenavi( $args = array() ) {
|
13 |
if ( !is_array( $args ) ) {
|
14 |
$argv = func_get_args();
|
15 |
+
|
16 |
$args = array();
|
17 |
foreach ( array( 'before', 'after', 'options' ) as $i => $key )
|
18 |
+
$args[ $key ] = isset( $argv[ $i ]) ? $argv[ $i ] : "";
|
19 |
}
|
20 |
|
21 |
$args = wp_parse_args( $args, array(
|
78 |
if ( $start_page >= 2 && $pages_to_show < $total_pages ) {
|
79 |
// First
|
80 |
$first_text = str_replace( '%TOTAL_PAGES%', number_format_i18n( $total_pages ), $options['first_text'] );
|
81 |
+
$out .= $instance->get_single( 1, $first_text, array(
|
82 |
+
'class' => 'first'
|
83 |
+
), '%TOTAL_PAGES%' );
|
84 |
}
|
85 |
|
86 |
// Previous
|
87 |
+
if ( $paged > 1 && !empty( $options['prev_text'] ) ) {
|
88 |
+
$out .= $instance->get_single( $paged - 1, $options['prev_text'], array(
|
89 |
+
'class' => 'previouspostslink',
|
90 |
+
) );
|
91 |
+
}
|
92 |
|
93 |
if ( $start_page >= 2 && $pages_to_show < $total_pages ) {
|
94 |
if ( !empty( $options['dotleft_text'] ) )
|
104 |
$larger_page_start = 0;
|
105 |
foreach ( $larger_pages_array as $larger_page ) {
|
106 |
if ( $larger_page < ($start_page - $half_page_start) && $larger_page_start < $larger_page_to_show ) {
|
107 |
+
$out .= $instance->get_single( $larger_page, $options['page_text'], array(
|
108 |
+
'class' => 'smaller page',
|
109 |
+
) );
|
110 |
$larger_page_start++;
|
111 |
}
|
112 |
}
|
122 |
$out .= "<span class='current'>$current_page_text</span>";
|
123 |
$timeline = 'larger';
|
124 |
} else {
|
125 |
+
$out .= $instance->get_single( $i, $options['page_text'], array(
|
126 |
+
'class' => "page $timeline",
|
127 |
+
) );
|
128 |
}
|
129 |
}
|
130 |
|
133 |
$larger_page_out = '';
|
134 |
foreach ( $larger_pages_array as $larger_page ) {
|
135 |
if ( $larger_page > ($end_page + $half_page_end) && $larger_page_end < $larger_page_to_show ) {
|
136 |
+
$larger_page_out .= $instance->get_single( $larger_page, $options['page_text'], array(
|
137 |
+
'class' => 'larger page',
|
138 |
+
) );
|
139 |
$larger_page_end++;
|
140 |
}
|
141 |
}
|
151 |
}
|
152 |
|
153 |
// Next
|
154 |
+
if ( $paged < $total_pages && !empty( $options['next_text'] ) ) {
|
155 |
+
$out .= $instance->get_single( $paged + 1, $options['next_text'], array(
|
156 |
+
'class' => 'nextpostslink',
|
157 |
+
) );
|
158 |
+
}
|
159 |
|
160 |
if ( $end_page < $total_pages ) {
|
161 |
// Last
|
162 |
+
$out .= $instance->get_single( $total_pages, $options['last_text'], array(
|
163 |
+
'class' => 'last',
|
164 |
+
), '%TOTAL_PAGES%' );
|
165 |
}
|
166 |
break;
|
167 |
|
240 |
return array( $posts_per_page, $paged, $total_pages );
|
241 |
}
|
242 |
|
243 |
+
function get_single( $page, $raw_text, $attr, $format = '%PAGE_NUMBER%' ) {
|
244 |
if ( empty( $raw_text ) )
|
245 |
return '';
|
246 |
|
247 |
$text = str_replace( $format, number_format_i18n( $page ), $raw_text );
|
248 |
|
249 |
+
$attr['href'] = $this->get_url( $page );
|
250 |
+
|
251 |
+
return html( 'a', $attr, $text );
|
252 |
}
|
253 |
|
254 |
function get_url( $page ) {
|
lang/wp-pagenai.pot
ADDED
@@ -0,0 +1,183 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
msgid ""
|
2 |
+
msgstr ""
|
3 |
+
"Project-Id-Version: WP-PageNavi\n"
|
4 |
+
"POT-Creation-Date: 2014-03-03 17:39+0800\n"
|
5 |
+
"PO-Revision-Date: 2014-03-03 17:39+0800\n"
|
6 |
+
"Last-Translator: Lester Chan <lesterchan@gmail.com>\n"
|
7 |
+
"Language-Team: Lester Chan <lesterchan@gmail.com>\n"
|
8 |
+
"MIME-Version: 1.0\n"
|
9 |
+
"Content-Type: text/plain; charset=UTF-8\n"
|
10 |
+
"Content-Transfer-Encoding: 8bit\n"
|
11 |
+
"X-Generator: Poedit 1.6.4\n"
|
12 |
+
"X-Poedit-Basepath: ..\n"
|
13 |
+
"X-Poedit-SourceCharset: UTF-8\n"
|
14 |
+
"X-Poedit-KeywordsList: __;_e;_n:1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;esc_attr__;"
|
15 |
+
"esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c;_n_noop:1,2;"
|
16 |
+
"_nx_noop:3c,1,2;__ngettext_noop:1,2\n"
|
17 |
+
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
18 |
+
"Language: en\n"
|
19 |
+
"X-Poedit-SearchPath-0: .\n"
|
20 |
+
|
21 |
+
#: admin.php:9
|
22 |
+
msgid "PageNavi Settings"
|
23 |
+
msgstr ""
|
24 |
+
|
25 |
+
#: admin.php:10
|
26 |
+
msgid "PageNavi"
|
27 |
+
msgstr ""
|
28 |
+
|
29 |
+
#: admin.php:29
|
30 |
+
msgid "Text For Number Of Pages"
|
31 |
+
msgstr ""
|
32 |
+
|
33 |
+
#: admin.php:34
|
34 |
+
msgid "The current page number."
|
35 |
+
msgstr ""
|
36 |
+
|
37 |
+
#: admin.php:35 admin.php:59 admin.php:67
|
38 |
+
msgid "The total number of pages."
|
39 |
+
msgstr ""
|
40 |
+
|
41 |
+
#: admin.php:39
|
42 |
+
msgid "Text For Current Page"
|
43 |
+
msgstr ""
|
44 |
+
|
45 |
+
#: admin.php:43 admin.php:51
|
46 |
+
msgid "The page number."
|
47 |
+
msgstr ""
|
48 |
+
|
49 |
+
#: admin.php:47
|
50 |
+
msgid "Text For Page"
|
51 |
+
msgstr ""
|
52 |
+
|
53 |
+
#: admin.php:55
|
54 |
+
msgid "Text For First Page"
|
55 |
+
msgstr ""
|
56 |
+
|
57 |
+
#: admin.php:63
|
58 |
+
msgid "Text For Last Page"
|
59 |
+
msgstr ""
|
60 |
+
|
61 |
+
#: admin.php:71
|
62 |
+
msgid "Text For Previous Page"
|
63 |
+
msgstr ""
|
64 |
+
|
65 |
+
#: admin.php:77
|
66 |
+
msgid "Text For Next Page"
|
67 |
+
msgstr ""
|
68 |
+
|
69 |
+
#: admin.php:83
|
70 |
+
msgid "Text For Previous ..."
|
71 |
+
msgstr ""
|
72 |
+
|
73 |
+
#: admin.php:89
|
74 |
+
msgid "Text For Next ..."
|
75 |
+
msgstr ""
|
76 |
+
|
77 |
+
#: admin.php:96
|
78 |
+
msgid "Page Navigation Text"
|
79 |
+
msgstr ""
|
80 |
+
|
81 |
+
#: admin.php:97
|
82 |
+
msgid "Leaving a field blank will hide that part of the navigation."
|
83 |
+
msgstr ""
|
84 |
+
|
85 |
+
#: admin.php:103
|
86 |
+
msgid "Use pagenavi-css.css"
|
87 |
+
msgstr ""
|
88 |
+
|
89 |
+
#: admin.php:106 admin.php:121
|
90 |
+
msgid "Yes"
|
91 |
+
msgstr ""
|
92 |
+
|
93 |
+
#: admin.php:106 admin.php:121
|
94 |
+
msgid "No"
|
95 |
+
msgstr ""
|
96 |
+
|
97 |
+
#: admin.php:110
|
98 |
+
msgid "Page Navigation Style"
|
99 |
+
msgstr ""
|
100 |
+
|
101 |
+
#: admin.php:113
|
102 |
+
msgid "Normal"
|
103 |
+
msgstr ""
|
104 |
+
|
105 |
+
#: admin.php:113
|
106 |
+
msgid "Drop-down List"
|
107 |
+
msgstr ""
|
108 |
+
|
109 |
+
#: admin.php:118
|
110 |
+
msgid "Always Show Page Navigation"
|
111 |
+
msgstr ""
|
112 |
+
|
113 |
+
#: admin.php:122
|
114 |
+
msgid "Show navigation even if there's only one page."
|
115 |
+
msgstr ""
|
116 |
+
|
117 |
+
#: admin.php:126
|
118 |
+
msgid "Number Of Pages To Show"
|
119 |
+
msgstr ""
|
120 |
+
|
121 |
+
#: admin.php:133
|
122 |
+
msgid "Number Of Larger Page Numbers To Show"
|
123 |
+
msgstr ""
|
124 |
+
|
125 |
+
#: admin.php:138
|
126 |
+
msgid ""
|
127 |
+
"Larger page numbers are in addition to the normal page numbers. They are "
|
128 |
+
"useful when there are many pages of posts."
|
129 |
+
msgstr ""
|
130 |
+
|
131 |
+
#: admin.php:139
|
132 |
+
msgid ""
|
133 |
+
"For example, WP-PageNavi will display: Pages 1, 2, 3, 4, 5, 10, 20, 30, 40, "
|
134 |
+
"50."
|
135 |
+
msgstr ""
|
136 |
+
|
137 |
+
#: admin.php:140
|
138 |
+
msgid "Enter 0 to disable."
|
139 |
+
msgstr ""
|
140 |
+
|
141 |
+
#: admin.php:144
|
142 |
+
msgid "Show Larger Page Numbers In Multiples Of"
|
143 |
+
msgstr ""
|
144 |
+
|
145 |
+
#: admin.php:149
|
146 |
+
msgid "For example, if mutiple is 5, it will show: 5, 10, 15, 20, 25"
|
147 |
+
msgstr ""
|
148 |
+
|
149 |
+
#: admin.php:154
|
150 |
+
msgid "Page Navigation Options"
|
151 |
+
msgstr ""
|
152 |
+
|
153 |
+
#: scb/AdminPage.php:228
|
154 |
+
msgid "Settings <strong>saved</strong>."
|
155 |
+
msgstr ""
|
156 |
+
|
157 |
+
#: scb/AdminPage.php:467
|
158 |
+
msgid "Settings"
|
159 |
+
msgstr ""
|
160 |
+
|
161 |
+
#: wp-pagenavi.php:20
|
162 |
+
msgid "Page %CURRENT_PAGE% of %TOTAL_PAGES%"
|
163 |
+
msgstr ""
|
164 |
+
|
165 |
+
#: wp-pagenavi.php:23
|
166 |
+
msgid "« First"
|
167 |
+
msgstr ""
|
168 |
+
|
169 |
+
#: wp-pagenavi.php:24
|
170 |
+
msgid "Last »"
|
171 |
+
msgstr ""
|
172 |
+
|
173 |
+
#: wp-pagenavi.php:25
|
174 |
+
msgid "«"
|
175 |
+
msgstr ""
|
176 |
+
|
177 |
+
#: wp-pagenavi.php:26
|
178 |
+
msgid "»"
|
179 |
+
msgstr ""
|
180 |
+
|
181 |
+
#: wp-pagenavi.php:27 wp-pagenavi.php:28
|
182 |
+
msgid "..."
|
183 |
+
msgstr ""
|
lang/wp-pagenavi-de_DE.mo
CHANGED
Binary file
|
lang/wp-pagenavi-de_DE.po
CHANGED
@@ -1,233 +1,181 @@
|
|
|
|
|
|
1 |
msgid ""
|
2 |
msgstr ""
|
3 |
-
"
|
4 |
-
"Report-Msgid-Bugs-To: \n"
|
5 |
-
"POT-Creation-Date: 2009-06-08 18:58+0800\n"
|
6 |
-
"PO-Revision-Date: 2009-08-12 01:58+0100\n"
|
7 |
-
"Last-Translator: Alexander Zigelski <alizige@gmail.com>\n"
|
8 |
-
"Language-Team: Lester Chan <lesterchan@gmail.com>\n"
|
9 |
"MIME-Version: 1.0\n"
|
10 |
"Content-Type: text/plain; charset=UTF-8\n"
|
11 |
"Content-Transfer-Encoding: 8bit\n"
|
12 |
-
"X-Poedit-Language: English\n"
|
13 |
-
"X-Poedit-Country: SINGAPORE\n"
|
14 |
-
"X-Poedit-KeywordsList: __;_e;__ngettext:1,2\n"
|
15 |
-
"X-Poedit-Basepath: .\n"
|
16 |
"Plural-Forms: nplurals=2; plural=n != 1;\n"
|
17 |
-
"X-
|
|
|
|
|
|
|
18 |
|
19 |
-
#: pagenavi
|
20 |
-
|
21 |
-
|
22 |
-
msgid "Page Navigation Options"
|
23 |
-
msgstr "Page Navigation Optionen"
|
24 |
|
25 |
-
#: pagenavi
|
26 |
-
msgid "
|
27 |
-
msgstr "
|
28 |
|
29 |
-
#: pagenavi
|
30 |
-
msgid "
|
31 |
-
msgstr "
|
32 |
|
33 |
-
#: pagenavi-
|
34 |
-
|
35 |
-
|
36 |
-
msgstr "WP-PageNavi DEINSTALLIEREN!"
|
37 |
|
38 |
-
|
39 |
-
|
40 |
-
msgid "Setting Key '%s' has been deleted."
|
41 |
-
msgstr "Die Einstellung '%s' wurde gelöscht."
|
42 |
|
43 |
-
|
44 |
-
|
45 |
-
msgid "Error deleting Setting Key '%s'."
|
46 |
-
msgstr "Fehler beim Löschen der Einstellung '%s'."
|
47 |
|
48 |
-
|
49 |
-
|
50 |
-
msgid "Uninstall WP-PageNavi"
|
51 |
-
msgstr "Deinstalliere WP-PageNavi"
|
52 |
|
53 |
-
|
54 |
-
|
55 |
-
msgid "<a href=\"%s\">Click Here</a> To Finish The Uninstallation And WP-PageNavi Will Be Deactivated Automatically."
|
56 |
-
msgstr "<a href=\"%s\">Klicken Sie hier</a> um die Deinstallation zu beenden. WP-PageNavi wird automatisch deaktiviert."
|
57 |
|
58 |
-
#:
|
59 |
msgid "Page Navigation Text"
|
60 |
msgstr "Seitennavigation Text"
|
61 |
|
62 |
-
#:
|
63 |
-
msgid "
|
64 |
-
msgstr "
|
65 |
-
|
66 |
-
#: pagenavi-options.php:117
|
67 |
-
msgid "The current page number."
|
68 |
-
msgstr "Die derzeitige Seitennummer."
|
69 |
|
70 |
-
#:
|
71 |
-
|
72 |
-
|
73 |
-
msgid "The total number of pages."
|
74 |
-
msgstr "Die Gesamtanzahl der Seiten."
|
75 |
-
|
76 |
-
#: pagenavi-options.php:122
|
77 |
-
msgid "Text For Current Page"
|
78 |
-
msgstr "Text der aktuellen Seite"
|
79 |
|
80 |
-
#:
|
81 |
-
#: pagenavi-options.php:132
|
82 |
-
msgid "The page number."
|
83 |
-
msgstr "Die Seitennummer."
|
84 |
-
|
85 |
-
#: pagenavi-options.php:129
|
86 |
-
msgid "Text For Page"
|
87 |
-
msgstr "Text auf Seite"
|
88 |
-
|
89 |
-
#: pagenavi-options.php:136
|
90 |
-
msgid "Text For First Post"
|
91 |
-
msgstr "Text der ersten Seite"
|
92 |
-
|
93 |
-
#: pagenavi-options.php:143
|
94 |
-
msgid "Text For Last Post"
|
95 |
-
msgstr "Text der letzten Seite"
|
96 |
-
|
97 |
-
#: pagenavi-options.php:150
|
98 |
-
msgid "Text For Next Post"
|
99 |
-
msgstr "Text der nächsten Seite"
|
100 |
-
|
101 |
-
#: pagenavi-options.php:156
|
102 |
-
msgid "Text For Previous Post"
|
103 |
-
msgstr "Text der vorherigen Seite"
|
104 |
-
|
105 |
-
#: pagenavi-options.php:162
|
106 |
-
msgid "Text For Next ..."
|
107 |
-
msgstr "Text für nächstes ..."
|
108 |
-
|
109 |
-
#: pagenavi-options.php:168
|
110 |
-
msgid "Text For Previous ..."
|
111 |
-
msgstr "Text für letztes ..."
|
112 |
-
|
113 |
-
#: pagenavi-options.php:177
|
114 |
msgid "Page Navigation Style"
|
115 |
-
msgstr "
|
116 |
|
117 |
-
#:
|
118 |
msgid "Normal"
|
119 |
msgstr "Normal"
|
120 |
|
121 |
-
#:
|
122 |
-
msgid "Drop
|
123 |
-
msgstr "Drop
|
124 |
|
125 |
-
#:
|
126 |
-
msgid "
|
127 |
-
msgstr "
|
128 |
|
129 |
-
#:
|
130 |
-
msgid "
|
131 |
-
msgstr "
|
132 |
|
133 |
-
#:
|
134 |
-
|
135 |
-
|
136 |
-
msgstr "Ja"
|
137 |
|
138 |
-
#:
|
139 |
-
msgid "
|
140 |
-
msgstr "
|
141 |
|
142 |
-
#:
|
143 |
-
msgid "
|
144 |
-
msgstr "
|
145 |
|
146 |
-
#:
|
147 |
-
msgid "
|
148 |
-
msgstr "
|
149 |
|
150 |
-
#:
|
151 |
-
msgid "For example, WP-PageNavi will display: Pages 1, 2, 3, 4, 5, 10, 20, 30, 40, 50"
|
152 |
-
msgstr "WP-PageNavi wird folgendes anzeigen: Seite 1, 2, 3, 4, 5, 10, 20, 30, 40, 50"
|
153 |
-
|
154 |
-
#: pagenavi-options.php:209
|
155 |
msgid "Enter 0 to disable."
|
156 |
msgstr "0 eingeben zum deaktivieren."
|
157 |
|
158 |
-
#:
|
159 |
-
msgid "Show
|
160 |
-
msgstr "Zeige
|
161 |
|
162 |
-
#:
|
163 |
-
msgid "
|
164 |
-
msgstr "
|
165 |
|
166 |
-
#:
|
167 |
-
msgid "
|
168 |
-
msgstr "
|
169 |
|
170 |
-
#:
|
|
|
|
|
|
|
|
|
171 |
msgid "Save Changes"
|
172 |
msgstr "Einstellungen speichern."
|
173 |
|
174 |
-
#:
|
175 |
-
msgid "
|
176 |
-
msgstr "
|
177 |
-
|
178 |
-
#: pagenavi-options.php:238
|
179 |
-
msgid "WARNING:"
|
180 |
-
msgstr "WARNUNG:"
|
181 |
|
182 |
-
#: pagenavi
|
183 |
-
msgid "
|
184 |
-
msgstr "
|
185 |
-
|
186 |
-
#: pagenavi-options.php:242
|
187 |
-
msgid "The following WordPress Options will be DELETED:"
|
188 |
-
msgstr "Die folgenden WordPress Optionen werden GELÖSCHT:"
|
189 |
|
190 |
-
#: pagenavi
|
191 |
-
msgid "
|
192 |
-
msgstr "
|
193 |
|
194 |
-
#:
|
195 |
-
msgid ""
|
196 |
-
"
|
197 |
-
"This Action Is Not Reversible.\\n"
|
198 |
-
"\\n"
|
199 |
-
" Choose [Cancel] To Stop, [OK] To Uninstall."
|
200 |
-
msgstr ""
|
201 |
-
"Sie sind dabei WP-PageNavi zu deinstallieren.\\n"
|
202 |
-
"Diese Aktion kann nicht rückgängig gemacht werden.\\\\n"
|
203 |
-
"Wählen Sie [Cancel] um Abzubrechen oder [OK] zum deinstallieren"
|
204 |
|
205 |
-
#:
|
206 |
msgid "PageNavi"
|
207 |
msgstr "PageNavi"
|
208 |
|
209 |
-
#:
|
210 |
-
msgid "
|
211 |
-
msgstr "
|
212 |
|
213 |
-
#:
|
214 |
-
msgid "
|
215 |
-
msgstr "
|
216 |
|
217 |
-
#:
|
218 |
-
msgid "
|
219 |
-
msgstr "
|
220 |
|
221 |
-
#:
|
222 |
-
msgid "
|
223 |
-
msgstr "
|
224 |
|
225 |
-
#:
|
226 |
-
msgid "
|
227 |
-
msgstr "
|
228 |
|
229 |
-
#:
|
230 |
-
|
231 |
-
|
232 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
233 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Translation of WP-PageNavi in German
|
2 |
+
# This file is distributed under the same license as the WP-PageNavi package.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
+
"PO-Revision-Date: 2013-03-01 11:57:02+0000\n"
|
|
|
|
|
|
|
|
|
|
|
6 |
"MIME-Version: 1.0\n"
|
7 |
"Content-Type: text/plain; charset=UTF-8\n"
|
8 |
"Content-Transfer-Encoding: 8bit\n"
|
|
|
|
|
|
|
|
|
9 |
"Plural-Forms: nplurals=2; plural=n != 1;\n"
|
10 |
+
"X-Generator: translate.foe-services.de/ReGlot/0.1\n"
|
11 |
+
"Project-Id-Version: WP-PageNavi\n"
|
12 |
+
"Language-Team: Translate.foe-services.de <translate@foe-services.de>\n"
|
13 |
+
"Language: German\n"
|
14 |
|
15 |
+
#: wp-pagenavi.php:41
|
16 |
+
msgid "Last »"
|
17 |
+
msgstr "Letzte »"
|
|
|
|
|
18 |
|
19 |
+
#: wp-pagenavi.php:42
|
20 |
+
msgid "«"
|
21 |
+
msgstr "«"
|
22 |
|
23 |
+
#: wp-pagenavi.php:43
|
24 |
+
msgid "»"
|
25 |
+
msgstr "»"
|
26 |
|
27 |
+
#: wp-pagenavi.php:44 wp-pagenavi.php:45
|
28 |
+
msgid "..."
|
29 |
+
msgstr "..."
|
|
|
30 |
|
31 |
+
msgid "WP-PageNavi"
|
32 |
+
msgstr "WP-PageNavi"
|
|
|
|
|
33 |
|
34 |
+
msgid "http://wordpress.org/extend/plugins/wp-pagenavi/"
|
35 |
+
msgstr "http://wordpress.org/extend/plugins/wp-pagenavi/"
|
|
|
|
|
36 |
|
37 |
+
msgid "Adds a more advanced paging navigation to your WordPress blog"
|
38 |
+
msgstr "Fügt eine verbesserte Seiten-Navigation zu deiner WordPress Seite hinzu"
|
|
|
|
|
39 |
|
40 |
+
msgid "Lester 'GaMerZ' Chan & scribu"
|
41 |
+
msgstr "Lester 'GaMerZ' Chan & scribu"
|
|
|
|
|
42 |
|
43 |
+
#: admin.php:95
|
44 |
msgid "Page Navigation Text"
|
45 |
msgstr "Seitennavigation Text"
|
46 |
|
47 |
+
#: admin.php:96
|
48 |
+
msgid "Leaving a field blank will hide that part of the navigation."
|
49 |
+
msgstr "Leere Felder deaktivieren den Teil der Navigation."
|
|
|
|
|
|
|
|
|
50 |
|
51 |
+
#: admin.php:102
|
52 |
+
msgid "Use pagenavi-css.css"
|
53 |
+
msgstr "Nutze pagenavi-css.css"
|
|
|
|
|
|
|
|
|
|
|
|
|
54 |
|
55 |
+
#: admin.php:108
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
56 |
msgid "Page Navigation Style"
|
57 |
+
msgstr "Seiten-Navigations-Stil"
|
58 |
|
59 |
+
#: admin.php:111
|
60 |
msgid "Normal"
|
61 |
msgstr "Normal"
|
62 |
|
63 |
+
#: admin.php:111
|
64 |
+
msgid "Drop-down List"
|
65 |
+
msgstr "Drop-Down Liste"
|
66 |
|
67 |
+
#: admin.php:116
|
68 |
+
msgid "Always Show Page Navigation"
|
69 |
+
msgstr "Zeige Seiten-Navigation immer"
|
70 |
|
71 |
+
#: admin.php:119
|
72 |
+
msgid "Show navigation even if there's only one page."
|
73 |
+
msgstr "Zeige die Navigation auch, wenn es nur eine Seite gibt."
|
74 |
|
75 |
+
#: admin.php:123
|
76 |
+
msgid "Number Of Pages To Show"
|
77 |
+
msgstr "Anzahl der angezeigten Seiten"
|
|
|
78 |
|
79 |
+
#: admin.php:130
|
80 |
+
msgid "Number Of Larger Page Numbers To Show"
|
81 |
+
msgstr "Anzahl der angezeigten großen Seitenzahlen"
|
82 |
|
83 |
+
#: admin.php:135
|
84 |
+
msgid "Larger page numbers are in addition to the normal page numbers. They are useful when there are many pages of posts."
|
85 |
+
msgstr "Große Seitenzahlen sind ein Zusatz zu den normalen Seitenzahlen. Sie sind nützlich, wenn es viele Seiten von Beiträgen gibt."
|
86 |
|
87 |
+
#: admin.php:136
|
88 |
+
msgid "For example, WP-PageNavi will display: Pages 1, 2, 3, 4, 5, 10, 20, 30, 40, 50."
|
89 |
+
msgstr "Zum Beispiel stellt WP-PageNavi dies dar: Seiten 1, 2, 3, 4, 5, 10, 20, 30, 40, 50."
|
90 |
|
91 |
+
#: admin.php:137
|
|
|
|
|
|
|
|
|
92 |
msgid "Enter 0 to disable."
|
93 |
msgstr "0 eingeben zum deaktivieren."
|
94 |
|
95 |
+
#: admin.php:141
|
96 |
+
msgid "Show Larger Page Numbers In Multiples Of"
|
97 |
+
msgstr "Zeige große Seitenzahlen als Vielfache von"
|
98 |
|
99 |
+
#: admin.php:146
|
100 |
+
msgid "For example, if mutiple is 5, it will show: 5, 10, 15, 20, 25"
|
101 |
+
msgstr "Ist der Multiplikator zum Beispiel 5 wird dies dargestellt: 5, 10, 15, 20, 25"
|
102 |
|
103 |
+
#: admin.php:151
|
104 |
+
msgid "Page Navigation Options"
|
105 |
+
msgstr "Page Navigation Optionen"
|
106 |
|
107 |
+
#: scb/AdminPage.php:167
|
108 |
+
msgid "Settings <strong>saved</strong>."
|
109 |
+
msgstr "Einstellungen <strong>gespeichert</strong>."
|
110 |
+
|
111 |
+
#: scb/AdminPage.php:179 scb/AdminPage.php:189
|
112 |
msgid "Save Changes"
|
113 |
msgstr "Einstellungen speichern."
|
114 |
|
115 |
+
#: scb/AdminPage.php:371
|
116 |
+
msgid "Settings"
|
117 |
+
msgstr "Einstellungen"
|
|
|
|
|
|
|
|
|
118 |
|
119 |
+
#: wp-pagenavi.php:37
|
120 |
+
msgid "Page %CURRENT_PAGE% of %TOTAL_PAGES%"
|
121 |
+
msgstr "Seite %CURRENT_PAGE% von %TOTAL_PAGES%"
|
|
|
|
|
|
|
|
|
122 |
|
123 |
+
#: wp-pagenavi.php:40
|
124 |
+
msgid "« First"
|
125 |
+
msgstr "« Erste"
|
126 |
|
127 |
+
#: admin.php:9
|
128 |
+
msgid "PageNavi Settings"
|
129 |
+
msgstr "PageNavi-Einstellungen"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
130 |
|
131 |
+
#: admin.php:10
|
132 |
msgid "PageNavi"
|
133 |
msgstr "PageNavi"
|
134 |
|
135 |
+
#: admin.php:28
|
136 |
+
msgid "Text For Number Of Pages"
|
137 |
+
msgstr "Text der Anzahl der Seiten"
|
138 |
|
139 |
+
#: admin.php:33
|
140 |
+
msgid "The current page number."
|
141 |
+
msgstr "Die derzeitige Seitennummer."
|
142 |
|
143 |
+
#: admin.php:34 admin.php:58 admin.php:66
|
144 |
+
msgid "The total number of pages."
|
145 |
+
msgstr "Die Gesamtanzahl der Seiten."
|
146 |
|
147 |
+
#: admin.php:38
|
148 |
+
msgid "Text For Current Page"
|
149 |
+
msgstr "Text der aktuellen Seite"
|
150 |
|
151 |
+
#: admin.php:42 admin.php:50
|
152 |
+
msgid "The page number."
|
153 |
+
msgstr "Die Seitennummer."
|
154 |
|
155 |
+
#: admin.php:46
|
156 |
+
msgid "Text For Page"
|
157 |
+
msgstr "Text auf Seite"
|
158 |
+
|
159 |
+
#: admin.php:54
|
160 |
+
msgid "Text For First Page"
|
161 |
+
msgstr "Text für Erste Seite"
|
162 |
+
|
163 |
+
#: admin.php:62
|
164 |
+
msgid "Text For Last Page"
|
165 |
+
msgstr "Text für Letzte Seite"
|
166 |
+
|
167 |
+
#: admin.php:70
|
168 |
+
msgid "Text For Previous Page"
|
169 |
+
msgstr "Text für Vorherige Seite"
|
170 |
|
171 |
+
#: admin.php:76
|
172 |
+
msgid "Text For Next Page"
|
173 |
+
msgstr "Text für Nächste Seite"
|
174 |
+
|
175 |
+
#: admin.php:82
|
176 |
+
msgid "Text For Previous ..."
|
177 |
+
msgstr "Text für letztes ..."
|
178 |
+
|
179 |
+
#: admin.php:88
|
180 |
+
msgid "Text For Next ..."
|
181 |
+
msgstr "Text für nächstes ..."
|
lang/wp-pagenavi-sl_SI.mo
ADDED
Binary file
|
lang/wp-pagenavi-sl_SI.po
ADDED
@@ -0,0 +1,198 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Translation of the WordPress plugin WP-PageNavi 2.73 by Lester 'GaMerZ' Chan & scribu.
|
2 |
+
# Copyright (C) 2010 Lester 'GaMerZ' Chan & scribu
|
3 |
+
# This file is distributed under the same license as the WP-PageNavi package.
|
4 |
+
# FIRST AUTHOR <EMAIL@ADDRESS>, 2010.
|
5 |
+
#
|
6 |
+
msgid ""
|
7 |
+
msgstr ""
|
8 |
+
"Project-Id-Version: WP-PageNavi 2.73\n"
|
9 |
+
"Report-Msgid-Bugs-To: http://wordpress.org/tag/wp-pagenavi\n"
|
10 |
+
"POT-Creation-Date: 2010-08-17 17:28+0300\n"
|
11 |
+
"PO-Revision-Date: 2012-10-22 01:44+0100\n"
|
12 |
+
"Last-Translator: Valter Pepelko <valter@netfin.si>\n"
|
13 |
+
"Language-Team: Netfin <info@netfin.si>\n"
|
14 |
+
"MIME-Version: 1.0\n"
|
15 |
+
"Content-Type: text/plain; charset=utf-8\n"
|
16 |
+
"Content-Transfer-Encoding: 8bit\n"
|
17 |
+
"Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3);\n"
|
18 |
+
"X-Poedit-Language: Slovenian\n"
|
19 |
+
"X-Poedit-Country: SLOVENIA\n"
|
20 |
+
"X-Poedit-SourceCharset: utf-8\n"
|
21 |
+
|
22 |
+
#: admin.php:9
|
23 |
+
msgid "PageNavi Settings"
|
24 |
+
msgstr "Nastavitve za PageNavi"
|
25 |
+
|
26 |
+
#: admin.php:10
|
27 |
+
msgid "PageNavi"
|
28 |
+
msgstr "PageNavi"
|
29 |
+
|
30 |
+
#: admin.php:28
|
31 |
+
msgid "Text For Number Of Pages"
|
32 |
+
msgstr "Besedilo za število strani"
|
33 |
+
|
34 |
+
#: admin.php:33
|
35 |
+
msgid "The current page number."
|
36 |
+
msgstr "Aktivna številka strani."
|
37 |
+
|
38 |
+
#: admin.php:34
|
39 |
+
#: admin.php:58
|
40 |
+
#: admin.php:66
|
41 |
+
msgid "The total number of pages."
|
42 |
+
msgstr "Skupno število strani."
|
43 |
+
|
44 |
+
#: admin.php:38
|
45 |
+
msgid "Text For Current Page"
|
46 |
+
msgstr "Oznaka za aktivno stran"
|
47 |
+
|
48 |
+
#: admin.php:42
|
49 |
+
#: admin.php:50
|
50 |
+
msgid "The page number."
|
51 |
+
msgstr "Številka strani."
|
52 |
+
|
53 |
+
#: admin.php:46
|
54 |
+
msgid "Text For Page"
|
55 |
+
msgstr "Oznaka za stran"
|
56 |
+
|
57 |
+
#: admin.php:54
|
58 |
+
msgid "Text For First Page"
|
59 |
+
msgstr "Poimenovanje za Prvo stran"
|
60 |
+
|
61 |
+
#: admin.php:62
|
62 |
+
msgid "Text For Last Page"
|
63 |
+
msgstr "Poimenovanje za Zadnjo stran"
|
64 |
+
|
65 |
+
#: admin.php:70
|
66 |
+
msgid "Text For Previous Page"
|
67 |
+
msgstr "Oznaka za prejšnjo stran"
|
68 |
+
|
69 |
+
#: admin.php:76
|
70 |
+
msgid "Text For Next Page"
|
71 |
+
msgstr "Oznaka za naslednjo stran"
|
72 |
+
|
73 |
+
#: admin.php:82
|
74 |
+
msgid "Text For Previous ..."
|
75 |
+
msgstr "Oznaka za prejšnjo"
|
76 |
+
|
77 |
+
#: admin.php:88
|
78 |
+
msgid "Text For Next ..."
|
79 |
+
msgstr "Oznaka za naslednjo"
|
80 |
+
|
81 |
+
#: admin.php:95
|
82 |
+
msgid "Page Navigation Text"
|
83 |
+
msgstr "Nastavitve besedil in oznak za navigacijo po straneh"
|
84 |
+
|
85 |
+
#: admin.php:96
|
86 |
+
msgid "Leaving a field blank will hide that part of the navigation."
|
87 |
+
msgstr "Če pustite katero polje prazno, bo ostal tisti del navigacije skrit in ne bo viden."
|
88 |
+
|
89 |
+
#: admin.php:102
|
90 |
+
msgid "Use pagenavi-css.css"
|
91 |
+
msgstr "Uporabi pagenavi-css.css"
|
92 |
+
|
93 |
+
#: admin.php:108
|
94 |
+
msgid "Page Navigation Style"
|
95 |
+
msgstr "Videz navigacije strani"
|
96 |
+
|
97 |
+
#: admin.php:111
|
98 |
+
msgid "Normal"
|
99 |
+
msgstr "Običajen"
|
100 |
+
|
101 |
+
#: admin.php:111
|
102 |
+
msgid "Drop-down List"
|
103 |
+
msgstr "Spustni seznam"
|
104 |
+
|
105 |
+
#: admin.php:116
|
106 |
+
msgid "Always Show Page Navigation"
|
107 |
+
msgstr "Vedno prikaži navigacijo strani"
|
108 |
+
|
109 |
+
#: admin.php:119
|
110 |
+
msgid "Show navigation even if there's only one page."
|
111 |
+
msgstr "Prikaže navigacijo četudi gre samo za eno stran."
|
112 |
+
|
113 |
+
#: admin.php:123
|
114 |
+
msgid "Number Of Pages To Show"
|
115 |
+
msgstr "Število strani za prikaz"
|
116 |
+
|
117 |
+
#: admin.php:130
|
118 |
+
msgid "Number Of Larger Page Numbers To Show"
|
119 |
+
msgstr "Število večjih števil strani za prikaz"
|
120 |
+
|
121 |
+
#: admin.php:135
|
122 |
+
msgid "Larger page numbers are in addition to the normal page numbers. They are useful when there are many pages of posts."
|
123 |
+
msgstr "Večja števila strani so poleg običajnih številk strani. To je koristno, če obstaja veliko strani prispevkov."
|
124 |
+
|
125 |
+
#: admin.php:136
|
126 |
+
msgid "For example, WP-PageNavi will display: Pages 1, 2, 3, 4, 5, 10, 20, 30, 40, 50."
|
127 |
+
msgstr "Na primer, WP-PageNavi bo prikazoval: Strani 1, 2, 3, 4, 5, 10, 20, 30, 40, 50."
|
128 |
+
|
129 |
+
#: admin.php:137
|
130 |
+
msgid "Enter 0 to disable."
|
131 |
+
msgstr "Vpiši 0 za onemogočenje te funkcije."
|
132 |
+
|
133 |
+
#: admin.php:141
|
134 |
+
msgid "Show Larger Page Numbers In Multiples Of"
|
135 |
+
msgstr "Prikaže le številko strani, ki je večkratnik števila"
|
136 |
+
|
137 |
+
#: admin.php:146
|
138 |
+
msgid "For example, if mutiple is 5, it will show: 5, 10, 15, 20, 25"
|
139 |
+
msgstr "Na primer, če je večkratnik številka 5, bo prikazano: 5, 10, 15, 20, 25,..."
|
140 |
+
|
141 |
+
#: admin.php:151
|
142 |
+
msgid "Page Navigation Options"
|
143 |
+
msgstr "Možnosti za navigacijo strani"
|
144 |
+
|
145 |
+
#: scb/AdminPage.php:167
|
146 |
+
msgid "Settings <strong>saved</strong>."
|
147 |
+
msgstr "Nastavitve <strong>so shranjene</strong>."
|
148 |
+
|
149 |
+
#: scb/AdminPage.php:179
|
150 |
+
#: scb/AdminPage.php:189
|
151 |
+
msgid "Save Changes"
|
152 |
+
msgstr "Shrani nastavitve"
|
153 |
+
|
154 |
+
#: scb/AdminPage.php:371
|
155 |
+
msgid "Settings"
|
156 |
+
msgstr "Nastavitve"
|
157 |
+
|
158 |
+
#: wp-pagenavi.php:37
|
159 |
+
msgid "Page %CURRENT_PAGE% of %TOTAL_PAGES%"
|
160 |
+
msgstr "Stran %CURRENT_PAGE% od %TOTAL_PAGES%"
|
161 |
+
|
162 |
+
#: wp-pagenavi.php:40
|
163 |
+
msgid "« First"
|
164 |
+
msgstr "« Prva"
|
165 |
+
|
166 |
+
#: wp-pagenavi.php:41
|
167 |
+
msgid "Last »"
|
168 |
+
msgstr "Zadnja »"
|
169 |
+
|
170 |
+
#: wp-pagenavi.php:42
|
171 |
+
msgid "«"
|
172 |
+
msgstr "«"
|
173 |
+
|
174 |
+
#: wp-pagenavi.php:43
|
175 |
+
msgid "»"
|
176 |
+
msgstr "»"
|
177 |
+
|
178 |
+
#: wp-pagenavi.php:44
|
179 |
+
#: wp-pagenavi.php:45
|
180 |
+
msgid "..."
|
181 |
+
msgstr "..."
|
182 |
+
|
183 |
+
#. Plugin Name of the plugin/theme
|
184 |
+
msgid "WP-PageNavi"
|
185 |
+
msgstr "WP-PageNavi"
|
186 |
+
|
187 |
+
#. Plugin URI of the plugin/theme
|
188 |
+
msgid "http://wordpress.org/extend/plugins/wp-pagenavi/"
|
189 |
+
msgstr "http://wordpress.org/extend/plugins/wp-pagenavi/"
|
190 |
+
|
191 |
+
#. Description of the plugin/theme
|
192 |
+
msgid "Adds a more advanced paging navigation to your WordPress blog"
|
193 |
+
msgstr "Dodaj najbolj napredno navigacijo po straneh na svoj blog v WordPress-u"
|
194 |
+
|
195 |
+
#. Author of the plugin/theme
|
196 |
+
msgid "Lester 'GaMerZ' Chan & scribu"
|
197 |
+
msgstr "Lester 'GaMerZ' Chan & scribu"
|
198 |
+
|
lang/wp-pagenavi-sr_RS.mo
CHANGED
Binary file
|
lang/wp-pagenavi-sr_RS.po
CHANGED
@@ -1,198 +1,270 @@
|
|
1 |
-
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
"
|
9 |
-
"
|
10 |
-
"
|
11 |
-
"
|
12 |
-
"
|
13 |
-
"
|
14 |
-
"
|
15 |
-
"
|
16 |
-
"
|
17 |
-
|
18 |
-
|
19 |
-
"
|
20 |
-
"
|
21 |
-
|
22 |
-
#: admin.php:
|
23 |
-
msgid "PageNavi
|
24 |
-
msgstr "
|
25 |
-
|
26 |
-
#: admin.php:
|
27 |
-
msgid "
|
28 |
-
msgstr "
|
29 |
-
|
30 |
-
#: admin.php:
|
31 |
-
msgid "
|
32 |
-
msgstr "
|
33 |
-
|
34 |
-
#: admin.php:33
|
35 |
-
msgid "The
|
36 |
-
msgstr "
|
37 |
-
|
38 |
-
#: admin.php:
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
#: admin.php:
|
130 |
-
msgid "Enter 0 to disable."
|
131 |
-
msgstr "
|
132 |
-
|
133 |
-
#: admin.php:
|
134 |
-
msgid "Show Larger Page Numbers In Multiples Of"
|
135 |
-
msgstr "
|
136 |
-
|
137 |
-
#: admin.php:
|
138 |
-
msgid "For example, if mutiple is 5, it will show: 5, 10, 15, 20, 25"
|
139 |
-
msgstr "
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
#: scb/AdminPage.php:
|
151 |
-
msgid "
|
152 |
-
msgstr "
|
153 |
-
|
154 |
-
#: scb/AdminPage.php:
|
155 |
-
msgid "Settings"
|
156 |
-
msgstr "
|
157 |
-
|
158 |
-
#: wp-pagenavi.php:
|
159 |
-
msgid "Page %CURRENT_PAGE% of %TOTAL_PAGES%"
|
160 |
-
msgstr "
|
161 |
-
|
162 |
-
#: wp-pagenavi.php:
|
163 |
-
msgid "« First"
|
164 |
-
msgstr "«
|
165 |
-
|
166 |
-
#: wp-pagenavi.php:
|
167 |
-
msgid "Last »"
|
168 |
-
msgstr "
|
169 |
-
|
170 |
-
#: wp-pagenavi.php:
|
171 |
-
msgid "«"
|
172 |
-
msgstr "«"
|
173 |
-
|
174 |
-
#: wp-pagenavi.php:
|
175 |
-
msgid "»"
|
176 |
-
msgstr "»"
|
177 |
-
|
178 |
-
#: wp-pagenavi.php:
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
msgid ""
|
2 |
+
msgstr ""
|
3 |
+
"Project-Id-Version: WP-PageNavi 2.50\n"
|
4 |
+
"Report-Msgid-Bugs-To: http://wordpress.org/tag/wp-pagenavi\n"
|
5 |
+
"POT-Creation-Date: 2010-04-19 11:25+0300\n"
|
6 |
+
"PO-Revision-Date: 2013-10-08 09:50+0100\n"
|
7 |
+
"Last-Translator: Elvis <main@fweb.org.rru>\n"
|
8 |
+
"Language-Team: Anna Ozeritskaya <anna.ozeritskaya@gmail.com>\n"
|
9 |
+
"MIME-Version: 1.0\n"
|
10 |
+
"Content-Type: text/plain; charset=UTF-8\n"
|
11 |
+
"Content-Transfer-Encoding: 8bit\n"
|
12 |
+
"X-Poedit-KeywordsList: __;_e\n"
|
13 |
+
"X-Poedit-Basepath: .\n"
|
14 |
+
"Language: ru_RU\n"
|
15 |
+
"X-Generator: Poedit 1.5.7\n"
|
16 |
+
"X-Poedit-SearchPath-0: .\n"
|
17 |
+
|
18 |
+
#: admin.php:9
|
19 |
+
msgid "PageNavi Settings"
|
20 |
+
msgstr "PageNavi postavke"
|
21 |
+
|
22 |
+
#: admin.php:10
|
23 |
+
msgid "PageNavi"
|
24 |
+
msgstr "PageNavi"
|
25 |
+
|
26 |
+
#: admin.php:27
|
27 |
+
msgid "Text For Number Of Pages"
|
28 |
+
msgstr "Tekst za broj stranica"
|
29 |
+
|
30 |
+
#: admin.php:32
|
31 |
+
msgid "The current page number."
|
32 |
+
msgstr "Trenutni broj stranica."
|
33 |
+
|
34 |
+
#: admin.php:33 admin.php:57 admin.php:65
|
35 |
+
msgid "The total number of pages."
|
36 |
+
msgstr "Totalni broj stranica"
|
37 |
+
|
38 |
+
#: admin.php:37
|
39 |
+
msgid "Text For Current Page"
|
40 |
+
msgstr "Tekst za trenutnu stranicu"
|
41 |
+
|
42 |
+
#: admin.php:41 admin.php:49
|
43 |
+
msgid "The page number."
|
44 |
+
msgstr "Broj stranice."
|
45 |
+
|
46 |
+
#: admin.php:45
|
47 |
+
msgid "Text For Page"
|
48 |
+
msgstr "Tekst za stranicu"
|
49 |
+
|
50 |
+
#: admin.php:53
|
51 |
+
msgid "Text For First Page"
|
52 |
+
msgstr "Tekst za prvu stranicu"
|
53 |
+
|
54 |
+
#: admin.php:61
|
55 |
+
msgid "Text For Last Page"
|
56 |
+
msgstr "Tekst za poslednju stranicu"
|
57 |
+
|
58 |
+
#: admin.php:69
|
59 |
+
msgid "Text For Previous Page"
|
60 |
+
msgstr "Tekst za prethodnu stranicu"
|
61 |
+
|
62 |
+
#: admin.php:75
|
63 |
+
msgid "Text For Next Page"
|
64 |
+
msgstr "Tekst za sledeću stranicu"
|
65 |
+
|
66 |
+
#: admin.php:81
|
67 |
+
msgid "Text For Previous ..."
|
68 |
+
msgstr "Tekst za prethodnu ..."
|
69 |
+
|
70 |
+
#: admin.php:87
|
71 |
+
msgid "Text For Next ..."
|
72 |
+
msgstr "Tekst za sledeću ..."
|
73 |
+
|
74 |
+
#: admin.php:94
|
75 |
+
msgid "Page Navigation Text"
|
76 |
+
msgstr "Stranica za navigaciju teksta"
|
77 |
+
|
78 |
+
#: admin.php:95
|
79 |
+
msgid "Leaving a field blank will hide that part of the navigation."
|
80 |
+
msgstr "Ako ostavite prazno polje prekriće deo navigacije."
|
81 |
+
|
82 |
+
#: admin.php:101
|
83 |
+
msgid "Use pagenavi-css.css"
|
84 |
+
msgstr "Koristi pagenavi-css.css"
|
85 |
+
|
86 |
+
#: admin.php:107
|
87 |
+
msgid "Page Navigation Style"
|
88 |
+
msgstr "Stranica za navigaciju stila"
|
89 |
+
|
90 |
+
#: admin.php:110
|
91 |
+
msgid "Normal"
|
92 |
+
msgstr "Normalno"
|
93 |
+
|
94 |
+
#: admin.php:110
|
95 |
+
msgid "Drop-down List"
|
96 |
+
msgstr "Drop-down lista"
|
97 |
+
|
98 |
+
#: admin.php:115
|
99 |
+
msgid "Always Show Page Navigation"
|
100 |
+
msgstr "Uvek prikaži navigaciju stranice"
|
101 |
+
|
102 |
+
#: admin.php:118
|
103 |
+
msgid "Show navigation even if there's only one page."
|
104 |
+
msgstr "Prikaži navigaciju čak iako je samo jedna stranica."
|
105 |
+
|
106 |
+
#: admin.php:122
|
107 |
+
msgid "Number Of Pages To Show"
|
108 |
+
msgstr "Broj stranica za prikaz"
|
109 |
+
|
110 |
+
#: admin.php:129
|
111 |
+
msgid "Number Of Larger Page Numbers To Show"
|
112 |
+
msgstr "Broj velkih stranica za prikaz"
|
113 |
+
|
114 |
+
#: admin.php:134
|
115 |
+
msgid ""
|
116 |
+
"Larger page numbers are in addition to the normal page numbers. They are "
|
117 |
+
"useful when there are many pages of posts."
|
118 |
+
msgstr ""
|
119 |
+
"Stranice sa velikim brojevima su dodatak stranicama sa normalnim brojevima. "
|
120 |
+
"Korisne su kada imate veliki broj stranica za postovanje."
|
121 |
+
|
122 |
+
#: admin.php:135
|
123 |
+
msgid ""
|
124 |
+
"For example, WP-PageNavi will display: Pages 1, 2, 3, 4, 5, 10, 20, 30, 40, "
|
125 |
+
"50."
|
126 |
+
msgstr ""
|
127 |
+
"Npr, WP-PageNavi će prikazati:Stranice 1, 2, 3, 4, 5, 10, 20, 30, 40, 50."
|
128 |
+
|
129 |
+
#: admin.php:136
|
130 |
+
msgid "Enter 0 to disable."
|
131 |
+
msgstr "Unesite 0 da biste onemogućili."
|
132 |
+
|
133 |
+
#: admin.php:140
|
134 |
+
msgid "Show Larger Page Numbers In Multiples Of"
|
135 |
+
msgstr "Prikaži veće brojeve stranica u ponavljanjima od"
|
136 |
+
|
137 |
+
#: admin.php:145
|
138 |
+
msgid "For example, if mutiple is 5, it will show: 5, 10, 15, 20, 25"
|
139 |
+
msgstr ""
|
140 |
+
"Npr, ako je ponavljanje 5, biće prikazano 1, 2, 3, 4, 5, 10, 20, 30, 40, 50."
|
141 |
+
|
142 |
+
#: admin.php:150
|
143 |
+
msgid "Page Navigation Options"
|
144 |
+
msgstr "Opcije za navigaciju stranice"
|
145 |
+
|
146 |
+
#: scb/AdminPage.php:165 scb/AdminPage.php:176
|
147 |
+
msgid "Save Changes"
|
148 |
+
msgstr "Sačuvaj promene"
|
149 |
+
|
150 |
+
#: scb/AdminPage.php:279
|
151 |
+
msgid "Settings <strong>saved</strong>."
|
152 |
+
msgstr "Postavke<strong> sačuvaj</strong>."
|
153 |
+
|
154 |
+
#: scb/AdminPage.php:337
|
155 |
+
msgid "Settings"
|
156 |
+
msgstr "Postavke"
|
157 |
+
|
158 |
+
#: wp-pagenavi.php:224
|
159 |
+
msgid "Page %CURRENT_PAGE% of %TOTAL_PAGES%"
|
160 |
+
msgstr "Stranica %TRENUTNA_STRANICA% od %TOTALNE_STRANICE%"
|
161 |
+
|
162 |
+
#: wp-pagenavi.php:227
|
163 |
+
msgid "« First"
|
164 |
+
msgstr " « Prva"
|
165 |
+
|
166 |
+
#: wp-pagenavi.php:228
|
167 |
+
msgid "Last »"
|
168 |
+
msgstr "Poslednja »"
|
169 |
+
|
170 |
+
#: wp-pagenavi.php:229
|
171 |
+
msgid "«"
|
172 |
+
msgstr "«"
|
173 |
+
|
174 |
+
#: wp-pagenavi.php:230
|
175 |
+
msgid "»"
|
176 |
+
msgstr "»"
|
177 |
+
|
178 |
+
#: wp-pagenavi.php:231 wp-pagenavi.php:232
|
179 |
+
msgid "..."
|
180 |
+
msgstr "..."
|
181 |
+
|
182 |
+
#. Plugin Name of the plugin/theme
|
183 |
+
msgid "WP-PageNavi"
|
184 |
+
msgstr "WP-PageNavi"
|
185 |
+
|
186 |
+
#. Plugin URI of the plugin/theme
|
187 |
+
msgid "http://wordpress.org/extend/plugins/wp-pagenavi/"
|
188 |
+
msgstr "http://wordpress.org/extend/plugins/wp-pagenavi/"
|
189 |
+
|
190 |
+
#. Description of the plugin/theme
|
191 |
+
msgid "Adds a more advanced paging navigation to your WordPress blog"
|
192 |
+
msgstr "Dodajte napredniju navigaciju na vaš WordPress blog"
|
193 |
+
|
194 |
+
#. Author of the plugin/theme
|
195 |
+
msgid "Lester 'GaMerZ' Chan & scribu"
|
196 |
+
msgstr "Lester 'GaMerZ' Chan & scribu"
|
197 |
+
|
198 |
+
#~ msgid "Updated"
|
199 |
+
#~ msgstr "— обновлено"
|
200 |
+
|
201 |
+
#~ msgid "No Page Navigation Option Updated"
|
202 |
+
#~ msgstr "Настройки списка страниц не изменились"
|
203 |
+
|
204 |
+
#~ msgid "UNINSTALL WP-PageNavi"
|
205 |
+
#~ msgstr "УДАЛИТЬ WP-PageNavi"
|
206 |
+
|
207 |
+
#~ msgid "Setting Key '%s' has been deleted."
|
208 |
+
#~ msgstr "Настройка «%s» удалена."
|
209 |
+
|
210 |
+
#~ msgid "Error deleting Setting Key '%s'."
|
211 |
+
#~ msgstr "Ошибка при удалении настройки «%s»."
|
212 |
+
|
213 |
+
#~ msgid "Uninstall WP-PageNavi"
|
214 |
+
#~ msgstr "Удалить список страниц"
|
215 |
+
|
216 |
+
#~ msgid ""
|
217 |
+
#~ "<a href=\"%s\">Click Here</a> To Finish The Uninstallation And WP-"
|
218 |
+
#~ "PageNavi Will Be Deactivated Automatically."
|
219 |
+
#~ msgstr ""
|
220 |
+
#~ "<a href=\"%s\">Нажмите здесь</a> чтобы завершить удаление. WP-PageNavi "
|
221 |
+
#~ "будет отключён автоматически."
|
222 |
+
|
223 |
+
#~ msgid "Text For Last Post"
|
224 |
+
#~ msgstr "Элемент «Последняя запись»"
|
225 |
+
|
226 |
+
#~ msgid "Text For Next Post"
|
227 |
+
#~ msgstr "Элемент «Следующая запись»"
|
228 |
+
|
229 |
+
#~ msgid "Yes"
|
230 |
+
#~ msgstr "Да"
|
231 |
+
|
232 |
+
#~ msgid "No"
|
233 |
+
#~ msgstr "Нет"
|
234 |
+
|
235 |
+
#~ msgid "If mutiple is in 10, it will show: 10, 20, 30, 40, 50"
|
236 |
+
#~ msgstr "А если 10 — так: 10, 20, 30, 40, 50"
|
237 |
+
|
238 |
+
#~ msgid ""
|
239 |
+
#~ "Deactivating WP-PageNavi plugin does not remove any data that may have "
|
240 |
+
#~ "been created, such as the page navigation options. To completely remove "
|
241 |
+
#~ "this plugin, you can uninstall it here."
|
242 |
+
#~ msgstr ""
|
243 |
+
#~ "При отключении плагина отображения списка страниц созданные данные, "
|
244 |
+
#~ "включая настройки, не удаляются. Для того, чтобы полностью удалить "
|
245 |
+
#~ "плагин, отмените здесь его установку."
|
246 |
+
|
247 |
+
#~ msgid "WARNING:"
|
248 |
+
#~ msgstr "ВНИМАНИЕ:"
|
249 |
+
|
250 |
+
#~ msgid ""
|
251 |
+
#~ "Once uninstalled, this cannot be undone. You should use a Database Backup "
|
252 |
+
#~ "plugin of WordPress to back up all the data first."
|
253 |
+
#~ msgstr ""
|
254 |
+
#~ "Удаление плагина необратимо. Для того, чтобы создать резервную копию БД "
|
255 |
+
#~ "WordPress и сохранить ваши данные, используйте плагин «Database "
|
256 |
+
#~ "Backup»."
|
257 |
+
|
258 |
+
#~ msgid "The following WordPress Options will be DELETED:"
|
259 |
+
#~ msgstr "Будут УДАЛЕНЫ следующие настройки WordPress:"
|
260 |
+
|
261 |
+
#~ msgid "WordPress Options"
|
262 |
+
#~ msgstr "Настройки WordPress"
|
263 |
+
|
264 |
+
#~ msgid ""
|
265 |
+
#~ "You Are About To Uninstall WP-PageNavi From WordPress.\\nThis Action Is "
|
266 |
+
#~ "Not Reversible.\\n\\n Choose [Cancel] To Stop, [OK] To Uninstall."
|
267 |
+
#~ msgstr ""
|
268 |
+
#~ "Вы собираетесь удалить плагин WP-PageNavi.\\nЭто действие необратимо.\\n"
|
269 |
+
#~ "\\nЧтобы остановить удаление, выберите [Отмена]. Выберите [OK], если вы "
|
270 |
+
#~ "хотите его продолжить."
|
lang/wp-pagenavi-zh_CN.po
CHANGED
@@ -1,247 +1,216 @@
|
|
1 |
msgid ""
|
2 |
msgstr ""
|
3 |
-
"Project-Id-Version: WP-PageNavi
|
4 |
"Report-Msgid-Bugs-To: http://wordpress.org/tag/wp-pagenavi\n"
|
5 |
-
"POT-Creation-Date:
|
6 |
-
"PO-Revision-Date:
|
7 |
-
"Last-Translator:
|
8 |
"Language-Team: ViDo <v@vzone.me>\n"
|
|
|
9 |
"MIME-Version: 1.0\n"
|
10 |
"Content-Type: text/plain; charset=UTF-8\n"
|
11 |
"Content-Transfer-Encoding: 8bit\n"
|
12 |
"Plural-Forms: nplurals=2; plural=n != 1;\n"
|
13 |
-
"X-Poedit-
|
14 |
-
"X-Poedit-
|
15 |
-
"
|
16 |
-
"X-Poedit-KeywordsList: __;_e;__ngettext:1,2;_n:1,2;__ngettext_noop:1,2;_n_noop:1,2;_c,_nc:4c,1,2;_x:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2\n"
|
17 |
"X-Textdomain-Support: yes\n"
|
18 |
"X-Poedit-Basepath: .\n"
|
19 |
-
"X-
|
|
|
20 |
|
21 |
# @ wp-pagenavi
|
22 |
-
#: admin.php:9
|
23 |
msgid "PageNavi Settings"
|
24 |
msgstr "分页导航选项"
|
25 |
|
26 |
# @ wp-pagenavi
|
27 |
-
#: admin.php:10
|
28 |
msgid "PageNavi"
|
29 |
msgstr "分页导航"
|
30 |
|
31 |
# @ wp-pagenavi
|
32 |
-
#: admin.php:
|
33 |
msgid "Text For Number Of Pages"
|
34 |
msgstr "“页数”文字设置"
|
35 |
|
36 |
# @ wp-pagenavi
|
37 |
-
#: admin.php:
|
38 |
msgid "The current page number."
|
39 |
msgstr "当前页数"
|
40 |
|
41 |
# @ wp-pagenavi
|
42 |
-
#: admin.php:
|
43 |
-
#: admin.php:58
|
44 |
-
#: admin.php:66
|
45 |
msgid "The total number of pages."
|
46 |
msgstr "所有页数"
|
47 |
|
48 |
# @ wp-pagenavi
|
49 |
-
#: admin.php:
|
50 |
msgid "Text For Current Page"
|
51 |
msgstr "“当前页数”文字设置"
|
52 |
|
53 |
# @ wp-pagenavi
|
54 |
-
#: admin.php:
|
55 |
-
#: admin.php:50
|
56 |
msgid "The page number."
|
57 |
msgstr "页数"
|
58 |
|
59 |
# @ wp-pagenavi
|
60 |
-
#: admin.php:
|
61 |
msgid "Text For Page"
|
62 |
msgstr "“页数”文字设置"
|
63 |
|
64 |
# @ wp-pagenavi
|
65 |
-
#: admin.php:
|
66 |
msgid "Text For First Page"
|
67 |
msgstr "“首页”文字设置"
|
68 |
|
69 |
# @ wp-pagenavi
|
70 |
-
#: admin.php:
|
71 |
msgid "Text For Last Page"
|
72 |
msgstr "“页数”文字设置"
|
73 |
|
74 |
# @ wp-pagenavi
|
75 |
-
#: admin.php:
|
76 |
msgid "Text For Previous Page"
|
77 |
msgstr "“下一页”文字设置"
|
78 |
|
79 |
# @ wp-pagenavi
|
80 |
-
#: admin.php:
|
81 |
msgid "Text For Next Page"
|
82 |
msgstr "“页数”文字设置"
|
83 |
|
84 |
# @ wp-pagenavi
|
85 |
-
#: admin.php:
|
86 |
msgid "Text For Previous ..."
|
87 |
msgstr "“下一页”省略文字设置"
|
88 |
|
89 |
# @ wp-pagenavi
|
90 |
-
#: admin.php:
|
91 |
msgid "Text For Next ..."
|
92 |
msgstr "“上一页”省略文字设置"
|
93 |
|
94 |
# @ wp-pagenavi
|
95 |
-
#: admin.php:
|
96 |
msgid "Page Navigation Text"
|
97 |
msgstr "分页导航文字"
|
98 |
|
99 |
-
#: admin.php:
|
100 |
msgid "Leaving a field blank will hide that part of the navigation."
|
101 |
msgstr "将隐藏导航区域留下的空白的部分。"
|
102 |
|
103 |
-
#: admin.php:
|
104 |
msgid "Use pagenavi-css.css"
|
105 |
msgstr "使用pagenavi- css.css"
|
106 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
107 |
# @ wp-pagenavi
|
108 |
-
#: admin.php:
|
109 |
msgid "Page Navigation Style"
|
110 |
msgstr "分页导航选项"
|
111 |
|
112 |
# @ wp-pagenavi
|
113 |
-
#: admin.php:
|
114 |
msgid "Normal"
|
115 |
msgstr "正常"
|
116 |
|
117 |
# @ wp-pagenavi
|
118 |
-
#: admin.php:
|
119 |
msgid "Drop-down List"
|
120 |
msgstr "下拉列表"
|
121 |
|
122 |
# @ wp-pagenavi
|
123 |
-
#: admin.php:
|
124 |
msgid "Always Show Page Navigation"
|
125 |
msgstr "总是显示页面导航"
|
126 |
|
127 |
-
#: admin.php:
|
128 |
msgid "Show navigation even if there's only one page."
|
129 |
msgstr "即使只有一个网页也显示导航。"
|
130 |
|
131 |
# @ wp-pagenavi
|
132 |
-
#: admin.php:
|
133 |
msgid "Number Of Pages To Show"
|
134 |
msgstr "显示多少页数"
|
135 |
|
136 |
# @ wp-pagenavi
|
137 |
-
#: admin.php:
|
138 |
msgid "Number Of Larger Page Numbers To Show"
|
139 |
msgstr "显示较大页面页数"
|
140 |
|
141 |
# @ wp-pagenavi
|
142 |
-
#: admin.php:
|
143 |
-
msgid "
|
|
|
|
|
144 |
msgstr "显示较大页面的页数,通常针对于文章非常多的站点。"
|
145 |
|
146 |
# @ wp-pagenavi
|
147 |
-
#: admin.php:
|
148 |
-
msgid "
|
|
|
|
|
149 |
msgstr "例如,WP-PageNavi 会显示为:页面 1, 2, 3, 4, 5, 10, 20, 30, 40, 50"
|
150 |
|
151 |
# @ wp-pagenavi
|
152 |
-
#: admin.php:
|
153 |
msgid "Enter 0 to disable."
|
154 |
msgstr "输入 0 可以禁用此功能。"
|
155 |
|
156 |
# @ wp-pagenavi
|
157 |
-
#: admin.php:
|
158 |
msgid "Show Larger Page Numbers In Multiples Of"
|
159 |
msgstr "大页面页数的显示倍数:"
|
160 |
|
161 |
# @ wp-pagenavi
|
162 |
-
#: admin.php:
|
163 |
msgid "For example, if mutiple is 5, it will show: 5, 10, 15, 20, 25"
|
164 |
msgstr "如果倍数设置为 5,将会显示为:5, 10, 15, 20, 25"
|
165 |
|
166 |
# @ wp-pagenavi
|
167 |
-
#: admin.php:
|
168 |
msgid "Page Navigation Options"
|
169 |
msgstr "页面导航选项"
|
170 |
|
171 |
-
#: scb/AdminPage.php:
|
172 |
msgid "Settings <strong>saved</strong>."
|
173 |
msgstr "选项<strong>保存</strong>."
|
174 |
|
175 |
-
|
176 |
-
#: scb/AdminPage.php:179
|
177 |
-
#: scb/AdminPage.php:189
|
178 |
-
msgid "Save Changes"
|
179 |
-
msgstr "保存更改"
|
180 |
-
|
181 |
-
#: scb/AdminPage.php:371
|
182 |
msgid "Settings"
|
183 |
msgstr "选项"
|
184 |
|
185 |
# @ wp-pagenavi
|
186 |
-
#: wp-pagenavi.php:
|
187 |
msgid "Page %CURRENT_PAGE% of %TOTAL_PAGES%"
|
188 |
msgstr "第 %CURRENT_PAGE% 页,共 %TOTAL_PAGES% 页"
|
189 |
|
190 |
# @ wp-pagenavi
|
191 |
-
#: wp-pagenavi.php:
|
192 |
msgid "« First"
|
193 |
msgstr "« 最新"
|
194 |
|
195 |
# @ wp-pagenavi
|
196 |
-
#: wp-pagenavi.php:
|
197 |
msgid "Last »"
|
198 |
msgstr "最旧 »"
|
199 |
|
200 |
# @ wp-pagenavi
|
201 |
-
#: wp-pagenavi.php:
|
202 |
msgid "«"
|
203 |
msgstr "«"
|
204 |
|
205 |
# @ wp-pagenavi
|
206 |
-
#: wp-pagenavi.php:
|
207 |
msgid "»"
|
208 |
msgstr "»"
|
209 |
|
210 |
-
|
211 |
-
#: wp-pagenavi.php:44
|
212 |
-
#: wp-pagenavi.php:45
|
213 |
-
msgid "..."
|
214 |
-
msgstr "..."
|
215 |
-
|
216 |
-
# @ wp-pagenavi
|
217 |
-
#. Plugin Name of the plugin/theme
|
218 |
-
msgid "WP-PageNavi"
|
219 |
-
msgstr "WP-PageNavi分页导航"
|
220 |
-
|
221 |
-
#. Plugin URI of the plugin/theme
|
222 |
-
msgid "http://wordpress.org/extend/plugins/wp-pagenavi/"
|
223 |
-
msgstr ""
|
224 |
-
|
225 |
-
#. Description of the plugin/theme
|
226 |
-
msgid "Adds a more advanced paging navigation to your WordPress blog"
|
227 |
-
msgstr "增加了一个更美观实用的分页导航到你的WordPress博客"
|
228 |
-
|
229 |
-
#. Author of the plugin/theme
|
230 |
-
msgid "Lester 'GaMerZ' Chan & scribu"
|
231 |
-
msgstr ""
|
232 |
-
|
233 |
-
agenavi.php:45
|
234 |
msgid "..."
|
235 |
msgstr "..."
|
236 |
-
|
237 |
-
# @ wp-pagenavi
|
238 |
-
#. Plugin Name of the plugin/theme
|
239 |
-
msgid "WP-PageNavi"
|
240 |
-
msgstr "WP-PageNavi分页导航"
|
241 |
-
|
242 |
-
#. Plugin URI of the plugin/theme
|
243 |
-
msgid "http://wordpress.org/extend/plugins/wp-pagenavi/"
|
244 |
-
msgstr ""
|
245 |
-
|
246 |
-
#. Description of the plugin/theme
|
247 |
-
msgid "Adds a more advanced paging
|
1 |
msgid ""
|
2 |
msgstr ""
|
3 |
+
"Project-Id-Version: WP-PageNavi\n"
|
4 |
"Report-Msgid-Bugs-To: http://wordpress.org/tag/wp-pagenavi\n"
|
5 |
+
"POT-Creation-Date: 2014-03-03 17:44+0800\n"
|
6 |
+
"PO-Revision-Date: 2014-03-03 17:45+0800\n"
|
7 |
+
"Last-Translator: Lester Chan <lesterchan@gmail.com>\n"
|
8 |
"Language-Team: ViDo <v@vzone.me>\n"
|
9 |
+
"Language: zh_CN\n"
|
10 |
"MIME-Version: 1.0\n"
|
11 |
"Content-Type: text/plain; charset=UTF-8\n"
|
12 |
"Content-Transfer-Encoding: 8bit\n"
|
13 |
"Plural-Forms: nplurals=2; plural=n != 1;\n"
|
14 |
+
"X-Poedit-SourceCharset: UTF-8\n"
|
15 |
+
"X-Poedit-KeywordsList: __;_e;__ngettext:1,2;_n:1,2;__ngettext_noop:1,2;"
|
16 |
+
"_n_noop:1,2;_c,_nc:4c,1,2;_x:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2\n"
|
|
|
17 |
"X-Textdomain-Support: yes\n"
|
18 |
"X-Poedit-Basepath: .\n"
|
19 |
+
"X-Generator: Poedit 1.6.4\n"
|
20 |
+
"X-Poedit-SearchPath-0: ..\n"
|
21 |
|
22 |
# @ wp-pagenavi
|
23 |
+
#: ../admin.php:9
|
24 |
msgid "PageNavi Settings"
|
25 |
msgstr "分页导航选项"
|
26 |
|
27 |
# @ wp-pagenavi
|
28 |
+
#: ../admin.php:10
|
29 |
msgid "PageNavi"
|
30 |
msgstr "分页导航"
|
31 |
|
32 |
# @ wp-pagenavi
|
33 |
+
#: ../admin.php:29
|
34 |
msgid "Text For Number Of Pages"
|
35 |
msgstr "“页数”文字设置"
|
36 |
|
37 |
# @ wp-pagenavi
|
38 |
+
#: ../admin.php:34
|
39 |
msgid "The current page number."
|
40 |
msgstr "当前页数"
|
41 |
|
42 |
# @ wp-pagenavi
|
43 |
+
#: ../admin.php:35 ../admin.php:59 ../admin.php:67
|
|
|
|
|
44 |
msgid "The total number of pages."
|
45 |
msgstr "所有页数"
|
46 |
|
47 |
# @ wp-pagenavi
|
48 |
+
#: ../admin.php:39
|
49 |
msgid "Text For Current Page"
|
50 |
msgstr "“当前页数”文字设置"
|
51 |
|
52 |
# @ wp-pagenavi
|
53 |
+
#: ../admin.php:43 ../admin.php:51
|
|
|
54 |
msgid "The page number."
|
55 |
msgstr "页数"
|
56 |
|
57 |
# @ wp-pagenavi
|
58 |
+
#: ../admin.php:47
|
59 |
msgid "Text For Page"
|
60 |
msgstr "“页数”文字设置"
|
61 |
|
62 |
# @ wp-pagenavi
|
63 |
+
#: ../admin.php:55
|
64 |
msgid "Text For First Page"
|
65 |
msgstr "“首页”文字设置"
|
66 |
|
67 |
# @ wp-pagenavi
|
68 |
+
#: ../admin.php:63
|
69 |
msgid "Text For Last Page"
|
70 |
msgstr "“页数”文字设置"
|
71 |
|
72 |
# @ wp-pagenavi
|
73 |
+
#: ../admin.php:71
|
74 |
msgid "Text For Previous Page"
|
75 |
msgstr "“下一页”文字设置"
|
76 |
|
77 |
# @ wp-pagenavi
|
78 |
+
#: ../admin.php:77
|
79 |
msgid "Text For Next Page"
|
80 |
msgstr "“页数”文字设置"
|
81 |
|
82 |
# @ wp-pagenavi
|
83 |
+
#: ../admin.php:83
|
84 |
msgid "Text For Previous ..."
|
85 |
msgstr "“下一页”省略文字设置"
|
86 |
|
87 |
# @ wp-pagenavi
|
88 |
+
#: ../admin.php:89
|
89 |
msgid "Text For Next ..."
|
90 |
msgstr "“上一页”省略文字设置"
|
91 |
|
92 |
# @ wp-pagenavi
|
93 |
+
#: ../admin.php:96
|
94 |
msgid "Page Navigation Text"
|
95 |
msgstr "分页导航文字"
|
96 |
|
97 |
+
#: ../admin.php:97
|
98 |
msgid "Leaving a field blank will hide that part of the navigation."
|
99 |
msgstr "将隐藏导航区域留下的空白的部分。"
|
100 |
|
101 |
+
#: ../admin.php:103
|
102 |
msgid "Use pagenavi-css.css"
|
103 |
msgstr "使用pagenavi- css.css"
|
104 |
|
105 |
+
#: ../admin.php:106 ../admin.php:121
|
106 |
+
msgid "Yes"
|
107 |
+
msgstr "是"
|
108 |
+
|
109 |
+
#: ../admin.php:106 ../admin.php:121
|
110 |
+
msgid "No"
|
111 |
+
msgstr "不是"
|
112 |
+
|
113 |
# @ wp-pagenavi
|
114 |
+
#: ../admin.php:110
|
115 |
msgid "Page Navigation Style"
|
116 |
msgstr "分页导航选项"
|
117 |
|
118 |
# @ wp-pagenavi
|
119 |
+
#: ../admin.php:113
|
120 |
msgid "Normal"
|
121 |
msgstr "正常"
|
122 |
|
123 |
# @ wp-pagenavi
|
124 |
+
#: ../admin.php:113
|
125 |
msgid "Drop-down List"
|
126 |
msgstr "下拉列表"
|
127 |
|
128 |
# @ wp-pagenavi
|
129 |
+
#: ../admin.php:118
|
130 |
msgid "Always Show Page Navigation"
|
131 |
msgstr "总是显示页面导航"
|
132 |
|
133 |
+
#: ../admin.php:122
|
134 |
msgid "Show navigation even if there's only one page."
|
135 |
msgstr "即使只有一个网页也显示导航。"
|
136 |
|
137 |
# @ wp-pagenavi
|
138 |
+
#: ../admin.php:126
|
139 |
msgid "Number Of Pages To Show"
|
140 |
msgstr "显示多少页数"
|
141 |
|
142 |
# @ wp-pagenavi
|
143 |
+
#: ../admin.php:133
|
144 |
msgid "Number Of Larger Page Numbers To Show"
|
145 |
msgstr "显示较大页面页数"
|
146 |
|
147 |
# @ wp-pagenavi
|
148 |
+
#: ../admin.php:138
|
149 |
+
msgid ""
|
150 |
+
"Larger page numbers are in addition to the normal page numbers. They are "
|
151 |
+
"useful when there are many pages of posts."
|
152 |
msgstr "显示较大页面的页数,通常针对于文章非常多的站点。"
|
153 |
|
154 |
# @ wp-pagenavi
|
155 |
+
#: ../admin.php:139
|
156 |
+
msgid ""
|
157 |
+
"For example, WP-PageNavi will display: Pages 1, 2, 3, 4, 5, 10, 20, 30, 40, "
|
158 |
+
"50."
|
159 |
msgstr "例如,WP-PageNavi 会显示为:页面 1, 2, 3, 4, 5, 10, 20, 30, 40, 50"
|
160 |
|
161 |
# @ wp-pagenavi
|
162 |
+
#: ../admin.php:140
|
163 |
msgid "Enter 0 to disable."
|
164 |
msgstr "输入 0 可以禁用此功能。"
|
165 |
|
166 |
# @ wp-pagenavi
|
167 |
+
#: ../admin.php:144
|
168 |
msgid "Show Larger Page Numbers In Multiples Of"
|
169 |
msgstr "大页面页数的显示倍数:"
|
170 |
|
171 |
# @ wp-pagenavi
|
172 |
+
#: ../admin.php:149
|
173 |
msgid "For example, if mutiple is 5, it will show: 5, 10, 15, 20, 25"
|
174 |
msgstr "如果倍数设置为 5,将会显示为:5, 10, 15, 20, 25"
|
175 |
|
176 |
# @ wp-pagenavi
|
177 |
+
#: ../admin.php:154
|
178 |
msgid "Page Navigation Options"
|
179 |
msgstr "页面导航选项"
|
180 |
|
181 |
+
#: ../scb/AdminPage.php:228
|
182 |
msgid "Settings <strong>saved</strong>."
|
183 |
msgstr "选项<strong>保存</strong>."
|
184 |
|
185 |
+
#: ../scb/AdminPage.php:467
|
|
|
|
|
|
|
|
|
|
|
|
|
186 |
msgid "Settings"
|
187 |
msgstr "选项"
|
188 |
|
189 |
# @ wp-pagenavi
|
190 |
+
#: ../wp-pagenavi.php:20
|
191 |
msgid "Page %CURRENT_PAGE% of %TOTAL_PAGES%"
|
192 |
msgstr "第 %CURRENT_PAGE% 页,共 %TOTAL_PAGES% 页"
|
193 |
|
194 |
# @ wp-pagenavi
|
195 |
+
#: ../wp-pagenavi.php:23
|
196 |
msgid "« First"
|
197 |
msgstr "« 最新"
|
198 |
|
199 |
# @ wp-pagenavi
|
200 |
+
#: ../wp-pagenavi.php:24
|
201 |
msgid "Last »"
|
202 |
msgstr "最旧 »"
|
203 |
|
204 |
# @ wp-pagenavi
|
205 |
+
#: ../wp-pagenavi.php:25
|
206 |
msgid "«"
|
207 |
msgstr "«"
|
208 |
|
209 |
# @ wp-pagenavi
|
210 |
+
#: ../wp-pagenavi.php:26
|
211 |
msgid "»"
|
212 |
msgstr "»"
|
213 |
|
214 |
+
#: ../wp-pagenavi.php:27 ../wp-pagenavi.php:28
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
215 |
msgid "..."
|
216 |
msgstr "..."
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
lang/wp-pagenavi-zh_TW.mo
CHANGED
Binary file
|
lang/wp-pagenavi-zh_TW.po
CHANGED
@@ -1,100 +1,79 @@
|
|
1 |
msgid ""
|
2 |
msgstr ""
|
3 |
-
"Project-Id-Version: WP-PageNavi
|
4 |
-
"Report-Msgid-Bugs-To:
|
5 |
-
"POT-Creation-Date:
|
6 |
-
"PO-Revision-Date:
|
7 |
-
"Last-Translator:
|
8 |
-
"Language-Team:
|
9 |
"MIME-Version: 1.0\n"
|
10 |
-
"Content-Type: text/plain; charset=
|
11 |
"Content-Transfer-Encoding: 8bit\n"
|
|
|
12 |
"Plural-Forms: nplurals=2; plural=n != 1;\n"
|
13 |
-
"X-Poedit-
|
14 |
-
"
|
15 |
-
"X-
|
16 |
-
|
17 |
-
"X-Textdomain-Support: yes\n"
|
18 |
-
"X-Poedit-Basepath: .\n"
|
19 |
-
"X-Poedit-SearchPath-0: .\n"
|
20 |
-
|
21 |
-
# @ wp-pagenavi
|
22 |
#: admin.php:9
|
23 |
msgid "PageNavi Settings"
|
24 |
-
msgstr "
|
25 |
|
26 |
-
# @ wp-pagenavi
|
27 |
#: admin.php:10
|
28 |
msgid "PageNavi"
|
29 |
-
msgstr "
|
30 |
|
31 |
-
# @ wp-pagenavi
|
32 |
#: admin.php:28
|
33 |
msgid "Text For Number Of Pages"
|
34 |
-
msgstr "
|
35 |
|
36 |
-
# @ wp-pagenavi
|
37 |
#: admin.php:33
|
38 |
msgid "The current page number."
|
39 |
-
msgstr "
|
40 |
|
41 |
-
|
42 |
-
#: admin.php:34
|
43 |
-
#: admin.php:58
|
44 |
-
#: admin.php:66
|
45 |
msgid "The total number of pages."
|
46 |
-
msgstr "
|
47 |
|
48 |
-
# @ wp-pagenavi
|
49 |
#: admin.php:38
|
50 |
msgid "Text For Current Page"
|
51 |
-
msgstr "
|
52 |
|
53 |
-
|
54 |
-
#: admin.php:42
|
55 |
-
#: admin.php:50
|
56 |
msgid "The page number."
|
57 |
-
msgstr "
|
58 |
|
59 |
-
# @ wp-pagenavi
|
60 |
#: admin.php:46
|
61 |
msgid "Text For Page"
|
62 |
-
msgstr "
|
63 |
|
64 |
-
# @ wp-pagenavi
|
65 |
#: admin.php:54
|
66 |
msgid "Text For First Page"
|
67 |
-
msgstr "
|
68 |
|
69 |
-
# @ wp-pagenavi
|
70 |
#: admin.php:62
|
71 |
msgid "Text For Last Page"
|
72 |
-
msgstr "
|
73 |
|
74 |
-
# @ wp-pagenavi
|
75 |
#: admin.php:70
|
76 |
msgid "Text For Previous Page"
|
77 |
-
msgstr "
|
78 |
|
79 |
-
# @ wp-pagenavi
|
80 |
#: admin.php:76
|
81 |
msgid "Text For Next Page"
|
82 |
-
msgstr "
|
83 |
|
84 |
-
# @ wp-pagenavi
|
85 |
#: admin.php:82
|
86 |
msgid "Text For Previous ..."
|
87 |
-
msgstr "
|
88 |
|
89 |
-
# @ wp-pagenavi
|
90 |
#: admin.php:88
|
91 |
msgid "Text For Next ..."
|
92 |
-
msgstr "
|
93 |
|
94 |
-
# @ wp-pagenavi
|
95 |
#: admin.php:95
|
96 |
msgid "Page Navigation Text"
|
97 |
-
msgstr "
|
98 |
|
99 |
#: admin.php:96
|
100 |
msgid "Leaving a field blank will hide that part of the navigation."
|
@@ -102,143 +81,104 @@ msgstr "將隱藏導航區域留下的空白的部分。"
|
|
102 |
|
103 |
#: admin.php:102
|
104 |
msgid "Use pagenavi-css.css"
|
105 |
-
msgstr "使用pagenavi- css.css"
|
106 |
|
107 |
-
# @ wp-pagenavi
|
108 |
#: admin.php:108
|
109 |
msgid "Page Navigation Style"
|
110 |
-
msgstr "
|
111 |
|
112 |
-
# @ wp-pagenavi
|
113 |
#: admin.php:111
|
114 |
msgid "Normal"
|
115 |
-
msgstr "
|
116 |
|
117 |
-
# @ wp-pagenavi
|
118 |
#: admin.php:111
|
119 |
msgid "Drop-down List"
|
120 |
-
msgstr "
|
121 |
|
122 |
-
# @ wp-pagenavi
|
123 |
#: admin.php:116
|
124 |
msgid "Always Show Page Navigation"
|
125 |
-
msgstr "
|
126 |
|
127 |
#: admin.php:119
|
128 |
msgid "Show navigation even if there's only one page."
|
129 |
-
msgstr "
|
130 |
|
131 |
-
# @ wp-pagenavi
|
132 |
#: admin.php:123
|
133 |
msgid "Number Of Pages To Show"
|
134 |
msgstr "顯示多少頁數"
|
135 |
|
136 |
-
# @ wp-pagenavi
|
137 |
#: admin.php:130
|
138 |
msgid "Number Of Larger Page Numbers To Show"
|
139 |
-
msgstr "
|
140 |
|
141 |
-
# @ wp-pagenavi
|
142 |
#: admin.php:135
|
143 |
-
msgid "
|
144 |
-
|
|
|
|
|
145 |
|
146 |
-
# @ wp-pagenavi
|
147 |
#: admin.php:136
|
148 |
-
msgid "
|
149 |
-
|
|
|
|
|
150 |
|
151 |
-
# @ wp-pagenavi
|
152 |
#: admin.php:137
|
153 |
msgid "Enter 0 to disable."
|
154 |
-
msgstr "輸入0
|
155 |
|
156 |
-
# @ wp-pagenavi
|
157 |
#: admin.php:141
|
158 |
msgid "Show Larger Page Numbers In Multiples Of"
|
159 |
-
msgstr "
|
160 |
|
161 |
-
# @ wp-pagenavi
|
162 |
#: admin.php:146
|
163 |
msgid "For example, if mutiple is 5, it will show: 5, 10, 15, 20, 25"
|
164 |
-
msgstr "
|
165 |
|
166 |
-
# @ wp-pagenavi
|
167 |
#: admin.php:151
|
168 |
msgid "Page Navigation Options"
|
169 |
-
msgstr "
|
170 |
-
|
171 |
-
#: scb/AdminPage.php:167
|
172 |
-
msgid "Settings <strong>saved</strong>."
|
173 |
-
msgstr "選項<strong>保存</strong>."
|
174 |
|
175 |
-
# @ wp-pagenavi
|
176 |
-
#: scb/AdminPage.php:179
|
177 |
-
#: scb/AdminPage.php:189
|
178 |
-
msgid "Save Changes"
|
179 |
-
msgstr "保存更改"
|
180 |
-
|
181 |
-
#: scb/AdminPage.php:371
|
182 |
-
msgid "Settings"
|
183 |
-
msgstr "設置"
|
184 |
-
|
185 |
-
# @ wp-pagenavi
|
186 |
#: wp-pagenavi.php:37
|
187 |
msgid "Page %CURRENT_PAGE% of %TOTAL_PAGES%"
|
188 |
-
msgstr "第 %CURRENT_PAGE%
|
189 |
|
190 |
-
# @ wp-pagenavi
|
191 |
#: wp-pagenavi.php:40
|
192 |
msgid "« First"
|
193 |
-
msgstr "«
|
194 |
|
195 |
-
# @ wp-pagenavi
|
196 |
#: wp-pagenavi.php:41
|
197 |
msgid "Last »"
|
198 |
-
msgstr "
|
199 |
|
200 |
-
# @ wp-pagenavi
|
201 |
#: wp-pagenavi.php:42
|
202 |
msgid "«"
|
203 |
-
msgstr "«"
|
204 |
|
205 |
-
# @ wp-pagenavi
|
206 |
#: wp-pagenavi.php:43
|
207 |
msgid "»"
|
208 |
-
msgstr "»"
|
209 |
|
210 |
-
|
211 |
-
#: wp-pagenavi.php:44
|
212 |
-
#: wp-pagenavi.php:45
|
213 |
msgid "..."
|
214 |
msgstr "..."
|
215 |
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
|
|
|
|
|
|
220 |
|
221 |
-
|
222 |
-
msgid "
|
223 |
-
msgstr ""
|
224 |
|
225 |
#. Description of the plugin/theme
|
226 |
msgid "Adds a more advanced paging navigation to your WordPress blog"
|
227 |
-
msgstr "增加了一個更美觀實用的分頁導航到你的WordPress的博客"
|
228 |
-
|
229 |
-
#. Author of the plugin/theme
|
230 |
-
msgid "Lester 'GaMerZ' Chan & scribu"
|
231 |
-
msgstr ""
|
232 |
-
|
233 |
-
msgid "..."
|
234 |
-
msgstr "..."
|
235 |
-
|
236 |
-
# @ wp-pagenavi
|
237 |
-
#. Plugin Name of the plugin/theme
|
238 |
-
msgid "WP-PageNavi"
|
239 |
-
msgstr "WP-PageNavi換頁導航"
|
240 |
-
|
241 |
-
#. Plugin URI of the plugin/theme
|
242 |
-
msgid "http://wordpress.org/extend/plugins/wp-pagenavi/"
|
243 |
msgstr ""
|
244 |
-
|
|
|
|
|
|
1 |
msgid ""
|
2 |
msgstr ""
|
3 |
+
"Project-Id-Version: WP-PageNavi\n"
|
4 |
+
"Report-Msgid-Bugs-To: \n"
|
5 |
+
"POT-Creation-Date: 2011-07-05 17:10+0800\n"
|
6 |
+
"PO-Revision-Date: 2014-03-03 17:40+0800\n"
|
7 |
+
"Last-Translator: Lester Chan <lesterchan@gmail.com>\n"
|
8 |
+
"Language-Team: Ragnarok | ragnarok.3dsydesign.com <ragnarok@3dsydesign.com>\n"
|
9 |
"MIME-Version: 1.0\n"
|
10 |
+
"Content-Type: text/plain; charset=UTF-8\n"
|
11 |
"Content-Transfer-Encoding: 8bit\n"
|
12 |
+
"X-Poedit-KeywordsList: __;_e\n"
|
13 |
"Plural-Forms: nplurals=2; plural=n != 1;\n"
|
14 |
+
"X-Poedit-SourceCharset: UTF-8\n"
|
15 |
+
"Language: zh_TW\n"
|
16 |
+
"X-Generator: Poedit 1.6.4\n"
|
17 |
+
|
|
|
|
|
|
|
|
|
|
|
18 |
#: admin.php:9
|
19 |
msgid "PageNavi Settings"
|
20 |
+
msgstr "PageNavi 設定"
|
21 |
|
|
|
22 |
#: admin.php:10
|
23 |
msgid "PageNavi"
|
24 |
+
msgstr "PageNavi"
|
25 |
|
|
|
26 |
#: admin.php:28
|
27 |
msgid "Text For Number Of Pages"
|
28 |
+
msgstr "【頁面編號】文字"
|
29 |
|
|
|
30 |
#: admin.php:33
|
31 |
msgid "The current page number."
|
32 |
+
msgstr "目前頁碼"
|
33 |
|
34 |
+
#: admin.php:34 admin.php:58 admin.php:66
|
|
|
|
|
|
|
35 |
msgid "The total number of pages."
|
36 |
+
msgstr "總共頁面數"
|
37 |
|
|
|
38 |
#: admin.php:38
|
39 |
msgid "Text For Current Page"
|
40 |
+
msgstr "【目前頁面】文字"
|
41 |
|
42 |
+
#: admin.php:42 admin.php:50
|
|
|
|
|
43 |
msgid "The page number."
|
44 |
+
msgstr "頁碼"
|
45 |
|
|
|
46 |
#: admin.php:46
|
47 |
msgid "Text For Page"
|
48 |
+
msgstr "【頁面】文字"
|
49 |
|
|
|
50 |
#: admin.php:54
|
51 |
msgid "Text For First Page"
|
52 |
+
msgstr "【第一頁】文字"
|
53 |
|
|
|
54 |
#: admin.php:62
|
55 |
msgid "Text For Last Page"
|
56 |
+
msgstr "【最後一頁】文字"
|
57 |
|
|
|
58 |
#: admin.php:70
|
59 |
msgid "Text For Previous Page"
|
60 |
+
msgstr "【上一頁】文字"
|
61 |
|
|
|
62 |
#: admin.php:76
|
63 |
msgid "Text For Next Page"
|
64 |
+
msgstr "【下一頁】文字"
|
65 |
|
|
|
66 |
#: admin.php:82
|
67 |
msgid "Text For Previous ..."
|
68 |
+
msgstr "【前一 ... 】文字"
|
69 |
|
|
|
70 |
#: admin.php:88
|
71 |
msgid "Text For Next ..."
|
72 |
+
msgstr "【下一 ... 】文字"
|
73 |
|
|
|
74 |
#: admin.php:95
|
75 |
msgid "Page Navigation Text"
|
76 |
+
msgstr "頁面導覽文字"
|
77 |
|
78 |
#: admin.php:96
|
79 |
msgid "Leaving a field blank will hide that part of the navigation."
|
81 |
|
82 |
#: admin.php:102
|
83 |
msgid "Use pagenavi-css.css"
|
84 |
+
msgstr "使用 pagenavi- css.css"
|
85 |
|
|
|
86 |
#: admin.php:108
|
87 |
msgid "Page Navigation Style"
|
88 |
+
msgstr "頁面導覽樣式"
|
89 |
|
|
|
90 |
#: admin.php:111
|
91 |
msgid "Normal"
|
92 |
+
msgstr "一般"
|
93 |
|
|
|
94 |
#: admin.php:111
|
95 |
msgid "Drop-down List"
|
96 |
+
msgstr "下拉式列表"
|
97 |
|
|
|
98 |
#: admin.php:116
|
99 |
msgid "Always Show Page Navigation"
|
100 |
+
msgstr "始終顯示頁面導覽"
|
101 |
|
102 |
#: admin.php:119
|
103 |
msgid "Show navigation even if there's only one page."
|
104 |
+
msgstr "即使只有一個頁面也顯示導覽。"
|
105 |
|
|
|
106 |
#: admin.php:123
|
107 |
msgid "Number Of Pages To Show"
|
108 |
msgstr "顯示多少頁數"
|
109 |
|
|
|
110 |
#: admin.php:130
|
111 |
msgid "Number Of Larger Page Numbers To Show"
|
112 |
+
msgstr "顯示較大頁碼"
|
113 |
|
|
|
114 |
#: admin.php:135
|
115 |
+
msgid ""
|
116 |
+
"Larger page numbers are in addition to the normal page numbers. They are "
|
117 |
+
"useful when there are many pages of posts."
|
118 |
+
msgstr "較大頁碼附加在一般頁碼,當你有許多頁面的文章時是很有用的。"
|
119 |
|
|
|
120 |
#: admin.php:136
|
121 |
+
msgid ""
|
122 |
+
"For example, WP-PageNavi will display: Pages 1, 2, 3, 4, 5, 10, 20, 30, 40, "
|
123 |
+
"50."
|
124 |
+
msgstr "例如 WP-PageNavi 會顯示為:頁面 1, 2, 3, 4, 5, 10, 20, 30, 40, 50。"
|
125 |
|
|
|
126 |
#: admin.php:137
|
127 |
msgid "Enter 0 to disable."
|
128 |
+
msgstr "輸入 0 停用此功能。"
|
129 |
|
|
|
130 |
#: admin.php:141
|
131 |
msgid "Show Larger Page Numbers In Multiples Of"
|
132 |
+
msgstr "顯示較大頁碼的倍增值為"
|
133 |
|
|
|
134 |
#: admin.php:146
|
135 |
msgid "For example, if mutiple is 5, it will show: 5, 10, 15, 20, 25"
|
136 |
+
msgstr "例如倍增值為 5,將會顯示為:5, 10, 15, 20, 25"
|
137 |
|
|
|
138 |
#: admin.php:151
|
139 |
msgid "Page Navigation Options"
|
140 |
+
msgstr "頁面導覽選項"
|
|
|
|
|
|
|
|
|
141 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
142 |
#: wp-pagenavi.php:37
|
143 |
msgid "Page %CURRENT_PAGE% of %TOTAL_PAGES%"
|
144 |
+
msgstr "第 %CURRENT_PAGE% 頁 / 共 %TOTAL_PAGES% 頁"
|
145 |
|
|
|
146 |
#: wp-pagenavi.php:40
|
147 |
msgid "« First"
|
148 |
+
msgstr "« 第一頁"
|
149 |
|
|
|
150 |
#: wp-pagenavi.php:41
|
151 |
msgid "Last »"
|
152 |
+
msgstr "最後一頁 »"
|
153 |
|
|
|
154 |
#: wp-pagenavi.php:42
|
155 |
msgid "«"
|
156 |
+
msgstr "« 上一頁"
|
157 |
|
|
|
158 |
#: wp-pagenavi.php:43
|
159 |
msgid "»"
|
160 |
+
msgstr "下一頁 »"
|
161 |
|
162 |
+
#: wp-pagenavi.php:44 wp-pagenavi.php:45
|
|
|
|
|
163 |
msgid "..."
|
164 |
msgstr "..."
|
165 |
|
166 |
+
#: scb/AdminPage.php:164
|
167 |
+
msgid "Settings <strong>saved</strong>."
|
168 |
+
msgstr "選項<strong>保存</strong>."
|
169 |
+
|
170 |
+
#: scb/AdminPage.php:176 scb/AdminPage.php:186
|
171 |
+
msgid "Save Changes"
|
172 |
+
msgstr "儲存設定"
|
173 |
|
174 |
+
#: scb/AdminPage.php:368
|
175 |
+
msgid "Settings"
|
176 |
+
msgstr "設定"
|
177 |
|
178 |
#. Description of the plugin/theme
|
179 |
msgid "Adds a more advanced paging navigation to your WordPress blog"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
180 |
msgstr ""
|
181 |
+
"新增更加美觀實用的頁面導覽到你的 WordPress 部落格。|繁體中文語系:<a href="
|
182 |
+
"\"http://ragnarok.3dsydesign.com/\" target=\"_blank\">Ragnarok</a>|教學:<a "
|
183 |
+
"href=\"http://ragnarok.3dsydesign.com/27/wp-pagenavi/\" target=\"_blank\">WP-"
|
184 |
+
"PageNavi 2.74 教學</a>"
|
readme.txt
CHANGED
@@ -1,23 +1,25 @@
|
|
1 |
=== WP-PageNavi ===
|
2 |
-
Contributors: GamerZ, scribu
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
License
|
|
|
9 |
|
10 |
Adds a more advanced paging navigation interface.
|
11 |
|
12 |
== Description ==
|
13 |
|
14 |
-
[PHP5 is required since version 2.70](http://scribu.net/wordpress/wp-pagenavi/wp-2-70.html)
|
15 |
-
|
16 |
Want to replace the old *← Older posts | Newer posts →* links with some page links?
|
17 |
|
18 |
This plugin provides the `wp_pagenavi()` template tag which generates fancy pagination links. See the [installation instructions](http://wordpress.org/extend/plugins/wp-pagenavi/installation/) for using it in your theme.
|
19 |
|
20 |
-
|
|
|
|
|
|
|
21 |
|
22 |
== Installation ==
|
23 |
|
@@ -32,10 +34,9 @@ In your theme, you need to find calls to next_posts_link() and previous_posts_li
|
|
32 |
|
33 |
In the Twentyten theme, it looks like this:
|
34 |
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
`
|
39 |
|
40 |
You would replace those two lines with this:
|
41 |
|
@@ -90,6 +91,12 @@ You can do that like so:
|
|
90 |
|
91 |
== Changelog ==
|
92 |
|
|
|
|
|
|
|
|
|
|
|
|
|
93 |
= 2.83 =
|
94 |
* added 'echo' parameter
|
95 |
* added Estonian and Bengali translations
|
@@ -172,7 +179,7 @@ You can do that like so:
|
|
172 |
|
173 |
= 2.11 (2007-06-01) =
|
174 |
* new: Page Navigation Now Is Customizable Via 'WP-Admin -> Options -> PageNavi' And pagenavi-css.css
|
175 |
-
* new: Default Style Navigation Is Now Boxed Navigation (Similar To Digg.com)
|
176 |
* fixed: Fix For Ultimate Tag Warrior By Oliver Kastler & Stephan (Netconcepts)
|
177 |
|
178 |
= 2.10 (2007-02-01) =
|
1 |
=== WP-PageNavi ===
|
2 |
+
Contributors: GamerZ, scribu
|
3 |
+
Donate link: http://lesterchan.net/site/donation/
|
4 |
+
Tags: navigation, pagination, paging, pages
|
5 |
+
Requires at least: 3.2
|
6 |
+
Tested up to: 3.9
|
7 |
+
Stable tag: trunk
|
8 |
+
License: GPLv2 or later
|
9 |
+
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
11 |
Adds a more advanced paging navigation interface.
|
12 |
|
13 |
== Description ==
|
14 |
|
|
|
|
|
15 |
Want to replace the old *← Older posts | Newer posts →* links with some page links?
|
16 |
|
17 |
This plugin provides the `wp_pagenavi()` template tag which generates fancy pagination links. See the [installation instructions](http://wordpress.org/extend/plugins/wp-pagenavi/installation/) for using it in your theme.
|
18 |
|
19 |
+
Help to translate at <https://translate.foe-services.de/projects/wp-pagenavi>.
|
20 |
+
|
21 |
+
= Development =
|
22 |
+
* [https://github.com/lesterchan/wp-pagenavi](https://github.com/lesterchan/wp-pagenavi "https://github.com/lesterchan/wp-pagenavi")
|
23 |
|
24 |
== Installation ==
|
25 |
|
34 |
|
35 |
In the Twentyten theme, it looks like this:
|
36 |
|
37 |
+
`<div class="nav-previous"><?php next_posts_link( __( '<span class="meta-nav">←</span> Older posts', 'twentyten' ) ); ?></div>`
|
38 |
+
`<div class="nav-next"><?php previous_posts_link( __( 'Newer posts <span class="meta-nav">→</span>', 'twentyten' ) ); ?></div>`
|
39 |
+
|
|
|
40 |
|
41 |
You would replace those two lines with this:
|
42 |
|
91 |
|
92 |
== Changelog ==
|
93 |
|
94 |
+
= 2.85 =
|
95 |
+
* FIXED: "Use pagenavi-css.css" & "Always Show Page Navigation" in the options are not being saved
|
96 |
+
|
97 |
+
= 2.84 =
|
98 |
+
* FIXED: Updated scb framework to fix scbAdminPage incompatible error
|
99 |
+
|
100 |
= 2.83 =
|
101 |
* added 'echo' parameter
|
102 |
* added Estonian and Bengali translations
|
179 |
|
180 |
= 2.11 (2007-06-01) =
|
181 |
* new: Page Navigation Now Is Customizable Via 'WP-Admin -> Options -> PageNavi' And pagenavi-css.css
|
182 |
+
* new: Default Style Navigation Is Now Boxed Navigation (Similar To Digg.com)
|
183 |
* fixed: Fix For Ultimate Tag Warrior By Oliver Kastler & Stephan (Netconcepts)
|
184 |
|
185 |
= 2.10 (2007-02-01) =
|
scb/AdminPage.php
CHANGED
@@ -1,13 +1,15 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
|
4 |
-
|
|
|
5 |
abstract class scbAdminPage {
|
6 |
/** Page args
|
7 |
* $page_title string (mandatory)
|
8 |
* $parent (string) (default: options-general.php)
|
9 |
* $capability (string) (default: 'manage_options')
|
10 |
* $menu_title (string) (default: $page_title)
|
|
|
11 |
* $page_slug (string) (default: sanitized $page_title)
|
12 |
* $toplevel (string) If not empty, will create a new top level menu (for expected values see http://codex.wordpress.org/Administration_Menus#Using_add_submenu_page)
|
13 |
* - $icon_url (string) URL to an icon for the top level menu
|
@@ -40,6 +42,13 @@ abstract class scbAdminPage {
|
|
40 |
|
41 |
private static $registered = array();
|
42 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
43 |
static function register( $class, $file, $options = null ) {
|
44 |
if ( isset( self::$registered[$class] ) )
|
45 |
return false;
|
@@ -51,6 +60,12 @@ abstract class scbAdminPage {
|
|
51 |
return true;
|
52 |
}
|
53 |
|
|
|
|
|
|
|
|
|
|
|
|
|
54 |
static function replace( $old_class, $new_class ) {
|
55 |
if ( ! isset( self::$registered[$old_class] ) )
|
56 |
return false;
|
@@ -61,6 +76,11 @@ abstract class scbAdminPage {
|
|
61 |
return true;
|
62 |
}
|
63 |
|
|
|
|
|
|
|
|
|
|
|
64 |
static function remove( $class ) {
|
65 |
if ( ! isset( self::$registered[$class] ) )
|
66 |
return false;
|
@@ -79,7 +99,12 @@ abstract class scbAdminPage {
|
|
79 |
// ____________MAIN METHODS____________
|
80 |
|
81 |
|
82 |
-
|
|
|
|
|
|
|
|
|
|
|
83 |
function __construct( $file = false, $options = null ) {
|
84 |
if ( is_a( $options, 'scbOptions' ) )
|
85 |
$this->options = $options;
|
@@ -89,8 +114,7 @@ abstract class scbAdminPage {
|
|
89 |
|
90 |
if ( isset( $this->option_name ) ) {
|
91 |
add_action( 'admin_init', array( $this, 'option_init' ) );
|
92 |
-
|
93 |
-
add_action( 'admin_notices', 'settings_errors' );
|
94 |
}
|
95 |
|
96 |
add_action( 'admin_menu', array( $this, 'page_init' ), $this->args['admin_action_priority'] );
|
@@ -105,7 +129,9 @@ abstract class scbAdminPage {
|
|
105 |
}
|
106 |
}
|
107 |
|
108 |
-
|
|
|
|
|
109 |
function setup(){}
|
110 |
|
111 |
/**
|
@@ -113,45 +139,68 @@ abstract class scbAdminPage {
|
|
113 |
*
|
114 |
* Useful for calling $screen->add_help_tab() etc.
|
115 |
*/
|
116 |
-
function page_loaded() {
|
|
|
|
|
117 |
|
118 |
-
|
119 |
-
|
|
|
|
|
120 |
function page_head(){}
|
121 |
|
122 |
-
|
123 |
-
|
|
|
|
|
124 |
function page_help(){}
|
125 |
|
126 |
-
|
|
|
|
|
127 |
function page_header() {
|
128 |
echo "<div class='wrap'>\n";
|
129 |
screen_icon( $this->args['screen_icon'] );
|
130 |
-
echo html(
|
131 |
}
|
132 |
|
133 |
-
|
|
|
|
|
134 |
abstract function page_content();
|
135 |
|
136 |
-
|
|
|
|
|
137 |
function page_footer() {
|
138 |
echo "</div>\n";
|
139 |
}
|
140 |
|
141 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
142 |
function validate( $new_data, $old_data ) {
|
143 |
return $new_data;
|
144 |
}
|
145 |
|
146 |
-
|
|
|
|
|
|
|
|
|
147 |
function form_handler() {
|
148 |
-
if ( empty( $_POST['action'] ) )
|
149 |
return false;
|
150 |
|
151 |
check_admin_referer( $this->nonce );
|
152 |
|
153 |
if ( !isset($this->options) ) {
|
154 |
-
trigger_error('options handler not set', E_USER_WARNING);
|
155 |
return false;
|
156 |
}
|
157 |
|
@@ -163,11 +212,18 @@ abstract class scbAdminPage {
|
|
163 |
|
164 |
$this->options->set( $new_data );
|
165 |
|
166 |
-
$this
|
|
|
|
|
167 |
}
|
168 |
|
169 |
-
|
170 |
-
|
|
|
|
|
|
|
|
|
|
|
171 |
if ( empty( $msg ) )
|
172 |
$msg = __( 'Settings <strong>saved</strong>.', $this->textdomain );
|
173 |
|
@@ -178,52 +234,47 @@ abstract class scbAdminPage {
|
|
178 |
// ____________UTILITIES____________
|
179 |
|
180 |
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
if ( ! $ajax )
|
192 |
-
$class .= ' no-ajax';
|
193 |
-
}
|
194 |
-
else {
|
195 |
-
if ( empty( $value ) )
|
196 |
-
$value = __( 'Save Changes', $this->textdomain );
|
197 |
-
}
|
198 |
-
|
199 |
-
$input_args = array(
|
200 |
-
'type' => 'submit',
|
201 |
-
'name' => $action,
|
202 |
-
'value' => $value,
|
203 |
-
'extra' => '',
|
204 |
-
'desc' => false,
|
205 |
-
'wrap' => html( 'p class="submit"', scbForms::TOKEN )
|
206 |
-
);
|
207 |
|
208 |
-
|
209 |
-
|
|
|
|
|
|
|
|
|
210 |
|
211 |
-
return
|
212 |
}
|
213 |
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
227 |
function form_wrap( $content, $submit_button = true ) {
|
228 |
if ( is_array( $submit_button ) ) {
|
229 |
$content .= $this->submit_button( $submit_button );
|
@@ -231,15 +282,24 @@ abstract class scbAdminPage {
|
|
231 |
$content .= $this->submit_button();
|
232 |
} elseif ( false !== strpos( $submit_button, '<input' ) ) {
|
233 |
$content .= $submit_button;
|
|
|
|
|
234 |
} elseif ( false !== $submit_button ) {
|
235 |
$button_args = array_slice( func_get_args(), 1 );
|
236 |
-
$content
|
237 |
}
|
238 |
|
239 |
return scbForms::form_wrap( $content, $this->nonce );
|
240 |
}
|
241 |
|
242 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
243 |
function form_table( $rows, $formdata = false ) {
|
244 |
$output = '';
|
245 |
foreach ( $rows as $row )
|
@@ -250,7 +310,13 @@ abstract class scbAdminPage {
|
|
250 |
return $output;
|
251 |
}
|
252 |
|
253 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
254 |
function form_table_wrap( $content ) {
|
255 |
$output = $this->table_wrap( $content );
|
256 |
$output = $this->form_wrap( $output );
|
@@ -258,7 +324,14 @@ abstract class scbAdminPage {
|
|
258 |
return $output;
|
259 |
}
|
260 |
|
261 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
262 |
function table( $rows, $formdata = false ) {
|
263 |
$output = '';
|
264 |
foreach ( $rows as $row )
|
@@ -269,12 +342,28 @@ abstract class scbAdminPage {
|
|
269 |
return $output;
|
270 |
}
|
271 |
|
272 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
273 |
function table_row( $args, $formdata = false ) {
|
274 |
return $this->row_wrap( $args['title'], $this->input( $args, $formdata ) );
|
275 |
}
|
276 |
|
277 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
278 |
function __call( $method, $args ) {
|
279 |
if ( in_array( $method, array( 'input', 'form' ) ) ) {
|
280 |
if ( empty( $args[1] ) && isset( $this->options ) )
|
@@ -287,12 +376,24 @@ abstract class scbAdminPage {
|
|
287 |
return call_user_func_array( array( 'scbForms', $method ), $args );
|
288 |
}
|
289 |
|
290 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
291 |
function js_wrap( $string ) {
|
292 |
return html( "script type='text/javascript'", $string );
|
293 |
}
|
294 |
|
295 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
296 |
function css_wrap( $string ) {
|
297 |
return html( "style type='text/css'", $string );
|
298 |
}
|
@@ -301,15 +402,40 @@ abstract class scbAdminPage {
|
|
301 |
// ____________INTERNAL METHODS____________
|
302 |
|
303 |
|
304 |
-
|
|
|
|
|
305 |
function page_init() {
|
306 |
-
extract( $this->args );
|
307 |
|
308 |
-
if ( ! $toplevel ) {
|
309 |
-
$this->pagehook = add_submenu_page(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
310 |
} else {
|
311 |
-
$func = 'add_' . $toplevel . '_page';
|
312 |
-
$this->pagehook = $func(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
313 |
}
|
314 |
|
315 |
if ( ! $this->pagehook )
|
@@ -317,11 +443,6 @@ abstract class scbAdminPage {
|
|
317 |
|
318 |
add_action( 'load-' . $this->pagehook, array( $this, 'page_loaded' ) );
|
319 |
|
320 |
-
if ( $ajax_submit ) {
|
321 |
-
$this->ajax_response();
|
322 |
-
add_action( 'admin_footer', array( $this, 'ajax_submit' ), 20 );
|
323 |
-
}
|
324 |
-
|
325 |
add_action( 'admin_print_styles-' . $this->pagehook, array( $this, 'page_head' ) );
|
326 |
}
|
327 |
|
@@ -334,20 +455,22 @@ abstract class scbAdminPage {
|
|
334 |
trigger_error( 'Page title cannot be empty', E_USER_WARNING );
|
335 |
|
336 |
$this->args = wp_parse_args( $this->args, array(
|
337 |
-
'toplevel'
|
338 |
-
'position'
|
339 |
-
'icon_url'
|
340 |
-
'screen_icon'
|
341 |
-
'parent'
|
342 |
-
'capability'
|
343 |
-
'menu_title'
|
344 |
-
'page_slug'
|
345 |
-
'nonce'
|
346 |
-
'action_link'
|
347 |
-
'ajax_submit' => false,
|
348 |
'admin_action_priority' => 10,
|
349 |
) );
|
350 |
|
|
|
|
|
|
|
351 |
if ( empty( $this->args['page_slug'] ) )
|
352 |
$this->args['page_slug'] = sanitize_title_with_dashes( $this->args['menu_title'] );
|
353 |
|
@@ -355,6 +478,12 @@ abstract class scbAdminPage {
|
|
355 |
$this->nonce = $this->args['page_slug'];
|
356 |
}
|
357 |
|
|
|
|
|
|
|
|
|
|
|
|
|
358 |
function _contextual_help( $help, $screen ) {
|
359 |
if ( is_object( $screen ) )
|
360 |
$screen = $screen->id;
|
@@ -367,67 +496,17 @@ abstract class scbAdminPage {
|
|
367 |
return $help;
|
368 |
}
|
369 |
|
370 |
-
function ajax_response() {
|
371 |
-
if ( ! isset( $_POST['_ajax_submit'] ) || $_POST['_ajax_submit'] != $this->pagehook )
|
372 |
-
return;
|
373 |
-
|
374 |
-
$this->form_handler();
|
375 |
-
die;
|
376 |
-
}
|
377 |
-
|
378 |
-
function ajax_submit() {
|
379 |
-
global $page_hook;
|
380 |
-
|
381 |
-
if ( $page_hook != $this->pagehook )
|
382 |
-
return;
|
383 |
-
?>
|
384 |
-
<script type="text/javascript">
|
385 |
-
jQuery( document ).ready( function( $ ){
|
386 |
-
var $spinner = $( new Image() ).attr( 'src', '<?php echo admin_url( "images/wpspin_light.gif" ); ?>' );
|
387 |
-
|
388 |
-
$( ':submit' ).click( function( ev ){
|
389 |
-
var $submit = $( this );
|
390 |
-
var $form = $submit.parents( 'form' );
|
391 |
-
|
392 |
-
if ( $submit.hasClass( 'no-ajax' ) || $form.attr( 'method' ).toLowerCase() != 'post' )
|
393 |
-
return true;
|
394 |
-
|
395 |
-
var $this_spinner = $spinner.clone();
|
396 |
-
|
397 |
-
$submit.before( $this_spinner ).hide();
|
398 |
-
|
399 |
-
var data = $form.serializeArray();
|
400 |
-
data.push( {name: $submit.attr( 'name' ), value: $submit.val()} );
|
401 |
-
data.push( {name: '_ajax_submit', value: '<?php echo $this->pagehook; ?>'} );
|
402 |
-
|
403 |
-
$.post( location.href, data, function( response ){
|
404 |
-
var $prev = $( '.wrap > .updated, .wrap > .error' );
|
405 |
-
var $msg = $( response ).hide().insertAfter( $( '.wrap h2' ) );
|
406 |
-
if ( $prev.length > 0 )
|
407 |
-
$prev.fadeOut( 'slow', function(){ $msg.fadeIn( 'slow' ); } );
|
408 |
-
else
|
409 |
-
$msg.fadeIn( 'slow' );
|
410 |
-
|
411 |
-
$this_spinner.hide();
|
412 |
-
$submit.show();
|
413 |
-
} );
|
414 |
-
|
415 |
-
ev.stopPropagation();
|
416 |
-
ev.preventDefault();
|
417 |
-
} );
|
418 |
-
} );
|
419 |
-
</script>
|
420 |
-
<?php
|
421 |
-
}
|
422 |
-
|
423 |
function _page_content_hook() {
|
424 |
-
$this->form_handler();
|
425 |
-
|
426 |
$this->page_header();
|
427 |
$this->page_content();
|
428 |
$this->page_footer();
|
429 |
}
|
430 |
|
|
|
|
|
|
|
|
|
|
|
431 |
function _action_link( $links ) {
|
432 |
$url = add_query_arg( 'page', $this->args['page_slug'], admin_url( $this->args['parent'] ) );
|
433 |
|
1 |
<?php
|
2 |
|
3 |
+
/**
|
4 |
+
* Administration page base class
|
5 |
+
*/
|
6 |
abstract class scbAdminPage {
|
7 |
/** Page args
|
8 |
* $page_title string (mandatory)
|
9 |
* $parent (string) (default: options-general.php)
|
10 |
* $capability (string) (default: 'manage_options')
|
11 |
* $menu_title (string) (default: $page_title)
|
12 |
+
* $submenu_title (string) (default: $menu_title)
|
13 |
* $page_slug (string) (default: sanitized $page_title)
|
14 |
* $toplevel (string) If not empty, will create a new top level menu (for expected values see http://codex.wordpress.org/Administration_Menus#Using_add_submenu_page)
|
15 |
* - $icon_url (string) URL to an icon for the top level menu
|
42 |
|
43 |
private static $registered = array();
|
44 |
|
45 |
+
/**
|
46 |
+
* @param string $class
|
47 |
+
* @param string $file
|
48 |
+
* @param scbOptions $options
|
49 |
+
*
|
50 |
+
* @return bool
|
51 |
+
*/
|
52 |
static function register( $class, $file, $options = null ) {
|
53 |
if ( isset( self::$registered[$class] ) )
|
54 |
return false;
|
60 |
return true;
|
61 |
}
|
62 |
|
63 |
+
/**
|
64 |
+
* @param string $old_class
|
65 |
+
* @param string $new_class
|
66 |
+
*
|
67 |
+
* @return bool
|
68 |
+
*/
|
69 |
static function replace( $old_class, $new_class ) {
|
70 |
if ( ! isset( self::$registered[$old_class] ) )
|
71 |
return false;
|
76 |
return true;
|
77 |
}
|
78 |
|
79 |
+
/**
|
80 |
+
* @param string $class
|
81 |
+
*
|
82 |
+
* @return bool
|
83 |
+
*/
|
84 |
static function remove( $class ) {
|
85 |
if ( ! isset( self::$registered[$class] ) )
|
86 |
return false;
|
99 |
// ____________MAIN METHODS____________
|
100 |
|
101 |
|
102 |
+
/**
|
103 |
+
* Constructor
|
104 |
+
*
|
105 |
+
* @param string|bool $file
|
106 |
+
* @param scbOptions $options
|
107 |
+
*/
|
108 |
function __construct( $file = false, $options = null ) {
|
109 |
if ( is_a( $options, 'scbOptions' ) )
|
110 |
$this->options = $options;
|
114 |
|
115 |
if ( isset( $this->option_name ) ) {
|
116 |
add_action( 'admin_init', array( $this, 'option_init' ) );
|
117 |
+
add_action( 'admin_notices', 'settings_errors' );
|
|
|
118 |
}
|
119 |
|
120 |
add_action( 'admin_menu', array( $this, 'page_init' ), $this->args['admin_action_priority'] );
|
129 |
}
|
130 |
}
|
131 |
|
132 |
+
/**
|
133 |
+
* This is where all the page args can be set
|
134 |
+
*/
|
135 |
function setup(){}
|
136 |
|
137 |
/**
|
139 |
*
|
140 |
* Useful for calling $screen->add_help_tab() etc.
|
141 |
*/
|
142 |
+
function page_loaded() {
|
143 |
+
$this->form_handler();
|
144 |
+
}
|
145 |
|
146 |
+
/**
|
147 |
+
* This is where the css and js go
|
148 |
+
* Both wp_enqueue_*() and inline code can be added
|
149 |
+
*/
|
150 |
function page_head(){}
|
151 |
|
152 |
+
/**
|
153 |
+
* This is where the contextual help goes
|
154 |
+
* @return string
|
155 |
+
*/
|
156 |
function page_help(){}
|
157 |
|
158 |
+
/**
|
159 |
+
* A generic page header
|
160 |
+
*/
|
161 |
function page_header() {
|
162 |
echo "<div class='wrap'>\n";
|
163 |
screen_icon( $this->args['screen_icon'] );
|
164 |
+
echo html( 'h2', $this->args['page_title'] );
|
165 |
}
|
166 |
|
167 |
+
/**
|
168 |
+
* This is where the page content goes
|
169 |
+
*/
|
170 |
abstract function page_content();
|
171 |
|
172 |
+
/**
|
173 |
+
* A generic page footer
|
174 |
+
*/
|
175 |
function page_footer() {
|
176 |
echo "</div>\n";
|
177 |
}
|
178 |
|
179 |
+
/**
|
180 |
+
* This is where the form data should be validated
|
181 |
+
*
|
182 |
+
* @param array $new_data
|
183 |
+
* @param array $old_data
|
184 |
+
*
|
185 |
+
* @return array
|
186 |
+
*/
|
187 |
function validate( $new_data, $old_data ) {
|
188 |
return $new_data;
|
189 |
}
|
190 |
|
191 |
+
/**
|
192 |
+
* Manually handle option saving ( use Settings API instead )
|
193 |
+
*
|
194 |
+
* @return bool
|
195 |
+
*/
|
196 |
function form_handler() {
|
197 |
+
if ( empty( $_POST['submit'] ) && empty( $_POST['action'] ) )
|
198 |
return false;
|
199 |
|
200 |
check_admin_referer( $this->nonce );
|
201 |
|
202 |
if ( !isset($this->options) ) {
|
203 |
+
trigger_error( 'options handler not set', E_USER_WARNING );
|
204 |
return false;
|
205 |
}
|
206 |
|
212 |
|
213 |
$this->options->set( $new_data );
|
214 |
|
215 |
+
add_action( 'admin_notices', array( $this, 'admin_msg' ) );
|
216 |
+
|
217 |
+
return true;
|
218 |
}
|
219 |
|
220 |
+
/**
|
221 |
+
* Manually generate a standard admin notice ( use Settings API instead )
|
222 |
+
*
|
223 |
+
* @param string $msg
|
224 |
+
* @param string $class
|
225 |
+
*/
|
226 |
+
function admin_msg( $msg = '', $class = 'updated' ) {
|
227 |
if ( empty( $msg ) )
|
228 |
$msg = __( 'Settings <strong>saved</strong>.', $this->textdomain );
|
229 |
|
234 |
// ____________UTILITIES____________
|
235 |
|
236 |
|
237 |
+
/**
|
238 |
+
* Generates a form submit button
|
239 |
+
*
|
240 |
+
* @param string|array $value button text or array of arguments
|
241 |
+
* @param string $action
|
242 |
+
* @param string $class
|
243 |
+
*
|
244 |
+
* @return string
|
245 |
+
*/
|
246 |
+
function submit_button( $value = '', $action = 'submit', $class = 'button' ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
247 |
|
248 |
+
$args = is_array( $value ) ? $value : compact( 'value', 'action', 'class' );
|
249 |
+
$args = wp_parse_args( $args, array(
|
250 |
+
'value' => null,
|
251 |
+
'action' => $action,
|
252 |
+
'class' => $class,
|
253 |
+
) );
|
254 |
|
255 |
+
return get_submit_button( $args['value'], $args['class'], $args['action'] );
|
256 |
}
|
257 |
|
258 |
+
/**
|
259 |
+
* Mimics scbForms::form_wrap()
|
260 |
+
*
|
261 |
+
* $this->form_wrap( $content ); // generates a form with a default submit button
|
262 |
+
*
|
263 |
+
* $this->form_wrap( $content, false ); // generates a form with no submit button
|
264 |
+
*
|
265 |
+
* // the second argument is sent to submit_button()
|
266 |
+
* $this->form_wrap( $content, array(
|
267 |
+
* 'text' => 'Save changes',
|
268 |
+
* 'name' => 'action',
|
269 |
+
* ) );
|
270 |
+
*
|
271 |
+
* @see scbForms::form_wrap()
|
272 |
+
*
|
273 |
+
* @param string $content
|
274 |
+
* @param boolean|string|array $submit_button
|
275 |
+
*
|
276 |
+
* @return string
|
277 |
+
*/
|
278 |
function form_wrap( $content, $submit_button = true ) {
|
279 |
if ( is_array( $submit_button ) ) {
|
280 |
$content .= $this->submit_button( $submit_button );
|
282 |
$content .= $this->submit_button();
|
283 |
} elseif ( false !== strpos( $submit_button, '<input' ) ) {
|
284 |
$content .= $submit_button;
|
285 |
+
} elseif ( false !== strpos( $submit_button, '<button' ) ) {
|
286 |
+
$content .= $submit_button;
|
287 |
} elseif ( false !== $submit_button ) {
|
288 |
$button_args = array_slice( func_get_args(), 1 );
|
289 |
+
$content .= call_user_func_array( array( $this, 'submit_button' ), $button_args );
|
290 |
}
|
291 |
|
292 |
return scbForms::form_wrap( $content, $this->nonce );
|
293 |
}
|
294 |
|
295 |
+
/**
|
296 |
+
* Generates a table wrapped in a form
|
297 |
+
*
|
298 |
+
* @param array $rows
|
299 |
+
* @param array|boolean $formdata
|
300 |
+
*
|
301 |
+
* @return string
|
302 |
+
*/
|
303 |
function form_table( $rows, $formdata = false ) {
|
304 |
$output = '';
|
305 |
foreach ( $rows as $row )
|
310 |
return $output;
|
311 |
}
|
312 |
|
313 |
+
/**
|
314 |
+
* Wraps the given content in a <form><table>
|
315 |
+
*
|
316 |
+
* @param string $content
|
317 |
+
*
|
318 |
+
* @return string
|
319 |
+
*/
|
320 |
function form_table_wrap( $content ) {
|
321 |
$output = $this->table_wrap( $content );
|
322 |
$output = $this->form_wrap( $output );
|
324 |
return $output;
|
325 |
}
|
326 |
|
327 |
+
/**
|
328 |
+
* Generates a form table
|
329 |
+
*
|
330 |
+
* @param array $rows
|
331 |
+
* @param array|boolean $formdata
|
332 |
+
*
|
333 |
+
* @return string
|
334 |
+
*/
|
335 |
function table( $rows, $formdata = false ) {
|
336 |
$output = '';
|
337 |
foreach ( $rows as $row )
|
342 |
return $output;
|
343 |
}
|
344 |
|
345 |
+
/**
|
346 |
+
* Generates a table row
|
347 |
+
*
|
348 |
+
* @param array $args
|
349 |
+
* @param array|boolean $formdata
|
350 |
+
*
|
351 |
+
* @return string
|
352 |
+
*/
|
353 |
function table_row( $args, $formdata = false ) {
|
354 |
return $this->row_wrap( $args['title'], $this->input( $args, $formdata ) );
|
355 |
}
|
356 |
|
357 |
+
/**
|
358 |
+
* Mimic scbForms inheritance
|
359 |
+
*
|
360 |
+
* @see scbForms
|
361 |
+
*
|
362 |
+
* @param string $method
|
363 |
+
* @param array $args
|
364 |
+
*
|
365 |
+
* @return mixed
|
366 |
+
*/
|
367 |
function __call( $method, $args ) {
|
368 |
if ( in_array( $method, array( 'input', 'form' ) ) ) {
|
369 |
if ( empty( $args[1] ) && isset( $this->options ) )
|
376 |
return call_user_func_array( array( 'scbForms', $method ), $args );
|
377 |
}
|
378 |
|
379 |
+
/**
|
380 |
+
* Wraps a string in a <script> tag
|
381 |
+
*
|
382 |
+
* @param string $string
|
383 |
+
*
|
384 |
+
* @return string
|
385 |
+
*/
|
386 |
function js_wrap( $string ) {
|
387 |
return html( "script type='text/javascript'", $string );
|
388 |
}
|
389 |
|
390 |
+
/**
|
391 |
+
* Wraps a string in a <style> tag
|
392 |
+
*
|
393 |
+
* @param string $string
|
394 |
+
*
|
395 |
+
* @return string
|
396 |
+
*/
|
397 |
function css_wrap( $string ) {
|
398 |
return html( "style type='text/css'", $string );
|
399 |
}
|
402 |
// ____________INTERNAL METHODS____________
|
403 |
|
404 |
|
405 |
+
/**
|
406 |
+
* Registers a page
|
407 |
+
*/
|
408 |
function page_init() {
|
|
|
409 |
|
410 |
+
if ( ! $this->args['toplevel'] ) {
|
411 |
+
$this->pagehook = add_submenu_page(
|
412 |
+
$this->args['parent'],
|
413 |
+
$this->args['page_title'],
|
414 |
+
$this->args['menu_title'],
|
415 |
+
$this->args['capability'],
|
416 |
+
$this->args['page_slug'],
|
417 |
+
array( $this, '_page_content_hook' )
|
418 |
+
);
|
419 |
} else {
|
420 |
+
$func = 'add_' . $this->args['toplevel'] . '_page';
|
421 |
+
$this->pagehook = $func(
|
422 |
+
$this->args['page_title'],
|
423 |
+
$this->args['menu_title'],
|
424 |
+
$this->args['capability'],
|
425 |
+
$this->args['page_slug'],
|
426 |
+
null,
|
427 |
+
$this->args['icon_url'],
|
428 |
+
$this->args['position']
|
429 |
+
);
|
430 |
+
|
431 |
+
add_submenu_page(
|
432 |
+
$this->args['page_slug'],
|
433 |
+
$this->args['page_title'],
|
434 |
+
$this->args['submenu_title'],
|
435 |
+
$this->args['capability'],
|
436 |
+
$this->args['page_slug'],
|
437 |
+
array( $this, '_page_content_hook' )
|
438 |
+
);
|
439 |
}
|
440 |
|
441 |
if ( ! $this->pagehook )
|
443 |
|
444 |
add_action( 'load-' . $this->pagehook, array( $this, 'page_loaded' ) );
|
445 |
|
|
|
|
|
|
|
|
|
|
|
446 |
add_action( 'admin_print_styles-' . $this->pagehook, array( $this, 'page_head' ) );
|
447 |
}
|
448 |
|
455 |
trigger_error( 'Page title cannot be empty', E_USER_WARNING );
|
456 |
|
457 |
$this->args = wp_parse_args( $this->args, array(
|
458 |
+
'toplevel' => '',
|
459 |
+
'position' => null,
|
460 |
+
'icon_url' => '',
|
461 |
+
'screen_icon' => '',
|
462 |
+
'parent' => 'options-general.php',
|
463 |
+
'capability' => 'manage_options',
|
464 |
+
'menu_title' => $this->args['page_title'],
|
465 |
+
'page_slug' => '',
|
466 |
+
'nonce' => '',
|
467 |
+
'action_link' => __( 'Settings', $this->textdomain ),
|
|
|
468 |
'admin_action_priority' => 10,
|
469 |
) );
|
470 |
|
471 |
+
if ( empty( $this->args['submenu_title'] ) )
|
472 |
+
$this->args['submenu_title'] = $this->args['menu_title'];
|
473 |
+
|
474 |
if ( empty( $this->args['page_slug'] ) )
|
475 |
$this->args['page_slug'] = sanitize_title_with_dashes( $this->args['menu_title'] );
|
476 |
|
478 |
$this->nonce = $this->args['page_slug'];
|
479 |
}
|
480 |
|
481 |
+
/**
|
482 |
+
* @param string $help
|
483 |
+
* @param string|object $screen
|
484 |
+
*
|
485 |
+
* @return string
|
486 |
+
*/
|
487 |
function _contextual_help( $help, $screen ) {
|
488 |
if ( is_object( $screen ) )
|
489 |
$screen = $screen->id;
|
496 |
return $help;
|
497 |
}
|
498 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
499 |
function _page_content_hook() {
|
|
|
|
|
500 |
$this->page_header();
|
501 |
$this->page_content();
|
502 |
$this->page_footer();
|
503 |
}
|
504 |
|
505 |
+
/**
|
506 |
+
* @param array $links
|
507 |
+
*
|
508 |
+
* @return array
|
509 |
+
*/
|
510 |
function _action_link( $links ) {
|
511 |
$url = add_query_arg( 'page', $this->args['page_slug'], admin_url( $this->args['parent'] ) );
|
512 |
|
scb/BoxesPage.php
CHANGED
@@ -166,35 +166,55 @@ abstract class scbBoxesPage extends scbAdminPage {
|
|
166 |
) );
|
167 |
|
168 |
$registered = array();
|
|
|
169 |
foreach ( $this->boxes as $box_args ) {
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
|
|
|
|
|
|
|
|
|
|
174 |
|
175 |
-
|
176 |
-
|
177 |
-
if (
|
178 |
-
|
179 |
-
if ( empty( $priority ) )
|
180 |
-
$priority = 'default';
|
181 |
-
if ( empty( $args ) )
|
182 |
-
$args = array();
|
183 |
-
|
184 |
-
if ( isset( $registered[$name] ) ) {
|
185 |
-
if ( empty( $args ) )
|
186 |
trigger_error( "Duplicate box name: $name", E_USER_NOTICE );
|
|
|
187 |
|
188 |
$name = $this->_increment( $name );
|
189 |
} else {
|
190 |
-
$registered[$name] = true;
|
191 |
}
|
192 |
|
193 |
-
add_meta_box(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
194 |
}
|
195 |
}
|
196 |
|
197 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
198 |
function _intermediate_callback( $_, $box ) {
|
199 |
list( $name ) = explode( '-', $box['id'] );
|
200 |
|
166 |
) );
|
167 |
|
168 |
$registered = array();
|
169 |
+
|
170 |
foreach ( $this->boxes as $box_args ) {
|
171 |
+
$box_args = self::numeric_to_assoc( $box_args, array( 'name', 'title', 'context', 'priority', 'args' ) );
|
172 |
+
|
173 |
+
$defaults = array(
|
174 |
+
'title' => ucfirst( $box_args['name'] ),
|
175 |
+
'context' => 'normal',
|
176 |
+
'priority' => 'default',
|
177 |
+
'args' => array()
|
178 |
+
);
|
179 |
+
$box_args = array_merge( $defaults, $box_args );
|
180 |
|
181 |
+
$name = $box_args['name'];
|
182 |
+
|
183 |
+
if ( isset( $registered[ $name ] ) ) {
|
184 |
+
if ( empty( $box_args['args'] ) ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
185 |
trigger_error( "Duplicate box name: $name", E_USER_NOTICE );
|
186 |
+
}
|
187 |
|
188 |
$name = $this->_increment( $name );
|
189 |
} else {
|
190 |
+
$registered[ $name ] = true;
|
191 |
}
|
192 |
|
193 |
+
add_meta_box(
|
194 |
+
$name,
|
195 |
+
$box_args['title'],
|
196 |
+
array( $this, '_intermediate_callback' ),
|
197 |
+
$this->pagehook,
|
198 |
+
$box_args['context'],
|
199 |
+
$box_args['priority'],
|
200 |
+
$box_args['args']
|
201 |
+
);
|
202 |
}
|
203 |
}
|
204 |
|
205 |
+
private static function numeric_to_assoc( $argv, $keys ) {
|
206 |
+
$args = array();
|
207 |
+
|
208 |
+
foreach ( $keys as $i => $key ) {
|
209 |
+
if ( isset( $argv[ $i ] ) )
|
210 |
+
$args[ $key ] = $argv[ $i ];
|
211 |
+
}
|
212 |
+
|
213 |
+
return $args;
|
214 |
+
}
|
215 |
+
|
216 |
+
// Since we don't pass an object to do_meta_boxes(),
|
217 |
+
// pass $box['args'] directly to each method.
|
218 |
function _intermediate_callback( $_, $box ) {
|
219 |
list( $name ) = explode( '-', $box['id'] );
|
220 |
|
scb/Cron.php
CHANGED
@@ -1,7 +1,8 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
|
4 |
-
|
|
|
5 |
class scbCron {
|
6 |
protected $schedule;
|
7 |
protected $interval;
|
@@ -13,41 +14,40 @@ class scbCron {
|
|
13 |
/**
|
14 |
* Create a new cron job
|
15 |
*
|
16 |
-
* @param string Reference to main plugin file
|
17 |
-
* @param array List of args:
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
*/
|
22 |
function __construct( $file = false, $args ) {
|
23 |
-
extract( $args, EXTR_SKIP );
|
24 |
|
25 |
// Set time & schedule
|
26 |
-
if ( isset( $time ) )
|
27 |
-
$this->time = $time;
|
28 |
-
|
29 |
-
if ( isset( $interval ) ) {
|
30 |
-
$this->schedule = $interval . 'secs';
|
31 |
-
$this->interval = $interval;
|
32 |
-
} elseif ( isset( $schedule ) ) {
|
33 |
-
$this->schedule = $schedule;
|
34 |
}
|
35 |
|
36 |
// Set hook
|
37 |
-
if ( isset( $action ) ) {
|
38 |
-
$this->hook = $action;
|
39 |
-
} elseif ( isset( $callback ) ) {
|
40 |
-
$this->hook = self::_callback_to_string( $callback );
|
41 |
-
add_action( $this->hook, $callback );
|
42 |
} elseif ( method_exists( $this, 'callback' ) ) {
|
43 |
$this->hook = self::_callback_to_string( array( $this, 'callback' ) );
|
44 |
-
add_action( $this->hook, $callback );
|
45 |
} else {
|
46 |
trigger_error( '$action OR $callback not set', E_USER_WARNING );
|
47 |
}
|
48 |
|
49 |
-
if ( isset( $callback_args ) )
|
50 |
-
$this->callback_args = (array) $callback_args;
|
51 |
|
52 |
if ( $file && $this->schedule ) {
|
53 |
scbUtil::add_activation_hook( $file, array( $this, 'reset' ) );
|
@@ -57,23 +57,23 @@ class scbCron {
|
|
57 |
add_filter( 'cron_schedules', array( $this, '_add_timing' ) );
|
58 |
}
|
59 |
|
60 |
-
|
|
|
61 |
*
|
62 |
-
* @param array List of args:
|
63 |
-
|
64 |
-
|
65 |
*/
|
66 |
function reschedule( $args ) {
|
67 |
-
extract( $args );
|
68 |
|
69 |
-
if ( $schedule && $this->schedule != $schedule ) {
|
70 |
-
$this->schedule = $schedule;
|
71 |
-
} elseif ( $interval && $this->interval != $interval ) {
|
72 |
-
$this->schedule = $interval . 'secs';
|
73 |
-
$this->interval = $interval;
|
74 |
}
|
75 |
|
76 |
-
$this->time = $time;
|
77 |
|
78 |
$this->reset();
|
79 |
}
|
@@ -107,8 +107,8 @@ class scbCron {
|
|
107 |
|
108 |
/**
|
109 |
* Execute the job with a given delay
|
110 |
-
* @param int
|
111 |
-
* @param array $args
|
112 |
*/
|
113 |
function do_once( $delay = 0, $args = null ) {
|
114 |
if ( is_null( $args ) )
|
@@ -121,13 +121,19 @@ class scbCron {
|
|
121 |
|
122 |
//_____INTERNAL METHODS_____
|
123 |
|
124 |
-
|
|
|
|
|
|
|
|
|
125 |
function _add_timing( $schedules ) {
|
126 |
if ( isset( $schedules[$this->schedule] ) )
|
127 |
return $schedules;
|
128 |
|
129 |
-
$schedules[$this->schedule] = array(
|
130 |
-
'
|
|
|
|
|
131 |
|
132 |
return $schedules;
|
133 |
}
|
@@ -139,6 +145,9 @@ class scbCron {
|
|
139 |
wp_schedule_event( $this->time, $this->schedule, $this->hook, $this->callback_args );
|
140 |
}
|
141 |
|
|
|
|
|
|
|
142 |
protected static function really_clear_scheduled_hook( $name ) {
|
143 |
$crons = _get_cron_array();
|
144 |
|
@@ -147,13 +156,18 @@ class scbCron {
|
|
147 |
if ( $hook == $name )
|
148 |
unset( $crons[$timestamp][$hook] );
|
149 |
|
150 |
-
if ( empty( $
|
151 |
unset( $crons[$timestamp] );
|
152 |
}
|
153 |
|
154 |
_set_cron_array( $crons );
|
155 |
}
|
156 |
|
|
|
|
|
|
|
|
|
|
|
157 |
protected static function _callback_to_string( $callback ) {
|
158 |
if ( ! is_array( $callback ) )
|
159 |
$str = $callback;
|
1 |
<?php
|
2 |
|
3 |
+
/**
|
4 |
+
* wp-cron job container
|
5 |
+
*/
|
6 |
class scbCron {
|
7 |
protected $schedule;
|
8 |
protected $interval;
|
14 |
/**
|
15 |
* Create a new cron job
|
16 |
*
|
17 |
+
* @param string|bool $file Reference to main plugin file
|
18 |
+
* @param array $args List of args:
|
19 |
+
* string $action OR callback $callback
|
20 |
+
* string $schedule OR number $interval
|
21 |
+
* array $callback_args (optional)
|
22 |
*/
|
23 |
function __construct( $file = false, $args ) {
|
|
|
24 |
|
25 |
// Set time & schedule
|
26 |
+
if ( isset( $args['time'] ) )
|
27 |
+
$this->time = $args['time'];
|
28 |
+
|
29 |
+
if ( isset( $args['interval'] ) ) {
|
30 |
+
$this->schedule = $args['interval'] . 'secs';
|
31 |
+
$this->interval = $args['interval'];
|
32 |
+
} elseif ( isset( $args['schedule'] ) ) {
|
33 |
+
$this->schedule = $args['schedule'];
|
34 |
}
|
35 |
|
36 |
// Set hook
|
37 |
+
if ( isset( $args['action'] ) ) {
|
38 |
+
$this->hook = $args['action'];
|
39 |
+
} elseif ( isset( $args['callback'] ) ) {
|
40 |
+
$this->hook = self::_callback_to_string( $args['callback'] );
|
41 |
+
add_action( $this->hook, $args['callback'] );
|
42 |
} elseif ( method_exists( $this, 'callback' ) ) {
|
43 |
$this->hook = self::_callback_to_string( array( $this, 'callback' ) );
|
44 |
+
add_action( $this->hook, $args['callback'] );
|
45 |
} else {
|
46 |
trigger_error( '$action OR $callback not set', E_USER_WARNING );
|
47 |
}
|
48 |
|
49 |
+
if ( isset( $args['callback_args'] ) )
|
50 |
+
$this->callback_args = (array) $args['callback_args'];
|
51 |
|
52 |
if ( $file && $this->schedule ) {
|
53 |
scbUtil::add_activation_hook( $file, array( $this, 'reset' ) );
|
57 |
add_filter( 'cron_schedules', array( $this, '_add_timing' ) );
|
58 |
}
|
59 |
|
60 |
+
/**
|
61 |
+
* Change the interval of the cron job
|
62 |
*
|
63 |
+
* @param array $args List of args:
|
64 |
+
* string $schedule OR number $interval
|
65 |
+
* timestamp $time ( optional )
|
66 |
*/
|
67 |
function reschedule( $args ) {
|
|
|
68 |
|
69 |
+
if ( $args['schedule'] && $this->schedule != $args['schedule'] ) {
|
70 |
+
$this->schedule = $args['schedule'];
|
71 |
+
} elseif ( $args['interval'] && $this->interval != $args['interval'] ) {
|
72 |
+
$this->schedule = $args['interval'] . 'secs';
|
73 |
+
$this->interval = $args['interval'];
|
74 |
}
|
75 |
|
76 |
+
$this->time = $args['time'];
|
77 |
|
78 |
$this->reset();
|
79 |
}
|
107 |
|
108 |
/**
|
109 |
* Execute the job with a given delay
|
110 |
+
* @param int $delay in seconds
|
111 |
+
* @param array $args List of arguments to pass to the callback
|
112 |
*/
|
113 |
function do_once( $delay = 0, $args = null ) {
|
114 |
if ( is_null( $args ) )
|
121 |
|
122 |
//_____INTERNAL METHODS_____
|
123 |
|
124 |
+
/**
|
125 |
+
* @param array $schedules
|
126 |
+
*
|
127 |
+
* @return array
|
128 |
+
*/
|
129 |
function _add_timing( $schedules ) {
|
130 |
if ( isset( $schedules[$this->schedule] ) )
|
131 |
return $schedules;
|
132 |
|
133 |
+
$schedules[$this->schedule] = array(
|
134 |
+
'interval' => $this->interval,
|
135 |
+
'display' => $this->interval . ' seconds',
|
136 |
+
);
|
137 |
|
138 |
return $schedules;
|
139 |
}
|
145 |
wp_schedule_event( $this->time, $this->schedule, $this->hook, $this->callback_args );
|
146 |
}
|
147 |
|
148 |
+
/**
|
149 |
+
* @param string $name
|
150 |
+
*/
|
151 |
protected static function really_clear_scheduled_hook( $name ) {
|
152 |
$crons = _get_cron_array();
|
153 |
|
156 |
if ( $hook == $name )
|
157 |
unset( $crons[$timestamp][$hook] );
|
158 |
|
159 |
+
if ( empty( $crons[$timestamp] ) )
|
160 |
unset( $crons[$timestamp] );
|
161 |
}
|
162 |
|
163 |
_set_cron_array( $crons );
|
164 |
}
|
165 |
|
166 |
+
/**
|
167 |
+
* @param callback $callback
|
168 |
+
*
|
169 |
+
* @return string
|
170 |
+
*/
|
171 |
protected static function _callback_to_string( $callback ) {
|
172 |
if ( ! is_array( $callback ) )
|
173 |
$str = $callback;
|
scb/Forms.php
CHANGED
@@ -1,24 +1,44 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
|
4 |
-
|
|
|
5 |
class scbForms {
|
6 |
|
7 |
const TOKEN = '%input%';
|
8 |
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
static function input_with_value( $args, $value ) {
|
10 |
$field = scbFormField::create( $args );
|
11 |
|
12 |
return $field->render( $value );
|
13 |
}
|
14 |
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
static function input( $args, $formdata = null ) {
|
16 |
$field = scbFormField::create( $args );
|
17 |
|
18 |
return $field->render( scbForms::get_value( $args['name'], $formdata ) );
|
19 |
}
|
20 |
|
21 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
22 |
static function form_table( $rows, $formdata = null ) {
|
23 |
$output = '';
|
24 |
foreach ( $rows as $row )
|
@@ -29,7 +49,15 @@ class scbForms {
|
|
29 |
return $output;
|
30 |
}
|
31 |
|
32 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
33 |
static function form( $inputs, $formdata = null, $nonce ) {
|
34 |
$output = '';
|
35 |
foreach ( $inputs as $input )
|
@@ -40,7 +68,14 @@ class scbForms {
|
|
40 |
return $output;
|
41 |
}
|
42 |
|
43 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
44 |
static function table( $rows, $formdata = null ) {
|
45 |
$output = '';
|
46 |
foreach ( $rows as $row )
|
@@ -51,7 +86,14 @@ class scbForms {
|
|
51 |
return $output;
|
52 |
}
|
53 |
|
54 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
55 |
static function table_row( $args, $formdata = null ) {
|
56 |
return self::row_wrap( $args['title'], self::input( $args, $formdata ) );
|
57 |
}
|
@@ -59,11 +101,22 @@ class scbForms {
|
|
59 |
|
60 |
// ____________WRAPPERS____________
|
61 |
|
62 |
-
|
|
|
|
|
|
|
|
|
|
|
63 |
static function form_table_wrap( $content, $nonce = 'update_options' ) {
|
64 |
return self::form_wrap( self::table_wrap( $content ), $nonce );
|
65 |
}
|
66 |
|
|
|
|
|
|
|
|
|
|
|
|
|
67 |
static function form_wrap( $content, $nonce = 'update_options' ) {
|
68 |
return html( "form method='post' action=''",
|
69 |
$content,
|
@@ -71,14 +124,25 @@ class scbForms {
|
|
71 |
);
|
72 |
}
|
73 |
|
|
|
|
|
|
|
|
|
|
|
74 |
static function table_wrap( $content ) {
|
75 |
return html( "table class='form-table'", $content );
|
76 |
}
|
77 |
|
|
|
|
|
|
|
|
|
|
|
|
|
78 |
static function row_wrap( $title, $content ) {
|
79 |
-
return html(
|
80 |
html( "th scope='row'", $title ),
|
81 |
-
html(
|
82 |
);
|
83 |
}
|
84 |
|
@@ -111,9 +175,9 @@ class scbForms {
|
|
111 |
/**
|
112 |
* Traverses the formdata and retrieves the correct value.
|
113 |
*
|
114 |
-
* @param
|
115 |
-
* @param array
|
116 |
-
* @param mixed
|
117 |
*
|
118 |
* @return mixed
|
119 |
*/
|
@@ -131,8 +195,8 @@ class scbForms {
|
|
131 |
/**
|
132 |
* Given a list of fields, validate some data.
|
133 |
*
|
134 |
-
* @param array $fields
|
135 |
-
* @param array $data
|
136 |
* @param array $to_update Existing data to populate. Necessary for nested values
|
137 |
*
|
138 |
* @return array
|
@@ -161,8 +225,8 @@ class scbForms {
|
|
161 |
* For single-choice fields, we can't distinguish either, because of how self::update_meta() works.
|
162 |
* Therefore, the 'default' parameter is always ignored.
|
163 |
*
|
164 |
-
* @param array
|
165 |
-
* @param int
|
166 |
* @param string $meta_type
|
167 |
*
|
168 |
* @return string
|
@@ -178,6 +242,12 @@ class scbForms {
|
|
178 |
return self::input_with_value( $args, $value );
|
179 |
}
|
180 |
|
|
|
|
|
|
|
|
|
|
|
|
|
181 |
static function update_meta( $fields, $data, $object_id, $meta_type = 'post' ) {
|
182 |
foreach ( $fields as $field_args ) {
|
183 |
$key = $field_args['name'];
|
@@ -193,7 +263,7 @@ class scbForms {
|
|
193 |
foreach ( array_diff( $old_values, $new_values ) as $value )
|
194 |
delete_metadata( $meta_type, $object_id, $key, $value );
|
195 |
} else {
|
196 |
-
$value = $data[$key];
|
197 |
|
198 |
if ( '' === $value )
|
199 |
delete_metadata( $meta_type, $object_id, $key );
|
@@ -203,6 +273,11 @@ class scbForms {
|
|
203 |
}
|
204 |
}
|
205 |
|
|
|
|
|
|
|
|
|
|
|
206 |
private static function set_value( &$arr, $name, $value ) {
|
207 |
$name = (array) $name;
|
208 |
|
@@ -226,9 +301,13 @@ class scbForms {
|
|
226 |
* A wrapper for scbForms, containing the formdata
|
227 |
*/
|
228 |
class scbForm {
|
229 |
-
protected $data
|
230 |
protected $prefix = array();
|
231 |
|
|
|
|
|
|
|
|
|
232 |
function __construct( $data, $prefix = false ) {
|
233 |
if ( is_array( $data ) )
|
234 |
$this->data = $data;
|
@@ -237,6 +316,11 @@ class scbForm {
|
|
237 |
$this->prefix = (array) $prefix;
|
238 |
}
|
239 |
|
|
|
|
|
|
|
|
|
|
|
240 |
function traverse_to( $path ) {
|
241 |
$data = scbForms::get_value( $path, $this->data );
|
242 |
|
@@ -245,6 +329,11 @@ class scbForm {
|
|
245 |
return new scbForm( $data, $prefix );
|
246 |
}
|
247 |
|
|
|
|
|
|
|
|
|
|
|
248 |
function input( $args ) {
|
249 |
$value = scbForms::get_value( $args['name'], $this->data );
|
250 |
|
@@ -256,7 +345,9 @@ class scbForm {
|
|
256 |
}
|
257 |
}
|
258 |
|
259 |
-
|
|
|
|
|
260 |
interface scbFormField_I {
|
261 |
|
262 |
/**
|
@@ -278,11 +369,18 @@ interface scbFormField_I {
|
|
278 |
function validate( $value );
|
279 |
}
|
280 |
|
281 |
-
|
|
|
|
|
282 |
abstract class scbFormField implements scbFormField_I {
|
283 |
|
284 |
protected $args;
|
285 |
|
|
|
|
|
|
|
|
|
|
|
286 |
public static function create( $args ) {
|
287 |
if ( is_a( $args, 'scbFormField_I' ) )
|
288 |
return $args;
|
@@ -305,9 +403,9 @@ abstract class scbFormField implements scbFormField_I {
|
|
305 |
$args['extra'] = shortcode_parse_atts( $args['extra'] );
|
306 |
|
307 |
$args = wp_parse_args( $args, array(
|
308 |
-
'desc'
|
309 |
-
'desc_pos'
|
310 |
-
'wrap'
|
311 |
'wrap_each' => scbForms::TOKEN,
|
312 |
) );
|
313 |
|
@@ -332,18 +430,36 @@ abstract class scbFormField implements scbFormField_I {
|
|
332 |
}
|
333 |
}
|
334 |
|
|
|
|
|
|
|
335 |
protected function __construct( $args ) {
|
336 |
$this->args = $args;
|
337 |
}
|
338 |
|
|
|
|
|
|
|
|
|
|
|
339 |
public function __get( $key ) {
|
340 |
return $this->args[ $key ];
|
341 |
}
|
342 |
|
|
|
|
|
|
|
|
|
|
|
343 |
public function __isset( $key ) {
|
344 |
return isset( $this->args[ $key ] );
|
345 |
}
|
346 |
|
|
|
|
|
|
|
|
|
|
|
347 |
public function render( $value = null ) {
|
348 |
if ( null === $value && isset( $this->default ) )
|
349 |
$value = $this->default;
|
@@ -358,58 +474,89 @@ abstract class scbFormField implements scbFormField_I {
|
|
358 |
return str_replace( scbForms::TOKEN, $this->_render( $args ), $this->wrap );
|
359 |
}
|
360 |
|
361 |
-
|
|
|
|
|
|
|
|
|
|
|
362 |
abstract protected function _set_value( &$args, $value );
|
363 |
|
364 |
-
|
|
|
|
|
|
|
|
|
365 |
abstract protected function _render( $args );
|
366 |
|
367 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
368 |
protected static function _checkbox( $args ) {
|
369 |
$args = wp_parse_args( $args, array(
|
370 |
-
'value'
|
371 |
-
'desc'
|
372 |
'checked' => false,
|
373 |
-
'extra'
|
374 |
) );
|
375 |
|
376 |
-
|
377 |
-
$$key = &$val;
|
378 |
-
unset( $val );
|
379 |
|
380 |
-
$
|
381 |
-
|
382 |
-
if ( is_null( $desc ) && !is_bool( $value ) )
|
383 |
-
$desc = str_replace( '[]', '', $value );
|
384 |
|
385 |
return self::_input_gen( $args );
|
386 |
}
|
387 |
|
388 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
389 |
protected static function _input_gen( $args ) {
|
390 |
-
|
391 |
'value' => null,
|
392 |
-
'desc'
|
393 |
-
'extra' => array()
|
394 |
-
) )
|
395 |
|
396 |
-
$extra['name'] = $name;
|
397 |
|
398 |
-
if ( 'textarea' == $type ) {
|
399 |
-
$input = html( 'textarea', $extra, esc_textarea( $value ) );
|
400 |
} else {
|
401 |
-
$extra['value'] = $value;
|
402 |
-
$extra['type']
|
403 |
-
$input = html( 'input', $extra );
|
404 |
}
|
405 |
|
406 |
-
return self::add_label( $input, $desc, $desc_pos );
|
407 |
}
|
408 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
409 |
protected static function add_label( $input, $desc, $desc_pos ) {
|
410 |
return html( 'label', self::add_desc( $input, $desc, $desc_pos ) ) . "\n";
|
411 |
}
|
412 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
413 |
protected static function add_desc( $input, $desc, $desc_pos ) {
|
414 |
if ( empty( $desc ) )
|
415 |
return $input;
|
@@ -420,6 +567,9 @@ abstract class scbFormField implements scbFormField_I {
|
|
420 |
return $input . ' ' . $desc;
|
421 |
}
|
422 |
|
|
|
|
|
|
|
423 |
private static function _expand_choices( &$args ) {
|
424 |
$choices =& $args['choices'];
|
425 |
|
@@ -433,46 +583,70 @@ abstract class scbFormField implements scbFormField_I {
|
|
433 |
}
|
434 |
}
|
435 |
|
|
|
|
|
|
|
|
|
|
|
436 |
private static function is_associative( $array ) {
|
437 |
$keys = array_keys( $array );
|
438 |
return array_keys( $keys ) !== $keys;
|
439 |
}
|
440 |
}
|
441 |
|
442 |
-
|
|
|
|
|
443 |
class scbTextField extends scbFormField {
|
444 |
|
|
|
|
|
|
|
|
|
|
|
445 |
public function validate( $value ) {
|
446 |
-
$sanitize = isset( $this->sanitize ) ? $this->sanitize : '
|
447 |
|
448 |
return call_user_func( $sanitize, $value, $this );
|
449 |
}
|
450 |
|
|
|
|
|
|
|
|
|
|
|
451 |
protected function _render( $args ) {
|
452 |
$args = wp_parse_args( $args, array(
|
453 |
-
'value'
|
454 |
'desc_pos' => 'after',
|
455 |
-
'extra'
|
456 |
) );
|
457 |
|
458 |
-
|
459 |
-
|
460 |
-
unset( $val );
|
461 |
-
|
462 |
-
if ( !isset( $extra['id'] ) && !is_array( $name ) && false === strpos( $name, '[' ) )
|
463 |
-
$extra['id'] = $name;
|
464 |
|
465 |
return scbFormField::_input_gen( $args );
|
466 |
}
|
467 |
|
|
|
|
|
|
|
|
|
468 |
protected function _set_value( &$args, $value ) {
|
469 |
$args['value'] = $value;
|
470 |
}
|
471 |
}
|
472 |
|
473 |
-
|
|
|
|
|
474 |
abstract class scbSingleChoiceField extends scbFormField {
|
475 |
|
|
|
|
|
|
|
|
|
|
|
476 |
public function validate( $value ) {
|
477 |
if ( isset( $this->choices[ $value ] ) )
|
478 |
return $value;
|
@@ -480,189 +654,274 @@ abstract class scbSingleChoiceField extends scbFormField {
|
|
480 |
return null;
|
481 |
}
|
482 |
|
|
|
|
|
|
|
|
|
|
|
483 |
protected function _render( $args ) {
|
484 |
$args = wp_parse_args( $args, array(
|
485 |
-
'numeric'
|
486 |
-
'selected' => array( 'foo' ), // hack to make default blank
|
487 |
) );
|
488 |
|
|
|
|
|
|
|
|
|
|
|
|
|
489 |
return $this->_render_specific( $args );
|
490 |
}
|
491 |
|
|
|
|
|
|
|
|
|
492 |
protected function _set_value( &$args, $value ) {
|
493 |
$args['selected'] = $value;
|
494 |
}
|
495 |
|
|
|
|
|
|
|
|
|
|
|
496 |
abstract protected function _render_specific( $args );
|
497 |
}
|
498 |
|
499 |
-
|
|
|
|
|
500 |
class scbSelectField extends scbSingleChoiceField {
|
501 |
|
|
|
|
|
|
|
|
|
|
|
502 |
protected function _render_specific( $args ) {
|
503 |
-
|
504 |
-
'text'
|
505 |
-
'extra' => array()
|
506 |
-
) )
|
507 |
|
508 |
$options = array();
|
509 |
|
510 |
-
if ( false !== $text ) {
|
511 |
$options[] = array(
|
512 |
-
'value'
|
513 |
-
'selected' => ( $selected
|
514 |
-
'title'
|
515 |
);
|
516 |
}
|
517 |
|
518 |
-
foreach ( $choices as $value => $title ) {
|
|
|
|
|
519 |
$options[] = array(
|
520 |
-
'value'
|
521 |
-
'selected' => ( $value == $selected ),
|
522 |
-
'title'
|
523 |
);
|
524 |
}
|
525 |
|
526 |
$opts = '';
|
527 |
foreach ( $options as $option ) {
|
528 |
-
|
529 |
-
|
530 |
-
$opts .= html( 'option', compact( 'value', 'selected' ), $title );
|
531 |
}
|
532 |
|
533 |
-
$extra['name'] = $name;
|
534 |
|
535 |
-
$input = html( 'select', $extra, $opts );
|
536 |
|
537 |
-
return scbFormField::add_label( $input, $desc, $desc_pos );
|
538 |
}
|
539 |
}
|
540 |
|
541 |
-
|
|
|
|
|
542 |
class scbRadiosField extends scbSelectField {
|
543 |
|
|
|
|
|
|
|
|
|
|
|
544 |
protected function _render_specific( $args ) {
|
545 |
-
extract( $args );
|
546 |
|
547 |
-
if ( array( 'foo' )
|
548 |
// radio buttons should always have one option selected
|
549 |
-
$selected = key( $choices );
|
550 |
}
|
551 |
|
552 |
$opts = '';
|
553 |
-
foreach ( $choices as $value => $title ) {
|
|
|
|
|
554 |
$single_input = scbFormField::_checkbox( array(
|
555 |
-
'name'
|
556 |
-
'type'
|
557 |
-
'value'
|
558 |
-
'checked'
|
559 |
-
'desc'
|
560 |
-
'desc_pos' => 'after'
|
561 |
) );
|
562 |
|
563 |
-
$opts .= str_replace( scbForms::TOKEN, $single_input, $wrap_each );
|
564 |
}
|
565 |
|
566 |
-
return scbFormField::add_desc( $opts, $desc, $desc_pos );
|
567 |
}
|
568 |
}
|
569 |
|
570 |
-
|
|
|
|
|
571 |
class scbMultipleChoiceField extends scbFormField {
|
572 |
|
|
|
|
|
|
|
|
|
|
|
573 |
public function validate( $value ) {
|
574 |
return array_intersect( array_keys( $this->choices ), (array) $value );
|
575 |
}
|
576 |
|
|
|
|
|
|
|
|
|
|
|
577 |
protected function _render( $args ) {
|
578 |
$args = wp_parse_args( $args, array(
|
579 |
-
'numeric' => false,
|
580 |
'checked' => null,
|
581 |
) );
|
582 |
|
583 |
-
|
584 |
-
|
585 |
-
if ( !is_array( $checked ) )
|
586 |
-
$checked = array();
|
587 |
|
588 |
$opts = '';
|
589 |
-
foreach ( $choices as $value => $title ) {
|
590 |
$single_input = scbFormField::_checkbox( array(
|
591 |
-
'name'
|
592 |
-
'type'
|
593 |
-
'value'
|
594 |
-
'checked'
|
595 |
-
'desc'
|
596 |
-
'desc_pos' => 'after'
|
597 |
) );
|
598 |
|
599 |
-
$opts .= str_replace( scbForms::TOKEN, $single_input, $wrap_each );
|
600 |
}
|
601 |
|
602 |
-
return scbFormField::add_desc( $opts, $desc, $desc_pos );
|
603 |
}
|
604 |
|
|
|
|
|
|
|
|
|
605 |
protected function _set_value( &$args, $value ) {
|
606 |
$args['checked'] = (array) $value;
|
607 |
}
|
608 |
}
|
609 |
|
610 |
-
|
|
|
|
|
611 |
class scbSingleCheckboxField extends scbFormField {
|
612 |
|
|
|
|
|
|
|
|
|
|
|
613 |
public function validate( $value ) {
|
614 |
return (bool) $value;
|
615 |
}
|
616 |
|
|
|
|
|
|
|
|
|
|
|
617 |
protected function _render( $args ) {
|
618 |
$args = wp_parse_args( $args, array(
|
619 |
-
'value'
|
620 |
-
'desc'
|
621 |
'checked' => false,
|
622 |
-
'extra'
|
623 |
) );
|
624 |
|
625 |
-
|
626 |
-
$$key = &$val;
|
627 |
-
unset( $val );
|
628 |
|
629 |
-
$
|
630 |
-
|
631 |
-
if ( is_null( $desc ) && !is_bool( $value ) )
|
632 |
-
$desc = str_replace( '[]', '', $value );
|
633 |
|
634 |
return scbFormField::_input_gen( $args );
|
635 |
}
|
636 |
|
|
|
|
|
|
|
|
|
637 |
protected function _set_value( &$args, $value ) {
|
638 |
$args['checked'] = ( $value || ( isset( $args['value'] ) && $value == $args['value'] ) );
|
639 |
}
|
640 |
}
|
641 |
|
642 |
-
|
|
|
|
|
643 |
class scbCustomField implements scbFormField_I {
|
644 |
|
645 |
protected $args;
|
646 |
|
|
|
|
|
|
|
647 |
function __construct( $args ) {
|
648 |
$this->args = wp_parse_args( $args, array(
|
649 |
-
'render'
|
650 |
'sanitize' => 'wp_filter_kses',
|
651 |
) );
|
652 |
}
|
653 |
|
|
|
|
|
|
|
|
|
|
|
654 |
public function __get( $key ) {
|
655 |
return $this->args[ $key ];
|
656 |
}
|
657 |
|
|
|
|
|
|
|
|
|
|
|
658 |
public function __isset( $key ) {
|
659 |
return isset( $this->args[ $key ] );
|
660 |
}
|
661 |
|
|
|
|
|
|
|
|
|
|
|
662 |
public function render( $value = null ) {
|
663 |
return call_user_func( $this->render, $value, $this );
|
664 |
}
|
665 |
|
|
|
|
|
|
|
|
|
|
|
666 |
public function validate( $value ) {
|
667 |
return call_user_func( $this->sanitize, $value, $this );
|
668 |
}
|
1 |
<?php
|
2 |
|
3 |
+
/**
|
4 |
+
* Data-aware form generator
|
5 |
+
*/
|
6 |
class scbForms {
|
7 |
|
8 |
const TOKEN = '%input%';
|
9 |
|
10 |
+
/**
|
11 |
+
* @param array|scbFormField_I $args
|
12 |
+
* @param mixed $value
|
13 |
+
*
|
14 |
+
* @return string
|
15 |
+
*/
|
16 |
static function input_with_value( $args, $value ) {
|
17 |
$field = scbFormField::create( $args );
|
18 |
|
19 |
return $field->render( $value );
|
20 |
}
|
21 |
|
22 |
+
/**
|
23 |
+
* @param array|scbFormField_I $args
|
24 |
+
* @param array $formdata
|
25 |
+
*
|
26 |
+
* @return string
|
27 |
+
*/
|
28 |
static function input( $args, $formdata = null ) {
|
29 |
$field = scbFormField::create( $args );
|
30 |
|
31 |
return $field->render( scbForms::get_value( $args['name'], $formdata ) );
|
32 |
}
|
33 |
|
34 |
+
/**
|
35 |
+
* Generates a table wrapped in a form
|
36 |
+
*
|
37 |
+
* @param array $rows
|
38 |
+
* @param array $formdata
|
39 |
+
*
|
40 |
+
* @return string
|
41 |
+
*/
|
42 |
static function form_table( $rows, $formdata = null ) {
|
43 |
$output = '';
|
44 |
foreach ( $rows as $row )
|
49 |
return $output;
|
50 |
}
|
51 |
|
52 |
+
/**
|
53 |
+
* Generates a form
|
54 |
+
*
|
55 |
+
* @param array $inputs
|
56 |
+
* @param array $formdata
|
57 |
+
* @param string $nonce
|
58 |
+
*
|
59 |
+
* @return string
|
60 |
+
*/
|
61 |
static function form( $inputs, $formdata = null, $nonce ) {
|
62 |
$output = '';
|
63 |
foreach ( $inputs as $input )
|
68 |
return $output;
|
69 |
}
|
70 |
|
71 |
+
/**
|
72 |
+
* Generates a table
|
73 |
+
*
|
74 |
+
* @param array $rows
|
75 |
+
* @param array $formdata
|
76 |
+
*
|
77 |
+
* @return string
|
78 |
+
*/
|
79 |
static function table( $rows, $formdata = null ) {
|
80 |
$output = '';
|
81 |
foreach ( $rows as $row )
|
86 |
return $output;
|
87 |
}
|
88 |
|
89 |
+
/**
|
90 |
+
* Generates a table row
|
91 |
+
*
|
92 |
+
* @param array $args
|
93 |
+
* @param array $formdata
|
94 |
+
*
|
95 |
+
* @return string
|
96 |
+
*/
|
97 |
static function table_row( $args, $formdata = null ) {
|
98 |
return self::row_wrap( $args['title'], self::input( $args, $formdata ) );
|
99 |
}
|
101 |
|
102 |
// ____________WRAPPERS____________
|
103 |
|
104 |
+
/**
|
105 |
+
* @param string $content
|
106 |
+
* @param string $nonce
|
107 |
+
*
|
108 |
+
* @return string
|
109 |
+
*/
|
110 |
static function form_table_wrap( $content, $nonce = 'update_options' ) {
|
111 |
return self::form_wrap( self::table_wrap( $content ), $nonce );
|
112 |
}
|
113 |
|
114 |
+
/**
|
115 |
+
* @param string $content
|
116 |
+
* @param string $nonce
|
117 |
+
*
|
118 |
+
* @return string
|
119 |
+
*/
|
120 |
static function form_wrap( $content, $nonce = 'update_options' ) {
|
121 |
return html( "form method='post' action=''",
|
122 |
$content,
|
124 |
);
|
125 |
}
|
126 |
|
127 |
+
/**
|
128 |
+
* @param string $content
|
129 |
+
*
|
130 |
+
* @return string
|
131 |
+
*/
|
132 |
static function table_wrap( $content ) {
|
133 |
return html( "table class='form-table'", $content );
|
134 |
}
|
135 |
|
136 |
+
/**
|
137 |
+
* @param string $title
|
138 |
+
* @param string $content
|
139 |
+
*
|
140 |
+
* @return string
|
141 |
+
*/
|
142 |
static function row_wrap( $title, $content ) {
|
143 |
+
return html( 'tr',
|
144 |
html( "th scope='row'", $title ),
|
145 |
+
html( 'td', $content )
|
146 |
);
|
147 |
}
|
148 |
|
175 |
/**
|
176 |
* Traverses the formdata and retrieves the correct value.
|
177 |
*
|
178 |
+
* @param string $name The name of the value
|
179 |
+
* @param array $value The data that will be traversed
|
180 |
+
* @param mixed $fallback The value returned when the key is not found
|
181 |
*
|
182 |
* @return mixed
|
183 |
*/
|
195 |
/**
|
196 |
* Given a list of fields, validate some data.
|
197 |
*
|
198 |
+
* @param array $fields List of args that would be sent to scbForms::input()
|
199 |
+
* @param array $data The data to validate. Defaults to $_POST
|
200 |
* @param array $to_update Existing data to populate. Necessary for nested values
|
201 |
*
|
202 |
* @return array
|
225 |
* For single-choice fields, we can't distinguish either, because of how self::update_meta() works.
|
226 |
* Therefore, the 'default' parameter is always ignored.
|
227 |
*
|
228 |
+
* @param array $args Field arguments.
|
229 |
+
* @param int $object_id The object ID the metadata is attached to
|
230 |
* @param string $meta_type
|
231 |
*
|
232 |
* @return string
|
242 |
return self::input_with_value( $args, $value );
|
243 |
}
|
244 |
|
245 |
+
/**
|
246 |
+
* @param array $fields
|
247 |
+
* @param array $data
|
248 |
+
* @param int $object_id
|
249 |
+
* @param string $meta_type
|
250 |
+
*/
|
251 |
static function update_meta( $fields, $data, $object_id, $meta_type = 'post' ) {
|
252 |
foreach ( $fields as $field_args ) {
|
253 |
$key = $field_args['name'];
|
263 |
foreach ( array_diff( $old_values, $new_values ) as $value )
|
264 |
delete_metadata( $meta_type, $object_id, $key, $value );
|
265 |
} else {
|
266 |
+
$value = isset( $data[$key] ) ? $data[$key] : '';
|
267 |
|
268 |
if ( '' === $value )
|
269 |
delete_metadata( $meta_type, $object_id, $key );
|
273 |
}
|
274 |
}
|
275 |
|
276 |
+
/**
|
277 |
+
* @param array $arr
|
278 |
+
* @param string $name
|
279 |
+
* @param mixed $value
|
280 |
+
*/
|
281 |
private static function set_value( &$arr, $name, $value ) {
|
282 |
$name = (array) $name;
|
283 |
|
301 |
* A wrapper for scbForms, containing the formdata
|
302 |
*/
|
303 |
class scbForm {
|
304 |
+
protected $data = array();
|
305 |
protected $prefix = array();
|
306 |
|
307 |
+
/**
|
308 |
+
* @param array $data
|
309 |
+
* @param string|boolean $prefix
|
310 |
+
*/
|
311 |
function __construct( $data, $prefix = false ) {
|
312 |
if ( is_array( $data ) )
|
313 |
$this->data = $data;
|
316 |
$this->prefix = (array) $prefix;
|
317 |
}
|
318 |
|
319 |
+
/**
|
320 |
+
* @param string $path
|
321 |
+
*
|
322 |
+
* @return scbForm
|
323 |
+
*/
|
324 |
function traverse_to( $path ) {
|
325 |
$data = scbForms::get_value( $path, $this->data );
|
326 |
|
329 |
return new scbForm( $data, $prefix );
|
330 |
}
|
331 |
|
332 |
+
/**
|
333 |
+
* @param array $args
|
334 |
+
*
|
335 |
+
* @return string
|
336 |
+
*/
|
337 |
function input( $args ) {
|
338 |
$value = scbForms::get_value( $args['name'], $this->data );
|
339 |
|
345 |
}
|
346 |
}
|
347 |
|
348 |
+
/**
|
349 |
+
* Interface for form fields.
|
350 |
+
*/
|
351 |
interface scbFormField_I {
|
352 |
|
353 |
/**
|
369 |
function validate( $value );
|
370 |
}
|
371 |
|
372 |
+
/**
|
373 |
+
* Base class for form fields implementations.
|
374 |
+
*/
|
375 |
abstract class scbFormField implements scbFormField_I {
|
376 |
|
377 |
protected $args;
|
378 |
|
379 |
+
/**
|
380 |
+
* @param array|scbFormField_I $args
|
381 |
+
*
|
382 |
+
* @return mixed false on failure or instance of form class
|
383 |
+
*/
|
384 |
public static function create( $args ) {
|
385 |
if ( is_a( $args, 'scbFormField_I' ) )
|
386 |
return $args;
|
403 |
$args['extra'] = shortcode_parse_atts( $args['extra'] );
|
404 |
|
405 |
$args = wp_parse_args( $args, array(
|
406 |
+
'desc' => '',
|
407 |
+
'desc_pos' => 'after',
|
408 |
+
'wrap' => scbForms::TOKEN,
|
409 |
'wrap_each' => scbForms::TOKEN,
|
410 |
) );
|
411 |
|
430 |
}
|
431 |
}
|
432 |
|
433 |
+
/**
|
434 |
+
* @param array $args
|
435 |
+
*/
|
436 |
protected function __construct( $args ) {
|
437 |
$this->args = $args;
|
438 |
}
|
439 |
|
440 |
+
/**
|
441 |
+
* @param string $key
|
442 |
+
*
|
443 |
+
* @return mixed
|
444 |
+
*/
|
445 |
public function __get( $key ) {
|
446 |
return $this->args[ $key ];
|
447 |
}
|
448 |
|
449 |
+
/**
|
450 |
+
* @param string $key
|
451 |
+
*
|
452 |
+
* @return bool
|
453 |
+
*/
|
454 |
public function __isset( $key ) {
|
455 |
return isset( $this->args[ $key ] );
|
456 |
}
|
457 |
|
458 |
+
/**
|
459 |
+
* @param mixed $value
|
460 |
+
*
|
461 |
+
* @return string
|
462 |
+
*/
|
463 |
public function render( $value = null ) {
|
464 |
if ( null === $value && isset( $this->default ) )
|
465 |
$value = $this->default;
|
474 |
return str_replace( scbForms::TOKEN, $this->_render( $args ), $this->wrap );
|
475 |
}
|
476 |
|
477 |
+
/**
|
478 |
+
* Mutate the field arguments so that the value passed is rendered.
|
479 |
+
*
|
480 |
+
* @param array $args
|
481 |
+
* @param mixed $value
|
482 |
+
*/
|
483 |
abstract protected function _set_value( &$args, $value );
|
484 |
|
485 |
+
/**
|
486 |
+
* The actual rendering
|
487 |
+
*
|
488 |
+
* @param array $args
|
489 |
+
*/
|
490 |
abstract protected function _render( $args );
|
491 |
|
492 |
+
/**
|
493 |
+
* Handle args for a single checkbox or radio input
|
494 |
+
*
|
495 |
+
* @param array $args
|
496 |
+
*
|
497 |
+
* @return string
|
498 |
+
*/
|
499 |
protected static function _checkbox( $args ) {
|
500 |
$args = wp_parse_args( $args, array(
|
501 |
+
'value' => true,
|
502 |
+
'desc' => null,
|
503 |
'checked' => false,
|
504 |
+
'extra' => array(),
|
505 |
) );
|
506 |
|
507 |
+
$args['extra']['checked'] = $args['checked'];
|
|
|
|
|
508 |
|
509 |
+
if ( is_null( $args['desc'] ) && ! is_bool( $args['value'] ) )
|
510 |
+
$args['desc'] = str_replace( '[]', '', $args['value'] );
|
|
|
|
|
511 |
|
512 |
return self::_input_gen( $args );
|
513 |
}
|
514 |
|
515 |
+
/**
|
516 |
+
* Generate html with the final args
|
517 |
+
*
|
518 |
+
* @param array $args
|
519 |
+
*
|
520 |
+
* @return string
|
521 |
+
*/
|
522 |
protected static function _input_gen( $args ) {
|
523 |
+
$args = wp_parse_args( $args, array(
|
524 |
'value' => null,
|
525 |
+
'desc' => null,
|
526 |
+
'extra' => array(),
|
527 |
+
) );
|
528 |
|
529 |
+
$args['extra']['name'] = $args['name'];
|
530 |
|
531 |
+
if ( 'textarea' == $args['type'] ) {
|
532 |
+
$input = html( 'textarea', $args['extra'], esc_textarea( $args['value'] ) );
|
533 |
} else {
|
534 |
+
$args['extra']['value'] = $args['value'];
|
535 |
+
$args['extra']['type'] = $args['type'];
|
536 |
+
$input = html( 'input', $args['extra'] );
|
537 |
}
|
538 |
|
539 |
+
return self::add_label( $input, $args['desc'], $args['desc_pos'] );
|
540 |
}
|
541 |
|
542 |
+
/**
|
543 |
+
* @param string $input
|
544 |
+
* @param string $desc
|
545 |
+
* @param string $desc_pos
|
546 |
+
*
|
547 |
+
* @return string
|
548 |
+
*/
|
549 |
protected static function add_label( $input, $desc, $desc_pos ) {
|
550 |
return html( 'label', self::add_desc( $input, $desc, $desc_pos ) ) . "\n";
|
551 |
}
|
552 |
|
553 |
+
/**
|
554 |
+
* @param string $input
|
555 |
+
* @param string $desc
|
556 |
+
* @param string $desc_pos
|
557 |
+
*
|
558 |
+
* @return string
|
559 |
+
*/
|
560 |
protected static function add_desc( $input, $desc, $desc_pos ) {
|
561 |
if ( empty( $desc ) )
|
562 |
return $input;
|
567 |
return $input . ' ' . $desc;
|
568 |
}
|
569 |
|
570 |
+
/**
|
571 |
+
* @param array $args
|
572 |
+
*/
|
573 |
private static function _expand_choices( &$args ) {
|
574 |
$choices =& $args['choices'];
|
575 |
|
583 |
}
|
584 |
}
|
585 |
|
586 |
+
/**
|
587 |
+
* @param array $array
|
588 |
+
*
|
589 |
+
* @return bool
|
590 |
+
*/
|
591 |
private static function is_associative( $array ) {
|
592 |
$keys = array_keys( $array );
|
593 |
return array_keys( $keys ) !== $keys;
|
594 |
}
|
595 |
}
|
596 |
|
597 |
+
/**
|
598 |
+
* Text form field.
|
599 |
+
*/
|
600 |
class scbTextField extends scbFormField {
|
601 |
|
602 |
+
/**
|
603 |
+
* @param string $value
|
604 |
+
*
|
605 |
+
* @return string
|
606 |
+
*/
|
607 |
public function validate( $value ) {
|
608 |
+
$sanitize = isset( $this->sanitize ) ? $this->sanitize : 'wp_kses_data';
|
609 |
|
610 |
return call_user_func( $sanitize, $value, $this );
|
611 |
}
|
612 |
|
613 |
+
/**
|
614 |
+
* @param array $args
|
615 |
+
*
|
616 |
+
* @return string
|
617 |
+
*/
|
618 |
protected function _render( $args ) {
|
619 |
$args = wp_parse_args( $args, array(
|
620 |
+
'value' => '',
|
621 |
'desc_pos' => 'after',
|
622 |
+
'extra' => array( 'class' => 'regular-text' ),
|
623 |
) );
|
624 |
|
625 |
+
if ( ! isset( $args['extra']['id'] ) && ! is_array( $args['name'] ) && false === strpos( $args['name'], '[' ) )
|
626 |
+
$args['extra']['id'] = $args['name'];
|
|
|
|
|
|
|
|
|
627 |
|
628 |
return scbFormField::_input_gen( $args );
|
629 |
}
|
630 |
|
631 |
+
/**
|
632 |
+
* @param array $args
|
633 |
+
* @param string $value
|
634 |
+
*/
|
635 |
protected function _set_value( &$args, $value ) {
|
636 |
$args['value'] = $value;
|
637 |
}
|
638 |
}
|
639 |
|
640 |
+
/**
|
641 |
+
* Base class for form fields with single choice.
|
642 |
+
*/
|
643 |
abstract class scbSingleChoiceField extends scbFormField {
|
644 |
|
645 |
+
/**
|
646 |
+
* @param mixed $value
|
647 |
+
*
|
648 |
+
* @return mixed|null
|
649 |
+
*/
|
650 |
public function validate( $value ) {
|
651 |
if ( isset( $this->choices[ $value ] ) )
|
652 |
return $value;
|
654 |
return null;
|
655 |
}
|
656 |
|
657 |
+
/**
|
658 |
+
* @param array $args
|
659 |
+
*
|
660 |
+
* @return string
|
661 |
+
*/
|
662 |
protected function _render( $args ) {
|
663 |
$args = wp_parse_args( $args, array(
|
664 |
+
'numeric' => false, // use numeric array instead of associative
|
|
|
665 |
) );
|
666 |
|
667 |
+
if ( isset( $args['selected'] ) ) {
|
668 |
+
$args['selected'] = (string) $args['selected'];
|
669 |
+
} else {
|
670 |
+
$args['selected'] = array('foo'); // hack to make default blank
|
671 |
+
}
|
672 |
+
|
673 |
return $this->_render_specific( $args );
|
674 |
}
|
675 |
|
676 |
+
/**
|
677 |
+
* @param array $args
|
678 |
+
* @param mixed $value
|
679 |
+
*/
|
680 |
protected function _set_value( &$args, $value ) {
|
681 |
$args['selected'] = $value;
|
682 |
}
|
683 |
|
684 |
+
/**
|
685 |
+
* @param array $args
|
686 |
+
*
|
687 |
+
* @return string
|
688 |
+
*/
|
689 |
abstract protected function _render_specific( $args );
|
690 |
}
|
691 |
|
692 |
+
/**
|
693 |
+
* Dropdown field.
|
694 |
+
*/
|
695 |
class scbSelectField extends scbSingleChoiceField {
|
696 |
|
697 |
+
/**
|
698 |
+
* @param array $args
|
699 |
+
*
|
700 |
+
* @return string
|
701 |
+
*/
|
702 |
protected function _render_specific( $args ) {
|
703 |
+
$args = wp_parse_args( $args, array(
|
704 |
+
'text' => false,
|
705 |
+
'extra' => array(),
|
706 |
+
) );
|
707 |
|
708 |
$options = array();
|
709 |
|
710 |
+
if ( false !== $args['text'] ) {
|
711 |
$options[] = array(
|
712 |
+
'value' => '',
|
713 |
+
'selected' => ( $args['selected'] === array( 'foo' ) ),
|
714 |
+
'title' => $args['text'],
|
715 |
);
|
716 |
}
|
717 |
|
718 |
+
foreach ( $args['choices'] as $value => $title ) {
|
719 |
+
$value = (string) $value;
|
720 |
+
|
721 |
$options[] = array(
|
722 |
+
'value' => $value,
|
723 |
+
'selected' => ( $value == $args['selected'] ),
|
724 |
+
'title' => $title,
|
725 |
);
|
726 |
}
|
727 |
|
728 |
$opts = '';
|
729 |
foreach ( $options as $option ) {
|
730 |
+
$opts .= html( 'option', array( 'value' => $option['value'], 'selected' => $option['selected'] ), $option['title'] );
|
|
|
|
|
731 |
}
|
732 |
|
733 |
+
$args['extra']['name'] = $args['name'];
|
734 |
|
735 |
+
$input = html( 'select', $args['extra'], $opts );
|
736 |
|
737 |
+
return scbFormField::add_label( $input, $args['desc'], $args['desc_pos'] );
|
738 |
}
|
739 |
}
|
740 |
|
741 |
+
/**
|
742 |
+
* Radio field.
|
743 |
+
*/
|
744 |
class scbRadiosField extends scbSelectField {
|
745 |
|
746 |
+
/**
|
747 |
+
* @param array $args
|
748 |
+
*
|
749 |
+
* @return string
|
750 |
+
*/
|
751 |
protected function _render_specific( $args ) {
|
|
|
752 |
|
753 |
+
if ( array( 'foo' ) === $args['selected'] ) {
|
754 |
// radio buttons should always have one option selected
|
755 |
+
$args['selected'] = key( $args['choices'] );
|
756 |
}
|
757 |
|
758 |
$opts = '';
|
759 |
+
foreach ( $args['choices'] as $value => $title ) {
|
760 |
+
$value = (string) $value;
|
761 |
+
|
762 |
$single_input = scbFormField::_checkbox( array(
|
763 |
+
'name' => $args['name'],
|
764 |
+
'type' => 'radio',
|
765 |
+
'value' => $value,
|
766 |
+
'checked' => ( $value == $args['selected'] ),
|
767 |
+
'desc' => $title,
|
768 |
+
'desc_pos' => 'after',
|
769 |
) );
|
770 |
|
771 |
+
$opts .= str_replace( scbForms::TOKEN, $single_input, $args['wrap_each'] );
|
772 |
}
|
773 |
|
774 |
+
return scbFormField::add_desc( $opts, $args['desc'], $args['desc_pos'] );
|
775 |
}
|
776 |
}
|
777 |
|
778 |
+
/**
|
779 |
+
* Checkbox field with multiple choices.
|
780 |
+
*/
|
781 |
class scbMultipleChoiceField extends scbFormField {
|
782 |
|
783 |
+
/**
|
784 |
+
* @param mixed $value
|
785 |
+
*
|
786 |
+
* @return array
|
787 |
+
*/
|
788 |
public function validate( $value ) {
|
789 |
return array_intersect( array_keys( $this->choices ), (array) $value );
|
790 |
}
|
791 |
|
792 |
+
/**
|
793 |
+
* @param array $args
|
794 |
+
*
|
795 |
+
* @return string
|
796 |
+
*/
|
797 |
protected function _render( $args ) {
|
798 |
$args = wp_parse_args( $args, array(
|
799 |
+
'numeric' => false, // use numeric array instead of associative
|
800 |
'checked' => null,
|
801 |
) );
|
802 |
|
803 |
+
if ( ! is_array( $args['checked'] ) )
|
804 |
+
$args['checked'] = array();
|
|
|
|
|
805 |
|
806 |
$opts = '';
|
807 |
+
foreach ( $args['choices'] as $value => $title ) {
|
808 |
$single_input = scbFormField::_checkbox( array(
|
809 |
+
'name' => $args['name'] . '[]',
|
810 |
+
'type' => 'checkbox',
|
811 |
+
'value' => $value,
|
812 |
+
'checked' => in_array( $value, $args['checked'] ),
|
813 |
+
'desc' => $title,
|
814 |
+
'desc_pos' => 'after',
|
815 |
) );
|
816 |
|
817 |
+
$opts .= str_replace( scbForms::TOKEN, $single_input, $args['wrap_each'] );
|
818 |
}
|
819 |
|
820 |
+
return scbFormField::add_desc( $opts, $args['desc'], $args['desc_pos'] );
|
821 |
}
|
822 |
|
823 |
+
/**
|
824 |
+
* @param array $args
|
825 |
+
* @param mixed $value
|
826 |
+
*/
|
827 |
protected function _set_value( &$args, $value ) {
|
828 |
$args['checked'] = (array) $value;
|
829 |
}
|
830 |
}
|
831 |
|
832 |
+
/**
|
833 |
+
* Checkbox field.
|
834 |
+
*/
|
835 |
class scbSingleCheckboxField extends scbFormField {
|
836 |
|
837 |
+
/**
|
838 |
+
* @param mixed $value
|
839 |
+
*
|
840 |
+
* @return boolean
|
841 |
+
*/
|
842 |
public function validate( $value ) {
|
843 |
return (bool) $value;
|
844 |
}
|
845 |
|
846 |
+
/**
|
847 |
+
* @param array $args
|
848 |
+
*
|
849 |
+
* @return string
|
850 |
+
*/
|
851 |
protected function _render( $args ) {
|
852 |
$args = wp_parse_args( $args, array(
|
853 |
+
'value' => true,
|
854 |
+
'desc' => null,
|
855 |
'checked' => false,
|
856 |
+
'extra' => array(),
|
857 |
) );
|
858 |
|
859 |
+
$args['extra']['checked'] = $args['checked'];
|
|
|
|
|
860 |
|
861 |
+
if ( is_null( $args['desc'] ) && ! is_bool( $args['value'] ) )
|
862 |
+
$args['desc'] = str_replace( '[]', '', $args['value'] );
|
|
|
|
|
863 |
|
864 |
return scbFormField::_input_gen( $args );
|
865 |
}
|
866 |
|
867 |
+
/**
|
868 |
+
* @param array $args
|
869 |
+
* @param mixed $value
|
870 |
+
*/
|
871 |
protected function _set_value( &$args, $value ) {
|
872 |
$args['checked'] = ( $value || ( isset( $args['value'] ) && $value == $args['value'] ) );
|
873 |
}
|
874 |
}
|
875 |
|
876 |
+
/**
|
877 |
+
* Wrapper field for custom callbacks.
|
878 |
+
*/
|
879 |
class scbCustomField implements scbFormField_I {
|
880 |
|
881 |
protected $args;
|
882 |
|
883 |
+
/**
|
884 |
+
* @param array $args
|
885 |
+
*/
|
886 |
function __construct( $args ) {
|
887 |
$this->args = wp_parse_args( $args, array(
|
888 |
+
'render' => 'var_dump',
|
889 |
'sanitize' => 'wp_filter_kses',
|
890 |
) );
|
891 |
}
|
892 |
|
893 |
+
/**
|
894 |
+
* @param string $key
|
895 |
+
*
|
896 |
+
* @return mixed
|
897 |
+
*/
|
898 |
public function __get( $key ) {
|
899 |
return $this->args[ $key ];
|
900 |
}
|
901 |
|
902 |
+
/**
|
903 |
+
* @param string $key
|
904 |
+
*
|
905 |
+
* @return boolean
|
906 |
+
*/
|
907 |
public function __isset( $key ) {
|
908 |
return isset( $this->args[ $key ] );
|
909 |
}
|
910 |
|
911 |
+
/**
|
912 |
+
* @param mixed $value
|
913 |
+
*
|
914 |
+
* @return string
|
915 |
+
*/
|
916 |
public function render( $value = null ) {
|
917 |
return call_user_func( $this->render, $value, $this );
|
918 |
}
|
919 |
|
920 |
+
/**
|
921 |
+
* @param mixed $value
|
922 |
+
*
|
923 |
+
* @return mixed
|
924 |
+
*/
|
925 |
public function validate( $value ) {
|
926 |
return call_user_func( $this->sanitize, $value, $this );
|
927 |
}
|
scb/Options.php
CHANGED
File without changes
|
scb/PostMetabox.php
ADDED
@@ -0,0 +1,182 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class scbPostMetabox {
|
4 |
+
|
5 |
+
private $id, $title;
|
6 |
+
|
7 |
+
private $post_types;
|
8 |
+
|
9 |
+
private $post_data = array();
|
10 |
+
|
11 |
+
protected $actions = array( 'admin_enqueue_scripts', 'post_updated_messages' );
|
12 |
+
|
13 |
+
public function __construct( $id, $title, $args = array() ) {
|
14 |
+
$this->id = $id;
|
15 |
+
$this->title = $title;
|
16 |
+
|
17 |
+
$args = wp_parse_args( $args, array(
|
18 |
+
'post_type' => 'post',
|
19 |
+
'context' => 'advanced',
|
20 |
+
'priority' => 'default'
|
21 |
+
) );
|
22 |
+
|
23 |
+
if ( is_string( $args['post_type'] ) )
|
24 |
+
$args['post_type'] = array( $args['post_type'] );
|
25 |
+
$this->post_types = $args['post_type'];
|
26 |
+
|
27 |
+
$this->context = $args['context'];
|
28 |
+
$this->priority = $args['priority'];
|
29 |
+
|
30 |
+
add_action( 'load-post.php', array( $this, 'pre_register' ) );
|
31 |
+
add_action( 'load-post-new.php', array( $this, 'pre_register' ) );
|
32 |
+
}
|
33 |
+
|
34 |
+
final public function pre_register() {
|
35 |
+
if ( ! in_array( get_current_screen()->post_type, $this->post_types ) )
|
36 |
+
return;
|
37 |
+
|
38 |
+
if ( ! $this->condition() )
|
39 |
+
return;
|
40 |
+
|
41 |
+
if ( isset( $_GET['post'] ) )
|
42 |
+
$this->post_data = $this->get_meta( intval( $_GET['post'] ) );
|
43 |
+
|
44 |
+
add_action( 'add_meta_boxes', array( $this, 'register' ) );
|
45 |
+
add_action( 'save_post', array( $this, '_save_post' ), 10, 2 );
|
46 |
+
|
47 |
+
foreach ( $this->actions as $action ) {
|
48 |
+
if ( method_exists( $this, $action ) )
|
49 |
+
add_action( $action, array( $this, $action ) );
|
50 |
+
}
|
51 |
+
}
|
52 |
+
|
53 |
+
// Additional checks before registering the metabox
|
54 |
+
protected function condition() {
|
55 |
+
return true;
|
56 |
+
}
|
57 |
+
|
58 |
+
final public function register() {
|
59 |
+
add_meta_box( $this->id, $this->title, array( $this, 'display' ), null, $this->context, $this->priority );
|
60 |
+
}
|
61 |
+
|
62 |
+
public function before_display( $form_data, $post ) {
|
63 |
+
return $form_data;
|
64 |
+
}
|
65 |
+
|
66 |
+
public function display( $post ) {
|
67 |
+
$form_fields = $this->form_fields();
|
68 |
+
if ( ! $form_fields )
|
69 |
+
return;
|
70 |
+
|
71 |
+
$form_data = $this->post_data;
|
72 |
+
$error_fields = array();
|
73 |
+
|
74 |
+
if ( isset( $form_data['_error_data_' . $this->id ] ) ) {
|
75 |
+
$data = maybe_unserialize( $form_data['_error_data_' . $this->id ] );
|
76 |
+
|
77 |
+
$error_fields = $data['fields'];
|
78 |
+
$form_data = $data['data'];
|
79 |
+
}
|
80 |
+
|
81 |
+
$form_data = $this->before_display( $form_data, $post );
|
82 |
+
|
83 |
+
$this->before_form( $post );
|
84 |
+
echo $this->table( $form_fields, $form_data, $error_fields );
|
85 |
+
$this->after_form( $post );
|
86 |
+
|
87 |
+
delete_post_meta( $post->ID, '_error_data_' . $this->id );
|
88 |
+
}
|
89 |
+
|
90 |
+
public function table( $rows, $formdata, $errors = array() ) {
|
91 |
+
$output = '';
|
92 |
+
foreach ( $rows as $row ) {
|
93 |
+
$output .= $this->table_row( $row, $formdata, $errors );
|
94 |
+
}
|
95 |
+
|
96 |
+
$output = scbForms::table_wrap( $output );
|
97 |
+
|
98 |
+
return $output;
|
99 |
+
}
|
100 |
+
|
101 |
+
public function table_row( $row, $formdata, $errors = array() ) {
|
102 |
+
$input = scbForms::input( $row, $formdata );
|
103 |
+
|
104 |
+
// If row has an error, highlight it
|
105 |
+
$style = ( in_array( $row['name'], $errors ) ) ? 'style= "background-color: #FFCCCC"' : '';
|
106 |
+
|
107 |
+
return html( 'tr',
|
108 |
+
html( "th $style scope='row'", $row['title'] ),
|
109 |
+
html( "td $style", $input )
|
110 |
+
);
|
111 |
+
}
|
112 |
+
|
113 |
+
// Display some extra HTML before the form
|
114 |
+
public function before_form( $post ) { }
|
115 |
+
|
116 |
+
// Return the list of form fields
|
117 |
+
public function form_fields() {
|
118 |
+
return array();
|
119 |
+
}
|
120 |
+
|
121 |
+
// Display some extra HTML after the form
|
122 |
+
public function after_form( $post ) { }
|
123 |
+
|
124 |
+
// Makes sure that the saving occurs only for the post being edited
|
125 |
+
final public function _save_post( $post_id, $post ) {
|
126 |
+
if ( ! isset( $_POST['action'] ) || $_POST['action'] != 'editpost' )
|
127 |
+
return;
|
128 |
+
|
129 |
+
if ( $post_id != $_POST['post_ID'] )
|
130 |
+
return;
|
131 |
+
|
132 |
+
if ( ! in_array( $post->post_type, $this->post_types ) )
|
133 |
+
return;
|
134 |
+
|
135 |
+
$this->save( $post->ID );
|
136 |
+
}
|
137 |
+
|
138 |
+
protected function save( $post_id ) {
|
139 |
+
$form_fields = $this->form_fields();
|
140 |
+
|
141 |
+
$to_update = scbForms::validate_post_data( $form_fields );
|
142 |
+
|
143 |
+
// Filter data
|
144 |
+
$to_update = $this->before_save( $to_update, $post_id );
|
145 |
+
|
146 |
+
// Validate dataset
|
147 |
+
$is_valid = $this->validate_post_data( $to_update, $post_id );
|
148 |
+
if ( $is_valid instanceof WP_Error && $is_valid->get_error_codes() ) {
|
149 |
+
|
150 |
+
$error_data = array(
|
151 |
+
'fields' => $is_valid->get_error_codes(),
|
152 |
+
'data' => $to_update
|
153 |
+
);
|
154 |
+
update_post_meta( $post_id, '_error_data_' . $this->id, $error_data );
|
155 |
+
|
156 |
+
$location = add_query_arg( 'message', 1, get_edit_post_link( $post_id, 'url' ) );
|
157 |
+
wp_redirect( apply_filters( 'redirect_post_location', $location, $post_id ) );
|
158 |
+
exit;
|
159 |
+
}
|
160 |
+
|
161 |
+
foreach ( $to_update as $key => $value ) {
|
162 |
+
update_post_meta( $post_id, $key, $value );
|
163 |
+
}
|
164 |
+
}
|
165 |
+
|
166 |
+
protected function before_save( $post_data, $post_id ) {
|
167 |
+
return $post_data;
|
168 |
+
}
|
169 |
+
|
170 |
+
protected function validate_post_data( $post_data, $post_id ) {
|
171 |
+
return false;
|
172 |
+
}
|
173 |
+
|
174 |
+
private function get_meta( $post_id ) {
|
175 |
+
$meta = get_post_custom( $post_id );
|
176 |
+
foreach ( $meta as $key => $values )
|
177 |
+
$meta[ $key ] = maybe_unserialize( $meta[ $key ][0] );
|
178 |
+
|
179 |
+
return $meta;
|
180 |
+
}
|
181 |
+
}
|
182 |
+
|
scb/Table.php
CHANGED
@@ -29,50 +29,3 @@ class scbTable {
|
|
29 |
}
|
30 |
}
|
31 |
|
32 |
-
/**
|
33 |
-
* Register a table with $wpdb
|
34 |
-
*
|
35 |
-
* @param string $key The key to be used on the $wpdb object
|
36 |
-
* @param string $name The actual name of the table, without $wpdb->prefix
|
37 |
-
*/
|
38 |
-
function scb_register_table( $key, $name = false ) {
|
39 |
-
global $wpdb;
|
40 |
-
|
41 |
-
if ( !$name )
|
42 |
-
$name = $key;
|
43 |
-
|
44 |
-
$wpdb->tables[] = $name;
|
45 |
-
$wpdb->$key = $wpdb->prefix . $name;
|
46 |
-
}
|
47 |
-
|
48 |
-
function scb_install_table( $key, $columns, $upgrade_method = 'dbDelta' ) {
|
49 |
-
global $wpdb;
|
50 |
-
|
51 |
-
$full_table_name = $wpdb->$key;
|
52 |
-
|
53 |
-
$charset_collate = '';
|
54 |
-
if ( $wpdb->has_cap( 'collation' ) ) {
|
55 |
-
if ( ! empty( $wpdb->charset ) )
|
56 |
-
$charset_collate = "DEFAULT CHARACTER SET $wpdb->charset";
|
57 |
-
if ( ! empty( $wpdb->collate ) )
|
58 |
-
$charset_collate .= " COLLATE $wpdb->collate";
|
59 |
-
}
|
60 |
-
|
61 |
-
if ( 'dbDelta' == $upgrade_method ) {
|
62 |
-
require_once ABSPATH . 'wp-admin/includes/upgrade.php';
|
63 |
-
dbDelta( "CREATE TABLE $full_table_name ( $columns ) $charset_collate" );
|
64 |
-
return;
|
65 |
-
}
|
66 |
-
|
67 |
-
if ( 'delete_first' == $upgrade_method )
|
68 |
-
$wpdb->query( "DROP TABLE IF EXISTS $full_table_name;" );
|
69 |
-
|
70 |
-
$wpdb->query( "CREATE TABLE IF NOT EXISTS $full_table_name ( $columns ) $charset_collate;" );
|
71 |
-
}
|
72 |
-
|
73 |
-
function scb_uninstall_table( $key ) {
|
74 |
-
global $wpdb;
|
75 |
-
|
76 |
-
$wpdb->query( "DROP TABLE IF EXISTS " . $wpdb->$key );
|
77 |
-
}
|
78 |
-
|
29 |
}
|
30 |
}
|
31 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
scb/Util.php
CHANGED
@@ -28,7 +28,9 @@ class scbUtil {
|
|
28 |
$content = str_replace( array( "'", "\n" ), array( '"', '' ), ob_get_clean() );
|
29 |
|
30 |
echo "<script type='text/javascript'>\n";
|
|
|
31 |
echo "jQuery(function ($) { $('head').prepend('$content'); });\n";
|
|
|
32 |
echo "</script>";
|
33 |
}
|
34 |
|
@@ -137,6 +139,93 @@ function scb_list_fold( $list, $key, $value ) {
|
|
137 |
return $r;
|
138 |
}
|
139 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
140 |
|
141 |
//_____Minimalist HTML framework_____
|
142 |
|
@@ -187,6 +276,18 @@ function html_link( $url, $title = '' ) {
|
|
187 |
}
|
188 |
endif;
|
189 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
190 |
|
191 |
//_____Compatibility layer_____
|
192 |
|
28 |
$content = str_replace( array( "'", "\n" ), array( '"', '' ), ob_get_clean() );
|
29 |
|
30 |
echo "<script type='text/javascript'>\n";
|
31 |
+
echo "//<![CDATA[";
|
32 |
echo "jQuery(function ($) { $('head').prepend('$content'); });\n";
|
33 |
+
echo "//]]>";
|
34 |
echo "</script>";
|
35 |
}
|
36 |
|
139 |
return $r;
|
140 |
}
|
141 |
|
142 |
+
/**
|
143 |
+
* Splits a list into sets, grouped by the result of running each value through $fn.
|
144 |
+
*
|
145 |
+
* @param array List of items to be partitioned
|
146 |
+
* @param callback Function that takes an element and returns a string key
|
147 |
+
*/
|
148 |
+
function scb_list_group_by( $list, $fn ) {
|
149 |
+
$groups = array();
|
150 |
+
|
151 |
+
foreach ( $list as $item ) {
|
152 |
+
$key = call_user_func( $fn, $item );
|
153 |
+
|
154 |
+
if ( null === $key )
|
155 |
+
continue;
|
156 |
+
|
157 |
+
$groups[ $key ][] = $item;
|
158 |
+
}
|
159 |
+
|
160 |
+
return $groups;
|
161 |
+
}
|
162 |
+
|
163 |
+
//_____Database Table Utilities_____
|
164 |
+
|
165 |
+
/**
|
166 |
+
* Register a table with $wpdb
|
167 |
+
*
|
168 |
+
* @param string $key The key to be used on the $wpdb object
|
169 |
+
* @param string $name The actual name of the table, without $wpdb->prefix
|
170 |
+
*/
|
171 |
+
function scb_register_table( $key, $name = false ) {
|
172 |
+
global $wpdb;
|
173 |
+
|
174 |
+
if ( !$name )
|
175 |
+
$name = $key;
|
176 |
+
|
177 |
+
$wpdb->tables[] = $name;
|
178 |
+
$wpdb->$key = $wpdb->prefix . $name;
|
179 |
+
}
|
180 |
+
|
181 |
+
/**
|
182 |
+
* Runs the SQL query for installing/upgrading a table
|
183 |
+
*
|
184 |
+
* @param string $key The key used in scb_register_table()
|
185 |
+
* @param string $columns The SQL columns for the CREATE TABLE statement
|
186 |
+
* @param array $opts Various other options
|
187 |
+
*/
|
188 |
+
function scb_install_table( $key, $columns, $opts = array() ) {
|
189 |
+
global $wpdb;
|
190 |
+
|
191 |
+
$full_table_name = $wpdb->$key;
|
192 |
+
|
193 |
+
if ( is_string( $opts ) ) {
|
194 |
+
$opts = array( 'upgrade_method' => $opts );
|
195 |
+
}
|
196 |
+
|
197 |
+
$opts = wp_parse_args( $opts, array(
|
198 |
+
'upgrade_method' => 'dbDelta',
|
199 |
+
'table_options' => '',
|
200 |
+
) );
|
201 |
+
|
202 |
+
$charset_collate = '';
|
203 |
+
if ( $wpdb->has_cap( 'collation' ) ) {
|
204 |
+
if ( ! empty( $wpdb->charset ) )
|
205 |
+
$charset_collate = "DEFAULT CHARACTER SET $wpdb->charset";
|
206 |
+
if ( ! empty( $wpdb->collate ) )
|
207 |
+
$charset_collate .= " COLLATE $wpdb->collate";
|
208 |
+
}
|
209 |
+
|
210 |
+
$table_options = $charset_collate . ' ' . $opts['table_options'];
|
211 |
+
|
212 |
+
if ( 'dbDelta' == $opts['upgrade_method'] ) {
|
213 |
+
require_once ABSPATH . 'wp-admin/includes/upgrade.php';
|
214 |
+
dbDelta( "CREATE TABLE $full_table_name ( $columns ) $table_options" );
|
215 |
+
return;
|
216 |
+
}
|
217 |
+
|
218 |
+
if ( 'delete_first' == $opts['upgrade_method'] )
|
219 |
+
$wpdb->query( "DROP TABLE IF EXISTS $full_table_name;" );
|
220 |
+
|
221 |
+
$wpdb->query( "CREATE TABLE IF NOT EXISTS $full_table_name ( $columns ) $table_options;" );
|
222 |
+
}
|
223 |
+
|
224 |
+
function scb_uninstall_table( $key ) {
|
225 |
+
global $wpdb;
|
226 |
+
|
227 |
+
$wpdb->query( "DROP TABLE IF EXISTS " . $wpdb->$key );
|
228 |
+
}
|
229 |
|
230 |
//_____Minimalist HTML framework_____
|
231 |
|
276 |
}
|
277 |
endif;
|
278 |
|
279 |
+
function scb_get_query_flags( $wp_query = null ) {
|
280 |
+
if ( !$wp_query )
|
281 |
+
$wp_query = $GLOBALS['wp_query'];
|
282 |
+
|
283 |
+
$flags = array();
|
284 |
+
foreach ( get_object_vars( $wp_query ) as $key => $val ) {
|
285 |
+
if ( 'is_' == substr( $key, 0, 3 ) && $val )
|
286 |
+
$flags[] = substr( $key, 3 );
|
287 |
+
}
|
288 |
+
|
289 |
+
return $flags;
|
290 |
+
}
|
291 |
|
292 |
//_____Compatibility layer_____
|
293 |
|
scb/composer.json
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"name" : "scribu/scb-framework",
|
3 |
+
"description": "A set of useful classes for faster plugin development",
|
4 |
+
"keywords" : ["wordpress"],
|
5 |
+
"homepage" : "https://github.com/scribu/wp-scb-framework",
|
6 |
+
"license" : "GPL-3.0+",
|
7 |
+
"authors" : [
|
8 |
+
{
|
9 |
+
"name" : "Cristi Burcă",
|
10 |
+
"homepage": "http://scribu.net/"
|
11 |
+
}
|
12 |
+
],
|
13 |
+
"support" : {
|
14 |
+
"issues": "https://github.com/scribu/wp-scb-framework/issues",
|
15 |
+
"source": "https://github.com/scribu/wp-scb-framework",
|
16 |
+
"wiki": "https://github.com/scribu/wp-scb-framework/wiki"
|
17 |
+
},
|
18 |
+
"autoload" : {
|
19 |
+
"classmap": ["."],
|
20 |
+
"files" : ["load-composer.php", "Util.php"]
|
21 |
+
}
|
22 |
+
}
|
scb/load-composer.php
ADDED
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Pass through version to use when Composer handles classes load.
|
5 |
+
*
|
6 |
+
* @param callable $callback
|
7 |
+
*/
|
8 |
+
function scb_init( $callback = null ) {
|
9 |
+
if ( $callback )
|
10 |
+
call_user_func( $callback );
|
11 |
+
}
|
scb/load.php
CHANGED
@@ -1,8 +1,8 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
$GLOBALS['_scb_data'] = array(
|
4 |
'scbUtil', 'scbOptions', 'scbForms', 'scbTable',
|
5 |
-
'scbWidget', 'scbAdminPage', 'scbBoxesPage',
|
6 |
'scbCron', 'scbHooks',
|
7 |
) );
|
8 |
|
1 |
<?php
|
2 |
|
3 |
+
$GLOBALS['_scb_data'] = array( 60, __FILE__, array(
|
4 |
'scbUtil', 'scbOptions', 'scbForms', 'scbTable',
|
5 |
+
'scbWidget', 'scbAdminPage', 'scbBoxesPage', 'scbPostMetabox',
|
6 |
'scbCron', 'scbHooks',
|
7 |
) );
|
8 |
|
screenshot-1.png
DELETED
Binary file
|
screenshot-2.png
DELETED
Binary file
|
wp-pagenavi.php
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?php
|
2 |
/*
|
3 |
Plugin Name: WP-PageNavi
|
4 |
-
Version: 2.
|
5 |
Description: Adds a more advanced paging navigation to your WordPress blog
|
6 |
Author: Lester 'GaMerZ' Chan & scribu
|
7 |
Plugin URI: http://wordpress.org/extend/plugins/wp-pagenavi/
|
1 |
<?php
|
2 |
/*
|
3 |
Plugin Name: WP-PageNavi
|
4 |
+
Version: 2.85
|
5 |
Description: Adds a more advanced paging navigation to your WordPress blog
|
6 |
Author: Lester 'GaMerZ' Chan & scribu
|
7 |
Plugin URI: http://wordpress.org/extend/plugins/wp-pagenavi/
|