Version Description
- Changes to support Weaver Xtreme Version 2.0 (for alpha test versions)
Download this release
Release Info
Developer | wpweaver |
Plugin | Weaver Xtreme Theme Support |
Version | 1.9 |
Comparing to | |
See all releases |
Code changes from version 1.3 to 1.9
- admin/admin-advancedopts.php +332 -0
- admin/admin-help.php +105 -0
- admin/admin-mainopts.php +1381 -0
- admin/admin-page-posts.php +34 -0
- admin/admin-plus.php +247 -0
- admin/admin-sapi-lib.php +351 -0
- admin/admin-saverestore.php +274 -0
- admin/admin-subthemes.php +240 -0
- admin/admin-top.php +227 -0
- admin/assets/css/admin-style-rtl.css +6 -0
- admin/assets/css/admin-style-rtl.min.css +1 -0
- admin/assets/css/admin-style.css +276 -0
- admin/assets/css/admin-style.min.css +7 -0
- admin/assets/css/customizer.css +29 -0
- admin/assets/css/customizer.min.css +1 -0
- admin/assets/js/jscolor/arrow.gif +0 -0
- admin/assets/js/jscolor/cross.gif +0 -0
- admin/assets/js/jscolor/demo.html +12 -0
- admin/assets/js/jscolor/hs.png +0 -0
- admin/assets/js/jscolor/hv.png +0 -0
- admin/assets/js/jscolor/jscolor.js +1010 -0
- admin/assets/js/theme/hide-css.js +16 -0
- admin/assets/js/theme/hide-css.min.js +1 -0
- admin/assets/js/theme/media-lib.js +22 -0
- admin/assets/js/theme/media-lib.min.js +1 -0
- admin/assets/js/yetii/bsdlicense.txt +29 -0
- admin/assets/js/yetii/html5.min.js +8 -0
- admin/assets/js/yetii/yetii.js +207 -0
- admin/assets/js/yetii/yetii.min.js +4 -0
- admin/class-tgm-plugin-activation.php +3625 -0
- admin/customizer.php +20 -0
- admin/lib-admin-part2.php +6 -0
- admin/lib-admin.php +1553 -0
- admin/load-weaverx-admin.php +100 -0
- includes/wvrx-ts-admin-page-posts.php +157 -157
- includes/wvrx-ts-runtime-lib.php +57 -57
- includes/wvrx-ts-shortcodes.php +11 -11
- includes/wvrx-ts-widgets.php +10 -10
- readme.txt +12 -1
- weaverx-ts-style.css +12 -0
- weaverx-ts-style.min.css +1 -1
- weaverx-ts.php +40 -32
admin/admin-advancedopts.php
ADDED
@@ -0,0 +1,332 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
if ( !defined('ABSPATH')) exit; // Exit if accessed directly
|
3 |
+
/* Weaver Xtreme - admin Advanced Options
|
4 |
+
*
|
5 |
+
* __ added: 12/9/14
|
6 |
+
*/
|
7 |
+
|
8 |
+
function weaverx_admin_advancedopts() {
|
9 |
+
?>
|
10 |
+
<div id="tabwrap_adv" style="padding-left:5px;">
|
11 |
+
<div id="tab-container-adv" class='yetiisub'>
|
12 |
+
<ul id="tab-container-adv-nav" class='yetiisub'>
|
13 |
+
<?php if (weaverx_allow_multisite()) {
|
14 |
+
|
15 |
+
weaverx_elink('#asptab0', __('Insert custom HTML, scripts, and CSS into <HEAD> section', 'weaver-xtreme' /*adm*/), __('<HEAD> Section', 'weaver-xtreme' /*adm*/), '<li>','</li>');
|
16 |
+
weaverx_elink('#asptab1', __('Insert custom HTML into several different page areas', 'weaver-xtreme' /*adm*/), __('HTML Insertion', 'weaver-xtreme' /*adm*/), '<li>','</li>');
|
17 |
+
}
|
18 |
+
weaverx_elink('#asptab3', __('Options related to this site: FavIcon, Home Page, more', 'weaver-xtreme' /*adm*/), __('Site Options', 'weaver-xtreme' /*adm*/), '<li>','</li>');
|
19 |
+
weaverx_elink('#asp_tab_admin', __('Basic Administrative Options', 'weaver-xtreme' /*adm*/), __('Admin Options', 'weaver-xtreme' /*adm*/), '<li>','</li>');
|
20 |
+
?>
|
21 |
+
</ul>
|
22 |
+
<?php weaverx_tab_title(__('Advanced Options','weaver-xtreme'), 'help.html#AdvancedOptions', __('Help for Advanced Options', 'weaver-xtreme' /*adm*/)); ?>
|
23 |
+
|
24 |
+
<?php weaverx_sapi_submit('', '<br /><br />'); ?>
|
25 |
+
|
26 |
+
<!-- ***************************************************** -->
|
27 |
+
<?php if (weaverx_allow_multisite() ) { ?>
|
28 |
+
<div id="asptab0" class="tab_adv" >
|
29 |
+
<?php weaverx_adv_head_section();
|
30 |
+
?>
|
31 |
+
</div> <!-- adtab 0 -->
|
32 |
+
|
33 |
+
<!-- ***************************************************** -->
|
34 |
+
|
35 |
+
<div id="asptab1" class="tab_adv" >
|
36 |
+
<?php weaverx_adv_html_insert(); ?>
|
37 |
+
</div> <!-- asptab1 -->
|
38 |
+
<?php } // end of major section of not allowed on multisite ?>
|
39 |
+
|
40 |
+
|
41 |
+
<!-- ***************************************************** -->
|
42 |
+
<div id="asptab3" class="tab_adv" >
|
43 |
+
<?php weaverx_adv_site_opts(); ?>
|
44 |
+
</div> <!-- site options -->
|
45 |
+
|
46 |
+
|
47 |
+
<!-- ***************************************************** -->
|
48 |
+
|
49 |
+
<div id="asp_tab_admin" class="tab_adv" >
|
50 |
+
<?php weaverx_admin_admin(); ?>
|
51 |
+
</div>
|
52 |
+
|
53 |
+
</div> <!-- tab-container-adv -->
|
54 |
+
|
55 |
+
<?php weaverx_sapi_submit(); ?>
|
56 |
+
</div> <!-- #tabwrap_adv-->
|
57 |
+
|
58 |
+
<script type="text/javascript">
|
59 |
+
var tabberAdv = new Yetii({
|
60 |
+
id: 'tab-container-adv',
|
61 |
+
tabclass: 'tab_adv',
|
62 |
+
persist: true
|
63 |
+
});
|
64 |
+
</script>
|
65 |
+
<?php
|
66 |
+
}
|
67 |
+
|
68 |
+
function weaverx_adv_head_section() {
|
69 |
+
|
70 |
+
?>
|
71 |
+
<div class="atw-option-header"><span style="color:black; padding:.2em;" class="dashicons dashicons-screenoptions"></span>
|
72 |
+
<?php _e('The Site <HEAD> Section', 'weaver-xtreme' /*adm*/);?>
|
73 |
+
<?php weaverx_help_link('help.html#HeadSection',__('Help for site HEAD section', 'weaver-xtreme' /*adm*/));?></div><br />
|
74 |
+
<p>
|
75 |
+
<?php _e('This tab allows you to add HTML to the <HEAD> Section of every page on your site.', 'weaver-xtreme' /*adm*/);?>
|
76 |
+
</p>
|
77 |
+
<?php if (weaverx_allow_multisite()) { ?>
|
78 |
+
<p><small>
|
79 |
+
<?php _e('PLEASE NOTE: Only minimal validation is made on the field values, so be careful not to use invalid code. Invalid code is usually harmless, but it can make your site display incorrectly. If your site looks broken after make changes here, please double check that what you entered uses valid HTML or CSS rules.', 'weaver-xtreme' /*adm*/);?>
|
80 |
+
</small></p>
|
81 |
+
|
82 |
+
|
83 |
+
<!-- ======== -->
|
84 |
+
|
85 |
+
<br /><br />
|
86 |
+
<a name="headsection" id="headsection"></a>
|
87 |
+
<div class="atw-option-subheader"><span style="color:black; padding:.2em;" class="dashicons dashicons-screenoptions"></span>
|
88 |
+
<?php _e('<HEAD> Section', 'weaver-xtreme' /*adm*/);?></div>
|
89 |
+
<br/>
|
90 |
+
<p>
|
91 |
+
<?php _e('This input area allows you to enter allowed HTML head elements to the <head> section, including <title>, <base>, <link>, <meta>, and <style>.
|
92 |
+
Code entered into this box is included right before the </head> HTML tag on each page of your site.
|
93 |
+
This code may <strong>not</strong> include <em><script>s</em> unless you\'ve installed the Weaver Xtreme Theme Support plugin.
|
94 |
+
We recommend using dedicated WordPress plugins to add things like ad tracking, SEO tags, Facebook code, and so on.
|
95 |
+
<small>Note: You can add CSS Rules using the "Custom CSS Rules" option on the Main Options tab.', 'weaver-xtreme' /*adm*/) . '</small>';?>
|
96 |
+
</p>
|
97 |
+
<p>
|
98 |
+
<?php _e('For even greater control of how your site looks, you can add code the the <HEAD> section on a per page basis using the per page options from the page editor.', 'weaver-xtreme' /*adm*/);?>
|
99 |
+
</p>
|
100 |
+
<?php weaverx_textarea(weaverx_getopt('head_opts'), 'head_opts', 2, '<!-- HTML code -->', $style = 'width:95%;', $class='wvrx-edit') ?>
|
101 |
+
<br>
|
102 |
+
<small><?php _e('Weaver Xtreme will <em>always</em> load the jQuery Library.', 'weaver-xtreme' /*adm*/);?></small>
|
103 |
+
<!-- ===================================================== -->
|
104 |
+
<br /><br />
|
105 |
+
|
106 |
+
<a name="headsection" id="headsection"></a>
|
107 |
+
<div class="atw-option-subheader"><span style="color:black; padding:.2em;" class="dashicons dashicons-screenoptions"></span>
|
108 |
+
<?php _e('<HEAD> Section (Advanced Alternative - ♦)', 'weaver-xtreme' /*adm*/);?></div>
|
109 |
+
|
110 |
+
<p><small>
|
111 |
+
<?php _e('Same as normal <HEAD> box above, but works like other ♦ options - it survives changing
|
112 |
+
the subtheme from the Weaver Xtreme Subthemes tab, and is saved only on a full backup Save.
|
113 |
+
This option is not commonly used, and is intended for more advanced Weaver Xtreme users.', 'weaver-xtreme' /*adm*/);?>
|
114 |
+
</small></p>
|
115 |
+
<?php weaverx_textarea(weaverx_getopt('_althead_opts'), '_althead_opts', 2, '<!-- HTML code -->', $style = 'width:95%;', $class='wvrx-edit') ?>
|
116 |
+
<?php
|
117 |
+
do_action('weaverxplus_admin','head_section');
|
118 |
+
} // not multisite
|
119 |
+
}
|
120 |
+
|
121 |
+
|
122 |
+
|
123 |
+
|
124 |
+
function weaverx_adv_html_insert() {
|
125 |
+
?>
|
126 |
+
<div class="atw-option-header"><span style="color:black; padding:.2em;" class="dashicons dashicons-editor-code"></span>
|
127 |
+
<?php _e('HTML Insertion', 'weaver-xtreme' /*adm*/);?>
|
128 |
+
<?php weaverx_help_link('help.html#HTMLInsertion','Help on HTML Code Insertion Areas');?></div><br />
|
129 |
+
<p>
|
130 |
+
<?php _e('The <b>Advanced Options→HTML Insertion</b> tab allows you to insert custom HTML code in many places on your site.
|
131 |
+
These fields allow you to add HTML code, special CSS rules, or even JavaScripts.
|
132 |
+
You will need at least a bit of knowledge of HTML coding to use these fields most effectively.', 'weaver-xtreme' /*adm*/);?>
|
133 |
+
</p>
|
134 |
+
<p><small>
|
135 |
+
<?php __('The values you put here are saved in the WordPress database, and will survive theme upgrades and other changes.', 'weaver-xtreme' /*adm*/);?>
|
136 |
+
</small></p>
|
137 |
+
<p><small>
|
138 |
+
<?php __('PLEASE NOTE: Only minimal validation is made on the field values, so be careful not to use invalid code.
|
139 |
+
Invalid code is usually harmless, but it can make your site display incorrectly.
|
140 |
+
If your site looks broken after make changes here, please double check that you entered valid HTML or CSS rules.', 'weaver-xtreme' /*adm*/);?>
|
141 |
+
</small></p>
|
142 |
+
<hr />
|
143 |
+
<?php
|
144 |
+
|
145 |
+
$base_areas = array(
|
146 |
+
|
147 |
+
//array('name'=>'', 'id'=>'submit', 'info' => '', 'help' => ''),
|
148 |
+
|
149 |
+
array ('name'=>__('Pre-Wrapper Code', 'weaver-xtreme' /*adm*/), 'id'=>'prewrapper', 'info' =>
|
150 |
+
__('This code will be inserted just before the #wrapper and #branding divs, before any other site content.(Area ID: #inject_prewrapper)', 'weaver-xtreme' /*adm*/), 'help' => ''),
|
151 |
+
array ('name'=>__('Post-Footer', 'weaver-xtreme' /*adm*/), 'id'=>'postfooter', 'info' =>
|
152 |
+
__('This code will be inserted just after the footer #colophon div, outside the #wrapper div.(Area ID: #inject_postfooter)', 'weaver-xtreme' /*adm*/),
|
153 |
+
'help' => '')
|
154 |
+
);
|
155 |
+
|
156 |
+
$areas = apply_filters('weaverxplus_html_inject', $base_areas);
|
157 |
+
|
158 |
+
foreach ($areas as $area => $def) {
|
159 |
+
$name = $def['name'];
|
160 |
+
|
161 |
+
weaverx_add_html_field( $name, $def['id'], $def['info'], $def['help'] ,
|
162 |
+
'<span style="color:black; padding:.2em;" class="dashicons dashicons-editor-code"></span>');
|
163 |
+
}
|
164 |
+
|
165 |
+
|
166 |
+
do_action('weaverxplus_admin','html_insertion');
|
167 |
+
}
|
168 |
+
|
169 |
+
|
170 |
+
function weaverx_add_html_field($title, $name, $info, $help='', $icon = '') {
|
171 |
+
|
172 |
+
if ($name=='submit') {
|
173 |
+
weaverx_sapi_submit('', "<br /><br />\n");
|
174 |
+
return;
|
175 |
+
}
|
176 |
+
|
177 |
+
if ($name[0] == '+') $name = substr($name,1); // fix locally
|
178 |
+
|
179 |
+
$area_name = '' . $name . '_insert';
|
180 |
+
$hide_front = 'hide_front_' . $name;
|
181 |
+
$hide_rest = 'hide_rest_' . $name;
|
182 |
+
$style_id = 'inject_' . $name;
|
183 |
+
$add_class_id = 'inject_add_class_' . $name;
|
184 |
+
|
185 |
+
$val = array ('name' => $title . __(' BG', 'weaver-xtreme' /*adm*/), 'id' => $style_id . '_bgcolor',
|
186 |
+
'info' => '<span style="margin-top:6px;" class="i-left-bg dashicons dashicons-admin-appearance"></span>' .
|
187 |
+
'<strong style="font-size:larger;">' . __('BG Color for area. (Add custom CSS using the CSS+ option.)', 'weaver-xtreme' /*adm*/) . '</strong>',
|
188 |
+
'help' => '');
|
189 |
+
$classes = array( 'name' => '<span class="i-left">{ }</span> <small>' . __('Add Classes', 'weaver-xtreme' /*adm*/) . '</small>',
|
190 |
+
'id' => $add_class_id, 'type' => '+widetext',
|
191 |
+
'info' => __('Space separated class names to add to this area (<em>Advanced option</em>) (★Plus)', 'weaver-xtreme' /*adm*/) );
|
192 |
+
|
193 |
+
?>
|
194 |
+
<div class="atw-option-subheader"><?php echo $icon; ?><span style="color:blue;"><b><?php echo $title; ?></b></span></div></br />
|
195 |
+
<?php
|
196 |
+
if (! $info)
|
197 |
+
return;
|
198 |
+
echo $info;
|
199 |
+
?>
|
200 |
+
<br />
|
201 |
+
<?php weaverx_textarea(weaverx_getopt($area_name), $area_name, 3, __('Any HTML, including shortcodes.', 'weaver-xtreme' /*adm*/)); ?>
|
202 |
+
|
203 |
+
<br />
|
204 |
+
<?php
|
205 |
+
echo '<table style="width:90%;">'; weaverx_form_ctext($val,true); weaverx_form_text($classes);echo '</table>';
|
206 |
+
?>
|
207 |
+
<label><span class="dashicons dashicons-visibility"></span>
|
208 |
+
<?php _e('Hide on front page:', 'weaver-xtreme' /*adm*/);?>
|
209 |
+
<input type="checkbox" name="<?php weaverx_sapi_main_name($hide_front); ?>" id="<?php echo $hide_front; ?>" <?php checked(weaverx_getopt_checked($hide_front)); ?> /></label>
|
210 |
+
|
211 |
+
<small><?php _e('If you check this box, then the code from this area will not be displayed on the front (home) page.', 'weaver-xtreme' /*adm*/);?></small><br />
|
212 |
+
<label><span class="dashicons dashicons-visibility"></span>
|
213 |
+
<?php _e('Hide on non-front pages:', 'weaver-xtreme' /*adm*/);?>
|
214 |
+
<input type="checkbox" name="<?php weaverx_sapi_main_name($hide_rest); ?>" id="<?php echo $hide_rest; ?>" <?php checked(weaverx_getopt_checked( $hide_rest )); ?> /></label>
|
215 |
+
<small><?php _e('If you check this box, then the code from this area will not be displayed on non-front pages.', 'weaver-xtreme' /*adm*/);?></small><br /><br />
|
216 |
+
<?php
|
217 |
+
}
|
218 |
+
|
219 |
+
|
220 |
+
|
221 |
+
|
222 |
+
// ============================================== SITE OPTIONS ===========================================
|
223 |
+
|
224 |
+
function weaverx_adv_site_opts() {
|
225 |
+
?>
|
226 |
+
<div class="atw-option-header"><span style="color:black; padding:.2em;" class="dashicons dashicons-admin-generic"></span>
|
227 |
+
<?php _e('Site Options', 'weaver-xtreme' /*adm*/); ?>
|
228 |
+
<?php weaverx_help_link('help.html#AdvSiteOptions',__('Help on Advanced Site Options', 'weaver-xtreme' /*adm*/));?></div><br />
|
229 |
+
<?php _e('These options are available to fine tune various aspects of your site.
|
230 |
+
Technically, these features are not part of the theme styling, but cover other aspects of site functionality.', 'weaver-xtreme' /*adm*/);?>
|
231 |
+
<br />
|
232 |
+
<hr />
|
233 |
+
<!-- ======== -->
|
234 |
+
<?php
|
235 |
+
if ( weaverx_f_file_access_available() ) {
|
236 |
+
?>
|
237 |
+
<h3><?php _e('Inline CSS - (Xtreme-Plus Option)', 'weaver-xtreme' /*adm*/);?></h3>
|
238 |
+
|
239 |
+
<label><input type="checkbox" name="<?php weaverx_sapi_main_name('_inline_style'); ?>" id="_inline_style" <?php checked(weaverx_getopt_checked( '_inline_style' )); ?> />
|
240 |
+
<?php _e('Generate inline CSS code rather than using style-weaverxt.css file.
|
241 |
+
By default, Weaverx Xtreme Plus will use the style-weaverxt.css file. ♦', 'weaver-xtreme' /*adm*/);?>
|
242 |
+
</label><br /><br />
|
243 |
+
<?php
|
244 |
+
}
|
245 |
+
?>
|
246 |
+
|
247 |
+
|
248 |
+
<br />
|
249 |
+
<div class="atw-option-subheader"><span style="color:black; padding:.2em;" class="dashicons dashicons-format-image"></span><span style="color:blue;font-size:larger;">
|
250 |
+
<b><?php _e('FavIcon', 'weaver-xtreme' /*adm*/);?></b></span></div></br />
|
251 |
+
<p>
|
252 |
+
<?php _e('You can add a FavIcon to your site with this option.
|
253 |
+
The preferred FavIcon is in the <code>.ico</code> format which has the most universal browser compatibility.
|
254 |
+
However, <code>.png, .gif, and .jpg</code> will work for most modern browsers.
|
255 |
+
The standard sizes are 16x16, 32x32, or 48x48 px.
|
256 |
+
You can alternatively load a <code>favicon.ico</code> file to the root directory of your site. ♦', 'weaver-xtreme' /*adm*/);?>
|
257 |
+
</p>
|
258 |
+
<p>
|
259 |
+
<?php
|
260 |
+
$icon = weaverx_getopt('_favicon_url');
|
261 |
+
if ($icon != '') {
|
262 |
+
echo '<img src="' . esc_url($icon) . '" alt="favicon" /> ';
|
263 |
+
}
|
264 |
+
?>
|
265 |
+
<strong><?php _e('FavIcon URL:', 'weaver-xtreme' /*adm*/); ?> </strong>
|
266 |
+
<?php weaverx_textarea(weaverx_getopt('_favicon_url'), '_favicon_url', 1, 'URL ', $style = 'width:350px;'); ?>
|
267 |
+
<?php weaverx_media_lib_button('_favicon_url'); ?> <?php _e('Full path to FavIcon', 'weaver-xtreme' /*adm*/);?>
|
268 |
+
</p><br />
|
269 |
+
|
270 |
+
<div class="atw-option-subheader"><span style="color:black; padding:.2em;" class="dashicons dashicons-admin-page"></span><span style="color:blue;font-size:larger;">
|
271 |
+
<b><?php _e('Exclude Pages from SiteMap', 'weaver-xtreme' /*adm*/);?></b></span></div></br />
|
272 |
+
<p>
|
273 |
+
<?php _e('You can specify a comma separated list of Page IDs to be excluded from the SiteMap Page list.
|
274 |
+
To exclude pages from Search results, use a plugin such as "Search Exclude".
|
275 |
+
You can hide different sections of the SiteMap by adding rules to the "Custom CSS Rules" box.
|
276 |
+
To hide authors, for example, add the rule <code>#sitemap-authors{display:none;}</code>.
|
277 |
+
The IDs for the SiteMap sections are: <code>#sitemap-pages, #sitemap-posts, #sitemap-categories, #sitemap-tags, #sitemap-authors</code>', 'weaver-xtreme' /*adm*/);?>
|
278 |
+
</p>
|
279 |
+
<p>
|
280 |
+
<?php
|
281 |
+
$exclude = weaverx_getopt('_sitemap_exclude_pages');
|
282 |
+
|
283 |
+
?>
|
284 |
+
<strong><?php _e('Exclude Pages from SiteMap', 'weaver-xtreme' /*adm*/); ?>: </strong>
|
285 |
+
<?php weaverx_textarea(weaverx_getopt('_sitemap_exclude_pages'), '_sitemap_exclude_pages', 1, '1,2,3', $style = 'width:350px;'); ?>
|
286 |
+
</p><br />
|
287 |
+
|
288 |
+
|
289 |
+
|
290 |
+
|
291 |
+
<div class="atw-option-subheader"><span style="color:black; padding:.2em;" class="dashicons dashicons-hammer"></span>
|
292 |
+
<span style="color:blue;font-size:larger;">
|
293 |
+
<b><?php _e('SEO - Search Engine Optimization', 'weaver-xtreme' /*adm*/);?></b>
|
294 |
+
</span></div><br />
|
295 |
+
<p>
|
296 |
+
<?php _e('The Weaver Xtreme Theme has been designed to follow the latest SEO guidelines.
|
297 |
+
Each non-home page will use the recommended "Page Title | Site Title" format, and the site is formatted using the appropriate HTML5 tags for optimal SEO performance.
|
298 |
+
An SEO plugin may help you optimize your site for SEO, but is not required.
|
299 |
+
See the <em>Help</em> tab for recommended SEO plugins.', 'weaver-xtreme' /*adm*/);?>
|
300 |
+
</p><br />
|
301 |
+
|
302 |
+
<div class="atw-option-subheader"><span style="color:black; padding:.2em;" class="dashicons dashicons-admin-home"></span>
|
303 |
+
<span style="color:blue;font-size:larger;">
|
304 |
+
<b><?php _e('Home Page', 'weaver-xtreme' /*adm*/);?></b>
|
305 |
+
</span></div>
|
306 |
+
<p>
|
307 |
+
<?php _e('WordPress allows you to specify what page is used for your home page - either the standard WordPress blog, or a static page (which can be a Weaver Xtreme "Page with Posts" page).
|
308 |
+
Please see the Weaver Xtreme Help topic for a more complete explanation.', 'weaver-xtreme' /*adm*/);?>
|
309 |
+
</p>
|
310 |
+
<p>
|
311 |
+
<?php _e('You can set the front page on the Dashboard <em>Settings→Reading panel</em>:', 'weaver-xtreme' /*adm*/);?>
|
312 |
+
<a href="<?php echo esc_url( home_url( '/' ) . 'wp-admin/options-reading.php' ); ?>">
|
313 |
+
<strong><?php _e('Set Front Page Displays', 'weaver-xtreme' /*adm*/);?></strong></a></p><br />
|
314 |
+
|
315 |
+
<div class="atw-option-subheader"><span style="color:black; padding:.2em;" class="dashicons dashicons-admin-users"></span>
|
316 |
+
<span style="color:blue;font-size:larger;">
|
317 |
+
<b><?php _e('Author Avatars', 'weaver-xtreme' /*adm*/);?></b>
|
318 |
+
</span></div>
|
319 |
+
<p>
|
320 |
+
<?php _e('For the best look, your site should support Avatars - a small image associated with a contributors e-mail address.
|
321 |
+
Gravatar.com is probably the most popular Avatar support, and is closely associated with WordPress.
|
322 |
+
You should set up a Gravatar for the main authors of your blog.
|
323 |
+
For contributors without any avatar, WordPress will automatically generate an avatar.
|
324 |
+
See the <strong>Settings → Discussion</strong> admin page for avatar settings.', 'weaver-xtreme' /*adm*/);?>
|
325 |
+
</p>
|
326 |
+
<hr />
|
327 |
+
<?php
|
328 |
+
do_action('weaverxplus_admin','site_opts');
|
329 |
+
do_action('weaverx_child_siteoptions');
|
330 |
+
}
|
331 |
+
|
332 |
+
?>
|
admin/admin-help.php
ADDED
@@ -0,0 +1,105 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
if ( !defined('ABSPATH')) exit; // Exit if accessed directly
|
3 |
+
/* Weaver Xtreme - admin Help
|
4 |
+
*
|
5 |
+
* __ added: 12/10/14
|
6 |
+
*
|
7 |
+
* This is the intro form. It won't have any options because it will be outside the main form
|
8 |
+
*/
|
9 |
+
|
10 |
+
function weaverx_admin_help() {
|
11 |
+
?>
|
12 |
+
<span style="font-size:larger;font-weight:bold;padding-right:70px;"><?php _e('Weaver Xtreme Help', 'weaver-xtreme' /*adm*/); ?></span>
|
13 |
+
|
14 |
+
<small><strong><?php _e('Media Library Picker Tool:', 'weaver-xtreme' /*adm*/); ?></strong></small>
|
15 |
+
<input name="media_url" type="text" style="width:400px;height:22px;" class="regular-text" name="media_url"
|
16 |
+
id="media_url" value="<?php __('Paste media URL here that you can then Copy/Paste elsewhere.', 'weaver-xtreme' /*adm*/);?>" />
|
17 |
+
<?php weaverx_media_lib_button('media_url'); ?>
|
18 |
+
<p>
|
19 |
+
<?php _e('This is the Weaver Xtreme Admin help button: ', 'weaver-xtreme' /*adm*/); ?>
|
20 |
+
<?php weaverx_help_link('help.html#top', __('Weaver Xtreme Help', 'weaver-xtreme' /*adm*/)); ?>
|
21 |
+
|
22 |
+
<?php _e('Clicking the ? will open the Weaver Xtreme Help document to the appropriate section.', 'weaver-xtreme' /*adm*/); ?>
|
23 |
+
</p>
|
24 |
+
<h2>
|
25 |
+
<?php _e('Please see our active ', 'weaver-xtreme' /*adm*/); ?>
|
26 |
+
<?php weaverx_site('','//forum.weavertheme.com/',__('Weaver Support Forum', 'weaver-xtreme' /*adm*/)); ?>
|
27 |
+
<?php _e('Support Forum</a> for online help.', 'weaver-xtreme' /*adm*/); ?>
|
28 |
+
</h2>
|
29 |
+
<?php
|
30 |
+
do_action('weaverxplus_admin','help');
|
31 |
+
?>
|
32 |
+
<div style="float:left;width:50%;padding-right:2%">
|
33 |
+
<div class="atw-help">
|
34 |
+
<h2 style="text-decoration:underline;font-weight:bold;")>
|
35 |
+
<?php weaverx_help_link('help.html', __('Weaver Xtreme Help', 'weaver-xtreme' /*adm*/), __('Weaver Xtreme Theme Documentation', 'weaver-xtreme' /*adm*/)) ?>
|
36 |
+
</h2>
|
37 |
+
<p>
|
38 |
+
<?php _e('Complete documentation for using the Weaver Xtreme Theme.', 'weaver-xtreme' /*adm*/); ?>
|
39 |
+
</p>
|
40 |
+
<h2 style="text-decoration:underline;font-weight:bold;")>
|
41 |
+
<?php weaverx_help_link('css-help.html', __('Weaver CSS Help', 'weaver-xtreme' /*adm*/), __('CSS HELP', 'weaver-xtreme' /*adm*/)) ?>
|
42 |
+
</h2>
|
43 |
+
<p>
|
44 |
+
<?php _e('A short CSS Tutorial', 'weaver-xtreme' /*adm*/); ?>
|
45 |
+
</p>
|
46 |
+
<h2 style="text-decoration:underline;font-weight:bold;")>
|
47 |
+
<?php weaverx_help_link('font-demo.html', __('Examples of supported fonts', 'weaver-xtreme' /*adm*/), __('Font Examples', 'weaver-xtreme' /*adm*/)) ?>
|
48 |
+
</h2>
|
49 |
+
<p>
|
50 |
+
<?php _e('Example of Font Families supported by Weaver Xtreme and Weaver Xtreme Plus.', 'weaver-xtreme' /*adm*/); ?>
|
51 |
+
</p>
|
52 |
+
|
53 |
+
<h3 style="text-decoration:underline;font-weight:bold;")>
|
54 |
+
<?php _e('Release Notes', 'weaver-xtreme' /*adm*/); ?>
|
55 |
+
</h3>
|
56 |
+
<p>
|
57 |
+
<pre>
|
58 |
+
= Version 1.3 =
|
59 |
+
* New: Custom Menu Placeholder item hover cursor specification
|
60 |
+
* New: New item on Customizer Menu: link to Weaver Xtreme Appearance → Theme Options
|
61 |
+
* Fix: <!--nextpage--> support on pages
|
62 |
+
* Fix: style for weaver slider FI's
|
63 |
+
* Tweak: Recommended Plugins wording, TGMPA update
|
64 |
+
* Tweak: moved loading of style sheets to weaverx_enqueue_scripts() action
|
65 |
+
* Tweak: support for shortcodes in Smart Menus (Plus)
|
66 |
+
* Tweak: Comment form translation fix
|
67 |
+
* Tweak: Page with Posts: sticky + author filter
|
68 |
+
</pre>
|
69 |
+
</p>
|
70 |
+
</div>
|
71 |
+
</div>
|
72 |
+
<div style="float:right;width:40%;padding-right:1%">
|
73 |
+
|
74 |
+
<h2><b><?php _e('RECOMMENDED PLUGINS', 'weaver-xtreme' /*adm*/); ?></b></h2>
|
75 |
+
<p><strong>
|
76 |
+
<?php _e('Some recommended plugins to use with your Weaver Xtreme Theme', 'weaver-xtreme' /*adm*/); ?>
|
77 |
+
</strong></p>
|
78 |
+
<ul>
|
79 |
+
<li style="font-size:120%;"><a href="//wordpress.org/plugins/weaverx-theme-support/" target="_blank"><?php _e('Weaver Xtreme Theme Support', 'weaver-xtreme' /*adm*/); ?></a>
|
80 |
+
<?php _e('- provides <strong>essential</strong> Weaver Xtreme theme options and useful shortcodes', 'weaver-xtreme' /*adm*/); ?>
|
81 |
+
</li>
|
82 |
+
<li><a href="//wordpress.org/plugins/show-posts/" target="_blank"><?php _e('Weaver Show Posts', 'weaver-xtreme' /*adm*/); ?></a>
|
83 |
+
<?php _e('- adds the [show_posts] shortcode to selectively display posts filtered by category, tag, order, id, etc.
|
84 |
+
Also adds additional filtering options to the Weaver Xtreme Page with Posts page template.
|
85 |
+
This formerly was integrated with Weaver, and was considered an important part of the theme.', 'weaver-xtreme' /*adm*/); ?>
|
86 |
+
</li>
|
87 |
+
<li><a href="//wordpress.org/plugins/show-sliders/" target="_blank"><?php _e('Weaver Show Sliders', 'weaver-xtreme' /*adm*/); ?></a>
|
88 |
+
<?php _e('- good for any kind of slideshows - images, posts, [gallery] replacement', 'weaver-xtreme' /*adm*/);?>
|
89 |
+
</li>
|
90 |
+
<li><a href="https://wordpress.org/plugins/wp-retina-2x/" target="_blank"><?php _e('WP Retina 2x', 'weaver-xtreme' /*adm*/); ?></a>
|
91 |
+
<?php _e('- Weaver Xtreme is Retina Ready - this plugin makes your Media Library Retina Ready, too. Only needed if you use HD images.', 'weaver-xtreme' /*adm*/); ?>
|
92 |
+
</li>
|
93 |
+
<li><a href="https://wordpress.org/plugins/wp-edit/" target="_blank">WP Edit</a> -
|
94 |
+
<?php _e('WP Edit adds additional editing functionality to the default WordPress editor.
|
95 |
+
Allows content formatting without the need for extra HTML or CSS.
|
96 |
+
Also includes advanced features to manage your content such as post and page revision control.', 'weaver-xtreme' /*adm*/); ?>
|
97 |
+
</li>
|
98 |
+
</ul>
|
99 |
+
|
100 |
+
</div><div style="clear:both;"></div>
|
101 |
+
|
102 |
+
<?php
|
103 |
+
}
|
104 |
+
|
105 |
+
?>
|
admin/admin-mainopts.php
ADDED
@@ -0,0 +1,1381 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
if ( !defined('ABSPATH')) exit; // Exit if accessed directly
|
3 |
+
/* Weaver Xtreme - admin Main Options
|
4 |
+
*
|
5 |
+
* __ added: 12/9/14
|
6 |
+
* This function will start the main sapi form, which will be closed in admin-adminopts
|
7 |
+
*/
|
8 |
+
|
9 |
+
|
10 |
+
// ======================== Main Options > Top Level ========================
|
11 |
+
function weaverx_admin_mainopts() {
|
12 |
+
?>
|
13 |
+
<div id="tabwrap_main" style="padding-left:4px;">
|
14 |
+
|
15 |
+
<div id="tab-container-main" class='yetiisub'>
|
16 |
+
<ul id="tab-container-main-nav" class='yetiisub'>
|
17 |
+
<?php
|
18 |
+
weaverx_elink('#asp_genappear' , __('Wrapping background colors, rounded corners, borders, fade, shadow', 'weaver-xtreme' /*adm*/), __('Wrapping Areas', 'weaver-xtreme' /*adm*/),'<li>','</li>');
|
19 |
+
weaverx_elink('#asp_widgets' , __('Settings for Sidebars and Sidebar Layout', 'weaver-xtreme' /*adm*/), __('Sidebars & Layout', 'weaver-xtreme' /*adm*/),'<li>', '</li>');
|
20 |
+
weaverx_elink('#asp_headeropts' , __('Site Title/Tagline properties, Header Image', 'weaver-xtreme' /*adm*/), __('Header', 'weaver-xtreme' /*adm*/),'<li>', '</li>');
|
21 |
+
weaverx_elink('#asp_menus' , __('Menu text and bg colors and other properties; Info Bar properties', 'weaver-xtreme' /*adm*/), __('Menus','weaver-xtreme' /*adm*/),'<li>', '</li>');
|
22 |
+
weaverx_elink('#asp_content' , __('Text colors and bg, image borders, featured image, other properties related to all content', 'weaver-xtreme' /*adm*/), __('Content Areas', 'weaver-xtreme' /*adm*/),'<li>', '</li>');
|
23 |
+
weaverx_elink('#asp_postspecific' , __('Properties related to posts: titles, meta info, navigation, excerpts, featured images, and more', 'weaver-xtreme' /*adm*/), __('Post Specifics', 'weaver-xtreme' /*adm*/),'<li>', '</li>');
|
24 |
+
weaverx_elink('#asp_footer' , __('Footer options: bg color, borders, more. Site Copyright', 'weaver-xtreme' /*adm*/), __('Footer', 'weaver-xtreme' /*adm*/),'<li>', '</li>');
|
25 |
+
weaverx_elink('#asp_custom' , __('Font settings & Custom Settings', 'weaver-xtreme' /*adm*/), __('Fonts & Custom', 'weaver-xtreme' /*adm*/),'<li>', '</li>');
|
26 |
+
?>
|
27 |
+
</ul>
|
28 |
+
|
29 |
+
<?php weaverx_tab_title(__('Main Options', 'weaver-xtreme' /*adm*/), 'help.html#MainOptions', __('Help for Main Options', 'weaver-xtreme' /*adm*/)); ?>
|
30 |
+
|
31 |
+
<div id="asp_genappear" class="tab_mainopt" >
|
32 |
+
<?php weaverx_mainopts_general(); ?>
|
33 |
+
</div>
|
34 |
+
|
35 |
+
<div id="asp_widgets" class="tab_mainopt" >
|
36 |
+
<?php
|
37 |
+
weaverx_mainopts_layout();
|
38 |
+
weaverx_mainopts_widgets();
|
39 |
+
?>
|
40 |
+
</div>
|
41 |
+
|
42 |
+
<div id="asp_headeropts" class="tab_mainopt" >
|
43 |
+
<?php weaverx_mainopts_header(); ?>
|
44 |
+
</div>
|
45 |
+
|
46 |
+
<div id="asp_menus" class="tab_mainopt" >
|
47 |
+
<?php weaverx_mainopts_menus(); ?>
|
48 |
+
</div>
|
49 |
+
|
50 |
+
<div id="asp_content" class="tab_mainopt" >
|
51 |
+
<?php weaverx_mainopts_content(); ?>
|
52 |
+
</div>
|
53 |
+
|
54 |
+
<div id="asp_postspecific" class="tab_mainopt" >
|
55 |
+
<?php weaverx_mainopts_posts(); ?>
|
56 |
+
</div>
|
57 |
+
|
58 |
+
<div id="asp_footer" class="tab_mainopt" >
|
59 |
+
<?php weaverx_mainopts_footer(); ?>
|
60 |
+
</div>
|
61 |
+
|
62 |
+
|
63 |
+
<div id="asp_links" class="tab_mainopt" >
|
64 |
+
<?php weaverx_mainopts_custom(); ?>
|
65 |
+
</div>
|
66 |
+
|
67 |
+
</div> <!-- #tab-container-main -->
|
68 |
+
<?php weaverx_sapi_submit(); ?>
|
69 |
+
</div> <!-- #tabwrap_main -->
|
70 |
+
<script type="text/javascript">
|
71 |
+
var tabberMainOpts = new Yetii({
|
72 |
+
id: 'tab-container-main',
|
73 |
+
tabclass: 'tab_mainopt',
|
74 |
+
persist: true
|
75 |
+
});
|
76 |
+
</script>
|
77 |
+
<?php
|
78 |
+
}
|
79 |
+
|
80 |
+
// ======================== Main Options > Wrapping Areas ========================
|
81 |
+
function weaverx_mainopts_general() {
|
82 |
+
|
83 |
+
$font_size = weaverx_getopt_default('site_fontsize_int', 16);
|
84 |
+
|
85 |
+
$opts = array(
|
86 |
+
array( 'type' => 'submit'),
|
87 |
+
array('name' => __('Wrapping Areas', 'weaver-xtreme' /*adm*/), 'icon' => '-admin-generic',
|
88 |
+
'id' => 'h-wrap-areas', 'type' => 'header',
|
89 |
+
'info' => __('Settings for wrapping areas','weaver-xtreme' /*adm*/),
|
90 |
+
'help' => 'help.html#GenApp'),
|
91 |
+
array('name' => __('GLOBAL SETTINGS', 'weaver-xtreme' /*adm*/), 'type' => 'note',
|
92 |
+
'info' => __('These settings control site outer background and the standard link colors.', 'weaver-xtreme' /*adm*/)),
|
93 |
+
array('name' => __('Outside BG', 'weaver-xtreme' /*adm*/), 'id' => 'body_bgcolor', 'type' => 'ctext',
|
94 |
+
'info' => __('Background color that wraps entire page. (<body>) Using <em>Appearance->Background</em> will override this value, or allow a background image instead.', 'weaver-xtreme' /*adm*/)),
|
95 |
+
|
96 |
+
array('name' => __('Fade Outside BG', 'weaver-xtreme' /*adm*/), 'id' => 'fadebody_bg', 'type' => 'checkbox',
|
97 |
+
'info' => __('Will fade the Outside BG color, darker at top to lighter at bottom.', 'weaver-xtreme' /*adm*/)),
|
98 |
+
array('name' => __('Full Browser Height', 'weaver-xtreme' /*adm*/), 'id' => 'full_browser_height', 'type' => 'checkbox',
|
99 |
+
'info' => __('For short pages, add extra padding to bottom of content to force full browser height.', 'weaver-xtreme' /*adm*/)),
|
100 |
+
array('name' => __('Standard Links', 'weaver-xtreme' /*adm*/), 'id' => 'link', 'type' => 'link',
|
101 |
+
'info' => __('Global default for link colors (not including menus and titles). Set Bold, Italic, and Underline by setting those options for specific areas rather than globally to have more control.', 'weaver-xtreme' /*adm*/)),
|
102 |
+
|
103 |
+
// array('name' => '#070' . __('No Auto-Underline Links', 'weaver-xtreme' /*adm*/), 'id' => 'mobile_nounderline', 'type' => 'checkbox',
|
104 |
+
// 'info' => __('Underlined links are easier to use on most mobile devices. This will disable auto-underlined links.', 'weaver-xtreme' /*adm*/)),
|
105 |
+
|
106 |
+
array('name' => __('Current Base Font Size:', 'weaver-xtreme' /*adm*/), 'type' => 'note',
|
107 |
+
'info' => '<span style="font-size:' . $font_size . 'px;">' . $font_size . __('px.', 'weaver-xtreme' /*adm*/) . '</span> ' . __('Change on Custom Tab', 'weaver-xtreme' /*adm*/)),
|
108 |
+
array( 'type' => 'submit'),
|
109 |
+
|
110 |
+
|
111 |
+
array('name' => __('Wrapper Area', 'weaver-xtreme' /*adm*/), 'id' => 'wrapper', 'type' => 'widget_area_submit',
|
112 |
+
'info' => __('Wrapper wraps entire site (CSS id: #wrapper). Colors and font settings will be the default values for all other areas.', 'weaver-xtreme' /*adm*/)),
|
113 |
+
|
114 |
+
array('name' => __('Container Area', 'weaver-xtreme' /*adm*/), 'id' => 'container', 'type' => 'widget_area_submit',
|
115 |
+
'info' => __('Container (#container div) wraps content and sidebars.', 'weaver-xtreme' /*adm*/)),
|
116 |
+
|
117 |
+
);
|
118 |
+
|
119 |
+
?>
|
120 |
+
|
121 |
+
<div class="options-intro"><?php _e('<strong>Wrapping Areas:</strong>
|
122 |
+
The options on this tab affect the overall site appearance.
|
123 |
+
The main <strong>Wrapper Area</strong> wraps the entire site, and is used to specify default text and background colors, site width, font families, and more.
|
124 |
+
With <em>Weaver Xtreme Plus</em>, you can also specify background images for various areas of your site.', 'weaver-xtreme' /*adm*/); ?>
|
125 |
+
<div class="options-intro-menu"> <a href="#wrapping-areas"><?php _e('Wrapping Areas', 'weaver-xtreme' /*adm*/); ?></a> |
|
126 |
+
<a href="#wrapper-area"><?php _e('Wrapper Area', 'weaver-xtreme' /*adm*/); ?></a> |
|
127 |
+
<a href="#container-area"><?php _e('Container Area', 'weaver-xtreme' /*adm*/); ?></a> |
|
128 |
+
<a href="#background-images"><?php _e('Background Image (X-Plus)', 'weaver-xtreme' /*adm*/); ?></a>
|
129 |
+
</div>
|
130 |
+
</div>
|
131 |
+
<?php
|
132 |
+
weaverx_form_show_options($opts);
|
133 |
+
do_action('weaverxplus_admin','general_appearance');
|
134 |
+
}
|
135 |
+
|
136 |
+
|
137 |
+
|
138 |
+
// ======================== Main Options > Custom ========================
|
139 |
+
|
140 |
+
function weaverx_mainopts_custom() {
|
141 |
+
$opts = array(
|
142 |
+
array( 'type' => 'submit'),
|
143 |
+
array('name' => __('Custom Options', 'weaver-xtreme' /*adm*/), 'icon' => '-admin-generic',
|
144 |
+
'id' => 'h-custom-opts', 'type' => 'header',
|
145 |
+
'info' => __('Set various global custom values.', 'weaver-xtreme' /*adm*/),
|
146 |
+
'help' => 'help.html#Custom'),
|
147 |
+
|
148 |
+
array('name' => __('Various Custom Values', 'weaver-xtreme' /*adm*/), 'icon' => '-admin-settings',
|
149 |
+
'id' => 'h-var-cust-vals', 'type' => 'subheader',
|
150 |
+
'info' => __('Adjust various global settings', 'weaver-xtreme' /*adm*/)),
|
151 |
+
|
152 |
+
array('name' => __('Smart Margin Width', 'weaver-xtreme' /*adm*/),
|
153 |
+
'icon' => '-align-none',
|
154 |
+
'id' => 'smart_margin_int', 'type' => '+val_percent',
|
155 |
+
'info' => __('Width used for smart column margins for Sidebars and Content Area. (Default: 1%) (★Plus)', 'weaver-xtreme' /*adm*/)),
|
156 |
+
|
157 |
+
array('name' => __('Border Color', 'weaver-xtreme' /*adm*/), 'id' => 'border_color', 'type' => 'color',
|
158 |
+
'info' => __('Global color of borders. (Default: #222)', 'weaver-xtreme' /*adm*/)),
|
159 |
+
array('name' => '<small>' . __('Border Width', 'weaver-xtreme' /*adm*/) . '</small>' , 'id' => 'border_width_int', 'type' => 'val_px',
|
160 |
+
'info' => __('Global Width of borders. (Default: 1px)', 'weaver-xtreme' /*adm*/)),
|
161 |
+
array('name' => '<small>' . __('Border Style', 'weaver-xtreme' /*adm*/) . '</small>',
|
162 |
+
'icon' => '<span class="i-left" style="font-size:200%;margin-left:4px;">□</span>' ,
|
163 |
+
'id' => 'border_style', 'type' => '+select_id',
|
164 |
+
'info' => __('Style of borders - width needs to be > 1 for some styles to work correctly (★Plus)', 'weaver-xtreme' /*adm*/),
|
165 |
+
'value' => array(
|
166 |
+
array('val' => 'solid', 'desc' => __('Solid', 'weaver-xtreme' /*adm*/) ),
|
167 |
+
array('val' => 'dotted', 'desc' => __('Dotted', 'weaver-xtreme' /*adm*/) ),
|
168 |
+
array('val' => 'dashed', 'desc' => __('Dashed', 'weaver-xtreme' /*adm*/) ),
|
169 |
+
array('val' => 'double', 'desc' => __('Double', 'weaver-xtreme' /*adm*/) ),
|
170 |
+
array('val' => 'groove', 'desc' => __('Groove', 'weaver-xtreme' /*adm*/) ),
|
171 |
+
array('val' => 'ridge', 'desc' => __('Ridge', 'weaver-xtreme' /*adm*/) ),
|
172 |
+
array('val' => 'inset', 'desc' => __('Inset', 'weaver-xtreme' /*adm*/) ),
|
173 |
+
array('val' => 'outset', 'desc' => __('Outset', 'weaver-xtreme' /*adm*/) )
|
174 |
+
)),
|
175 |
+
|
176 |
+
array('name' => __('Corner Radius', 'weaver-xtreme' /*adm*/), 'id' => 'rounded_corners_radius', 'type' => '+val_px',
|
177 |
+
'info' => __('Controls how "round" corners are. Specify a value (5 to 15 look best) for corner radius. (Default: 8) (★Plus)', 'weaver-xtreme' /*adm*/)),
|
178 |
+
|
179 |
+
array('name' => __('Hide Menu/Link Tool Tips', 'weaver-xtreme' /*adm*/), 'id' => 'hide_tooltip', 'type' => '+checkbox',
|
180 |
+
'info' => __('Hide the tool tip pop up over all menus and links. (★Plus)', 'weaver-xtreme' /*adm*/)),
|
181 |
+
|
182 |
+
|
183 |
+
array('name' => __('Custom Shadow', 'weaver-xtreme' /*adm*/), 'id' => 'custom_shadow', 'type' => '+widetext',
|
184 |
+
'info' => __('Specify full <em>box-shadow</em> CSS rule, e.g., <em>{box-shadow: 0 0 3px 1px rgba(0,0,0,0.25);}</em> (★Plus)', 'weaver-xtreme' /*adm*/)),
|
185 |
+
|
186 |
+
array( 'type' => 'submit'),
|
187 |
+
|
188 |
+
array('name' => __('Custom CSS', 'weaver-xtreme' /*adm*/), 'id' => 'custom_css', 'type' => 'custom_css',
|
189 |
+
'info' => __('Create Custom CSS Rules', 'weaver-xtreme' /*adm*/)),
|
190 |
+
|
191 |
+
array( 'type' => 'submit'),
|
192 |
+
|
193 |
+
|
194 |
+
array('name' => __('Fonts', 'weaver-xtreme' /*adm*/), 'icon' => '-editor-textcolor',
|
195 |
+
'id' => 'h-fonts', 'type' => 'header',
|
196 |
+
'info' => __('Font Base Sizes', 'weaver-xtreme' /*adm*/),
|
197 |
+
'help' => 'font-demo.html'
|
198 |
+
),
|
199 |
+
|
200 |
+
array('name' => __('Site Base Font Size', 'weaver-xtreme' /*adm*/), 'id' => 'site_fontsize_int', 'type' => 'val_px',
|
201 |
+
'info' => __('Base font size of standard text. This value determines the default medium font size. Note that visitors can change their browser\'s font size, so final font size can vary, as expected. (Default: 16px)', 'weaver-xtreme' /*adm*/)),
|
202 |
+
|
203 |
+
array('name' => __('Site Base Line Height', 'weaver-xtreme' /*adm*/), 'id' => 'site_line_height_dec', 'type' => '+val_num',
|
204 |
+
'info' => __('Set the Base line-height. Most other line heights based on this multiplier. (Default: 1.5 - no units) (★Plus)', 'weaver-xtreme' /*adm*/)),
|
205 |
+
|
206 |
+
array('name' => '<small>' . __('Site Base Font Size - Small Tablets', 'weaver-xtreme' /*adm*/) . '</small>', 'id' => 'site_fontsize_tablet_int', 'type' => '+val_px',
|
207 |
+
'info' => __('Small Tablet base font size of standard text. (Default medium font size: 16px) (★Plus)', 'weaver-xtreme' /*adm*/)),
|
208 |
+
array('name' => '<small>' . __('Site Base Font Size - Phones', 'weaver-xtreme' /*adm*/) . '</small>', 'id' => 'site_fontsize_phone_int', 'type' => '+val_px',
|
209 |
+
'info' => __('Phone base font size of standard text. (Default medium font size: 16px) (★Plus)', 'weaver-xtreme' /*adm*/)),
|
210 |
+
|
211 |
+
array('name' => __('Custom Font Size A', 'weaver-xtreme' /*adm*/), 'id' => 'custom_fontsize_a', 'type' => '+val_em',
|
212 |
+
'info' => __('Specify font size in em for Custom Size A (★Plus)', 'weaver-xtreme' /*adm*/)),
|
213 |
+
array('name' => __('Custom Font Size B', 'weaver-xtreme' /*adm*/), 'id' => 'custom_fontsize_b', 'type' => '+val_em',
|
214 |
+
'info' => __('Specify font size in em for Custom Size B (★Plus)', 'weaver-xtreme' /*adm*/)),
|
215 |
+
|
216 |
+
array( 'type' => 'submit')
|
217 |
+
|
218 |
+
);
|
219 |
+
?>
|
220 |
+
<div class="options-intro"><strong><?php _e('Custom & Fonts:', 'weaver-xtreme' /*adm*/); ?> </strong>
|
221 |
+
<?php _e('Set values for Custom options and Fonts: Smart Margin, Borders, Corners, Shadows, Custom CSS, and Fonts', 'weaver-xtreme' /*adm*/); ?>
|
222 |
+
<br />
|
223 |
+
<div class="options-intro-menu">
|
224 |
+
<a href="#various-custom-values"><?php _e('Various Custom Values', 'weaver-xtreme' /*adm*/); ?></a> |
|
225 |
+
<a href="#custom-css-rules"><?php _e('Custom CSS Rules', 'weaver-xtreme' /*adm*/); ?></a> |
|
226 |
+
<a href="#fonts">Fonts</a>
|
227 |
+
</div>
|
228 |
+
</div>
|
229 |
+
<?php
|
230 |
+
weaverx_form_show_options($opts);
|
231 |
+
|
232 |
+
do_action('weaverxplus_admin','fonts');
|
233 |
+
}
|
234 |
+
|
235 |
+
|
236 |
+
// ======================== Main Options > Header ========================
|
237 |
+
function weaverx_mainopts_header() {
|
238 |
+
$opts = array(
|
239 |
+
array( 'type' => 'submit'),
|
240 |
+
array('name' => __('Header Options', 'weaver-xtreme' /*adm*/), 'icon' => '-admin-generic',
|
241 |
+
'id' => 'h-header-opts', 'type' => 'header',
|
242 |
+
'info' => __('Options affecting site Header', 'weaver-xtreme' /*adm*/),
|
243 |
+
'help' => 'help.html#HeaderOpt'),
|
244 |
+
|
245 |
+
|
246 |
+
array('name' => __('Header Area', 'weaver-xtreme' /*adm*/), 'id' => 'header', 'type' => 'widget_area',
|
247 |
+
'info' => __('Wraps the Header Area: menu bars, standard header image, title, tagline, header widget area', 'weaver-xtreme' /*adm*/)),
|
248 |
+
|
249 |
+
array('name' => __('Hide Search on Header', 'weaver-xtreme' /*adm*/),
|
250 |
+
'icon' => '-visibility',
|
251 |
+
'id' => 'header_search_hide', 'type' => 'select_hide',
|
252 |
+
'info' => __('Selectively hide the Search Box Button on top right of header', 'weaver-xtreme' /*adm*/)),
|
253 |
+
array('name' => '<small>' . __('Search Area Options:', 'weaver-xtreme' /*adm*/) . '</small>', 'type' => 'note',
|
254 |
+
'info' => __('Specify search icon, text and background colors Search section of Content Areas tab.', 'weaver-xtreme' /*adm*/)),
|
255 |
+
|
256 |
+
array( 'type' => 'submit'),
|
257 |
+
|
258 |
+
array('name' => __('Header Image', 'weaver-xtreme' /*adm*/), 'icon' => '-format-image',
|
259 |
+
'id' => 'h-hdr-img', 'type' =>'subheader',
|
260 |
+
'info' => __('Settings related to standard header image (Set on Appearance→Header)', 'weaver-xtreme' /*adm*/)),
|
261 |
+
|
262 |
+
array('name' => __('Hide Header Image', 'weaver-xtreme' /*adm*/),
|
263 |
+
'icon' => '-visibility',
|
264 |
+
'id' => 'hide_header_image', 'type' => 'select_hide',
|
265 |
+
'info' => __('Check to selectively hide standard header image', 'weaver-xtreme' /*adm*/)),
|
266 |
+
|
267 |
+
array('name' => '<small>' . __('Suggested Header Image Height', 'weaver-xtreme' /*adm*/) . '</small>',
|
268 |
+
'id' => 'header_image_height_int', 'type' => 'val_px',
|
269 |
+
'info' => __('Change the suggested height of the Header Image. Standard size is 188. This only affects the clipping window on the Appearance:Header page. Header images will be responsively sized. (Default header image width: theme width)', 'weaver-xtreme' /*adm*/)),
|
270 |
+
|
271 |
+
array('name' => '<span class="i-left" style="font-size:120%;">↔</span><small>' . __('Maximum Image Width', 'weaver-xtreme' /*adm*/) . '</small>',
|
272 |
+
'id' => 'header_image_max_width_dec', 'type' => '+val_percent',
|
273 |
+
'info' => __('Maximum width of Image (Default: 100%; (★Plus)', 'weaver-xtreme' /*adm*/)),
|
274 |
+
|
275 |
+
array('name' => '<small>' . __('Use Actual Image Size', 'weaver-xtreme' /*adm*/) . '</small>',
|
276 |
+
'id' => 'header_actual_size', 'type' => '+checkbox',
|
277 |
+
'info' => __('Check to use actual header image size, centered in header. (Default: theme width) (★Plus)', 'weaver-xtreme' /*adm*/)),
|
278 |
+
|
279 |
+
array('name' => __('Align Header Image', 'weaver-xtreme' /*adm*/) . '</small>', 'icon' => '-alignleft',
|
280 |
+
'id' => 'header_image_align', 'type' => '+align',
|
281 |
+
'info' => __('How to align header image - meaningful only when Max Width or Actual Size set. (★Plus)', 'weaver-xtreme' /*adm*/)),
|
282 |
+
|
283 |
+
array('name' => __('Hide Header Image Front Page', 'weaver-xtreme' /*adm*/) . '</small>', 'icon' => '-visibility',
|
284 |
+
'id' => 'hide_header_image_front', 'type' => 'checkbox',
|
285 |
+
'info' => __('Check to hide display of standard header image on front page only.', 'weaver-xtreme' /*adm*/)),
|
286 |
+
|
287 |
+
array( 'name' => '<span class="i-left">{ }</span> <small>' . __('Add Classes', 'weaver-xtreme' /*adm*/) . '</small>',
|
288 |
+
'id' => 'header_image_add_class', 'type' => '+widetext',
|
289 |
+
'info' => '<em>' . __('Header Image', 'weaver-xtreme' /*adm*/) . '</em>' . __(': Space separated class names to add to this area (<em>Advanced option</em>) (★Plus)', 'weaver-xtreme' /*adm*/) ),
|
290 |
+
|
291 |
+
array('name' => '<small>' . __('Header Image Links to Site', 'weaver-xtreme' /*adm*/) . '</small>', 'id' => 'link_site_image', 'type' => 'checkbox',
|
292 |
+
'info' => __('Check to add a link to site home page for Header Image. Note: If used with <em>Move Title/Tagline over Image</em>, parts of the header image will not be clickable.', 'weaver-xtreme' /*adm*/)),
|
293 |
+
|
294 |
+
array('name' => '<small>' . __('Alternate Header Images:', 'weaver-xtreme' /*adm*/) . '</small>', 'type' => 'note',
|
295 |
+
'info' => __('Specify alternate header images using the <em>Featured Image Location</em> options on the <em>Content Areas</em> tab for pages, or the <em>Post Specifics</em> tab for single post views.', 'weaver-xtreme' /*adm*/)),
|
296 |
+
|
297 |
+
|
298 |
+
array( 'type' => 'submit'),
|
299 |
+
|
300 |
+
|
301 |
+
array('name' => __('Site Title/Tagline', 'weaver-xtreme' /*adm*/), 'icon' => '-text',
|
302 |
+
'id' => 'h-title-tag', 'type' =>'subheader',
|
303 |
+
'info' => __('Settings related to the Site Title and Tagline (Tagline sometimes called Site Description)', 'weaver-xtreme' /*adm*/)),
|
304 |
+
|
305 |
+
|
306 |
+
array('name' => __('Site Title', 'weaver-xtreme' /*adm*/), 'id' => 'site_title', 'type' => 'titles',
|
307 |
+
'info' => __("The site's main title in the header (blog title)", 'weaver-xtreme' /*adm*/)),
|
308 |
+
|
309 |
+
array('name' => '<span class="i-left font-bold" style="font-size:120%;">⇌</span><small>' . __('Title Position', 'weaver-xtreme' /*adm*/) . '</small>',
|
310 |
+
'id' => 'site_title_position_xy', 'type' => 'text_xy_percent',
|
311 |
+
'info' => __('Adjust left and top margins for Title. Decimal and negative values allowed. (Default: X: 7%, Y:0.25%)', 'weaver-xtreme' /*adm*/)),
|
312 |
+
|
313 |
+
array('name' => '<span class="i-left" style="font-size:150%;">↔</span><small>' . __('Title Max Width', 'weaver-xtreme' /*adm*/) . '</small>', 'id' => 'site_title_max_w', 'type' => 'val_percent',
|
314 |
+
'info' => __("Maximum width of title in header area (Default: 90%)", 'weaver-xtreme' /*adm*/)),
|
315 |
+
|
316 |
+
array('name' => __('Hide Site Title', 'weaver-xtreme' /*adm*/) . '</small>', 'icon' => '-visibility',
|
317 |
+
'id' => 'hide_site_title', 'type' => 'select_hide',
|
318 |
+
'info' => __('Hide Site Title (Uses "display:none;" : SEO friendly.)', 'weaver-xtreme' /*adm*/)),
|
319 |
+
|
320 |
+
array('name' => __('Site Tagline', 'weaver-xtreme' /*adm*/), 'id' => 'tagline', 'type' => 'titles',
|
321 |
+
'info' => __("The site's tagline (blog description)", 'weaver-xtreme' /*adm*/)),
|
322 |
+
|
323 |
+
|
324 |
+
array('name' => '<span class="i-left font-bold" style="font-size:120%;">⇌</span><small>' . __('Tagline Position', 'weaver-xtreme' /*adm*/) . '</small>',
|
325 |
+
'id' => 'tagline_xy', 'type' => 'text_xy_percent',
|
326 |
+
'info' => __('Adjust default left and top margins for Tagline. (Default: X: 10% Y:0%)', 'weaver-xtreme' /*adm*/)),
|
327 |
+
array('name' => '<span class="i-left" style="font-size:150%;">↔</span><small>' . __('Tagline Max Width', 'weaver-xtreme' /*adm*/) . '</small>',
|
328 |
+
'id' => 'tagline_max_w', 'type' => 'val_percent',
|
329 |
+
'info' => __("Maximum width of Tagline in header area (Default: 90%)", 'weaver-xtreme' /*adm*/)),
|
330 |
+
|
331 |
+
array('name' => '<small>'. __('Hide Site Tagline', 'weaver-xtreme' /*adm*/) . '</small>', 'icon' => '-visibility',
|
332 |
+
'id' => 'hide_site_tagline', 'type' => 'select_hide',
|
333 |
+
'info' => __('Hide Site Tagline (Uses "display:none;" : SEO friendly.)', 'weaver-xtreme' /*adm*/)),
|
334 |
+
|
335 |
+
array('name' => __('Title/Tagline Area BG', 'weaver-xtreme' /*adm*/), 'id' => 'title_tagline_bgcolor', 'type' => 'ctext',
|
336 |
+
'info' => __('BG Color for the Title, Tagline, Search, Logo/HTML and Mini-Menu area.', 'weaver-xtreme' /*adm*/)),
|
337 |
+
|
338 |
+
array('name' => '<small>' . __('Site Logo/HTML', 'weaver-xtreme' /*adm*/) . '</small>', 'icon' => '-editor-code',
|
339 |
+
'id' => '_site_logo', 'type' => '+textarea',
|
340 |
+
'info' => __('HTML for Site Title area. (example: <img src="url" style="position:absolute;top:20px;left:20px;" /> + Custom CSS: #site-logo{min-height:123px;} (★Plus) (♦)', 'weaver-xtreme' /*adm*/)),
|
341 |
+
array('name' => '<small>'. __('Hide Site Logo/HTML', 'weaver-xtreme' /*adm*/) . '</small>', 'icon' => '-visibility',
|
342 |
+
'id' => '_hide_site_logo', 'type' => '+select_hide',
|
343 |
+
'info' => __('Hide Site Logo/HTML by device (★Plus) (♦)', 'weaver-xtreme' /*adm*/)),
|
344 |
+
|
345 |
+
array( 'name' => '<span class="i-left">{ }</span> <small>' . __('Add Classes', 'weaver-xtreme' /*adm*/) . '</small>',
|
346 |
+
'id' => 'site_title_add_class', 'type' => '+widetext',
|
347 |
+
'info' => '<em>' . __('Title/Tagline', 'weaver-xtreme' /*adm*/) . '</em>' . __(': Space separated class names to add to this area (<em>Advanced option</em>) (★Plus)', 'weaver-xtreme' /*adm*/) ),
|
348 |
+
|
349 |
+
|
350 |
+
array('name' => '<small>' . __('Move Title/Tagline over Image', 'weaver-xtreme' /*adm*/) . '</small>', 'id' => 'title_over_image', 'type' => 'checkbox',
|
351 |
+
'info' => __('Move the Title, Tagline, Search, Logo/HTML and Mini-Menu over the Header Image.', 'weaver-xtreme' /*adm*/)),
|
352 |
+
|
353 |
+
|
354 |
+
|
355 |
+
array( 'type' => 'submit'),
|
356 |
+
|
357 |
+
|
358 |
+
array('name' => __('The Header Mini-Menu', 'weaver-xtreme' /*adm*/), 'icon' => '-menu',
|
359 |
+
'id' => 'h-hdr-mini-menu', 'type' =>'subheader',
|
360 |
+
'info' => __('Horizontal "Mini-Menu" displayed right-aligned of Site Tagline', 'weaver-xtreme' /*adm*/)),
|
361 |
+
array('name' => __('Note:', 'weaver-xtreme' /*adm*/), 'type' => 'note',
|
362 |
+
'info' => __('The Header Mini-Menu options are on the Menu Tab.', 'weaver-xtreme' /*adm*/)),
|
363 |
+
|
364 |
+
array('name' => __('Header Widget Area', 'weaver-xtreme' /*adm*/), 'id' => 'header_sb', 'type' => 'widget_area',
|
365 |
+
'info' => __('Horizontal Header Widget Area', 'weaver-xtreme' /*adm*/)),
|
366 |
+
array('name' => '<small>' . __('Header Widget Area Position', 'weaver-xtreme' /*adm*/) . '</small>',
|
367 |
+
'id' => 'header_sb_position', 'type' => '+select_id', //code
|
368 |
+
'info' => __('Change where Header Widget Area is displayed. (Default: Top) (★Plus)', 'weaver-xtreme' /*adm*/),
|
369 |
+
'value' => array(
|
370 |
+
array('val' => 'top', 'desc' => __('Top of Header', 'weaver-xtreme' /*adm*/)),
|
371 |
+
array('val' => 'before_header', 'desc' => __('Before Header Image', 'weaver-xtreme' /*adm*/)),
|
372 |
+
array('val' => 'after_header', 'desc' => __('After Header Image', 'weaver-xtreme' /*adm*/)),
|
373 |
+
array('val' => 'after_html', 'desc' => __('After HTML Block', 'weaver-xtreme' /*adm*/)),
|
374 |
+
array('val' => 'after_menu', 'desc' => __('After Lower Menu', 'weaver-xtreme' /*adm*/)),
|
375 |
+
)),
|
376 |
+
|
377 |
+
array( 'type' => 'submit'),
|
378 |
+
|
379 |
+
array('name' => __('Header HTML', 'weaver-xtreme' /*adm*/), 'id' => 'header_html', 'type' => 'widget_area',
|
380 |
+
'info' => __('Add arbitrary HTML to Header Area (in <div id="header-html">)', 'weaver-xtreme' /*adm*/)),
|
381 |
+
|
382 |
+
|
383 |
+
array('name' => '<span class="i-left dashicons dashicons-editor-code"></span>' . __('Header HTML content', 'weaver-xtreme' /*adm*/),
|
384 |
+
'id' => 'header_html_text', 'type' => 'textarea',
|
385 |
+
'placeholder' => __('Any HTML, including shortcodes', 'weaver-xtreme' /*adm*/),
|
386 |
+
'info' => __('Add arbitrary HTML to Header Area (in <div id="header-html">)', 'weaver-xtreme' /*adm*/), 'val' => 4 ),
|
387 |
+
|
388 |
+
array( 'type' => 'submit'),
|
389 |
+
|
390 |
+
array('name' => __('Note:', 'weaver-xtreme' /*adm*/), 'type' => 'note',
|
391 |
+
'info' => __('There are more standard WordPress Header options available on the Dashboard Appearance->Header panel.', 'weaver-xtreme' /*adm*/)),
|
392 |
+
);
|
393 |
+
|
394 |
+
?>
|
395 |
+
<div class="options-intro">
|
396 |
+
<?php _e('<strong>Header:</strong> Options affecting the Header Area at the top of your site.', 'weaver-xtreme' /*adm*/); ?>
|
397 |
+
<br />
|
398 |
+
<div class="options-intro-menu"> <a href="#header-area"><?php _e('Header Area', 'weaver-xtreme' /*adm*/); ?></a> |
|
399 |
+
<a href="#header-image"><?php _e('Header Image', 'weaver-xtreme' /*adm*/); ?></a> |
|
400 |
+
<a href="#site-titletagline"><?php _e('Site Title/Tagline', 'weaver-xtreme' /*adm*/); ?></a> |
|
401 |
+
<a href="#header-widget-area"><?php _e('Header Widget Area', 'weaver-xtreme' /*adm*/); ?></a>|
|
402 |
+
<a href="#header-html"><?php _e('Header HTML', 'weaver-xtreme' /*adm*/); ?></a>
|
403 |
+
</div>
|
404 |
+
</div>
|
405 |
+
<?php
|
406 |
+
weaverx_form_show_options($opts);
|
407 |
+
|
408 |
+
do_action('weaverxplus_admin','header_opts');
|
409 |
+
}
|
410 |
+
|
411 |
+
// ======================== Main Options > Menus ========================
|
412 |
+
function weaverx_mainopts_menus() {
|
413 |
+
$opts = array(
|
414 |
+
array( 'type' => 'submit'),
|
415 |
+
array('name' => __('Menu & Info Bars', 'weaver-xtreme' /*adm*/), 'icon' => '-menu',
|
416 |
+
'id' => 'h-info-bars', 'type' => 'header',
|
417 |
+
'info' => __('Options affecting site Menus and the Info Bar', 'weaver-xtreme' /*adm*/),
|
418 |
+
'help' => 'help.html#MenuBar'),
|
419 |
+
|
420 |
+
|
421 |
+
##### SmartMenu
|
422 |
+
array('name' => '<span class="i-left dashicons dashicons-menu"></span>' . __('Use SmartMenus', 'weaver-xtreme' /*adm*/),
|
423 |
+
'id' => 'use_smartmenus', 'type' => '+checkbox',
|
424 |
+
'info' => __('Use <em>SmartMenus</em> rather than default Weaver Xtreme Menus. <em>SmartMenus</em> provide enhanced menu support, including auto-visibility, and transition effects. Applies to all menus. Additional options for SmartMenus on the <em>Xtreme Plus:SmartMenus</em> tab. (★Plus)', 'weaver-xtreme' /*adm*/)),
|
425 |
+
|
426 |
+
array( 'name' => '<small>' . __('Menu Mobile/Desktop Switch Point', 'weaver-xtreme' /*adm*/) . '</small>',
|
427 |
+
'id' => 'mobile_alt_switch', 'type' => '+val_px',
|
428 |
+
'info' => __('<em>SmartMenus Only:</em> Set when menu bars switch from desktop to mobile. (Default: 767px. Hint: use 768 to force mobile menu on iPad portrait.) (★Plus)', 'weaver-xtreme' /*adm*/) ),
|
429 |
+
|
430 |
+
array('name' => __('Mega Menus:', 'weaver-xtreme' /*adm*/), 'type' => 'note',
|
431 |
+
'info' => __('Weaver Xtreme Plus allows you to define Mega Menu style dropdown menu items with arbitrary HTML content. (★Plus)', 'weaver-xtreme' /*adm*/)),
|
432 |
+
|
433 |
+
|
434 |
+
|
435 |
+
array('name' => __('Primary Menu Bar', 'weaver-xtreme' /*adm*/), 'id' => 'm_primary', 'type' => 'menu_opts',
|
436 |
+
'info' => __('Attributes for the Primary Menu Bar (Default Location: Bottom of Header)', 'weaver-xtreme' /*adm*/)),
|
437 |
+
|
438 |
+
array('name' => '<small>' . __('No Home Menu Item', 'weaver-xtreme' /*adm*/) . '</small>', 'id' => 'menu_nohome', 'type' => 'checkbox',
|
439 |
+
'info' => __('Don\'t automatically add Home menu item for home page (as defined in Settings->Reading)', 'weaver-xtreme' /*adm*/)),
|
440 |
+
|
441 |
+
|
442 |
+
// array('name' => '<span class="i-left" style="font-size:150%;">↔</span><small> ' . __('Mobile Menu Trigger', 'weaver-xtreme' /*adm*/). '</small>',
|
443 |
+
// 'id' => 'menu_primary_trigger_int', 'type' => 'val_px',
|
444 |
+
// 'info' => __('Set trigger width where Primary Menu changes to/from Mobile Menu (Default: 768px, value must be < 768)', 'weaver-xtreme' /*adm*/)),
|
445 |
+
|
446 |
+
|
447 |
+
array( 'type' => 'submit'),
|
448 |
+
|
449 |
+
array('name' => __('Secondary Menu Bar', 'weaver-xtreme' /*adm*/), 'id' => 'm_secondary', 'type' => 'menu_opts',
|
450 |
+
'info' => __('Attributes for the Secondary Menu Bar (Default Location: Top of Header)', 'weaver-xtreme' /*adm*/)),
|
451 |
+
|
452 |
+
// array('name' => '<span class="i-left" style="font-size:150%;">↔</span><small> ' . __('Mobile Menu Trigger', 'weaver-xtreme' /*adm*/). '</small>',
|
453 |
+
// 'id' => 'menu_secondary_trigger_int', 'type' => 'val_px',
|
454 |
+
// 'info' => __('Set trigger width where Secondary Menu changes to/from Mobile Menu (Default: 768px, value must be < 768)', 'weaver-xtreme' /*adm*/)),
|
455 |
+
|
456 |
+
|
457 |
+
array( 'type' => 'submit'),
|
458 |
+
|
459 |
+
|
460 |
+
array('name' => __('Options: All Menus', 'weaver-xtreme' /*adm*/), 'icon' => '-forms',
|
461 |
+
'id' => 'h-all-menu-opts', 'type' => 'subheader_alt',
|
462 |
+
'info' => __('Menu Bar enhancements and features', 'weaver-xtreme' /*adm*/)),
|
463 |
+
|
464 |
+
|
465 |
+
array('name' => __('Current Page BG', 'weaver-xtreme' /*adm*/), 'id' => 'menubar_curpage_bgcolor', 'type' => 'ctext',
|
466 |
+
'info' => __('BG Color for the currently displayed page and its ancestors.', 'weaver-xtreme' /*adm*/)),
|
467 |
+
array('name' => __('Current Page Text', 'weaver-xtreme' /*adm*/), 'id' => 'menubar_curpage_color', 'type' => 'color',
|
468 |
+
'info' => __('Color for the currently displayed page and its ancestors.', 'weaver-xtreme' /*adm*/)),
|
469 |
+
|
470 |
+
|
471 |
+
array('name' => '<span class="i-left dashicons dashicons-editor-bold"></span><small>' . __('Bold Current Page', 'weaver-xtreme' /*adm*/) . '</small>', 'id' => 'menubar_curpage_bold', 'type' => 'checkbox',
|
472 |
+
'info' => __('Bold Face Current Page and ancestors', 'weaver-xtreme' /*adm*/)),
|
473 |
+
array('name' => '<span class="i-left dashicons dashicons-editor-italic"></span><small>' . __('Italic Current Page', 'weaver-xtreme' /*adm*/) . '</small>', 'id' => 'menubar_curpage_em', 'type' => 'checkbox',
|
474 |
+
'info' => __('Italic Current Page and ancestors', 'weaver-xtreme' /*adm*/)),
|
475 |
+
array('name' => '<small>' . __('Do Not Highlight Ancestors', 'weaver-xtreme' /*adm*/) . '</small>',
|
476 |
+
'id' => 'menubar_curpage_noancestors', 'type' => 'checkbox',
|
477 |
+
'info' => __('Highlight Current Page only - do not also highlight ancestor items', 'weaver-xtreme' /*adm*/)),
|
478 |
+
array( 'name' => '<small>' . __('Placeholder Hover Cursor', 'weaver-xtreme' /*adm*/) . '</small>',
|
479 |
+
'id' => 'placeholder_cursor', 'type' => 'widetext',
|
480 |
+
'info' => __('CSS cursor :hover attribute for placeholder menus (e.g., Custom Menus with URL==#).
|
481 |
+
(Default: pointer. Suggested: context-menu or text.)', 'weaver-xtreme' /*adm*/)),
|
482 |
+
|
483 |
+
|
484 |
+
array( 'type' => 'submit'),
|
485 |
+
|
486 |
+
array('name' => __('Header Mini-Menu', 'weaver-xtreme' /*adm*/), 'icon' => '-menu',
|
487 |
+
'id' => 'h-hdr-mmenu', 'type' =>'subheader_alt',
|
488 |
+
'info' => __('Horizontal "Mini-Menu" displayed right-aligned of Site Tagline', 'weaver-xtreme' /*adm*/)),
|
489 |
+
|
490 |
+
|
491 |
+
array('name' => __('Mini-Menu', 'weaver-xtreme' /*adm*/), 'id' => 'm_header_mini', 'type' => 'titles_text',
|
492 |
+
'info' => __('Color of Mini-Menu Link Items', 'weaver-xtreme' /*adm*/)),
|
493 |
+
|
494 |
+
array('name' => '<small>' . __('Mini-Menu Hover', 'weaver-xtreme' /*adm*/) . '</small>', 'id' => 'm_header_mini_hover_color', 'type' => 'ctext',
|
495 |
+
'info' => __('Hover Color for Mini-Menu Links', 'weaver-xtreme' /*adm*/)),
|
496 |
+
|
497 |
+
array('name' => '<small>' . __('Mini Menu Top Margin', 'weaver-xtreme' /*adm*/) . '</small>',
|
498 |
+
'id' => 'm_header_mini_top_margin_dec', 'type' => 'val_em',
|
499 |
+
'info' => __('Top margin for Mini-Menu. Negative value moves it up. (Default: -1.0em)', 'weaver-xtreme' /*adm*/)),
|
500 |
+
|
501 |
+
array('name' => '<small>' . __('Hide Mini Menu', 'weaver-xtreme' /*adm*/) . '</small>', 'icon' => '-visibility',
|
502 |
+
'id' => 'm_header_mini_hide', 'type' => 'select_hide',
|
503 |
+
'info' => __('Hide Mini Menu', 'weaver-xtreme' /*adm*/)),
|
504 |
+
|
505 |
+
|
506 |
+
array( 'type' => 'submit'),
|
507 |
+
|
508 |
+
|
509 |
+
array('name' => __('Info Bar', 'weaver-xtreme' /*adm*/), 'id' => 'infobar', 'type' => 'widget_area',
|
510 |
+
'info' => __('Info Bar : Breadcrumbs & Page Nav below primary menu', 'weaver-xtreme' /*adm*/)),
|
511 |
+
|
512 |
+
|
513 |
+
array('name' => '<span class="i-left dashicons dashicons-visibility"></span>' . __('Hide Breadcrumbs', 'weaver-xtreme' /*adm*/),
|
514 |
+
'id' => 'info_hide_breadcrumbs', 'type' => 'checkbox',
|
515 |
+
'info' => __('Do not display the Breadcrumbs', 'weaver-xtreme' /*adm*/)),
|
516 |
+
array('name' => '<span class="i-left dashicons dashicons-visibility"></span>' . __('Hide Page Navigation', 'weaver-xtreme' /*adm*/),
|
517 |
+
'id' => 'info_hide_pagenav', 'type' => 'checkbox',
|
518 |
+
'info' => __('Do not display the numbered Page navigation', 'weaver-xtreme' /*adm*/)),
|
519 |
+
array('name' => '<span class="i-left dashicons dashicons-visibility"></span>' . __('Show Search box', 'weaver-xtreme' /*adm*/),
|
520 |
+
'id' => 'info_search', 'type' => 'checkbox',
|
521 |
+
'info' => __('Include a Search box on the right', 'weaver-xtreme' /*adm*/)),
|
522 |
+
array('name' => '<span class="i-left dashicons dashicons-visibility"></span>' . __('Show Log In', 'weaver-xtreme' /*adm*/), 'id' => 'info_addlogin', 'type' => 'checkbox',
|
523 |
+
'info' => __('Include a simple Log In link on the right', 'weaver-xtreme' /*adm*/)),
|
524 |
+
|
525 |
+
array('name' => __('Breadcrumb for Home', 'weaver-xtreme' /*adm*/), 'id' =>'info_home_label' , 'type' => 'widetext', //code - option done in code
|
526 |
+
'info' => __('This lets you change the breadcrumb label for your home page. (Default: Home)', 'weaver-xtreme' /*adm*/)),
|
527 |
+
array('name' => __('Info Bar Links', 'weaver-xtreme' /*adm*/), 'id' => 'ibarlink', 'type' => 'link',
|
528 |
+
'info' => __('Color for links in Info Bar (uses Standard Link colors if left blank)', 'weaver-xtreme' /*adm*/))
|
529 |
+
);
|
530 |
+
|
531 |
+
?>
|
532 |
+
<div class="options-intro">
|
533 |
+
<?php _e('<strong>Menus:</strong> Options to control how your menus look.', 'weaver-xtreme' /*adm*/); ?><br />
|
534 |
+
<div class="options-intro-menu">
|
535 |
+
<a href="#primary-menu-bar"><?php _e('Primary Menu Bar', 'weaver-xtreme' /*adm*/); ?></a> |
|
536 |
+
<a href="#secondary-menu-bar"><?php _e('Secondary Menu Bar', 'weaver-xtreme' /*adm*/); ?></a> |
|
537 |
+
<a href="#options-all-menus"><?php _e('Options: All Menus', 'weaver-xtreme' /*adm*/); ?></a> |
|
538 |
+
<a href="#header-mini-menu"><?php _e('Header Mini-Menu', 'weaver-xtreme' /*adm*/); ?></a> |
|
539 |
+
<a href="#info-bar"><?php _e('Info Bar', 'weaver-xtreme' /*adm*/); ?></a> |
|
540 |
+
<a href="#extra-menu"><?php _e('Extra Menu (X-Plus)', 'weaver-xtreme' /*adm*/); ?></a>
|
541 |
+
</div>
|
542 |
+
</div>
|
543 |
+
<?php
|
544 |
+
|
545 |
+
$all_opts = apply_filters('weaverxplus_menu_inject', $opts);
|
546 |
+
|
547 |
+
weaverx_form_show_options($all_opts);
|
548 |
+
|
549 |
+
}
|
550 |
+
|
551 |
+
|
552 |
+
// ======================== Main Options > Content Areas ========================
|
553 |
+
function weaverx_mainopts_content() {
|
554 |
+
$opts = array(
|
555 |
+
array( 'type' => 'submit'),
|
556 |
+
array('name' => __('Content Areas', 'weaver-xtreme' /*adm*/), 'icon' => '-admin-page',
|
557 |
+
'id' => 'h-content-areas', 'type' => 'header',
|
558 |
+
'info' => __('Settings for the content areas (posts and pages)', 'weaver-xtreme' /*adm*/),
|
559 |
+
'toggle' => 'content-areas',
|
560 |
+
'help' => 'help.html#ContentAreas'),
|
561 |
+
|
562 |
+
array('name' => __('Content Area', 'weaver-xtreme' /*adm*/), 'id' => 'content', 'type' => 'widget_area',
|
563 |
+
'info' => __('Area properties for page and post content', 'weaver-xtreme' /*adm*/)),
|
564 |
+
|
565 |
+
array('name' => __('Page Title', 'weaver-xtreme' /*adm*/), 'id' => 'page_title', 'type' => 'titles',
|
566 |
+
'info' => __('Page titles, including pages, post single pages, and archive-like pages.', 'weaver-xtreme' /*adm*/)),
|
567 |
+
array('name' => '<small>' . __('Bar under Title', 'weaver-xtreme' /*adm*/) . '</small>', 'id' => 'page_title_underline_int', 'type' => 'val_px',
|
568 |
+
'info' => __('Enter size in px if you want a bar under page title. Leave blank or 0 for no bar.', 'weaver-xtreme' /*adm*/)),
|
569 |
+
array('name' => '<small>' . __('Space Between Title and Content', 'weaver-xtreme' /*adm*/) . '</small>', 'id' => 'space_after_title_dec', 'type' => 'val_em',
|
570 |
+
'info' => __('Space between Page or Post title and beginning of content (Default: 1.0em)', 'weaver-xtreme' /*adm*/)),
|
571 |
+
|
572 |
+
array('name' => __('Archive Pages Title', 'weaver-xtreme' /*adm*/), 'id' => 'archive_title', 'type' => 'titles',
|
573 |
+
'info' => __('Archive-like page titles: archives, categories, tags, searches.', 'weaver-xtreme' /*adm*/)),
|
574 |
+
|
575 |
+
array('name' => __('Content Links', 'weaver-xtreme' /*adm*/), 'id' => 'contentlink', 'type' => 'link',
|
576 |
+
'info' => __('Color for links in Content', 'weaver-xtreme' /*adm*/)),
|
577 |
+
|
578 |
+
array('name' => __('Content Headings', 'weaver-xtreme' /*adm*/), 'id' => 'content_h', 'type' => '+titles',
|
579 |
+
'info' => __('Headings (<h1>-<h6>) in page and post content (★Plus)', 'weaver-xtreme' /*adm*/)),
|
580 |
+
|
581 |
+
array( 'type' => 'submit'),
|
582 |
+
|
583 |
+
array('name' => __('Text', 'weaver-xtreme' /*adm*/), 'icon' => '-text',
|
584 |
+
'id' => 'h-text-related', 'type'=>'subheader_alt',
|
585 |
+
'info' => __('Text related options', 'weaver-xtreme' /*adm*/)),
|
586 |
+
|
587 |
+
array('name' => '<small>' . __('Space after paragraphs and lists', 'weaver-xtreme' /*adm*/) . '</small>', 'id' => 'content_p_list_dec', 'type' => 'val_em',
|
588 |
+
'info' => __('Space after paragraphs and lists (Recommended: 1.5 em)', 'weaver-xtreme' /*adm*/)),
|
589 |
+
|
590 |
+
array('name' => '<small>' . __('Page/Post Editor BG', 'weaver-xtreme' /*adm*/) . '</small>', 'id' => 'editor_bgcolor', 'type' => 'ctext',
|
591 |
+
'info' => __('Alternative Background Color to use for Page/Post editor if you\'re using transparent or image backgrounds.','weaver-xtreme' /*adm*/)),
|
592 |
+
|
593 |
+
array('name' => '<small>' . __('Input Area BG', 'weaver-xtreme' /*adm*/) . '</small>', 'id' => 'input_bgcolor', 'type' => 'ctext',
|
594 |
+
'info' => __('Background color for text input (textareas) boxes.', 'weaver-xtreme' /*adm*/)),
|
595 |
+
array('name' => '<small>' . __('Input Area Text', 'weaver-xtreme' /*adm*/) . '</small>', 'id' => 'input_color', 'type' => 'color',
|
596 |
+
'info' => __('Text color for text input (textareas) boxes.', 'weaver-xtreme' /*adm*/)),
|
597 |
+
|
598 |
+
array('name' => '<small>' . __('Auto Hyphenation', 'weaver-xtreme' /*adm*/) . '</small>', 'id' => 'hyphenate', 'type' => 'checkbox',
|
599 |
+
'info' => __('Allow browsers to automatically hyphenate text for appearance.', 'weaver-xtreme' /*adm*/)),
|
600 |
+
|
601 |
+
array('name' => '<span class="i-left" style=font-size:120%;"> ☷</span>' . __('Columns', 'weaver-xtreme' /*adm*/), 'id' => 'page_cols', 'type' => 'select_id', //code
|
602 |
+
'info' => __('Automatically split all page content into columns using CSS column rules. Also can use Per Page option. (Always 1 column on IE<=9.)', 'weaver-xtreme' /*adm*/),
|
603 |
+
'value' => array(
|
604 |
+
array('val' => '1', 'desc' => __('1 Column', 'weaver-xtreme' /*adm*/)),
|
605 |
+
array('val' => '2', 'desc' => __('2 Columns', 'weaver-xtreme' /*adm*/)),
|
606 |
+
array('val' => '3', 'desc' => __('3 Columns', 'weaver-xtreme' /*adm*/)),
|
607 |
+
array('val' => '4', 'desc' => __('4 Columns', 'weaver-xtreme' /*adm*/)))
|
608 |
+
),
|
609 |
+
|
610 |
+
|
611 |
+
array('name' => __('Search Boxes', 'weaver-xtreme' /*adm*/), 'icon' => '-search',
|
612 |
+
'id' => 'h-search-boxes', 'type'=>'subheader_alt',
|
613 |
+
'info' => __('Search box related options', 'weaver-xtreme' /*adm*/)),
|
614 |
+
|
615 |
+
array('name' => '<small>' . __('Search Input BG', 'weaver-xtreme' /*adm*/) . '</small>', 'id' => 'search_bgcolor', 'type' => 'ctext',
|
616 |
+
'info' => __('Background color for search input boxes.', 'weaver-xtreme' /*adm*/)),
|
617 |
+
array('name' => '<small>' . __('Search Input Text', 'weaver-xtreme' /*adm*/) . '</small>', 'id' => 'search_color', 'type' => 'color',
|
618 |
+
'info' => __('Text color for search input boxes.', 'weaver-xtreme' /*adm*/)),
|
619 |
+
|
620 |
+
array('name' => '<small>' . __('Search Icon', 'weaver-xtreme' /*adm*/) . '</small>', 'id' => 'search_icon', 'type' => 'radio', //code
|
621 |
+
'info' => __('Search Icon - used for both Header and Search Widgets.', 'weaver-xtreme' /*adm*/),
|
622 |
+
'value' => array(
|
623 |
+
array('val' => 'black'),
|
624 |
+
array('val' => 'gray'),
|
625 |
+
array('val' => 'light'),
|
626 |
+
array('val' => 'white'),
|
627 |
+
array('val' => 'black-bg'),
|
628 |
+
array('val' => 'gray-bg'),
|
629 |
+
array('val' => 'white-bg'),
|
630 |
+
array('val' => 'blue-bg'),
|
631 |
+
array('val' => 'green-bg'),
|
632 |
+
array('val' => 'orange-bg'),
|
633 |
+
array('val' => 'red-bg'),
|
634 |
+
array('val' => 'yellow-bg'),
|
635 |
+
)),
|
636 |
+
|
637 |
+
|
638 |
+
array( 'type' => 'submit'),
|
639 |
+
array('name' => __('Images', 'weaver-xtreme' /*adm*/), 'icon' => '-format-image',
|
640 |
+
'id' => 'h-img-opts', 'type'=>'subheader_alt',
|
641 |
+
'info' => __('Image related options', 'weaver-xtreme' /*adm*/)),
|
642 |
+
array('name' => '<small>' . __('Image Border Color', 'weaver-xtreme' /*adm*/) . '</small>', 'id' => 'media_lib_border_color', 'type' => 'ctext',
|
643 |
+
'info' => __('Border color for images in Container and Footer.', 'weaver-xtreme' /*adm*/)),
|
644 |
+
array('name' => '<span class="i-left" style="font-size:150%;">↔</span><small>' . __('Image Border Width', 'weaver-xtreme' /*adm*/) . '</small>',
|
645 |
+
'id' => 'media_lib_border_int', 'type' => 'val_px',
|
646 |
+
'info' => __('Border width for images in Container and Footer. (Leave blank or set to 0 for no image borders.)', 'weaver-xtreme' /*adm*/)),
|
647 |
+
|
648 |
+
array('name' => '<span class="i-left dashicons dashicons-admin-page"></span><small>' . __('Show Image Shadows', 'weaver-xtreme' /*adm*/) . '</small>',
|
649 |
+
'id' => 'show_img_shadows', 'type' => 'checkbox',
|
650 |
+
'info' => __('Add a shadow to images in Container and Footer. Add CSS+ to Border Color for custom shadow.', 'weaver-xtreme' /*adm*/)),
|
651 |
+
|
652 |
+
array('name' => '<small>' . __('Restrict Borders to Media Library', 'weaver-xtreme' /*adm*/) . '</small>', 'id' => 'restrict_img_border', 'type' => 'checkbox',
|
653 |
+
'info' => __('For Container and Footer, restrict border and shadows to images from Media Library. Manually entered <img> HTML without Media Library classes will not have borders.', 'weaver-xtreme' /*adm*/)),
|
654 |
+
|
655 |
+
array('name' => '<small>' . __('Caption text color', 'weaver-xtreme' /*adm*/) . '</small>', 'id' => 'caption_color', 'type' => 'ctext',
|
656 |
+
'info' => __('Color of captions - e.g., below media images.', 'weaver-xtreme' /*adm*/)),
|
657 |
+
|
658 |
+
array('name' => __('Featured Image - Pages', 'weaver-xtreme' /*adm*/), 'icon' => '-id',
|
659 |
+
'id' => 'h-fi-pages', 'type'=>'subheader_alt',
|
660 |
+
'info' => __('Display of Page Featured Images', 'weaver-xtreme' /*adm*/)),
|
661 |
+
array('name' => '<span class="i-left" style=font-size:120%;"> ⤪</span>' . __('Featured Image Location', 'weaver-xtreme' /*adm*/),
|
662 |
+
'id' => 'page_fi_location', 'type' => 'fi_location',
|
663 |
+
'info' => __('Where to display Featured Image for Pages','weaver-xtreme' /*adm*/)),
|
664 |
+
array('name' => '<span class="i-left dashicons dashicons-editor-alignleft"></span><small>' . __('Featured Image Alignment<small>', 'weaver-xtreme' /*adm*/), 'id' => 'page_fi_align', 'type' => 'fi_align',
|
665 |
+
'info' => __('How to align the Featured Image', 'weaver-xtreme' /*adm*/)),
|
666 |
+
|
667 |
+
array('name' => '<small>' . __('Hide Featured Image on Pages', 'weaver-xtreme' /*adm*/) . '</small>', 'icon' => '-visibility',
|
668 |
+
'id' => 'page_fi_hide', 'type' => 'select_hide',
|
669 |
+
'info' => __('Where to hide Featured Images on Pages (Posts have their own setting.)', 'weaver-xtreme' /*adm*/)),
|
670 |
+
|
671 |
+
array ('name' => '<small>' . __('Page Featured Image Size', 'weaver-xtreme' /*adm*/) . '</small>',
|
672 |
+
'id' => 'page_fi_size', 'type' => 'select_id',
|
673 |
+
'info' => __('Media Library Image Size for Featured Image on pages. (Header uses full size).', 'weaver-xtreme' /*adm*/),
|
674 |
+
'value' => array(
|
675 |
+
array('val' => 'thumbnail', 'desc' => __('Thumbnail (default)', 'weaver-xtreme' /*adm*/)),
|
676 |
+
array('val' => 'medium', 'desc' => __('Medium', 'weaver-xtreme' /*adm*/)),
|
677 |
+
array('val' => 'large', 'desc' => __('Large', 'weaver-xtreme' /*adm*/)),
|
678 |
+
array('val' => 'full', 'desc' => __('Full', 'weaver-xtreme' /*adm*/)))
|
679 |
+
),
|
680 |
+
array('name' => '<span class="i-left" style="font-size:150%;">↔</span><small>' . __('Featured Image Width, Pages', 'weaver-xtreme' /*adm*/) . '</small>',
|
681 |
+
'id' => 'page_fi_width', 'type' => '+val_percent',
|
682 |
+
'info' => __('Width of Featured Image on Pages. Max Width in %, overrides FI Size selection. (★Plus)', 'weaver-xtreme' /*adm*/) ),
|
683 |
+
|
684 |
+
array('name' => __('Lists - <HR> - Tables', 'weaver-xtreme' /*adm*/), 'icon' => '-list-view',
|
685 |
+
'id' => 'h-list-tables', 'type'=>'subheader_alt',
|
686 |
+
'info' => __('Other options related to content', 'weaver-xtreme' /*adm*/)),
|
687 |
+
array ('name' => __('Content List Bullet', 'weaver-xtreme' /*adm*/),
|
688 |
+
'id' => 'contentlist_bullet', 'type' => 'select_id',
|
689 |
+
'info' => __('Bullet used for Unordered Lists in Content areas', 'weaver-xtreme' /*adm*/),
|
690 |
+
'value' => array(
|
691 |
+
array('val' => 'disc', 'desc' => __('Filled Disc (default)', 'weaver-xtreme' /*adm*/)),
|
692 |
+
array('val' => 'circle', 'desc' => __('Circle', 'weaver-xtreme' /*adm*/)),
|
693 |
+
array('val' => 'square', 'desc' => __('Square', 'weaver-xtreme' /*adm*/)),
|
694 |
+
array('val' => 'none', 'desc' => __('None', 'weaver-xtreme' /*adm*/)))
|
695 |
+
),
|
696 |
+
|
697 |
+
array('name' => __('<HR> color', 'weaver-xtreme' /*adm*/), 'id' => 'hr_color', 'type' => 'ctext',
|
698 |
+
'info' => __('Color of horizontal (<hr>) lines in posts and pages.', 'weaver-xtreme' /*adm*/)),
|
699 |
+
|
700 |
+
array ('name' => __('Table Style', 'weaver-xtreme' /*adm*/), 'id' => 'weaverx_tables', 'type' => 'select_id',
|
701 |
+
'info' => __('Style used for tables in content.', 'weaver-xtreme' /*adm*/),
|
702 |
+
'value' => array(
|
703 |
+
array('val' => 'default', 'desc' => __('Theme Default', 'weaver-xtreme' /*adm*/)),
|
704 |
+
array('val' => 'bold', 'desc' => __('Bold Headings', 'weaver-xtreme' /*adm*/)),
|
705 |
+
array('val' => 'noborders', 'desc' => __('No Borders', 'weaver-xtreme' /*adm*/)),
|
706 |
+
array('val' => 'fullwidth', 'desc' => __('Wide', 'weaver-xtreme' /*adm*/)),
|
707 |
+
array('val' => 'wide', 'desc' => __('Wide 2', 'weaver-xtreme' /*adm*/)),
|
708 |
+
array('val' => 'plain', 'desc' => __('Minimal', 'weaver-xtreme' /*adm*/)))
|
709 |
+
),
|
710 |
+
|
711 |
+
array('name' => __('Comments', 'weaver-xtreme' /*adm*/), 'icon' => '-admin-comments',
|
712 |
+
'id' => 'h-comments', 'type' => 'subheader',
|
713 |
+
'info' => __('Settings for displaying comments', 'weaver-xtreme' /*adm*/)),
|
714 |
+
array('name' => __('Comment Headings', 'weaver-xtreme' /*adm*/), 'id' => 'comment_headings_color', 'type' => 'ctext',
|
715 |
+
'info' => __('Color for various headings in comment form', 'weaver-xtreme' /*adm*/)),
|
716 |
+
array('name' => __('Comment Content BG', 'weaver-xtreme' /*adm*/), 'id' => 'comment_content_bgcolor', 'type' => 'ctext',
|
717 |
+
'info' => __('BG Color of Comment Content area', 'weaver-xtreme' /*adm*/)),
|
718 |
+
array('name' => __('Comment Submit Button BG', 'weaver-xtreme' /*adm*/), 'id' => 'comment_submit_bgcolor', 'type' => 'ctext',
|
719 |
+
'info' => __('BG Color of "Post Comment" submit button', 'weaver-xtreme' /*adm*/)),
|
720 |
+
array('name' => '<span class="i-left" style="font-size:200%;margin-left:4px;">□</span><small>' . __('Show Borders on Comments', 'weaver-xtreme' /*adm*/) . '</small>',
|
721 |
+
'id' => 'show_comment_borders', 'type' => 'checkbox',
|
722 |
+
'info' => __('Show Borders around comment sections - improves visual look of comments.', 'weaver-xtreme' /*adm*/)),
|
723 |
+
|
724 |
+
array('name' => '<small>' . __('Hide Old Comments When Closed', 'weaver-xtreme' /*adm*/) . '</small>', 'icon' => '-visibility',
|
725 |
+
'id' => 'hide_old_comments', 'type' => '+checkbox',
|
726 |
+
'info' => __('Hide previous comments after closing comments for page or post. (Default: show old comments after closing.) (★Plus)', 'weaver-xtreme' /*adm*/)),
|
727 |
+
array('name' => '<span class="i-left dashicons dashicons-visibility"></span>'. '<small>' . __('Show Allowed HTML', 'weaver-xtreme' /*adm*/) . '</small>',
|
728 |
+
'id' => 'form_allowed_tags', 'type' => '+checkbox',
|
729 |
+
'info' => __('Show the allowed HTML tags below comment input box (★Plus)', 'weaver-xtreme' /*adm*/)),
|
730 |
+
array('name' => '<span class="i-left dashicons dashicons-visibility"></span><span class="dashicons dashicons-admin-comments"></span>' .
|
731 |
+
'<small>' . __('Hide Comment Title Icon', 'weaver-xtreme' /*adm*/) . '</small>',
|
732 |
+
'id' => 'hide_comment_bubble', 'type' => '+checkbox',
|
733 |
+
'info' => __('Hide the comment icon before the Comments title (★Plus)', 'weaver-xtreme' /*adm*/)),
|
734 |
+
array('name' => '<small>' . __('Hide Separator Above Comments', 'weaver-xtreme' /*adm*/) . '</small>', 'icon' => '-visibility',
|
735 |
+
'id' => 'hide_comment_hr', 'type' => '+checkbox',
|
736 |
+
'info' => __('Hide the (<hr>) separator line above the Comments area (★Plus)', 'weaver-xtreme' /*adm*/))
|
737 |
+
);
|
738 |
+
|
739 |
+
?>
|
740 |
+
<div class="options-intro">
|
741 |
+
<?php _e('<strong>Content Areas:</strong> Includes options common to both <em>Pages</em> and <em>Posts</em>. Options for <strong>Text</strong>,
|
742 |
+
<strong>Padding</strong>, <strong>Images</strong>, <strong>Lists & Tables</strong>, and user <strong>Comments</strong>.', 'weaver-xtreme' /*adm*/); ?><br />
|
743 |
+
<div class="options-intro-menu">
|
744 |
+
<a href="#content-area"><?php _e('Content Area', 'weaver-xtreme' /*adm*/); ?></a> |
|
745 |
+
<a href="#text"><?php _e('Text', 'weaver-xtreme' /*adm*/); ?></a> |
|
746 |
+
<a href="#search-boxes"><?php _e('Search Boxes', 'weaver-xtreme' /*adm*/); ?></a> |
|
747 |
+
<a href="#images"><?php _e('Images', 'weaver-xtreme' /*adm*/); ?></a> |
|
748 |
+
<a href="#featured-image-pages"><?php _e('Featured Image - Pages', 'weaver-xtreme' /*adm*/); ?></a> |
|
749 |
+
<a href="#lists-hr-tables"><?php _e('Lists - <HR> - Tables', 'weaver-xtreme' /*adm*/); ?></a> |
|
750 |
+
<a href="#comments"><?php _e('Comments', 'weaver-xtreme' /*adm*/); ?></a>
|
751 |
+
</div>
|
752 |
+
</div>
|
753 |
+
<?php
|
754 |
+
weaverx_form_show_options($opts);
|
755 |
+
do_action('weaverxplus_admin','content_areas');
|
756 |
+
?>
|
757 |
+
<span style="color:green;"><b><?php _e('Hiding/Enabling Page and Post Comments', 'weaver-xtreme' /*adm*/); ?></b></span>
|
758 |
+
<?php
|
759 |
+
weaverx_help_link('help.html#LeavingComments',__('Help for Leaving Comments', 'weaver-xtreme' /*adm*/));
|
760 |
+
?>
|
761 |
+
<p>
|
762 |
+
<?php _e('Controlling "Reply/Leave a Comment" visibility for pages and posts is <strong>not</strong> a theme function.
|
763 |
+
It is controlled by WordPress settings.
|
764 |
+
Please click the ? just above to see the help file entry!', 'weaver-xtreme' /*adm*/); ?>
|
765 |
+
</p>
|
766 |
+
<?php
|
767 |
+
}
|
768 |
+
|
769 |
+
// ======================== Main Options > Post Specifics ========================
|
770 |
+
function weaverx_mainopts_posts() {
|
771 |
+
$opts = array(
|
772 |
+
array( 'type' => 'submit'),
|
773 |
+
array('name' => __('Post Specifics', 'weaver-xtreme' /*adm*/), 'icon' => '-admin-post',
|
774 |
+
'id' => 'h-post-specifics', 'type' => 'header',
|
775 |
+
'info' => __('Settings affecting Posts', 'weaver-xtreme' /*adm*/),
|
776 |
+
'help' => 'help.html#PPSpecifics'),
|
777 |
+
|
778 |
+
array('name' => __('Post Area', 'weaver-xtreme' /*adm*/), 'id' => 'post', 'type' => 'widget_area',
|
779 |
+
'info' => __('Use these settings to override Content Area settings for Posts (blog entries).', 'weaver-xtreme' /*adm*/)),
|
780 |
+
|
781 |
+
array('name' => __('Sticky Post BG', 'weaver-xtreme' /*adm*/), 'id' => 'stickypost_bgcolor', 'type' => 'ctext',
|
782 |
+
'info' => __('BG color for sticky posts, author info. (Add {border:none;padding:0;} to CSS to make sticky posts same as regular posts.)', 'weaver-xtreme' /*adm*/)),
|
783 |
+
|
784 |
+
array('name' => '<small>' . __('Reset Major Content Options', 'weaver-xtreme' /*adm*/) . '</small>', 'id' => 'reset_content_opts', 'type' => 'checkbox',
|
785 |
+
'info' => __('Clear wrapping Content Area bg, borders, padding, and top/bottom margins for views with posts. Allows more flexible post settings.', 'weaver-xtreme' /*adm*/)),
|
786 |
+
|
787 |
+
|
788 |
+
array( 'type' => 'submit'),
|
789 |
+
|
790 |
+
|
791 |
+
array('name' => __('Post Title', 'weaver-xtreme' /*adm*/), 'icon' => '-text',
|
792 |
+
'id' => 'h-post-title', 'type' => 'subheader_alt',
|
793 |
+
'info' => __('Options for the Post Title', 'weaver-xtreme' /*adm*/)),
|
794 |
+
|
795 |
+
array('name' => __('Post Title', 'weaver-xtreme' /*adm*/), 'id' => 'post_title', 'type' => 'titles',
|
796 |
+
'info' => __("Post title (Blog Views)", 'weaver-xtreme' /*adm*/)),
|
797 |
+
|
798 |
+
array('name' => '<small>' . __('Bar under Post Titles', 'weaver-xtreme' /*adm*/) . '</small>', 'id' => 'post_title_underline_int', 'type' => 'val_px',
|
799 |
+
'info' => __('Enter size in px if you want a bar under page title. Leave blank or 0 for no bar.', 'weaver-xtreme' /*adm*/)),
|
800 |
+
|
801 |
+
array('name' => '<small>' . __('Post Title Hover', 'weaver-xtreme' /*adm*/) . '</small>', 'id' => 'post_title_hover_color', 'type' => 'ctext',
|
802 |
+
'info' => __('Color if you want the Post Title to show alternate color for hover', 'weaver-xtreme' /*adm*/)),
|
803 |
+
|
804 |
+
array('name' => '<small>' . __('Space After Post Title', 'weaver-xtreme' /*adm*/) . '</small>', 'id' => 'post_title_bottom_margin_dec', 'type' => 'val_em',
|
805 |
+
'info' => __('Space between Post Title and Post Info Line or content. (Default: 0.15em)', 'weaver-xtreme' /*adm*/)),
|
806 |
+
|
807 |
+
|
808 |
+
array('name' => '<span class="i-left dashicons dashicons-admin-comments"></span><small>' . __('Show Comment Bubble', 'weaver-xtreme' /*adm*/) . '</small>',
|
809 |
+
'id' => 'show_post_bubble', 'type' => 'checkbox',
|
810 |
+
'info' => __("Show comment bubble with link to comments on the post info line", 'weaver-xtreme' /*adm*/)),
|
811 |
+
|
812 |
+
array('name' => '<small>' . __('Hide <em>Post Format</em> Icons', 'weaver-xtreme' /*adm*/) . '</small>', 'icon' => '-visibility',
|
813 |
+
'id' => 'hide_post_format_icon', 'type' => '+checkbox',
|
814 |
+
'info' => __('Hide the icons for posts with Post Format specified. (★Plus)', 'weaver-xtreme' /*adm*/)),
|
815 |
+
|
816 |
+
|
817 |
+
|
818 |
+
|
819 |
+
array('name' => __('Post Layout', 'weaver-xtreme' /*adm*/), 'icon' => '-schedule',
|
820 |
+
'id' => 'h-post-layout', 'type' => 'subheader_alt',
|
821 |
+
'info' => __('Layout of Posts', 'weaver-xtreme' /*adm*/)),
|
822 |
+
|
823 |
+
array('name' => '<span class="i-left" style=font-size:120%;"> ☷</span>' . __('Columns of Posts', 'weaver-xtreme' /*adm*/), 'id' => 'blog_cols', 'type' => 'select_id', //code
|
824 |
+
'info' => __('Display posts on blog page with this many columns. (You should adjust "Display posts on blog page with this many columns" on Settings:Reading to be a multiple of this value.)', 'weaver-xtreme' /*adm*/),
|
825 |
+
'value' => array(
|
826 |
+
array('val' => '1', 'desc' => __('1 Column', 'weaver-xtreme' /*adm*/)),
|
827 |
+
array('val' => '2', 'desc' => __('2 Columns', 'weaver-xtreme' /*adm*/)),
|
828 |
+
array('val' => '3', 'desc' => __('3 Columns', 'weaver-xtreme' /*adm*/)))
|
829 |
+
),
|
830 |
+
|
831 |
+
array('name' => '<span class="i-left" style=font-size:120%;"> ☷</span><small>' . __('Use Columns on Archive Pages', 'weaver-xtreme' /*adm*/) . '</small>' , 'id' => 'archive_cols', 'type' => 'checkbox', //code
|
832 |
+
'info' => __('Display posts on archive-like pages using columns. (Archive, Author, Category, Tag)', 'weaver-xtreme' /*adm*/)
|
833 |
+
),
|
834 |
+
|
835 |
+
array('name' => '<small>' . __('First Post One Column', 'weaver-xtreme' /*adm*/) . '</small>', 'id' => 'blog_first_one', 'type' => 'checkbox',
|
836 |
+
'info' => __('Always display the first post in one column.', 'weaver-xtreme' /*adm*/)),
|
837 |
+
array('name' => '<small>' . __('Sticky Posts One Column', 'weaver-xtreme' /*adm*/) . '</small>', 'id' => 'blog_sticky_one', 'type' => 'checkbox',
|
838 |
+
'info' => __("Display opening Sticky Posts in one column. If First Post One Column also checked, then first non-sticky post will be one column.", 'weaver-xtreme' /*adm*/)),
|
839 |
+
array('name' => '<span class="i-left" style=font-size:120%;"> ☷</span><small>' . __('Use <em>Masonry</em> for Posts', 'weaver-xtreme' /*adm*/) . '</small>',
|
840 |
+
'id' => 'masonry_cols', 'type' => 'select_id', //code
|
841 |
+
'info' => __('Use the <em>Masonry</em> blog layout option to show dynamically packed posts on blog and archive-like pages. Overrides "Columns of Posts" setting.', 'weaver-xtreme' /*adm*/),
|
842 |
+
'value' => array(
|
843 |
+
array('val' => '0', 'desc' => ''),
|
844 |
+
array('val' => '2', 'desc' => __('2 Columns', 'weaver-xtreme' /*adm*/)),
|
845 |
+
array('val' => '3', 'desc' => __('3 Columns', 'weaver-xtreme' /*adm*/)),
|
846 |
+
array('val' => '4', 'desc' => __('4 Columns', 'weaver-xtreme' /*adm*/)),
|
847 |
+
array('val' => '5', 'desc' => __('5 Columns', 'weaver-xtreme' /*adm*/)))
|
848 |
+
),
|
849 |
+
|
850 |
+
array('name' => '<small>' . __('Compact <em>Post Format</em> Posts', 'weaver-xtreme' /*adm*/) . '</small>',
|
851 |
+
'id' => 'compact_post_formats', 'type' => 'checkbox',
|
852 |
+
'info' => __('Use compact layout for <em>Post Format</em> posts (Image, Gallery, Video, etc.). Useful for photo blogs and multi-column layouts. Looks great with <em>Masonry</em>.', 'weaver-xtreme' /*adm*/)),
|
853 |
+
array('name' => __('Photo Bloging', 'weaver-xtreme' /*adm*/),
|
854 |
+
'info' => __('Read the Help entry for information on creating a Photo Blog page', 'weaver-xtreme' /*adm*/),
|
855 |
+
'type' => 'note','help' => 'help.html#PhotoBlog'),
|
856 |
+
|
857 |
+
|
858 |
+
array( 'type' => 'submit'),
|
859 |
+
|
860 |
+
array('name' => __('Excerpts / Full Posts', 'weaver-xtreme' /*adm*/), 'icon' => '-exerpt-view',
|
861 |
+
'id' => 'h-excerpts-full', 'type' => 'subheader_alt',
|
862 |
+
'info' => __('How to display posts in Blog / Archive Views', 'weaver-xtreme' /*adm*/)),
|
863 |
+
array('name' => __('Show Full Blog Posts', 'weaver-xtreme' /*adm*/), 'id' => 'fullpost_blog', 'type' => 'checkbox',
|
864 |
+
'info' => __('Will display full blog post instead of excerpts on <em>blog pages</em>.', 'weaver-xtreme' /*adm*/)),
|
865 |
+
array('name' => '<small>' . __('Full Post for Archives', 'weaver-xtreme' /*adm*/) . '</small>', 'id' => 'fullpost_archive', 'type' => 'checkbox',
|
866 |
+
'info' => __('Display the full posts instead of excerpts on <em>special post pages</em>. (Archives, Categories, etc.) Does not override manually added <--more--> breaks.', 'weaver-xtreme' /*adm*/)),
|
867 |
+
array('name' => '<small>' . __('Full Post for Searches', 'weaver-xtreme' /*adm*/) . '</small>', 'id' => 'fullpost_search', 'type' => 'checkbox',
|
868 |
+
'info' => __('Display the full posts instead of excerpts for Search results. Does not override manually added <--more--> breaks.', 'weaver-xtreme' /*adm*/)),
|
869 |
+
array('name' => '<small>' . __('Full text for 1st <em>"n"</em> Posts', 'weaver-xtreme' /*adm*/) . '</small>',
|
870 |
+
'id' => 'fullpost_first', 'type' => 'val_num',
|
871 |
+
'info' => __('Display the full post for the first "n" posts on Blog pages. Does not override manually added <--more--> breaks.', 'weaver-xtreme' /*adm*/)),
|
872 |
+
array('name' => '<small>' . __('Excerpt length', 'weaver-xtreme' /*adm*/) . '</small>', 'id' => 'excerpt_length', 'type' => 'val_num',
|
873 |
+
'info' => __('Change post excerpt length. (Default: 40 words)', 'weaver-xtreme' /*adm*/)),
|
874 |
+
array('name' => '<small>' . __('<em>Continue reading</em> Message', 'weaver-xtreme' /*adm*/) . '</small>', 'id' => 'excerpt_more_msg', 'type' => 'widetext',
|
875 |
+
'info' => __('Change default <em>Continue reading →</em> message for excerpts. Can include HTML (e.g., <img>).', 'weaver-xtreme' /*adm*/)),
|
876 |
+
array('type' => 'endheader'),
|
877 |
+
|
878 |
+
|
879 |
+
|
880 |
+
|
881 |
+
array('name' => __('Post Navigation', 'weaver-xtreme' /*adm*/), 'icon' => '-leftright',
|
882 |
+
'id' => 'h-post-nav', 'type' => 'subheader_alt',
|
883 |
+
'info' => __('Navigation for moving between posts', 'weaver-xtreme' /*adm*/)),
|
884 |
+
array('name' => __('Blog Navigation Style', 'weaver-xtreme' /*adm*/), 'id' => 'nav_style', 'type' => 'select_id',
|
885 |
+
'info' => __('Style of navigation links on blog pages: "Older/Newer posts", "Previous/Next Post", or by page numbers', 'weaver-xtreme' /*adm*/),
|
886 |
+
'value' => array(
|
887 |
+
array('val' => 'old_new', 'desc' => __('Older/Newer', 'weaver-xtreme' /*adm*/)),
|
888 |
+
array('val' => 'prev_next', 'desc' => __('Previous/Next', 'weaver-xtreme' /*adm*/)),
|
889 |
+
array('val' => 'paged_left', 'desc' => __('Paged - Left', 'weaver-xtreme' /*adm*/)),
|
890 |
+
array('val' => 'paged_right', 'desc' => __('Paged - Right', 'weaver-xtreme' /*adm*/)))
|
891 |
+
),
|
892 |
+
array('name' => '<small>' . __('Hide Top Links', 'weaver-xtreme' /*adm*/) . '</small>', 'icon' => '-visibility',
|
893 |
+
'id' => 'nav_hide_above', 'type' => '+checkbox',
|
894 |
+
'info' => __('Hide the blog navigation links at the top (★Plus)', 'weaver-xtreme' /*adm*/)),
|
895 |
+
array('name' => '<small>' . __('Hide Bottom Links', 'weaver-xtreme' /*adm*/) . '</small>', 'icon' => '-visibility',
|
896 |
+
'id' => 'nav_hide_below', 'type' => '+checkbox',
|
897 |
+
'info' => __('Hide the blog navigation links at the bottom (★Plus)', 'weaver-xtreme' /*adm*/)),
|
898 |
+
array('name' => '<small>' . __('Show Top on First Page', 'weaver-xtreme' /*adm*/) . '</small>', 'icon' => '-visibility',
|
899 |
+
'id' => 'nav_show_first', 'type' => '+checkbox',
|
900 |
+
'info' => __('Show navigation at top even on the first page (★Plus)', 'weaver-xtreme' /*adm*/)),
|
901 |
+
|
902 |
+
array('name' => __('Single Page Navigation Style', 'weaver-xtreme' /*adm*/), 'id' => 'single_nav_style', 'type' => 'select_id',
|
903 |
+
'info' => __('Style of navigation links on post Single pages: Previous/Next, by title, or none', 'weaver-xtreme' /*adm*/),
|
904 |
+
'value' => array(
|
905 |
+
array('val' => 'title', 'desc' => __('Post Titles', 'weaver-xtreme' /*adm*/)),
|
906 |
+
array('val' => 'prev_next', 'desc' => __('Previous/Next', 'weaver-xtreme' /*adm*/)),
|
907 |
+
array('val' => 'hide', 'desc' => __('None - no display', 'weaver-xtreme' /*adm*/)))
|
908 |
+
),
|
909 |
+
array('name' => '<small>' . __('Link to Same Categories', 'weaver-xtreme' /*adm*/) . '</small>', 'id' => 'single_nav_link_cats', 'type' => '+checkbox',
|
910 |
+
'info' => __('Single Page navigation links point to posts with same categories. (★Plus)', 'weaver-xtreme' /*adm*/)),
|
911 |
+
array('name' => '<small>' . __('Hide Top Links', 'weaver-xtreme' /*adm*/) . '</small>', 'icon' => '-visibility',
|
912 |
+
'id' => 'single_nav_hide_above', 'type' => '+checkbox',
|
913 |
+
'info' => __('Hide the single page navigation links at the top (★Plus)', 'weaver-xtreme' /*adm*/)),
|
914 |
+
array('name' => '<small>' . __('Hide Bottom Links', 'weaver-xtreme' /*adm*/) . '</small>', 'icon' => '-visibility',
|
915 |
+
'id' => 'single_nav_hide_below', 'type' => '+checkbox',
|
916 |
+
'info' => __('Hide the single page navigation links at the bottom (★Plus)', 'weaver-xtreme' /*adm*/)),
|
917 |
+
|
918 |
+
array( 'type' => 'submit'),
|
919 |
+
array('name' => __('Post Meta Info Areas', 'weaver-xtreme' /*adm*/), 'icon' => '-info',
|
920 |
+
'id' => 'h-post-meta', 'type' => 'subheader_alt',
|
921 |
+
'info' => __('Top and Bottom Post Meta Information areas', 'weaver-xtreme' /*adm*/)),
|
922 |
+
|
923 |
+
array('name' => __('Top Post Info', 'weaver-xtreme' /*adm*/), 'id' => 'post_info_top', 'type' => 'titles_text',
|
924 |
+
'info' => __("Top Post info line", 'weaver-xtreme' /*adm*/)),
|
925 |
+
|
926 |
+
|
927 |
+
array('name' => '<small>' . __('Hide top post info', 'weaver-xtreme' /*adm*/) . '</small>', 'icon' => '-visibility',
|
928 |
+
'id' => 'post_info_hide_top', 'type' => 'checkbox', //code
|
929 |
+
'info' => __('Hide entire top info line (posted on, by) of post.','weaver-xtreme' /*adm*/)),
|
930 |
+
|
931 |
+
array('name' => __('Bottom Post Info', 'weaver-xtreme' /*adm*/), 'id' => 'post_info_bottom', 'type' => 'titles_text',
|
932 |
+
'info' => __('The bottom post info line', 'weaver-xtreme' /*adm*/)),
|
933 |
+
|
934 |
+
array('name' => '<small>' . __('Hide bottom post info', 'weaver-xtreme' /*adm*/) . '</small>', 'icon' => '-visibility',
|
935 |
+
'id' => 'post_info_hide_bottom', 'type' => 'checkbox', //code
|
936 |
+
'info' => __('Hide entire bottom info line (posted in, comments) of post.', 'weaver-xtreme' /*adm*/)),
|
937 |
+
|
938 |
+
|
939 |
+
array('name' => '<span class="i-left dashicons dashicons-visibility"></span>' . __('Show Author Avatar', 'weaver-xtreme' /*adm*/),
|
940 |
+
'id' => 'show_post_avatar', 'type' => 'select_id', //code
|
941 |
+
'info' => __('Show author avatar on the post info line (also can be set per post with post editor)', 'weaver-xtreme' /*adm*/),
|
942 |
+
'value' => array(
|
943 |
+
array('val' => 'hide', 'desc' => __('Do Not Show', 'weaver-xtreme' /*adm*/)),
|
944 |
+
array('val' => 'start', 'desc' => __('Start of Info Line', 'weaver-xtreme' /*adm*/)),
|
945 |
+
array('val' => 'end', 'desc' => __('End of Info Line', 'weaver-xtreme' /*adm*/)))),
|
946 |
+
|
947 |
+
array('name' => '<small>' . __('Avatar size', 'weaver-xtreme' /*adm*/) . '</small>', 'id' => 'post_avatar_int', 'type' => 'val_px',
|
948 |
+
'info' => __('Size of Avatar in px. (Default: 28px)', 'weaver-xtreme' /*adm*/)),
|
949 |
+
|
950 |
+
array('name' => __('Use Icons in Post Info', 'weaver-xtreme' /*adm*/), 'id' => 'post_icons', 'type' => 'select_id',
|
951 |
+
'info' => __('Use Icons instead of Text descriptions in Post Meta Info', 'weaver-xtreme' /*adm*/),
|
952 |
+
'value' => array(
|
953 |
+
array('val' => 'text', 'desc' => __('Text Descriptions', 'weaver-xtreme' /*adm*/)),
|
954 |
+
array('val' => 'fonticons', 'desc' => __('Font Icons', 'weaver-xtreme' /*adm*/)),
|
955 |
+
array('val' => 'graphics', 'desc' => __('Graphic Icons', 'weaver-xtreme' /*adm*/)))
|
956 |
+
),
|
957 |
+
array('name' => '<small>' . __('Font Icons Color', 'weaver-xtreme' /*adm*/) . '</small>', 'id' => 'post_icons_color', 'type' => 'color',
|
958 |
+
'info' => __('Color for Font Icons (Default: Post Info text color)', 'weaver-xtreme' /*adm*/)),
|
959 |
+
|
960 |
+
|
961 |
+
array('name' => '<span style="color:red">' . __('Note:', 'weaver-xtreme' /*adm*/) . '</span>',
|
962 |
+
'type' => 'note', 'info' => __('Hiding any meta info item automatically uses Icons instead of text descriptions.', 'weaver-xtreme' /*adm*/)),
|
963 |
+
array('name' => '<small>' . __('Hide Post Date', 'weaver-xtreme' /*adm*/) . '</small>', 'icon' => '-visibility',
|
964 |
+
'id' => 'post_hide_date', 'type' => 'checkbox',
|
965 |
+
'info' => __('Hide the post date everywhere it is normally displayed.', 'weaver-xtreme' /*adm*/)),
|
966 |
+
array('name' => '<small>' . __('Hide Post Author', 'weaver-xtreme' /*adm*/) . '</small>', 'icon' => '-visibility',
|
967 |
+
'id' => 'post_hide_author', 'type' => 'checkbox',
|
968 |
+
'info' => __('Hide the post author everywhere it is normally displayed.', 'weaver-xtreme' /*adm*/)),
|
969 |
+
array('name' => '<small>' . __('Hide Post Categories', 'weaver-xtreme' /*adm*/) . '</small>', 'icon' => '-visibility',
|
970 |
+
'id' => 'post_hide_categories', 'type' => 'checkbox',
|
971 |
+
'info' => __('Hide the post categories wherever they are normally displayed.', 'weaver-xtreme' /*adm*/)),
|
972 |
+
array('name' => '<small>' . __('Hide Post Tags', 'weaver-xtreme' /*adm*/) . '</small>', 'id' => 'post_hide_tags', 'type' => 'checkbox',
|
973 |
+
'info' => __('Hide the post tags wherever they are normally displayed.','weaver-xtreme' /*adm*/)),
|
974 |
+
array('name' => '<small>' . __('Hide Permalink', 'weaver-xtreme' /*adm*/) . '</small>', 'icon' => '-visibility',
|
975 |
+
'id' => 'hide_permalink', 'type' => 'checkbox',
|
976 |
+
'info' => __('Hide the permalink.', 'weaver-xtreme' /*adm*/)),
|
977 |
+
array('name' => '<small>' . __('Hide Category if Only One', 'weaver-xtreme' /*adm*/) . '</small>', 'icon' => '-visibility',
|
978 |
+
'id' => 'hide_singleton_category', 'type' => 'checkbox',
|
979 |
+
'info' => __('If there is only one overall category defined (Uncategorized), don\'t show Category of post.', 'weaver-xtreme' /*adm*/)),
|
980 |
+
array('name' => '<small>' . __('Hide Author for Single Author Site', 'weaver-xtreme' /*adm*/) . '</small>', 'icon' => '-visibility',
|
981 |
+
'id' => 'post_hide_single_author', 'type' => 'checkbox',
|
982 |
+
'info' => __('Hide author information if site has only a single author.', 'weaver-xtreme' /*adm*/)),
|
983 |
+
|
984 |
+
array('name' => __('Post Info Links', 'weaver-xtreme' /*adm*/), 'id' => 'ilink', 'type' => 'link',
|
985 |
+
'info' => __('Links in post information top and bottom lines.', 'weaver-xtreme' /*adm*/)),
|
986 |
+
|
987 |
+
array( 'type' => 'submit'),
|
988 |
+
|
989 |
+
|
990 |
+
array('name' => __('Featured Image - Posts', 'weaver-xtreme' /*adm*/), 'icon' => '-id',
|
991 |
+
'id' => 'h-fi-posts', 'type' => 'subheader_alt',
|
992 |
+
'info' => __('Display of Post Featured Images', 'weaver-xtreme' /*adm*/)),
|
993 |
+
|
994 |
+
array('name' => '<span class="i-left" style=font-size:120%;"> ⤪</span>' . __('FI Location - Full Post', 'weaver-xtreme' /*adm*/),
|
995 |
+
'id' => 'post_full_fi_location', 'type' => 'fi_location_post',
|
996 |
+
'info' => __('Where to display Featured Image for full blog posts.', 'weaver-xtreme' /*adm*/)),
|
997 |
+
array('name' => '<span class="i-left dashicons dashicons-editor-alignleft"></span><small>' . __('FI Alignment - Full post', 'weaver-xtreme' /*adm*/) . '</small>',
|
998 |
+
'id' => 'post_full_fi_align', 'type' => 'fi_align',
|
999 |
+
'info' => __('Featured Image alignment','weaver-xtreme' /*adm*/)),
|
1000 |
+
|
1001 |
+
|
1002 |
+
array('name' => '<small>' . __('Hide FI - Full Posts', 'weaver-xtreme' /*adm*/) . '</small>', 'icon' => '-visibility',
|
1003 |
+
'id' => 'post_full_fi_hide', 'type' => 'select_hide',
|
1004 |
+
'info' => __('Hide Featured Images on full blog posts.', 'weaver-xtreme' /*adm*/)),
|
1005 |
+
array ('name' => '<small>' . __('FI Size - Full Posts', 'weaver-xtreme' /*adm*/) . '</small>',
|
1006 |
+
'id' => 'post_full_fi_size', 'type' => 'select_id',
|
1007 |
+
'info' => __('Media Library Image Size for Featured Image on full posts.', 'weaver-xtreme' /*adm*/),
|
1008 |
+
'value' => array(
|
1009 |
+
array('val' => 'thumbnail', 'desc' => __('Thumbnail (default)', 'weaver-xtreme' /*adm*/)),
|
1010 |
+
array('val' => 'medium', 'desc' => __('Medium', 'weaver-xtreme' /*adm*/)),
|
1011 |
+
array('val' => 'large', 'desc' => __('Large', 'weaver-xtreme' /*adm*/)),
|
1012 |
+
array('val' => 'full', 'desc' => __('Full', 'weaver-xtreme' /*adm*/)))
|
1013 |
+
),
|
1014 |
+
array('name' => '<span class="i-left" style="font-size:150%;">↔</span><small>' . __('FI Width, Full Posts', 'weaver-xtreme' /*adm*/) . '</small>',
|
1015 |
+
'id' => 'post_full_fi_width', 'type' => '+val_percent',
|
1016 |
+
'info' => __('Width of Featured Image on Full Posts. Max Width in %, overrides FI Size selection. (★Plus)', 'weaver-xtreme' /*adm*/) ),
|
1017 |
+
|
1018 |
+
|
1019 |
+
|
1020 |
+
array('name' => '<span class="i-left" style=font-size:120%;"> ⤪</span>'. __('FI Location - Excerpts', 'weaver-xtreme' /*adm*/),
|
1021 |
+
'id' => 'post_excerpt_fi_location', 'type' => 'fi_location_post',
|
1022 |
+
'info' => __('Where to display Featured Image for posts displayed as excerpt.', 'weaver-xtreme' /*adm*/)),
|
1023 |
+
array('name' => '<span class="i-left dashicons dashicons-editor-alignleft"></span><small>' . __('FI Alignment - Excerpts', 'weaver-xtreme' /*adm*/) . '</small>',
|
1024 |
+
'id' => 'post_excerpt_fi_align', 'type' => 'fi_align',
|
1025 |
+
'info' => __('How to align the Featured Image', 'weaver-xtreme' /*adm*/)),
|
1026 |
+
|
1027 |
+
array('name' => '<small>' . __('Hide FI - Excerpts', 'weaver-xtreme' /*adm*/) . '</small>', 'icon' => '-visibility',
|
1028 |
+
'id' => 'post_excerpt_fi_hide', 'type' => 'select_hide',
|
1029 |
+
'info' => __('Where to hide Featured Images on full blog posts.', 'weaver-xtreme' /*adm*/)),
|
1030 |
+
array ('name' => '<small>FI Size - Excerpts</small>',
|
1031 |
+
'id' => 'post_excerpt_fi_size', 'type' => 'select_id',
|
1032 |
+
'info' => __('Media Library Image Size for Featured Image on excerpts.', 'weaver-xtreme' /*adm*/),
|
1033 |
+
'value' => array(
|
1034 |
+
array('val' => 'thumbnail', 'desc' => __('Thumbnail (default)', 'weaver-xtreme' /*adm*/)),
|
1035 |
+
array('val' => 'medium', 'desc' => __('Medium', 'weaver-xtreme' /*adm*/)),
|
1036 |
+
array('val' => 'large', 'desc' => __('Large', 'weaver-xtreme' /*adm*/)),
|
1037 |
+
array('val' => 'full', 'desc' => __('Full', 'weaver-xtreme' /*adm*/)))
|
1038 |
+
),
|
1039 |
+
array('name' => '<span class="i-left" style="font-size:150%;">↔</span><small>' . __('FI Width, Excerpts', 'weaver-xtreme' /*adm*/) . '</small>',
|
1040 |
+
'id' => 'post_excerpt_fi_width', 'type' => '+val_percent',
|
1041 |
+
'info' => __('Width of Featured Image on excerpts. Max Width in %, overrides FI Size selection. (★Plus)', 'weaver-xtreme' /*adm*/) ),
|
1042 |
+
|
1043 |
+
|
1044 |
+
array('name' => '<span class="i-left" style=font-size:120%;"> ⤪</span>' . __('FI Location - Single Page', 'weaver-xtreme' /*adm*/),
|
1045 |
+
'id' => 'post_fi_location', 'type' => 'fi_location',
|
1046 |
+
'info' => __('Where to display Featured Image for posts on single page view.', 'weaver-xtreme' /*adm*/)),
|
1047 |
+
array('name' => '<span class="i-left dashicons dashicons-editor-alignleft"></span><small>' . __('FI Alignment - Single Page', 'weaver-xtreme' /*adm*/) . '</small>',
|
1048 |
+
'id' => 'post_fi_align', 'type' => 'fi_align',
|
1049 |
+
'info' => __('How to align the Featured Image on Single Page View.', 'weaver-xtreme' /*adm*/)),
|
1050 |
+
|
1051 |
+
array('name' => '<small>' . __('Hide FI - Single Page', 'weaver-xtreme' /*adm*/) . '</small>', 'icon' => '-visibility',
|
1052 |
+
'id' => 'post_fi_hide', 'type' => 'select_hide',
|
1053 |
+
'info' => __('Where to hide Featured Images on single page view.', 'weaver-xtreme' /*adm*/)),
|
1054 |
+
array ('name' => '<small>' . __('FI Size - Single Posts', 'weaver-xtreme' /*adm*/) . '</small>',
|
1055 |
+
'id' => 'post_fi_size', 'type' => 'select_id',
|
1056 |
+
'info' => __('Media Library Image Size for Featured Image on single page view.', 'weaver-xtreme' /*adm*/),
|
1057 |
+
'value' => array(
|
1058 |
+
array('val' => 'thumbnail', 'desc' => __('Thumbnail (default)', 'weaver-xtreme' /*adm*/)),
|
1059 |
+
array('val' => 'medium', 'desc' => __('Medium', 'weaver-xtreme' /*adm*/)),
|
1060 |
+
array('val' => 'large', 'desc' => __('Large', 'weaver-xtreme' /*adm*/)),
|
1061 |
+
array('val' => 'full', 'desc' => __('Full', 'weaver-xtreme' /*adm*/)))
|
1062 |
+
),
|
1063 |
+
array('name' => '<span class="i-left" style="font-size:150%;">↔</span><small>' . __('FI Width, Single Page', 'weaver-xtreme' /*adm*/) . '</small>',
|
1064 |
+
'id' => 'post_fi_width', 'type' => '+val_percent',
|
1065 |
+
'info' => __('Width of Featured Image on single page view. Max Width in %, overrides FI Size selection. (★Plus)', 'weaver-xtreme' /*adm*/) ),
|
1066 |
+
|
1067 |
+
|
1068 |
+
|
1069 |
+
array( 'type' => 'submit'),
|
1070 |
+
|
1071 |
+
|
1072 |
+
array('name' => __('More Post Related Options', 'weaver-xtreme' /*adm*/), 'icon' => '-forms',
|
1073 |
+
'id' => 'h-post-rel', 'type' => 'subheader_alt',
|
1074 |
+
'info' => __('Other options related to post display, including single pages.', 'weaver-xtreme' /*adm*/)),
|
1075 |
+
array('name' => '<small>' . __('Show <em>Comments are closed.</em>', 'weaver-xtreme' /*adm*/) . '</small>', 'icon' => '-visibility',
|
1076 |
+
'id' => 'show_comments_closed', 'type' => 'checkbox',
|
1077 |
+
'info' => __('If comments are off, and no comments have been made, show the <em>Comments are closed.</em> message.', 'weaver-xtreme' /*adm*/) ),
|
1078 |
+
array('name' => __('Author Info BG', 'weaver-xtreme' /*adm*/), 'id' => 'post_author_bgcolor', 'type' => 'ctext',
|
1079 |
+
'info' => __('Background color used for Author Bio.', 'weaver-xtreme' /*adm*/)),
|
1080 |
+
array('name' => '<small>' . __('Hide Author Bio', 'weaver-xtreme' /*adm*/) . '</small>', 'icon' => '-visibility',
|
1081 |
+
'id' => 'hide_author_bio', 'type' => 'checkbox',
|
1082 |
+
'info' => __('Hide display of author bio box on Author Archive and Single Post page views.', 'weaver-xtreme' /*adm*/)),
|
1083 |
+
array('name' => '<small>' . __('Allow comments for attachments', 'weaver-xtreme' /*adm*/) . '</small>',
|
1084 |
+
'id' => 'allow_attachment_comments', 'type' => 'checkbox',
|
1085 |
+
'info' => __('Allow visitors to leave comments for attachments (usually full size media image - only if comments allowed).', 'weaver-xtreme' /*adm*/))
|
1086 |
+
);
|
1087 |
+
|
1088 |
+
?>
|
1089 |
+
<div class="options-intro">
|
1090 |
+
<?php _e('<strong>Post Specifics: </strong>
|
1091 |
+
Options related to <strong>Posts</strong>, including <strong>Background</strong> color, <strong>Columns</strong> displayed
|
1092 |
+
on blog pages, <strong>Title</strong> options, <strong>Navigation</strong> to earlier and later posts, the post
|
1093 |
+
<strong>Info Lines</strong>, <strong>Excerpts</strong>, and <strong>Featured Image</strong> handling.', 'weaver-xtreme' /*adm*/); ?>
|
1094 |
+
<br />
|
1095 |
+
<div class="options-intro-menu">
|
1096 |
+
<a href="#post-area"><?php _e('Post Area', 'weaver-xtreme' /*adm*/); ?></a> |
|
1097 |
+
<a href="#post-title"><?php _e('Post Title', 'weaver-xtreme' /*adm*/);?></a> |
|
1098 |
+
<a href="#post-layout"><?php _e('Post Layout', 'weaver-xtreme' /*adm*/);?></a> |
|
1099 |
+
<a href="#excerpts-full-posts"><?php _e('Excerpts / Full Posts', 'weaver-xtreme' /*adm*/);?></a> |
|
1100 |
+
<a href="#post-navigation"><?php _e('Post Navigation', 'weaver-xtreme' /*adm*/);?></a> |
|
1101 |
+
<a href="#post-meta-info-areas"><?php _e('Post Meta Info Areas', 'weaver-xtreme' /*adm*/);?></a> |
|
1102 |
+
<a href="#featured-image-posts"><?php _e('Featured Image - Posts', 'weaver-xtreme' /*adm*/); ?></a> |
|
1103 |
+
<a href="#more-post-related-options"><?php _e('More Post Related Options', 'weaver-xtreme' /*adm*/); ?></a> |
|
1104 |
+
<a href="#custom-post-info-lines"><?php _e('Custom Post Info Lines', 'weaver-xtreme' /*adm*/); ?></a>
|
1105 |
+
</div>
|
1106 |
+
</div>
|
1107 |
+
<?php
|
1108 |
+
weaverx_form_show_options($opts);
|
1109 |
+
do_action('weaverxplus_admin','post_specifics');
|
1110 |
+
?>
|
1111 |
+
<span style="color:green;"><b><?php _e('Hiding/Enabling Page and Post Comments', 'weaver-xtreme' /*adm*/); ?></b></span>
|
1112 |
+
<?php
|
1113 |
+
weaverx_help_link('help.html#LeavingComments',__('Help for Leaving Comments', 'weaver-xtreme' /*adm*/));
|
1114 |
+
?>
|
1115 |
+
<p>
|
1116 |
+
<?php _e('Controlling "Reply/Leave a Comment" visibility for pages and posts is <strong>not</strong> a theme function.
|
1117 |
+
It is controlled by WordPress settings.
|
1118 |
+
Please click the ? just above to see the help file entry!
|
1119 |
+
(Additional options for comment <em>styling</em> are found on the Content Areas tab.)', 'weaver-xtreme' /*adm*/); ?>
|
1120 |
+
</p>
|
1121 |
+
<?php
|
1122 |
+
}
|
1123 |
+
|
1124 |
+
|
1125 |
+
// ======================== Main Options > Footer ========================
|
1126 |
+
function weaverx_mainopts_footer() {
|
1127 |
+
$opts = array(
|
1128 |
+
array( 'type' => 'submit'),
|
1129 |
+
|
1130 |
+
array('name' => __('Footer Options', 'weaver-xtreme' /*adm*/), 'icon' => '-admin-generic',
|
1131 |
+
'id' => 'h-footer-opts', 'type' => 'header',
|
1132 |
+
'info' => __('Settings for the footer', 'weaver-xtreme' /*adm*/),
|
1133 |
+
'help' => 'help.html#FooterOpt'),
|
1134 |
+
|
1135 |
+
|
1136 |
+
array('name' => __('Footer Area', 'weaver-xtreme' /*adm*/), 'id' => 'footer', 'type' => 'widget_area',
|
1137 |
+
'info' => __('Properties for the footer area.', 'weaver-xtreme' /*adm*/)),
|
1138 |
+
array('name' => __('Footer Links', 'weaver-xtreme' /*adm*/), 'id' => 'footerlink', 'type' => 'link',
|
1139 |
+
'info' => __('Color for links in Footer (Uses Standard Link colors if left blank).', 'weaver-xtreme' /*adm*/)),
|
1140 |
+
array( 'type' => 'submit'),
|
1141 |
+
|
1142 |
+
array('name' => __('Footer Widget Area', 'weaver-xtreme' /*adm*/), 'id' => 'footer_sb', 'type' => 'widget_area_submit',
|
1143 |
+
'info' => __('Properties for the Footer Widget Area.', 'weaver-xtreme' /*adm*/)),
|
1144 |
+
|
1145 |
+
array('name' => __('Footer HTML', 'weaver-xtreme' /*adm*/), 'id' => 'footer_html', 'type' => 'widget_area',
|
1146 |
+
'info' => __('Add arbitrary HTML to Footer Area (in <div id=\"footer-html\">)', 'weaver-xtreme' /*adm*/)),
|
1147 |
+
|
1148 |
+
array('name' => '<span class="i-left dashicons dashicons-editor-code"></span>' . __('Footer HTML content', 'weaver-xtreme' /*adm*/),
|
1149 |
+
'id' => 'footer_html_text', 'type' => 'textarea',
|
1150 |
+
'placeholder' => __('Any HTML, including shortcodes.', 'weaver-xtreme' /*adm*/),
|
1151 |
+
'info' => __("Add arbitrary HTML", 'weaver-xtreme' /*adm*/), 'val' => 4),
|
1152 |
+
array( 'type' => 'submit'),
|
1153 |
+
);
|
1154 |
+
|
1155 |
+
?>
|
1156 |
+
<div class="options-intro">
|
1157 |
+
<?php _e('<strong>Footer: </strong> Options affecting the <strong>Footer</strong> area, including <strong>Background</strong>
|
1158 |
+
color, <strong>Borders</strong>, and the <strong>Copyright</strong> message.', 'weaver-xtreme' /*adm*/); ?>
|
1159 |
+
<br />
|
1160 |
+
<div class="options-intro-menu">
|
1161 |
+
<a href="#footer-area"><?php _e('Footer Area', 'weaver-xtreme' /*adm*/); ?></a> |
|
1162 |
+
<a href="#footer-widget-area"><?php _e('Footer Widget Area', 'weaver-xtreme' /*adm*/); ?></a> |
|
1163 |
+
<a href="#footer-html"><?php _e('Footer HTML', 'weaver-xtreme' /*adm*/); ?></a> |
|
1164 |
+
<a href="#site-copyright"><?php _e('Site Copyright', 'weaver-xtreme' /*adm*/); ?></a>
|
1165 |
+
</div>
|
1166 |
+
</div>
|
1167 |
+
<?php
|
1168 |
+
weaverx_form_show_options($opts);
|
1169 |
+
do_action('weaverxplus_admin','footer_opts');
|
1170 |
+
?>
|
1171 |
+
<a id="site-copyright"></a>
|
1172 |
+
<strong>©</strong> <span style="color:blue;"><b><?php _e('Site Copyright', 'weaver-xtreme' /*adm*/); ?></b></span>
|
1173 |
+
<br/>
|
1174 |
+
<small>
|
1175 |
+
<?php _e('If you fill this in, the default copyright notice in the footer will be replaced with the text here.
|
1176 |
+
It will not automatically update from year to year.
|
1177 |
+
Use &copy; to display ©.
|
1178 |
+
You can use other HTML as well.
|
1179 |
+
Use <span class="style4">&nbsp;</span> to hide the copyright notice. ♦', 'weaver-xtreme' /*adm*/); ?>
|
1180 |
+
</small>
|
1181 |
+
<br />
|
1182 |
+
|
1183 |
+
<span class="dashicons dashicons-editor-code"></span>
|
1184 |
+
<?php weaverx_textarea(weaverx_getopt('copyright'), 'copyright', 1, ' ', 'width:85%;'); ?>
|
1185 |
+
<br>
|
1186 |
+
<label><span class="dashicons dashicons-visibility"></span> <?php _e('Hide Powered By tag:', 'weaver-xtreme' /*adm*/); ?>
|
1187 |
+
<input type="checkbox" name="<?php weaverx_sapi_main_name('_hide_poweredby'); ?>" id="_hide_poweredby" <?php checked(weaverx_getopt_checked( '_hide_poweredby' )); ?> />
|
1188 |
+
</label>
|
1189 |
+
<small><?php _e('Check this to hide the "Proudly powered by" notice in the footer.', 'weaver-xtreme' /*adm*/); ?></small>
|
1190 |
+
<br /><br />
|
1191 |
+
<?php _e('You can add other content to the Footer from the Advanced Options:HTML Insertion tab.', 'weaver-xtreme' /*adm*/); ?>
|
1192 |
+
<?php
|
1193 |
+
}
|
1194 |
+
|
1195 |
+
// ======================== Main Options > Widget Areas ========================
|
1196 |
+
function weaverx_mainopts_widgets() {
|
1197 |
+
$opts = array(
|
1198 |
+
array( 'type' => 'submit'),
|
1199 |
+
array('name' => __('Sidebar Options', 'weaver-xtreme' /*adm*/), 'icon' => '-screenoptions',
|
1200 |
+
'id' => 'h-sidebar-opts', 'type' => 'header',
|
1201 |
+
'info' => __('Settings affecting main Sidebars and individual widgets', 'weaver-xtreme' /*adm*/),
|
1202 |
+
'help' => 'help.html#WidgetAreas'),
|
1203 |
+
|
1204 |
+
array('name' => __('Individual Widgets', 'weaver-xtreme' /*adm*/), 'id' => 'widget', 'type' => 'widget_area',
|
1205 |
+
'info' => __('Properties for individual widgets (e.g., Text, Recent Posts, etc.)', 'weaver-xtreme' /*adm*/)),
|
1206 |
+
|
1207 |
+
array('name' => __('Widget Title', 'weaver-xtreme' /*adm*/), 'id' => 'widget_title', 'type' => 'titles',
|
1208 |
+
'info' => __('Color for Widget Titles.', 'weaver-xtreme' /*adm*/)),
|
1209 |
+
array('name' => __('Bar under Widget Titles', 'weaver-xtreme' /*adm*/), 'id' => 'widget_title_underline_int', 'type' => 'val_px',
|
1210 |
+
'info' => __('Enter size in px if you want a bar under Widget Titles. Leave blank or 0 for no bar.', 'weaver-xtreme' /*adm*/)),
|
1211 |
+
|
1212 |
+
array ('name' => __('Widget List Bullet', 'weaver-xtreme' /*adm*/),
|
1213 |
+
'id' => 'widgetlist_bullet', 'type' => 'select_id',
|
1214 |
+
'info' => __('Bullet used for Unordered Lists in Widget areas.', 'weaver-xtreme' /*adm*/),
|
1215 |
+
'value' => array(
|
1216 |
+
array('val' => 'disc', 'desc' => __('Filled Disc (default)', 'weaver-xtreme' /*adm*/)),
|
1217 |
+
array('val' => 'circle', 'desc' => __('Circle', 'weaver-xtreme' /*adm*/)),
|
1218 |
+
array('val' => 'square', 'desc' => __('Square', 'weaver-xtreme' /*adm*/)),
|
1219 |
+
array('val' => 'none', 'desc' => __('None', 'weaver-xtreme' /*adm*/)))
|
1220 |
+
),
|
1221 |
+
|
1222 |
+
array('name' => __('Widget Links', 'weaver-xtreme' /*adm*/), 'id' => 'wlink', 'type' => 'link',
|
1223 |
+
'info' => __('Color for links in widgets (uses Standard Link colors if left blank).', 'weaver-xtreme' /*adm*/)),
|
1224 |
+
|
1225 |
+
array( 'type' => 'submit'),
|
1226 |
+
|
1227 |
+
|
1228 |
+
|
1229 |
+
array('name' => __('Primary Widget Area', 'weaver-xtreme' /*adm*/), 'id' => 'primary', 'type' => 'widget_area_submit',
|
1230 |
+
'info' => __('Properties for the Primary (Upper/Left) Sidebar Widget Area.', 'weaver-xtreme' /*adm*/)),
|
1231 |
+
|
1232 |
+
array('name' => __('Secondary Widget Area', 'weaver-xtreme' /*adm*/), 'id' => 'secondary', 'type' => 'widget_area_submit',
|
1233 |
+
'info' => __('Properties for the Secondary (Lower/Right) Sidebar Widget Area.', 'weaver-xtreme' /*adm*/)),
|
1234 |
+
|
1235 |
+
array('name' => __('Top Widget Areas', 'weaver-xtreme' /*adm*/), 'id' => 'top', 'type' => 'widget_area_submit',
|
1236 |
+
'info' => __('Properties for all Top Widget areas (Sitewide, Pages, Blog, Archive).', 'weaver-xtreme' /*adm*/)),
|
1237 |
+
|
1238 |
+
|
1239 |
+
array('name' => __('Bottom Widget Areas', 'weaver-xtreme' /*adm*/), 'id' => 'bottom', 'type' => 'widget_area',
|
1240 |
+
'info' => __('Properties for all Bottom Widget areas (Sitewide, Pages, Blog, Archive).', 'weaver-xtreme' /*adm*/)),
|
1241 |
+
|
1242 |
+
);
|
1243 |
+
|
1244 |
+
weaverx_form_show_options($opts);
|
1245 |
+
?>
|
1246 |
+
<hr />
|
1247 |
+
<span style="color:blue;"><b>Define Per Page Extra Widget Areas</b></span>
|
1248 |
+
<?php
|
1249 |
+
weaverx_help_link('help.html#PPWidgets','Help for Per Page Widget Areas');
|
1250 |
+
?>
|
1251 |
+
<br/>
|
1252 |
+
<small>
|
1253 |
+
<?php _e('You may define extra widget areas that can then be used in the <em>Per Page</em> settings, or in the <em>Weaver Xtreme Plus</em> [widget_area] shortcode.
|
1254 |
+
Enter a list of one or more widget area names separated by commas.
|
1255 |
+
Your names should include only letters, numbers, or underscores - no spaces or other special characters.
|
1256 |
+
The widgets areas will then appear on the Appearance->Widgets menus.
|
1257 |
+
They can be included on individual pages by adding the name you define here to the "Weaver Xtreme Options For This Page" box on the Edit Page screen. (♦)', 'weaver-xtreme' /*adm*/); ?>
|
1258 |
+
</small>
|
1259 |
+
<br />
|
1260 |
+
<?php weaverx_textarea(weaverx_getopt('_perpagewidgets'), '_perpagewidgets', 1, ' ', $style = 'width:60%;', $class='wvrx-edit'); ?>
|
1261 |
+
<?php
|
1262 |
+
do_action('weaverxplus_admin','widget_areas');
|
1263 |
+
}
|
1264 |
+
|
1265 |
+
// ======================== Main Options > Layout ========================
|
1266 |
+
function weaverx_mainopts_layout() {
|
1267 |
+
$opts = array( array( 'type' => 'submit'),
|
1268 |
+
array('name' => __('Sidebar Layout', 'weaver-xtreme' /*adm*/), 'icon' => '-welcome-widgets-menus',
|
1269 |
+
'id' => 'h-sb-layout', 'type' => 'header',
|
1270 |
+
'info' => __('Sidebar Layout for each type of page ("stack top" used for mobile view)', 'weaver-xtreme' /*adm*/),
|
1271 |
+
'help' => 'help.html#layout'),
|
1272 |
+
|
1273 |
+
array('name' => __('Blog, Post, Page Default', 'weaver-xtreme' /*adm*/), 'id' => 'layout_default', 'type' => 'select_id',
|
1274 |
+
'info' => __('Select the default theme layout for blog, single post, attachments, and pages.', 'weaver-xtreme' /*adm*/),
|
1275 |
+
'value' => array(
|
1276 |
+
array('val' => 'right', 'desc' => __('Sidebars on Right', 'weaver-xtreme' /*adm*/) ),
|
1277 |
+
array('val' => 'right-top', 'desc' => __('Sidebars on Right (stack top)', 'weaver-xtreme' /*adm*/) ),
|
1278 |
+
array('val' => 'left', 'desc' => __(' Sidebars on Left', 'weaver-xtreme' /*adm*/) ),
|
1279 |
+
array('val' => 'left-top', 'desc' => __(' Sidebars on Left (stack top)', 'weaver-xtreme' /*adm*/) ),
|
1280 |
+
array('val' => 'split', 'desc' => __('Split - Sidebars on Right and Left', 'weaver-xtreme' /*adm*/) ),
|
1281 |
+
array('val' => 'split-top', 'desc' => __('Split (stack top)', 'weaver-xtreme' /*adm*/) ),
|
1282 |
+
array('val' => 'one-column', 'desc' => __('No sidebars, content only', 'weaver-xtreme' /*adm*/) )
|
1283 |
+
)),
|
1284 |
+
|
1285 |
+
array('name' => __('Archive-like Default', 'weaver-xtreme' /*adm*/), 'id' => 'layout_default_archive', 'type' => 'select_id',
|
1286 |
+
'info' => __('Select the default theme layout for all other pages - archives, search, etc.', 'weaver-xtreme' /*adm*/),
|
1287 |
+
'value' => array(
|
1288 |
+
array('val' => 'right', 'desc' => __('Sidebars on Right', 'weaver-xtreme' /*adm*/) ),
|
1289 |
+
array('val' => 'right-top', 'desc' => __('Sidebars on Right (stack top)', 'weaver-xtreme' /*adm*/) ),
|
1290 |
+
array('val' => 'left', 'desc' => __(' Sidebars on Left', 'weaver-xtreme' /*adm*/) ),
|
1291 |
+
array('val' => 'left-top', 'desc' => __(' Sidebars on Left (stack top)', 'weaver-xtreme' /*adm*/) ),
|
1292 |
+
array('val' => 'split', 'desc' => __('Split - Sidebars on Right and Left', 'weaver-xtreme' /*adm*/) ),
|
1293 |
+
array('val' => 'split-top', 'desc' => __('Split (stack top)', 'weaver-xtreme' /*adm*/) ),
|
1294 |
+
array('val' => 'one-column', 'desc' => __('No sidebars, content only', 'weaver-xtreme' /*adm*/) )
|
1295 |
+
)),
|
1296 |
+
|
1297 |
+
array('name' => '<small>' . __('Page', 'weaver-xtreme' /*adm*/) . '</small>', 'id' => 'layout_page', 'type' => 'select_layout',
|
1298 |
+
'info' => __('Layout for normal Pages on your site.', 'weaver-xtreme' /*adm*/),
|
1299 |
+
'value' => ''
|
1300 |
+
),
|
1301 |
+
array('name' => '<small>' . __('Blog', 'weaver-xtreme' /*adm*/) . '</small>', 'id' => 'layout_blog', 'type' => 'select_layout',
|
1302 |
+
'info' => __('Layout for main blog page. Includes "Page with Posts" Page templates.', 'weaver-xtreme' /*adm*/),
|
1303 |
+
'value' => ''
|
1304 |
+
),
|
1305 |
+
array('name' => '<small>' . __('Post Single Page', 'weaver-xtreme' /*adm*/) . '</small>', 'id' => 'layout_single', 'type' => 'select_layout',
|
1306 |
+
'info' => __('Layout for Posts displayed as a single page.', 'weaver-xtreme' /*adm*/),
|
1307 |
+
'value' => ''
|
1308 |
+
),
|
1309 |
+
array('name' => '<small>' . __('Attachments', 'weaver-xtreme' /*adm*/) . '</small>', 'id' => 'layout_image', 'type' => '+select_layout',
|
1310 |
+
'info' => __('Layout for attachment pages such as images. (★Plus)', 'weaver-xtreme' /*adm*/),
|
1311 |
+
'value' => ''
|
1312 |
+
),
|
1313 |
+
array('name' => '<small>' . __('Date Archive', 'weaver-xtreme' /*adm*/) . '</small>', 'id' => 'layout_archive', 'type' => '+select_layout',
|
1314 |
+
'info' => __('Layout for archive by date pages. (★Plus)', 'weaver-xtreme' /*adm*/),
|
1315 |
+
'value' => ''
|
1316 |
+
),
|
1317 |
+
array('name' => '<small>' . __('Category Archive', 'weaver-xtreme' /*adm*/) . '</small>', 'id' => 'layout_category', 'type' => '+select_layout',
|
1318 |
+
'info' => __('Layout for category archive pages. (★Plus)', 'weaver-xtreme' /*adm*/),
|
1319 |
+
'value' => ''
|
1320 |
+
),
|
1321 |
+
array('name' => '<small>' . __('Tags Archive', 'weaver-xtreme' /*adm*/) . '</small>', 'id' => 'layout_tag', 'type' => '+select_layout',
|
1322 |
+
'info' => __('Layout for tag archive pages. (★Plus)', 'weaver-xtreme' /*adm*/),
|
1323 |
+
'value' => ''
|
1324 |
+
),
|
1325 |
+
array('name' => '<small>' . __('Author Archive</small>', 'weaver-xtreme' /*adm*/), 'id' => 'layout_author', 'type' => '+select_layout',
|
1326 |
+
'info' => __('Layout for author archive pages. (★Plus)', 'weaver-xtreme' /*adm*/),
|
1327 |
+
'value' => ''
|
1328 |
+
),
|
1329 |
+
array('name' => '<small>' . __('Search Results, 404</small>', 'weaver-xtreme' /*adm*/), 'id' => 'layout_search', 'type' => '+select_layout',
|
1330 |
+
'info' => __('Layout for search results and 404 pages. (★Plus)', 'weaver-xtreme' /*adm*/),
|
1331 |
+
'value' => ''
|
1332 |
+
),
|
1333 |
+
|
1334 |
+
|
1335 |
+
|
1336 |
+
array('name' => '<span class="i-left" style="font-size:120%;">↔</span><small>' . __('Left Sidebar Width', 'weaver-xtreme' /*adm*/) . '</small>', 'id' => 'left_sb_width_int', 'type' => 'val_percent',
|
1337 |
+
'info' => __('Width for Left Sidebar (Default: 25%)', 'weaver-xtreme' /*adm*/),
|
1338 |
+
'value' => ''
|
1339 |
+
),
|
1340 |
+
array('name' => '<span class="i-left" style="font-size:120%;">↔</span><small>' . __('Right Sidebar Width', 'weaver-xtreme' /*adm*/) . '</small>', 'id' => 'right_sb_width_int', 'type' => 'val_percent',
|
1341 |
+
'info' => __('Width for Right Sidebar (Default: 25%)', 'weaver-xtreme' /*adm*/),
|
1342 |
+
'value' => ''
|
1343 |
+
),
|
1344 |
+
array('name' => '<span class="i-left" style="font-size:120%;">↔</span><small>' . __('Split Left Sidebar Width', 'weaver-xtreme' /*adm*/) . '</small>', 'id' => 'left_split_sb_width_int', 'type' => 'val_percent',
|
1345 |
+
'info' => __('Width for Split Sidebar, Left Side (Default: 25%)', 'weaver-xtreme' /*adm*/),
|
1346 |
+
'value' => ''
|
1347 |
+
),
|
1348 |
+
array('name' => '<span class="i-left" style="font-size:120%;">↔</span><small>' . __('Split Right Sidebar Width', 'weaver-xtreme' /*adm*/) . '</small>', 'id' => 'right_split_sb_width_int', 'type' => 'val_percent',
|
1349 |
+
'info' => __('Width for Split Sidebar, Right Side (Default: 25%)', 'weaver-xtreme' /*adm*/),
|
1350 |
+
'value' => ''
|
1351 |
+
),
|
1352 |
+
array('name' => '<span class="i-left" style="font-size:120%;">↔</span> ' . __('Content Width:', 'weaver-xtreme' /*adm*/), 'type' => 'note',
|
1353 |
+
'info' => __('The width of content area automatically determined by sidebar layout and width', 'weaver-xtreme' /*adm*/)),
|
1354 |
+
|
1355 |
+
array('name' => __('Flow color to bottom', 'weaver-xtreme' /*adm*/), 'id' => 'flow_color', 'type' => '+checkbox',
|
1356 |
+
'info' => __('If checked, Content and Sidebar bg colors will flow to bottom of the Container (that is, equal heights). You must provide background colors for the Content and Sidebars or the default bg color will be used. (★Plus)', 'weaver-xtreme' /*adm*/)),
|
1357 |
+
|
1358 |
+
|
1359 |
+
|
1360 |
+
);
|
1361 |
+
?>
|
1362 |
+
<div class="options-intro">
|
1363 |
+
<strong>Sidebars & Layout: </strong>
|
1364 |
+
<?php _e('Options affecting <strong>Sidebar Layout</strong> and the main <strong>Sidebar Areas</strong>.
|
1365 |
+
This includes properties of individual <strong>Widgets</strong>, as well as properties of various <strong>Sidebars</strong>.', 'weaver-xtreme' /*adm*/); ?>
|
1366 |
+
<br />
|
1367 |
+
<div class="options-intro-menu">
|
1368 |
+
<a href="#sidebar-layout"><?php _e('Sidebar Layout', 'weaver-xtreme' /*adm*/); ?></a> |
|
1369 |
+
<a href="#individual-widgets"><?php _e('Individual Widgets', 'weaver-xtreme' /*adm*/); ?></a> |
|
1370 |
+
<a href="#primary-widget-area"><?php _e('Primary Widget Area', 'weaver-xtreme' /*adm*/); ?></a> |
|
1371 |
+
<a href="#secondary-widget-area"><?php _e('Secondary Widget Area', 'weaver-xtreme' /*adm*/); ?></a> |
|
1372 |
+
<a href="#top-widget-areas"><?php _e('Top Widget Areas', 'weaver-xtreme' /*adm*/); ?></a> |
|
1373 |
+
<a href="#bottom-widget-areas"><?php _e('Bottom Widget Areas', 'weaver-xtreme' /*adm*/); ?></a>
|
1374 |
+
</div>
|
1375 |
+
</div>
|
1376 |
+
<?php
|
1377 |
+
|
1378 |
+
weaverx_form_show_options($opts);
|
1379 |
+
do_action('weaverxplus_admin','layout'); // add new layout option?
|
1380 |
+
}
|
1381 |
+
?>
|
admin/admin-page-posts.php
ADDED
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/* Display per page and per post options.
|
3 |
+
*
|
4 |
+
* __ added - 12/10/14
|
5 |
+
*/
|
6 |
+
|
7 |
+
if ( !defined('ABSPATH')) exit; // Exit if accessed directly
|
8 |
+
// Admin panel that gets added to the page edit page for per page options
|
9 |
+
|
10 |
+
if ( ! ( function_exists( 'wvrx_ts_installed' ) ||
|
11 |
+
function_exists( 'weaverxplus_plugin_installed' ) ) ) {
|
12 |
+
|
13 |
+
add_action('admin_menu', 'weaverx_add_page_fields');
|
14 |
+
|
15 |
+
function weaverx_add_page_fields() {
|
16 |
+
add_meta_box('page-box', __('Weaver Xtreme Options For This Page (Per Page Options)', 'weaver-xtreme' /*adm*/),
|
17 |
+
'weaverx_page_extras', 'page', 'normal', 'high');
|
18 |
+
add_meta_box('post-box', __('Weaver Xtreme Options For This Post (Per Post Options)', 'weaver-xtreme' /*adm*/),
|
19 |
+
'weaverx_page_extras', 'post', 'normal', 'high');
|
20 |
+
}
|
21 |
+
|
22 |
+
function weaverx_page_extras() {
|
23 |
+
echo '<p>';
|
24 |
+
_e('<em>Weaver Xtreme</em> supports a complete set of Per Page and Per Post options if you install either
|
25 |
+
the <a href="https://wordpress.org/plugins/weaverx-theme-support/" target="_blank" alt="Weaver X Theme Support">
|
26 |
+
Weaver X Theme Support</a> free plugin, or the <a href="//plus.weavertheme.com/" target="_blank" alt="Weaver Xtreme">
|
27 |
+
Weaver Xtreme Plus</a> premium plugin.', 'weaver-xtreme' /*adm*/);
|
28 |
+
echo '</p><p>';
|
29 |
+
_e('These options include, among others, the ability to hide header images, titles, footers, as well as per page
|
30 |
+
and per post widget area options. These options allow you to give special pages or posts highly customized layouts.', 'weaver-xtreme' /*adm*/);
|
31 |
+
echo '</p>';
|
32 |
+
}
|
33 |
+
}
|
34 |
+
?>
|
admin/admin-plus.php
ADDED
@@ -0,0 +1,247 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
if ( !defined('ABSPATH')) exit; // Exit if accessed directly
|
3 |
+
/* Weaver Xtreme - admin
|
4 |
+
* __ added - 12/10/14
|
5 |
+
*/
|
6 |
+
|
7 |
+
function weaverx_admin_pro() {
|
8 |
+
|
9 |
+
weaverx_tab_title(__('Theme Add-ons','weaver-xtreme'), 'help.html#WeaverXPlus', __('Help for theme Add-ons', 'weaver-xtreme' /*adm*/));
|
10 |
+
|
11 |
+
do_action('weaverx_show_licenses');
|
12 |
+
|
13 |
+
if ( !function_exists('weaverxplus_plugin_installed') ) {
|
14 |
+
?>
|
15 |
+
<h2 style="font-weight:bold;">
|
16 |
+
<em><?php weaverx_site('','//plus.weavertheme.com/',__('Weaver Xtreme Plus', 'weaver-xtreme' /*adm*/)); ?>
|
17 |
+
<?php _e('Weaver Xtreme Plus', 'weaver-xtreme' /*adm*/); ?></a></em>
|
18 |
+
<?php _e('gives you more premium Weaver Xtreme features', 'weaver-xtreme' /*adm*/); ?>
|
19 |
+
</h2>
|
20 |
+
<div class="a-plus">
|
21 |
+
<p>
|
22 |
+
<?php _e('You can extend Weaver Xtreme\'s features by getting the premium <em>Weaver Xtreme Plus Plugin</em>.
|
23 |
+
Weaver Xtreme Plus adds useful new options to the Weaver Xtreme admin tabs
|
24 |
+
- many you\'ve probably already noticed mentioned on the existing option tabs.', 'weaver-xtreme' /*adm*/); ?>
|
25 |
+
<p>
|
26 |
+
<strong><em><?php _e('Premium features included with Weaver Xtreme Plus:', 'weaver-xtreme' /*adm*/); ?></em></strong>
|
27 |
+
<ul>
|
28 |
+
<li><?php _e('<strong>More Wrapping Areas Options</strong> - Specify background images for specific areas', 'weaver-xtreme' /*adm*/); ?></li>
|
29 |
+
<li><?php _e('<strong>More Widget Options</strong> - Define custom multi-column widgets. Equalize multi-column widget height', 'weaver-xtreme' /*adm*/); ?></li>
|
30 |
+
<li><?php _e('<strong>More Font Options</strong> - Easily add font families from hundreds of Google Fonts', 'weaver-xtreme' /*adm*/); ?></li>
|
31 |
+
<li><?php _e('<strong>Add Extra Menus</strong> - Add extra menus to your site using the Weaver Xtreme Plus Extra Menu
|
32 |
+
Widget, or the [extra_menu] shortcode', 'weaver-xtreme' /*adm*/);?></li>
|
33 |
+
<li><?php _e('<strong>Additional Post Specifics Options</strong> - Define totally custom post top and bottom info lines', 'weaver-xtreme' /*adm*/); ?></li>
|
34 |
+
<li><strong><?php _e('More <HEAD> Section Options</strong> - define custom PHP actions and filters for WordPress', 'weaver-xtreme' /*adm*/); ?></li>
|
35 |
+
<li><strong><?php _e('Additional HTML Insertion Areas</strong> - Many HTML insertion area', 'weaver-xtreme' /*adm*/); ?></li>
|
36 |
+
<li><strong><?php _e('More Per Page HTML Insertion Options</strong> - Define HTML insertions on per page basis', 'weaver-xtreme' /*adm*/); ?></li>
|
37 |
+
</ul>
|
38 |
+
</p>
|
39 |
+
<p style="font-size:large;line-height:1.4em;">
|
40 |
+
<strong><span style="color:blue; font-weight:bold;"><?php _e('Get Weaver Xtreme Plus Now!', 'weaver-xtreme' /*adm*/); ?></span></strong>
|
41 |
+
<br />
|
42 |
+
<span style="margin-left:20px;"></span><?php _e('Visit', 'weaver-xtreme' /*adm*/); ?> <?php weaverx_site('','//plus.weavertheme.com/','Weaver Xtreme Plus'); ?><?php _e('Plus.WeaverTheme.com<', 'weaver-xtreme' /*adm*/); ?>/a>
|
43 |
+
<?php _e('now to get your copy of <em>Weaver Xtreme Plus</em>.', 'weaver-xtreme' /*adm*/); ?>
|
44 |
+
</p>
|
45 |
+
</div>
|
46 |
+
|
47 |
+
<?php
|
48 |
+
} else {
|
49 |
+
// to here, have Plus features
|
50 |
+
|
51 |
+
echo '<h2 style="font-weight:bold;">' . __('Weaver Xtreme Plus Features - <span style="font-size:small;">You are using Weaver Xtreme Plus. Thank you.</span>', 'weaver-xtreme' /*adm*/) . '</h2>' . "\n";
|
52 |
+
|
53 |
+
do_action('weaverxplus_admin','weaverxplus_admin');
|
54 |
+
}
|
55 |
+
?>
|
56 |
+
<hr />
|
57 |
+
<?php
|
58 |
+
|
59 |
+
if (!function_exists('wvrx_ts_installed')) {
|
60 |
+
?>
|
61 |
+
<h2 style="font-weight:bold;"><?php _e('Get the <em>free</em> Weaver Xtreme Theme Support Plugin!', 'weaver-xtreme' /*adm*/); ?></h2>
|
62 |
+
<div class="a-plus">
|
63 |
+
<p>
|
64 |
+
<?php _e('The <em>Weaver Xtreme Theme Support</em> plugin provides a collection of useful shortcodes and widgets
|
65 |
+
to make it even easier to customize your site.', 'weaver-xtreme' /*adm*/); ?>
|
66 |
+
</p>
|
67 |
+
<p><strong><?php _e('See ', 'weaver-xtreme' /*adm*/); ?><em>
|
68 |
+
<?php weaverx_site('/plugins/weaverx-theme-plugins','','Weaver Xtreme Plugins'); ?><?php _e('Weaver Xtreme Plugins', 'weaver-xtreme' /*adm*/); ?></a></em> <?php _e('for complete details.', 'weaver-xtreme' /*adm*/); ?></strong></p>
|
69 |
+
<p>
|
70 |
+
<?php _e('Shortcodes and Widgets included:', 'weaver-xtreme' /*adm*/); ?>
|
71 |
+
<ul>
|
72 |
+
<li><strong><?php _e('[show|hide_if]</strong> - Show or hide content based on device, page/post ID, user role, or logged in status', 'weaver-xtreme' /*adm*/); ?></li>
|
73 |
+
<li><strong><?php _e('[tab_group]</strong> - Add content to a tabbed box', 'weaver-xtreme' /*adm*/); ?></li>
|
74 |
+
<li><?php _e('<strong>[youtube]</strong> - Show your YouTube videos responsively, and with the capability
|
75 |
+
to use any of the YouTube custom display options', 'weaver-xtreme' /*adm*/); ?></li>
|
76 |
+
<li><strong><?php _e('[vimeo]</strong> - Show your Vimeo videos responsively, and with the capability
|
77 |
+
to use any of the Vimeo custom display options', 'weaver-xtreme' /*adm*/); ?></li>
|
78 |
+
<li><?php _e('<strong>[iframe]</strong> - Quick and easy display of content in an iframe', 'weaver-xtreme' /*adm*/); ?></li>
|
79 |
+
<li><?php _e('Plus more shortcodes', 'weaver-xtreme' /*adm*/); ?></li>
|
80 |
+
<li><?php _e('Adds shortcode support to the standard Text Widget', 'weaver-xtreme' /*adm*/); ?></li>
|
81 |
+
<li><?php _e('<strong>Weaver Xtreme 2 Column Text Widget</strong> - Add text into two columns in a widget', 'weaver-xtreme' /*adm*/); ?></li>
|
82 |
+
<li><strong><?php _e('Weaver Xtreme Per Page Text Widget</strong> - Add a text widget on a per page basis', 'weaver-xtreme' /*adm*/); ?></li>
|
83 |
+
</ul>
|
84 |
+
</p>
|
85 |
+
</div>
|
86 |
+
|
87 |
+
<?php
|
88 |
+
} else {
|
89 |
+
do_action('weaverx_theme_support_addon');
|
90 |
+
}
|
91 |
+
}
|
92 |
+
|
93 |
+
if (!function_exists('weaverxplus_plugin_installed')) {
|
94 |
+
add_action('weaverxplus_admin','weaverxplus_admin_actions_free');
|
95 |
+
|
96 |
+
function weaverxplus_admin_actions_free( $action ) {
|
97 |
+
|
98 |
+
switch ($action) { // search code for list of actions supported by Weaver Xtreme Theme
|
99 |
+
|
100 |
+
case 'fonts':
|
101 |
+
weaverxplus_fonts();
|
102 |
+
break;
|
103 |
+
|
104 |
+
case 'footer_opts':
|
105 |
+
weaverxplus_footeropts();
|
106 |
+
break;
|
107 |
+
|
108 |
+
case 'general_appearance':
|
109 |
+
weaverxplus_genappearance();
|
110 |
+
break;
|
111 |
+
|
112 |
+
case 'header_opts':
|
113 |
+
weaverxplus_mainopts_header();
|
114 |
+
break;
|
115 |
+
|
116 |
+
case 'head_section':
|
117 |
+
weaverxplus_adv_head();
|
118 |
+
break;
|
119 |
+
|
120 |
+
case 'html_insertion':
|
121 |
+
weaverxplus_html_insertion();
|
122 |
+
break;
|
123 |
+
|
124 |
+
case 'post_specifics':
|
125 |
+
weaverxplus_post_spec();
|
126 |
+
break;
|
127 |
+
|
128 |
+
// cases with no Plus extensions
|
129 |
+
|
130 |
+
case 'admin_options':
|
131 |
+
case 'content_areas':
|
132 |
+
case 'help':
|
133 |
+
case 'layout':
|
134 |
+
case 'links':
|
135 |
+
case 'menu_bar':
|
136 |
+
case 'mobile_opts':
|
137 |
+
case 'process_options': // ignore submitted options
|
138 |
+
case 'save_restore':
|
139 |
+
case 'show_subthemes':
|
140 |
+
case 'site_opts':
|
141 |
+
case 'widget_areas':
|
142 |
+
break;
|
143 |
+
|
144 |
+
|
145 |
+
default:
|
146 |
+
// echo '<h3 style="background-color:#afa;border:2px solid green;"><strong>Weaver Xtreme Plus Extra Admin: ' . $action . '</strong></h3>';
|
147 |
+
break;
|
148 |
+
}
|
149 |
+
|
150 |
+
}
|
151 |
+
|
152 |
+
function weaverxplus_intro($title) {
|
153 |
+
echo '<h4 class="atw-option-subheader"><span style="color:black; padding:.2em;" class="dashicons dashicons-plus-alt"></span>' . $title .
|
154 |
+
' <span style="float:right;margin-right:4em;font-size:small;font-style:italic;"><a href="//plus.weavertheme.com/" target="_blank";>' . __('Get Weaver Xtreme Plus', 'weaver-xtreme' /*adm*/) . '</a></span></h4>'. "\n";
|
155 |
+
}
|
156 |
+
|
157 |
+
function weaverxplus_fonts() {
|
158 |
+
weaverxplus_intro(__('Weaver Xtreme Plus Font Options', 'weaver-xtreme' /*adm*/));
|
159 |
+
?>
|
160 |
+
<div class="a-plus">
|
161 |
+
<p>
|
162 |
+
<?php _e('<strong>Weaver Xtreme Plus</strong> makes adding new font easy.
|
163 |
+
The Plus Font Control panel allows you to easily add fonts from Google Web Fonts, Font Squirrel,
|
164 |
+
or virtually any other free or commercial font source directly to the <em>Font Family</em> text options.', 'weaver-xtreme' /*adm*/); ?>
|
165 |
+
</p>
|
166 |
+
</div> <br />
|
167 |
+
<?php
|
168 |
+
}
|
169 |
+
|
170 |
+
|
171 |
+
function weaverxplus_footeropts() {
|
172 |
+
}
|
173 |
+
|
174 |
+
function weaverxplus_genappearance() {
|
175 |
+
weaverxplus_intro('Weaver Xtreme Plus Wrapping Areas Options');
|
176 |
+
?>
|
177 |
+
<a id="background-images"></a></a><div class="a-plus">
|
178 |
+
<p>
|
179 |
+
<?php _e('<strong>Weaver Xtreme Plus</strong> allows you to specify a background image for specific areas
|
180 |
+
on your site, including a full screen site bg image, background images for the wrapper,
|
181 |
+
header, container, content, sidebars and more. You easily pick any image from your
|
182 |
+
Media Library to use as the background image.', 'weaver-xtreme' /*adm*/); ?>
|
183 |
+
</p>
|
184 |
+
</div>
|
185 |
+
|
186 |
+
<?php
|
187 |
+
}
|
188 |
+
|
189 |
+
function weaverxplus_mainopts_header() {
|
190 |
+
|
191 |
+
}
|
192 |
+
|
193 |
+
function weaverxplus_adv_head() {
|
194 |
+
weaverxplus_intro(__('Weaver Xtreme Plus <HEAD> Section Options', 'weaver-xtreme' /*adm*/));
|
195 |
+
?>
|
196 |
+
<div class="a-plus">
|
197 |
+
<p>
|
198 |
+
<?php _e('For advanced users, <strong>Weaver Xtreme Plus</strong> allows you to write complete PHP functions
|
199 |
+
that can define WordPress actions and filters used to format and control much of the content
|
200 |
+
output of your theme. Much of what previously required defining a child theme can be
|
201 |
+
done with the Actions and Filters feature of <strong>Weaver Xtreme Plus</strong>.', 'weaver-xtreme' /*adm*/); ?>
|
202 |
+
</p>
|
203 |
+
</div>
|
204 |
+
<?php
|
205 |
+
}
|
206 |
+
|
207 |
+
function weaverxplus_html_insertion() {
|
208 |
+
weaverxplus_intro('Weaver Xtreme Plus Additional HTML Insertion Areas');
|
209 |
+
?>
|
210 |
+
<div class='a-plus'>
|
211 |
+
<p>
|
212 |
+
<?php _e('<strong>Weaver Xtreme Plus</strong> includes these additional HTML Insertions areas:', 'weaver-xtreme' /*adm*/); ?>
|
213 |
+
<ul style="padding-left:4em;">
|
214 |
+
<li><?php _e('Header Top Code', 'weaver-xtreme' /*adm*/); ?></li>
|
215 |
+
<li><?php _e('Container Top', 'weaver-xtreme' /*adm*/); ?></li>
|
216 |
+
<li><?php _e('Content Top', 'weaver-xtreme' /*adm*/); ?></li>
|
217 |
+
<li><?php _e('Page Content Bottom', 'weaver-xtreme' /*adm*/); ?></li>
|
218 |
+
<li><?php _e('Post-Post Content Code', 'weaver-xtreme' /*adm*/); ?></li>
|
219 |
+
<li><?php _e('Pre-Comments Code', 'weaver-xtreme' /*adm*/); ?></li>
|
220 |
+
<li><?php _e('Post-Comments Code', 'weaver-xtreme' /*adm*/); ?></li>
|
221 |
+
<li><?php _e('Pre-Footer Code', 'weaver-xtreme' /*adm*/); ?></li>
|
222 |
+
<li><?php _e('Pre-Sidebar', 'weaver-xtreme' /*adm*/); ?></li>
|
223 |
+
<li><?php _e('Fixed Browser Top Area', 'weaver-xtreme' /*adm*/); ?></li>
|
224 |
+
<li><?php _e('Fixed Browser Bottom Area', 'weaver-xtreme' /*adm*/); ?></li>
|
225 |
+
</ul>
|
226 |
+
</p>
|
227 |
+
</div>
|
228 |
+
<?php
|
229 |
+
}
|
230 |
+
|
231 |
+
//Header TopContainer TopContent TopPage Content BottomPost-Post ContentPre-CommentsPost-CommentsPre-FooterPre-Sidebar
|
232 |
+
function weaverxplus_post_spec() {
|
233 |
+
weaverxplus_intro( __('Weaver Xtreme Plus Additional Post Specifics Options', 'weaver-xtreme' /*adm*/));
|
234 |
+
?>
|
235 |
+
<div class="a-plus">
|
236 |
+
<p>
|
237 |
+
<?php _e('<strong>Weaver Xtreme Plus</strong> includes the ability to define custom top and bottom post meta info lines.
|
238 |
+
You can define any combination of labels, icons, and elements like categories, author, dates, and custom text
|
239 |
+
to replace the default meta info lines.', 'weaver-xtreme' /*adm*/); ?>
|
240 |
+
</p>
|
241 |
+
</div>
|
242 |
+
<br />
|
243 |
+
<?php
|
244 |
+
}
|
245 |
+
|
246 |
+
} // end of Weaver Xtreme Free's Weaver Xtreme Plus plugs
|
247 |
+
?>
|
admin/admin-sapi-lib.php
ADDED
@@ -0,0 +1,351 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/*
|
3 |
+
This file includes the interface to the WP Settings API.
|
4 |
+
|
5 |
+
Because the SAPI is quite limiting on the format of the output fields
|
6 |
+
supported by add_settings_field, we will not use that part.
|
7 |
+
|
8 |
+
Settings that need validation and nonce handling, we use our function weaverx_sapi_main_name() that
|
9 |
+
generates the <input name="weaverx_main_settings[option_name]" ...> format required for
|
10 |
+
processing by the sapi handlers. They create an array called $_POST['weaverx_main_settings']. Each
|
11 |
+
setting in that array corresponds to a Weaver Xtreme option value, and will be passed to the
|
12 |
+
validation function.
|
13 |
+
|
14 |
+
We will wrap the main form (Main Options) with our functions
|
15 |
+
weaverx_sapi_form_top() and weaverx_sapi_form_bottom() that generates required calls to sapi.
|
16 |
+
|
17 |
+
All other forms will use submit buttons that include their own nonce definition. Other forms generally
|
18 |
+
do not change individual settings, but take actions such as save/restore or setting a subtheme.
|
19 |
+
*/
|
20 |
+
|
21 |
+
/*
|
22 |
+
================= nonce helpers =====================
|
23 |
+
*/
|
24 |
+
function weaverx_submitted($submit_name) {
|
25 |
+
// do a nonce check for each form submit button
|
26 |
+
// pairs 1:1 with weaverx_nonce_field
|
27 |
+
$nonce_act = $submit_name.'_act';
|
28 |
+
$nonce_name = $submit_name.'_nonce';
|
29 |
+
|
30 |
+
if (isset($_POST[$submit_name])) {
|
31 |
+
if (isset($_POST[$nonce_name]) && wp_verify_nonce($_POST[$nonce_name],$nonce_act)) {
|
32 |
+
return true;
|
33 |
+
} else {
|
34 |
+
die(__('WARNING: invalid form submit detected. Probably caused by session time-out, or, rarely, a failed security check. Please contact WeaverTheme.com if you continue to receive this message.', 'weaver-xtreme' /*adm*/) . '(' . $submit_name . ')');
|
35 |
+
}
|
36 |
+
} else {
|
37 |
+
return false;
|
38 |
+
}
|
39 |
+
}
|
40 |
+
|
41 |
+
function weaverx_nonce_field($submit_name,$echo = true) {
|
42 |
+
// pairs 1:1 with sumbitted
|
43 |
+
// will be one for each form submit button
|
44 |
+
|
45 |
+
return wp_nonce_field($submit_name.'_act',$submit_name.'_nonce',$echo);
|
46 |
+
}
|
47 |
+
|
48 |
+
|
49 |
+
// # RUNTIME SAPI HELPER FUNCTIONS ============================================
|
50 |
+
|
51 |
+
function weaverx_sapi_options_init() {
|
52 |
+
/* this will initialize the SAPI stuff, must be called from the admin_init cb function .
|
53 |
+
In reality, we really only need to register one setting - 'weaverx_main_settings_group',
|
54 |
+
and the settings will be saved in the WP DB as 'weaverx_main_settings'. The SAPI uses
|
55 |
+
the name param of any <input> fields to figure out where to store the input value.
|
56 |
+
|
57 |
+
The validation will have to scan the ENTIRE list of options and lookup the kind of
|
58 |
+
validation each parameter needs.
|
59 |
+
*/
|
60 |
+
|
61 |
+
register_setting('weaverx_settings_group', /* the group name of our settings */
|
62 |
+
apply_filters('weaverx_options','weaverx_settings'), /* the get_option name */
|
63 |
+
'weaverx_validate_cb'); /* a validation call back */
|
64 |
+
}
|
65 |
+
|
66 |
+
function weaverx_validate_cb($in) {
|
67 |
+
|
68 |
+
return weaverx_validate_all_options($in);
|
69 |
+
}
|
70 |
+
|
71 |
+
/*
|
72 |
+
================= Main SAPI helper functions =================
|
73 |
+
*/
|
74 |
+
|
75 |
+
function weaverx_sapi_form_top($group, $form_name='') {
|
76 |
+
/* beginning of a form */
|
77 |
+
$name = '';
|
78 |
+
if ($form_name != '') $name = 'name="' . $form_name . '"';
|
79 |
+
|
80 |
+
echo("<form action=\"options.php\" $name method=\"post\">\n"); /* <form action="options.php" method="post"> */
|
81 |
+
settings_fields($group); // use our one set of settings
|
82 |
+
}
|
83 |
+
|
84 |
+
function weaverx_sapi_form_bottom($form_name='end of form') {
|
85 |
+
|
86 |
+
$non_sapi = array( // non-sapi elements in the db
|
87 |
+
'weaverx_version_id', 'style_version',
|
88 |
+
'theme_filename', 'addon_name', '_hide_theme_thumbs', 'last_option'
|
89 |
+
);
|
90 |
+
|
91 |
+
/* The following code allows the SAPI to save the non-sapi values. If you don't do this here,
|
92 |
+
then the values will be set to false, and be lost! SAPI is not tolerant of submitting a form
|
93 |
+
that doesn't include EVERY setting for the form group. */
|
94 |
+
|
95 |
+
foreach ($non_sapi as $name) {
|
96 |
+
?>
|
97 |
+
<input name="<?php weaverx_sapi_main_name($name); ?>" id="<?php echo $name;?>" type="hidden" value="<?php echo weaverx_getopt($name); ?>" />
|
98 |
+
<?php
|
99 |
+
}
|
100 |
+
weaverx_setopt('last_option','Weaver Xtreme'); // Safety check for limited PHP $_POST variables
|
101 |
+
echo ("</form> <!-- $form_name -->\n");
|
102 |
+
}
|
103 |
+
|
104 |
+
function weaverx_sapi_submit( $before='', $after='', $show_more_opts = false ) {
|
105 |
+
// generate a submit button for the form
|
106 |
+
$submit_label = __('Save Settings', 'weaver-xtreme' /*adm*/);
|
107 |
+
echo $before;
|
108 |
+
?>
|
109 |
+
<span style="display:inline;"><input name="save_options" type="submit" style="margin-top:10px;" class="button-primary" value="<?php echo($submit_label); ?>" />
|
110 |
+
<?php
|
111 |
+
echo "</span>\n" . $after ;
|
112 |
+
|
113 |
+
}
|
114 |
+
|
115 |
+
function weaverx_form_submit($value) {
|
116 |
+
weaverx_sapi_submit('</table>','<table style="margin-top:10px;">');
|
117 |
+
}
|
118 |
+
|
119 |
+
function weaverx_sapi_main_name($id, $echo=true) {
|
120 |
+
/* generate the SAPI name for 'weaverx_settings' */
|
121 |
+
$name = apply_filters('weaverx_options','weaverx_settings');
|
122 |
+
if ($echo) echo $name. '[' . $id . ']';
|
123 |
+
return $name . '[' . $id . ']';
|
124 |
+
}
|
125 |
+
|
126 |
+
/*
|
127 |
+
============== Validation =====================
|
128 |
+
*/
|
129 |
+
function weaverx_validate_all_options($in) {
|
130 |
+
/* validation for all options */
|
131 |
+
$err_msg = ''; // no error message yet
|
132 |
+
|
133 |
+
if (empty($in)) {
|
134 |
+
wp_die( __( 'You attempted to save options, but something has gone wrong. Please be sure you are logged in and your host is correctly configured. See the "Weaver Doesn\'t Save Settings" FAQ on weavertheme.com.' ,'weaver-xtreme') );
|
135 |
+
}
|
136 |
+
|
137 |
+
if (!current_user_can('edit_theme_options')) {
|
138 |
+
wp_die( __( 'You do not have sufficient permissions to manage options for this site.' ,'weaver-xtreme') );
|
139 |
+
}
|
140 |
+
|
141 |
+
$wvr_last = '';
|
142 |
+
|
143 |
+
|
144 |
+
foreach ($in as $key => $value) {
|
145 |
+
switch ($key) {
|
146 |
+
|
147 |
+
/* -------- integer -------- */
|
148 |
+
case 'excerpt_length':
|
149 |
+
|
150 |
+
if (!empty($value) && (!is_numeric($value) || !is_int((int)$value))) {
|
151 |
+
$opt_id = str_replace('', '', $key);
|
152 |
+
$opt_id = str_replace('_', ' ', $opt_id);
|
153 |
+
$err_msg .= __('Option must be an integer value: ', 'weaver-xtreme' /*adm*/) . '"'. $opt_id . '" = "' . $value . '".'
|
154 |
+
. __(' Value has been cleared to blank value', 'weaver-xtreme' /*adm*/) . '<br />';
|
155 |
+
$in[$key] = '';
|
156 |
+
}
|
157 |
+
break;
|
158 |
+
|
159 |
+
/* ---------- text ----------- */
|
160 |
+
case 'excerpt_more_msg':
|
161 |
+
case 'header_maxwidth':
|
162 |
+
|
163 |
+
if (!empty($value))
|
164 |
+
$in[$key] = weaverx_filter_textarea($value);
|
165 |
+
break;
|
166 |
+
|
167 |
+
case 'themename': // can't be empty!
|
168 |
+
if (empty($value))
|
169 |
+
$in[$key] = 'please-give-this-a-name';
|
170 |
+
else
|
171 |
+
$in[$key] = weaverx_filter_textarea($value);
|
172 |
+
break;
|
173 |
+
|
174 |
+
|
175 |
+
/* code */
|
176 |
+
case 'copyright': // Alternate copyright
|
177 |
+
case '_css_rows':
|
178 |
+
if (!empty($value)) {
|
179 |
+
$in[$key] = weaverx_filter_code($value);
|
180 |
+
}
|
181 |
+
break;
|
182 |
+
|
183 |
+
|
184 |
+
case '_perpagewidgets': // Add widget areas for per page - names must be lower case
|
185 |
+
if (!empty($value)) {
|
186 |
+
$in[$key] = strtolower(str_ireplace(' ','',weaverx_filter_code($value)));
|
187 |
+
}
|
188 |
+
break;
|
189 |
+
|
190 |
+
case '_althead_opts':
|
191 |
+
case 'head_opts':
|
192 |
+
if ( !empty( $value ) ) {
|
193 |
+
$in[$key] = weaverx_filter_head( $value );
|
194 |
+
}
|
195 |
+
break;
|
196 |
+
|
197 |
+
case 'wvrx_css_saved':
|
198 |
+
if ( !empty( $value ) ) {
|
199 |
+
$in[$key] = weaverx_filter_code( $value );
|
200 |
+
//$in[$key] = wp_filter_post_kses( trim(stripslashes($value)) );
|
201 |
+
}
|
202 |
+
break;
|
203 |
+
|
204 |
+
|
205 |
+
/* must not have <style .... </style> */
|
206 |
+
case 'add_css': // Add CSS Rules to Weaver Xtreme's style rules
|
207 |
+
|
208 |
+
if (!empty($value)) {
|
209 |
+
$val = weaverx_filter_code($value);
|
210 |
+
$in[$key] = $val;
|
211 |
+
if (stripos($val,'<style') !== false || stripos($val, '</style') !== false ||
|
212 |
+
stripos($val,'<script') !== false || stripos($val, '</script') !== false) {
|
213 |
+
$err_msg .= __('<style> or <script> tags have been automatically stripped from your "Add CSS Rules"!', 'weaver-xtreme' /*adm*/)
|
214 |
+
. ' ' . __('Please correct your entry.', 'weaver-xtreme' /*adm*/) . '<br />';
|
215 |
+
$in[$key] = wp_filter_post_kses( trim(stripslashes($val)) );
|
216 |
+
}
|
217 |
+
}
|
218 |
+
break;
|
219 |
+
|
220 |
+
case '_fonts_google':
|
221 |
+
$in[$key] = $value;
|
222 |
+
break;
|
223 |
+
|
224 |
+
case 'last_option': // check for last_option...
|
225 |
+
if (!empty($value))
|
226 |
+
$wvr_last = $value;
|
227 |
+
break;
|
228 |
+
|
229 |
+
default: /* to here, then colors, _css, or checkbox/selectors */
|
230 |
+
$keylen = strlen($key);
|
231 |
+
|
232 |
+
if (strrpos($key,'_css') == $keylen-4) { // all _css settings
|
233 |
+
if (!empty($value)) {
|
234 |
+
$val = weaverx_filter_code($value);
|
235 |
+
if (stripos($val,'<style') !== false || stripos($val, '</style') !== false ||
|
236 |
+
stripos($val,'<script') !== false || stripos($val, '</script') !== false) {
|
237 |
+
$err_msg .= __('<style> or <script> tags have been automatically stripped from your CSS+ rules,', 'weaver-xtreme' /*adm*/)
|
238 |
+
. ' ' . __('Please correct your entry.', 'weaver-xtreme' /*adm*/) . '<br />';
|
239 |
+
$val = wp_filter_post_kses( trim($val) );
|
240 |
+
}
|
241 |
+
|
242 |
+
$in[$key] = $val;
|
243 |
+
|
244 |
+
if (strpos($val, '{') === false || strpos($val, '}') === false) {
|
245 |
+
$opt_id = str_replace('_css', '', $key); // kill _css
|
246 |
+
$opt_id = str_replace('', '', $opt_id);
|
247 |
+
$opt_id = str_replace('_', ' ', $opt_id);
|
248 |
+
$err_msg .= __('CSS options must be enclosed in {}\'s: ', 'weaver-xtreme' /*adm*/) . '"'. $opt_id . '" = "' . $value . '". '
|
249 |
+
. __('Please correct your entry.', 'weaver-xtreme' /*adm*/) . '<br />';
|
250 |
+
}
|
251 |
+
}
|
252 |
+
break;
|
253 |
+
} // _css
|
254 |
+
|
255 |
+
if (strrpos($key,'_insert') == $keylen-7) { // all _insert settings
|
256 |
+
if (!empty($value)) {
|
257 |
+
$val = weaverx_filter_code($value);
|
258 |
+
$in[$key] = $val;
|
259 |
+
}
|
260 |
+
break;
|
261 |
+
} // _insert
|
262 |
+
|
263 |
+
if (strrpos($key,'_url') == $keylen-4) { // all _url settings
|
264 |
+
if (!empty($value)) {
|
265 |
+
$val = weaverx_filter_code($value); // can't use esc_url because that forces a leading html{background-image: url(%template_directory%assets/images/addon_themes.png);}
|
266 |
+
$in[$key] = $val;
|
267 |
+
}
|
268 |
+
break;
|
269 |
+
} // _insert
|
270 |
+
|
271 |
+
if (strrpos($key,'_dec') == $keylen-4) {
|
272 |
+
if (!empty($value) && !is_numeric($value)) {
|
273 |
+
$opt_id = str_replace('', '', $key);
|
274 |
+
$opt_id = str_replace('_dec', '', $opt_id);
|
275 |
+
$opt_id = str_replace('_', ' ', $opt_id);
|
276 |
+
$err_msg .= __('Option must be a numeric value: ', 'weaver-xtreme' /*adm*/) . '"'. $opt_id . '" = "' . $value . '". '
|
277 |
+
. __('Value has been cleared to blank value.', 'weaver-xtreme' /*adm*/) . '<br />';
|
278 |
+
$in[$key] = '';
|
279 |
+
}
|
280 |
+
break;
|
281 |
+
}
|
282 |
+
|
283 |
+
if (strrpos($key,'_int') == $keylen-4 || // _int settings
|
284 |
+
strrpos($key,'_X') == $keylen-2 ||
|
285 |
+
strrpos($key,'_Y') == $keylen-2 ||
|
286 |
+
strrpos($key,'_L') == $keylen-2 ||
|
287 |
+
strrpos($key,'_R') == $keylen-2 ||
|
288 |
+
strrpos($key,'_T') == $keylen-2 ||
|
289 |
+
strrpos($key,'_B') == $keylen-2 ) {
|
290 |
+
if (!empty($value) && (!is_numeric($value) || !is_int((int)$value))) {
|
291 |
+
$opt_id = str_replace('', '', $key);
|
292 |
+
$opt_id = str_replace('_int', '', $opt_id);
|
293 |
+
$opt_id = str_replace('_', ' ', $opt_id);
|
294 |
+
$err_msg .= __('Option must be a numeric value: ', 'weaver-xtreme' /*adm*/) . '"'. $opt_id . '" = "' . $value . '". '
|
295 |
+
. __('Value has been cleared to blank value.', 'weaver-xtreme' /*adm*/) . '<br />';
|
296 |
+
$in[$key] = '';
|
297 |
+
}
|
298 |
+
break;
|
299 |
+
}
|
300 |
+
|
301 |
+
if (strrpos($key,'color') == $keylen-5) { // _bgcolor and _color (order here important - after _css, etc.)
|
302 |
+
if (!empty($value)) {
|
303 |
+
|
304 |
+
$val = trim(weaverx_filter_code($value));
|
305 |
+
if (preg_match('/^#?+[0-9a-f]{3}(?:[0-9a-f]{3})?$/i', $val)) { // hex value
|
306 |
+
$val = strtoupper($val); // force hex values to upper case, just to be tidy
|
307 |
+
if ($val[0] != '#') $val = '#' . $val;
|
308 |
+
$in[$key] = $val;
|
309 |
+
} else if (preg_match("/^([a-zA-Z])+$/i", $val)) { // name - all letters
|
310 |
+
$in[$key] = $val;
|
311 |
+
} else { // only legal things left are rgb and rgba
|
312 |
+
$isrgb = strpos( $val, 'rgb' );
|
313 |
+
$ishsa = strpos( $val, 'hsl' );
|
314 |
+
if ($isrgb === false && $ishsa === false) {
|
315 |
+
if ( $value == ' ') {
|
316 |
+
$in[$key] = '';
|
317 |
+
} else {
|
318 |
+
$err_msg .= __('Color must be a valid # hex value, rgb value, or color name (a-z): ', 'weaver-xtreme' /*adm*/) .
|
319 |
+
'"'. $key . '" = "' . bin2hex($value) . '". ' .
|
320 |
+
__('Value has been cleared to blank value.', 'weaver-xtreme' /*adm*/) . '<br />';
|
321 |
+
}
|
322 |
+
$in[$key] = '';
|
323 |
+
} else {
|
324 |
+
$in[$key] = $val;
|
325 |
+
}
|
326 |
+
}
|
327 |
+
}
|
328 |
+
break;
|
329 |
+
}
|
330 |
+
|
331 |
+
if (!empty($value) && is_string($value) && !is_numeric($value)) { $in[$key] = weaverx_filter_textarea($value); }
|
332 |
+
|
333 |
+
break;
|
334 |
+
}
|
335 |
+
}
|
336 |
+
|
337 |
+
if (false && $wvr_last != 'Weaver Xtreme') {
|
338 |
+
$err_msg .= __('Warning - your host may be configured to limit how many input var options you are allowed to pass via PHP.
|
339 |
+
Unfortunately, this means your settings may not be saved correctly. See the "Weaver II Doesn\'t Save Settings" FAQ on weavertheme.com.<br />', 'weaver-xtreme' /*adm*/);
|
340 |
+
}
|
341 |
+
|
342 |
+
|
343 |
+
if (!empty($err_msg)) {
|
344 |
+
add_settings_error('weaverx_settings', 'settings_error', $err_msg, 'error');
|
345 |
+
} else {
|
346 |
+
add_settings_error('weaverx_settings', 'settings_updated', __('Weaver Xtreme Settings Saved.', 'weaver-xtreme' /*adm*/), 'updated');
|
347 |
+
}
|
348 |
+
|
349 |
+
return $in;
|
350 |
+
}
|
351 |
+
?>
|
admin/admin-saverestore.php
ADDED
@@ -0,0 +1,274 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
if ( !defined('ABSPATH')) exit; // Exit if accessed directly
|
3 |
+
/* Weaver Xtreme - admin Save/Restore
|
4 |
+
* __ added - 12/10/14
|
5 |
+
* This will come after the Options form has been closed, and is used for non-SAPI options
|
6 |
+
*
|
7 |
+
*/
|
8 |
+
|
9 |
+
function weaverx_admin_saverestore() {
|
10 |
+
$saved = get_option( apply_filters('weaverx_options','weaverx_settings_backup') ,array());
|
11 |
+
$style_date = '';
|
12 |
+
if (!empty($saved))
|
13 |
+
$style_date = $saved['style_date'];
|
14 |
+
|
15 |
+
if (! $style_date ) $style_date = __('No saved settings', 'weaver-xtreme' /*adm*/);
|
16 |
+
?>
|
17 |
+
|
18 |
+
<div class="atw-option-header" style="clear:both;"><?php _e('Save/Restore Theme Settings', 'weaver-xtreme' /*adm*/);weaverx_help_link('help.html#SaveRestore',_e('Help on Save/Restore Themes', 'weaver-xtreme' /*adm*/));?></div>
|
19 |
+
<p>
|
20 |
+
<?php _e('Note: if you have Weaver Xtreme Plus installed, then options marked with ★Plus will be included in saves and restores.', 'weaver-xtreme' /*adm*/); ?>
|
21 |
+
</p>
|
22 |
+
<div class="atw-option-subheader"><?php _e('Save/Restore Current Theme Settings using WordPress Database', 'weaver-xtreme' /*adm*/);?></div>
|
23 |
+
<?php _e('<p>This option allows you to save and restore all current theme settings using your host\'s WordPress database. Your options will be preserved across Weaver Xtreme theme upgrades, as well when you change to different themes. There is only one saved backup available. You can also download your setting to your computer with the options below.</p>
|
24 |
+
<p>Note: This save option saves <strong>all</strong> settings, including those marked with ♦.</p>', 'weaver-xtreme' /*adm*/);?>
|
25 |
+
<form name="save_mysave_form" method="post">
|
26 |
+
<span class="submit"><input type="submit" name="save_mytheme" value="<?php _e('Save Current Theme Settings', 'weaver-xtreme' /*adm*/);?>"/></span>
|
27 |
+
<strong><?php _e('Backup all current theme settings using the WordPress database.', 'weaver-xtreme' /*adm*/);?></strong>
|
28 |
+
<?php weaverx_nonce_field('save_mytheme'); ?>
|
29 |
+
<br /><br />
|
30 |
+
<span class="submit"><input type="submit" name="restore_mytheme" value="<?php _e('Restore Settings', 'weaver-xtreme' /*adm*/);?>"/></span>
|
31 |
+
<strong><?php _e('Restore from saved settings.', 'weaver-xtreme' /*adm*/);?></strong> <em><?php _e('Last save date:', 'weaver-xtreme' /*adm*/);?> <?php echo $style_date; ?></em>
|
32 |
+
<?php
|
33 |
+
weaverx_nonce_field('restore_mytheme');
|
34 |
+
do_action('weaverxplus_admin','save_restore');
|
35 |
+
?>
|
36 |
+
</form>
|
37 |
+
|
38 |
+
<?php
|
39 |
+
|
40 |
+
weaverx_saverestore(); // download/upload to computer
|
41 |
+
|
42 |
+
do_action('weaverx_child_saverestore'); // allow additional save/restore in child
|
43 |
+
|
44 |
+
do_action('weaverx_child_update');
|
45 |
+
?>
|
46 |
+
<div class="atw-option-subheader"><?php _e('Reset Current Settings to Default', 'weaver-xtreme' /*adm*/); ?></div><br />
|
47 |
+
<form name="resetweaverx_form" method="post" onSubmit="return confirm('<?php _e('Are you sure you want to reset all Weaver Xtreme settings? This will include the [Saved Current Settings using WordPress Database].', 'weaver-xtreme' /*adm*/); ?>');">
|
48 |
+
<strong><?php _e('Click the Clear button to reset all Weaver Xtreme settings, including ♦, ★Plus, and Weaver Xtreme Plus shortcode settings, to the default values.', 'weaver-xtreme' /*adm*/); ?></strong><br >
|
49 |
+
<em style="color:red;"><?php _e('Warning: You will lose all current settings, including settings from "Save Settings using the WordPress Database".', 'weaver-xtreme' /*adm*/); ?></em><br />
|
50 |
+
<?php _e('You should use the "Download Current Settings To Your Computer" option above to save a copy of your current settings before clearing!
|
51 |
+
If you have Weaver Xtreme Plus installed, you should also save shortcode settings from the Xtreme Plus Save/Restore tab.', 'weaver-xtreme' /*adm*/); ?>
|
52 |
+
<br />
|
53 |
+
<span class="submit"><input type="submit" name="reset_weaverx" value="<?php _e('Clear All Weaver Xtreme Settings', 'weaver-xtreme' /*adm*/); ?>"/></span>
|
54 |
+
<?php weaverx_nonce_field('reset_weaverx'); ?>
|
55 |
+
</form> <!-- resetweaverx_form -->
|
56 |
+
<br /><hr />
|
57 |
+
|
58 |
+
<?php
|
59 |
+
|
60 |
+
}
|
61 |
+
|
62 |
+
function weaverx_process_options_admin_standard( $processed ) {
|
63 |
+
if ( weaverx_submitted( 'weaverx_clear_messages' )) {
|
64 |
+
return true;
|
65 |
+
}
|
66 |
+
if (weaverx_submitted('reset_weaverx')) {
|
67 |
+
if (! current_user_can('manage_options'))
|
68 |
+
wp_die(__('You do not have the capability to do that.', 'weaver-xtreme' /*adm*/));
|
69 |
+
// delete everything!
|
70 |
+
weaverx_save_msg(__('All Weaver Xtreme settings have been reset to the defaults.','weaver-xtreme'));
|
71 |
+
delete_option( apply_filters('weaverx_options','weaverx_settings') );
|
72 |
+
global $weaverx_opts_cache;
|
73 |
+
$weaverx_opts_cache = false; // clear the cache
|
74 |
+
weaverx_init_opts('reset_weaverx');
|
75 |
+
delete_option( apply_filters('weaverx_options','weaverx_settings_backup') );
|
76 |
+
|
77 |
+
do_action('weaverxplus_admin','reset_weaverxplus');
|
78 |
+
|
79 |
+
update_user_meta( get_current_user_id(), 'tgmpa_dismissed_notice', 0 ); // reset the dismiss on the plugin loader
|
80 |
+
return true;
|
81 |
+
}
|
82 |
+
|
83 |
+
if (weaverx_submitted('uploadtheme') && function_exists('weaverx_loadtheme')) {
|
84 |
+
weaverx_loadtheme();
|
85 |
+
return true;
|
86 |
+
}
|
87 |
+
|
88 |
+
return $processed;
|
89 |
+
}
|
90 |
+
|
91 |
+
function weaverx_saverestore(){
|
92 |
+
/* admin tab for saving and restoring theme */
|
93 |
+
$weaverx_theme_dir = esc_url(weaverx_f_uploads_base_dir() .'weaverx-theme/');
|
94 |
+
$download_path = esc_url(weaverx_relative_url('includes/download.php'));
|
95 |
+
$download_img_path = esc_url(weaverx_relative_url('assets/images/download.png'));
|
96 |
+
$nonce = wp_create_nonce('weaverx_download');
|
97 |
+
$a_pro = (function_exists('weaverxplus_plugin_installed')) ? '-plus' : '';
|
98 |
+
|
99 |
+
?>
|
100 |
+
<h3 class="atw-option-subheader" style="color:blue;">
|
101 |
+
<?php _e('Save/Restore Current Theme Settings using Your Computer', 'weaver-xtreme' /*adm*/); ?>
|
102 |
+
</h3>
|
103 |
+
<p>
|
104 |
+
<?php _e('This option allows you to save and restore all current theme settings by uploading and downloading to your own computer.', 'weaver-xtreme' /*adm*/); ?>
|
105 |
+
</p>
|
106 |
+
|
107 |
+
<h3><?php _e('Download Current Settings To Your Computer', 'weaver-xtreme' /*adm*/); ?></h3>
|
108 |
+
|
109 |
+
<a href="<?php echo $download_path . '?_wpnonce=' . $nonce; ?>"><img src="<?php echo esc_url($download_img_path); ?>" />
|
110 |
+
<strong><?php _e('Download', 'weaver-xtreme' /*adm*/); ?></strong> </a> -
|
111 |
+
<?php _e('<strong>Save all</strong> current settings to file on your computer.
|
112 |
+
(Full settings backup, including those marked with ♦.) <em>File:</em>', 'weaver-xtreme' /*adm*/); ?>
|
113 |
+
<strong>weaverx-backup-settings<?php echo $a_pro;?>.wxb</strong>
|
114 |
+
<br />
|
115 |
+
<br />
|
116 |
+
<a href="<?php echo $download_path . '?_wpnoncet=' . $nonce;?>"><img src="<?php echo esc_url($download_img_path); ?>" />
|
117 |
+
<strong><?php _e('Download', 'weaver-xtreme' /*adm*/); ?></strong></a> -
|
118 |
+
<?php _e('<strong><em>Save only theme related</em></strong> current settings to file on your computer. <em>File:</em>
|
119 |
+
<strong>weaverx-theme-settings<?php echo $a_pro;?>.wxt</strong>', 'weaver-xtreme' /*adm*/); ?>
|
120 |
+
<?php
|
121 |
+
if (function_exists('weaverxplus_plugin_installed'))
|
122 |
+
echo '<p>' .
|
123 |
+
__('Note: Downloaded settings include <em>Weaver Xtreme Plus</em> settings.
|
124 |
+
Setting files from Weaver Xtreme Plus can be uploaded to the Free Weaver Xtreme version, but will not be used or saved by the free version.', 'weaver-xtreme' /*adm*/)
|
125 |
+
. '</p>';
|
126 |
+
?>
|
127 |
+
|
128 |
+
<form enctype="multipart/form-data" action="<?php echo $_SERVER["REQUEST_URI"]; ?>" method="POST">
|
129 |
+
<table>
|
130 |
+
<tr><td><h3><?php _e('Upload settings from file saved on your computer', 'weaver-xtreme' /*adm*/); ?></h3></td></tr>
|
131 |
+
|
132 |
+
<tr valign="top">
|
133 |
+
<td><?php _e('Select theme/backup file to upload:', 'weaver-xtreme' /*adm*/); ?>
|
134 |
+
<span style="border:1px solid black;padding:2px;"><input name="uploaded" type="file" /></span>
|
135 |
+
<input type="hidden" name="uploadit" value="yes" /> <?php _e('(Restores settings in file to current settings.)', 'weaver-xtreme' /*adm*/); ?>
|
136 |
+
</td>
|
137 |
+
</tr>
|
138 |
+
|
139 |
+
<tr><td><span class='submit'>
|
140 |
+
<input name="uploadtheme" type="submit" value="<?php _e('Upload theme/backup', 'weaver-xtreme' /*adm*/); ?>" /></span>
|
141 |
+
<small><?php _e('<strong>Upload and Restore</strong> a theme/backup from file on your computer. Will become current settings.', 'weaver-xtreme' /*adm*/); ?>
|
142 |
+
</small></td></tr>
|
143 |
+
|
144 |
+
<tr><td>
|
145 |
+
<?php if (!function_exists('weaverxplus_plugin_installed'))
|
146 |
+
echo '<small>' .
|
147 |
+
__('Note: Any Weaver Xtreme Plus settings will <em>not</em> be restored for Weaver Xtreme Free version.', 'weaver-xtreme' /*adm*/) . '</small>';
|
148 |
+
?> </td></tr>
|
149 |
+
|
150 |
+
</table>
|
151 |
+
<?php weaverx_nonce_field('uploadtheme'); ?>
|
152 |
+
</form>
|
153 |
+
<?php
|
154 |
+
}
|
155 |
+
|
156 |
+
function weaverx_loadtheme() {
|
157 |
+
if (!(isset($_POST['uploadit']) && $_POST['uploadit'] == 'yes')) return;
|
158 |
+
|
159 |
+
// upload theme from users computer
|
160 |
+
// they've supplied and uploaded a file
|
161 |
+
|
162 |
+
$ok = true; // no errors so far
|
163 |
+
|
164 |
+
if (isset($_FILES['uploaded']['name']))
|
165 |
+
$filename = $_FILES['uploaded']['name'];
|
166 |
+
else
|
167 |
+
$filename = "";
|
168 |
+
|
169 |
+
if (isset($_FILES['uploaded']['tmp_name'])) {
|
170 |
+
$openname = $_FILES['uploaded']['tmp_name'];
|
171 |
+
} else {
|
172 |
+
$openname = "";
|
173 |
+
}
|
174 |
+
|
175 |
+
//Check the file extension
|
176 |
+
$check_file = strtolower($filename);
|
177 |
+
$pat = '.'; // PHP version strict checking bug...
|
178 |
+
$end = explode($pat, $check_file);
|
179 |
+
$ext_check = end($end);
|
180 |
+
|
181 |
+
|
182 |
+
if ($filename == "") {
|
183 |
+
$errors[] = __('You didn\'t select a file to upload.', 'weaver-xtreme' /*adm*/) . "<br />";
|
184 |
+
$ok = false;
|
185 |
+
}
|
186 |
+
|
187 |
+
if ($ok && $ext_check != 'wxt' && $ext_check != 'wxb'){
|
188 |
+
$errors[] = __('Theme files must have <em>.wxt</em> or <em>.wxb</em> extension.', 'weaver-xtreme' /*adm*/) . '<br />';
|
189 |
+
$ok = false;
|
190 |
+
}
|
191 |
+
|
192 |
+
if ($ok) {
|
193 |
+
if (!weaverx_f_exists($openname)) {
|
194 |
+
$errors[] = '<strong><em style="color:red;">' .
|
195 |
+
__('Sorry, there was a problem uploading your file.
|
196 |
+
You may need to check your folder permissions or other server settings.', 'weaver-xtreme' /*adm*/) .
|
197 |
+
'</em></strong><br />(' . __('Trying to use file', 'weaver-xtreme' /*adm*/) . ' <em>' . $openname . '</em>)';
|
198 |
+
$ok = false;
|
199 |
+
}
|
200 |
+
}
|
201 |
+
if (!$ok) {
|
202 |
+
echo '<div id="message" class="updated fade"><p><strong><em style="color:red;">' .
|
203 |
+
__('ERROR', 'weaver-xtreme' /*adm*/) . '</em></strong></p><p>';
|
204 |
+
foreach($errors as $error){
|
205 |
+
echo $error.'<br />';
|
206 |
+
}
|
207 |
+
echo '</p></div>';
|
208 |
+
} else { // OK - read file and save to My Saved Theme
|
209 |
+
// $handle has file handle to temp file.
|
210 |
+
$contents = weaverx_f_get_contents($openname);
|
211 |
+
|
212 |
+
if ( ! weaverx_ex_set_current_to_serialized_values($contents,'weaverx_uploadit:'.$openname ) ) {
|
213 |
+
echo '<div id="message" class="updated fade"><p><strong><em style="color:red;">' .
|
214 |
+
__('Sorry, there was a problem uploading your file.
|
215 |
+
The file you picked was not a valid Weaver Xtreme theme file.', 'weaver-xtreme' /*adm*/) .
|
216 |
+
'</em></strong></p></div>';
|
217 |
+
} else {
|
218 |
+
weaverx_save_msg( __('Weaver Xtreme theme options reset to uploaded theme.', 'weaver-xtreme' /*adm*/) );
|
219 |
+
}
|
220 |
+
}
|
221 |
+
}
|
222 |
+
|
223 |
+
function weaverx_ex_set_current_to_serialized_values($contents) {
|
224 |
+
global $weaverx_opts_cache; // need to mess with the cache
|
225 |
+
|
226 |
+
if (substr($contents,0,10) == 'WXT-V01.00')
|
227 |
+
$type = 'theme';
|
228 |
+
else if (substr($contents,0,10) == 'WXB-V01.00')
|
229 |
+
$type = 'backup';
|
230 |
+
else {
|
231 |
+
$val = substr($contents,0,10);
|
232 |
+
return weaverx_f_fail(__("Wrong theme file format version", 'weaver-xtreme' /*adm*/) . ':' . $val); /* simple check for one of ours */
|
233 |
+
}
|
234 |
+
$restore = array();
|
235 |
+
$restore = unserialize(substr($contents,10));
|
236 |
+
|
237 |
+
if (!$restore) return weaverx_f_fail(__("Unserialize failed", 'weaver-xtreme' /*adm*/));
|
238 |
+
|
239 |
+
$version = weaverx_getopt('weaverx_version_id'); // get something to force load
|
240 |
+
|
241 |
+
if ($type == 'theme') {
|
242 |
+
// need to clear some settings
|
243 |
+
// first, pickup the per-site settings that aren't theme related...
|
244 |
+
$new_cache = array();
|
245 |
+
foreach ($weaverx_opts_cache as $key => $val) {
|
246 |
+
if (isset($key[0]) && $key[0] == '_') // these are non-theme specific settings
|
247 |
+
$new_cache[$key] = $val; // keep
|
248 |
+
}
|
249 |
+
$opts = $restore['weaverx_base']; // fetch base opts
|
250 |
+
weaverx_delete_all_options();
|
251 |
+
|
252 |
+
foreach ($opts as $key => $val) {
|
253 |
+
if (isset($key[0]) && $key[0] != '_')
|
254 |
+
weaverx_setopt($key, $val, false); // overwrite with saved theme values
|
255 |
+
}
|
256 |
+
|
257 |
+
foreach ($new_cache as $key => $val) { // set the values we need to keep
|
258 |
+
weaverx_setopt($key,$val,false);
|
259 |
+
}
|
260 |
+
} else if ($type == 'backup') {
|
261 |
+
weaverx_delete_all_options();
|
262 |
+
|
263 |
+
$opts = $restore['weaverx_base']; // fetch base opts
|
264 |
+
foreach ($opts as $key => $val) {
|
265 |
+
weaverx_setopt($key, $val, false); // overwrite with saved values
|
266 |
+
}
|
267 |
+
}
|
268 |
+
weaverx_setopt('weaverx_version_id',$version); // keep version, force save of db
|
269 |
+
weaverx_setopt('wvrx_css_saved','');
|
270 |
+
weaverx_setopt('last_option','Weaver Xtreme');
|
271 |
+
weaverx_save_opts('loading theme'); // OK, now we've saved the options, update them in the DB
|
272 |
+
return true;
|
273 |
+
}
|
274 |
+
?>
|
admin/admin-subthemes.php
ADDED
@@ -0,0 +1,240 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
if ( !defined('ABSPATH')) exit; // Exit if accessed directly
|
3 |
+
/* Weaver Xtreme - admin Subtheme
|
4 |
+
*
|
5 |
+
* __ added - 12/10/14
|
6 |
+
* This is the intro form. It won't have any options because it will be outside the main form
|
7 |
+
*/
|
8 |
+
|
9 |
+
function weaverx_admin_subthemes() {
|
10 |
+
|
11 |
+
|
12 |
+
weaverx_tab_title(__('Predefined Weaver Xtreme Subthemes','weaver-xtreme'), 'help.html#PredefinedThemes', __('Help for Weaver Xtreme Predefined Themes', 'weaver-xtreme' /*adm*/)); ?>
|
13 |
+
<small style="font-weight:normal;font-size:10px;"><?php _e('You can click the ?\'s found throughout Weaver Xtreme admin pages for context specific help.', 'weaver-xtreme' /*adm*/);?></small>
|
14 |
+
|
15 |
+
<?php _e('<h3>Welcome to Weaver X</h3>', 'weaver-xtreme' /*adm*/);?>
|
16 |
+
|
17 |
+
<?php _e('<p>Weaver Xtreme gives you extreme control of your WordPress blog appearance using the
|
18 |
+
different admin tabs here. This tab lets you get a quick start by picking one of the many
|
19 |
+
predefined subthemes. Once you\'ve picked a starter theme, use the <em>Main Options</em> and <em>Advanced Options</em>
|
20 |
+
tabs to tweak the theme to be whatever you like. After you have a theme you\'re happy with,
|
21 |
+
you can save it from the Save/Restore tab. The <em>Help</em> tab has much more <b>useful</b> information.</p>', 'weaver-xtreme' /*adm*/);?>
|
22 |
+
|
23 |
+
|
24 |
+
<h3 class="atw-option-subheader"><span style="color:black;padding:.2em;" class="dashicons dashicons-images-alt2"></span>
|
25 |
+
<?php _e('Get started by trying one of the predefined subthemes!', 'weaver-xtreme' /*adm*/);?>
|
26 |
+
</h3>
|
27 |
+
<?php
|
28 |
+
$theme_dir = trailingslashit(WP_CONTENT_DIR) . 'themes/' . get_template() . '/subthemes/';
|
29 |
+
$theme_list = array();
|
30 |
+
if ( $media_dir = opendir($theme_dir) ) { // build the list of themes from directory
|
31 |
+
while ( $m_file = readdir($media_dir) ) {
|
32 |
+
$len = strlen($m_file);
|
33 |
+
$base = substr( $m_file, 0, $len-4 );
|
34 |
+
$ext = $len > 4 ? substr( $m_file, $len-4, 4 ) : '';
|
35 |
+
if ( $ext == '.wxt' || $ext == '.wxb' ) {
|
36 |
+
$theme_list[] = $base;
|
37 |
+
}
|
38 |
+
}
|
39 |
+
}
|
40 |
+
|
41 |
+
if (!empty($theme_list)) {
|
42 |
+
echo '<p style="font-size:120%;font-weight:bold;">';
|
43 |
+
_e( 'Please remember: these subthemes are only starting points!
|
44 |
+
You can use <em>Weaver Xtreme</em> options to change virtually any part of these subthemes.
|
45 |
+
You can change colors, sidebar layouts, font family and sizes, borders, spacing - really, everything.' ,'weaver-xtreme' /*adm*/);
|
46 |
+
echo '</p>';
|
47 |
+
weaverx_st_pick_theme($theme_list); // show the theme picker
|
48 |
+
} else {
|
49 |
+
_e("<h3>WARNING: Your version of Weaver Xtreme is likely installed incorrectly. Unable to find subtheme definitions.</h3>\n", 'weaver-xtreme' /*adm*/);
|
50 |
+
}
|
51 |
+
}
|
52 |
+
|
53 |
+
function weaverx_st_pick_theme($list_in) {
|
54 |
+
// output the form to select a file list from weaverx-subthemes directory
|
55 |
+
$list = $list_in;
|
56 |
+
natcasesort($list);
|
57 |
+
$cur_theme = weaverx_getopt('theme_filename');
|
58 |
+
if ( !$cur_theme ) $cur_theme = WEAVERX_DEFAULT_THEME; // the default theme
|
59 |
+
?>
|
60 |
+
<form enctype="multipart/form-data" name='pick_theme' method='post'>
|
61 |
+
<strong><?php _e('Click a Radio Button below to select a subtheme:', 'weaver-xtreme' /*adm*/);?> </strong>
|
62 |
+
<span style="padding-left:100px;"><?php _e('Current theme:', 'weaver-xtreme' /*adm*/);?> <strong>
|
63 |
+
<?php
|
64 |
+
$cur_addon = weaverx_getopt('addon_name');
|
65 |
+
if ($cur_addon == '') {
|
66 |
+
echo ucwords(str_replace('-',' ',$cur_theme));
|
67 |
+
} else {
|
68 |
+
echo __('Add-on Subtheme: ','weaver-xtreme') . ucwords(str_replace('-',' ',$cur_addon));
|
69 |
+
$cur_theme = '';
|
70 |
+
}
|
71 |
+
?>
|
72 |
+
</strong></span>
|
73 |
+
|
74 |
+
<br /><br /><span class='submit'><input name="set_subtheme" type="submit" value="<?php _e('Set to Selected Subtheme', 'weaver-xtreme' /*adm*/);?>" /></span>
|
75 |
+
<small style="color:#b00;"><br /><?php _e('<strong>Note:</strong> Selecting a <em>non-Demo</em> subtheme will change only theme related settings.
|
76 |
+
Options labelled with (♦) will be retained. You can use the Save/Restore tab to save a copy of all your current settings first.', 'weaver-xtreme' /*adm*/);?></small><br /><br />
|
77 |
+
<?php
|
78 |
+
weaverx_nonce_field('set_subtheme');
|
79 |
+
|
80 |
+
$thumbs = weaverx_relative_url('/subthemes/');
|
81 |
+
|
82 |
+
foreach ($list as $addon) {
|
83 |
+
$name = ucwords(str_replace('-',' ',$addon));
|
84 |
+
?>
|
85 |
+
<div style="float:left; width:200px;">
|
86 |
+
<label><input type="radio" name="theme_picked"
|
87 |
+
<?php echo 'value="' . $addon . '" ' . ($cur_theme == $addon ? 'checked' : '') .
|
88 |
+
'/> <strong>' . $name . '</strong><br />';
|
89 |
+
if (!weaverx_getopt('_hide_theme_thumbs')) {
|
90 |
+
echo '<img style="border: 1px solid gray; margin: 5px 0px 10px 0px;" src="' . esc_url($thumbs . $addon . '.jpg') . '" width="150px" height="113px" alt="thumb" /></label></div>' . "\n";
|
91 |
+
} else {
|
92 |
+
echo "</label></div>\n";
|
93 |
+
}
|
94 |
+
}
|
95 |
+
|
96 |
+
if (! weaverx_getopt_checked('_hide_theme_thumbs')) {
|
97 |
+
weaverx_clear_both();
|
98 |
+
?>
|
99 |
+
<span class='submit' style='padding-top:6px;'><input name="set_subtheme" type="submit" value="<?php _e('Set to Selected Subtheme', 'weaver-xtreme' /*adm*/);?>" /></span>
|
100 |
+
<?php
|
101 |
+
}
|
102 |
+
?>
|
103 |
+
|
104 |
+
</form>
|
105 |
+
<div style="clear:both;padding-top:6px;"></div>
|
106 |
+
|
107 |
+
<form enctype="multipart/form-data" name='hide_thumbs_form' method='post'>
|
108 |
+
<?php
|
109 |
+
$hide_msg = (weaverx_getopt('_hide_theme_thumbs')) ? __('Show Subtheme Thumbnails', 'weaver-xtreme' /*adm*/) :
|
110 |
+
__('Hide Subtheme Thumbnails', 'weaver-xtreme' /*adm*/);
|
111 |
+
?>
|
112 |
+
<input name="hide_thumbs" type="submit" value="<?php echo $hide_msg; ?>" />
|
113 |
+
<?php weaverx_nonce_field('hide_thumbs'); ?>
|
114 |
+
</form>
|
115 |
+
<div style="clear:both;"></div>
|
116 |
+
<hr />
|
117 |
+
<?php
|
118 |
+
do_action('weaverx_child_show_extrathemes');
|
119 |
+
do_action('weaverxplus_admin','show_subthemes');
|
120 |
+
}
|
121 |
+
|
122 |
+
function weaverx_process_options_themes() {
|
123 |
+
|
124 |
+
if (weaverx_submitted('set_subtheme')) { // invoked from Weaver Xtreme Subthemes tab (this file)
|
125 |
+
if (isset($_POST['theme_picked'])) {
|
126 |
+
$theme = weaverx_filter_textarea($_POST['theme_picked']);
|
127 |
+
|
128 |
+
if (weaverx_activate_subtheme($theme))
|
129 |
+
weaverx_save_msg(__("Subtheme Selected: ", 'weaver-xtreme' /*adm*/) . $theme );
|
130 |
+
else
|
131 |
+
weaverx_save_msg(__("Invalid Subtheme file detected. Your installation of Weaver Xtreme may be broken.", 'weaver-xtreme' /*adm*/));
|
132 |
+
} else {
|
133 |
+
weaverx_save_msg(__("Please select a subtheme.", 'weaver-xtreme' /*adm*/));
|
134 |
+
}
|
135 |
+
return true;
|
136 |
+
}
|
137 |
+
|
138 |
+
if (weaverx_submitted('save_mytheme')) { // invoked from Save/Restore tab
|
139 |
+
weaverx_save_msg(__("Current settings saved in WordPress database.", 'weaver-xtreme' /*adm*/));
|
140 |
+
global $weaverx_opts_cache;
|
141 |
+
if (!$weaverx_opts_cache)
|
142 |
+
$weaverx_opts_cache = get_option( apply_filters('weaverx_options','weaverx_settings') ,array());
|
143 |
+
if (current_user_can( 'manage_options' )) {
|
144 |
+
$compressed = array_filter( $weaverx_opts_cache, 'strlen'); // filter out all null options (strlen == 0)
|
145 |
+
update_option(apply_filters('weaverx_options','weaverx_settings_backup'),$compressed);
|
146 |
+
if ( apply_filters('weaverx_xtra_type', '+backup' ) != 'inactive')
|
147 |
+
delete_option('weaverx_plus_backup');
|
148 |
+
}
|
149 |
+
return true;
|
150 |
+
}
|
151 |
+
|
152 |
+
if (weaverx_submitted('restore_mytheme')) { // invoked from Save/Restore tab
|
153 |
+
global $weaverx_opts_cache;
|
154 |
+
$saved = get_option( apply_filters('weaverx_options','weaverx_settings_backup') ,array());
|
155 |
+
if (!empty($saved)) {
|
156 |
+
$weaverx_opts_cache = $saved;
|
157 |
+
weaverx_wpupdate_option('weaverx_settings',$weaverx_opts_cache);
|
158 |
+
}
|
159 |
+
weaverx_save_msg(__("Current settings restored from WordPress database.", 'weaver-xtreme' /*adm*/));
|
160 |
+
return true;
|
161 |
+
}
|
162 |
+
|
163 |
+
if (weaverx_submitted('hide_thumbs')) {
|
164 |
+
$hide = weaverx_getopt('_hide_theme_thumbs');
|
165 |
+
weaverx_setopt('_hide_theme_thumbs', !$hide);
|
166 |
+
return true;
|
167 |
+
}
|
168 |
+
return false;
|
169 |
+
}
|
170 |
+
|
171 |
+
function weaverx_activate_subtheme($theme) {
|
172 |
+
/* load settings for specified theme */
|
173 |
+
global $weaverx_opts_cache;
|
174 |
+
|
175 |
+
/* build the filename - theme files stored in /wp-content/themes/weaver-xtreme/subthemes/
|
176 |
+
|
177 |
+
Important: the following code assumes that any of the pre-defined theme files won't have
|
178 |
+
and end-of-line character in them, which should be true. A user could muck about with the
|
179 |
+
files, and possibly break this assumption. This assumption is necessary because the WP
|
180 |
+
theme rules allow 'file', but not 'file get contents'. Other than that, the following code
|
181 |
+
is really the same as the 'theme' section of weaverx_upload_theme() in the pro library
|
182 |
+
*/
|
183 |
+
|
184 |
+
$ext = '.wxt';
|
185 |
+
|
186 |
+
$filename = get_template_directory() . '/subthemes/' . $theme . $ext;
|
187 |
+
|
188 |
+
if ( ! weaverx_f_exists( $filename ) ) {
|
189 |
+
$filename = str_replace('.wxt', '.wxb', $filename);
|
190 |
+
if ( ! weaverx_f_exists( $filename ) )
|
191 |
+
return false;
|
192 |
+
else
|
193 |
+
$ext = '.wxb';
|
194 |
+
}
|
195 |
+
|
196 |
+
$contents = weaverx_f_get_contents($filename); // use either real (pro) or file (standard) version of function
|
197 |
+
|
198 |
+
if (empty($contents)) return false;
|
199 |
+
|
200 |
+
if ( substr($contents,0,10) != 'WXT-V01.00' ) {
|
201 |
+
if ($ext == '.wxb' && substr($contents,0,10) != 'WXB-V01.00' )
|
202 |
+
return false;
|
203 |
+
}
|
204 |
+
|
205 |
+
$restore = array();
|
206 |
+
$restore = unserialize(substr($contents,10));
|
207 |
+
|
208 |
+
if (!$restore) return false;
|
209 |
+
$version = weaverx_getopt('weaverx_version_id'); // get something to force load
|
210 |
+
|
211 |
+
// need to clear some settings
|
212 |
+
// first, pickup the per-site settings that aren't theme related...
|
213 |
+
$new_cache = array();
|
214 |
+
if ( $ext == '.wxt' ) {
|
215 |
+
foreach ($weaverx_opts_cache as $key => $val) {
|
216 |
+
if ($key[0] == '_') { // these are non-theme specific settings
|
217 |
+
$new_cache[$key] = $weaverx_opts_cache[$key]; // clear
|
218 |
+
}
|
219 |
+
}
|
220 |
+
}
|
221 |
+
|
222 |
+
$opts = $restore['weaverx_base']; // fetch base opts
|
223 |
+
weaverx_delete_all_options();
|
224 |
+
|
225 |
+
foreach ($new_cache as $key => $val) { // set the values we need to keep
|
226 |
+
weaverx_setopt($key,$new_cache[$key],false);
|
227 |
+
}
|
228 |
+
foreach ($opts as $key => $val) {
|
229 |
+
if ($key[0] == '_' && $ext != '.wxb' )
|
230 |
+
continue; // should be here
|
231 |
+
weaverx_setopt($key, $val, false); // overwrite with saved theme values
|
232 |
+
}
|
233 |
+
|
234 |
+
weaverx_setopt('theme_filename',$theme);
|
235 |
+
weaverx_setopt('last_option','Weaver Xtreme');
|
236 |
+
|
237 |
+
weaverx_save_opts('set subtheme'); // OK, now we've saved the options, update them in the DB
|
238 |
+
return true;
|
239 |
+
}
|
240 |
+
?>
|
admin/admin-top.php
ADDED
@@ -0,0 +1,227 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
if ( !defined('ABSPATH')) exit; // Exit if accessed directly
|
3 |
+
/*
|
4 |
+
Weaver Xtreme Admin - Uses yetii JavaScript to build tabs.
|
5 |
+
Tabs include:
|
6 |
+
Weaver Xtreme Themes (in atw-subthemes.php)
|
7 |
+
Main Options (in this file)
|
8 |
+
Advanced Options (in wvr_advancedopts.php)
|
9 |
+
Save/Restore Themes (in atw-subthemes.php)
|
10 |
+
Snippets (in atw-help.php)
|
11 |
+
CSS Help ditto
|
12 |
+
Help ditto
|
13 |
+
|
14 |
+
* __ added - 12/10/14
|
15 |
+
/*
|
16 |
+
========================= Weaver Xtreme Admin Tab - Main Options ==============
|
17 |
+
*/
|
18 |
+
function weaverx_do_admin() {
|
19 |
+
/* theme admin page */
|
20 |
+
|
21 |
+
/* This generates the startup script calls, etc, for the admin page */
|
22 |
+
global $weaverx_opts_cache, $weaverx_main_options, $weaverx_main_opts_list;
|
23 |
+
|
24 |
+
if (!current_user_can('edit_theme_options'))
|
25 |
+
wp_die(__('No permission to access that page.', 'weaver-xtreme' /*adm*/));
|
26 |
+
|
27 |
+
weaverx_admin_page_process_options(); // Process non-sapi options
|
28 |
+
|
29 |
+
echo('<div class="wrap">');
|
30 |
+
?>
|
31 |
+
<div style="float:left;"><h2><?php echo WEAVERX_THEMEVERSION; ?> Options
|
32 |
+
<?php if (function_exists('weaverxplus_plugin_installed')) {
|
33 |
+
echo '<span style="font-size:smaller;"> - ' . __('Plus', 'weaver-xtreme' /*adm*/) .
|
34 |
+
'</span><span style="font-size:small;"> ('; echo WEAVER_XPLUS_VERSION; echo ')</span>';
|
35 |
+
}?>
|
36 |
+
|
37 |
+
<?php if (is_child_theme()) echo " — " . wp_get_theme(); ?>
|
38 |
+
|
39 |
+
|
40 |
+
</h2>
|
41 |
+
<a name="top_main" id="top_main"></a></div>
|
42 |
+
<?php weaverx_donate_button();
|
43 |
+
//weaverx_check_theme();
|
44 |
+
weaverx_clear_messages();
|
45 |
+
|
46 |
+
weaverx_check_version(); // check version RSS
|
47 |
+
|
48 |
+
weaverx_clear_both();
|
49 |
+
?>
|
50 |
+
|
51 |
+
<div id="tabwrap">
|
52 |
+
<div id="taba-admin" class='yetii'>
|
53 |
+
<ul id="taba-admin-nav" class='yetii'>
|
54 |
+
<?php
|
55 |
+
weaverx_elink( '#tab_themes', __('Select from pre-defined subthemes', 'weaver-xtreme' /*adm*/), __('Weaver Xtreme Subthemes', 'weaver-xtreme' /*adm*/), $before='<li>', $after='</li>');
|
56 |
+
weaverx_elink( '#tab_main', __('Main options for most theme elements: site appearance, layout, header, menus, content, footer, fonts, more', 'weaver-xtreme' /*adm*/), __('Main Options', 'weaver-xtreme' /*adm*/), $before='<li>', $after='</li>');
|
57 |
+
weaverx_elink( '#tab_advanced', __('Advanced options: HTML, code, CSS insertion; page templates, background images, SEO, site options', 'weaver-xtreme' /*adm*/), __('Advanced Options', 'weaver-xtreme' /*adm*/), $before='<li>', $after='</li>');
|
58 |
+
weaverx_elink( '#tab_pro', __('Weaver Xtreme Theme Add-ons', 'weaver-xtreme' /*adm*/), __('Add-ons', 'weaver-xtreme' /*adm*/), $before='<li>', $after='</li>');
|
59 |
+
weaverx_elink( '#tab_saverestore', __('Save and Restore theme settings', 'weaver-xtreme' /*adm*/), __('Save/Restore', 'weaver-xtreme' /*adm*/), $before='<li>', $after='</li>');
|
60 |
+
weaverx_elink( '#tab_help', __('Table of Content links to Weaver Xtreme Help files', 'weaver-xtreme' /*adm*/), __('Help', 'weaver-xtreme' /*adm*/), $before='<li>', $after='</li>');
|
61 |
+
?>
|
62 |
+
</ul>
|
63 |
+
|
64 |
+
<?php // list is order specific - above and below must match ?>
|
65 |
+
|
66 |
+
<div id="tab_themes" class="tab" >
|
67 |
+
<?php weaverx_admin_subthemes(); ?>
|
68 |
+
</div>
|
69 |
+
<?php
|
70 |
+
// ====================== Begin the big form here =====================
|
71 |
+
weaverx_sapi_form_top('weaverx_settings_group','weaverx_options_form');
|
72 |
+
?>
|
73 |
+
<div id="tab_main" class="tab" >
|
74 |
+
<?php weaverx_admin_mainopts(); ?>
|
75 |
+
</div>
|
76 |
+
|
77 |
+
<div id="tab_advanced" class="tab" >
|
78 |
+
<?php weaverx_admin_advancedopts(); ?>
|
79 |
+
</div>
|
80 |
+
|
81 |
+
|
82 |
+
<?php
|
83 |
+
weaverx_sapi_form_bottom(); // end of SAPI opts here. Can't cross <div>s! Non-sapi forms follow
|
84 |
+
// ===================== end of big form =====================
|
85 |
+
?>
|
86 |
+
|
87 |
+
<div id="tab_pro" class="tab" >
|
88 |
+
<?php weaverx_admin_pro(); ?>
|
89 |
+
</div>
|
90 |
+
|
91 |
+
|
92 |
+
<div id="tab_saverestore" class="tab" >
|
93 |
+
<?php weaverx_admin_saverestore(); ?>
|
94 |
+
</div>
|
95 |
+
<div id="tab_help" class="tab" >
|
96 |
+
<?php weaverx_admin_help(); ?>
|
97 |
+
</div>
|
98 |
+
</div> <!-- #tab-saverestore -->
|
99 |
+
</div> <!-- #tabwrap -->
|
100 |
+
|
101 |
+
<?php weaverx_end_of_section('Options'); ?>
|
102 |
+
|
103 |
+
<script type="text/javascript">
|
104 |
+
var tabberAdmin = new Yetii({
|
105 |
+
id: 'taba-admin',
|
106 |
+
tabclass: 'tab',
|
107 |
+
persist: true
|
108 |
+
});
|
109 |
+
</script>
|
110 |
+
|
111 |
+
<?php
|
112 |
+
} /* end weaverx_do_admin */
|
113 |
+
|
114 |
+
/*
|
115 |
+
================= process settings when enter admin pages ================
|
116 |
+
*/
|
117 |
+
function weaverx_admin_page_process_options() {
|
118 |
+
/* Process all options - called upon entry to options forms */
|
119 |
+
|
120 |
+
// Most options are handled by the SAPI filter.
|
121 |
+
|
122 |
+
settings_errors('weaverx_settings'); // display results from SAPI save settings
|
123 |
+
|
124 |
+
$processed = weaverx_process_options_themes(); // >>>> Weaver Xtreme Themes Tab
|
125 |
+
|
126 |
+
do_action('weaverx_child_process_options'); // let the child theme do something
|
127 |
+
do_action('weaverxplus_admin','process_options');
|
128 |
+
do_action('weaverx_process_license_options');
|
129 |
+
|
130 |
+
$processed = weaverx_process_options_admin_standard( $processed ); // setting from admin page
|
131 |
+
|
132 |
+
/* this tab has the most individual forms and submit commands */
|
133 |
+
|
134 |
+
/* ====================================================== */
|
135 |
+
|
136 |
+
if ( !$processed && isset($_GET['settings-updated']) && $_GET['settings-updated'] == 'true' ) {
|
137 |
+
add_settings_error('weaverx_settings', 'settings_updated', __('Saved', 'weaver-xtreme' /*adm*/), 'updated');
|
138 |
+
$vers = weaverx_getopt('style_version');
|
139 |
+
weaverx_setopt('style_version', $vers + 1 );
|
140 |
+
}
|
141 |
+
|
142 |
+
weaverx_save_opts('Weaver Xtreme Admin'); /* FINALLY - SAVE ALL OPTIONS AND UPDATE CURRENT CSS FILE */
|
143 |
+
|
144 |
+
}
|
145 |
+
|
146 |
+
function weaverx_admin_admin() {
|
147 |
+
?>
|
148 |
+
<div class="atw-option-header"><span style="color:black; padding:.2em;" class="dashicons dashicons-admin-generic"></span>
|
149 |
+
<?php _e('Basic Administrative Options', 'weaver-xtreme' /*adm*/); ?>
|
150 |
+
<?php weaverx_help_link('help.html#AdminOptions','Help for Admin Options'); ?></div>
|
151 |
+
|
152 |
+
<p>
|
153 |
+
<?php _e('These options control some administrative options and appearance features.', 'weaver-xtreme' /*adm*/); ?>
|
154 |
+
</p>
|
155 |
+
|
156 |
+
<br />
|
157 |
+
|
158 |
+
<label><input type="checkbox" name="<?php weaverx_sapi_main_name('_hide_donate'); ?>" id="hide_donate" <?php checked(weaverx_getopt_checked( '_hide_donate' )); ?> />
|
159 |
+
<?php _e('I\'ve Donated - <small>Thank you for donating to the Weaver Xtreme theme.
|
160 |
+
This will hide the Donate button. Purchasing Weaver Xtreme Plus also hides the Donate button.</small> ♦', 'weaver-xtreme' /*adm*/); ?>
|
161 |
+
</label><br /><br />
|
162 |
+
|
163 |
+
<label><input type="checkbox" name="<?php weaverx_sapi_main_name('_hide_editor_style'); ?>" id="_hide_editor_style" <?php checked(weaverx_getopt_checked( '_hide_editor_style' )); ?> />
|
164 |
+
<?php _e('Disable Page/Post Editor Styling - <small>Checking this box will disable the Weaver Xtreme subtheme based styling in the Page/Post editor.
|
165 |
+
If you have a theme using transparent backgrounds, this option will likely improve the Post/Page editor visibility. ♦</small>', 'weaver-xtreme' /*adm*/); ?></label><br />
|
166 |
+
|
167 |
+
<label><input type="checkbox" name="<?php weaverx_sapi_main_name('_hide_auto_css_rules'); ?>" id="hide_auto_css_rules" <?php checked(weaverx_getopt_checked( '_hide_auto_css_rules' )); ?> />
|
168 |
+
<?php _e('Don\'t auto-display CSS rules - <small>Checking this box will disable the auto-display of Main Option elements that have CSS settings.</small> ♦', 'weaver-xtreme' /*adm*/); ?></label><br />
|
169 |
+
|
170 |
+
<input name="<?php weaverx_sapi_main_name('_css_rows'); ?>" id="css_rows" type="text" style="width:30px;height:20px;" class="regular-text" value="<?php weaverx_esc_textarea(weaverx_getopt('_css_rows')); ?>" />
|
171 |
+
<?php _e('lines - Set CSS+ text box height - <small>You can increase the default height of the CSS+ input area (1 to 25 lines).</small> ♦', 'weaver-xtreme' /*adm*/); ?>
|
172 |
+
<br />
|
173 |
+
<br />
|
174 |
+
<h3 class="atw-option-subheader"><?php _e('Per Page and Per Post Option Panels by Roles<', 'weaver-xtreme' /*adm*/); ?>/h3>
|
175 |
+
<p>
|
176 |
+
<?php _e('Single site Administrator and Multi-Site Super Administrator will always have the Per Page and Per Post options panel displayed.
|
177 |
+
You may selectively disable these options for other User Roles using the check boxes below.', 'weaver-xtreme' /*adm*/); ?>
|
178 |
+
</p>
|
179 |
+
|
180 |
+
|
181 |
+
<label><input type="checkbox" name="<?php weaverx_sapi_main_name('_hide_mu_admin_per'); ?>" id="_hide_mu_admin_per" <?php checked(weaverx_getopt_checked( '_hide_mu_admin_per' )); ?> />
|
182 |
+
<?php _e('Hide Per Page/Post Options for MultiSite Admins', 'weaver-xtreme' /*adm*/); ?></label> ♦<br />
|
183 |
+
<label><input type="checkbox" name="<?php weaverx_sapi_main_name('_hide_editor_per'); ?>" id="_hide_editor_per" <?php checked(weaverx_getopt_checked( '_hide_editor_per' )); ?> />
|
184 |
+
<?php _e('Hide Per Page/Post Options for Editors', 'weaver-xtreme' /*adm*/); ?></label> ♦<br />
|
185 |
+
<label><input type="checkbox" name="<?php weaverx_sapi_main_name('_hide_author_per'); ?>" id="_hide_author_per" <?php checked(weaverx_getopt_checked( '_hide_author_per' )); ?> />
|
186 |
+
<?php _e('Hide Per Page/Post Options for Authors and Contributors', 'weaver-xtreme' /*adm*/); ?></label> ♦<br />
|
187 |
+
<br />
|
188 |
+
<label><input type="checkbox" name="<?php weaverx_sapi_main_name('_show_per_post_all'); ?>" id="_hide_author_per" <?php checked(weaverx_getopt_checked( '_show_per_post_all' )); ?> />
|
189 |
+
<?php _e('Show Per Post Options for Custom Post Types ♦ - <small>Shows the Per Post options box on "Custom Post Type Editor" admin pages', 'weaver-xtreme' /*adm*/); ?></small>
|
190 |
+
</label>
|
191 |
+
<br />
|
192 |
+
<br /><br />
|
193 |
+
<div class="atw-option-subheader"><?php _e('Theme Name and Description', 'weaver-xtreme' /*adm*/); ?></div>
|
194 |
+
<p>
|
195 |
+
<?php _e('You can change the name and description of your current settings if you would like to create a new theme
|
196 |
+
theme file for sharing with others, or for you own identification.', 'weaver-xtreme' /*adm*/); ?>
|
197 |
+
</p>
|
198 |
+
<?php _e('Theme Name:', 'weaver-xtreme' /*adm*/); ?> <input name="<?php weaverx_sapi_main_name('themename'); ?>" id="themename" value="<?php echo weaverx_getopt('themename'); ?>" />
|
199 |
+
<br />
|
200 |
+
<?php _e('Description:', 'weaver-xtreme' /*adm*/); ?>
|
201 |
+
<?php weaverx_textarea(weaverx_getopt('theme_description'), 'theme_description', 2, __('Describe the theme','weaver-xtreme' /*adm*/),'width:65%;'); ?>
|
202 |
+
<br />
|
203 |
+
<br />
|
204 |
+
<h3 class="atw-option-subheader"><?php _e('Subtheme Notes', 'weaver-xtreme' /*adm*/); ?></h3>
|
205 |
+
<p>
|
206 |
+
<?php _e('This box may be used to keep notes and instructions about settings made for a custom subtheme.
|
207 |
+
It will be saved in the both \'.wxt\' and \'.wxb\' settings files.', 'weaver-xtreme' /*adm*/); ?>
|
208 |
+
</p>
|
209 |
+
<?php
|
210 |
+
weaverx_textarea(weaverx_getopt('subtheme_notes'), 'subtheme_notes', 2, __('Notes about theme','weaver-xtreme' /*adm*/), 'width:75%;');
|
211 |
+
|
212 |
+
do_action('weaverxplus_admin','admin_options');
|
213 |
+
|
214 |
+
}
|
215 |
+
/* ^^^^^ end weaverx_admin_page_process_options ^^^^^^ */
|
216 |
+
|
217 |
+
// ===================================== include other stuff ==========================
|
218 |
+
|
219 |
+
require_once( dirname( __FILE__ ) . '/lib-admin.php' );
|
220 |
+
|
221 |
+
require_once( dirname( __FILE__ ) . '/admin-subthemes.php' );
|
222 |
+
require_once( dirname( __FILE__ ) . '/admin-mainopts.php' );
|
223 |
+
require_once( dirname( __FILE__ ) . '/admin-advancedopts.php' );
|
224 |
+
require_once( dirname( __FILE__ ) . '/admin-plus.php' );
|
225 |
+
require_once( dirname( __FILE__ ) . '/admin-saverestore.php' );
|
226 |
+
require_once( dirname( __FILE__ ) . '/admin-help.php' );
|
227 |
+
?>
|
admin/assets/css/admin-style-rtl.css
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/* Weaver Xtreme admin style */
|
2 |
+
.rtl-break {
|
3 |
+
display:block;
|
4 |
+
padding:0;margin:0;
|
5 |
+
line-height:.5;
|
6 |
+
}
|
admin/assets/css/admin-style-rtl.min.css
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
.rtl-break{display:block;padding:0;margin:0;line-height:.5;}
|
admin/assets/css/admin-style.css
ADDED
@@ -0,0 +1,276 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/* Weaver Xtreme admin style */
|
2 |
+
.hide_me {display:none;}
|
3 |
+
|
4 |
+
.wvr-green {font-weight:bold;color:green;}
|
5 |
+
.wvr-yellow {font-weight:bold;color:orange;}
|
6 |
+
.wvr-red {font-weight:bold;color:red;}
|
7 |
+
.wvr-blue {font-weight:bold;color:blue;}
|
8 |
+
.a-plus {
|
9 |
+
background-color:#F5FBEF;border: 1px solid #ccc;padding-left:20px;padding-right:20px;margin-left:20px;margin-right:20%;
|
10 |
+
}
|
11 |
+
|
12 |
+
.i-left {float:left;font-size:14px;}
|
13 |
+
.i-left-bg {float:left;font-size:16px;color:#70FF29;}
|
14 |
+
.i-left-fg {float:left;font-size:16px;color:#290BBD;}
|
15 |
+
|
16 |
+
a.anchorx {display: block; position: relative; top: -40px; visibility: hidden;} /* This makes the anchor above the content, so the title shows */
|
17 |
+
|
18 |
+
.options-intro {text-align:center;margin:-10px auto -5px auto;font-size:90%;background-color:ivory;padding:4px 10px 4px 10px;border:1px solid green;max-width:90%;}
|
19 |
+
.options-intro a{font-weight: bold;text-decoration:none;color:blue;}
|
20 |
+
.options-intro-menu {text-align:center;}
|
21 |
+
|
22 |
+
#wpcontent {background-color:#FFFFF8;color:black;}
|
23 |
+
|
24 |
+
input.color {border:1px solid #2BFF1C;}
|
25 |
+
|
26 |
+
select { font-size:12px;}
|
27 |
+
|
28 |
+
.font-bold {
|
29 |
+
font-weight:bold;
|
30 |
+
}
|
31 |
+
.font-bold-title {
|
32 |
+
font-weight:900;
|
33 |
+
}
|
34 |
+
|
35 |
+
.font-italic a,
|
36 |
+
.font-italic {
|
37 |
+
font-style: italic !important;
|
38 |
+
}
|
39 |
+
/* =sans-serif -------------------------------------------------- */
|
40 |
+
|
41 |
+
.font-sans-serif {
|
42 |
+
font-family: sans-serif;
|
43 |
+
}
|
44 |
+
|
45 |
+
.font-arial {
|
46 |
+
font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
|
47 |
+
}
|
48 |
+
|
49 |
+
.font-arialNarrow {
|
50 |
+
font-family: "Arial Narrow", Arial, sans-serif;
|
51 |
+
}
|
52 |
+
|
53 |
+
.font-impact {
|
54 |
+
font-family:Impact, Haettenschweiler, Charcoal, "Arial Narrow Bold", sans-serif;
|
55 |
+
}
|
56 |
+
|
57 |
+
.font-lucidaSans {
|
58 |
+
font-family: "Lucida Sans", Geneva, Tahoma, sans-serif;
|
59 |
+
}
|
60 |
+
|
61 |
+
.font-trebuchetMS {
|
62 |
+
font-family: "Trebuchet MS", "Lucida Grande", "Lucida Sans Unicode", "Lucida Sans", Tahoma, sans-serif;
|
63 |
+
}
|
64 |
+
|
65 |
+
.font-verdana {
|
66 |
+
font-family: Verdana, Geneva, Candara, sans-serif;
|
67 |
+
}
|
68 |
+
|
69 |
+
/* =serif ------------------------------------------------------ */
|
70 |
+
|
71 |
+
.font-serif {
|
72 |
+
font-family: TimesNewRoman, "Times New Roman", Times, Baskerville, Georgia, serif;
|
73 |
+
}
|
74 |
+
|
75 |
+
.font-garamond {
|
76 |
+
font-family: Garamond, Baskerville, "Baskerville Old Face", "Hoefler Text", "Times New Roman", serif;
|
77 |
+
}
|
78 |
+
|
79 |
+
.font-georgia {
|
80 |
+
font-family: Georgia, Times, "Times New Roman", serif;
|
81 |
+
}
|
82 |
+
|
83 |
+
.font-lucidaBright {
|
84 |
+
font-family: "Lucida Bright", "Book Antiqua", Georgia, serif;
|
85 |
+
}
|
86 |
+
|
87 |
+
.font-palatino {
|
88 |
+
font-family: "Palatino Linotype", Palatino, "Lucida Bright", "Book Antiqua", serif;
|
89 |
+
}
|
90 |
+
|
91 |
+
.font-timesNewRoman {
|
92 |
+
font-family: TimesNewRoman, "Times New Roman", Times, Baskerville, Georgia, serif;
|
93 |
+
}
|
94 |
+
|
95 |
+
/* =sans-monospace -------------------------------------------------- */
|
96 |
+
|
97 |
+
.font-monospace {
|
98 |
+
font-family: monospace;
|
99 |
+
}
|
100 |
+
|
101 |
+
.font-consolas {
|
102 |
+
font-family: Consolas, monaco,"Andale Mono", AndaleMono, monospace;
|
103 |
+
}
|
104 |
+
.font-courier {
|
105 |
+
font-family: "Courier New", Courier, "Lucida Sans Typewriter", "Lucida Typewriter", monospace;
|
106 |
+
}
|
107 |
+
|
108 |
+
.font-lucidaConsole {
|
109 |
+
font-family: "Lucida Console", "Lucida Sans Typewriter", Monaco, "Bitstream Vera Sans Mono", monospace;
|
110 |
+
}
|
111 |
+
|
112 |
+
.font-papyrus {
|
113 |
+
font-family: Papyrus, fantasy, cursive, serif;
|
114 |
+
}
|
115 |
+
|
116 |
+
.font-comicSans {
|
117 |
+
font-family: "Comic Sans MS", cursive,serif;
|
118 |
+
}
|
119 |
+
|
120 |
+
|
121 |
+
|
122 |
+
p {margin-right:5%;}
|
123 |
+
.submit input {background: #f8f8f8;
|
124 |
+
background-image: linear-gradient(#A8DDFF,#88B3CF);
|
125 |
+
border-radius: 4px;
|
126 |
+
}
|
127 |
+
|
128 |
+
|
129 |
+
.atw-help ul {list-style: disc; margin-left:30px;}
|
130 |
+
.atw-option-section {font-weight:bold;font-size:120%;color:blue;}
|
131 |
+
|
132 |
+
.tab ul {
|
133 |
+
margin-left: 1.15em;
|
134 |
+
list-style: disc outside none;
|
135 |
+
}
|
136 |
+
.tab ol {
|
137 |
+
list-style-position:outside;
|
138 |
+
margin-left: 1.4em;
|
139 |
+
margin-bottom:.6em;
|
140 |
+
}
|
141 |
+
|
142 |
+
.js_button {background:#eee !important;font-weight: 600 !important;color:#585858 !important;}
|
143 |
+
|
144 |
+
div.yetii {
|
145 |
+
width: 95%;
|
146 |
+
margin: 0 0 20px 0;
|
147 |
+
}
|
148 |
+
|
149 |
+
ul.yetii {
|
150 |
+
list-style-type: none;
|
151 |
+
width: 100%;
|
152 |
+
float: left;
|
153 |
+
border-bottom: 4px ridge #ddd;
|
154 |
+
margin-bottom: 8px;
|
155 |
+
}
|
156 |
+
|
157 |
+
ul.yetii li {
|
158 |
+
margin: 0 2px 0 0;
|
159 |
+
float: left;
|
160 |
+
}
|
161 |
+
|
162 |
+
ul.yetii a {
|
163 |
+
float: left;
|
164 |
+
display: block;
|
165 |
+
padding: 4px 8px;
|
166 |
+
border: 1px solid #ddd;
|
167 |
+
border-bottom: 0;
|
168 |
+
color: #666;
|
169 |
+
background: #eee;
|
170 |
+
text-decoration: none;
|
171 |
+
font-weight: bold;
|
172 |
+
background-image: linear-gradient(#f0f0f0,#c8c8c8);
|
173 |
+
border-top-left-radius:6px;
|
174 |
+
border-top-right-radius:6px;
|
175 |
+
}
|
176 |
+
|
177 |
+
ul.yetii a:hover {
|
178 |
+
background: #fff;
|
179 |
+
}
|
180 |
+
|
181 |
+
ul.yetii a.active {
|
182 |
+
background: #fff;
|
183 |
+
color: #00f;
|
184 |
+
background-image: linear-gradient(#f8f8f8,#eee);
|
185 |
+
}
|
186 |
+
/* -- */
|
187 |
+
div.yetiisub {
|
188 |
+
width: 100%;
|
189 |
+
margin: 0 0 20px 0;
|
190 |
+
}
|
191 |
+
|
192 |
+
ul.yetiisub {
|
193 |
+
list-style-type: none;
|
194 |
+
width: 100%;
|
195 |
+
float: left;
|
196 |
+
margin-bottom: 8px;
|
197 |
+
}
|
198 |
+
|
199 |
+
ul.yetiisub li {
|
200 |
+
margin: 0 2px 2px 0px;
|
201 |
+
float: left;
|
202 |
+
}
|
203 |
+
|
204 |
+
ul.yetiisub a {
|
205 |
+
float: left;
|
206 |
+
padding: 4px 8px;
|
207 |
+
border: 1px solid #ccc;
|
208 |
+
color: #666;
|
209 |
+
background: #f0f0f0;
|
210 |
+
text-decoration: none;
|
211 |
+
font-style: italic;
|
212 |
+
font-weight: bold;
|
213 |
+
background-image: linear-gradient(#f8f8f8,#c8c8c8);
|
214 |
+
border-top-left-radius:6px;
|
215 |
+
border-top-right-radius:6px;
|
216 |
+
}
|
217 |
+
|
218 |
+
ul.yetiisub a:hover {
|
219 |
+
background: #fefefe !important;
|
220 |
+
}
|
221 |
+
|
222 |
+
ul.yetiisub a.active {
|
223 |
+
background: #fff;
|
224 |
+
color: #00f;
|
225 |
+
background-image: linear-gradient(#fff,#e8e8e8);
|
226 |
+
}
|
227 |
+
|
228 |
+
.atw-small-submit {
|
229 |
+
padding: 1.0em 0;
|
230 |
+
margin: 1px 0;
|
231 |
+
font-size:90%;
|
232 |
+
}
|
233 |
+
|
234 |
+
.atw-option-header {background:#D0D0D8;line-height:1.8em;width:95%;color:blue;font-size:large;font-weight:bold;padding-left:12px;
|
235 |
+
border-radius: 6px;
|
236 |
+
box-shadow: 3px 3px 10px #aaa;
|
237 |
+
background-image: linear-gradient(#eee,#ccc);
|
238 |
+
}
|
239 |
+
.atw-option-subheader {background:#EAEAEA;line-height:1.8em;width:95%;color:blue;font-size:larger;font-weight:bold;padding-left:18px;
|
240 |
+
border-radius: 6px;
|
241 |
+
box-shadow: 3px 3px 10px #ccc;
|
242 |
+
background-image: linear-gradient(#fff,#ddd);
|
243 |
+
}
|
244 |
+
|
245 |
+
.atw-row-header {background:#D0D0D8;line-height:1.8em;padding-left:4px;
|
246 |
+
background-image: linear-gradient(#eee,#ccc);
|
247 |
+
}
|
248 |
+
.atw-row-subheader {background:#EAEAEA;padding-left:4px;
|
249 |
+
background: linear-gradient(#f8f8f8,#ddd);
|
250 |
+
}
|
251 |
+
.atw-row-subheader-alt {background:#F4F4F4;padding-left:4px;
|
252 |
+
background-image: linear-gradient(#f8f8f8,#dadada);
|
253 |
+
}
|
254 |
+
.atw-row-subheader-area {
|
255 |
+
background:#e8ffee;
|
256 |
+
background: linear-gradient(#e8ffee,#95e8b7);
|
257 |
+
}
|
258 |
+
/* layouts for layout boxes */
|
259 |
+
.l_layout {display:block; width:140px; height:110px; float:left; margin-right:10px; margin-bottom:10px; display:inline;border:1px solid #888; color:black;text-align:center;font:15px arial,sans-serif;}
|
260 |
+
.l_layout span {display:block;}
|
261 |
+
.l_header {width:140px; height:20px; background:#CCF; line-height:20px;}
|
262 |
+
.l_content {width:100px; height:70px; background:beige; float:left; display:inline; line-height:70px;}
|
263 |
+
.l_contentcenter {width:60px; height:70px; background:beige; float:left; display:inline; line-height:70px;}
|
264 |
+
.l_content2 {width:80px; height:70px; background:beige; float:left; display:inline; line-height:70px;}
|
265 |
+
.l_contentw {width:140px; height:70px; background:beige; float:left; display:inline; line-height:70px;}
|
266 |
+
.l_stdbar {width:40px; height:70px; float:left; display:inline;}
|
267 |
+
.l_widebar {width:60px; height:70px; float:left; display:inline;}
|
268 |
+
.l_righttop {width:40px; height:20px; background:#FE8; float:left; display:inline; line-height:20px;}
|
269 |
+
.l_righttopwide {width:60px; height:20px; background:#FE8; float:left; display:inline; line-height:20px;}
|
270 |
+
.l_rightup {width:40px; height:25px; margin:0; background:#FAA; float:left; display:inline; line-height:25px;}
|
271 |
+
.l_rightright {width:40px; height:50px; margin:0; background:#FAA; float:left; display:inline; line-height:50px;}
|
272 |
+
.l_rightdown {width:40px; height:25px; margin:0; background:#AFA; float:left; display:inline; line-height:25px;}
|
273 |
+
.l_leftleft {width:40px; height:70px; margin:0; background:#AFA; float:left; display:inline; line-height:70px;}
|
274 |
+
.l_leftshort {width:30px; height:50px; margin:0; background:#AFA; float:left; display:inline; line-height:50px;}
|
275 |
+
.l_skinny {width:30px; height:50px; margin:0; background:#FAA; float:left; display:inline; line-height:50px;}
|
276 |
+
.l_footer {clear:left;width:140px; height:20px; background:#DDF; color:#000; line-height:20px;}
|
admin/assets/css/admin-style.min.css
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.hide_me{display:none}.wvr-green{font-weight:bold;color:green}.wvr-yellow{font-weight:bold;color:orange}.wvr-red{font-weight:bold;color:red}.wvr-blue{font-weight:bold;color:blue}.a-plus{background-color:#f5fbef;border:1px solid #ccc;padding-left:20px;padding-right:20px;margin-left:20px;margin-right:20%}.i-left{float:left;font-size:14px}.i-left-bg{float:left;font-size:16px;color:#70ff29}.i-left-fg{float:left;font-size:16px;color:#290bbd}a.anchorx{display:block;position:relative;top:-40px;visibility:hidden}.options-intro{text-align:center;margin:-10px auto -5px auto;font-size:90%;background-color:ivory;padding:4px 10px 4px 10px;border:1px solid green;max-width:90%}.options-intro a{font-weight:bold;text-decoration:none;color:blue}.options-intro-menu{text-align:center}#wpcontent{background-color:#fffff8;color:black}input.color{border:1px solid #2bff1c}select{font-size:12px}.font-bold{font-weight:bold}.font-bold-title{font-weight:900}.font-italic a,.font-italic{font-style:italic!important}.font-sans-serif{font-family:sans-serif}
|
2 |
+
.font-arial{font-family:Arial,"Helvetica Neue",Helvetica,sans-serif}.font-arialNarrow{font-family:"Arial Narrow",Arial,sans-serif}.font-impact{font-family:Impact,Haettenschweiler,Charcoal,"Arial Narrow Bold",sans-serif}.font-lucidaSans{font-family:"Lucida Sans",Geneva,Tahoma,sans-serif}.font-trebuchetMS{font-family:"Trebuchet MS","Lucida Grande","Lucida Sans Unicode","Lucida Sans",Tahoma,sans-serif}.font-verdana{font-family:Verdana,Geneva,Candara,sans-serif}.font-serif{font-family:TimesNewRoman,"Times New Roman",Times,Baskerville,Georgia,serif}.font-garamond{font-family:Garamond,Baskerville,"Baskerville Old Face","Hoefler Text","Times New Roman",serif}.font-georgia{font-family:Georgia,Times,"Times New Roman",serif}.font-lucidaBright{font-family:"Lucida Bright","Book Antiqua",Georgia,serif}
|
3 |
+
.font-palatino{font-family:"Palatino Linotype",Palatino,"Lucida Bright","Book Antiqua",serif}.font-timesNewRoman{font-family:TimesNewRoman,"Times New Roman",Times,Baskerville,Georgia,serif}.font-monospace{font-family:monospace}.font-consolas{font-family:Consolas,monaco,"Andale Mono",AndaleMono,monospace}.font-courier{font-family:"Courier New",Courier,"Lucida Sans Typewriter","Lucida Typewriter",monospace}.font-lucidaConsole{font-family:"Lucida Console","Lucida Sans Typewriter",Monaco,"Bitstream Vera Sans Mono",monospace}.font-papyrus{font-family:Papyrus,fantasy,cursive,serif}.font-comicSans{font-family:"Comic Sans MS",cursive,serif}p{margin-right:5%}.submit input{background:#f8f8f8;background-image:linear-gradient(#a8ddff,#88b3cf);border-radius:4px}.atw-help ul{list-style:disc;margin-left:30px}
|
4 |
+
.atw-option-section{font-weight:bold;font-size:120%;color:blue}.tab ul{margin-left:1.15em;list-style:disc outside none}.tab ol{list-style-position:outside;margin-left:1.4em;margin-bottom:.6em}.js_button{background:#eee!important;font-weight:600!important;color:#585858!important}div.yetii{width:95%;margin:0 0 20px 0}ul.yetii{list-style-type:none;width:100%;float:left;border-bottom:4px ridge #ddd;margin-bottom:8px}ul.yetii li{margin:0 2px 0 0;float:left}ul.yetii a{float:left;display:block;padding:4px 8px;border:1px solid #ddd;border-bottom:0;color:#666;background:#eee;text-decoration:none;font-weight:bold;background-image:linear-gradient(#f0f0f0,#c8c8c8);border-top-left-radius:6px;border-top-right-radius:6px}ul.yetii a:hover{background:#fff}ul.yetii a.active{background:#fff;color:#00f;background-image:linear-gradient(#f8f8f8,#eee)}div.yetiisub{width:100%;margin:0 0 20px 0}ul.yetiisub{list-style-type:none;width:100%;float:left;margin-bottom:8px}ul.yetiisub li{margin:0 2px 2px 0;float:left}
|
5 |
+
ul.yetiisub a{float:left;padding:4px 8px;border:1px solid #ccc;color:#666;background:#f0f0f0;text-decoration:none;font-style:italic;font-weight:bold;background-image:linear-gradient(#f8f8f8,#c8c8c8);border-top-left-radius:6px;border-top-right-radius:6px}ul.yetiisub a:hover{background:#fefefe!important}ul.yetiisub a.active{background:#fff;color:#00f;background-image:linear-gradient(#fff,#e8e8e8)}.atw-small-submit{padding:1.0em 0;margin:1px 0;font-size:90%}.atw-option-header{background:#d0d0d8;line-height:1.8em;width:95%;color:blue;font-size:large;font-weight:bold;padding-left:12px;border-radius:6px;box-shadow:3px 3px 10px #aaa;background-image:linear-gradient(#eee,#ccc)}.atw-option-subheader{background:#eaeaea;line-height:1.8em;width:95%;color:blue;font-size:larger;font-weight:bold;padding-left:18px;border-radius:6px;box-shadow:3px 3px 10px #ccc;background-image:linear-gradient(#fff,#ddd)}.atw-row-header{background:#d0d0d8;line-height:1.8em;padding-left:4px;background-image:linear-gradient(#eee,#ccc)}
|
6 |
+
.atw-row-subheader{background:#eaeaea;padding-left:4px;background:linear-gradient(#f8f8f8,#ddd)}.atw-row-subheader-alt{background:#f4f4f4;padding-left:4px;background-image:linear-gradient(#f8f8f8,#dadada)}.atw-row-subheader-area{background:#e8ffee;background:linear-gradient(#e8ffee,#95e8b7)}.l_layout{display:block;width:140px;height:110px;float:left;margin-right:10px;margin-bottom:10px;display:inline;border:1px solid #888;color:black;text-align:center;font:15px arial,sans-serif}.l_layout span{display:block}.l_header{width:140px;height:20px;background:#CCF;line-height:20px}.l_content{width:100px;height:70px;background:beige;float:left;display:inline;line-height:70px}.l_contentcenter{width:60px;height:70px;background:beige;float:left;display:inline;line-height:70px}.l_content2{width:80px;height:70px;background:beige;float:left;display:inline;line-height:70px}.l_contentw{width:140px;height:70px;background:beige;float:left;display:inline;line-height:70px}.l_stdbar{width:40px;height:70px;float:left;display:inline}
|
7 |
+
.l_widebar{width:60px;height:70px;float:left;display:inline}.l_righttop{width:40px;height:20px;background:#FE8;float:left;display:inline;line-height:20px}.l_righttopwide{width:60px;height:20px;background:#FE8;float:left;display:inline;line-height:20px}.l_rightup{width:40px;height:25px;margin:0;background:#FAA;float:left;display:inline;line-height:25px}.l_rightright{width:40px;height:50px;margin:0;background:#FAA;float:left;display:inline;line-height:50px}.l_rightdown{width:40px;height:25px;margin:0;background:#AFA;float:left;display:inline;line-height:25px}.l_leftleft{width:40px;height:70px;margin:0;background:#AFA;float:left;display:inline;line-height:70px}.l_leftshort{width:30px;height:50px;margin:0;background:#AFA;float:left;display:inline;line-height:50px}.l_skinny{width:30px;height:50px;margin:0;background:#FAA;float:left;display:inline;line-height:50px}.l_footer{clear:left;width:140px;height:20px;background:#DDF;color:#000;line-height:20px}
|
admin/assets/css/customizer.css
ADDED
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
.use-theme-options {
|
3 |
+
text-align: center;
|
4 |
+
border-bottom: solid 1px #eee;
|
5 |
+
}
|
6 |
+
.use-theme-options a {
|
7 |
+
display: block;
|
8 |
+
padding: 9px 0;
|
9 |
+
color: white;
|
10 |
+
background: #43b3c4;
|
11 |
+
-webkit-transition: background 0.15s ease-in-out;
|
12 |
+
transition: background 0.15s ease-in-out;
|
13 |
+
}
|
14 |
+
.use-theme-options a:link, .use-theme-options a:visited, .use-theme-options a:hover, .use-theme-options a:active, .use-theme-options a:focus {
|
15 |
+
color: white;
|
16 |
+
}
|
17 |
+
.use-theme-options a:hover, .use-theme-options a:active, .use-theme-options a:focus {
|
18 |
+
background: #3ea5b3;
|
19 |
+
text-decoration: underline !important;
|
20 |
+
}
|
21 |
+
.use-theme-options a:hover span, .use-theme-options a:active span, .use-theme-options a:focus span {
|
22 |
+
right: -3px;
|
23 |
+
}
|
24 |
+
.use-theme-options span {
|
25 |
+
position: relative;
|
26 |
+
right: 0;
|
27 |
+
-webkit-transition: right 0.15s ease-in-out;
|
28 |
+
transition: right 0.15s ease-in-out;
|
29 |
+
}
|
admin/assets/css/customizer.min.css
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
.use-theme-options{text-align:center;border-bottom:solid 1px #eee}.use-theme-options a{display:block;padding:9px 0;color:white;background:#43b3c4;-webkit-transition:background .15s ease-in-out;transition:background .15s ease-in-out}.use-theme-options a:link,.use-theme-options a:visited,.use-theme-options a:hover,.use-theme-options a:active,.use-theme-options a:focus{color:white}.use-theme-options a:hover,.use-theme-options a:active,.use-theme-options a:focus{background:#3ea5b3;text-decoration:underline!important}.use-theme-options a:hover span,.use-theme-options a:active span,.use-theme-options a:focus span{right:-3px}.use-theme-options span{position:relative;right:0;-webkit-transition:right .15s ease-in-out;transition:right .15s ease-in-out}
|
admin/assets/js/jscolor/arrow.gif
ADDED
Binary file
|
admin/assets/js/jscolor/cross.gif
ADDED
Binary file
|
admin/assets/js/jscolor/demo.html
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<html>
|
2 |
+
<head>
|
3 |
+
<title>jscolor demo</title>
|
4 |
+
</head>
|
5 |
+
<body>
|
6 |
+
|
7 |
+
<script type="text/javascript" src="jscolor.js"></script>
|
8 |
+
|
9 |
+
Click here: <input class="color" value="66ff00">
|
10 |
+
|
11 |
+
</body>
|
12 |
+
</html>
|
admin/assets/js/jscolor/hs.png
ADDED
Binary file
|
admin/assets/js/jscolor/hv.png
ADDED
Binary file
|
admin/assets/js/jscolor/jscolor.js
ADDED
@@ -0,0 +1,1010 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* jscolor, JavaScript Color Picker
|
3 |
+
*
|
4 |
+
* @version 1.4.4
|
5 |
+
* @license GNU Lesser General Public License, http://www.gnu.org/copyleft/lesser.html
|
6 |
+
* @author Jan Odvarko, http://odvarko.cz
|
7 |
+
* @created 2008-06-15
|
8 |
+
* @updated 2014-12-09
|
9 |
+
* @link http://jscolor.com
|
10 |
+
*/
|
11 |
+
|
12 |
+
|
13 |
+
var jscolor = {
|
14 |
+
|
15 |
+
|
16 |
+
dir : '', // location of jscolor directory (leave empty to autodetect)
|
17 |
+
bindClass : 'color', // class name
|
18 |
+
binding : true, // automatic binding via <input class="...">
|
19 |
+
preloading : true, // use image preloading?
|
20 |
+
|
21 |
+
|
22 |
+
install : function() {
|
23 |
+
jscolor.addEvent(window, 'load', jscolor.init);
|
24 |
+
},
|
25 |
+
|
26 |
+
|
27 |
+
init : function() {
|
28 |
+
if(jscolor.binding) {
|
29 |
+
jscolor.bind();
|
30 |
+
}
|
31 |
+
if(jscolor.preloading) {
|
32 |
+
jscolor.preload();
|
33 |
+
}
|
34 |
+
},
|
35 |
+
|
36 |
+
|
37 |
+
getDir : function() {
|
38 |
+
if(!jscolor.dir) {
|
39 |
+
var detected = jscolor.detectDir();
|
40 |
+
jscolor.dir = detected!==false ? detected : 'jscolor/';
|
41 |
+
}
|
42 |
+
return jscolor.dir;
|
43 |
+
},
|
44 |
+
|
45 |
+
|
46 |
+
detectDir : function() {
|
47 |
+
var base = location.href;
|
48 |
+
|
49 |
+
var e = document.getElementsByTagName('base');
|
50 |
+
for(var i=0; i<e.length; i+=1) {
|
51 |
+
if(e[i].href) { base = e[i].href; }
|
52 |
+
}
|
53 |
+
|
54 |
+
var e = document.getElementsByTagName('script');
|
55 |
+
for(var i=0; i<e.length; i+=1) {
|
56 |
+
if(e[i].src && /(^|\/)jscolor\.js([?#].*)?$/i.test(e[i].src)) {
|
57 |
+
var src = new jscolor.URI(e[i].src);
|
58 |
+
var srcAbs = src.toAbsolute(base);
|
59 |
+
srcAbs.path = srcAbs.path.replace(/[^\/]+$/, ''); // remove filename
|
60 |
+
srcAbs.query = null;
|
61 |
+
srcAbs.fragment = null;
|
62 |
+
return srcAbs.toString();
|
63 |
+
}
|
64 |
+
}
|
65 |
+
return false;
|
66 |
+
},
|
67 |
+
|
68 |
+
|
69 |
+
bind : function() {
|
70 |
+
var matchClass = new RegExp('(^|\\s)('+jscolor.bindClass+')(\\s*(\\{[^}]*\\})|\\s|$)', 'i');
|
71 |
+
var e = document.getElementsByTagName('input');
|
72 |
+
for(var i=0; i<e.length; i+=1) {
|
73 |
+
if(jscolor.isColorAttrSupported && e[i].type.toLowerCase() == 'color') {
|
74 |
+
// skip inputs of type 'color' if the browser supports this feature
|
75 |
+
continue;
|
76 |
+
}
|
77 |
+
var m;
|
78 |
+
if(!e[i].color && e[i].className && (m = e[i].className.match(matchClass))) {
|
79 |
+
var prop = {};
|
80 |
+
if(m[4]) {
|
81 |
+
try {
|
82 |
+
prop = (new Function ('return (' + m[4] + ')'))();
|
83 |
+
} catch(eInvalidProp) {}
|
84 |
+
}
|
85 |
+
e[i].color = new jscolor.color(e[i], prop);
|
86 |
+
}
|
87 |
+
}
|
88 |
+
},
|
89 |
+
|
90 |
+
|
91 |
+
preload : function() {
|
92 |
+
for(var fn in jscolor.imgRequire) {
|
93 |
+
if(jscolor.imgRequire.hasOwnProperty(fn)) {
|
94 |
+
jscolor.loadImage(fn);
|
95 |
+
}
|
96 |
+
}
|
97 |
+
},
|
98 |
+
|
99 |
+
|
100 |
+
images : {
|
101 |
+
pad : [ 181, 101 ],
|
102 |
+
sld : [ 16, 101 ],
|
103 |
+
cross : [ 15, 15 ],
|
104 |
+
arrow : [ 7, 11 ]
|
105 |
+
},
|
106 |
+
|
107 |
+
|
108 |
+
imgRequire : {},
|
109 |
+
imgLoaded : {},
|
110 |
+
|
111 |
+
|
112 |
+
requireImage : function(filename) {
|
113 |
+
jscolor.imgRequire[filename] = true;
|
114 |
+
},
|
115 |
+
|
116 |
+
|
117 |
+
loadImage : function(filename) {
|
118 |
+
if(!jscolor.imgLoaded[filename]) {
|
119 |
+
jscolor.imgLoaded[filename] = new Image();
|
120 |
+
jscolor.imgLoaded[filename].src = jscolor.getDir()+filename;
|
121 |
+
}
|
122 |
+
},
|
123 |
+
|
124 |
+
|
125 |
+
fetchElement : function(mixed) {
|
126 |
+
return typeof mixed === 'string' ? document.getElementById(mixed) : mixed;
|
127 |
+
},
|
128 |
+
|
129 |
+
|
130 |
+
addEvent : function(el, evnt, func) {
|
131 |
+
if(el.addEventListener) {
|
132 |
+
el.addEventListener(evnt, func, false);
|
133 |
+
} else if(el.attachEvent) {
|
134 |
+
el.attachEvent('on'+evnt, func);
|
135 |
+
}
|
136 |
+
},
|
137 |
+
|
138 |
+
|
139 |
+
fireEvent : function(el, evnt) {
|
140 |
+
if(!el) {
|
141 |
+
return;
|
142 |
+
}
|
143 |
+
if(document.createEvent) {
|
144 |
+
var ev = document.createEvent('HTMLEvents');
|
145 |
+
ev.initEvent(evnt, true, true);
|
146 |
+
el.dispatchEvent(ev);
|
147 |
+
} else if(document.createEventObject) {
|
148 |
+
var ev = document.createEventObject();
|
149 |
+
el.fireEvent('on'+evnt, ev);
|
150 |
+
} else if(el['on'+evnt]) { // alternatively use the traditional event model (IE5)
|
151 |
+
el['on'+evnt]();
|
152 |
+
}
|
153 |
+
},
|
154 |
+
|
155 |
+
|
156 |
+
getElementPos : function(e) {
|
157 |
+
var e1=e, e2=e;
|
158 |
+
var x=0, y=0;
|
159 |
+
if(e1.offsetParent) {
|
160 |
+
do {
|
161 |
+
x += e1.offsetLeft;
|
162 |
+
y += e1.offsetTop;
|
163 |
+
} while(e1 = e1.offsetParent);
|
164 |
+
}
|
165 |
+
while((e2 = e2.parentNode) && e2.nodeName.toUpperCase() !== 'BODY') {
|
166 |
+
x -= e2.scrollLeft;
|
167 |
+
y -= e2.scrollTop;
|
168 |
+
}
|
169 |
+
return [x, y];
|
170 |
+
},
|
171 |
+
|
172 |
+
|
173 |
+
getElementSize : function(e) {
|
174 |
+
return [e.offsetWidth, e.offsetHeight];
|
175 |
+
},
|
176 |
+
|
177 |
+
|
178 |
+
getRelMousePos : function(e) {
|
179 |
+
var x = 0, y = 0;
|
180 |
+
if (!e) { e = window.event; }
|
181 |
+
if (typeof e.offsetX === 'number') {
|
182 |
+
x = e.offsetX;
|
183 |
+
y = e.offsetY;
|
184 |
+
} else if (typeof e.layerX === 'number') {
|
185 |
+
x = e.layerX;
|
186 |
+
y = e.layerY;
|
187 |
+
}
|
188 |
+
return { x: x, y: y };
|
189 |
+
},
|
190 |
+
|
191 |
+
|
192 |
+
getViewPos : function() {
|
193 |
+
if(typeof window.pageYOffset === 'number') {
|
194 |
+
return [window.pageXOffset, window.pageYOffset];
|
195 |
+
} else if(document.body && (document.body.scrollLeft || document.body.scrollTop)) {
|
196 |
+
return [document.body.scrollLeft, document.body.scrollTop];
|
197 |
+
} else if(document.documentElement && (document.documentElement.scrollLeft || document.documentElement.scrollTop)) {
|
198 |
+
return [document.documentElement.scrollLeft, document.documentElement.scrollTop];
|
199 |
+
} else {
|
200 |
+
return [0, 0];
|
201 |
+
}
|
202 |
+
},
|
203 |
+
|
204 |
+
|
205 |
+
getViewSize : function() {
|
206 |
+
if(typeof window.innerWidth === 'number') {
|
207 |
+
return [window.innerWidth, window.innerHeight];
|
208 |
+
} else if(document.body && (document.body.clientWidth || document.body.clientHeight)) {
|
209 |
+
return [document.body.clientWidth, document.body.clientHeight];
|
210 |
+
} else if(document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)) {
|
211 |
+
return [document.documentElement.clientWidth, document.documentElement.clientHeight];
|
212 |
+
} else {
|
213 |
+
return [0, 0];
|
214 |
+
}
|
215 |
+
},
|
216 |
+
|
217 |
+
|
218 |
+
URI : function(uri) { // See RFC3986
|
219 |
+
|
220 |
+
this.scheme = null;
|
221 |
+
this.authority = null;
|
222 |
+
this.path = '';
|
223 |
+
this.query = null;
|
224 |
+
this.fragment = null;
|
225 |
+
|
226 |
+
this.parse = function(uri) {
|
227 |
+
var m = uri.match(/^(([A-Za-z][0-9A-Za-z+.-]*)(:))?((\/\/)([^\/?#]*))?([^?#]*)((\?)([^#]*))?((#)(.*))?/);
|
228 |
+
this.scheme = m[3] ? m[2] : null;
|
229 |
+
this.authority = m[5] ? m[6] : null;
|
230 |
+
this.path = m[7];
|
231 |
+
this.query = m[9] ? m[10] : null;
|
232 |
+
this.fragment = m[12] ? m[13] : null;
|
233 |
+
return this;
|
234 |
+
};
|
235 |
+
|
236 |
+
this.toString = function() {
|
237 |
+
var result = '';
|
238 |
+
if(this.scheme !== null) { result = result + this.scheme + ':'; }
|
239 |
+
if(this.authority !== null) { result = result + '//' + this.authority; }
|
240 |
+
if(this.path !== null) { result = result + this.path; }
|
241 |
+
if(this.query !== null) { result = result + '?' + this.query; }
|
242 |
+
if(this.fragment !== null) { result = result + '#' + this.fragment; }
|
243 |
+
return result;
|
244 |
+
};
|
245 |
+
|
246 |
+
this.toAbsolute = function(base) {
|
247 |
+
var base = new jscolor.URI(base);
|
248 |
+
var r = this;
|
249 |
+
var t = new jscolor.URI;
|
250 |
+
|
251 |
+
if(base.scheme === null) { return false; }
|
252 |
+
|
253 |
+
if(r.scheme !== null && r.scheme.toLowerCase() === base.scheme.toLowerCase()) {
|
254 |
+
r.scheme = null;
|
255 |
+
}
|
256 |
+
|
257 |
+
if(r.scheme !== null) {
|
258 |
+
t.scheme = r.scheme;
|
259 |
+
t.authority = r.authority;
|
260 |
+
t.path = removeDotSegments(r.path);
|
261 |
+
t.query = r.query;
|
262 |
+
} else {
|
263 |
+
if(r.authority !== null) {
|
264 |
+
t.authority = r.authority;
|
265 |
+
t.path = removeDotSegments(r.path);
|
266 |
+
t.query = r.query;
|
267 |
+
} else {
|
268 |
+
if(r.path === '') {
|
269 |
+
t.path = base.path;
|
270 |
+
if(r.query !== null) {
|
271 |
+
t.query = r.query;
|
272 |
+
} else {
|
273 |
+
t.query = base.query;
|
274 |
+
}
|
275 |
+
} else {
|
276 |
+
if(r.path.substr(0,1) === '/') {
|
277 |
+
t.path = removeDotSegments(r.path);
|
278 |
+
} else {
|
279 |
+
if(base.authority !== null && base.path === '') {
|
280 |
+
t.path = '/'+r.path;
|
281 |
+
} else {
|
282 |
+
t.path = base.path.replace(/[^\/]+$/,'')+r.path;
|
283 |
+
}
|
284 |
+
t.path = removeDotSegments(t.path);
|
285 |
+
}
|
286 |
+
t.query = r.query;
|
287 |
+
}
|
288 |
+
t.authority = base.authority;
|
289 |
+
}
|
290 |
+
t.scheme = base.scheme;
|
291 |
+
}
|
292 |
+
t.fragment = r.fragment;
|
293 |
+
|
294 |
+
return t;
|
295 |
+
};
|
296 |
+
|
297 |
+
function removeDotSegments(path) {
|
298 |
+
var out = '';
|
299 |
+
while(path) {
|
300 |
+
if(path.substr(0,3)==='../' || path.substr(0,2)==='./') {
|
301 |
+
path = path.replace(/^\.+/,'').substr(1);
|
302 |
+
} else if(path.substr(0,3)==='/./' || path==='/.') {
|
303 |
+
path = '/'+path.substr(3);
|
304 |
+
} else if(path.substr(0,4)==='/../' || path==='/..') {
|
305 |
+
path = '/'+path.substr(4);
|
306 |
+
out = out.replace(/\/?[^\/]*$/, '');
|
307 |
+
} else if(path==='.' || path==='..') {
|
308 |
+
path = '';
|
309 |
+
} else {
|
310 |
+
var rm = path.match(/^\/?[^\/]*/)[0];
|
311 |
+
path = path.substr(rm.length);
|
312 |
+
out = out + rm;
|
313 |
+
}
|
314 |
+
}
|
315 |
+
return out;
|
316 |
+
}
|
317 |
+
|
318 |
+
if(uri) {
|
319 |
+
this.parse(uri);
|
320 |
+
}
|
321 |
+
|
322 |
+
},
|
323 |
+
|
324 |
+
|
325 |
+
//
|
326 |
+
// Usage example:
|
327 |
+
// var myColor = new jscolor.color(myInputElement)
|
328 |
+
//
|
329 |
+
|
330 |
+
color : function(target, prop) {
|
331 |
+
|
332 |
+
|
333 |
+
this.required = true; // refuse empty values?
|
334 |
+
this.adjust = true; // adjust value to uniform notation?
|
335 |
+
this.hash = false; // prefix color with # symbol?
|
336 |
+
this.caps = true; // uppercase?
|
337 |
+
this.slider = true; // show the value/saturation slider?
|
338 |
+
this.valueElement = target; // value holder
|
339 |
+
this.styleElement = target; // where to reflect current color
|
340 |
+
this.onImmediateChange = null; // onchange callback (can be either string or function)
|
341 |
+
this.hsv = [0, 0, 1]; // read-only 0-6, 0-1, 0-1
|
342 |
+
this.rgb = [1, 1, 1]; // read-only 0-1, 0-1, 0-1
|
343 |
+
this.minH = 0; // read-only 0-6
|
344 |
+
this.maxH = 6; // read-only 0-6
|
345 |
+
this.minS = 0; // read-only 0-1
|
346 |
+
this.maxS = 1; // read-only 0-1
|
347 |
+
this.minV = 0; // read-only 0-1
|
348 |
+
this.maxV = 1; // read-only 0-1
|
349 |
+
|
350 |
+
this.pickerOnfocus = true; // display picker on focus?
|
351 |
+
this.pickerMode = 'HSV'; // HSV | HVS
|
352 |
+
this.pickerPosition = 'bottom'; // left | right | top | bottom
|
353 |
+
this.pickerSmartPosition = true; // automatically adjust picker position when necessary
|
354 |
+
this.pickerButtonHeight = 20; // px
|
355 |
+
this.pickerClosable = false;
|
356 |
+
this.pickerCloseText = 'Close';
|
357 |
+
this.pickerButtonColor = 'ButtonText'; // px
|
358 |
+
this.pickerFace = 10; // px
|
359 |
+
this.pickerFaceColor = 'ThreeDFace'; // CSS color
|
360 |
+
this.pickerBorder = 1; // px
|
361 |
+
this.pickerBorderColor = 'ThreeDHighlight ThreeDShadow ThreeDShadow ThreeDHighlight'; // CSS color
|
362 |
+
this.pickerInset = 1; // px
|
363 |
+
this.pickerInsetColor = 'ThreeDShadow ThreeDHighlight ThreeDHighlight ThreeDShadow'; // CSS color
|
364 |
+
this.pickerZIndex = 10000;
|
365 |
+
|
366 |
+
|
367 |
+
for(var p in prop) {
|
368 |
+
if(prop.hasOwnProperty(p)) {
|
369 |
+
this[p] = prop[p];
|
370 |
+
}
|
371 |
+
}
|
372 |
+
|
373 |
+
|
374 |
+
this.hidePicker = function() {
|
375 |
+
if(isPickerOwner()) {
|
376 |
+
removePicker();
|
377 |
+
}
|
378 |
+
};
|
379 |
+
|
380 |
+
|
381 |
+
this.showPicker = function() {
|
382 |
+
if(!isPickerOwner()) {
|
383 |
+
var tp = jscolor.getElementPos(target); // target pos
|
384 |
+
var ts = jscolor.getElementSize(target); // target size
|
385 |
+
var vp = jscolor.getViewPos(); // view pos
|
386 |
+
var vs = jscolor.getViewSize(); // view size
|
387 |
+
var ps = getPickerDims(this); // picker size
|
388 |
+
var a, b, c;
|
389 |
+
switch(this.pickerPosition.toLowerCase()) {
|
390 |
+
case 'left': a=1; b=0; c=-1; break;
|
391 |
+
case 'right':a=1; b=0; c=1; break;
|
392 |
+
case 'top': a=0; b=1; c=-1; break;
|
393 |
+
default: a=0; b=1; c=1; break;
|
394 |
+
}
|
395 |
+
var l = (ts[b]+ps[b])/2;
|
396 |
+
|
397 |
+
// picker pos
|
398 |
+
if (!this.pickerSmartPosition) {
|
399 |
+
var pp = [
|
400 |
+
tp[a],
|
401 |
+
tp[b]+ts[b]-l+l*c
|
402 |
+
];
|
403 |
+
} else {
|
404 |
+
var pp = [
|
405 |
+
-vp[a]+tp[a]+ps[a] > vs[a] ?
|
406 |
+
(-vp[a]+tp[a]+ts[a]/2 > vs[a]/2 && tp[a]+ts[a]-ps[a] >= 0 ? tp[a]+ts[a]-ps[a] : tp[a]) :
|
407 |
+
tp[a],
|
408 |
+
-vp[b]+tp[b]+ts[b]+ps[b]-l+l*c > vs[b] ?
|
409 |
+
(-vp[b]+tp[b]+ts[b]/2 > vs[b]/2 && tp[b]+ts[b]-l-l*c >= 0 ? tp[b]+ts[b]-l-l*c : tp[b]+ts[b]-l+l*c) :
|
410 |
+
(tp[b]+ts[b]-l+l*c >= 0 ? tp[b]+ts[b]-l+l*c : tp[b]+ts[b]-l-l*c)
|
411 |
+
];
|
412 |
+
}
|
413 |
+
drawPicker(pp[a], pp[b]);
|
414 |
+
}
|
415 |
+
};
|
416 |
+
|
417 |
+
|
418 |
+
this.importColor = function() {
|
419 |
+
if(!valueElement) {
|
420 |
+
this.exportColor();
|
421 |
+
} else {
|
422 |
+
if(!this.adjust) {
|
423 |
+
if(!this.fromString(valueElement.value, leaveValue)) {
|
424 |
+
styleElement.style.backgroundImage = styleElement.jscStyle.backgroundImage;
|
425 |
+
styleElement.style.backgroundColor = styleElement.jscStyle.backgroundColor;
|
426 |
+
styleElement.style.color = styleElement.jscStyle.color;
|
427 |
+
this.exportColor(leaveValue | leaveStyle);
|
428 |
+
}
|
429 |
+
} else if(!this.required && /^\s*$/.test(valueElement.value)) {
|
430 |
+
valueElement.value = '';
|
431 |
+
styleElement.style.backgroundImage = styleElement.jscStyle.backgroundImage;
|
432 |
+
styleElement.style.backgroundColor = styleElement.jscStyle.backgroundColor;
|
433 |
+
styleElement.style.color = styleElement.jscStyle.color;
|
434 |
+
this.exportColor(leaveValue | leaveStyle);
|
435 |
+
|
436 |
+
} else if(this.fromString(valueElement.value)) {
|
437 |
+
// OK
|
438 |
+
} else {
|
439 |
+
this.exportColor();
|
440 |
+
}
|
441 |
+
}
|
442 |
+
};
|
443 |
+
|
444 |
+
|
445 |
+
this.exportColor = function(flags) {
|
446 |
+
if(!(flags & leaveValue) && valueElement) {
|
447 |
+
var value = this.toString();
|
448 |
+
if(this.caps) { value = value.toUpperCase(); }
|
449 |
+
if(this.hash) { value = '#'+value; }
|
450 |
+
valueElement.value = value;
|
451 |
+
}
|
452 |
+
if(!(flags & leaveStyle) && styleElement) {
|
453 |
+
styleElement.style.backgroundImage = "none";
|
454 |
+
styleElement.style.backgroundColor =
|
455 |
+
'#'+this.toString();
|
456 |
+
styleElement.style.color =
|
457 |
+
0.213 * this.rgb[0] +
|
458 |
+
0.715 * this.rgb[1] +
|
459 |
+
0.072 * this.rgb[2]
|
460 |
+
< 0.5 ? '#FFF' : '#000';
|
461 |
+
}
|
462 |
+
if(!(flags & leavePad) && isPickerOwner()) {
|
463 |
+
redrawPad();
|
464 |
+
}
|
465 |
+
if(!(flags & leaveSld) && isPickerOwner()) {
|
466 |
+
redrawSld();
|
467 |
+
}
|
468 |
+
};
|
469 |
+
|
470 |
+
|
471 |
+
this.fromHSV = function(h, s, v, flags) { // null = don't change
|
472 |
+
if(h !== null) { h = Math.max(0.0, this.minH, Math.min(6.0, this.maxH, h)); }
|
473 |
+
if(s !== null) { s = Math.max(0.0, this.minS, Math.min(1.0, this.maxS, s)); }
|
474 |
+
if(v !== null) { v = Math.max(0.0, this.minV, Math.min(1.0, this.maxV, v)); }
|
475 |
+
|
476 |
+
this.rgb = HSV_RGB(
|
477 |
+
h===null ? this.hsv[0] : (this.hsv[0]=h),
|
478 |
+
s===null ? this.hsv[1] : (this.hsv[1]=s),
|
479 |
+
v===null ? this.hsv[2] : (this.hsv[2]=v)
|
480 |
+
);
|
481 |
+
|
482 |
+
this.exportColor(flags);
|
483 |
+
};
|
484 |
+
|
485 |
+
|
486 |
+
this.fromRGB = function(r, g, b, flags) { // null = don't change
|
487 |
+
if(r !== null) { r = Math.max(0.0, Math.min(1.0, r)); }
|
488 |
+
if(g !== null) { g = Math.max(0.0, Math.min(1.0, g)); }
|
489 |
+
if(b !== null) { b = Math.max(0.0, Math.min(1.0, b)); }
|
490 |
+
|
491 |
+
var hsv = RGB_HSV(
|
492 |
+
r===null ? this.rgb[0] : r,
|
493 |
+
g===null ? this.rgb[1] : g,
|
494 |
+
b===null ? this.rgb[2] : b
|
495 |
+
);
|
496 |
+
if(hsv[0] !== null) {
|
497 |
+
this.hsv[0] = Math.max(0.0, this.minH, Math.min(6.0, this.maxH, hsv[0]));
|
498 |
+
}
|
499 |
+
if(hsv[2] !== 0) {
|
500 |
+
this.hsv[1] = hsv[1]===null ? null : Math.max(0.0, this.minS, Math.min(1.0, this.maxS, hsv[1]));
|
501 |
+
}
|
502 |
+
this.hsv[2] = hsv[2]===null ? null : Math.max(0.0, this.minV, Math.min(1.0, this.maxV, hsv[2]));
|
503 |
+
|
504 |
+
// update RGB according to final HSV, as some values might be trimmed
|
505 |
+
var rgb = HSV_RGB(this.hsv[0], this.hsv[1], this.hsv[2]);
|
506 |
+
this.rgb[0] = rgb[0];
|
507 |
+
this.rgb[1] = rgb[1];
|
508 |
+
this.rgb[2] = rgb[2];
|
509 |
+
|
510 |
+
this.exportColor(flags);
|
511 |
+
};
|
512 |
+
|
513 |
+
|
514 |
+
this.fromString = function(hex, flags) {
|
515 |
+
var m = hex.match(/^\W*([0-9A-F]{3}([0-9A-F]{3})?)\W*$/i);
|
516 |
+
if(!m) {
|
517 |
+
return false;
|
518 |
+
} else {
|
519 |
+
if(m[1].length === 6) { // 6-char notation
|
520 |
+
this.fromRGB(
|
521 |
+
parseInt(m[1].substr(0,2),16) / 255,
|
522 |
+
parseInt(m[1].substr(2,2),16) / 255,
|
523 |
+
parseInt(m[1].substr(4,2),16) / 255,
|
524 |
+
flags
|
525 |
+
);
|
526 |
+
} else { // 3-char notation
|
527 |
+
this.fromRGB(
|
528 |
+
parseInt(m[1].charAt(0)+m[1].charAt(0),16) / 255,
|
529 |
+
parseInt(m[1].charAt(1)+m[1].charAt(1),16) / 255,
|
530 |
+
parseInt(m[1].charAt(2)+m[1].charAt(2),16) / 255,
|
531 |
+
flags
|
532 |
+
);
|
533 |
+
}
|
534 |
+
return true;
|
535 |
+
}
|
536 |
+
};
|
537 |
+
|
538 |
+
|
539 |
+
this.toString = function() {
|
540 |
+
return (
|
541 |
+
(0x100 | Math.round(255*this.rgb[0])).toString(16).substr(1) +
|
542 |
+
(0x100 | Math.round(255*this.rgb[1])).toString(16).substr(1) +
|
543 |
+
(0x100 | Math.round(255*this.rgb[2])).toString(16).substr(1)
|
544 |
+
);
|
545 |
+
};
|
546 |
+
|
547 |
+
|
548 |
+
function RGB_HSV(r, g, b) {
|
549 |
+
var n = Math.min(Math.min(r,g),b);
|
550 |
+
var v = Math.max(Math.max(r,g),b);
|
551 |
+
var m = v - n;
|
552 |
+
if(m === 0) { return [ null, 0, v ]; }
|
553 |
+
var h = r===n ? 3+(b-g)/m : (g===n ? 5+(r-b)/m : 1+(g-r)/m);
|
554 |
+
return [ h===6?0:h, m/v, v ];
|
555 |
+
}
|
556 |
+
|
557 |
+
|
558 |
+
function HSV_RGB(h, s, v) {
|
559 |
+
if(h === null) { return [ v, v, v ]; }
|
560 |
+
var i = Math.floor(h);
|
561 |
+
var f = i%2 ? h-i : 1-(h-i);
|
562 |
+
var m = v * (1 - s);
|
563 |
+
var n = v * (1 - s*f);
|
564 |
+
switch(i) {
|
565 |
+
case 6:
|
566 |
+
case 0: return [v,n,m];
|
567 |
+
case 1: return [n,v,m];
|
568 |
+
case 2: return [m,v,n];
|
569 |
+
case 3: return [m,n,v];
|
570 |
+
case 4: return [n,m,v];
|
571 |
+
case 5: return [v,m,n];
|
572 |
+
}
|
573 |
+
}
|
574 |
+
|
575 |
+
|
576 |
+
function removePicker() {
|
577 |
+
delete jscolor.picker.owner;
|
578 |
+
document.getElementsByTagName('body')[0].removeChild(jscolor.picker.boxB);
|
579 |
+
}
|
580 |
+
|
581 |
+
|
582 |
+
function drawPicker(x, y) {
|
583 |
+
if(!jscolor.picker) {
|
584 |
+
jscolor.picker = {
|
585 |
+
box : document.createElement('div'),
|
586 |
+
boxB : document.createElement('div'),
|
587 |
+
pad : document.createElement('div'),
|
588 |
+
padB : document.createElement('div'),
|
589 |
+
padM : document.createElement('div'),
|
590 |
+
sld : document.createElement('div'),
|
591 |
+
sldB : document.createElement('div'),
|
592 |
+
sldM : document.createElement('div'),
|
593 |
+
btn : document.createElement('div'),
|
594 |
+
btnS : document.createElement('span'),
|
595 |
+
btnT : document.createTextNode(THIS.pickerCloseText)
|
596 |
+
};
|
597 |
+
for(var i=0,segSize=4; i<jscolor.images.sld[1]; i+=segSize) {
|
598 |
+
var seg = document.createElement('div');
|
599 |
+
seg.style.height = segSize+'px';
|
600 |
+
seg.style.fontSize = '1px';
|
601 |
+
seg.style.lineHeight = '0';
|
602 |
+
jscolor.picker.sld.appendChild(seg);
|
603 |
+
}
|
604 |
+
jscolor.picker.sldB.appendChild(jscolor.picker.sld);
|
605 |
+
jscolor.picker.box.appendChild(jscolor.picker.sldB);
|
606 |
+
jscolor.picker.box.appendChild(jscolor.picker.sldM);
|
607 |
+
jscolor.picker.padB.appendChild(jscolor.picker.pad);
|
608 |
+
jscolor.picker.box.appendChild(jscolor.picker.padB);
|
609 |
+
jscolor.picker.box.appendChild(jscolor.picker.padM);
|
610 |
+
jscolor.picker.btnS.appendChild(jscolor.picker.btnT);
|
611 |
+
jscolor.picker.btn.appendChild(jscolor.picker.btnS);
|
612 |
+
jscolor.picker.box.appendChild(jscolor.picker.btn);
|
613 |
+
jscolor.picker.boxB.appendChild(jscolor.picker.box);
|
614 |
+
}
|
615 |
+
|
616 |
+
var p = jscolor.picker;
|
617 |
+
|
618 |
+
// controls interaction
|
619 |
+
p.box.onmouseup =
|
620 |
+
p.box.onmouseout = function() { target.focus(); };
|
621 |
+
p.box.onmousedown = function() { abortBlur=true; };
|
622 |
+
p.box.onmousemove = function(e) {
|
623 |
+
if (holdPad || holdSld) {
|
624 |
+
holdPad && setPad(e);
|
625 |
+
holdSld && setSld(e);
|
626 |
+
if (document.selection) {
|
627 |
+
document.selection.empty();
|
628 |
+
} else if (window.getSelection) {
|
629 |
+
window.getSelection().removeAllRanges();
|
630 |
+
}
|
631 |
+
dispatchImmediateChange();
|
632 |
+
}
|
633 |
+
};
|
634 |
+
if('ontouchstart' in window) { // if touch device
|
635 |
+
var handle_touchmove = function(e) {
|
636 |
+
var event={
|
637 |
+
'offsetX': e.touches[0].pageX-touchOffset.X,
|
638 |
+
'offsetY': e.touches[0].pageY-touchOffset.Y
|
639 |
+
};
|
640 |
+
if (holdPad || holdSld) {
|
641 |
+
holdPad && setPad(event);
|
642 |
+
holdSld && setSld(event);
|
643 |
+
dispatchImmediateChange();
|
644 |
+
}
|
645 |
+
e.stopPropagation(); // prevent move "view" on broswer
|
646 |
+
e.preventDefault(); // prevent Default - Android Fix (else android generated only 1-2 touchmove events)
|
647 |
+
};
|
648 |
+
p.box.removeEventListener('touchmove', handle_touchmove, false)
|
649 |
+
p.box.addEventListener('touchmove', handle_touchmove, false)
|
650 |
+
}
|
651 |
+
p.padM.onmouseup =
|
652 |
+
p.padM.onmouseout = function() { if(holdPad) { holdPad=false; jscolor.fireEvent(valueElement,'change'); } };
|
653 |
+
p.padM.onmousedown = function(e) {
|
654 |
+
// if the slider is at the bottom, move it up
|
655 |
+
switch(modeID) {
|
656 |
+
case 0: if (THIS.hsv[2] === 0) { THIS.fromHSV(null, null, 1.0); }; break;
|
657 |
+
case 1: if (THIS.hsv[1] === 0) { THIS.fromHSV(null, 1.0, null); }; break;
|
658 |
+
}
|
659 |
+
holdSld=false;
|
660 |
+
holdPad=true;
|
661 |
+
setPad(e);
|
662 |
+
dispatchImmediateChange();
|
663 |
+
};
|
664 |
+
if('ontouchstart' in window) {
|
665 |
+
p.padM.addEventListener('touchstart', function(e) {
|
666 |
+
touchOffset={
|
667 |
+
'X': e.target.offsetParent.offsetLeft,
|
668 |
+
'Y': e.target.offsetParent.offsetTop
|
669 |
+
};
|
670 |
+
this.onmousedown({
|
671 |
+
'offsetX':e.touches[0].pageX-touchOffset.X,
|
672 |
+
'offsetY':e.touches[0].pageY-touchOffset.Y
|
673 |
+
});
|
674 |
+
});
|
675 |
+
}
|
676 |
+
p.sldM.onmouseup =
|
677 |
+
p.sldM.onmouseout = function() { if(holdSld) { holdSld=false; jscolor.fireEvent(valueElement,'change'); } };
|
678 |
+
p.sldM.onmousedown = function(e) {
|
679 |
+
holdPad=false;
|
680 |
+
holdSld=true;
|
681 |
+
setSld(e);
|
682 |
+
dispatchImmediateChange();
|
683 |
+
};
|
684 |
+
if('ontouchstart' in window) {
|
685 |
+
p.sldM.addEventListener('touchstart', function(e) {
|
686 |
+
touchOffset={
|
687 |
+
'X': e.target.offsetParent.offsetLeft,
|
688 |
+
'Y': e.target.offsetParent.offsetTop
|
689 |
+
};
|
690 |
+
this.onmousedown({
|
691 |
+
'offsetX':e.touches[0].pageX-touchOffset.X,
|
692 |
+
'offsetY':e.touches[0].pageY-touchOffset.Y
|
693 |
+
});
|
694 |
+
});
|
695 |
+
}
|
696 |
+
|
697 |
+
// picker
|
698 |
+
var dims = getPickerDims(THIS);
|
699 |
+
p.box.style.width = dims[0] + 'px';
|
700 |
+
p.box.style.height = dims[1] + 'px';
|
701 |
+
|
702 |
+
// picker border
|
703 |
+
p.boxB.style.position = 'absolute';
|
704 |
+
p.boxB.style.clear = 'both';
|
705 |
+
p.boxB.style.left = x+'px';
|
706 |
+
p.boxB.style.top = y+'px';
|
707 |
+
p.boxB.style.zIndex = THIS.pickerZIndex;
|
708 |
+
p.boxB.style.border = THIS.pickerBorder+'px solid';
|
709 |
+
p.boxB.style.borderColor = THIS.pickerBorderColor;
|
710 |
+
p.boxB.style.background = THIS.pickerFaceColor;
|
711 |
+
|
712 |
+
// pad image
|
713 |
+
p.pad.style.width = jscolor.images.pad[0]+'px';
|
714 |
+
p.pad.style.height = jscolor.images.pad[1]+'px';
|
715 |
+
|
716 |
+
// pad border
|
717 |
+
p.padB.style.position = 'absolute';
|
718 |
+
p.padB.style.left = THIS.pickerFace+'px';
|
719 |
+
p.padB.style.top = THIS.pickerFace+'px';
|
720 |
+
p.padB.style.border = THIS.pickerInset+'px solid';
|
721 |
+
p.padB.style.borderColor = THIS.pickerInsetColor;
|
722 |
+
|
723 |
+
// pad mouse area
|
724 |
+
p.padM.style.position = 'absolute';
|
725 |
+
p.padM.style.left = '0';
|
726 |
+
p.padM.style.top = '0';
|
727 |
+
p.padM.style.width = THIS.pickerFace + 2*THIS.pickerInset + jscolor.images.pad[0] + jscolor.images.arrow[0] + 'px';
|
728 |
+
p.padM.style.height = p.box.style.height;
|
729 |
+
p.padM.style.cursor = 'crosshair';
|
730 |
+
|
731 |
+
// slider image
|
732 |
+
p.sld.style.overflow = 'hidden';
|
733 |
+
p.sld.style.width = jscolor.images.sld[0]+'px';
|
734 |
+
p.sld.style.height = jscolor.images.sld[1]+'px';
|
735 |
+
|
736 |
+
// slider border
|
737 |
+
p.sldB.style.display = THIS.slider ? 'block' : 'none';
|
738 |
+
p.sldB.style.position = 'absolute';
|
739 |
+
p.sldB.style.right = THIS.pickerFace+'px';
|
740 |
+
p.sldB.style.top = THIS.pickerFace+'px';
|
741 |
+
p.sldB.style.border = THIS.pickerInset+'px solid';
|
742 |
+
p.sldB.style.borderColor = THIS.pickerInsetColor;
|
743 |
+
|
744 |
+
// slider mouse area
|
745 |
+
p.sldM.style.display = THIS.slider ? 'block' : 'none';
|
746 |
+
p.sldM.style.position = 'absolute';
|
747 |
+
p.sldM.style.right = '0';
|
748 |
+
p.sldM.style.top = '0';
|
749 |
+
p.sldM.style.width = jscolor.images.sld[0] + jscolor.images.arrow[0] + THIS.pickerFace + 2*THIS.pickerInset + 'px';
|
750 |
+
p.sldM.style.height = p.box.style.height;
|
751 |
+
try {
|
752 |
+
p.sldM.style.cursor = 'pointer';
|
753 |
+
} catch(eOldIE) {
|
754 |
+
p.sldM.style.cursor = 'hand';
|
755 |
+
}
|
756 |
+
|
757 |
+
// "close" button
|
758 |
+
function setBtnBorder() {
|
759 |
+
var insetColors = THIS.pickerInsetColor.split(/\s+/);
|
760 |
+
var pickerOutsetColor = insetColors.length < 2 ? insetColors[0] : insetColors[1] + ' ' + insetColors[0] + ' ' + insetColors[0] + ' ' + insetColors[1];
|
761 |
+
p.btn.style.borderColor = pickerOutsetColor;
|
762 |
+
}
|
763 |
+
p.btn.style.display = THIS.pickerClosable ? 'block' : 'none';
|
764 |
+
p.btn.style.position = 'absolute';
|
765 |
+
p.btn.style.left = THIS.pickerFace + 'px';
|
766 |
+
p.btn.style.bottom = THIS.pickerFace + 'px';
|
767 |
+
p.btn.style.padding = '0 15px';
|
768 |
+
p.btn.style.height = '18px';
|
769 |
+
p.btn.style.border = THIS.pickerInset + 'px solid';
|
770 |
+
setBtnBorder();
|
771 |
+
p.btn.style.color = THIS.pickerButtonColor;
|
772 |
+
p.btn.style.font = '12px sans-serif';
|
773 |
+
p.btn.style.textAlign = 'center';
|
774 |
+
try {
|
775 |
+
p.btn.style.cursor = 'pointer';
|
776 |
+
} catch(eOldIE) {
|
777 |
+
p.btn.style.cursor = 'hand';
|
778 |
+
}
|
779 |
+
p.btn.onmousedown = function () {
|
780 |
+
THIS.hidePicker();
|
781 |
+
};
|
782 |
+
p.btnS.style.lineHeight = p.btn.style.height;
|
783 |
+
|
784 |
+
// load images in optimal order
|
785 |
+
switch(modeID) {
|
786 |
+
case 0: var padImg = 'hs.png'; break;
|
787 |
+
case 1: var padImg = 'hv.png'; break;
|
788 |
+
}
|
789 |
+
p.padM.style.backgroundImage = "url('"+jscolor.getDir()+"cross.gif')";
|
790 |
+
p.padM.style.backgroundRepeat = "no-repeat";
|
791 |
+
p.sldM.style.backgroundImage = "url('"+jscolor.getDir()+"arrow.gif')";
|
792 |
+
p.sldM.style.backgroundRepeat = "no-repeat";
|
793 |
+
p.pad.style.backgroundImage = "url('"+jscolor.getDir()+padImg+"')";
|
794 |
+
p.pad.style.backgroundRepeat = "no-repeat";
|
795 |
+
p.pad.style.backgroundPosition = "0 0";
|
796 |
+
|
797 |
+
// place pointers
|
798 |
+
redrawPad();
|
799 |
+
redrawSld();
|
800 |
+
|
801 |
+
jscolor.picker.owner = THIS;
|
802 |
+
document.getElementsByTagName('body')[0].appendChild(p.boxB);
|
803 |
+
}
|
804 |
+
|
805 |
+
|
806 |
+
function getPickerDims(o) {
|
807 |
+
var dims = [
|
808 |
+
2*o.pickerInset + 2*o.pickerFace + jscolor.images.pad[0] +
|
809 |
+
(o.slider ? 2*o.pickerInset + 2*jscolor.images.arrow[0] + jscolor.images.sld[0] : 0),
|
810 |
+
o.pickerClosable ?
|
811 |
+
4*o.pickerInset + 3*o.pickerFace + jscolor.images.pad[1] + o.pickerButtonHeight :
|
812 |
+
2*o.pickerInset + 2*o.pickerFace + jscolor.images.pad[1]
|
813 |
+
];
|
814 |
+
return dims;
|
815 |
+
}
|
816 |
+
|
817 |
+
|
818 |
+
function redrawPad() {
|
819 |
+
// redraw the pad pointer
|
820 |
+
switch(modeID) {
|
821 |
+
case 0: var yComponent = 1; break;
|
822 |
+
case 1: var yComponent = 2; break;
|
823 |
+
}
|
824 |
+
var x = Math.round((THIS.hsv[0]/6) * (jscolor.images.pad[0]-1));
|
825 |
+
var y = Math.round((1-THIS.hsv[yComponent]) * (jscolor.images.pad[1]-1));
|
826 |
+
jscolor.picker.padM.style.backgroundPosition =
|
827 |
+
(THIS.pickerFace+THIS.pickerInset+x - Math.floor(jscolor.images.cross[0]/2)) + 'px ' +
|
828 |
+
(THIS.pickerFace+THIS.pickerInset+y - Math.floor(jscolor.images.cross[1]/2)) + 'px';
|
829 |
+
|
830 |
+
// redraw the slider image
|
831 |
+
var seg = jscolor.picker.sld.childNodes;
|
832 |
+
|
833 |
+
switch(modeID) {
|
834 |
+
case 0:
|
835 |
+
var rgb = HSV_RGB(THIS.hsv[0], THIS.hsv[1], 1);
|
836 |
+
for(var i=0; i<seg.length; i+=1) {
|
837 |
+
seg[i].style.backgroundColor = 'rgb('+
|
838 |
+
(rgb[0]*(1-i/seg.length)*100)+'%,'+
|
839 |
+
(rgb[1]*(1-i/seg.length)*100)+'%,'+
|
840 |
+
(rgb[2]*(1-i/seg.length)*100)+'%)';
|
841 |
+
}
|
842 |
+
break;
|
843 |
+
case 1:
|
844 |
+
var rgb, s, c = [ THIS.hsv[2], 0, 0 ];
|
845 |
+
var i = Math.floor(THIS.hsv[0]);
|
846 |
+
var f = i%2 ? THIS.hsv[0]-i : 1-(THIS.hsv[0]-i);
|
847 |
+
switch(i) {
|
848 |
+
case 6:
|
849 |
+
case 0: rgb=[0,1,2]; break;
|
850 |
+
case 1: rgb=[1,0,2]; break;
|
851 |
+
case 2: rgb=[2,0,1]; break;
|
852 |
+
case 3: rgb=[2,1,0]; break;
|
853 |
+
case 4: rgb=[1,2,0]; break;
|
854 |
+
case 5: rgb=[0,2,1]; break;
|
855 |
+
}
|
856 |
+
for(var i=0; i<seg.length; i+=1) {
|
857 |
+
s = 1 - 1/(seg.length-1)*i;
|
858 |
+
c[1] = c[0] * (1 - s*f);
|
859 |
+
c[2] = c[0] * (1 - s);
|
860 |
+
seg[i].style.backgroundColor = 'rgb('+
|
861 |
+
(c[rgb[0]]*100)+'%,'+
|
862 |
+
(c[rgb[1]]*100)+'%,'+
|
863 |
+
(c[rgb[2]]*100)+'%)';
|
864 |
+
}
|
865 |
+
break;
|
866 |
+
}
|
867 |
+
}
|
868 |
+
|
869 |
+
|
870 |
+
function redrawSld() {
|
871 |
+
// redraw the slider pointer
|
872 |
+
switch(modeID) {
|
873 |
+
case 0: var yComponent = 2; break;
|
874 |
+
case 1: var yComponent = 1; break;
|
875 |
+
}
|
876 |
+
var y = Math.round((1-THIS.hsv[yComponent]) * (jscolor.images.sld[1]-1));
|
877 |
+
jscolor.picker.sldM.style.backgroundPosition =
|
878 |
+
'0 ' + (THIS.pickerFace+THIS.pickerInset+y - Math.floor(jscolor.images.arrow[1]/2)) + 'px';
|
879 |
+
}
|
880 |
+
|
881 |
+
|
882 |
+
function isPickerOwner() {
|
883 |
+
return jscolor.picker && jscolor.picker.owner === THIS;
|
884 |
+
}
|
885 |
+
|
886 |
+
|
887 |
+
function blurTarget() {
|
888 |
+
if(valueElement === target) {
|
889 |
+
THIS.importColor();
|
890 |
+
}
|
891 |
+
if(THIS.pickerOnfocus) {
|
892 |
+
THIS.hidePicker();
|
893 |
+
}
|
894 |
+
}
|
895 |
+
|
896 |
+
|
897 |
+
function blurValue() {
|
898 |
+
if(valueElement !== target) {
|
899 |
+
THIS.importColor();
|
900 |
+
}
|
901 |
+
}
|
902 |
+
|
903 |
+
|
904 |
+
function setPad(e) {
|
905 |
+
var mpos = jscolor.getRelMousePos(e);
|
906 |
+
var x = mpos.x - THIS.pickerFace - THIS.pickerInset;
|
907 |
+
var y = mpos.y - THIS.pickerFace - THIS.pickerInset;
|
908 |
+
switch(modeID) {
|
909 |
+
case 0: THIS.fromHSV(x*(6/(jscolor.images.pad[0]-1)), 1 - y/(jscolor.images.pad[1]-1), null, leaveSld); break;
|
910 |
+
case 1: THIS.fromHSV(x*(6/(jscolor.images.pad[0]-1)), null, 1 - y/(jscolor.images.pad[1]-1), leaveSld); break;
|
911 |
+
}
|
912 |
+
}
|
913 |
+
|
914 |
+
|
915 |
+
function setSld(e) {
|
916 |
+
var mpos = jscolor.getRelMousePos(e);
|
917 |
+
var y = mpos.y - THIS.pickerFace - THIS.pickerInset;
|
918 |
+
switch(modeID) {
|
919 |
+
case 0: THIS.fromHSV(null, null, 1 - y/(jscolor.images.sld[1]-1), leavePad); break;
|
920 |
+
case 1: THIS.fromHSV(null, 1 - y/(jscolor.images.sld[1]-1), null, leavePad); break;
|
921 |
+
}
|
922 |
+
}
|
923 |
+
|
924 |
+
|
925 |
+
function dispatchImmediateChange() {
|
926 |
+
if (THIS.onImmediateChange) {
|
927 |
+
var callback;
|
928 |
+
if (typeof THIS.onImmediateChange === 'string') {
|
929 |
+
callback = new Function (THIS.onImmediateChange);
|
930 |
+
} else {
|
931 |
+
callback = THIS.onImmediateChange;
|
932 |
+
}
|
933 |
+
callback.call(THIS);
|
934 |
+
}
|
935 |
+
}
|
936 |
+
|
937 |
+
|
938 |
+
var THIS = this;
|
939 |
+
var modeID = this.pickerMode.toLowerCase()==='hvs' ? 1 : 0;
|
940 |
+
var abortBlur = false;
|
941 |
+
var
|
942 |
+
valueElement = jscolor.fetchElement(this.valueElement),
|
943 |
+
styleElement = jscolor.fetchElement(this.styleElement);
|
944 |
+
var
|
945 |
+
holdPad = false,
|
946 |
+
holdSld = false,
|
947 |
+
touchOffset = {};
|
948 |
+
var
|
949 |
+
leaveValue = 1<<0,
|
950 |
+
leaveStyle = 1<<1,
|
951 |
+
leavePad = 1<<2,
|
952 |
+
leaveSld = 1<<3;
|
953 |
+
|
954 |
+
jscolor.isColorAttrSupported = false;
|
955 |
+
var el = document.createElement('input');
|
956 |
+
if(el.setAttribute) {
|
957 |
+
el.setAttribute('type', 'color');
|
958 |
+
if(el.type.toLowerCase() == 'color') {
|
959 |
+
jscolor.isColorAttrSupported = true;
|
960 |
+
}
|
961 |
+
}
|
962 |
+
|
963 |
+
// target
|
964 |
+
jscolor.addEvent(target, 'focus', function() {
|
965 |
+
if(THIS.pickerOnfocus) { THIS.showPicker(); }
|
966 |
+
});
|
967 |
+
jscolor.addEvent(target, 'blur', function() {
|
968 |
+
if(!abortBlur) {
|
969 |
+
window.setTimeout(function(){ abortBlur || blurTarget(); abortBlur=false; }, 0);
|
970 |
+
} else {
|
971 |
+
abortBlur = false;
|
972 |
+
}
|
973 |
+
});
|
974 |
+
|
975 |
+
// valueElement
|
976 |
+
if(valueElement) {
|
977 |
+
var updateField = function() {
|
978 |
+
THIS.fromString(valueElement.value, leaveValue);
|
979 |
+
dispatchImmediateChange();
|
980 |
+
};
|
981 |
+
jscolor.addEvent(valueElement, 'keyup', updateField);
|
982 |
+
jscolor.addEvent(valueElement, 'input', updateField);
|
983 |
+
jscolor.addEvent(valueElement, 'blur', blurValue);
|
984 |
+
valueElement.setAttribute('autocomplete', 'off');
|
985 |
+
}
|
986 |
+
|
987 |
+
// styleElement
|
988 |
+
if(styleElement) {
|
989 |
+
styleElement.jscStyle = {
|
990 |
+
backgroundImage : styleElement.style.backgroundImage,
|
991 |
+
backgroundColor : styleElement.style.backgroundColor,
|
992 |
+
color : styleElement.style.color
|
993 |
+
};
|
994 |
+
}
|
995 |
+
|
996 |
+
// require images
|
997 |
+
switch(modeID) {
|
998 |
+
case 0: jscolor.requireImage('hs.png'); break;
|
999 |
+
case 1: jscolor.requireImage('hv.png'); break;
|
1000 |
+
}
|
1001 |
+
jscolor.requireImage('cross.gif');
|
1002 |
+
jscolor.requireImage('arrow.gif');
|
1003 |
+
|
1004 |
+
this.importColor();
|
1005 |
+
}
|
1006 |
+
|
1007 |
+
};
|
1008 |
+
|
1009 |
+
|
1010 |
+
jscolor.install();
|
admin/assets/js/theme/hide-css.js
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* weaverx_hide_css, JavaScript specialized hide table row
|
3 |
+
*
|
4 |
+
* @version 1.1
|
5 |
+
* @license GNU Lesser General Public License, http://www.gnu.org/copyleft/lesser.html
|
6 |
+
* @author Bruce Wampler
|
7 |
+
*/
|
8 |
+
function weaverx_ToggleRowCSS(his, me, show, hide) {
|
9 |
+
if (his.style.display != 'none') {
|
10 |
+
his.style.display = 'none';
|
11 |
+
me.innerHTML = '<img src="' + show + '" alt="show" />';
|
12 |
+
} else {
|
13 |
+
his.style.display = 'table-row';
|
14 |
+
me.innerHTML = '<img src="' + hide + '" alt="hide" />';
|
15 |
+
}
|
16 |
+
}
|
admin/assets/js/theme/hide-css.min.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
function weaverx_ToggleRowCSS(d,c,a,b){if(d.style.display!="none"){d.style.display="none";c.innerHTML='<img src="'+a+'" alt="show" />'}else{d.style.display="table-row";c.innerHTML='<img src="'+b+'" alt="hide" />'}};
|
admin/assets/js/theme/media-lib.js
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* media-lib.js, JavaScript specialized open WP thickbox media uploader
|
3 |
+
*
|
4 |
+
* @version 1.1
|
5 |
+
* @license GNU Lesser General Public License, http://www.gnu.org/copyleft/lesser.html
|
6 |
+
* @author Bruce Wampler
|
7 |
+
*/
|
8 |
+
var weaverx_fillin;
|
9 |
+
function weaverx_media_lib(fillarea) {
|
10 |
+
weaverx_fillin = fillarea;
|
11 |
+
tb_show('', 'media-upload.php?post_id=0&type=image&TB_iframe=true&width=800&height=600');
|
12 |
+
return;
|
13 |
+
}
|
14 |
+
|
15 |
+
jQuery(document).ready(function() {
|
16 |
+
window.send_to_editor = function(html) {
|
17 |
+
imgurl = jQuery('img',html).attr('src');
|
18 |
+
jQuery('#' + weaverx_fillin).val(imgurl);
|
19 |
+
tb_remove();
|
20 |
+
jQuery('#' + weaverx_fillin).focus();
|
21 |
+
}
|
22 |
+
});
|
admin/assets/js/theme/media-lib.min.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
var weaverx_fillin;function weaverx_media_lib(a){weaverx_fillin=a;tb_show("","media-upload.php?post_id=0&type=image&TB_iframe=true&width=800&height=600");return}jQuery(document).ready(function(){window.send_to_editor=function(a){imgurl=jQuery("img",a).attr("src");jQuery("#"+weaverx_fillin).val(imgurl);tb_remove();jQuery("#"+weaverx_fillin).focus()}});
|
admin/assets/js/yetii/bsdlicense.txt
ADDED
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
Copyright (c) kminek.pl & Grzegorz Wójcik
|
2 |
+
|
3 |
+
All rights reserved.
|
4 |
+
|
5 |
+
Redistribution and use in source and binary forms, with or without modification, are permitted
|
6 |
+
provided that the following conditions are met:
|
7 |
+
|
8 |
+
* Redistributions of source code must retain the above copyright notice,
|
9 |
+
this list of conditions and the following disclaimer.
|
10 |
+
|
11 |
+
* Redistributions in binary form must reproduce the above copyright notice,
|
12 |
+
this list of conditions and the following disclaimer in the documentation and/or other
|
13 |
+
materials provided with the distribution.
|
14 |
+
|
15 |
+
* Neither the name of the kminek.pl & Grzegorz Wójcik nor the names of its contributors
|
16 |
+
may be used to endorse or promote products derived from this software without
|
17 |
+
specific prior written permission.
|
18 |
+
|
19 |
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
20 |
+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
21 |
+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
22 |
+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
23 |
+
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
24 |
+
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
25 |
+
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
26 |
+
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
27 |
+
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
28 |
+
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
29 |
+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
admin/assets/js/yetii/html5.min.js
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*
|
2 |
+
HTML5 Shiv v3.7.0 | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed
|
3 |
+
*/
|
4 |
+
(function(l,f){function m(){var a=e.elements;return"string"==typeof a?a.split(" "):a}function i(a){var b=n[a[o]];b||(b={},h++,a[o]=h,n[h]=b);return b}function p(a,b,c){b||(b=f);if(g)return b.createElement(a);c||(c=i(b));b=c.cache[a]?c.cache[a].cloneNode():r.test(a)?(c.cache[a]=c.createElem(a)).cloneNode():c.createElem(a);return b.canHaveChildren&&!s.test(a)?c.frag.appendChild(b):b}function t(a,b){if(!b.cache)b.cache={},b.createElem=a.createElement,b.createFrag=a.createDocumentFragment,b.frag=b.createFrag();
|
5 |
+
a.createElement=function(c){return!e.shivMethods?b.createElem(c):p(c,a,b)};a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+m().join().replace(/[\w\-]+/g,function(a){b.createElem(a);b.frag.createElement(a);return'c("'+a+'")'})+");return n}")(e,b.frag)}function q(a){a||(a=f);var b=i(a);if(e.shivCSS&&!j&&!b.hasCSS){var c,d=a;c=d.createElement("p");d=d.getElementsByTagName("head")[0]||d.documentElement;c.innerHTML="x<style>article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}template{display:none}</style>";
|
6 |
+
c=d.insertBefore(c.lastChild,d.firstChild);b.hasCSS=!!c}g||t(a,b);return a}var k=l.html5||{},s=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,r=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,j,o="_html5shiv",h=0,n={},g;(function(){try{var a=f.createElement("a");a.innerHTML="<xyz></xyz>";j="hidden"in a;var b;if(!(b=1==a.childNodes.length)){f.createElement("a");var c=f.createDocumentFragment();b="undefined"==typeof c.cloneNode||
|
7 |
+
"undefined"==typeof c.createDocumentFragment||"undefined"==typeof c.createElement}g=b}catch(d){g=j=!0}})();var e={elements:k.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output progress section summary template time video",version:"3.7.0",shivCSS:!1!==k.shivCSS,supportsUnknownElements:g,shivMethods:!1!==k.shivMethods,type:"default",shivDocument:q,createElement:p,createDocumentFragment:function(a,b){a||(a=f);
|
8 |
+
if(g)return a.createDocumentFragment();for(var b=b||i(a),c=b.frag.cloneNode(),d=0,e=m(),h=e.length;d<h;d++)c.createElement(e[d]);return c}};l.html5=e;q(f)})(this,document);
|
admin/assets/js/yetii/yetii.js
ADDED
@@ -0,0 +1,207 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*
|
2 |
+
Yetii - Yet (E)Another Tab Interface Implementation
|
3 |
+
version 1.6
|
4 |
+
http://www.kminek.pl/lab/yetii/
|
5 |
+
Copyright (c) Grzegorz Wojcik
|
6 |
+
Code licensed under the BSD License:
|
7 |
+
http://www.kminek.pl/bsdlicense.txt
|
8 |
+
*/
|
9 |
+
|
10 |
+
function Yetii() {
|
11 |
+
|
12 |
+
this.defaults = {
|
13 |
+
|
14 |
+
id: null,
|
15 |
+
active: 1,
|
16 |
+
interval: null,
|
17 |
+
wait: null,
|
18 |
+
persist: null,
|
19 |
+
tabclass: 'tab',
|
20 |
+
activeclass: 'active',
|
21 |
+
callback: null,
|
22 |
+
leavecallback: null
|
23 |
+
|
24 |
+
};
|
25 |
+
|
26 |
+
this.activebackup = null;
|
27 |
+
|
28 |
+
for (var n in arguments[0]) { this.defaults[n]=arguments[0][n]; };
|
29 |
+
|
30 |
+
this.getTabs = function() {
|
31 |
+
|
32 |
+
var retnode = [];
|
33 |
+
var elem = document.getElementById(this.defaults.id).getElementsByTagName('*');
|
34 |
+
|
35 |
+
var regexp = new RegExp("(^|\\s)" + this.defaults.tabclass.replace(/\-/g, "\\-") + "(\\s|$)");
|
36 |
+
|
37 |
+
for (var i = 0; i < elem.length; i++) {
|
38 |
+
if (regexp.test(elem[i].className)) retnode.push(elem[i]);
|
39 |
+
}
|
40 |
+
|
41 |
+
return retnode;
|
42 |
+
|
43 |
+
};
|
44 |
+
|
45 |
+
this.links = document.getElementById(this.defaults.id + '-nav').getElementsByTagName('a');
|
46 |
+
this.listitems = document.getElementById(this.defaults.id + '-nav').getElementsByTagName('li');
|
47 |
+
|
48 |
+
this.show = function(number) {
|
49 |
+
|
50 |
+
for (var i = 0; i < this.tabs.length; i++) {
|
51 |
+
|
52 |
+
this.tabs[i].style.display = ((i+1)==number) ? 'block' : 'none';
|
53 |
+
|
54 |
+
if ((i+1)==number) {
|
55 |
+
this.addClass(this.links[i], this.defaults.activeclass);
|
56 |
+
this.addClass(this.listitems[i], this.defaults.activeclass + 'li');
|
57 |
+
} else {
|
58 |
+
this.removeClass(this.links[i], this.defaults.activeclass);
|
59 |
+
this.removeClass(this.listitems[i], this.defaults.activeclass + 'li');
|
60 |
+
}
|
61 |
+
|
62 |
+
}
|
63 |
+
|
64 |
+
|
65 |
+
if (this.defaults.leavecallback && (number != this.activebackup)) this.defaults.leavecallback(this.defaults.active);
|
66 |
+
|
67 |
+
this.activebackup = number;
|
68 |
+
|
69 |
+
|
70 |
+
this.defaults.active = number;
|
71 |
+
|
72 |
+
if (this.defaults.callback) this.defaults.callback(number);
|
73 |
+
|
74 |
+
|
75 |
+
};
|
76 |
+
|
77 |
+
this.rotate = function(interval) {
|
78 |
+
|
79 |
+
this.show(this.defaults.active);
|
80 |
+
this.defaults.active++;
|
81 |
+
|
82 |
+
if (this.defaults.active > this.tabs.length) this.defaults.active = 1;
|
83 |
+
|
84 |
+
|
85 |
+
var self = this;
|
86 |
+
|
87 |
+
if (this.defaults.wait) clearTimeout(this.timer2);
|
88 |
+
|
89 |
+
this.timer1 = setTimeout(function(){self.rotate(interval);}, interval*1000);
|
90 |
+
|
91 |
+
};
|
92 |
+
|
93 |
+
this.next = function() {
|
94 |
+
|
95 |
+
var _target = (this.defaults.active + 1 > this.tabs.length) ? 1 : this.defaults.active + 1;
|
96 |
+
this.show(_target);
|
97 |
+
this.defaults.active = _target;
|
98 |
+
|
99 |
+
};
|
100 |
+
|
101 |
+
this.previous = function() {
|
102 |
+
|
103 |
+
var _target = ((this.defaults.active - 1) == 0) ? this.tabs.length : this.defaults.active - 1;
|
104 |
+
this.show(_target);
|
105 |
+
this.defaults.active = _target;
|
106 |
+
|
107 |
+
};
|
108 |
+
|
109 |
+
this.previous = function() {
|
110 |
+
|
111 |
+
this.defaults.active--;
|
112 |
+
if(!this.defaults.active) this.defaults.active = this.tabs.length;
|
113 |
+
this.show(this.defaults.active);
|
114 |
+
|
115 |
+
};
|
116 |
+
|
117 |
+
this.gup = function(name) {
|
118 |
+
name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
|
119 |
+
var regexS = "[\\?&]"+name+"=([^&#]*)";
|
120 |
+
var regex = new RegExp( regexS );
|
121 |
+
var results = regex.exec( window.location.href );
|
122 |
+
if (results == null) return null;
|
123 |
+
else return results[1];
|
124 |
+
};
|
125 |
+
|
126 |
+
this.parseurl = function(tabinterfaceid) {
|
127 |
+
|
128 |
+
var result = this.gup(tabinterfaceid);
|
129 |
+
|
130 |
+
if (result==null) return null;
|
131 |
+
if (parseInt(result)) return parseInt(result);
|
132 |
+
if (document.getElementById(result)) {
|
133 |
+
for (var i=0;i<this.tabs.length;i++) {
|
134 |
+
if (this.tabs[i].id == result) return (i+1);
|
135 |
+
}
|
136 |
+
}
|
137 |
+
|
138 |
+
return null;
|
139 |
+
|
140 |
+
};
|
141 |
+
|
142 |
+
this.createCookie = function(name,value,days) {
|
143 |
+
if (days) {
|
144 |
+
var date = new Date();
|
145 |
+
date.setTime(date.getTime()+(days*24*60*60*1000));
|
146 |
+
var expires = "; expires="+date.toGMTString();
|
147 |
+
}
|
148 |
+
else var expires = "";
|
149 |
+
document.cookie = name+"="+value+expires+"; path=/";
|
150 |
+
};
|
151 |
+
|
152 |
+
this.readCookie = function(name) {
|
153 |
+
var nameEQ = name + "=";
|
154 |
+
var ca = document.cookie.split(';');
|
155 |
+
for(var i=0;i < ca.length;i++) {
|
156 |
+
var c = ca[i];
|
157 |
+
while (c.charAt(0)==' ') c = c.substring(1,c.length);
|
158 |
+
if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
|
159 |
+
}
|
160 |
+
return null;
|
161 |
+
};
|
162 |
+
|
163 |
+
this.contains = function(el, item, from) {
|
164 |
+
return el.indexOf(item, from) != -1;
|
165 |
+
};
|
166 |
+
|
167 |
+
this.hasClass = function(el, className){
|
168 |
+
return this.contains(el.className, className, ' ');
|
169 |
+
};
|
170 |
+
|
171 |
+
this.addClass = function(el, className){
|
172 |
+
if (!this.hasClass(el, className)) el.className = (el.className + ' ' + className).replace(/\s{2,}/g, ' ').replace(/^\s+|\s+$/g, '');
|
173 |
+
};
|
174 |
+
|
175 |
+
this.removeClass = function(el, className){
|
176 |
+
el.className = el.className.replace(new RegExp('(^|\\s)' + className + '(?:\\s|$)'), '$1');
|
177 |
+
el.className.replace(/\s{2,}/g, ' ').replace(/^\s+|\s+$/g, '');
|
178 |
+
};
|
179 |
+
|
180 |
+
|
181 |
+
this.tabs = this.getTabs();
|
182 |
+
this.defaults.active = (this.parseurl(this.defaults.id)) ? this.parseurl(this.defaults.id) : this.defaults.active;
|
183 |
+
if (this.defaults.persist && this.readCookie(this.defaults.id)) this.defaults.active = this.readCookie(this.defaults.id);
|
184 |
+
this.activebackup = this.defaults.active;
|
185 |
+
this.show(this.defaults.active);
|
186 |
+
|
187 |
+
var self = this;
|
188 |
+
for (var i = 0; i < this.links.length; i++) {
|
189 |
+
this.links[i].customindex = i+1;
|
190 |
+
this.links[i].onclick = function(){
|
191 |
+
|
192 |
+
if (self.timer1) clearTimeout(self.timer1);
|
193 |
+
if (self.timer2) clearTimeout(self.timer2);
|
194 |
+
|
195 |
+
self.show(this.customindex);
|
196 |
+
|
197 |
+
if (self.defaults.persist) self.createCookie(self.defaults.id, this.customindex, 0);
|
198 |
+
|
199 |
+
if (self.defaults.wait) self.timer2 = setTimeout(function(){self.rotate(self.defaults.interval);}, self.defaults.wait*1000);
|
200 |
+
|
201 |
+
return false;
|
202 |
+
};
|
203 |
+
}
|
204 |
+
|
205 |
+
if (this.defaults.interval) this.rotate(this.defaults.interval);
|
206 |
+
|
207 |
+
};
|
admin/assets/js/yetii/yetii.min.js
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
1 |
+
function Yetii(){this.defaults={id:null,active:1,interval:null,wait:null,persist:null,tabclass:"tab",activeclass:"active",callback:null,leavecallback:null};this.activebackup=null;for(var c in arguments[0]){this.defaults[c]=arguments[0][c]}this.getTabs=function(){var d=[];var f=document.getElementById(this.defaults.id).getElementsByTagName("*");var g=new RegExp("(^|\\s)"+this.defaults.tabclass.replace(/\-/g,"\\-")+"(\\s|$)");for(var e=0;e<f.length;e++){if(g.test(f[e].className)){d.push(f[e])}}return d};this.links=document.getElementById(this.defaults.id+"-nav").getElementsByTagName("a");this.listitems=document.getElementById(this.defaults.id+"-nav").getElementsByTagName("li");this.show=function(e){for(var d=0;d<this.tabs.length;d++){this.tabs[d].style.display=((d+1)==e)?"block":"none";if((d+1)==e){this.addClass(this.links[d],this.defaults.activeclass);this.addClass(this.listitems[d],this.defaults.activeclass+"li")}else{this.removeClass(this.links[d],this.defaults.activeclass);this.removeClass(this.listitems[d],this.defaults.activeclass+"li")
|
2 |
+
}}if(this.defaults.leavecallback&&(e!=this.activebackup)){this.defaults.leavecallback(this.defaults.active)}this.activebackup=e;this.defaults.active=e;if(this.defaults.callback){this.defaults.callback(e)}};this.rotate=function(e){this.show(this.defaults.active);this.defaults.active++;if(this.defaults.active>this.tabs.length){this.defaults.active=1}var d=this;if(this.defaults.wait){clearTimeout(this.timer2)}this.timer1=setTimeout(function(){d.rotate(e)},e*1000)};this.next=function(){var d=(this.defaults.active+1>this.tabs.length)?1:this.defaults.active+1;this.show(d);this.defaults.active=d};this.previous=function(){var d=((this.defaults.active-1)==0)?this.tabs.length:this.defaults.active-1;this.show(d);this.defaults.active=d};this.previous=function(){this.defaults.active--;if(!this.defaults.active){this.defaults.active=this.tabs.length}this.show(this.defaults.active)};this.gup=function(e){e=e.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var d="[\\?&]"+e+"=([^&#]*)";var g=new RegExp(d);var f=g.exec(window.location.href);
|
3 |
+
if(f==null){return null}else{return f[1]}};this.parseurl=function(f){var d=this.gup(f);if(d==null){return null}if(parseInt(d)){return parseInt(d)}if(document.getElementById(d)){for(var e=0;e<this.tabs.length;e++){if(this.tabs[e].id==d){return(e+1)}}}return null};this.createCookie=function(f,g,h){if(h){var e=new Date();e.setTime(e.getTime()+(h*24*60*60*1000));var d="; expires="+e.toGMTString()}else{var d=""}document.cookie=f+"="+g+d+"; path=/"};this.readCookie=function(e){var g=e+"=";var d=document.cookie.split(";");for(var f=0;f<d.length;f++){var h=d[f];while(h.charAt(0)==" "){h=h.substring(1,h.length)}if(h.indexOf(g)==0){return h.substring(g.length,h.length)}}return null};this.contains=function(d,e,f){return d.indexOf(e,f)!=-1};this.hasClass=function(e,d){return this.contains(e.className,d," ")};this.addClass=function(e,d){if(!this.hasClass(e,d)){e.className=(e.className+" "+d).replace(/\s{2,}/g," ").replace(/^\s+|\s+$/g,"")}};this.removeClass=function(e,d){e.className=e.className.replace(new RegExp("(^|\\s)"+d+"(?:\\s|$)"),"$1");
|
4 |
+
e.className.replace(/\s{2,}/g," ").replace(/^\s+|\s+$/g,"")};this.tabs=this.getTabs();this.defaults.active=(this.parseurl(this.defaults.id))?this.parseurl(this.defaults.id):this.defaults.active;if(this.defaults.persist&&this.readCookie(this.defaults.id)){this.defaults.active=this.readCookie(this.defaults.id)}this.activebackup=this.defaults.active;this.show(this.defaults.active);var a=this;for(var b=0;b<this.links.length;b++){this.links[b].customindex=b+1;this.links[b].onclick=function(){if(a.timer1){clearTimeout(a.timer1)}if(a.timer2){clearTimeout(a.timer2)}a.show(this.customindex);if(a.defaults.persist){a.createCookie(a.defaults.id,this.customindex,0)}if(a.defaults.wait){a.timer2=setTimeout(function(){a.rotate(a.defaults.interval)},a.defaults.wait*1000)}return false}}if(this.defaults.interval){this.rotate(this.defaults.interval)}};
|
admin/class-tgm-plugin-activation.php
ADDED
@@ -0,0 +1,3625 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Plugin installation and activation for WordPress themes.
|
4 |
+
*
|
5 |
+
* Please note that this is a drop-in library for a theme or plugin.
|
6 |
+
* The authors of this library (Thomas, Gary and Juliette) are NOT responsible
|
7 |
+
* for the support of your plugin or theme. Please contact the plugin
|
8 |
+
* or theme author for support.
|
9 |
+
*
|
10 |
+
*'tgmpa' -> 'weaver-xtreme'
|
11 |
+
*
|
12 |
+
* @package TGM-Plugin-Activation
|
13 |
+
* @version 2.5.2.1
|
14 |
+
* @link http://tgmpluginactivation.com/
|
15 |
+
* @author Thomas Griffin, Gary Jones, Juliette Reinders Folmer
|
16 |
+
* @copyright Copyright (c) 2011, Thomas Griffin
|
17 |
+
* @license GPL-2.0+
|
18 |
+
*
|
19 |
+
* @wordpress-plugin
|
20 |
+
* Plugin Name: TGM Plugin Activation
|
21 |
+
* Plugin URI:
|
22 |
+
* Description: Plugin installation and activation for WordPress themes.
|
23 |
+
* Version: 2.5.2
|
24 |
+
* Author: Thomas Griffin, Gary Jones, Juliette Reinders Folmer
|
25 |
+
* Author URI: http://tgmpluginactivation.com/
|
26 |
+
* Text Domain: tgmpa
|
27 |
+
* Domain Path: /languages/
|
28 |
+
* Copyright: 2011, Thomas Griffin
|
29 |
+
*/
|
30 |
+
|
31 |
+
/*
|
32 |
+
Copyright 2011 Thomas Griffin (thomasgriffinmedia.com)
|
33 |
+
|
34 |
+
This program is free software; you can redistribute it and/or modify
|
35 |
+
it under the terms of the GNU General Public License, version 2, as
|
36 |
+
published by the Free Software Foundation.
|
37 |
+
|
38 |
+
This program is distributed in the hope that it will be useful,
|
39 |
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
40 |
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
41 |
+
GNU General Public License for more details.
|
42 |
+
|
43 |
+
You should have received a copy of the GNU General Public License
|
44 |
+
along with this program; if not, write to the Free Software
|
45 |
+
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
46 |
+
*/
|
47 |
+
|
48 |
+
if ( ! class_exists( 'TGM_Plugin_Activation' ) ) {
|
49 |
+
|
50 |
+
/**
|
51 |
+
* Automatic plugin installation and activation library.
|
52 |
+
*
|
53 |
+
* Creates a way to automatically install and activate plugins from within themes.
|
54 |
+
* The plugins can be either bundled, downloaded from the WordPress
|
55 |
+
* Plugin Repository or downloaded from another external source.
|
56 |
+
*
|
57 |
+
* @since 1.0.0
|
58 |
+
*
|
59 |
+
* @package TGM-Plugin-Activation
|
60 |
+
* @author Thomas Griffin
|
61 |
+
* @author Gary Jones
|
62 |
+
*/
|
63 |
+
class TGM_Plugin_Activation {
|
64 |
+
/**
|
65 |
+
* TGMPA version number.
|
66 |
+
*
|
67 |
+
* @since 2.5.0
|
68 |
+
*
|
69 |
+
* @const string Version number.
|
70 |
+
*/
|
71 |
+
const TGMPA_VERSION = '2.5.2';
|
72 |
+
|
73 |
+
/**
|
74 |
+
* Regular expression to test if a URL is a WP plugin repo URL.
|
75 |
+
*
|
76 |
+
* @const string Regex.
|
77 |
+
*
|
78 |
+
* @since 2.5.0
|
79 |
+
*/
|
80 |
+
const WP_REPO_REGEX = '|^http[s]?://wordpress\.org/(?:extend/)?plugins/|';
|
81 |
+
|
82 |
+
/**
|
83 |
+
* Arbitrary regular expression to test if a string starts with a URL.
|
84 |
+
*
|
85 |
+
* @const string Regex.
|
86 |
+
*
|
87 |
+
* @since 2.5.0
|
88 |
+
*/
|
89 |
+
const IS_URL_REGEX = '|^http[s]?://|';
|
90 |
+
|
91 |
+
/**
|
92 |
+
* Holds a copy of itself, so it can be referenced by the class name.
|
93 |
+
*
|
94 |
+
* @since 1.0.0
|
95 |
+
*
|
96 |
+
* @var TGM_Plugin_Activation
|
97 |
+
*/
|
98 |
+
public static $instance;
|
99 |
+
|
100 |
+
/**
|
101 |
+
* Holds arrays of plugin details.
|
102 |
+
*
|
103 |
+
* @since 1.0.0
|
104 |
+
*
|
105 |
+
* @since 2.5.0 the array has the plugin slug as an associative key.
|
106 |
+
*
|
107 |
+
* @var array
|
108 |
+
*/
|
109 |
+
public $plugins = array();
|
110 |
+
|
111 |
+
/**
|
112 |
+
* Holds arrays of plugin names to use to sort the plugins array.
|
113 |
+
*
|
114 |
+
* @since 2.5.0
|
115 |
+
*
|
116 |
+
* @var array
|
117 |
+
*/
|
118 |
+
protected $sort_order = array();
|
119 |
+
|
120 |
+
/**
|
121 |
+
* Whether any plugins have the 'force_activation' setting set to true.
|
122 |
+
*
|
123 |
+
* @since 2.5.0
|
124 |
+
*
|
125 |
+
* @var bool
|
126 |
+
*/
|
127 |
+
protected $has_forced_activation = false;
|
128 |
+
|
129 |
+
/**
|
130 |
+
* Whether any plugins have the 'force_deactivation' setting set to true.
|
131 |
+
*
|
132 |
+
* @since 2.5.0
|
133 |
+
*
|
134 |
+
* @var bool
|
135 |
+
*/
|
136 |
+
protected $has_forced_deactivation = false;
|
137 |
+
|
138 |
+
/**
|
139 |
+
* Name of the unique ID to hash notices.
|
140 |
+
*
|
141 |
+
* @since 2.4.0
|
142 |
+
*
|
143 |
+
* @var string
|
144 |
+
*/
|
145 |
+
public $id = 'tgmpa';
|
146 |
+
|
147 |
+
/**
|
148 |
+
* Name of the query-string argument for the admin page.
|
149 |
+
*
|
150 |
+
* @since 1.0.0
|
151 |
+
*
|
152 |
+
* @var string
|
153 |
+
*/
|
154 |
+
protected $menu = 'tgmpa-install-plugins';
|
155 |
+
|
156 |
+
/**
|
157 |
+
* Parent menu file slug.
|
158 |
+
*
|
159 |
+
* @since 2.5.0
|
160 |
+
*
|
161 |
+
* @var string
|
162 |
+
*/
|
163 |
+
public $parent_slug = 'themes.php';
|
164 |
+
|
165 |
+
/**
|
166 |
+
* Capability needed to view the plugin installation menu item.
|
167 |
+
*
|
168 |
+
* @since 2.5.0
|
169 |
+
*
|
170 |
+
* @var string
|
171 |
+
*/
|
172 |
+
public $capability = 'edit_theme_options';
|
173 |
+
|
174 |
+
/**
|
175 |
+
* Default absolute path to folder containing bundled plugin zip files.
|
176 |
+
*
|
177 |
+
* @since 2.0.0
|
178 |
+
*
|
179 |
+
* @var string Absolute path prefix to zip file location for bundled plugins. Default is empty string.
|
180 |
+
*/
|
181 |
+
public $default_path = '';
|
182 |
+
|
183 |
+
/**
|
184 |
+
* Flag to show admin notices or not.
|
185 |
+
*
|
186 |
+
* @since 2.1.0
|
187 |
+
*
|
188 |
+
* @var boolean
|
189 |
+
*/
|
190 |
+
public $has_notices = true;
|
191 |
+
|
192 |
+
/**
|
193 |
+
* Flag to determine if the user can dismiss the notice nag.
|
194 |
+
*
|
195 |
+
* @since 2.4.0
|
196 |
+
*
|
197 |
+
* @var boolean
|
198 |
+
*/
|
199 |
+
public $dismissable = true;
|
200 |
+
|
201 |
+
/**
|
202 |
+
* Message to be output above nag notice if dismissable is false.
|
203 |
+
*
|
204 |
+
* @since 2.4.0
|
205 |
+
*
|
206 |
+
* @var string
|
207 |
+
*/
|
208 |
+
public $dismiss_msg = '';
|
209 |
+
|
210 |
+
/**
|
211 |
+
* Flag to set automatic activation of plugins. Off by default.
|
212 |
+
*
|
213 |
+
* @since 2.2.0
|
214 |
+
*
|
215 |
+
* @var boolean
|
216 |
+
*/
|
217 |
+
public $is_automatic = false;
|
218 |
+
|
219 |
+
/**
|
220 |
+
* Optional message to display before the plugins table.
|
221 |
+
*
|
222 |
+
* @since 2.2.0
|
223 |
+
*
|
224 |
+
* @var string Message filtered by wp_kses_post(). Default is empty string.
|
225 |
+
*/
|
226 |
+
public $message = '';
|
227 |
+
|
228 |
+
/**
|
229 |
+
* Holds configurable array of strings.
|
230 |
+
*
|
231 |
+
* Default values are added in the constructor.
|
232 |
+
*
|
233 |
+
* @since 2.0.0
|
234 |
+
*
|
235 |
+
* @var array
|
236 |
+
*/
|
237 |
+
public $strings = array();
|
238 |
+
|
239 |
+
/**
|
240 |
+
* Holds the version of WordPress.
|
241 |
+
*
|
242 |
+
* @since 2.4.0
|
243 |
+
*
|
244 |
+
* @var int
|
245 |
+
*/
|
246 |
+
public $wp_version;
|
247 |
+
|
248 |
+
/**
|
249 |
+
* Holds the hook name for the admin page.
|
250 |
+
*
|
251 |
+
* @since 2.5.0
|
252 |
+
*
|
253 |
+
* @var string
|
254 |
+
*/
|
255 |
+
public $page_hook;
|
256 |
+
|
257 |
+
/**
|
258 |
+
* Adds a reference of this object to $instance, populates default strings,
|
259 |
+
* does the tgmpa_init action hook, and hooks in the interactions to init.
|
260 |
+
*
|
261 |
+
* @internal This method should be `protected`, but as too many TGMPA implementations
|
262 |
+
* haven't upgraded beyond v2.3.6 yet, this gives backward compatibility issues.
|
263 |
+
* Reverted back to public for the time being.
|
264 |
+
*
|
265 |
+
* @since 1.0.0
|
266 |
+
*
|
267 |
+
* @see TGM_Plugin_Activation::init()
|
268 |
+
*/
|
269 |
+
public function __construct() {
|
270 |
+
// Set the current WordPress version.
|
271 |
+
$this->wp_version = $GLOBALS['wp_version'];
|
272 |
+
|
273 |
+
// Announce that the class is ready, and pass the object (for advanced use).
|
274 |
+
do_action_ref_array( 'tgmpa_init', array( $this ) );
|
275 |
+
|
276 |
+
// When the rest of WP has loaded, kick-start the rest of the class.
|
277 |
+
add_action( 'init', array( $this, 'init' ) );
|
278 |
+
}
|
279 |
+
|
280 |
+
/**
|
281 |
+
* Magic method to (not) set protected properties from outside of this class.
|
282 |
+
*
|
283 |
+
* @internal hackedihack... There is a serious bug in v2.3.2 - 2.3.6 where the `menu` property
|
284 |
+
* is being assigned rather than tested in a conditional, effectively rendering it useless.
|
285 |
+
* This 'hack' prevents this from happening.
|
286 |
+
*
|
287 |
+
* @see https://github.com/TGMPA/TGM-Plugin-Activation/blob/2.3.6/tgm-plugin-activation/class-tgm-plugin-activation.php#L1593
|
288 |
+
*
|
289 |
+
* @param string $name Name of an inaccessible property.
|
290 |
+
* @param mixed $value Value to assign to the property.
|
291 |
+
* @return void Silently fail to set the property when this is tried from outside of this class context.
|
292 |
+
* (Inside this class context, the __set() method if not used as there is direct access.)
|
293 |
+
*/
|
294 |
+
public function __set( $name, $value ) {
|
295 |
+
return;
|
296 |
+
}
|
297 |
+
|
298 |
+
/**
|
299 |
+
* Magic method to get the value of a protected property outside of this class context.
|
300 |
+
*
|
301 |
+
* @param string $name Name of an inaccessible property.
|
302 |
+
* @return mixed The property value.
|
303 |
+
*/
|
304 |
+
public function __get( $name ) {
|
305 |
+
return $this->{$name};
|
306 |
+
}
|
307 |
+
|
308 |
+
/**
|
309 |
+
* Initialise the interactions between this class and WordPress.
|
310 |
+
*
|
311 |
+
* Hooks in three new methods for the class: admin_menu, notices and styles.
|
312 |
+
*
|
313 |
+
* @since 2.0.0
|
314 |
+
*
|
315 |
+
* @see TGM_Plugin_Activation::admin_menu()
|
316 |
+
* @see TGM_Plugin_Activation::notices()
|
317 |
+
* @see TGM_Plugin_Activation::styles()
|
318 |
+
*/
|
319 |
+
public function init() {
|
320 |
+
/**
|
321 |
+
* By default TGMPA only loads on the WP back-end and not in an Ajax call. Using this filter
|
322 |
+
* you can overrule that behaviour.
|
323 |
+
*
|
324 |
+
* @since 2.5.0
|
325 |
+
*
|
326 |
+
* @param bool $load Whether or not TGMPA should load.
|
327 |
+
* Defaults to the return of `is_admin() && ! defined( 'DOING_AJAX' )`.
|
328 |
+
*/
|
329 |
+
if ( true !== apply_filters( 'tgmpa_load', ( is_admin() && ! defined( 'DOING_AJAX' ) ) ) ) {
|
330 |
+
return;
|
331 |
+
}
|
332 |
+
|
333 |
+
// Load class strings.
|
334 |
+
$this->strings = array(
|
335 |
+
'page_title' => __( 'Install Required Plugins', 'weaver-xtreme' ),
|
336 |
+
'menu_title' => __( 'Install Plugins', 'weaver-xtreme' ),
|
337 |
+
'installing' => __( 'Installing Plugin: %s', 'weaver-xtreme' ),
|
338 |
+
'oops' => __( 'Something went wrong with the plugin API.', 'weaver-xtreme' ),
|
339 |
+
'notice_can_install_required' => _n_noop(
|
340 |
+
'This theme requires the following plugin: %1$s.',
|
341 |
+
'This theme requires the following plugins: %1$s.',
|
342 |
+
'weaver-xtreme'
|
343 |
+
),
|
344 |
+
'notice_can_install_recommended' => _n_noop(
|
345 |
+
'This theme recommends the following plugin: %1$s.',
|
346 |
+
'This theme recommends the following plugins: %1$s.',
|
347 |
+
'weaver-xtreme'
|
348 |
+
),
|
349 |
+
'notice_cannot_install' => _n_noop(
|
350 |
+
'Sorry, but you do not have the correct permissions to install the %1$s plugin.',
|
351 |
+
'Sorry, but you do not have the correct permissions to install the %1$s plugins.',
|
352 |
+
'weaver-xtreme'
|
353 |
+
),
|
354 |
+
'notice_ask_to_update' => _n_noop(
|
355 |
+
'The following plugin needs to be updated to its latest version to ensure maximum compatibility with this theme: %1$s.',
|
356 |
+
'The following plugins need to be updated to their latest version to ensure maximum compatibility with this theme: %1$s.',
|
357 |
+
'weaver-xtreme'
|
358 |
+
),
|
359 |
+
'notice_ask_to_update_maybe' => _n_noop(
|
360 |
+
'There is an update available for: %1$s.',
|
361 |
+
'There are updates available for the following plugins: %1$s.',
|
362 |
+
'weaver-xtreme'
|
363 |
+
),
|
364 |
+
'notice_cannot_update' => _n_noop(
|
365 |
+
'Sorry, but you do not have the correct permissions to update the %1$s plugin.',
|
366 |
+
'Sorry, but you do not have the correct permissions to update the %1$s plugins.',
|
367 |
+
'weaver-xtreme'
|
368 |
+
),
|
369 |
+
'notice_can_activate_required' => _n_noop(
|
370 |
+
'The following required plugin is currently inactive: %1$s.',
|
371 |
+
'The following required plugins are currently inactive: %1$s.',
|
372 |
+
'weaver-xtreme'
|
373 |
+
),
|
374 |
+
'notice_can_activate_recommended' => _n_noop(
|
375 |
+
'The following recommended plugin is currently inactive: %1$s.',
|
376 |
+
'The following recommended plugins are currently inactive: %1$s.',
|
377 |
+
'weaver-xtreme'
|
378 |
+
),
|
379 |
+
'notice_cannot_activate' => _n_noop(
|
380 |
+
'Sorry, but you do not have the correct permissions to activate the %1$s plugin.',
|
381 |
+
'Sorry, but you do not have the correct permissions to activate the %1$s plugins.',
|
382 |
+
'weaver-xtreme'
|
383 |
+
),
|
384 |
+
'install_link' => _n_noop(
|
385 |
+
'Begin installing plugin',
|
386 |
+
'Begin installing plugins',
|
387 |
+
'weaver-xtreme'
|
388 |
+
),
|
389 |
+
'update_link' => _n_noop(
|
390 |
+
'Begin updating plugin',
|
391 |
+
'Begin updating plugins',
|
392 |
+
'weaver-xtreme'
|
393 |
+
),
|
394 |
+
'activate_link' => _n_noop(
|
395 |
+
'Begin activating plugin',
|
396 |
+
'Begin activating plugins',
|
397 |
+
'weaver-xtreme'
|
398 |
+
),
|
399 |
+
'return' => __( 'Return to Required Plugins Installer', 'weaver-xtreme' ),
|
400 |
+
'dashboard' => __( 'Return to the dashboard', 'weaver-xtreme' ),
|
401 |
+
'plugin_activated' => __( 'Plugin activated successfully.', 'weaver-xtreme' ),
|
402 |
+
'activated_successfully' => __( 'The following plugin was activated successfully:', 'weaver-xtreme' ),
|
403 |
+
'plugin_already_active' => __( 'No action taken. Plugin %1$s was already active.', 'weaver-xtreme' ),
|
404 |
+
'plugin_needs_higher_version' => __( 'Plugin not activated. A higher version of %s is needed for this theme. Please update the plugin.', 'weaver-xtreme' ),
|
405 |
+
'complete' => __( 'All plugins installed and activated successfully. %1$s', 'weaver-xtreme' ),
|
406 |
+
'dismiss' => __( 'Dismiss this notice', 'weaver-xtreme' ),
|
407 |
+
'contact_admin' => __( 'Please contact the administrator of this site for help.', 'weaver-xtreme' ),
|
408 |
+
);
|
409 |
+
|
410 |
+
do_action( 'tgmpa_register' );
|
411 |
+
|
412 |
+
/* After this point, the plugins should be registered and the configuration set. */
|
413 |
+
|
414 |
+
// Proceed only if we have plugins to handle.
|
415 |
+
if ( empty( $this->plugins ) || ! is_array( $this->plugins ) ) {
|
416 |
+
return;
|
417 |
+
}
|
418 |
+
|
419 |
+
// Set up the menu and notices if we still have outstanding actions.
|
420 |
+
if ( true !== $this->is_tgmpa_complete() ) {
|
421 |
+
// Sort the plugins.
|
422 |
+
array_multisort( $this->sort_order, SORT_ASC, $this->plugins );
|
423 |
+
|
424 |
+
add_action( 'admin_menu', array( $this, 'admin_menu' ) );
|
425 |
+
add_action( 'admin_head', array( $this, 'dismiss' ) );
|
426 |
+
|
427 |
+
// Prevent the normal links from showing underneath a single install/update page.
|
428 |
+
add_filter( 'install_plugin_complete_actions', array( $this, 'actions' ) );
|
429 |
+
add_filter( 'update_plugin_complete_actions', array( $this, 'actions' ) );
|
430 |
+
|
431 |
+
if ( $this->has_notices ) {
|
432 |
+
add_action( 'admin_notices', array( $this, 'notices' ) );
|
433 |
+
add_action( 'admin_init', array( $this, 'admin_init' ), 1 );
|
434 |
+
add_action( 'admin_enqueue_scripts', array( $this, 'thickbox' ) );
|
435 |
+
}
|
436 |
+
}
|
437 |
+
|
438 |
+
// If needed, filter plugin action links.
|
439 |
+
add_action( 'load-plugins.php', array( $this, 'add_plugin_action_link_filters' ), 1 );
|
440 |
+
|
441 |
+
// Make sure things get reset on switch theme.
|
442 |
+
add_action( 'switch_theme', array( $this, 'flush_plugins_cache' ) );
|
443 |
+
|
444 |
+
if ( $this->has_notices ) {
|
445 |
+
add_action( 'switch_theme', array( $this, 'update_dismiss' ) );
|
446 |
+
}
|
447 |
+
|
448 |
+
// Setup the force activation hook.
|
449 |
+
if ( true === $this->has_forced_activation ) {
|
450 |
+
add_action( 'admin_init', array( $this, 'force_activation' ) );
|
451 |
+
}
|
452 |
+
|
453 |
+
// Setup the force deactivation hook.
|
454 |
+
if ( true === $this->has_forced_deactivation ) {
|
455 |
+
add_action( 'switch_theme', array( $this, 'force_deactivation' ) );
|
456 |
+
}
|
457 |
+
}
|
458 |
+
|
459 |
+
/**
|
460 |
+
* Hook in plugin action link filters for the WP native plugins page.
|
461 |
+
*
|
462 |
+
* - Prevent activation of plugins which don't meet the minimum version requirements.
|
463 |
+
* - Prevent deactivation of force-activated plugins.
|
464 |
+
* - Add update notice if update available.
|
465 |
+
*
|
466 |
+
* @since 2.5.0
|
467 |
+
*/
|
468 |
+
public function add_plugin_action_link_filters() {
|
469 |
+
foreach ( $this->plugins as $slug => $plugin ) {
|
470 |
+
if ( false === $this->can_plugin_activate( $slug ) ) {
|
471 |
+
add_filter( 'plugin_action_links_' . $plugin['file_path'], array( $this, 'filter_plugin_action_links_activate' ), 20 );
|
472 |
+
}
|
473 |
+
|
474 |
+
if ( true === $plugin['force_activation'] ) {
|
475 |
+
add_filter( 'plugin_action_links_' . $plugin['file_path'], array( $this, 'filter_plugin_action_links_deactivate' ), 20 );
|
476 |
+
}
|
477 |
+
|
478 |
+
if ( false !== $this->does_plugin_require_update( $slug ) ) {
|
479 |
+
add_filter( 'plugin_action_links_' . $plugin['file_path'], array( $this, 'filter_plugin_action_links_update' ), 20 );
|
480 |
+
}
|
481 |
+
}
|
482 |
+
}
|
483 |
+
|
484 |
+
/**
|
485 |
+
* Remove the 'Activate' link on the WP native plugins page if the plugin does not meet the
|
486 |
+
* minimum version requirements.
|
487 |
+
*
|
488 |
+
* @since 2.5.0
|
489 |
+
*
|
490 |
+
* @param array $actions Action links.
|
491 |
+
* @return array
|
492 |
+
*/
|
493 |
+
public function filter_plugin_action_links_activate( $actions ) {
|
494 |
+
unset( $actions['activate'] );
|
495 |
+
|
496 |
+
return $actions;
|
497 |
+
}
|
498 |
+
|
499 |
+
/**
|
500 |
+
* Remove the 'Deactivate' link on the WP native plugins page if the plugin has been set to force activate.
|
501 |
+
*
|
502 |
+
* @since 2.5.0
|
503 |
+
*
|
504 |
+
* @param array $actions Action links.
|
505 |
+
* @return array
|
506 |
+
*/
|
507 |
+
public function filter_plugin_action_links_deactivate( $actions ) {
|
508 |
+
unset( $actions['deactivate'] );
|
509 |
+
|
510 |
+
return $actions;
|
511 |
+
}
|
512 |
+
|
513 |
+
/**
|
514 |
+
* Add a 'Requires update' link on the WP native plugins page if the plugin does not meet the
|
515 |
+
* minimum version requirements.
|
516 |
+
*
|
517 |
+
* @since 2.5.0
|
518 |
+
*
|
519 |
+
* @param array $actions Action links.
|
520 |
+
* @return array
|
521 |
+
*/
|
522 |
+
public function filter_plugin_action_links_update( $actions ) {
|
523 |
+
$actions['update'] = sprintf(
|
524 |
+
'<a href="%1$s" title="%2$s" class="edit">%3$s</a>',
|
525 |
+
esc_url( $this->get_tgmpa_status_url( 'update' ) ),
|
526 |
+
esc_attr__( 'This plugin needs to be updated to be compatible with your theme.', 'weaver-xtreme' ),
|
527 |
+
esc_html__( 'Update Required', 'weaver-xtreme' )
|
528 |
+
);
|
529 |
+
|
530 |
+
return $actions;
|
531 |
+
}
|
532 |
+
|
533 |
+
/**
|
534 |
+
* Handles calls to show plugin information via links in the notices.
|
535 |
+
*
|
536 |
+
* We get the links in the admin notices to point to the TGMPA page, rather
|
537 |
+
* than the typical plugin-install.php file, so we can prepare everything
|
538 |
+
* beforehand.
|
539 |
+
*
|
540 |
+
* WP does not make it easy to show the plugin information in the thickbox -
|
541 |
+
* here we have to require a file that includes a function that does the
|
542 |
+
* main work of displaying it, enqueue some styles, set up some globals and
|
543 |
+
* finally call that function before exiting.
|
544 |
+
*
|
545 |
+
* Down right easy once you know how...
|
546 |
+
*
|
547 |
+
* Returns early if not the TGMPA page.
|
548 |
+
*
|
549 |
+
* @since 2.1.0
|
550 |
+
*
|
551 |
+
* @global string $tab Used as iframe div class names, helps with styling
|
552 |
+
* @global string $body_id Used as the iframe body ID, helps with styling
|
553 |
+
*
|
554 |
+
* @return null Returns early if not the TGMPA page.
|
555 |
+
*/
|
556 |
+
public function admin_init() {
|
557 |
+
if ( ! $this->is_tgmpa_page() ) {
|
558 |
+
return;
|
559 |
+
}
|
560 |
+
|
561 |
+
if ( isset( $_REQUEST['tab'] ) && 'plugin-information' === $_REQUEST['tab'] ) {
|
562 |
+
// Needed for install_plugin_information().
|
563 |
+
require_once ABSPATH . 'wp-admin/includes/plugin-install.php';
|
564 |
+
|
565 |
+
wp_enqueue_style( 'plugin-install' );
|
566 |
+
|
567 |
+
global $tab, $body_id;
|
568 |
+
$body_id = 'plugin-information';
|
569 |
+
// @codingStandardsIgnoreStart
|
570 |
+
$tab = 'plugin-information';
|
571 |
+
// @codingStandardsIgnoreEnd
|
572 |
+
|
573 |
+
install_plugin_information();
|
574 |
+
|
575 |
+
exit;
|
576 |
+
}
|
577 |
+
}
|
578 |
+
|
579 |
+
/**
|
580 |
+
* Enqueue thickbox scripts/styles for plugin info.
|
581 |
+
*
|
582 |
+
* Thickbox is not automatically included on all admin pages, so we must
|
583 |
+
* manually enqueue it for those pages.
|
584 |
+
*
|
585 |
+
* Thickbox is only loaded if the user has not dismissed the admin
|
586 |
+
* notice or if there are any plugins left to install and activate.
|
587 |
+
*
|
588 |
+
* @since 2.1.0
|
589 |
+
*/
|
590 |
+
public function thickbox() {
|
591 |
+
if ( ! get_user_meta( get_current_user_id(), 'tgmpa_dismissed_notice_' . $this->id, true ) ) {
|
592 |
+
add_thickbox();
|
593 |
+
}
|
594 |
+
}
|
595 |
+
|
596 |
+
/**
|
597 |
+
* Adds submenu page if there are plugin actions to take.
|
598 |
+
*
|
599 |
+
* This method adds the submenu page letting users know that a required
|
600 |
+
* plugin needs to be installed.
|
601 |
+
*
|
602 |
+
* This page disappears once the plugin has been installed and activated.
|
603 |
+
*
|
604 |
+
* @since 1.0.0
|
605 |
+
*
|
606 |
+
* @see TGM_Plugin_Activation::init()
|
607 |
+
* @see TGM_Plugin_Activation::install_plugins_page()
|
608 |
+
*
|
609 |
+
* @return null Return early if user lacks capability to install a plugin.
|
610 |
+
*/
|
611 |
+
public function admin_menu() {
|
612 |
+
// Make sure privileges are correct to see the page.
|
613 |
+
if ( ! current_user_can( 'install_plugins' ) ) {
|
614 |
+
return;
|
615 |
+
}
|
616 |
+
|
617 |
+
$args = apply_filters(
|
618 |
+
'tgmpa_admin_menu_args',
|
619 |
+
array(
|
620 |
+
'parent_slug' => $this->parent_slug, // Parent Menu slug.
|
621 |
+
'page_title' => $this->strings['page_title'], // Page title.
|
622 |
+
'menu_title' => $this->strings['menu_title'], // Menu title.
|
623 |
+
'capability' => $this->capability, // Capability.
|
624 |
+
'menu_slug' => $this->menu, // Menu slug.
|
625 |
+
'function' => array( $this, 'install_plugins_page' ), // Callback.
|
626 |
+
)
|
627 |
+
);
|
628 |
+
|
629 |
+
$this->add_admin_menu( $args );
|
630 |
+
}
|
631 |
+
|
632 |
+
/**
|
633 |
+
* Add the menu item.
|
634 |
+
*
|
635 |
+
* @since 2.5.0
|
636 |
+
*
|
637 |
+
* @param array $args Menu item configuration.
|
638 |
+
*/
|
639 |
+
protected function add_admin_menu( array $args ) {
|
640 |
+
if ( has_filter( 'tgmpa_admin_menu_use_add_theme_page' ) ) {
|
641 |
+
_deprecated_function( 'The "tgmpa_admin_menu_use_add_theme_page" filter', '2.5.0', esc_html__( 'Set the parent_slug config variable instead.', 'weaver-xtreme' ) );
|
642 |
+
}
|
643 |
+
|
644 |
+
if ( 'themes.php' === $this->parent_slug ) {
|
645 |
+
$this->page_hook = call_user_func( 'add_theme_page', $args['page_title'], $args['menu_title'], $args['capability'], $args['menu_slug'], $args['function'] );
|
646 |
+
} else {
|
647 |
+
$type = 'submenu';
|
648 |
+
$this->page_hook = call_user_func( "add_{$type}_page", $args['parent_slug'], $args['page_title'], $args['menu_title'], $args['capability'], $args['menu_slug'], $args['function'] );
|
649 |
+
}
|
650 |
+
}
|
651 |
+
|
652 |
+
/**
|
653 |
+
* Echoes plugin installation form.
|
654 |
+
*
|
655 |
+
* This method is the callback for the admin_menu method function.
|
656 |
+
* This displays the admin page and form area where the user can select to install and activate the plugin.
|
657 |
+
* Aborts early if we're processing a plugin installation action.
|
658 |
+
*
|
659 |
+
* @since 1.0.0
|
660 |
+
*
|
661 |
+
* @return null Aborts early if we're processing a plugin installation action.
|
662 |
+
*/
|
663 |
+
public function install_plugins_page() {
|
664 |
+
// Store new instance of plugin table in object.
|
665 |
+
$plugin_table = new TGMPA_List_Table;
|
666 |
+
|
667 |
+
// Return early if processing a plugin installation action.
|
668 |
+
if ( ( ( 'tgmpa-bulk-install' === $plugin_table->current_action() || 'tgmpa-bulk-update' === $plugin_table->current_action() ) && $plugin_table->process_bulk_actions() ) || $this->do_plugin_install() ) {
|
669 |
+
return;
|
670 |
+
}
|
671 |
+
|
672 |
+
// Force refresh of available plugin information so we'll know about manual updates/deletes.
|
673 |
+
wp_clean_plugins_cache( false );
|
674 |
+
|
675 |
+
?>
|
676 |
+
<div class="tgmpa wrap">
|
677 |
+
<h2><?php echo esc_html( get_admin_page_title() ); ?></h2>
|
678 |
+
<?php $plugin_table->prepare_items(); ?>
|
679 |
+
|
680 |
+
<?php
|
681 |
+
if ( ! empty( $this->message ) && is_string( $this->message ) ) {
|
682 |
+
echo wp_kses_post( $this->message );
|
683 |
+
}
|
684 |
+
?>
|
685 |
+
<?php $plugin_table->views(); ?>
|
686 |
+
|
687 |
+
<form id="tgmpa-plugins" action="" method="post">
|
688 |
+
<input type="hidden" name="tgmpa-page" value="<?php echo esc_attr( $this->menu ); ?>" />
|
689 |
+
<input type="hidden" name="plugin_status" value="<?php echo esc_attr( $plugin_table->view_context ); ?>" />
|
690 |
+
<?php $plugin_table->display(); ?>
|
691 |
+
</form>
|
692 |
+
</div>
|
693 |
+
<?php
|
694 |
+
}
|
695 |
+
|
696 |
+
/**
|
697 |
+
* Installs, updates or activates a plugin depending on the action link clicked by the user.
|
698 |
+
*
|
699 |
+
* Checks the $_GET variable to see which actions have been
|
700 |
+
* passed and responds with the appropriate method.
|
701 |
+
*
|
702 |
+
* Uses WP_Filesystem to process and handle the plugin installation
|
703 |
+
* method.
|
704 |
+
*
|
705 |
+
* @since 1.0.0
|
706 |
+
*
|
707 |
+
* @uses WP_Filesystem
|
708 |
+
* @uses WP_Error
|
709 |
+
* @uses WP_Upgrader
|
710 |
+
* @uses Plugin_Upgrader
|
711 |
+
* @uses Plugin_Installer_Skin
|
712 |
+
* @uses Plugin_Upgrader_Skin
|
713 |
+
*
|
714 |
+
* @return boolean True on success, false on failure.
|
715 |
+
*/
|
716 |
+
protected function do_plugin_install() {
|
717 |
+
if ( empty( $_GET['plugin'] ) ) {
|
718 |
+
return false;
|
719 |
+
}
|
720 |
+
|
721 |
+
// All plugin information will be stored in an array for processing.
|
722 |
+
$slug = $this->sanitize_key( urldecode( $_GET['plugin'] ) );
|
723 |
+
|
724 |
+
if ( ! isset( $this->plugins[ $slug ] ) ) {
|
725 |
+
return false;
|
726 |
+
}
|
727 |
+
|
728 |
+
// Was an install or upgrade action link clicked?
|
729 |
+
if ( ( isset( $_GET['tgmpa-install'] ) && 'install-plugin' === $_GET['tgmpa-install'] ) || ( isset( $_GET['tgmpa-update'] ) && 'update-plugin' === $_GET['tgmpa-update'] ) ) {
|
730 |
+
|
731 |
+
$install_type = 'install';
|
732 |
+
if ( isset( $_GET['tgmpa-update'] ) && 'update-plugin' === $_GET['tgmpa-update'] ) {
|
733 |
+
$install_type = 'update';
|
734 |
+
}
|
735 |
+
|
736 |
+
check_admin_referer( 'tgmpa-' . $install_type, 'tgmpa-nonce' );
|
737 |
+
|
738 |
+
// Pass necessary information via URL if WP_Filesystem is needed.
|
739 |
+
$url = wp_nonce_url(
|
740 |
+
add_query_arg(
|
741 |
+
array(
|
742 |
+
'plugin' => urlencode( $slug ),
|
743 |
+
'tgmpa-' . $install_type => $install_type . '-plugin',
|
744 |
+
),
|
745 |
+
$this->get_tgmpa_url()
|
746 |
+
),
|
747 |
+
'tgmpa-' . $install_type,
|
748 |
+
'tgmpa-nonce'
|
749 |
+
);
|
750 |
+
|
751 |
+
$method = ''; // Leave blank so WP_Filesystem can populate it as necessary.
|
752 |
+
|
753 |
+
if ( false === ( $creds = request_filesystem_credentials( esc_url_raw( $url ), $method, false, false, array() ) ) ) {
|
754 |
+
return true;
|
755 |
+
}
|
756 |
+
|
757 |
+
if ( ! WP_Filesystem( $creds ) ) {
|
758 |
+
request_filesystem_credentials( esc_url_raw( $url ), $method, true, false, array() ); // Setup WP_Filesystem.
|
759 |
+
return true;
|
760 |
+
}
|
761 |
+
|
762 |
+
/* If we arrive here, we have the filesystem. */
|
763 |
+
|
764 |
+
// Prep variables for Plugin_Installer_Skin class.
|
765 |
+
$extra = array();
|
766 |
+
$extra['slug'] = $slug; // Needed for potentially renaming of directory name.
|
767 |
+
$source = $this->get_download_url( $slug );
|
768 |
+
$api = ( 'repo' === $this->plugins[ $slug ]['source_type'] ) ? $this->get_plugins_api( $slug ) : null;
|
769 |
+
$api = ( false !== $api ) ? $api : null;
|
770 |
+
|
771 |
+
$url = add_query_arg(
|
772 |
+
array(
|
773 |
+
'action' => $install_type . '-plugin',
|
774 |
+
'plugin' => urlencode( $slug ),
|
775 |
+
),
|
776 |
+
'update.php'
|
777 |
+
);
|
778 |
+
|
779 |
+
if ( ! class_exists( 'Plugin_Upgrader', false ) ) {
|
780 |
+
require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
|
781 |
+
}
|
782 |
+
|
783 |
+
$skin_args = array(
|
784 |
+
'type' => ( 'bundled' !== $this->plugins[ $slug ]['source_type'] ) ? 'web' : 'upload',
|
785 |
+
'title' => sprintf( $this->strings['installing'], $this->plugins[ $slug ]['name'] ),
|
786 |
+
'url' => esc_url_raw( $url ),
|
787 |
+
'nonce' => $install_type . '-plugin_' . $slug,
|
788 |
+
'plugin' => '',
|
789 |
+
'api' => $api,
|
790 |
+
'extra' => $extra,
|
791 |
+
);
|
792 |
+
|
793 |
+
if ( 'update' === $install_type ) {
|
794 |
+
$skin_args['plugin'] = $this->plugins[ $slug ]['file_path'];
|
795 |
+
$skin = new Plugin_Upgrader_Skin( $skin_args );
|
796 |
+
} else {
|
797 |
+
$skin = new Plugin_Installer_Skin( $skin_args );
|
798 |
+
}
|
799 |
+
|
800 |
+
// Create a new instance of Plugin_Upgrader.
|
801 |
+
$upgrader = new Plugin_Upgrader( $skin );
|
802 |
+
|
803 |
+
// Perform the action and install the plugin from the $source urldecode().
|
804 |
+
add_filter( 'upgrader_source_selection', array( $this, 'maybe_adjust_source_dir' ), 1, 3 );
|
805 |
+
|
806 |
+
if ( 'update' === $install_type ) {
|
807 |
+
// Inject our info into the update transient.
|
808 |
+
$to_inject = array( $slug => $this->plugins[ $slug ] );
|
809 |
+
$to_inject[ $slug ]['source'] = $source;
|
810 |
+
$this->inject_update_info( $to_inject );
|
811 |
+
|
812 |
+
$upgrader->upgrade( $this->plugins[ $slug ]['file_path'] );
|
813 |
+
} else {
|
814 |
+
$upgrader->install( $source );
|
815 |
+
}
|
816 |
+
|
817 |
+
remove_filter( 'upgrader_source_selection', array( $this, 'maybe_adjust_source_dir' ), 1, 3 );
|
818 |
+
|
819 |
+
// Make sure we have the correct file path now the plugin is installed/updated.
|
820 |
+
$this->populate_file_path( $slug );
|
821 |
+
|
822 |
+
// Only activate plugins if the config option is set to true and the plugin isn't
|
823 |
+
// already active (upgrade).
|
824 |
+
if ( $this->is_automatic && ! $this->is_plugin_active( $slug ) ) {
|
825 |
+
$plugin_activate = $upgrader->plugin_info(); // Grab the plugin info from the Plugin_Upgrader method.
|
826 |
+
if ( false === $this->activate_single_plugin( $plugin_activate, $slug, true ) ) {
|
827 |
+
return true; // Finish execution of the function early as we encountered an error.
|
828 |
+
}
|
829 |
+
}
|
830 |
+
|
831 |
+
$this->show_tgmpa_version();
|
832 |
+
|
833 |
+
// Display message based on if all plugins are now active or not.
|
834 |
+
if ( $this->is_tgmpa_complete() ) {
|
835 |
+
echo '<p>', sprintf( esc_html( $this->strings['complete'] ), '<a href="' . esc_url( self_admin_url() ) . '">' . esc_html__( 'Return to the Dashboard', 'weaver-xtreme' ) . '</a>' ), '</p>';
|
836 |
+
echo '<style type="text/css">#adminmenu .wp-submenu li.current { display: none !important; }</style>';
|
837 |
+
} else {
|
838 |
+
echo '<p><a href="', esc_url( $this->get_tgmpa_url() ), '" target="_parent">', esc_html( $this->strings['return'] ), '</a></p>';
|
839 |
+
}
|
840 |
+
|
841 |
+
return true;
|
842 |
+
} elseif ( isset( $this->plugins[ $slug ]['file_path'], $_GET['tgmpa-activate'] ) && 'activate-plugin' === $_GET['tgmpa-activate'] ) {
|
843 |
+
// Activate action link was clicked.
|
844 |
+
check_admin_referer( 'tgmpa-activate', 'tgmpa-nonce' );
|
845 |
+
|
846 |
+
if ( false === $this->activate_single_plugin( $this->plugins[ $slug ]['file_path'], $slug ) ) {
|
847 |
+
return true; // Finish execution of the function early as we encountered an error.
|
848 |
+
}
|
849 |
+
}
|
850 |
+
|
851 |
+
return false;
|
852 |
+
}
|
853 |
+
|
854 |
+
/**
|
855 |
+
* Inject information into the 'update_plugins' site transient as WP checks that before running an update.
|
856 |
+
*
|
857 |
+
* @since 2.5.0
|
858 |
+
*
|
859 |
+
* @param array $plugins The plugin information for the plugins which are to be updated.
|
860 |
+
*/
|
861 |
+
public function inject_update_info( $plugins ) {
|
862 |
+
$repo_updates = get_site_transient( 'update_plugins' );
|
863 |
+
|
864 |
+
if ( ! is_object( $repo_updates ) ) {
|
865 |
+
$repo_updates = new stdClass;
|
866 |
+
}
|
867 |
+
|
868 |
+
foreach ( $plugins as $slug => $plugin ) {
|
869 |
+
$file_path = $plugin['file_path'];
|
870 |
+
|
871 |
+
if ( empty( $repo_updates->response[ $file_path ] ) ) {
|
872 |
+
$repo_updates->response[ $file_path ] = new stdClass;
|
873 |
+
}
|
874 |
+
|
875 |
+
// We only really need to set package, but let's do all we can in case WP changes something.
|
876 |
+
$repo_updates->response[ $file_path ]->slug = $slug;
|
877 |
+
$repo_updates->response[ $file_path ]->plugin = $file_path;
|
878 |
+
$repo_updates->response[ $file_path ]->new_version = $plugin['version'];
|
879 |
+
$repo_updates->response[ $file_path ]->package = $plugin['source'];
|
880 |
+
if ( empty( $repo_updates->response[ $file_path ]->url ) && ! empty( $plugin['external_url'] ) ) {
|
881 |
+
$repo_updates->response[ $file_path ]->url = $plugin['external_url'];
|
882 |
+
}
|
883 |
+
}
|
884 |
+
|
885 |
+
set_site_transient( 'update_plugins', $repo_updates );
|
886 |
+
}
|
887 |
+
|
888 |
+
/**
|
889 |
+
* Adjust the plugin directory name if necessary.
|
890 |
+
*
|
891 |
+
* The final destination directory of a plugin is based on the subdirectory name found in the
|
892 |
+
* (un)zipped source. In some cases - most notably GitHub repository plugin downloads -, this
|
893 |
+
* subdirectory name is not the same as the expected slug and the plugin will not be recognized
|
894 |
+
* as installed. This is fixed by adjusting the temporary unzipped source subdirectory name to
|
895 |
+
* the expected plugin slug.
|
896 |
+
*
|
897 |
+
* @since 2.5.0
|
898 |
+
*
|
899 |
+
* @param string $source Path to upgrade/zip-file-name.tmp/subdirectory/.
|
900 |
+
* @param string $remote_source Path to upgrade/zip-file-name.tmp.
|
901 |
+
* @param \WP_Upgrader $upgrader Instance of the upgrader which installs the plugin.
|
902 |
+
* @return string $source
|
903 |
+
*/
|
904 |
+
public function maybe_adjust_source_dir( $source, $remote_source, $upgrader ) {
|
905 |
+
if ( ! $this->is_tgmpa_page() || ! is_object( $GLOBALS['wp_filesystem'] ) ) {
|
906 |
+
return $source;
|
907 |
+
}
|
908 |
+
|
909 |
+
// Check for single file plugins.
|
910 |
+
$source_files = array_keys( $GLOBALS['wp_filesystem']->dirlist( $remote_source ) );
|
911 |
+
if ( 1 === count( $source_files ) && false === $GLOBALS['wp_filesystem']->is_dir( $source ) ) {
|
912 |
+
return $source;
|
913 |
+
}
|
914 |
+
|
915 |
+
// Multi-file plugin, let's see if the directory is correctly named.
|
916 |
+
$desired_slug = '';
|
917 |
+
|
918 |
+
// Figure out what the slug is supposed to be.
|
919 |
+
if ( false === $upgrader->bulk && ! empty( $upgrader->skin->options['extra']['slug'] ) ) {
|
920 |
+
$desired_slug = $upgrader->skin->options['extra']['slug'];
|
921 |
+
} else {
|
922 |
+
// Bulk installer contains less info, so fall back on the info registered here.
|
923 |
+
foreach ( $this->plugins as $slug => $plugin ) {
|
924 |
+
if ( ! empty( $upgrader->skin->plugin_names[ $upgrader->skin->i ] ) && $plugin['name'] === $upgrader->skin->plugin_names[ $upgrader->skin->i ] ) {
|
925 |
+
$desired_slug = $slug;
|
926 |
+
break;
|
927 |
+
}
|
928 |
+
}
|
929 |
+
unset( $slug, $plugin );
|
930 |
+
}
|
931 |
+
|
932 |
+
if ( ! empty( $desired_slug ) ) {
|
933 |
+
$subdir_name = untrailingslashit( str_replace( trailingslashit( $remote_source ), '', $source ) );
|
934 |
+
|
935 |
+
if ( ! empty( $subdir_name ) && $subdir_name !== $desired_slug ) {
|
936 |
+
$from = untrailingslashit( $source );
|
937 |
+
$to = trailingslashit( $remote_source ) . $desired_slug;
|
938 |
+
|
939 |
+
if ( true === $GLOBALS['wp_filesystem']->move( $from, $to ) ) {
|
940 |
+
return trailingslashit( $to );
|
941 |
+
} else {
|
942 |
+
return new WP_Error( 'rename_failed', esc_html__( 'The remote plugin package does not contain a folder with the desired slug and renaming did not work.', 'weaver-xtreme' ) . ' ' . esc_html__( 'Please contact the plugin provider and ask them to package their plugin according to the WordPress guidelines.', 'weaver-xtreme' ), array( 'found' => $subdir_name, 'expected' => $desired_slug ) );
|
943 |
+
}
|
944 |
+
} elseif ( empty( $subdir_name ) ) {
|
945 |
+
return new WP_Error( 'packaged_wrong', esc_html__( 'The remote plugin package consists of more than one file, but the files are not packaged in a folder.', 'weaver-xtreme' ) . ' ' . esc_html__( 'Please contact the plugin provider and ask them to package their plugin according to the WordPress guidelines.', 'weaver-xtreme' ), array( 'found' => $subdir_name, 'expected' => $desired_slug ) );
|
946 |
+
}
|
947 |
+
}
|
948 |
+
|
949 |
+
return $source;
|
950 |
+
}
|
951 |
+
|
952 |
+
/**
|
953 |
+
* Activate a single plugin and send feedback about the result to the screen.
|
954 |
+
*
|
955 |
+
* @since 2.5.0
|
956 |
+
*
|
957 |
+
* @param string $file_path Path within wp-plugins/ to main plugin file.
|
958 |
+
* @param string $slug Plugin slug.
|
959 |
+
* @param bool $automatic Whether this is an automatic activation after an install. Defaults to false.
|
960 |
+
* This determines the styling of the output messages.
|
961 |
+
* @return bool False if an error was encountered, true otherwise.
|
962 |
+
*/
|
963 |
+
protected function activate_single_plugin( $file_path, $slug, $automatic = false ) {
|
964 |
+
if ( $this->can_plugin_activate( $slug ) ) {
|
965 |
+
$activate = activate_plugin( $file_path );
|
966 |
+
|
967 |
+
if ( is_wp_error( $activate ) ) {
|
968 |
+
echo '<div id="message" class="error"><p>', wp_kses_post( $activate->get_error_message() ), '</p></div>',
|
969 |
+
'<p><a href="', esc_url( $this->get_tgmpa_url() ), '" target="_parent">', esc_html( $this->strings['return'] ), '</a></p>';
|
970 |
+
|
971 |
+
return false; // End it here if there is an error with activation.
|
972 |
+
} else {
|
973 |
+
if ( ! $automatic ) {
|
974 |
+
// Make sure message doesn't display again if bulk activation is performed
|
975 |
+
// immediately after a single activation.
|
976 |
+
if ( ! isset( $_POST['action'] ) ) { // WPCS: CSRF OK.
|
977 |
+
echo '<div id="message" class="updated"><p>', esc_html( $this->strings['activated_successfully'] ), ' <strong>', esc_html( $this->plugins[ $slug ]['name'] ), '.</strong></p></div>';
|
978 |
+
}
|
979 |
+
} else {
|
980 |
+
// Simpler message layout for use on the plugin install page.
|
981 |
+
echo '<p>', esc_html( $this->strings['plugin_activated'] ), '</p>';
|
982 |
+
}
|
983 |
+
}
|
984 |
+
} elseif ( $this->is_plugin_active( $slug ) ) {
|
985 |
+
// No simpler message format provided as this message should never be encountered
|
986 |
+
// on the plugin install page.
|
987 |
+
echo '<div id="message" class="error"><p>',
|
988 |
+
sprintf(
|
989 |
+
esc_html( $this->strings['plugin_already_active'] ),
|
990 |
+
'<strong>' . esc_html( $this->plugins[ $slug ]['name'] ) . '</strong>'
|
991 |
+
),
|
992 |
+
'</p></div>';
|
993 |
+
} elseif ( $this->does_plugin_require_update( $slug ) ) {
|
994 |
+
if ( ! $automatic ) {
|
995 |
+
// Make sure message doesn't display again if bulk activation is performed
|
996 |
+
// immediately after a single activation.
|
997 |
+
if ( ! isset( $_POST['action'] ) ) { // WPCS: CSRF OK.
|
998 |
+
echo '<div id="message" class="error"><p>',
|
999 |
+
sprintf(
|
1000 |
+
esc_html( $this->strings['plugin_needs_higher_version'] ),
|
1001 |
+
'<strong>' . esc_html( $this->plugins[ $slug ]['name'] ) . '</strong>'
|
1002 |
+
),
|
1003 |
+
'</p></div>';
|
1004 |
+
}
|
1005 |
+
} else {
|
1006 |
+
// Simpler message layout for use on the plugin install page.
|
1007 |
+
echo '<p>', sprintf( esc_html( $this->strings['plugin_needs_higher_version'] ), esc_html( $this->plugins[ $slug ]['name'] ) ), '</p>';
|
1008 |
+
}
|
1009 |
+
}
|
1010 |
+
|
1011 |
+
return true;
|
1012 |
+
}
|
1013 |
+
|
1014 |
+
/**
|
1015 |
+
* Echoes required plugin notice.
|
1016 |
+
*
|
1017 |
+
* Outputs a message telling users that a specific plugin is required for
|
1018 |
+
* their theme. If appropriate, it includes a link to the form page where
|
1019 |
+
* users can install and activate the plugin.
|
1020 |
+
*
|
1021 |
+
* Returns early if we're on the Install page.
|
1022 |
+
*
|
1023 |
+
* @since 1.0.0
|
1024 |
+
*
|
1025 |
+
* @global object $current_screen
|
1026 |
+
*
|
1027 |
+
* @return null Returns early if we're on the Install page.
|
1028 |
+
*/
|
1029 |
+
public function notices() {
|
1030 |
+
// Remove nag on the install page / Return early if the nag message has been dismissed.
|
1031 |
+
if ( $this->is_tgmpa_page() || get_user_meta( get_current_user_id(), 'tgmpa_dismissed_notice_' . $this->id, true ) ) {
|
1032 |
+
return;
|
1033 |
+
}
|
1034 |
+
|
1035 |
+
// Store for the plugin slugs by message type.
|
1036 |
+
$message = array();
|
1037 |
+
|
1038 |
+
// Initialize counters used to determine plurality of action link texts.
|
1039 |
+
$install_link_count = 0;
|
1040 |
+
$update_link_count = 0;
|
1041 |
+
$activate_link_count = 0;
|
1042 |
+
|
1043 |
+
foreach ( $this->plugins as $slug => $plugin ) {
|
1044 |
+
if ( $this->is_plugin_active( $slug ) && false === $this->does_plugin_have_update( $slug ) ) {
|
1045 |
+
continue;
|
1046 |
+
}
|
1047 |
+
|
1048 |
+
if ( ! $this->is_plugin_installed( $slug ) ) {
|
1049 |
+
if ( current_user_can( 'install_plugins' ) ) {
|
1050 |
+
$install_link_count++;
|
1051 |
+
|
1052 |
+
if ( true === $plugin['required'] ) {
|
1053 |
+
$message['notice_can_install_required'][] = $slug;
|
1054 |
+
} else {
|
1055 |
+
$message['notice_can_install_recommended'][] = $slug;
|
1056 |
+
}
|
1057 |
+
} else {
|
1058 |
+
// Need higher privileges to install the plugin.
|
1059 |
+
$message['notice_cannot_install'][] = $slug;
|
1060 |
+
}
|
1061 |
+
} else {
|
1062 |
+
if ( ! $this->is_plugin_active( $slug ) && $this->can_plugin_activate( $slug ) ) {
|
1063 |
+
if ( current_user_can( 'activate_plugins' ) ) {
|
1064 |
+
$activate_link_count++;
|
1065 |
+
|
1066 |
+
if ( true === $plugin['required'] ) {
|
1067 |
+
$message['notice_can_activate_required'][] = $slug;
|
1068 |
+
} else {
|
1069 |
+
$message['notice_can_activate_recommended'][] = $slug;
|
1070 |
+
}
|
1071 |
+
} else {
|
1072 |
+
// Need higher privileges to activate the plugin.
|
1073 |
+
$message['notice_cannot_activate'][] = $slug;
|
1074 |
+
}
|
1075 |
+
}
|
1076 |
+
|
1077 |
+
if ( $this->does_plugin_require_update( $slug ) || false !== $this->does_plugin_have_update( $slug ) ) {
|
1078 |
+
|
1079 |
+
if ( current_user_can( 'install_plugins' ) ) {
|
1080 |
+
$update_link_count++;
|
1081 |
+
|
1082 |
+
if ( $this->does_plugin_require_update( $slug ) ) {
|
1083 |
+
$message['notice_ask_to_update'][] = $slug;
|
1084 |
+
} elseif ( false !== $this->does_plugin_have_update( $slug ) ) {
|
1085 |
+
$message['notice_ask_to_update_maybe'][] = $slug;
|
1086 |
+
}
|
1087 |
+
} else {
|
1088 |
+
// Need higher privileges to update the plugin.
|
1089 |
+
$message['notice_cannot_update'][] = $slug;
|
1090 |
+
}
|
1091 |
+
}
|
1092 |
+
}
|
1093 |
+
}
|
1094 |
+
unset( $slug, $plugin );
|
1095 |
+
|
1096 |
+
// If we have notices to display, we move forward.
|
1097 |
+
if ( ! empty( $message ) ) {
|
1098 |
+
krsort( $message ); // Sort messages.
|
1099 |
+
$rendered = '';
|
1100 |
+
|
1101 |
+
// As add_settings_error() wraps the final message in a <p> and as the final message can't be
|
1102 |
+
// filtered, using <p>'s in our html would render invalid html output.
|
1103 |
+
$line_template = '<span style="display: block; margin: 0.5em 0.5em 0 0; clear: both;">%s</span>' . "\n";
|
1104 |
+
|
1105 |
+
// If dismissable is false and a message is set, output it now.
|
1106 |
+
if ( ! $this->dismissable && ! empty( $this->dismiss_msg ) ) {
|
1107 |
+
$rendered .= sprintf( $line_template, wp_kses_post( $this->dismiss_msg ) );
|
1108 |
+
}
|
1109 |
+
|
1110 |
+
// Render the individual message lines for the notice.
|
1111 |
+
foreach ( $message as $type => $plugin_group ) {
|
1112 |
+
$linked_plugins = array();
|
1113 |
+
|
1114 |
+
// Get the external info link for a plugin if one is available.
|
1115 |
+
foreach ( $plugin_group as $plugin_slug ) {
|
1116 |
+
$linked_plugins[] = $this->get_info_link( $plugin_slug );
|
1117 |
+
}
|
1118 |
+
unset( $plugin_slug );
|
1119 |
+
|
1120 |
+
$count = count( $plugin_group );
|
1121 |
+
$linked_plugins = array_map( array( 'TGMPA_Utils', 'wrap_in_em' ), $linked_plugins );
|
1122 |
+
$last_plugin = array_pop( $linked_plugins ); // Pop off last name to prep for readability.
|
1123 |
+
$imploded = empty( $linked_plugins ) ? $last_plugin : ( implode( ', ', $linked_plugins ) . ' ' . esc_html_x( 'and', 'plugin A *and* plugin B', 'weaver-xtreme' ) . ' ' . $last_plugin );
|
1124 |
+
|
1125 |
+
$rendered .= sprintf(
|
1126 |
+
$line_template,
|
1127 |
+
sprintf(
|
1128 |
+
translate_nooped_plural( $this->strings[ $type ], $count, 'weaver-xtreme' ),
|
1129 |
+
$imploded,
|
1130 |
+
$count
|
1131 |
+
)
|
1132 |
+
);
|
1133 |
+
|
1134 |
+
if ( 0 === strpos( $type, 'notice_cannot' ) ) {
|
1135 |
+
$rendered .= $this->strings['contact_admin'];
|
1136 |
+
}
|
1137 |
+
}
|
1138 |
+
unset( $type, $plugin_group, $linked_plugins, $count, $last_plugin, $imploded );
|
1139 |
+
|
1140 |
+
// Setup action links.
|
1141 |
+
$action_links = array(
|
1142 |
+
'install' => '',
|
1143 |
+
'update' => '',
|
1144 |
+
'activate' => '',
|
1145 |
+
'dismiss' => $this->dismissable ? '<a href="' . esc_url( add_query_arg( 'tgmpa-dismiss', 'dismiss_admin_notices' ) ) . '" class="dismiss-notice" target="_parent">' . esc_html( $this->strings['dismiss'] ) . '</a>' : '',
|
1146 |
+
);
|
1147 |
+
|
1148 |
+
$link_template = '<a href="%2$s">%1$s</a>';
|
1149 |
+
|
1150 |
+
if ( current_user_can( 'install_plugins' ) ) {
|
1151 |
+
if ( $install_link_count > 0 ) {
|
1152 |
+
$action_links['install'] = sprintf(
|
1153 |
+
$link_template,
|
1154 |
+
translate_nooped_plural( $this->strings['install_link'], $install_link_count, 'weaver-xtreme' ),
|
1155 |
+
esc_url( $this->get_tgmpa_status_url( 'install' ) )
|
1156 |
+
);
|
1157 |
+
}
|
1158 |
+
if ( $update_link_count > 0 ) {
|
1159 |
+
$action_links['update'] = sprintf(
|
1160 |
+
$link_template,
|
1161 |
+
translate_nooped_plural( $this->strings['update_link'], $update_link_count, 'weaver-xtreme' ),
|
1162 |
+
esc_url( $this->get_tgmpa_status_url( 'update' ) )
|
1163 |
+
);
|
1164 |
+
}
|
1165 |
+
}
|
1166 |
+
|
1167 |
+
if ( current_user_can( 'activate_plugins' ) && $activate_link_count > 0 ) {
|
1168 |
+
$action_links['activate'] = sprintf(
|
1169 |
+
$link_template,
|
1170 |
+
translate_nooped_plural( $this->strings['activate_link'], $activate_link_count, 'weaver-xtreme' ),
|
1171 |
+
esc_url( $this->get_tgmpa_status_url( 'activate' ) )
|
1172 |
+
);
|
1173 |
+
}
|
1174 |
+
|
1175 |
+
$action_links = apply_filters( 'tgmpa_notice_action_links', $action_links );
|
1176 |
+
|
1177 |
+
$action_links = array_filter( (array) $action_links ); // Remove any empty array items.
|
1178 |
+
|
1179 |
+
if ( ! empty( $action_links ) && is_array( $action_links ) ) {
|
1180 |
+
$action_links = sprintf( $line_template, implode( ' | ', $action_links ) );
|
1181 |
+
$rendered .= apply_filters( 'tgmpa_notice_rendered_action_links', $action_links );
|
1182 |
+
}
|
1183 |
+
|
1184 |
+
// Register the nag messages and prepare them to be processed.
|
1185 |
+
if ( ! empty( $this->strings['nag_type'] ) ) {
|
1186 |
+
add_settings_error( 'tgmpa','tgmpa', $rendered, sanitize_html_class( strtolower( $this->strings['nag_type'] ) ) );
|
1187 |
+
} else {
|
1188 |
+
$nag_class = version_compare( $this->wp_version, '3.8', '<' ) ? 'updated' : 'update-nag';
|
1189 |
+
add_settings_error( 'tgmpa','tgmpa', $rendered, $nag_class );
|
1190 |
+
}
|
1191 |
+
}
|
1192 |
+
|
1193 |
+
// Admin options pages already output settings_errors, so this is to avoid duplication.
|
1194 |
+
if ( 'options-general' !== $GLOBALS['current_screen']->parent_base ) {
|
1195 |
+
$this->display_settings_errors();
|
1196 |
+
}
|
1197 |
+
}
|
1198 |
+
|
1199 |
+
/**
|
1200 |
+
* Display settings errors and remove those which have been displayed to avoid duplicate messages showing
|
1201 |
+
*
|
1202 |
+
* @since 2.5.0
|
1203 |
+
*/
|
1204 |
+
protected function display_settings_errors() {
|
1205 |
+
global $wp_settings_errors;
|
1206 |
+
|
1207 |
+
settings_errors( 'tgmpa' );
|
1208 |
+
|
1209 |
+
foreach ( (array) $wp_settings_errors as $key => $details ) {
|
1210 |
+
if ( 'tgmpa' === $details['setting'] ) {
|
1211 |
+
unset( $wp_settings_errors[ $key ] );
|
1212 |
+
break;
|
1213 |
+
}
|
1214 |
+
}
|
1215 |
+
}
|
1216 |
+
|
1217 |
+
/**
|
1218 |
+
* Add dismissable admin notices.
|
1219 |
+
*
|
1220 |
+
* Appends a link to the admin nag messages. If clicked, the admin notice disappears and no longer is visible to users.
|
1221 |
+
*
|
1222 |
+
* @since 2.1.0
|
1223 |
+
*/
|
1224 |
+
public function dismiss() {
|
1225 |
+
if ( isset( $_GET['tgmpa-dismiss'] ) ) {
|
1226 |
+
update_user_meta( get_current_user_id(), 'tgmpa_dismissed_notice_' . $this->id, 1 );
|
1227 |
+
}
|
1228 |
+
}
|
1229 |
+
|
1230 |
+
/**
|
1231 |
+
* Add individual plugin to our collection of plugins.
|
1232 |
+
*
|
1233 |
+
* If the required keys are not set or the plugin has already
|
1234 |
+
* been registered, the plugin is not added.
|
1235 |
+
*
|
1236 |
+
* @since 2.0.0
|
1237 |
+
*
|
1238 |
+
* @param array|null $plugin Array of plugin arguments or null if invalid argument.
|
1239 |
+
* @return null Return early if incorrect argument.
|
1240 |
+
*/
|
1241 |
+
public function register( $plugin ) {
|
1242 |
+
if ( empty( $plugin['slug'] ) || empty( $plugin['name'] ) ) {
|
1243 |
+
return;
|
1244 |
+
}
|
1245 |
+
|
1246 |
+
if ( empty( $plugin['slug'] ) || ! is_string( $plugin['slug'] ) || isset( $this->plugins[ $plugin['slug'] ] ) ) {
|
1247 |
+
return;
|
1248 |
+
}
|
1249 |
+
|
1250 |
+
$defaults = array(
|
1251 |
+
'name' => '', // String
|
1252 |
+
'slug' => '', // String
|
1253 |
+
'source' => 'repo', // String
|
1254 |
+
'required' => false, // Boolean
|
1255 |
+
'version' => '', // String
|
1256 |
+
'force_activation' => false, // Boolean
|
1257 |
+
'force_deactivation' => false, // Boolean
|
1258 |
+
'external_url' => '', // String
|
1259 |
+
'is_callable' => '', // String|Array.
|
1260 |
+
);
|
1261 |
+
|
1262 |
+
// Prepare the received data.
|
1263 |
+
$plugin = wp_parse_args( $plugin, $defaults );
|
1264 |
+
|
1265 |
+
// Standardize the received slug.
|
1266 |
+
$plugin['slug'] = $this->sanitize_key( $plugin['slug'] );
|
1267 |
+
|
1268 |
+
// Forgive users for using string versions of booleans or floats for version number.
|
1269 |
+
$plugin['version'] = (string) $plugin['version'];
|
1270 |
+
$plugin['source'] = empty( $plugin['source'] ) ? 'repo' : $plugin['source'];
|
1271 |
+
$plugin['required'] = TGMPA_Utils::validate_bool( $plugin['required'] );
|
1272 |
+
$plugin['force_activation'] = TGMPA_Utils::validate_bool( $plugin['force_activation'] );
|
1273 |
+
$plugin['force_deactivation'] = TGMPA_Utils::validate_bool( $plugin['force_deactivation'] );
|
1274 |
+
|
1275 |
+
// Enrich the received data.
|
1276 |
+
$plugin['file_path'] = $this->_get_plugin_basename_from_slug( $plugin['slug'] );
|
1277 |
+
$plugin['source_type'] = $this->get_plugin_source_type( $plugin['source'] );
|
1278 |
+
|
1279 |
+
// Set the class properties.
|
1280 |
+
$this->plugins[ $plugin['slug'] ] = $plugin;
|
1281 |
+
$this->sort_order[ $plugin['slug'] ] = $plugin['name'];
|
1282 |
+
|
1283 |
+
// Should we add the force activation hook ?
|
1284 |
+
if ( true === $plugin['force_activation'] ) {
|
1285 |
+
$this->has_forced_activation = true;
|
1286 |
+
}
|
1287 |
+
|
1288 |
+
// Should we add the force deactivation hook ?
|
1289 |
+
if ( true === $plugin['force_deactivation'] ) {
|
1290 |
+
$this->has_forced_deactivation = true;
|
1291 |
+
}
|
1292 |
+
}
|
1293 |
+
|
1294 |
+
/**
|
1295 |
+
* Determine what type of source the plugin comes from.
|
1296 |
+
*
|
1297 |
+
* @since 2.5.0
|
1298 |
+
*
|
1299 |
+
* @param string $source The source of the plugin as provided, either empty (= WP repo), a file path
|
1300 |
+
* (= bundled) or an external URL.
|
1301 |
+
* @return string 'repo', 'external', or 'bundled'
|
1302 |
+
*/
|
1303 |
+
protected function get_plugin_source_type( $source ) {
|
1304 |
+
if ( 'repo' === $source || preg_match( self::WP_REPO_REGEX, $source ) ) {
|
1305 |
+
return 'repo';
|
1306 |
+
} elseif ( preg_match( self::IS_URL_REGEX, $source ) ) {
|
1307 |
+
return 'external';
|
1308 |
+
} else {
|
1309 |
+
return 'bundled';
|
1310 |
+
}
|
1311 |
+
}
|
1312 |
+
|
1313 |
+
/**
|
1314 |
+
* Sanitizes a string key.
|
1315 |
+
*
|
1316 |
+
* Near duplicate of WP Core `sanitize_key()`. The difference is that uppercase characters *are*
|
1317 |
+
* allowed, so as not to break upgrade paths from non-standard bundled plugins using uppercase
|
1318 |
+
* characters in the plugin directory path/slug. Silly them.
|
1319 |
+
*
|
1320 |
+
* @see https://developer.wordpress.org/reference/hooks/sanitize_key/
|
1321 |
+
*
|
1322 |
+
* @since 2.5.0
|
1323 |
+
*
|
1324 |
+
* @param string $key String key.
|
1325 |
+
* @return string Sanitized key
|
1326 |
+
*/
|
1327 |
+
public function sanitize_key( $key ) {
|
1328 |
+
$raw_key = $key;
|
1329 |
+
$key = preg_replace( '`[^A-Za-z0-9_-]`', '', $key );
|
1330 |
+
|
1331 |
+
/**
|
1332 |
+
* Filter a sanitized key string.
|
1333 |
+
*
|
1334 |
+
* @since 3.0.0
|
1335 |
+
*
|
1336 |
+
* @param string $key Sanitized key.
|
1337 |
+
* @param string $raw_key The key prior to sanitization.
|
1338 |
+
*/
|
1339 |
+
return apply_filters( 'tgmpa_sanitize_key', $key, $raw_key );
|
1340 |
+
}
|
1341 |
+
|
1342 |
+
/**
|
1343 |
+
* Amend default configuration settings.
|
1344 |
+
*
|
1345 |
+
* @since 2.0.0
|
1346 |
+
*
|
1347 |
+
* @param array $config Array of config options to pass as class properties.
|
1348 |
+
*/
|
1349 |
+
public function config( $config ) {
|
1350 |
+
$keys = array(
|
1351 |
+
'id',
|
1352 |
+
'default_path',
|
1353 |
+
'has_notices',
|
1354 |
+
'dismissable',
|
1355 |
+
'dismiss_msg',
|
1356 |
+
'menu',
|
1357 |
+
'parent_slug',
|
1358 |
+
'capability',
|
1359 |
+
'is_automatic',
|
1360 |
+
'message',
|
1361 |
+
'strings',
|
1362 |
+
);
|
1363 |
+
|
1364 |
+
foreach ( $keys as $key ) {
|
1365 |
+
if ( isset( $config[ $key ] ) ) {
|
1366 |
+
if ( is_array( $config[ $key ] ) ) {
|
1367 |
+
$this->$key = array_merge( $this->$key, $config[ $key ] );
|
1368 |
+
} else {
|
1369 |
+
$this->$key = $config[ $key ];
|
1370 |
+
}
|
1371 |
+
}
|
1372 |
+
}
|
1373 |
+
}
|
1374 |
+
|
1375 |
+
/**
|
1376 |
+
* Amend action link after plugin installation.
|
1377 |
+
*
|
1378 |
+
* @since 2.0.0
|
1379 |
+
*
|
1380 |
+
* @param array $install_actions Existing array of actions.
|
1381 |
+
* @return array Amended array of actions.
|
1382 |
+
*/
|
1383 |
+
public function actions( $install_actions ) {
|
1384 |
+
// Remove action links on the TGMPA install page.
|
1385 |
+
if ( $this->is_tgmpa_page() ) {
|
1386 |
+
return false;
|
1387 |
+
}
|
1388 |
+
|
1389 |
+
return $install_actions;
|
1390 |
+
}
|
1391 |
+
|
1392 |
+
/**
|
1393 |
+
* Flushes the plugins cache on theme switch to prevent stale entries
|
1394 |
+
* from remaining in the plugin table.
|
1395 |
+
*
|
1396 |
+
* @since 2.4.0
|
1397 |
+
*
|
1398 |
+
* @param bool $clear_update_cache Optional. Whether to clear the Plugin updates cache.
|
1399 |
+
* Parameter added in v2.5.0.
|
1400 |
+
*/
|
1401 |
+
public function flush_plugins_cache( $clear_update_cache = true ) {
|
1402 |
+
wp_clean_plugins_cache( $clear_update_cache );
|
1403 |
+
}
|
1404 |
+
|
1405 |
+
/**
|
1406 |
+
* Set file_path key for each installed plugin.
|
1407 |
+
*
|
1408 |
+
* @since 2.1.0
|
1409 |
+
*
|
1410 |
+
* @param string $plugin_slug Optional. If set, only (re-)populates the file path for that specific plugin.
|
1411 |
+
* Parameter added in v2.5.0.
|
1412 |
+
*/
|
1413 |
+
public function populate_file_path( $plugin_slug = '' ) {
|
1414 |
+
if ( ! empty( $plugin_slug ) && is_string( $plugin_slug ) && isset( $this->plugins[ $plugin_slug ] ) ) {
|
1415 |
+
$this->plugins[ $plugin_slug ]['file_path'] = $this->_get_plugin_basename_from_slug( $plugin_slug );
|
1416 |
+
} else {
|
1417 |
+
// Add file_path key for all plugins.
|
1418 |
+
foreach ( $this->plugins as $slug => $values ) {
|
1419 |
+
$this->plugins[ $slug ]['file_path'] = $this->_get_plugin_basename_from_slug( $slug );
|
1420 |
+
}
|
1421 |
+
}
|
1422 |
+
}
|
1423 |
+
|
1424 |
+
/**
|
1425 |
+
* Helper function to extract the file path of the plugin file from the
|
1426 |
+
* plugin slug, if the plugin is installed.
|
1427 |
+
*
|
1428 |
+
* @since 2.0.0
|
1429 |
+
*
|
1430 |
+
* @param string $slug Plugin slug (typically folder name) as provided by the developer.
|
1431 |
+
* @return string Either file path for plugin if installed, or just the plugin slug.
|
1432 |
+
*/
|
1433 |
+
protected function _get_plugin_basename_from_slug( $slug ) {
|
1434 |
+
$keys = array_keys( $this->get_plugins() );
|
1435 |
+
|
1436 |
+
foreach ( $keys as $key ) {
|
1437 |
+
if ( preg_match( '|^' . $slug . '/|', $key ) ) {
|
1438 |
+
return $key;
|
1439 |
+
}
|
1440 |
+
}
|
1441 |
+
|
1442 |
+
return $slug;
|
1443 |
+
}
|
1444 |
+
|
1445 |
+
/**
|
1446 |
+
* Retrieve plugin data, given the plugin name.
|
1447 |
+
*
|
1448 |
+
* Loops through the registered plugins looking for $name. If it finds it,
|
1449 |
+
* it returns the $data from that plugin. Otherwise, returns false.
|
1450 |
+
*
|
1451 |
+
* @since 2.1.0
|
1452 |
+
*
|
1453 |
+
* @param string $name Name of the plugin, as it was registered.
|
1454 |
+
* @param string $data Optional. Array key of plugin data to return. Default is slug.
|
1455 |
+
* @return string|boolean Plugin slug if found, false otherwise.
|
1456 |
+
*/
|
1457 |
+
public function _get_plugin_data_from_name( $name, $data = 'slug' ) {
|
1458 |
+
foreach ( $this->plugins as $values ) {
|
1459 |
+
if ( $name === $values['name'] && isset( $values[ $data ] ) ) {
|
1460 |
+
return $values[ $data ];
|
1461 |
+
}
|
1462 |
+
}
|
1463 |
+
|
1464 |
+
return false;
|
1465 |
+
}
|
1466 |
+
|
1467 |
+
/**
|
1468 |
+
* Retrieve the download URL for a package.
|
1469 |
+
*
|
1470 |
+
* @since 2.5.0
|
1471 |
+
*
|
1472 |
+
* @param string $slug Plugin slug.
|
1473 |
+
* @return string Plugin download URL or path to local file or empty string if undetermined.
|
1474 |
+
*/
|
1475 |
+
public function get_download_url( $slug ) {
|
1476 |
+
$dl_source = '';
|
1477 |
+
|
1478 |
+
switch ( $this->plugins[ $slug ]['source_type'] ) {
|
1479 |
+
case 'repo':
|
1480 |
+
return $this->get_wp_repo_download_url( $slug );
|
1481 |
+
case 'external':
|
1482 |
+
return $this->plugins[ $slug ]['source'];
|
1483 |
+
case 'bundled':
|
1484 |
+
return $this->default_path . $this->plugins[ $slug ]['source'];
|
1485 |
+
}
|
1486 |
+
|
1487 |
+
return $dl_source; // Should never happen.
|
1488 |
+
}
|
1489 |
+
|
1490 |
+
/**
|
1491 |
+
* Retrieve the download URL for a WP repo package.
|
1492 |
+
*
|
1493 |
+
* @since 2.5.0
|
1494 |
+
*
|
1495 |
+
* @param string $slug Plugin slug.
|
1496 |
+
* @return string Plugin download URL.
|
1497 |
+
*/
|
1498 |
+
protected function get_wp_repo_download_url( $slug ) {
|
1499 |
+
$source = '';
|
1500 |
+
$api = $this->get_plugins_api( $slug );
|
1501 |
+
|
1502 |
+
if ( false !== $api && isset( $api->download_link ) ) {
|
1503 |
+
$source = $api->download_link;
|
1504 |
+
}
|
1505 |
+
|
1506 |
+
return $source;
|
1507 |
+
}
|
1508 |
+
|
1509 |
+
/**
|
1510 |
+
* Try to grab information from WordPress API.
|
1511 |
+
*
|
1512 |
+
* @since 2.5.0
|
1513 |
+
*
|
1514 |
+
* @param string $slug Plugin slug.
|
1515 |
+
* @return object Plugins_api response object on success, WP_Error on failure.
|
1516 |
+
*/
|
1517 |
+
protected function get_plugins_api( $slug ) {
|
1518 |
+
static $api = array(); // Cache received responses.
|
1519 |
+
|
1520 |
+
if ( ! isset( $api[ $slug ] ) ) {
|
1521 |
+
if ( ! function_exists( 'plugins_api' ) ) {
|
1522 |
+
require_once ABSPATH . 'wp-admin/includes/plugin-install.php';
|
1523 |
+
}
|
1524 |
+
|
1525 |
+
$response = plugins_api( 'plugin_information', array( 'slug' => $slug, 'fields' => array( 'sections' => false ) ) );
|
1526 |
+
|
1527 |
+
$api[ $slug ] = false;
|
1528 |
+
|
1529 |
+
if ( is_wp_error( $response ) ) {
|
1530 |
+
wp_die( esc_html( $this->strings['oops'] ) );
|
1531 |
+
} else {
|
1532 |
+
$api[ $slug ] = $response;
|
1533 |
+
}
|
1534 |
+
}
|
1535 |
+
|
1536 |
+
return $api[ $slug ];
|
1537 |
+
}
|
1538 |
+
|
1539 |
+
/**
|
1540 |
+
* Retrieve a link to a plugin information page.
|
1541 |
+
*
|
1542 |
+
* @since 2.5.0
|
1543 |
+
*
|
1544 |
+
* @param string $slug Plugin slug.
|
1545 |
+
* @return string Fully formed html link to a plugin information page if available
|
1546 |
+
* or the plugin name if not.
|
1547 |
+
*/
|
1548 |
+
public function get_info_link( $slug ) {
|
1549 |
+
if ( ! empty( $this->plugins[ $slug ]['external_url'] ) && preg_match( self::IS_URL_REGEX, $this->plugins[ $slug ]['external_url'] ) ) {
|
1550 |
+
$link = sprintf(
|
1551 |
+
'<a href="%1$s" target="_blank">%2$s</a>',
|
1552 |
+
esc_url( $this->plugins[ $slug ]['external_url'] ),
|
1553 |
+
esc_html( $this->plugins[ $slug ]['name'] )
|
1554 |
+
);
|
1555 |
+
} elseif ( 'repo' === $this->plugins[ $slug ]['source_type'] ) {
|
1556 |
+
$url = add_query_arg(
|
1557 |
+
array(
|
1558 |
+
'tab' => 'plugin-information',
|
1559 |
+
'plugin' => urlencode( $slug ),
|
1560 |
+
'TB_iframe' => 'true',
|
1561 |
+
'width' => '640',
|
1562 |
+
'height' => '500',
|
1563 |
+
),
|
1564 |
+
self_admin_url( 'plugin-install.php' )
|
1565 |
+
);
|
1566 |
+
|
1567 |
+
$link = sprintf(
|
1568 |
+
'<a href="%1$s" class="thickbox">%2$s</a>',
|
1569 |
+
esc_url( $url ),
|
1570 |
+
esc_html( $this->plugins[ $slug ]['name'] )
|
1571 |
+
);
|
1572 |
+
} else {
|
1573 |
+
$link = esc_html( $this->plugins[ $slug ]['name'] ); // No hyperlink.
|
1574 |
+
}
|
1575 |
+
|
1576 |
+
return $link;
|
1577 |
+
}
|
1578 |
+
|
1579 |
+
/**
|
1580 |
+
* Determine if we're on the TGMPA Install page.
|
1581 |
+
*
|
1582 |
+
* @since 2.1.0
|
1583 |
+
*
|
1584 |
+
* @return boolean True when on the TGMPA page, false otherwise.
|
1585 |
+
*/
|
1586 |
+
protected function is_tgmpa_page() {
|
1587 |
+
return isset( $_GET['page'] ) && $this->menu === $_GET['page'];
|
1588 |
+
}
|
1589 |
+
|
1590 |
+
/**
|
1591 |
+
* Retrieve the URL to the TGMPA Install page.
|
1592 |
+
*
|
1593 |
+
* I.e. depending on the config settings passed something along the lines of:
|
1594 |
+
* http://example.com/wp-admin/themes.php?page=tgmpa-install-plugins
|
1595 |
+
*
|
1596 |
+
* @since 2.5.0
|
1597 |
+
*
|
1598 |
+
* @return string Properly encoded URL (not escaped).
|
1599 |
+
*/
|
1600 |
+
public function get_tgmpa_url() {
|
1601 |
+
static $url;
|
1602 |
+
|
1603 |
+
if ( ! isset( $url ) ) {
|
1604 |
+
$parent = $this->parent_slug;
|
1605 |
+
if ( false === strpos( $parent, '.php' ) ) {
|
1606 |
+
$parent = 'admin.php';
|
1607 |
+
}
|
1608 |
+
$url = add_query_arg(
|
1609 |
+
array(
|
1610 |
+
'page' => urlencode( $this->menu ),
|
1611 |
+
),
|
1612 |
+
self_admin_url( $parent )
|
1613 |
+
);
|
1614 |
+
}
|
1615 |
+
|
1616 |
+
return $url;
|
1617 |
+
}
|
1618 |
+
|
1619 |
+
/**
|
1620 |
+
* Retrieve the URL to the TGMPA Install page for a specific plugin status (view).
|
1621 |
+
*
|
1622 |
+
* I.e. depending on the config settings passed something along the lines of:
|
1623 |
+
* http://example.com/wp-admin/themes.php?page=tgmpa-install-plugins&plugin_status=install
|
1624 |
+
*
|
1625 |
+
* @since 2.5.0
|
1626 |
+
*
|
1627 |
+
* @param string $status Plugin status - either 'install', 'update' or 'activate'.
|
1628 |
+
* @return string Properly encoded URL (not escaped).
|
1629 |
+
*/
|
1630 |
+
public function get_tgmpa_status_url( $status ) {
|
1631 |
+
return add_query_arg(
|
1632 |
+
array(
|
1633 |
+
'plugin_status' => urlencode( $status ),
|
1634 |
+
),
|
1635 |
+
$this->get_tgmpa_url()
|
1636 |
+
);
|
1637 |
+
}
|
1638 |
+
|
1639 |
+
/**
|
1640 |
+
* Determine whether there are open actions for plugins registered with TGMPA.
|
1641 |
+
*
|
1642 |
+
* @since 2.5.0
|
1643 |
+
*
|
1644 |
+
* @return bool True if complete, i.e. no outstanding actions. False otherwise.
|
1645 |
+
*/
|
1646 |
+
public function is_tgmpa_complete() {
|
1647 |
+
$complete = true;
|
1648 |
+
foreach ( $this->plugins as $slug => $plugin ) {
|
1649 |
+
if ( ! $this->is_plugin_active( $slug ) || false !== $this->does_plugin_have_update( $slug ) ) {
|
1650 |
+
$complete = false;
|
1651 |
+
break;
|
1652 |
+
}
|
1653 |
+
}
|
1654 |
+
|
1655 |
+
return $complete;
|
1656 |
+
}
|
1657 |
+
|
1658 |
+
/**
|
1659 |
+
* Check if a plugin is installed. Does not take must-use plugins into account.
|
1660 |
+
*
|
1661 |
+
* @since 2.5.0
|
1662 |
+
*
|
1663 |
+
* @param string $slug Plugin slug.
|
1664 |
+
* @return bool True if installed, false otherwise.
|
1665 |
+
*/
|
1666 |
+
public function is_plugin_installed( $slug ) {
|
1667 |
+
$installed_plugins = $this->get_plugins(); // Retrieve a list of all installed plugins (WP cached).
|
1668 |
+
|
1669 |
+
return ( ! empty( $installed_plugins[ $this->plugins[ $slug ]['file_path'] ] ) );
|
1670 |
+
}
|
1671 |
+
|
1672 |
+
/**
|
1673 |
+
* Check if a plugin is active.
|
1674 |
+
*
|
1675 |
+
* @since 2.5.0
|
1676 |
+
*
|
1677 |
+
* @param string $slug Plugin slug.
|
1678 |
+
* @return bool True if active, false otherwise.
|
1679 |
+
*/
|
1680 |
+
public function is_plugin_active( $slug ) {
|
1681 |
+
return ( ( ! empty( $this->plugins[ $slug ]['is_callable'] ) && is_callable( $this->plugins[ $slug ]['is_callable'] ) ) || is_plugin_active( $this->plugins[ $slug ]['file_path'] ) );
|
1682 |
+
}
|
1683 |
+
|
1684 |
+
/**
|
1685 |
+
* Check if a plugin can be updated, i.e. if we have information on the minimum WP version required
|
1686 |
+
* available, check whether the current install meets them.
|
1687 |
+
*
|
1688 |
+
* @since 2.5.0
|
1689 |
+
*
|
1690 |
+
* @param string $slug Plugin slug.
|
1691 |
+
* @return bool True if OK to update, false otherwise.
|
1692 |
+
*/
|
1693 |
+
public function can_plugin_update( $slug ) {
|
1694 |
+
// We currently can't get reliable info on non-WP-repo plugins - issue #380.
|
1695 |
+
if ( 'repo' !== $this->plugins[ $slug ]['source_type'] ) {
|
1696 |
+
return true;
|
1697 |
+
}
|
1698 |
+
|
1699 |
+
$api = $this->get_plugins_api( $slug );
|
1700 |
+
|
1701 |
+
if ( false !== $api && isset( $api->requires ) ) {
|
1702 |
+
return version_compare( $GLOBALS['wp_version'], $api->requires, '>=' );
|
1703 |
+
}
|
1704 |
+
|
1705 |
+
// No usable info received from the plugins API, presume we can update.
|
1706 |
+
return true;
|
1707 |
+
}
|
1708 |
+
|
1709 |
+
/**
|
1710 |
+
* Check if a plugin can be activated, i.e. is not currently active and meets the minimum
|
1711 |
+
* plugin version requirements set in TGMPA (if any).
|
1712 |
+
*
|
1713 |
+
* @since 2.5.0
|
1714 |
+
*
|
1715 |
+
* @param string $slug Plugin slug.
|
1716 |
+
* @return bool True if OK to activate, false otherwise.
|
1717 |
+
*/
|
1718 |
+
public function can_plugin_activate( $slug ) {
|
1719 |
+
return ( ! $this->is_plugin_active( $slug ) && ! $this->does_plugin_require_update( $slug ) );
|
1720 |
+
}
|
1721 |
+
|
1722 |
+
/**
|
1723 |
+
* Retrieve the version number of an installed plugin.
|
1724 |
+
*
|
1725 |
+
* @since 2.5.0
|
1726 |
+
*
|
1727 |
+
* @param string $slug Plugin slug.
|
1728 |
+
* @return string Version number as string or an empty string if the plugin is not installed
|
1729 |
+
* or version unknown (plugins which don't comply with the plugin header standard).
|
1730 |
+
*/
|
1731 |
+
public function get_installed_version( $slug ) {
|
1732 |
+
$installed_plugins = $this->get_plugins(); // Retrieve a list of all installed plugins (WP cached).
|
1733 |
+
|
1734 |
+
if ( ! empty( $installed_plugins[ $this->plugins[ $slug ]['file_path'] ]['Version'] ) ) {
|
1735 |
+
return $installed_plugins[ $this->plugins[ $slug ]['file_path'] ]['Version'];
|
1736 |
+
}
|
1737 |
+
|
1738 |
+
return '';
|
1739 |
+
}
|
1740 |
+
|
1741 |
+
/**
|
1742 |
+
* Check whether a plugin complies with the minimum version requirements.
|
1743 |
+
*
|
1744 |
+
* @since 2.5.0
|
1745 |
+
*
|
1746 |
+
* @param string $slug Plugin slug.
|
1747 |
+
* @return bool True when a plugin needs to be updated, otherwise false.
|
1748 |
+
*/
|
1749 |
+
public function does_plugin_require_update( $slug ) {
|
1750 |
+
$installed_version = $this->get_installed_version( $slug );
|
1751 |
+
$minimum_version = $this->plugins[ $slug ]['version'];
|
1752 |
+
|
1753 |
+
return version_compare( $minimum_version, $installed_version, '>' );
|
1754 |
+
}
|
1755 |
+
|
1756 |
+
/**
|
1757 |
+
* Check whether there is an update available for a plugin.
|
1758 |
+
*
|
1759 |
+
* @since 2.5.0
|
1760 |
+
*
|
1761 |
+
* @param string $slug Plugin slug.
|
1762 |
+
* @return false|string Version number string of the available update or false if no update available.
|
1763 |
+
*/
|
1764 |
+
public function does_plugin_have_update( $slug ) {
|
1765 |
+
// Presume bundled and external plugins will point to a package which meets the minimum required version.
|
1766 |
+
if ( 'repo' !== $this->plugins[ $slug ]['source_type'] ) {
|
1767 |
+
if ( $this->does_plugin_require_update( $slug ) ) {
|
1768 |
+
return $this->plugins[ $slug ]['version'];
|
1769 |
+
}
|
1770 |
+
|
1771 |
+
return false;
|
1772 |
+
}
|
1773 |
+
|
1774 |
+
$repo_updates = get_site_transient( 'update_plugins' );
|
1775 |
+
|
1776 |
+
if ( isset( $repo_updates->response[ $this->plugins[ $slug ]['file_path'] ]->new_version ) ) {
|
1777 |
+
return $repo_updates->response[ $this->plugins[ $slug ]['file_path'] ]->new_version;
|
1778 |
+
}
|
1779 |
+
|
1780 |
+
return false;
|
1781 |
+
}
|
1782 |
+
|
1783 |
+
/**
|
1784 |
+
* Retrieve potential upgrade notice for a plugin.
|
1785 |
+
*
|
1786 |
+
* @since 2.5.0
|
1787 |
+
*
|
1788 |
+
* @param string $slug Plugin slug.
|
1789 |
+
* @return string The upgrade notice or an empty string if no message was available or provided.
|
1790 |
+
*/
|
1791 |
+
public function get_upgrade_notice( $slug ) {
|
1792 |
+
// We currently can't get reliable info on non-WP-repo plugins - issue #380.
|
1793 |
+
if ( 'repo' !== $this->plugins[ $slug ]['source_type'] ) {
|
1794 |
+
return '';
|
1795 |
+
}
|
1796 |
+
|
1797 |
+
$repo_updates = get_site_transient( 'update_plugins' );
|
1798 |
+
|
1799 |
+
if ( ! empty( $repo_updates->response[ $this->plugins[ $slug ]['file_path'] ]->upgrade_notice ) ) {
|
1800 |
+
return $repo_updates->response[ $this->plugins[ $slug ]['file_path'] ]->upgrade_notice;
|
1801 |
+
}
|
1802 |
+
|
1803 |
+
return '';
|
1804 |
+
}
|
1805 |
+
|
1806 |
+
/**
|
1807 |
+
* Wrapper around the core WP get_plugins function, making sure it's actually available.
|
1808 |
+
*
|
1809 |
+
* @since 2.5.0
|
1810 |
+
*
|
1811 |
+
* @param string $plugin_folder Optional. Relative path to single plugin folder.
|
1812 |
+
* @return array Array of installed plugins with plugin information.
|
1813 |
+
*/
|
1814 |
+
public function get_plugins( $plugin_folder = '' ) {
|
1815 |
+
if ( ! function_exists( 'get_plugins' ) ) {
|
1816 |
+
require_once ABSPATH . 'wp-admin/includes/plugin.php';
|
1817 |
+
}
|
1818 |
+
|
1819 |
+
return get_plugins( $plugin_folder );
|
1820 |
+
}
|
1821 |
+
|
1822 |
+
/**
|
1823 |
+
* Delete dismissable nag option when theme is switched.
|
1824 |
+
*
|
1825 |
+
* This ensures that the user(s) is/are again reminded via nag of required
|
1826 |
+
* and/or recommended plugins if they re-activate the theme.
|
1827 |
+
*
|
1828 |
+
* @since 2.1.1
|
1829 |
+
*/
|
1830 |
+
public function update_dismiss() {
|
1831 |
+
delete_metadata( 'user', null, 'tgmpa_dismissed_notice_' . $this->id, null, true );
|
1832 |
+
}
|
1833 |
+
|
1834 |
+
/**
|
1835 |
+
* Forces plugin activation if the parameter 'force_activation' is
|
1836 |
+
* set to true.
|
1837 |
+
*
|
1838 |
+
* This allows theme authors to specify certain plugins that must be
|
1839 |
+
* active at all times while using the current theme.
|
1840 |
+
*
|
1841 |
+
* Please take special care when using this parameter as it has the
|
1842 |
+
* potential to be harmful if not used correctly. Setting this parameter
|
1843 |
+
* to true will not allow the specified plugin to be deactivated unless
|
1844 |
+
* the user switches themes.
|
1845 |
+
*
|
1846 |
+
* @since 2.2.0
|
1847 |
+
*/
|
1848 |
+
public function force_activation() {
|
1849 |
+
foreach ( $this->plugins as $slug => $plugin ) {
|
1850 |
+
if ( true === $plugin['force_activation'] ) {
|
1851 |
+
if ( ! $this->is_plugin_installed( $slug ) ) {
|
1852 |
+
// Oops, plugin isn't there so iterate to next condition.
|
1853 |
+
continue;
|
1854 |
+
} elseif ( $this->can_plugin_activate( $slug ) ) {
|
1855 |
+
// There we go, activate the plugin.
|
1856 |
+
activate_plugin( $plugin['file_path'] );
|
1857 |
+
}
|
1858 |
+
}
|
1859 |
+
}
|
1860 |
+
}
|
1861 |
+
|
1862 |
+
/**
|
1863 |
+
* Forces plugin deactivation if the parameter 'force_deactivation'
|
1864 |
+
* is set to true.
|
1865 |
+
*
|
1866 |
+
* This allows theme authors to specify certain plugins that must be
|
1867 |
+
* deactivated upon switching from the current theme to another.
|
1868 |
+
*
|
1869 |
+
* Please take special care when using this parameter as it has the
|
1870 |
+
* potential to be harmful if not used correctly.
|
1871 |
+
*
|
1872 |
+
* @since 2.2.0
|
1873 |
+
*/
|
1874 |
+
public function force_deactivation() {
|
1875 |
+
foreach ( $this->plugins as $slug => $plugin ) {
|
1876 |
+
// Only proceed forward if the parameter is set to true and plugin is active.
|
1877 |
+
if ( true === $plugin['force_deactivation'] && $this->is_plugin_active( $slug ) ) {
|
1878 |
+
deactivate_plugins( $plugin['file_path'] );
|
1879 |
+
}
|
1880 |
+
}
|
1881 |
+
}
|
1882 |
+
|
1883 |
+
/**
|
1884 |
+
* Echo the current TGMPA version number to the page.
|
1885 |
+
*/
|
1886 |
+
public function show_tgmpa_version() {
|
1887 |
+
echo '<p style="float: right; padding: 0em 1.5em 0.5em 0;"><strong><small>',
|
1888 |
+
esc_html( sprintf( _x( 'TGMPA v%s', '%s = version number', 'weaver-xtreme' ), self::TGMPA_VERSION ) ),
|
1889 |
+
'</small></strong></p>';
|
1890 |
+
}
|
1891 |
+
|
1892 |
+
/**
|
1893 |
+
* Returns the singleton instance of the class.
|
1894 |
+
*
|
1895 |
+
* @since 2.4.0
|
1896 |
+
*
|
1897 |
+
* @return object The TGM_Plugin_Activation object.
|
1898 |
+
*/
|
1899 |
+
public static function get_instance() {
|
1900 |
+
if ( ! isset( self::$instance ) && ! ( self::$instance instanceof self ) ) {
|
1901 |
+
self::$instance = new self();
|
1902 |
+
}
|
1903 |
+
|
1904 |
+
return self::$instance;
|
1905 |
+
}
|
1906 |
+
}
|
1907 |
+
|
1908 |
+
if ( ! function_exists( 'load_tgm_plugin_activation' ) ) {
|
1909 |
+
/**
|
1910 |
+
* Ensure only one instance of the class is ever invoked.
|
1911 |
+
*/
|
1912 |
+
function load_tgm_plugin_activation() {
|
1913 |
+
$GLOBALS['tgmpa'] = TGM_Plugin_Activation::get_instance();
|
1914 |
+
}
|
1915 |
+
}
|
1916 |
+
|
1917 |
+
if ( did_action( 'plugins_loaded' ) ) {
|
1918 |
+
load_tgm_plugin_activation();
|
1919 |
+
} else {
|
1920 |
+
add_action( 'plugins_loaded', 'load_tgm_plugin_activation' );
|
1921 |
+
}
|
1922 |
+
}
|
1923 |
+
|
1924 |
+
if ( ! function_exists( 'tgmpa' ) ) {
|
1925 |
+
/**
|
1926 |
+
* Helper function to register a collection of required plugins.
|
1927 |
+
*
|
1928 |
+
* @since 2.0.0
|
1929 |
+
* @api
|
1930 |
+
*
|
1931 |
+
* @param array $plugins An array of plugin arrays.
|
1932 |
+
* @param array $config Optional. An array of configuration values.
|
1933 |
+
*/
|
1934 |
+
function tgmpa( $plugins, $config = array() ) {
|
1935 |
+
$instance = call_user_func( array( get_class( $GLOBALS['tgmpa'] ), 'get_instance' ) );
|
1936 |
+
|
1937 |
+
foreach ( $plugins as $plugin ) {
|
1938 |
+
call_user_func( array( $instance, 'register' ), $plugin );
|
1939 |
+
}
|
1940 |
+
|
1941 |
+
if ( ! empty( $config ) && is_array( $config ) ) {
|
1942 |
+
// Send out notices for deprecated arguments passed.
|
1943 |
+
if ( isset( $config['notices'] ) ) {
|
1944 |
+
_deprecated_argument( __FUNCTION__, '2.2.0', 'The `notices` config parameter was renamed to `has_notices` in TGMPA 2.2.0. Please adjust your configuration.' );
|
1945 |
+
if ( ! isset( $config['has_notices'] ) ) {
|
1946 |
+
$config['has_notices'] = $config['notices'];
|
1947 |
+
}
|
1948 |
+
}
|
1949 |
+
|
1950 |
+
if ( isset( $config['parent_menu_slug'] ) ) {
|
1951 |
+
_deprecated_argument( __FUNCTION__, '2.4.0', 'The `parent_menu_slug` config parameter was removed in TGMPA 2.4.0. In TGMPA 2.5.0 an alternative was (re-)introduced. Please adjust your configuration. For more information visit the website: http://tgmpluginactivation.com/configuration/#h-configuration-options.' );
|
1952 |
+
}
|
1953 |
+
if ( isset( $config['parent_url_slug'] ) ) {
|
1954 |
+
_deprecated_argument( __FUNCTION__, '2.4.0', 'The `parent_url_slug` config parameter was removed in TGMPA 2.4.0. In TGMPA 2.5.0 an alternative was (re-)introduced. Please adjust your configuration. For more information visit the website: http://tgmpluginactivation.com/configuration/#h-configuration-options.' );
|
1955 |
+
}
|
1956 |
+
|
1957 |
+
call_user_func( array( $instance, 'config' ), $config );
|
1958 |
+
}
|
1959 |
+
}
|
1960 |
+
}
|
1961 |
+
|
1962 |
+
/**
|
1963 |
+
* WP_List_Table isn't always available. If it isn't available,
|
1964 |
+
* we load it here.
|
1965 |
+
*
|
1966 |
+
* @since 2.2.0
|
1967 |
+
*/
|
1968 |
+
if ( ! class_exists( 'WP_List_Table' ) ) {
|
1969 |
+
require_once ABSPATH . 'wp-admin/includes/class-wp-list-table.php';
|
1970 |
+
}
|
1971 |
+
|
1972 |
+
if ( ! class_exists( 'TGMPA_List_Table' ) ) {
|
1973 |
+
|
1974 |
+
/**
|
1975 |
+
* List table class for handling plugins.
|
1976 |
+
*
|
1977 |
+
* Extends the WP_List_Table class to provide a future-compatible
|
1978 |
+
* way of listing out all required/recommended plugins.
|
1979 |
+
*
|
1980 |
+
* Gives users an interface similar to the Plugin Administration
|
1981 |
+
* area with similar (albeit stripped down) capabilities.
|
1982 |
+
*
|
1983 |
+
* This class also allows for the bulk install of plugins.
|
1984 |
+
*
|
1985 |
+
* @since 2.2.0
|
1986 |
+
*
|
1987 |
+
* @package TGM-Plugin-Activation
|
1988 |
+
* @author Thomas Griffin
|
1989 |
+
* @author Gary Jones
|
1990 |
+
*/
|
1991 |
+
class TGMPA_List_Table extends WP_List_Table {
|
1992 |
+
/**
|
1993 |
+
* TGMPA instance.
|
1994 |
+
*
|
1995 |
+
* @since 2.5.0
|
1996 |
+
*
|
1997 |
+
* @var object
|
1998 |
+
*/
|
1999 |
+
protected $tgmpa;
|
2000 |
+
|
2001 |
+
/**
|
2002 |
+
* The currently chosen view.
|
2003 |
+
*
|
2004 |
+
* @since 2.5.0
|
2005 |
+
*
|
2006 |
+
* @var string One of: 'all', 'install', 'update', 'activate'
|
2007 |
+
*/
|
2008 |
+
public $view_context = 'all';
|
2009 |
+
|
2010 |
+
/**
|
2011 |
+
* The plugin counts for the various views.
|
2012 |
+
*
|
2013 |
+
* @since 2.5.0
|
2014 |
+
*
|
2015 |
+
* @var array
|
2016 |
+
*/
|
2017 |
+
protected $view_totals = array(
|
2018 |
+
'all' => 0,
|
2019 |
+
'install' => 0,
|
2020 |
+
'update' => 0,
|
2021 |
+
'activate' => 0,
|
2022 |
+
);
|
2023 |
+
|
2024 |
+
/**
|
2025 |
+
* References parent constructor and sets defaults for class.
|
2026 |
+
*
|
2027 |
+
* @since 2.2.0
|
2028 |
+
*/
|
2029 |
+
public function __construct() {
|
2030 |
+
$this->tgmpa = call_user_func( array( get_class( $GLOBALS['tgmpa'] ), 'get_instance' ) );
|
2031 |
+
|
2032 |
+
parent::__construct(
|
2033 |
+
array(
|
2034 |
+
'singular' => 'plugin',
|
2035 |
+
'plural' => 'plugins',
|
2036 |
+
'ajax' => false,
|
2037 |
+
)
|
2038 |
+
);
|
2039 |
+
|
2040 |
+
if ( isset( $_REQUEST['plugin_status'] ) && in_array( $_REQUEST['plugin_status'], array( 'install', 'update', 'activate' ), true ) ) {
|
2041 |
+
$this->view_context = sanitize_key( $_REQUEST['plugin_status'] );
|
2042 |
+
}
|
2043 |
+
|
2044 |
+
add_filter( 'tgmpa_table_data_items', array( $this, 'sort_table_items' ) );
|
2045 |
+
}
|
2046 |
+
|
2047 |
+
/**
|
2048 |
+
* Get a list of CSS classes for the <table> tag.
|
2049 |
+
*
|
2050 |
+
* Overruled to prevent the 'plural' argument from being added.
|
2051 |
+
*
|
2052 |
+
* @since 2.5.0
|
2053 |
+
*
|
2054 |
+
* @return array CSS classnames.
|
2055 |
+
*/
|
2056 |
+
public function get_table_classes() {
|
2057 |
+
return array( 'widefat', 'fixed' );
|
2058 |
+
}
|
2059 |
+
|
2060 |
+
/**
|
2061 |
+
* Gathers and renames all of our plugin information to be used by WP_List_Table to create our table.
|
2062 |
+
*
|
2063 |
+
* @since 2.2.0
|
2064 |
+
*
|
2065 |
+
* @return array $table_data Information for use in table.
|
2066 |
+
*/
|
2067 |
+
protected function _gather_plugin_data() {
|
2068 |
+
// Load thickbox for plugin links.
|
2069 |
+
$this->tgmpa->admin_init();
|
2070 |
+
$this->tgmpa->thickbox();
|
2071 |
+
|
2072 |
+
// Categorize the plugins which have open actions.
|
2073 |
+
$plugins = $this->categorize_plugins_to_views();
|
2074 |
+
|
2075 |
+
// Set the counts for the view links.
|
2076 |
+
$this->set_view_totals( $plugins );
|
2077 |
+
|
2078 |
+
// Prep variables for use and grab list of all installed plugins.
|
2079 |
+
$table_data = array();
|
2080 |
+
$i = 0;
|
2081 |
+
|
2082 |
+
// Redirect to the 'all' view if no plugins were found for the selected view context.
|
2083 |
+
if ( empty( $plugins[ $this->view_context ] ) ) {
|
2084 |
+
$this->view_context = 'all';
|
2085 |
+
}
|
2086 |
+
|
2087 |
+
foreach ( $plugins[ $this->view_context ] as $slug => $plugin ) {
|
2088 |
+
$table_data[ $i ]['sanitized_plugin'] = $plugin['name'];
|
2089 |
+
$table_data[ $i ]['slug'] = $slug;
|
2090 |
+
$table_data[ $i ]['plugin'] = '<strong>' . $this->tgmpa->get_info_link( $slug ) . '</strong>';
|
2091 |
+
$table_data[ $i ]['source'] = $this->get_plugin_source_type_text( $plugin['source_type'] );
|
2092 |
+
$table_data[ $i ]['type'] = $this->get_plugin_advise_type_text( $plugin['required'] );
|
2093 |
+
$table_data[ $i ]['status'] = $this->get_plugin_status_text( $slug );
|
2094 |
+
$table_data[ $i ]['installed_version'] = $this->tgmpa->get_installed_version( $slug );
|
2095 |
+
$table_data[ $i ]['minimum_version'] = $plugin['version'];
|
2096 |
+
$table_data[ $i ]['available_version'] = $this->tgmpa->does_plugin_have_update( $slug );
|
2097 |
+
|
2098 |
+
// Prep the upgrade notice info.
|
2099 |
+
$upgrade_notice = $this->tgmpa->get_upgrade_notice( $slug );
|
2100 |
+
if ( ! empty( $upgrade_notice ) ) {
|
2101 |
+
$table_data[ $i ]['upgrade_notice'] = $upgrade_notice;
|
2102 |
+
|
2103 |
+
add_action( "tgmpa_after_plugin_row_$slug", array( $this, 'wp_plugin_update_row' ), 10, 2 );
|
2104 |
+
}
|
2105 |
+
|
2106 |
+
$table_data[ $i ] = apply_filters( 'tgmpa_table_data_item', $table_data[ $i ], $plugin );
|
2107 |
+
|
2108 |
+
$i++;
|
2109 |
+
}
|
2110 |
+
|
2111 |
+
return $table_data;
|
2112 |
+
}
|
2113 |
+
|
2114 |
+
/**
|
2115 |
+
* Categorize the plugins which have open actions into views for the TGMPA page.
|
2116 |
+
*
|
2117 |
+
* @since 2.5.0
|
2118 |
+
*/
|
2119 |
+
protected function categorize_plugins_to_views() {
|
2120 |
+
$plugins = array(
|
2121 |
+
'all' => array(), // Meaning: all plugins which still have open actions.
|
2122 |
+
'install' => array(),
|
2123 |
+
'update' => array(),
|
2124 |
+
'activate' => array(),
|
2125 |
+
);
|
2126 |
+
|
2127 |
+
foreach ( $this->tgmpa->plugins as $slug => $plugin ) {
|
2128 |
+
if ( $this->tgmpa->is_plugin_active( $slug ) && false === $this->tgmpa->does_plugin_have_update( $slug ) ) {
|
2129 |
+
// No need to display plugins if they are installed, up-to-date and active.
|
2130 |
+
continue;
|
2131 |
+
} else {
|
2132 |
+
$plugins['all'][ $slug ] = $plugin;
|
2133 |
+
|
2134 |
+
if ( ! $this->tgmpa->is_plugin_installed( $slug ) ) {
|
2135 |
+
$plugins['install'][ $slug ] = $plugin;
|
2136 |
+
} else {
|
2137 |
+
if ( false !== $this->tgmpa->does_plugin_have_update( $slug ) ) {
|
2138 |
+
$plugins['update'][ $slug ] = $plugin;
|
2139 |
+
}
|
2140 |
+
|
2141 |
+
if ( $this->tgmpa->can_plugin_activate( $slug ) ) {
|
2142 |
+
$plugins['activate'][ $slug ] = $plugin;
|
2143 |
+
}
|
2144 |
+
}
|
2145 |
+
}
|
2146 |
+
}
|
2147 |
+
|
2148 |
+
return $plugins;
|
2149 |
+
}
|
2150 |
+
|
2151 |
+
/**
|
2152 |
+
* Set the counts for the view links.
|
2153 |
+
*
|
2154 |
+
* @since 2.5.0
|
2155 |
+
*
|
2156 |
+
* @param array $plugins Plugins order by view.
|
2157 |
+
*/
|
2158 |
+
protected function set_view_totals( $plugins ) {
|
2159 |
+
foreach ( $plugins as $type => $list ) {
|
2160 |
+
$this->view_totals[ $type ] = count( $list );
|
2161 |
+
}
|
2162 |
+
}
|
2163 |
+
|
2164 |
+
/**
|
2165 |
+
* Get the plugin required/recommended text string.
|
2166 |
+
*
|
2167 |
+
* @since 2.5.0
|
2168 |
+
*
|
2169 |
+
* @param string $required Plugin required setting.
|
2170 |
+
* @return string
|
2171 |
+
*/
|
2172 |
+
protected function get_plugin_advise_type_text( $required ) {
|
2173 |
+
if ( true === $required ) {
|
2174 |
+
return __( 'Required', 'weaver-xtreme' );
|
2175 |
+
}
|
2176 |
+
|
2177 |
+
return __( 'Recommended', 'weaver-xtreme' );
|
2178 |
+
}
|
2179 |
+
|
2180 |
+
/**
|
2181 |
+
* Get the plugin source type text string.
|
2182 |
+
*
|
2183 |
+
* @since 2.5.0
|
2184 |
+
*
|
2185 |
+
* @param string $type Plugin type.
|
2186 |
+
* @return string
|
2187 |
+
*/
|
2188 |
+
protected function get_plugin_source_type_text( $type ) {
|
2189 |
+
$string = '';
|
2190 |
+
|
2191 |
+
switch ( $type ) {
|
2192 |
+
case 'repo':
|
2193 |
+
$string = __( 'WordPress Repository', 'weaver-xtreme' );
|
2194 |
+
break;
|
2195 |
+
case 'external':
|
2196 |
+
$string = __( 'External Source', 'weaver-xtreme' );
|
2197 |
+
break;
|
2198 |
+
case 'bundled':
|
2199 |
+
$string = __( 'Pre-Packaged', 'weaver-xtreme' );
|
2200 |
+
break;
|
2201 |
+
}
|
2202 |
+
|
2203 |
+
return $string;
|
2204 |
+
}
|
2205 |
+
|
2206 |
+
/**
|
2207 |
+
* Determine the plugin status message.
|
2208 |
+
*
|
2209 |
+
* @since 2.5.0
|
2210 |
+
*
|
2211 |
+
* @param string $slug Plugin slug.
|
2212 |
+
* @return string
|
2213 |
+
*/
|
2214 |
+
protected function get_plugin_status_text( $slug ) {
|
2215 |
+
if ( ! $this->tgmpa->is_plugin_installed( $slug ) ) {
|
2216 |
+
return __( 'Not Installed', 'weaver-xtreme' );
|
2217 |
+
}
|
2218 |
+
|
2219 |
+
if ( ! $this->tgmpa->is_plugin_active( $slug ) ) {
|
2220 |
+
$install_status = __( 'Installed But Not Activated', 'weaver-xtreme' );
|
2221 |
+
} else {
|
2222 |
+
$install_status = __( 'Active', 'weaver-xtreme' );
|
2223 |
+
}
|
2224 |
+
|
2225 |
+
$update_status = '';
|
2226 |
+
|
2227 |
+
if ( $this->tgmpa->does_plugin_require_update( $slug ) && false === $this->tgmpa->does_plugin_have_update( $slug ) ) {
|
2228 |
+
$update_status = __( 'Required Update not Available', 'weaver-xtreme' );
|
2229 |
+
|
2230 |
+
} elseif ( $this->tgmpa->does_plugin_require_update( $slug ) ) {
|
2231 |
+
$update_status = __( 'Requires Update', 'weaver-xtreme' );
|
2232 |
+
|
2233 |
+
} elseif ( false !== $this->tgmpa->does_plugin_have_update( $slug ) ) {
|
2234 |
+
$update_status = __( 'Update recommended', 'weaver-xtreme' );
|
2235 |
+
}
|
2236 |
+
|
2237 |
+
if ( '' === $update_status ) {
|
2238 |
+
return $install_status;
|
2239 |
+
}
|
2240 |
+
|
2241 |
+
return sprintf(
|
2242 |
+
_x( '%1$s, %2$s', '%1$s = install status, %2$s = update status', 'weaver-xtreme' ),
|
2243 |
+
$install_status,
|
2244 |
+
$update_status
|
2245 |
+
);
|
2246 |
+
}
|
2247 |
+
|
2248 |
+
/**
|
2249 |
+
* Sort plugins by Required/Recommended type and by alphabetical plugin name within each type.
|
2250 |
+
*
|
2251 |
+
* @since 2.5.0
|
2252 |
+
*
|
2253 |
+
* @param array $items Prepared table items.
|
2254 |
+
* @return array Sorted table items.
|
2255 |
+
*/
|
2256 |
+
public function sort_table_items( $items ) {
|
2257 |
+
$type = array();
|
2258 |
+
$name = array();
|
2259 |
+
|
2260 |
+
foreach ( $items as $i => $plugin ) {
|
2261 |
+
$type[ $i ] = $plugin['type']; // Required / recommended.
|
2262 |
+
$name[ $i ] = $plugin['sanitized_plugin'];
|
2263 |
+
}
|
2264 |
+
|
2265 |
+
array_multisort( $type, SORT_DESC, $name, SORT_ASC, $items );
|
2266 |
+
|
2267 |
+
return $items;
|
2268 |
+
}
|
2269 |
+
|
2270 |
+
/**
|
2271 |
+
* Get an associative array ( id => link ) of the views available on this table.
|
2272 |
+
*
|
2273 |
+
* @since 2.5.0
|
2274 |
+
*
|
2275 |
+
* @return array
|
2276 |
+
*/
|
2277 |
+
public function get_views() {
|
2278 |
+
$status_links = array();
|
2279 |
+
|
2280 |
+
foreach ( $this->view_totals as $type => $count ) {
|
2281 |
+
if ( $count < 1 ) {
|
2282 |
+
continue;
|
2283 |
+
}
|
2284 |
+
|
2285 |
+
switch ( $type ) {
|
2286 |
+
case 'all':
|
2287 |
+
$text = _nx( 'All <span class="count">(%s)</span>', 'All <span class="count">(%s)</span>', $count, 'plugins', 'weaver-xtreme' );
|
2288 |
+
break;
|
2289 |
+
case 'install':
|
2290 |
+
$text = _n( 'To Install <span class="count">(%s)</span>', 'To Install <span class="count">(%s)</span>', $count, 'weaver-xtreme' );
|
2291 |
+
break;
|
2292 |
+
case 'update':
|
2293 |
+
$text = _n( 'Update Available <span class="count">(%s)</span>', 'Update Available <span class="count">(%s)</span>', $count, 'weaver-xtreme' );
|
2294 |
+
break;
|
2295 |
+
case 'activate':
|
2296 |
+
$text = _n( 'To Activate <span class="count">(%s)</span>', 'To Activate <span class="count">(%s)</span>', $count, 'weaver-xtreme' );
|
2297 |
+
break;
|
2298 |
+
default:
|
2299 |
+
$text = '';
|
2300 |
+
break;
|
2301 |
+
}
|
2302 |
+
|
2303 |
+
if ( ! empty( $text ) ) {
|
2304 |
+
|
2305 |
+
$status_links[ $type ] = sprintf(
|
2306 |
+
'<a href="%s"%s>%s</a>',
|
2307 |
+
esc_url( $this->tgmpa->get_tgmpa_status_url( $type ) ),
|
2308 |
+
( $type === $this->view_context ) ? ' class="current"' : '',
|
2309 |
+
sprintf( $text, number_format_i18n( $count ) )
|
2310 |
+
);
|
2311 |
+
}
|
2312 |
+
}
|
2313 |
+
|
2314 |
+
return $status_links;
|
2315 |
+
}
|
2316 |
+
|
2317 |
+
/**
|
2318 |
+
* Create default columns to display important plugin information
|
2319 |
+
* like type, action and status.
|
2320 |
+
*
|
2321 |
+
* @since 2.2.0
|
2322 |
+
*
|
2323 |
+
* @param array $item Array of item data.
|
2324 |
+
* @param string $column_name The name of the column.
|
2325 |
+
* @return string
|
2326 |
+
*/
|
2327 |
+
public function column_default( $item, $column_name ) {
|
2328 |
+
return $item[ $column_name ];
|
2329 |
+
}
|
2330 |
+
|
2331 |
+
/**
|
2332 |
+
* Required for bulk installing.
|
2333 |
+
*
|
2334 |
+
* Adds a checkbox for each plugin.
|
2335 |
+
*
|
2336 |
+
* @since 2.2.0
|
2337 |
+
*
|
2338 |
+
* @param array $item Array of item data.
|
2339 |
+
* @return string The input checkbox with all necessary info.
|
2340 |
+
*/
|
2341 |
+
public function column_cb( $item ) {
|
2342 |
+
return sprintf(
|
2343 |
+
'<input type="checkbox" name="%1$s[]" value="%2$s" id="%3$s" />',
|
2344 |
+
esc_attr( $this->_args['singular'] ),
|
2345 |
+
esc_attr( $item['slug'] ),
|
2346 |
+
esc_attr( $item['sanitized_plugin'] )
|
2347 |
+
);
|
2348 |
+
}
|
2349 |
+
|
2350 |
+
/**
|
2351 |
+
* Create default title column along with the action links.
|
2352 |
+
*
|
2353 |
+
* @since 2.2.0
|
2354 |
+
*
|
2355 |
+
* @param array $item Array of item data.
|
2356 |
+
* @return string The plugin name and action links.
|
2357 |
+
*/
|
2358 |
+
public function column_plugin( $item ) {
|
2359 |
+
return sprintf(
|
2360 |
+
'%1$s %2$s',
|
2361 |
+
$item['plugin'],
|
2362 |
+
$this->row_actions( $this->get_row_actions( $item ), true )
|
2363 |
+
);
|
2364 |
+
}
|
2365 |
+
|
2366 |
+
/**
|
2367 |
+
* Create version information column.
|
2368 |
+
*
|
2369 |
+
* @since 2.5.0
|
2370 |
+
*
|
2371 |
+
* @param array $item Array of item data.
|
2372 |
+
* @return string HTML-formatted version information.
|
2373 |
+
*/
|
2374 |
+
public function column_version( $item ) {
|
2375 |
+
$output = array();
|
2376 |
+
|
2377 |
+
if ( $this->tgmpa->is_plugin_installed( $item['slug'] ) ) {
|
2378 |
+
$installed = ! empty( $item['installed_version'] ) ? $item['installed_version'] : _x( 'unknown', 'as in: "version nr unknown"', 'weaver-xtreme' );
|
2379 |
+
|
2380 |
+
$color = '';
|
2381 |
+
if ( ! empty( $item['minimum_version'] ) && $this->tgmpa->does_plugin_require_update( $item['slug'] ) ) {
|
2382 |
+
$color = ' color: #ff0000; font-weight: bold;';
|
2383 |
+
}
|
2384 |
+
|
2385 |
+
$output[] = sprintf(
|
2386 |
+
'<p><span style="min-width: 32px; text-align: right; float: right;%1$s">%2$s</span>' . __( 'Installed version:', 'weaver-xtreme' ) . '</p>',
|
2387 |
+
$color,
|
2388 |
+
$installed
|
2389 |
+
);
|
2390 |
+
}
|
2391 |
+
|
2392 |
+
if ( ! empty( $item['minimum_version'] ) ) {
|
2393 |
+
$output[] = sprintf(
|
2394 |
+
'<p><span style="min-width: 32px; text-align: right; float: right;">%1$s</span>' . __( 'Minimum required version:', 'weaver-xtreme' ) . '</p>',
|
2395 |
+
$item['minimum_version']
|
2396 |
+
);
|
2397 |
+
}
|
2398 |
+
|
2399 |
+
if ( ! empty( $item['available_version'] ) ) {
|
2400 |
+
$color = '';
|
2401 |
+
if ( ! empty( $item['minimum_version'] ) && version_compare( $item['available_version'], $item['minimum_version'], '>=' ) ) {
|
2402 |
+
$color = ' color: #71C671; font-weight: bold;';
|
2403 |
+
}
|
2404 |
+
|
2405 |
+
$output[] = sprintf(
|
2406 |
+
'<p><span style="min-width: 32px; text-align: right; float: right;%1$s">%2$s</span>' . __( 'Available version:', 'weaver-xtreme' ) . '</p>',
|
2407 |
+
$color,
|
2408 |
+
$item['available_version']
|
2409 |
+
);
|
2410 |
+
}
|
2411 |
+
|
2412 |
+
if ( empty( $output ) ) {
|
2413 |
+
return ' '; // Let's not break the table layout.
|
2414 |
+
} else {
|
2415 |
+
return implode( "\n", $output );
|
2416 |
+
}
|
2417 |
+
}
|
2418 |
+
|
2419 |
+
/**
|
2420 |
+
* Sets default message within the plugins table if no plugins
|
2421 |
+
* are left for interaction.
|
2422 |
+
*
|
2423 |
+
* Hides the menu item to prevent the user from clicking and
|
2424 |
+
* getting a permissions error.
|
2425 |
+
*
|
2426 |
+
* @since 2.2.0
|
2427 |
+
*/
|
2428 |
+
public function no_items() {
|
2429 |
+
printf( wp_kses_post( __( 'No plugins to install, update or activate. <a href="%1$s">Return to the Dashboard</a>', 'weaver-xtreme' ) ), esc_url( self_admin_url() ) );
|
2430 |
+
echo '<style type="text/css">#adminmenu .wp-submenu li.current { display: none !important; }</style>';
|
2431 |
+
}
|
2432 |
+
|
2433 |
+
/**
|
2434 |
+
* Output all the column information within the table.
|
2435 |
+
*
|
2436 |
+
* @since 2.2.0
|
2437 |
+
*
|
2438 |
+
* @return array $columns The column names.
|
2439 |
+
*/
|
2440 |
+
public function get_columns() {
|
2441 |
+
$columns = array(
|
2442 |
+
'cb' => '<input type="checkbox" />',
|
2443 |
+
'plugin' => __( 'Plugin', 'weaver-xtreme' ),
|
2444 |
+
'source' => __( 'Source', 'weaver-xtreme' ),
|
2445 |
+
'type' => __( 'Type', 'weaver-xtreme' ),
|
2446 |
+
);
|
2447 |
+
|
2448 |
+
if ( 'all' === $this->view_context || 'update' === $this->view_context ) {
|
2449 |
+
$columns['version'] = __( 'Version', 'weaver-xtreme' );
|
2450 |
+
$columns['status'] = __( 'Status', 'weaver-xtreme' );
|
2451 |
+
}
|
2452 |
+
|
2453 |
+
return apply_filters( 'tgmpa_table_columns', $columns );
|
2454 |
+
}
|
2455 |
+
|
2456 |
+
/**
|
2457 |
+
* Get name of default primary column
|
2458 |
+
*
|
2459 |
+
* @since 2.5.0 / WP 4.3+ compatibility
|
2460 |
+
* @access protected
|
2461 |
+
*
|
2462 |
+
* @return string
|
2463 |
+
*/
|
2464 |
+
protected function get_default_primary_column_name() {
|
2465 |
+
return 'plugin';
|
2466 |
+
}
|
2467 |
+
|
2468 |
+
/**
|
2469 |
+
* Get the name of the primary column.
|
2470 |
+
*
|
2471 |
+
* @since 2.5.0 / WP 4.3+ compatibility
|
2472 |
+
* @access protected
|
2473 |
+
*
|
2474 |
+
* @return string The name of the primary column.
|
2475 |
+
*/
|
2476 |
+
protected function get_primary_column_name() {
|
2477 |
+
if ( method_exists( 'WP_List_Table', 'get_primary_column_name' ) ) {
|
2478 |
+
return parent::get_primary_column_name();
|
2479 |
+
} else {
|
2480 |
+
return $this->get_default_primary_column_name();
|
2481 |
+
}
|
2482 |
+
}
|
2483 |
+
|
2484 |
+
/**
|
2485 |
+
* Get the actions which are relevant for a specific plugin row.
|
2486 |
+
*
|
2487 |
+
* @since 2.5.0
|
2488 |
+
*
|
2489 |
+
* @param array $item Array of item data.
|
2490 |
+
* @return array Array with relevant action links.
|
2491 |
+
*/
|
2492 |
+
protected function get_row_actions( $item ) {
|
2493 |
+
$actions = array();
|
2494 |
+
$action_links = array();
|
2495 |
+
|
2496 |
+
// Display the 'Install' action link if the plugin is not yet available.
|
2497 |
+
if ( ! $this->tgmpa->is_plugin_installed( $item['slug'] ) ) {
|
2498 |
+
$actions['install'] = _x( 'Install %2$s', '%2$s = plugin name in screen reader markup', 'weaver-xtreme' );
|
2499 |
+
} else {
|
2500 |
+
// Display the 'Update' action link if an update is available and WP complies with plugin minimum.
|
2501 |
+
if ( false !== $this->tgmpa->does_plugin_have_update( $item['slug'] ) && $this->tgmpa->can_plugin_update( $item['slug'] ) ) {
|
2502 |
+
$actions['update'] = _x( 'Update %2$s', '%2$s = plugin name in screen reader markup', 'weaver-xtreme' );
|
2503 |
+
}
|
2504 |
+
|
2505 |
+
// Display the 'Activate' action link, but only if the plugin meets the minimum version.
|
2506 |
+
if ( $this->tgmpa->can_plugin_activate( $item['slug'] ) ) {
|
2507 |
+
$actions['activate'] = _x( 'Activate %2$s', '%2$s = plugin name in screen reader markup', 'weaver-xtreme' );
|
2508 |
+
}
|
2509 |
+
}
|
2510 |
+
|
2511 |
+
// Create the actual links.
|
2512 |
+
foreach ( $actions as $action => $text ) {
|
2513 |
+
$nonce_url = wp_nonce_url(
|
2514 |
+
add_query_arg(
|
2515 |
+
array(
|
2516 |
+
'plugin' => urlencode( $item['slug'] ),
|
2517 |
+
'tgmpa-' . $action => $action . '-plugin',
|
2518 |
+
),
|
2519 |
+
$this->tgmpa->get_tgmpa_url()
|
2520 |
+
),
|
2521 |
+
'tgmpa-' . $action,
|
2522 |
+
'tgmpa-nonce'
|
2523 |
+
);
|
2524 |
+
|
2525 |
+
$action_links[ $action ] = sprintf(
|
2526 |
+
'<a href="%1$s">' . esc_html( $text ) . '</a>',
|
2527 |
+
esc_url( $nonce_url ),
|
2528 |
+
'<span class="screen-reader-text">' . esc_html( $item['sanitized_plugin'] ) . '</span>'
|
2529 |
+
);
|
2530 |
+
}
|
2531 |
+
|
2532 |
+
$prefix = ( defined( 'WP_NETWORK_ADMIN' ) && WP_NETWORK_ADMIN ) ? 'network_admin_' : '';
|
2533 |
+
return apply_filters( "tgmpa_{$prefix}plugin_action_links", array_filter( $action_links ), $item['slug'], $item, $this->view_context );
|
2534 |
+
}
|
2535 |
+
|
2536 |
+
/**
|
2537 |
+
* Generates content for a single row of the table.
|
2538 |
+
*
|
2539 |
+
* @since 2.5.0
|
2540 |
+
*
|
2541 |
+
* @param object $item The current item.
|
2542 |
+
*/
|
2543 |
+
public function single_row( $item ) {
|
2544 |
+
parent::single_row( $item );
|
2545 |
+
|
2546 |
+
/**
|
2547 |
+
* Fires after each specific row in the TGMPA Plugins list table.
|
2548 |
+
*
|
2549 |
+
* The dynamic portion of the hook name, `$item['slug']`, refers to the slug
|
2550 |
+
* for the plugin.
|
2551 |
+
*
|
2552 |
+
* @since 2.5.0
|
2553 |
+
*/
|
2554 |
+
do_action( "tgmpa_after_plugin_row_{$item['slug']}", $item['slug'], $item, $this->view_context );
|
2555 |
+
}
|
2556 |
+
|
2557 |
+
/**
|
2558 |
+
* Show the upgrade notice below a plugin row if there is one.
|
2559 |
+
*
|
2560 |
+
* @since 2.5.0
|
2561 |
+
*
|
2562 |
+
* @see /wp-admin/includes/update.php
|
2563 |
+
*
|
2564 |
+
* @param string $slug Plugin slug.
|
2565 |
+
* @param array $item The information available in this table row.
|
2566 |
+
* @return null Return early if upgrade notice is empty.
|
2567 |
+
*/
|
2568 |
+
public function wp_plugin_update_row( $slug, $item ) {
|
2569 |
+
if ( empty( $item['upgrade_notice'] ) ) {
|
2570 |
+
return;
|
2571 |
+
}
|
2572 |
+
|
2573 |
+
echo '
|
2574 |
+
<tr class="plugin-update-tr">
|
2575 |
+
<td colspan="', absint( $this->get_column_count() ), '" class="plugin-update colspanchange">
|
2576 |
+
<div class="update-message">',
|
2577 |
+
esc_html__( 'Upgrade message from the plugin author:', 'weaver-xtreme' ),
|
2578 |
+
' <strong>', wp_kses_data( $item['upgrade_notice'] ), '</strong>
|
2579 |
+
</div>
|
2580 |
+
</td>
|
2581 |
+
</tr>';
|
2582 |
+
}
|
2583 |
+
|
2584 |
+
/**
|
2585 |
+
* Extra controls to be displayed between bulk actions and pagination.
|
2586 |
+
*
|
2587 |
+
* @since 2.5.0
|
2588 |
+
*
|
2589 |
+
* @param string $which 'top' or 'bottom' table navigation.
|
2590 |
+
*/
|
2591 |
+
public function extra_tablenav( $which ) {
|
2592 |
+
if ( 'bottom' === $which ) {
|
2593 |
+
$this->tgmpa->show_tgmpa_version();
|
2594 |
+
}
|
2595 |
+
}
|
2596 |
+
|
2597 |
+
/**
|
2598 |
+
* Defines the bulk actions for handling registered plugins.
|
2599 |
+
*
|
2600 |
+
* @since 2.2.0
|
2601 |
+
*
|
2602 |
+
* @return array $actions The bulk actions for the plugin install table.
|
2603 |
+
*/
|
2604 |
+
public function get_bulk_actions() {
|
2605 |
+
|
2606 |
+
$actions = array();
|
2607 |
+
|
2608 |
+
if ( 'update' !== $this->view_context && 'activate' !== $this->view_context ) {
|
2609 |
+
if ( current_user_can( 'install_plugins' ) ) {
|
2610 |
+
$actions['tgmpa-bulk-install'] = __( 'Install', 'weaver-xtreme' );
|
2611 |
+
}
|
2612 |
+
}
|
2613 |
+
|
2614 |
+
if ( 'install' !== $this->view_context ) {
|
2615 |
+
if ( current_user_can( 'update_plugins' ) ) {
|
2616 |
+
$actions['tgmpa-bulk-update'] = __( 'Update', 'weaver-xtreme' );
|
2617 |
+
}
|
2618 |
+
if ( current_user_can( 'activate_plugins' ) ) {
|
2619 |
+
$actions['tgmpa-bulk-activate'] = __( 'Activate', 'weaver-xtreme' );
|
2620 |
+
}
|
2621 |
+
}
|
2622 |
+
|
2623 |
+
return $actions;
|
2624 |
+
}
|
2625 |
+
|
2626 |
+
/**
|
2627 |
+
* Processes bulk installation and activation actions.
|
2628 |
+
*
|
2629 |
+
* The bulk installation process looks for the $_POST information and passes that
|
2630 |
+
* through if a user has to use WP_Filesystem to enter their credentials.
|
2631 |
+
*
|
2632 |
+
* @since 2.2.0
|
2633 |
+
*/
|
2634 |
+
public function process_bulk_actions() {
|
2635 |
+
// Bulk installation process.
|
2636 |
+
if ( 'tgmpa-bulk-install' === $this->current_action() || 'tgmpa-bulk-update' === $this->current_action() ) {
|
2637 |
+
|
2638 |
+
check_admin_referer( 'bulk-' . $this->_args['plural'] );
|
2639 |
+
|
2640 |
+
$install_type = 'install';
|
2641 |
+
if ( 'tgmpa-bulk-update' === $this->current_action() ) {
|
2642 |
+
$install_type = 'update';
|
2643 |
+
}
|
2644 |
+
|
2645 |
+
$plugins_to_install = array();
|
2646 |
+
|
2647 |
+
// Did user actually select any plugins to install/update ?
|
2648 |
+
if ( empty( $_POST['plugin'] ) ) {
|
2649 |
+
if ( 'install' === $install_type ) {
|
2650 |
+
$message = __( 'No plugins were selected to be installed. No action taken.', 'weaver-xtreme' );
|
2651 |
+
} else {
|
2652 |
+
$message = __( 'No plugins were selected to be updated. No action taken.', 'weaver-xtreme' );
|
2653 |
+
}
|
2654 |
+
|
2655 |
+
echo '<div id="message" class="error"><p>', esc_html( $message ), '</p></div>';
|
2656 |
+
|
2657 |
+
return false;
|
2658 |
+
}
|
2659 |
+
|
2660 |
+
if ( is_array( $_POST['plugin'] ) ) {
|
2661 |
+
$plugins_to_install = (array) $_POST['plugin'];
|
2662 |
+
} elseif ( is_string( $_POST['plugin'] ) ) {
|
2663 |
+
// Received via Filesystem page - un-flatten array (WP bug #19643).
|
2664 |
+
$plugins_to_install = explode( ',', $_POST['plugin'] );
|
2665 |
+
}
|
2666 |
+
|
2667 |
+
// Sanitize the received input.
|
2668 |
+
$plugins_to_install = array_map( 'urldecode', $plugins_to_install );
|
2669 |
+
$plugins_to_install = array_map( array( $this->tgmpa, 'sanitize_key' ), $plugins_to_install );
|
2670 |
+
|
2671 |
+
// Validate the received input.
|
2672 |
+
foreach ( $plugins_to_install as $key => $slug ) {
|
2673 |
+
// Check if the plugin was registered with TGMPA and remove if not.
|
2674 |
+
if ( ! isset( $this->tgmpa->plugins[ $slug ] ) ) {
|
2675 |
+
unset( $plugins_to_install[ $key ] );
|
2676 |
+
continue;
|
2677 |
+
}
|
2678 |
+
|
2679 |
+
// For updates: make sure this is a plugin we *can* update (update available and WP version ok).
|
2680 |
+
if ( 'update' === $install_type && ( $this->tgmpa->is_plugin_installed( $slug ) && ( false === $this->tgmpa->does_plugin_have_update( $slug ) || ! $this->tgmpa->can_plugin_update( $slug ) ) ) ) {
|
2681 |
+
unset( $plugins_to_install[ $key ] );
|
2682 |
+
}
|
2683 |
+
}
|
2684 |
+
|
2685 |
+
// No need to proceed further if we have no plugins to handle.
|
2686 |
+
if ( empty( $plugins_to_install ) ) {
|
2687 |
+
if ( 'install' === $install_type ) {
|
2688 |
+
$message = __( 'No plugins are available to be installed at this time.', 'weaver-xtreme' );
|
2689 |
+
} else {
|
2690 |
+
$message = __( 'No plugins are available to be updated at this time.', 'weaver-xtreme' );
|
2691 |
+
}
|
2692 |
+
|
2693 |
+
echo '<div id="message" class="error"><p>', esc_html( $message ), '</p></div>';
|
2694 |
+
|
2695 |
+
return false;
|
2696 |
+
}
|
2697 |
+
|
2698 |
+
// Pass all necessary information if WP_Filesystem is needed.
|
2699 |
+
$url = wp_nonce_url(
|
2700 |
+
$this->tgmpa->get_tgmpa_url(),
|
2701 |
+
'bulk-' . $this->_args['plural']
|
2702 |
+
);
|
2703 |
+
|
2704 |
+
// Give validated data back to $_POST which is the only place the filesystem looks for extra fields.
|
2705 |
+
$_POST['plugin'] = implode( ',', $plugins_to_install ); // Work around for WP bug #19643.
|
2706 |
+
|
2707 |
+
$method = ''; // Leave blank so WP_Filesystem can populate it as necessary.
|
2708 |
+
$fields = array_keys( $_POST ); // Extra fields to pass to WP_Filesystem.
|
2709 |
+
|
2710 |
+
if ( false === ( $creds = request_filesystem_credentials( esc_url_raw( $url ), $method, false, false, $fields ) ) ) {
|
2711 |
+
return true; // Stop the normal page form from displaying, credential request form will be shown.
|
2712 |
+
}
|
2713 |
+
|
2714 |
+
// Now we have some credentials, setup WP_Filesystem.
|
2715 |
+
if ( ! WP_Filesystem( $creds ) ) {
|
2716 |
+
// Our credentials were no good, ask the user for them again.
|
2717 |
+
request_filesystem_credentials( esc_url_raw( $url ), $method, true, false, $fields );
|
2718 |
+
|
2719 |
+
return true;
|
2720 |
+
}
|
2721 |
+
|
2722 |
+
/* If we arrive here, we have the filesystem */
|
2723 |
+
|
2724 |
+
// Store all information in arrays since we are processing a bulk installation.
|
2725 |
+
$names = array();
|
2726 |
+
$sources = array(); // Needed for installs.
|
2727 |
+
$file_paths = array(); // Needed for upgrades.
|
2728 |
+
$to_inject = array(); // Information to inject into the update_plugins transient.
|
2729 |
+
|
2730 |
+
// Prepare the data for validated plugins for the install/upgrade.
|
2731 |
+
foreach ( $plugins_to_install as $slug ) {
|
2732 |
+
$name = $this->tgmpa->plugins[ $slug ]['name'];
|
2733 |
+
$source = $this->tgmpa->get_download_url( $slug );
|
2734 |
+
|
2735 |
+
if ( ! empty( $name ) && ! empty( $source ) ) {
|
2736 |
+
$names[] = $name;
|
2737 |
+
|
2738 |
+
switch ( $install_type ) {
|
2739 |
+
|
2740 |
+
case 'install':
|
2741 |
+
$sources[] = $source;
|
2742 |
+
break;
|
2743 |
+
|
2744 |
+
case 'update':
|
2745 |
+
$file_paths[] = $this->tgmpa->plugins[ $slug ]['file_path'];
|
2746 |
+
$to_inject[ $slug ] = $this->tgmpa->plugins[ $slug ];
|
2747 |
+
$to_inject[ $slug ]['source'] = $source;
|
2748 |
+
break;
|
2749 |
+
}
|
2750 |
+
}
|
2751 |
+
}
|
2752 |
+
unset( $slug, $name, $source );
|
2753 |
+
|
2754 |
+
// Create a new instance of TGMPA_Bulk_Installer.
|
2755 |
+
$installer = new TGMPA_Bulk_Installer(
|
2756 |
+
new TGMPA_Bulk_Installer_Skin(
|
2757 |
+
array(
|
2758 |
+
'url' => esc_url_raw( $this->tgmpa->get_tgmpa_url() ),
|
2759 |
+
'nonce' => 'bulk-' . $this->_args['plural'],
|
2760 |
+
'names' => $names,
|
2761 |
+
'install_type' => $install_type,
|
2762 |
+
)
|
2763 |
+
)
|
2764 |
+
);
|
2765 |
+
|
2766 |
+
// Wrap the install process with the appropriate HTML.
|
2767 |
+
echo '<div class="tgmpa wrap">',
|
2768 |
+
'<h2>', esc_html( get_admin_page_title() ), '</h2>';
|
2769 |
+
|
2770 |
+
// Process the bulk installation submissions.
|
2771 |
+
add_filter( 'upgrader_source_selection', array( $this->tgmpa, 'maybe_adjust_source_dir' ), 1, 3 );
|
2772 |
+
|
2773 |
+
if ( 'tgmpa-bulk-update' === $this->current_action() ) {
|
2774 |
+
// Inject our info into the update transient.
|
2775 |
+
$this->tgmpa->inject_update_info( $to_inject );
|
2776 |
+
|
2777 |
+
$installer->bulk_upgrade( $file_paths );
|
2778 |
+
} else {
|
2779 |
+
$installer->bulk_install( $sources );
|
2780 |
+
}
|
2781 |
+
|
2782 |
+
remove_filter( 'upgrader_source_selection', array( $this->tgmpa, 'maybe_adjust_source_dir' ), 1, 3 );
|
2783 |
+
|
2784 |
+
echo '</div>';
|
2785 |
+
|
2786 |
+
return true;
|
2787 |
+
}
|
2788 |
+
|
2789 |
+
// Bulk activation process.
|
2790 |
+
if ( 'tgmpa-bulk-activate' === $this->current_action() ) {
|
2791 |
+
check_admin_referer( 'bulk-' . $this->_args['plural'] );
|
2792 |
+
|
2793 |
+
// Did user actually select any plugins to activate ?
|
2794 |
+
if ( empty( $_POST['plugin'] ) ) {
|
2795 |
+
echo '<div id="message" class="error"><p>', esc_html__( 'No plugins were selected to be activated. No action taken.', 'weaver-xtreme' ), '</p></div>';
|
2796 |
+
|
2797 |
+
return false;
|
2798 |
+
}
|
2799 |
+
|
2800 |
+
// Grab plugin data from $_POST.
|
2801 |
+
$plugins = array();
|
2802 |
+
if ( isset( $_POST['plugin'] ) ) {
|
2803 |
+
$plugins = array_map( 'urldecode', (array) $_POST['plugin'] );
|
2804 |
+
$plugins = array_map( array( $this->tgmpa, 'sanitize_key' ), $plugins );
|
2805 |
+
}
|
2806 |
+
|
2807 |
+
$plugins_to_activate = array();
|
2808 |
+
$plugin_names = array();
|
2809 |
+
|
2810 |
+
// Grab the file paths for the selected & inactive plugins from the registration array.
|
2811 |
+
foreach ( $plugins as $slug ) {
|
2812 |
+
if ( $this->tgmpa->can_plugin_activate( $slug ) ) {
|
2813 |
+
$plugins_to_activate[] = $this->tgmpa->plugins[ $slug ]['file_path'];
|
2814 |
+
$plugin_names[] = $this->tgmpa->plugins[ $slug ]['name'];
|
2815 |
+
}
|
2816 |
+
}
|
2817 |
+
unset( $slug );
|
2818 |
+
|
2819 |
+
// Return early if there are no plugins to activate.
|
2820 |
+
if ( empty( $plugins_to_activate ) ) {
|
2821 |
+
echo '<div id="message" class="error"><p>', esc_html__( 'No plugins are available to be activated at this time.', 'weaver-xtreme' ), '</p></div>';
|
2822 |
+
|
2823 |
+
return false;
|
2824 |
+
}
|
2825 |
+
|
2826 |
+
// Now we are good to go - let's start activating plugins.
|
2827 |
+
$activate = activate_plugins( $plugins_to_activate );
|
2828 |
+
|
2829 |
+
if ( is_wp_error( $activate ) ) {
|
2830 |
+
echo '<div id="message" class="error"><p>', wp_kses_post( $activate->get_error_message() ), '</p></div>';
|
2831 |
+
} else {
|
2832 |
+
$count = count( $plugin_names ); // Count so we can use _n function.
|
2833 |
+
$plugin_names = array_map( array( 'TGMPA_Utils', 'wrap_in_strong' ), $plugin_names );
|
2834 |
+
$last_plugin = array_pop( $plugin_names ); // Pop off last name to prep for readability.
|
2835 |
+
$imploded = empty( $plugin_names ) ? $last_plugin : ( implode( ', ', $plugin_names ) . ' ' . esc_html_x( 'and', 'plugin A *and* plugin B', 'weaver-xtreme' ) . ' ' . $last_plugin );
|
2836 |
+
|
2837 |
+
printf( // WPCS: xss ok.
|
2838 |
+
'<div id="message" class="updated"><p>%1$s %2$s.</p></div>',
|
2839 |
+
esc_html( _n( 'The following plugin was activated successfully:', 'The following plugins were activated successfully:', $count, 'weaver-xtreme' ) ),
|
2840 |
+
$imploded
|
2841 |
+
);
|
2842 |
+
|
2843 |
+
// Update recently activated plugins option.
|
2844 |
+
$recent = (array) get_option( 'recently_activated' );
|
2845 |
+
foreach ( $plugins_to_activate as $plugin => $time ) {
|
2846 |
+
if ( isset( $recent[ $plugin ] ) ) {
|
2847 |
+
unset( $recent[ $plugin ] );
|
2848 |
+
}
|
2849 |
+
}
|
2850 |
+
update_option( 'recently_activated', $recent );
|
2851 |
+
}
|
2852 |
+
|
2853 |
+
unset( $_POST ); // Reset the $_POST variable in case user wants to perform one action after another.
|
2854 |
+
|
2855 |
+
return true;
|
2856 |
+
}
|
2857 |
+
|
2858 |
+
return false;
|
2859 |
+
}
|
2860 |
+
|
2861 |
+
/**
|
2862 |
+
* Prepares all of our information to be outputted into a usable table.
|
2863 |
+
*
|
2864 |
+
* @since 2.2.0
|
2865 |
+
*/
|
2866 |
+
public function prepare_items() {
|
2867 |
+
$columns = $this->get_columns(); // Get all necessary column information.
|
2868 |
+
$hidden = array(); // No columns to hide, but we must set as an array.
|
2869 |
+
$sortable = array(); // No reason to make sortable columns.
|
2870 |
+
$primary = $this->get_primary_column_name(); // Column which has the row actions.
|
2871 |
+
$this->_column_headers = array( $columns, $hidden, $sortable, $primary ); // Get all necessary column headers.
|
2872 |
+
|
2873 |
+
// Process our bulk activations here.
|
2874 |
+
if ( 'tgmpa-bulk-activate' === $this->current_action() ) {
|
2875 |
+
$this->process_bulk_actions();
|
2876 |
+
}
|
2877 |
+
|
2878 |
+
// Store all of our plugin data into $items array so WP_List_Table can use it.
|
2879 |
+
$this->items = apply_filters( 'tgmpa_table_data_items', $this->_gather_plugin_data() );
|
2880 |
+
}
|
2881 |
+
|
2882 |
+
/* *********** DEPRECATED METHODS *********** */
|
2883 |
+
|
2884 |
+
/**
|
2885 |
+
* Retrieve plugin data, given the plugin name.
|
2886 |
+
*
|
2887 |
+
* @since 2.2.0
|
2888 |
+
* @deprecated 2.5.0 use {@see TGM_Plugin_Activation::_get_plugin_data_from_name()} instead.
|
2889 |
+
* @see TGM_Plugin_Activation::_get_plugin_data_from_name()
|
2890 |
+
*
|
2891 |
+
* @param string $name Name of the plugin, as it was registered.
|
2892 |
+
* @param string $data Optional. Array key of plugin data to return. Default is slug.
|
2893 |
+
* @return string|boolean Plugin slug if found, false otherwise.
|
2894 |
+
*/
|
2895 |
+
protected function _get_plugin_data_from_name( $name, $data = 'slug' ) {
|
2896 |
+
_deprecated_function( __FUNCTION__, 'TGMPA 2.5.0', 'TGM_Plugin_Activation::_get_plugin_data_from_name()' );
|
2897 |
+
|
2898 |
+
return $this->tgmpa->_get_plugin_data_from_name( $name, $data );
|
2899 |
+
}
|
2900 |
+
}
|
2901 |
+
}
|
2902 |
+
|
2903 |
+
|
2904 |
+
if ( ! class_exists( 'TGM_Bulk_Installer' ) ) {
|
2905 |
+
|
2906 |
+
/**
|
2907 |
+
* Hack: Prevent TGMPA v2.4.1- bulk installer class from being loaded if 2.4.1- is loaded after 2.5+.
|
2908 |
+
*/
|
2909 |
+
class TGM_Bulk_Installer {
|
2910 |
+
}
|
2911 |
+
}
|
2912 |
+
if ( ! class_exists( 'TGM_Bulk_Installer_Skin' ) ) {
|
2913 |
+
|
2914 |
+
/**
|
2915 |
+
* Hack: Prevent TGMPA v2.4.1- bulk installer skin class from being loaded if 2.4.1- is loaded after 2.5+.
|
2916 |
+
*/
|
2917 |
+
class TGM_Bulk_Installer_Skin {
|
2918 |
+
}
|
2919 |
+
}
|
2920 |
+
|
2921 |
+
/**
|
2922 |
+
* The WP_Upgrader file isn't always available. If it isn't available,
|
2923 |
+
* we load it here.
|
2924 |
+
*
|
2925 |
+
* We check to make sure no action or activation keys are set so that WordPress
|
2926 |
+
* does not try to re-include the class when processing upgrades or installs outside
|
2927 |
+
* of the class.
|
2928 |
+
*
|
2929 |
+
* @since 2.2.0
|
2930 |
+
*/
|
2931 |
+
add_action( 'admin_init', 'tgmpa_load_bulk_installer' );
|
2932 |
+
if ( ! function_exists( 'tgmpa_load_bulk_installer' ) ) {
|
2933 |
+
/**
|
2934 |
+
* Load bulk installer
|
2935 |
+
*/
|
2936 |
+
function tgmpa_load_bulk_installer() {
|
2937 |
+
// Silently fail if 2.5+ is loaded *after* an older version.
|
2938 |
+
if ( ! isset( $GLOBALS['tgmpa'] ) ) {
|
2939 |
+
return;
|
2940 |
+
}
|
2941 |
+
|
2942 |
+
// Get TGMPA class instance.
|
2943 |
+
$tgmpa_instance = call_user_func( array( get_class( $GLOBALS['tgmpa'] ), 'get_instance' ) );
|
2944 |
+
|
2945 |
+
if ( isset( $_GET['page'] ) && $tgmpa_instance->menu === $_GET['page'] ) {
|
2946 |
+
if ( ! class_exists( 'Plugin_Upgrader', false ) ) {
|
2947 |
+
require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
|
2948 |
+
}
|
2949 |
+
|
2950 |
+
if ( ! class_exists( 'TGMPA_Bulk_Installer' ) ) {
|
2951 |
+
|
2952 |
+
/**
|
2953 |
+
* Installer class to handle bulk plugin installations.
|
2954 |
+
*
|
2955 |
+
* Extends WP_Upgrader and customizes to suit the installation of multiple
|
2956 |
+
* plugins.
|
2957 |
+
*
|
2958 |
+
* @since 2.2.0
|
2959 |
+
*
|
2960 |
+
* @internal Since 2.5.0 the class is an extension of Plugin_Upgrader rather than WP_Upgrader
|
2961 |
+
* @internal Since 2.5.2 the class has been renamed from TGM_Bulk_Installer to TGMPA_Bulk_Installer.
|
2962 |
+
* This was done to prevent backward compatibility issues with v2.3.6.
|
2963 |
+
*
|
2964 |
+
* @package TGM-Plugin-Activation
|
2965 |
+
* @author Thomas Griffin
|
2966 |
+
* @author Gary Jones
|
2967 |
+
*/
|
2968 |
+
class TGMPA_Bulk_Installer extends Plugin_Upgrader {
|
2969 |
+
/**
|
2970 |
+
* Holds result of bulk plugin installation.
|
2971 |
+
*
|
2972 |
+
* @since 2.2.0
|
2973 |
+
*
|
2974 |
+
* @var string
|
2975 |
+
*/
|
2976 |
+
public $result;
|
2977 |
+
|
2978 |
+
/**
|
2979 |
+
* Flag to check if bulk installation is occurring or not.
|
2980 |
+
*
|
2981 |
+
* @since 2.2.0
|
2982 |
+
*
|
2983 |
+
* @var boolean
|
2984 |
+
*/
|
2985 |
+
public $bulk = false;
|
2986 |
+
|
2987 |
+
/**
|
2988 |
+
* TGMPA instance
|
2989 |
+
*
|
2990 |
+
* @since 2.5.0
|
2991 |
+
*
|
2992 |
+
* @var object
|
2993 |
+
*/
|
2994 |
+
protected $tgmpa;
|
2995 |
+
|
2996 |
+
/**
|
2997 |
+
* Whether or not the destination directory needs to be cleared ( = on update).
|
2998 |
+
*
|
2999 |
+
* @since 2.5.0
|
3000 |
+
*
|
3001 |
+
* @var bool
|
3002 |
+
*/
|
3003 |
+
protected $clear_destination = false;
|
3004 |
+
|
3005 |
+
/**
|
3006 |
+
* References parent constructor and sets defaults for class.
|
3007 |
+
*
|
3008 |
+
* @since 2.2.0
|
3009 |
+
*
|
3010 |
+
* @param \Bulk_Upgrader_Skin|null $skin Installer skin.
|
3011 |
+
*/
|
3012 |
+
public function __construct( $skin = null ) {
|
3013 |
+
// Get TGMPA class instance.
|
3014 |
+
$this->tgmpa = call_user_func( array( get_class( $GLOBALS['tgmpa'] ), 'get_instance' ) );
|
3015 |
+
|
3016 |
+
parent::__construct( $skin );
|
3017 |
+
|
3018 |
+
if ( isset( $this->skin->options['install_type'] ) && 'update' === $this->skin->options['install_type'] ) {
|
3019 |
+
$this->clear_destination = true;
|
3020 |
+
}
|
3021 |
+
|
3022 |
+
if ( $this->tgmpa->is_automatic ) {
|
3023 |
+
$this->activate_strings();
|
3024 |
+
}
|
3025 |
+
|
3026 |
+
add_action( 'upgrader_process_complete', array( $this->tgmpa, 'populate_file_path' ) );
|
3027 |
+
}
|
3028 |
+
|
3029 |
+
/**
|
3030 |
+
* Sets the correct activation strings for the installer skin to use.
|
3031 |
+
*
|
3032 |
+
* @since 2.2.0
|
3033 |
+
*/
|
3034 |
+
public function activate_strings() {
|
3035 |
+
$this->strings['activation_failed'] = __( 'Plugin activation failed.', 'weaver-xtreme' );
|
3036 |
+
$this->strings['activation_success'] = __( 'Plugin activated successfully.', 'weaver-xtreme' );
|
3037 |
+
}
|
3038 |
+
|
3039 |
+
/**
|
3040 |
+
* Performs the actual installation of each plugin.
|
3041 |
+
*
|
3042 |
+
* @since 2.2.0
|
3043 |
+
*
|
3044 |
+
* @see WP_Upgrader::run()
|
3045 |
+
*
|
3046 |
+
* @param array $options The installation config options.
|
3047 |
+
* @return null|array Return early if error, array of installation data on success.
|
3048 |
+
*/
|
3049 |
+
public function run( $options ) {
|
3050 |
+
$result = parent::run( $options );
|
3051 |
+
|
3052 |
+
// Reset the strings in case we changed one during automatic activation.
|
3053 |
+
if ( $this->tgmpa->is_automatic ) {
|
3054 |
+
if ( 'update' === $this->skin->options['install_type'] ) {
|
3055 |
+
$this->upgrade_strings();
|
3056 |
+
} else {
|
3057 |
+
$this->install_strings();
|
3058 |
+
}
|
3059 |
+
}
|
3060 |
+
|
3061 |
+
return $result;
|
3062 |
+
}
|
3063 |
+
|
3064 |
+
/**
|
3065 |
+
* Processes the bulk installation of plugins.
|
3066 |
+
*
|
3067 |
+
* @since 2.2.0
|
3068 |
+
*
|
3069 |
+
* @internal This is basically a near identical copy of the WP Core Plugin_Upgrader::bulk_upgrade()
|
3070 |
+
* method, with minor adjustments to deal with new installs instead of upgrades.
|
3071 |
+
* For ease of future synchronizations, the adjustments are clearly commented, but no other
|
3072 |
+
* comments are added. Code style has been made to comply.
|
3073 |
+
*
|
3074 |
+
* @see Plugin_Upgrader::bulk_upgrade()
|
3075 |
+
* @see https://core.trac.wordpress.org/browser/tags/4.2.1/src/wp-admin/includes/class-wp-upgrader.php#L838
|
3076 |
+
*
|
3077 |
+
* @param array $plugins The plugin sources needed for installation.
|
3078 |
+
* @param array $args Arbitrary passed extra arguments.
|
3079 |
+
* @return string|bool Install confirmation messages on success, false on failure.
|
3080 |
+
*/
|
3081 |
+
public function bulk_install( $plugins, $args = array() ) {
|
3082 |
+
// [TGMPA + ] Hook auto-activation in.
|
3083 |
+
add_filter( 'upgrader_post_install', array( $this, 'auto_activate' ), 10 );
|
3084 |
+
|
3085 |
+
$defaults = array(
|
3086 |
+
'clear_update_cache' => true,
|
3087 |
+
);
|
3088 |
+
$parsed_args = wp_parse_args( $args, $defaults );
|
3089 |
+
|
3090 |
+
$this->init();
|
3091 |
+
$this->bulk = true;
|
3092 |
+
|
3093 |
+
$this->install_strings(); // [TGMPA + ] adjusted.
|
3094 |
+
|
3095 |
+
/* [TGMPA - ] $current = get_site_transient( 'update_plugins' ); */
|
3096 |
+
|
3097 |
+
/* [TGMPA - ] add_filter('upgrader_clear_destination', array($this, 'delete_old_plugin'), 10, 4); */
|
3098 |
+
|
3099 |
+
$this->skin->header();
|
3100 |
+
|
3101 |
+
// Connect to the Filesystem first.
|
3102 |
+
$res = $this->fs_connect( array( WP_CONTENT_DIR, WP_PLUGIN_DIR ) );
|
3103 |
+
if ( ! $res ) {
|
3104 |
+
$this->skin->footer();
|
3105 |
+
|
3106 |
+
return false;
|
3107 |
+
}
|
3108 |
+
|
3109 |
+
$this->skin->bulk_header();
|
3110 |
+
|
3111 |
+
// Only start maintenance mode if:
|
3112 |
+
// - running Multisite and there are one or more plugins specified, OR
|
3113 |
+
// - a plugin with an update available is currently active.
|
3114 |
+
// @TODO: For multisite, maintenance mode should only kick in for individual sites if at all possible.
|
3115 |
+
$maintenance = ( is_multisite() && ! empty( $plugins ) );
|
3116 |
+
|
3117 |
+
/*
|
3118 |
+
[TGMPA - ]
|
3119 |
+
foreach ( $plugins as $plugin )
|
3120 |
+
$maintenance = $maintenance || ( is_plugin_active( $plugin ) && isset( $current->response[ $plugin] ) );
|
3121 |
+
*/
|
3122 |
+
if ( $maintenance ) {
|
3123 |
+
$this->maintenance_mode( true );
|
3124 |
+
}
|
3125 |
+
|
3126 |
+
$results = array();
|
3127 |
+
|
3128 |
+
$this->update_count = count( $plugins );
|
3129 |
+
$this->update_current = 0;
|
3130 |
+
foreach ( $plugins as $plugin ) {
|
3131 |
+
$this->update_current++;
|
3132 |
+
|
3133 |
+
/*
|
3134 |
+
[TGMPA - ]
|
3135 |
+
$this->skin->plugin_info = get_plugin_data( WP_PLUGIN_DIR . '/' . $plugin, false, true);
|
3136 |
+
|
3137 |
+
if ( !isset( $current->response[ $plugin ] ) ) {
|
3138 |
+
$this->skin->set_result('up_to_date');
|
3139 |
+
$this->skin->before();
|
3140 |
+
$this->skin->feedback('up_to_date');
|
3141 |
+
$this->skin->after();
|
3142 |
+
$results[$plugin] = true;
|
3143 |
+
continue;
|
3144 |
+
}
|
3145 |
+
|
3146 |
+
// Get the URL to the zip file
|
3147 |
+
$r = $current->response[ $plugin ];
|
3148 |
+
|
3149 |
+
$this->skin->plugin_active = is_plugin_active($plugin);
|
3150 |
+
*/
|
3151 |
+
|
3152 |
+
$result = $this->run( array(
|
3153 |
+
'package' => $plugin, // [TGMPA + ] adjusted.
|
3154 |
+
'destination' => WP_PLUGIN_DIR,
|
3155 |
+
'clear_destination' => false, // [TGMPA + ] adjusted.
|
3156 |
+
'clear_working' => true,
|
3157 |
+
'is_multi' => true,
|
3158 |
+
'hook_extra' => array(
|
3159 |
+
'plugin' => $plugin,
|
3160 |
+
),
|
3161 |
+
) );
|
3162 |
+
|
3163 |
+
$results[ $plugin ] = $this->result;
|
3164 |
+
|
3165 |
+
// Prevent credentials auth screen from displaying multiple times.
|
3166 |
+
if ( false === $result ) {
|
3167 |
+
break;
|
3168 |
+
}
|
3169 |
+
} //end foreach $plugins
|
3170 |
+
|
3171 |
+
$this->maintenance_mode( false );
|
3172 |
+
|
3173 |
+
/**
|
3174 |
+
* Fires when the bulk upgrader process is complete.
|
3175 |
+
*
|
3176 |
+
* @since WP 3.6.0 / TGMPA 2.5.0
|
3177 |
+
*
|
3178 |
+
* @param Plugin_Upgrader $this Plugin_Upgrader instance. In other contexts, $this, might
|
3179 |
+
* be a Theme_Upgrader or Core_Upgrade instance.
|
3180 |
+
* @param array $data {
|
3181 |
+
* Array of bulk item update data.
|
3182 |
+
*
|
3183 |
+
* @type string $action Type of action. Default 'update'.
|
3184 |
+
* @type string $type Type of update process. Accepts 'plugin', 'theme', or 'core'.
|
3185 |
+
* @type bool $bulk Whether the update process is a bulk update. Default true.
|
3186 |
+
* @type array $packages Array of plugin, theme, or core packages to update.
|
3187 |
+
* }
|
3188 |
+
*/
|
3189 |
+
do_action( 'upgrader_process_complete', $this, array(
|
3190 |
+
'action' => 'install', // [TGMPA + ] adjusted.
|
3191 |
+
'type' => 'plugin',
|
3192 |
+
'bulk' => true,
|
3193 |
+
'plugins' => $plugins,
|
3194 |
+
) );
|
3195 |
+
|
3196 |
+
$this->skin->bulk_footer();
|
3197 |
+
|
3198 |
+
$this->skin->footer();
|
3199 |
+
|
3200 |
+
// Cleanup our hooks, in case something else does a upgrade on this connection.
|
3201 |
+
/* [TGMPA - ] remove_filter('upgrader_clear_destination', array($this, 'delete_old_plugin')); */
|
3202 |
+
|
3203 |
+
// [TGMPA + ] Remove our auto-activation hook.
|
3204 |
+
remove_filter( 'upgrader_post_install', array( $this, 'auto_activate' ), 10 );
|
3205 |
+
|
3206 |
+
// Force refresh of plugin update information.
|
3207 |
+
wp_clean_plugins_cache( $parsed_args['clear_update_cache'] );
|
3208 |
+
|
3209 |
+
return $results;
|
3210 |
+
}
|
3211 |
+
|
3212 |
+
/**
|
3213 |
+
* Handle a bulk upgrade request.
|
3214 |
+
*
|
3215 |
+
* @since 2.5.0
|
3216 |
+
*
|
3217 |
+
* @see Plugin_Upgrader::bulk_upgrade()
|
3218 |
+
*
|
3219 |
+
* @param array $plugins The local WP file_path's of the plugins which should be upgraded.
|
3220 |
+
* @param array $args Arbitrary passed extra arguments.
|
3221 |
+
* @return string|bool Install confirmation messages on success, false on failure.
|
3222 |
+
*/
|
3223 |
+
public function bulk_upgrade( $plugins, $args = array() ) {
|
3224 |
+
|
3225 |
+
add_filter( 'upgrader_post_install', array( $this, 'auto_activate' ), 10 );
|
3226 |
+
|
3227 |
+
$result = parent::bulk_upgrade( $plugins, $args );
|
3228 |
+
|
3229 |
+
remove_filter( 'upgrader_post_install', array( $this, 'auto_activate' ), 10 );
|
3230 |
+
|
3231 |
+
return $result;
|
3232 |
+
}
|
3233 |
+
|
3234 |
+
/**
|
3235 |
+
* Abuse a filter to auto-activate plugins after installation.
|
3236 |
+
*
|
3237 |
+
* Hooked into the 'upgrader_post_install' filter hook.
|
3238 |
+
*
|
3239 |
+
* @since 2.5.0
|
3240 |
+
*
|
3241 |
+
* @param bool $bool The value we need to give back (true).
|
3242 |
+
* @return bool
|
3243 |
+
*/
|
3244 |
+
public function auto_activate( $bool ) {
|
3245 |
+
// Only process the activation of installed plugins if the automatic flag is set to true.
|
3246 |
+
if ( $this->tgmpa->is_automatic ) {
|
3247 |
+
// Flush plugins cache so the headers of the newly installed plugins will be read correctly.
|
3248 |
+
wp_clean_plugins_cache();
|
3249 |
+
|
3250 |
+
// Get the installed plugin file.
|
3251 |
+
$plugin_info = $this->plugin_info();
|
3252 |
+
|
3253 |
+
// Don't try to activate on upgrade of active plugin as WP will do this already.
|
3254 |
+
if ( ! is_plugin_active( $plugin_info ) ) {
|
3255 |
+
$activate = activate_plugin( $plugin_info );
|
3256 |
+
|
3257 |
+
// Adjust the success string based on the activation result.
|
3258 |
+
$this->strings['process_success'] = $this->strings['process_success'] . "<br />\n";
|
3259 |
+
|
3260 |
+
if ( is_wp_error( $activate ) ) {
|
3261 |
+
$this->skin->error( $activate );
|
3262 |
+
$this->strings['process_success'] .= $this->strings['activation_failed'];
|
3263 |
+
} else {
|
3264 |
+
$this->strings['process_success'] .= $this->strings['activation_success'];
|
3265 |
+
}
|
3266 |
+
}
|
3267 |
+
}
|
3268 |
+
|
3269 |
+
return $bool;
|
3270 |
+
}
|
3271 |
+
}
|
3272 |
+
}
|
3273 |
+
|
3274 |
+
if ( ! class_exists( 'TGMPA_Bulk_Installer_Skin' ) ) {
|
3275 |
+
|
3276 |
+
/**
|
3277 |
+
* Installer skin to set strings for the bulk plugin installations..
|
3278 |
+
*
|
3279 |
+
* Extends Bulk_Upgrader_Skin and customizes to suit the installation of multiple
|
3280 |
+
* plugins.
|
3281 |
+
*
|
3282 |
+
* @since 2.2.0
|
3283 |
+
*
|
3284 |
+
* @internal Since 2.5.2 the class has been renamed from TGM_Bulk_Installer_Skin to
|
3285 |
+
* TGMPA_Bulk_Installer_Skin.
|
3286 |
+
* This was done to prevent backward compatibility issues with v2.3.6.
|
3287 |
+
*
|
3288 |
+
* @see https://core.trac.wordpress.org/browser/trunk/src/wp-admin/includes/class-wp-upgrader-skins.php
|
3289 |
+
*
|
3290 |
+
* @package TGM-Plugin-Activation
|
3291 |
+
* @author Thomas Griffin
|
3292 |
+
* @author Gary Jones
|
3293 |
+
*/
|
3294 |
+
class TGMPA_Bulk_Installer_Skin extends Bulk_Upgrader_Skin {
|
3295 |
+
/**
|
3296 |
+
* Holds plugin info for each individual plugin installation.
|
3297 |
+
*
|
3298 |
+
* @since 2.2.0
|
3299 |
+
*
|
3300 |
+
* @var array
|
3301 |
+
*/
|
3302 |
+
public $plugin_info = array();
|
3303 |
+
|
3304 |
+
/**
|
3305 |
+
* Holds names of plugins that are undergoing bulk installations.
|
3306 |
+
*
|
3307 |
+
* @since 2.2.0
|
3308 |
+
*
|
3309 |
+
* @var array
|
3310 |
+
*/
|
3311 |
+
public $plugin_names = array();
|
3312 |
+
|
3313 |
+
/**
|
3314 |
+
* Integer to use for iteration through each plugin installation.
|
3315 |
+
*
|
3316 |
+
* @since 2.2.0
|
3317 |
+
*
|
3318 |
+
* @var integer
|
3319 |
+
*/
|
3320 |
+
public $i = 0;
|
3321 |
+
|
3322 |
+
/**
|
3323 |
+
* TGMPA instance
|
3324 |
+
*
|
3325 |
+
* @since 2.5.0
|
3326 |
+
*
|
3327 |
+
* @var object
|
3328 |
+
*/
|
3329 |
+
protected $tgmpa;
|
3330 |
+
|
3331 |
+
/**
|
3332 |
+
* Constructor. Parses default args with new ones and extracts them for use.
|
3333 |
+
*
|
3334 |
+
* @since 2.2.0
|
3335 |
+
*
|
3336 |
+
* @param array $args Arguments to pass for use within the class.
|
3337 |
+
*/
|
3338 |
+
public function __construct( $args = array() ) {
|
3339 |
+
// Get TGMPA class instance.
|
3340 |
+
$this->tgmpa = call_user_func( array( get_class( $GLOBALS['tgmpa'] ), 'get_instance' ) );
|
3341 |
+
|
3342 |
+
// Parse default and new args.
|
3343 |
+
$defaults = array(
|
3344 |
+
'url' => '',
|
3345 |
+
'nonce' => '',
|
3346 |
+
'names' => array(),
|
3347 |
+
'install_type' => 'install',
|
3348 |
+
);
|
3349 |
+
$args = wp_parse_args( $args, $defaults );
|
3350 |
+
|
3351 |
+
// Set plugin names to $this->plugin_names property.
|
3352 |
+
$this->plugin_names = $args['names'];
|
3353 |
+
|
3354 |
+
// Extract the new args.
|
3355 |
+
parent::__construct( $args );
|
3356 |
+
}
|
3357 |
+
|
3358 |
+
/**
|
3359 |
+
* Sets install skin strings for each individual plugin.
|
3360 |
+
*
|
3361 |
+
* Checks to see if the automatic activation flag is set and uses the
|
3362 |
+
* the proper strings accordingly.
|
3363 |
+
*
|
3364 |
+
* @since 2.2.0
|
3365 |
+
*/
|
3366 |
+
public function add_strings() {
|
3367 |
+
if ( 'update' === $this->options['install_type'] ) {
|
3368 |
+
parent::add_strings();
|
3369 |
+
$this->upgrader->strings['skin_before_update_header'] = __( 'Updating Plugin %1$s (%2$d/%3$d)', 'weaver-xtreme' );
|
3370 |
+
} else {
|
3371 |
+
$this->upgrader->strings['skin_update_failed_error'] = __( 'An error occurred while installing %1$s: <strong>%2$s</strong>.', 'weaver-xtreme' );
|
3372 |
+
$this->upgrader->strings['skin_update_failed'] = __( 'The installation of %1$s failed.', 'weaver-xtreme' );
|
3373 |
+
|
3374 |
+
if ( $this->tgmpa->is_automatic ) {
|
3375 |
+
// Automatic activation strings.
|
3376 |
+
$this->upgrader->strings['skin_upgrade_start'] = __( 'The installation and activation process is starting. This process may take a while on some hosts, so please be patient.', 'weaver-xtreme' );
|
3377 |
+
$this->upgrader->strings['skin_update_successful'] = __( '%1$s installed and activated successfully.', 'weaver-xtreme' ) . ' <a href="#" class="hide-if-no-js" onclick="%2$s"><span>' . esc_html__( 'Show Details', 'weaver-xtreme' ) . '</span><span class="hidden">' . esc_html__( 'Hide Details', 'weaver-xtreme' ) . '</span>.</a>';
|
3378 |
+
$this->upgrader->strings['skin_upgrade_end'] = __( 'All installations and activations have been completed.', 'weaver-xtreme' );
|
3379 |
+
$this->upgrader->strings['skin_before_update_header'] = __( 'Installing and Activating Plugin %1$s (%2$d/%3$d)', 'weaver-xtreme' );
|
3380 |
+
} else {
|
3381 |
+
// Default installation strings.
|
3382 |
+
$this->upgrader->strings['skin_upgrade_start'] = __( 'The installation process is starting. This process may take a while on some hosts, so please be patient.', 'weaver-xtreme' );
|
3383 |
+
$this->upgrader->strings['skin_update_successful'] = esc_html__( '%1$s installed successfully.', 'weaver-xtreme' ) . ' <a href="#" class="hide-if-no-js" onclick="%2$s"><span>' . esc_html__( 'Show Details', 'weaver-xtreme' ) . '</span><span class="hidden">' . esc_html__( 'Hide Details', 'weaver-xtreme' ) . '</span>.</a>';
|
3384 |
+
$this->upgrader->strings['skin_upgrade_end'] = __( 'All installations have been completed.', 'weaver-xtreme' );
|
3385 |
+
$this->upgrader->strings['skin_before_update_header'] = __( 'Installing Plugin %1$s (%2$d/%3$d)', 'weaver-xtreme' );
|
3386 |
+
}
|
3387 |
+
}
|
3388 |
+
}
|
3389 |
+
|
3390 |
+
/**
|
3391 |
+
* Outputs the header strings and necessary JS before each plugin installation.
|
3392 |
+
*
|
3393 |
+
* @since 2.2.0
|
3394 |
+
*
|
3395 |
+
* @param string $title Unused in this implementation.
|
3396 |
+
*/
|
3397 |
+
public function before( $title = '' ) {
|
3398 |
+
if ( empty( $title ) ) {
|
3399 |
+
$title = esc_html( $this->plugin_names[ $this->i ] );
|
3400 |
+
}
|
3401 |
+
parent::before( $title );
|
3402 |
+
}
|
3403 |
+
|
3404 |
+
/**
|
3405 |
+
* Outputs the footer strings and necessary JS after each plugin installation.
|
3406 |
+
*
|
3407 |
+
* Checks for any errors and outputs them if they exist, else output
|
3408 |
+
* success strings.
|
3409 |
+
*
|
3410 |
+
* @since 2.2.0
|
3411 |
+
*
|
3412 |
+
* @param string $title Unused in this implementation.
|
3413 |
+
*/
|
3414 |
+
public function after( $title = '' ) {
|
3415 |
+
if ( empty( $title ) ) {
|
3416 |
+
$title = esc_html( $this->plugin_names[ $this->i ] );
|
3417 |
+
}
|
3418 |
+
parent::after( $title );
|
3419 |
+
|
3420 |
+
$this->i++;
|
3421 |
+
}
|
3422 |
+
|
3423 |
+
/**
|
3424 |
+
* Outputs links after bulk plugin installation is complete.
|
3425 |
+
*
|
3426 |
+
* @since 2.2.0
|
3427 |
+
*/
|
3428 |
+
public function bulk_footer() {
|
3429 |
+
// Serve up the string to say installations (and possibly activations) are complete.
|
3430 |
+
parent::bulk_footer();
|
3431 |
+
|
3432 |
+
// Flush plugins cache so we can make sure that the installed plugins list is always up to date.
|
3433 |
+
wp_clean_plugins_cache();
|
3434 |
+
|
3435 |
+
$this->tgmpa->show_tgmpa_version();
|
3436 |
+
|
3437 |
+
// Display message based on if all plugins are now active or not.
|
3438 |
+
$update_actions = array();
|
3439 |
+
|
3440 |
+
if ( $this->tgmpa->is_tgmpa_complete() ) {
|
3441 |
+
// All plugins are active, so we display the complete string and hide the menu to protect users.
|
3442 |
+
echo '<style type="text/css">#adminmenu .wp-submenu li.current { display: none !important; }</style>';
|
3443 |
+
$update_actions['dashboard'] = sprintf(
|
3444 |
+
esc_html( $this->tgmpa->strings['complete'] ),
|
3445 |
+
'<a href="' . esc_url( self_admin_url() ) . '">' . esc_html__( 'Return to the Dashboard', 'weaver-xtreme' ) . '</a>'
|
3446 |
+
);
|
3447 |
+
} else {
|
3448 |
+
$update_actions['tgmpa_page'] = '<a href="' . esc_url( $this->tgmpa->get_tgmpa_url() ) . '" target="_parent">' . esc_html( $this->tgmpa->strings['return'] ) . '</a>';
|
3449 |
+
}
|
3450 |
+
|
3451 |
+
/**
|
3452 |
+
* Filter the list of action links available following bulk plugin installs/updates.
|
3453 |
+
*
|
3454 |
+
* @since 2.5.0
|
3455 |
+
*
|
3456 |
+
* @param array $update_actions Array of plugin action links.
|
3457 |
+
* @param array $plugin_info Array of information for the last-handled plugin.
|
3458 |
+
*/
|
3459 |
+
$update_actions = apply_filters( 'tgmpa_update_bulk_plugins_complete_actions', $update_actions, $this->plugin_info );
|
3460 |
+
|
3461 |
+
if ( ! empty( $update_actions ) ) {
|
3462 |
+
$this->feedback( implode( ' | ', (array) $update_actions ) );
|
3463 |
+
}
|
3464 |
+
}
|
3465 |
+
|
3466 |
+
/* *********** DEPRECATED METHODS *********** */
|
3467 |
+
|
3468 |
+
/**
|
3469 |
+
* Flush header output buffer.
|
3470 |
+
*
|
3471 |
+
* @since 2.2.0
|
3472 |
+
* @deprecated 2.5.0 use {@see Bulk_Upgrader_Skin::flush_output()} instead
|
3473 |
+
* @see Bulk_Upgrader_Skin::flush_output()
|
3474 |
+
*/
|
3475 |
+
public function before_flush_output() {
|
3476 |
+
_deprecated_function( __FUNCTION__, 'TGMPA 2.5.0', 'Bulk_Upgrader_Skin::flush_output()' );
|
3477 |
+
$this->flush_output();
|
3478 |
+
}
|
3479 |
+
|
3480 |
+
/**
|
3481 |
+
* Flush footer output buffer and iterate $this->i to make sure the
|
3482 |
+
* installation strings reference the correct plugin.
|
3483 |
+
*
|
3484 |
+
* @since 2.2.0
|
3485 |
+
* @deprecated 2.5.0 use {@see Bulk_Upgrader_Skin::flush_output()} instead
|
3486 |
+
* @see Bulk_Upgrader_Skin::flush_output()
|
3487 |
+
*/
|
3488 |
+
public function after_flush_output() {
|
3489 |
+
_deprecated_function( __FUNCTION__, 'TGMPA 2.5.0', 'Bulk_Upgrader_Skin::flush_output()' );
|
3490 |
+
$this->flush_output();
|
3491 |
+
$this->i++;
|
3492 |
+
}
|
3493 |
+
}
|
3494 |
+
}
|
3495 |
+
}
|
3496 |
+
}
|
3497 |
+
}
|
3498 |
+
|
3499 |
+
if ( ! class_exists( 'TGMPA_Utils' ) ) {
|
3500 |
+
|
3501 |
+
/**
|
3502 |
+
* Generic utilities for TGMPA.
|
3503 |
+
*
|
3504 |
+
* All methods are static, poor-dev name-spacing class wrapper.
|
3505 |
+
*
|
3506 |
+
* Class was called TGM_Utils in 2.5.0 but renamed TGMPA_Utils in 2.5.1 as this was conflicting with Soliloquy.
|
3507 |
+
*
|
3508 |
+
* @since 2.5.0
|
3509 |
+
*
|
3510 |
+
* @package TGM-Plugin-Activation
|
3511 |
+
* @author Juliette Reinders Folmer
|
3512 |
+
*/
|
3513 |
+
class TGMPA_Utils {
|
3514 |
+
/**
|
3515 |
+
* Whether the PHP filter extension is enabled.
|
3516 |
+
*
|
3517 |
+
* @see http://php.net/book.filter
|
3518 |
+
*
|
3519 |
+
* @since 2.5.0
|
3520 |
+
*
|
3521 |
+
* @static
|
3522 |
+
*
|
3523 |
+
* @var bool $has_filters True is the extension is enabled.
|
3524 |
+
*/
|
3525 |
+
public static $has_filters;
|
3526 |
+
|
3527 |
+
/**
|
3528 |
+
* Wrap an arbitrary string in <em> tags. Meant to be used in combination with array_map().
|
3529 |
+
*
|
3530 |
+
* @since 2.5.0
|
3531 |
+
*
|
3532 |
+
* @static
|
3533 |
+
*
|
3534 |
+
* @param string $string Text to be wrapped.
|
3535 |
+
* @return string
|
3536 |
+
*/
|
3537 |
+
public static function wrap_in_em( $string ) {
|
3538 |
+
return '<em>' . wp_kses_post( $string ) . '</em>';
|
3539 |
+
}
|
3540 |
+
|
3541 |
+
/**
|
3542 |
+
* Wrap an arbitrary string in <strong> tags. Meant to be used in combination with array_map().
|
3543 |
+
*
|
3544 |
+
* @since 2.5.0
|
3545 |
+
*
|
3546 |
+
* @static
|
3547 |
+
*
|
3548 |
+
* @param string $string Text to be wrapped.
|
3549 |
+
* @return string
|
3550 |
+
*/
|
3551 |
+
public static function wrap_in_strong( $string ) {
|
3552 |
+
return '<strong>' . wp_kses_post( $string ) . '</strong>';
|
3553 |
+
}
|
3554 |
+
|
3555 |
+
/**
|
3556 |
+
* Helper function: Validate a value as boolean
|
3557 |
+
*
|
3558 |
+
* @since 2.5.0
|
3559 |
+
*
|
3560 |
+
* @static
|
3561 |
+
*
|
3562 |
+
* @param mixed $value Arbitrary value.
|
3563 |
+
* @return bool
|
3564 |
+
*/
|
3565 |
+
public static function validate_bool( $value ) {
|
3566 |
+
if ( ! isset( self::$has_filters ) ) {
|
3567 |
+
self::$has_filters = extension_loaded( 'filter' );
|
3568 |
+
}
|
3569 |
+
|
3570 |
+
if ( self::$has_filters ) {
|
3571 |
+
return filter_var( $value, FILTER_VALIDATE_BOOLEAN );
|
3572 |
+
} else {
|
3573 |
+
return self::emulate_filter_bool( $value );
|
3574 |
+
}
|
3575 |
+
}
|
3576 |
+
|
3577 |
+
/**
|
3578 |
+
* Helper function: Cast a value to bool
|
3579 |
+
*
|
3580 |
+
* @since 2.5.0
|
3581 |
+
*
|
3582 |
+
* @static
|
3583 |
+
*
|
3584 |
+
* @param mixed $value Value to cast.
|
3585 |
+
* @return bool
|
3586 |
+
*/
|
3587 |
+
protected static function emulate_filter_bool( $value ) {
|
3588 |
+
// @codingStandardsIgnoreStart
|
3589 |
+
static $true = array(
|
3590 |
+
'1',
|
3591 |
+
'true', 'True', 'TRUE',
|
3592 |
+
'y', 'Y',
|
3593 |
+
'yes', 'Yes', 'YES',
|
3594 |
+
'on', 'On', 'ON',
|
3595 |
+
);
|
3596 |
+
static $false = array(
|
3597 |
+
'0',
|
3598 |
+
'false', 'False', 'FALSE',
|
3599 |
+
'n', 'N',
|
3600 |
+
'no', 'No', 'NO',
|
3601 |
+
'off', 'Off', 'OFF',
|
3602 |
+
);
|
3603 |
+
// @codingStandardsIgnoreEnd
|
3604 |
+
|
3605 |
+
if ( is_bool( $value ) ) {
|
3606 |
+
return $value;
|
3607 |
+
} else if ( is_int( $value ) && ( 0 === $value || 1 === $value ) ) {
|
3608 |
+
return (bool) $value;
|
3609 |
+
} else if ( ( is_float( $value ) && ! is_nan( $value ) ) && ( (float) 0 === $value || (float) 1 === $value ) ) {
|
3610 |
+
return (bool) $value;
|
3611 |
+
} else if ( is_string( $value ) ) {
|
3612 |
+
$value = trim( $value );
|
3613 |
+
if ( in_array( $value, $true, true ) ) {
|
3614 |
+
return true;
|
3615 |
+
} else if ( in_array( $value, $false, true ) ) {
|
3616 |
+
return false;
|
3617 |
+
} else {
|
3618 |
+
return false;
|
3619 |
+
}
|
3620 |
+
}
|
3621 |
+
|
3622 |
+
return false;
|
3623 |
+
}
|
3624 |
+
} // End of class TGMPA_Utils
|
3625 |
+
} // End of class_exists wrapper
|
admin/customizer.php
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
function weaverx_customize_preview_js() {
|
3 |
+
$option_menu = site_url('/wp-admin/themes.php?page=WeaverX', 'relative');
|
4 |
+
|
5 |
+
$content = "<script>jQuery('#customize-info').append('<div class=\"use-theme-options\"><a href=\"{$option_menu}\" target=\"_blank\">Weaver Xtreme Options on Appearance Menu</a></div>')</script>";
|
6 |
+
echo $content;
|
7 |
+
}
|
8 |
+
add_action('customize_controls_print_footer_scripts', 'weaverx_customize_preview_js');
|
9 |
+
|
10 |
+
/*
|
11 |
+
* Customizer scripts
|
12 |
+
*/
|
13 |
+
function weaverx_enqueue_customizer_scripts(){
|
14 |
+
|
15 |
+
// stylesheet for customizer
|
16 |
+
wp_enqueue_style('weaverx-customizer-styles', get_template_directory_uri() . '/admin/assets/css/customizer'.WEAVERX_MINIFY.'.css');
|
17 |
+
|
18 |
+
}
|
19 |
+
add_action('customize_controls_enqueue_scripts','weaverx_enqueue_customizer_scripts');
|
20 |
+
?>
|
admin/lib-admin-part2.php
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
if ( !defined('ABSPATH')) exit; // Exit if accessed directly
|
3 |
+
|
4 |
+
|
5 |
+
|
6 |
+
?>
|
admin/lib-admin.php
ADDED
@@ -0,0 +1,1553 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
if ( !defined('ABSPATH')) exit; // Exit if accessed directly
|
3 |
+
/* Weaver Xtreme Theme
|
4 |
+
|
5 |
+
This file contains all the functions needed to interact with the different
|
6 |
+
options and settings.
|
7 |
+
|
8 |
+
Options are saved in the WP DB in one option called 'weaverx_main_settings'.
|
9 |
+
*/
|
10 |
+
|
11 |
+
|
12 |
+
// ========================== utils ==================================
|
13 |
+
|
14 |
+
function weaverx_end_of_section($who = '') {
|
15 |
+
echo '<hr />';
|
16 |
+
$name = weaverx_getopt('themename');
|
17 |
+
if ( ! $name )
|
18 |
+
$name = __('Please set theme name on the Advanced Options → Admin Options tab.', 'weaver-xtreme' /*adm*/);
|
19 |
+
|
20 |
+
printf(__("%s %s | Options Version: %s | Subtheme: %s\n", 'weaver-xtreme' /*adm*/),WEAVERX_THEMENAME, WEAVERX_VERSION, weaverx_getopt('style_version'), $name);
|
21 |
+
|
22 |
+
$last = weaverx_getopt('last_option');
|
23 |
+
if ($last != 'Weaver Xtreme') // check for case of limited PHP $_POST values
|
24 |
+
{
|
25 |
+
?>
|
26 |
+
<p style="color:red">
|
27 |
+
<?php _e('Possible Non-Standard Web Host Configuration detected. If your options
|
28 |
+
are not saving correctly, your host may have limited the default number of values that PHP can use for
|
29 |
+
settings. Try saving your settings again, and if this message persists, please contact your host and ask them to "Increase the PHP <em>max_input_vars</em> value for $_POST to at least 800." If that does not fix the issue,
|
30 |
+
please contact Weaver Xtreme support. Diagnostic info: last_option=', 'weaver-xtreme' /*adm*/); ?><?php echo $last;?>
|
31 |
+
</p>
|
32 |
+
<?php
|
33 |
+
}
|
34 |
+
|
35 |
+
if (false && !weaverx_getopt('_hide_subtheme_link')) {
|
36 |
+
?>
|
37 |
+
<p style="max-width:90%;"><?php weaverx_site('/subthemes/'); ?><img style="max-width:95%;float:left;margin-right:10px;" src="<?php echo weaverx_relative_url('/assets/images/'); ?>theme-bar.jpg" alt="addons" />
|
38 |
+
<?php _e('<strong>Discover more premium <br />Weaver Xtreme Subthemes</strong>', 'weaver-xtreme' /*adm*/); ?></a>
|
39 |
+
</p>
|
40 |
+
<?php
|
41 |
+
}
|
42 |
+
}
|
43 |
+
|
44 |
+
function weaverx_donate_button() {
|
45 |
+
|
46 |
+
if (!weaverx_getopt_checked('_hide_donate') && !function_exists('weaverxplus_plugin_installed')) { ?>
|
47 |
+
<div style="float:right;padding-right:30px;"><small><strong><?php _e('Like Weaver X? Consider', 'weaver-xtreme' /*adm*/); ?></strong></small>
|
48 |
+
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
|
49 |
+
<input type="hidden" name="cmd" value="_s-xclick">
|
50 |
+
<input type="hidden" name="hosted_button_id" value="6Y68LG9G9M82W">
|
51 |
+
<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donate_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
|
52 |
+
<img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1">
|
53 |
+
</form>
|
54 |
+
</div>
|
55 |
+
<?php }
|
56 |
+
}
|
57 |
+
|
58 |
+
|
59 |
+
function weaverx_clear_messages() {
|
60 |
+
?>
|
61 |
+
<form style="float:right;margin-right:15px;" name="clearweaverx_form" method="post">
|
62 |
+
<?php
|
63 |
+
|
64 |
+
if (!function_exists('wvrx_ts_installed')) {
|
65 |
+
if (!is_multisite() || (is_multisite() && current_user_can('manage_network_themes')) ) {
|
66 |
+
echo '<div style="display:inline-block;background-color:pink;border:1px solid black;padding:3px;margin-right:4px;font-style:italic;font-size:80%;line-height:1.2;">' .
|
67 |
+
__('Please install and activate the<br />Weaver Xtreme Theme Support Plugin.', 'weaver-xtreme') . '</div>';
|
68 |
+
}
|
69 |
+
}
|
70 |
+
if (!function_exists('weaverxplus_plugin_installed')) {
|
71 |
+
echo '<strong style="border:1px solid blue;background:yellow;padding:4px;margin:5px;">';
|
72 |
+
weaverx_site('','//plus.weavertheme.com/',__('Weaver Xtreme Plus', 'weaver-xtreme' /*adm*/));
|
73 |
+
echo __('Get Weaver Xtreme Plus!','weaver-xtreme' /*adm*/) . '</a> </strong>';
|
74 |
+
}
|
75 |
+
do_action('weaverx_check_licenses');
|
76 |
+
|
77 |
+
?>
|
78 |
+
<span class="submit"><input type="submit" name="weaverx_clear_messages" value="<?php _e('Clear Messages', 'weaver-xtreme' /*adm*/); ?>"/></span>
|
79 |
+
<?php weaverx_nonce_field('weaverx_clear_messages'); ?>
|
80 |
+
</form> <!-- resetweaverx_form -->
|
81 |
+
<?php
|
82 |
+
}
|
83 |
+
|
84 |
+
function weaverx_abs_file_path($http_path) {
|
85 |
+
return untrailingslashit(ABSPATH) . parse_url($http_path,PHP_URL_PATH);
|
86 |
+
}
|
87 |
+
/*
|
88 |
+
==================== SAVE / RESTORE THEMES AND BACKUPS ==========================
|
89 |
+
*/
|
90 |
+
function weaverx_get_save_settings($is_theme) {
|
91 |
+
// serialize current settings
|
92 |
+
global $weaverx_opts_cache;
|
93 |
+
|
94 |
+
weaverx_update_options('write_backup');
|
95 |
+
|
96 |
+
if ($is_theme) {
|
97 |
+
$header = 'WXT-V01.00'; /* Save theme settings: 10 byte header */
|
98 |
+
$theme_opts = array();
|
99 |
+
$theme_opts['weaverx_base'] = $weaverx_opts_cache;
|
100 |
+
foreach ($weaverx_opts_cache as $opt => $val) {
|
101 |
+
if ($opt[0] == '_')
|
102 |
+
$theme_opts['weaverx_base'][$opt] = false;
|
103 |
+
}
|
104 |
+
return $header . serialize($theme_opts); /* serialize full set of options right now */
|
105 |
+
} else {
|
106 |
+
$header = 'WXB-V01.00'; /* Save all settings: 10 byte header */
|
107 |
+
$theme_opts = array();
|
108 |
+
$theme_opts['weaverx_base'] = $weaverx_opts_cache;
|
109 |
+
return $header . serialize($theme_opts); /* serialize full set of options right now */
|
110 |
+
}
|
111 |
+
}
|
112 |
+
|
113 |
+
function weaverx_clear_cache_settings() {
|
114 |
+
/* clear all settings */
|
115 |
+
global $weaverx_opts_cache;
|
116 |
+
foreach ($weaverx_opts_cache as $key => $value) {
|
117 |
+
$weaverx_opts_cache[$key] = false; // clear everything
|
118 |
+
}
|
119 |
+
}
|
120 |
+
|
121 |
+
function weaverx_save_msg($msg) {
|
122 |
+
echo '<div id="message" class="updated fade"><p><strong>' . $msg .
|
123 |
+
'</strong></p></div>';
|
124 |
+
}
|
125 |
+
function weaverx_error_msg($msg) {
|
126 |
+
echo '<div id="message" class="updated fade" style="background:#F88;"><p><strong>' . $msg .
|
127 |
+
'</strong></p></div>';
|
128 |
+
}
|
129 |
+
|
130 |
+
//============================================ form builder ====================================
|
131 |
+
|
132 |
+
function weaverx_form_show_options($weaverx_olist, $begin_table = true, $end_table = true) {
|
133 |
+
/* output a list of options - this really does the layout for the options defined in an array */
|
134 |
+
if ($begin_table) {
|
135 |
+
?>
|
136 |
+
<div>
|
137 |
+
<table class="optiontable" style="margin-top:6px;">
|
138 |
+
<?php
|
139 |
+
}
|
140 |
+
foreach ($weaverx_olist as $value) {
|
141 |
+
if (!isset($value['type'])) {
|
142 |
+
if ( WEAVERX_DEV_MODE ) {
|
143 |
+
echo '<h2>**** ERROR: '; print_r($value); echo '</h2>'; // @@@@@@@@@@@@@@@@
|
144 |
+
xxxxxxxxx();
|
145 |
+
}
|
146 |
+
continue;
|
147 |
+
}
|
148 |
+
$value['type'] = weaverx_fix_type($value['type']);
|
149 |
+
switch ($value['type']) {
|
150 |
+
case 'align':
|
151 |
+
weaverx_form_align($value);
|
152 |
+
break;
|
153 |
+
case 'checkbox':
|
154 |
+
weaverx_form_checkbox($value);
|
155 |
+
break;
|
156 |
+
case 'ctext':
|
157 |
+
weaverx_form_ctext($value);
|
158 |
+
break;
|
159 |
+
case 'color':
|
160 |
+
weaverx_form_color($value);
|
161 |
+
break;
|
162 |
+
case 'custom_css':
|
163 |
+
weaverx_custom_css($value);
|
164 |
+
break;
|
165 |
+
case 'endheader':
|
166 |
+
echo '<!-- end header -->';
|
167 |
+
break;
|
168 |
+
case 'fi_align':
|
169 |
+
weaverx_form_fi_align($value);
|
170 |
+
break;
|
171 |
+
case 'fi_location':
|
172 |
+
weaverx_from_fi_location($value);
|
173 |
+
break;
|
174 |
+
case 'fi_location_post':
|
175 |
+
weaverx_from_fi_location($value, true);
|
176 |
+
break;
|
177 |
+
case 'header':
|
178 |
+
weaverx_form_header($value);
|
179 |
+
break;
|
180 |
+
case 'header_area':
|
181 |
+
weaverx_form_header_area($value);
|
182 |
+
break;
|
183 |
+
case 'header0':
|
184 |
+
weaverx_form_header($value,true);
|
185 |
+
break;
|
186 |
+
case 'inactive':
|
187 |
+
weaverx_form_inactive($value);
|
188 |
+
break;
|
189 |
+
case 'link':
|
190 |
+
weaverx_form_link($value);
|
191 |
+
break;
|
192 |
+
case 'menu_opts':
|
193 |
+
weaverx_form_menu_opts($value, false);
|
194 |
+
break;
|
195 |
+
case 'menu_opts_submit':
|
196 |
+
weaverx_form_menu_opts($value, true);
|
197 |
+
break;
|
198 |
+
case 'note':
|
199 |
+
weaverx_form_note($value);
|
200 |
+
break;
|
201 |
+
case 'radio':
|
202 |
+
weaverx_form_radio($value);
|
203 |
+
break;
|
204 |
+
case 'rounded':
|
205 |
+
weaverx_form_rounded($value);
|
206 |
+
break;
|
207 |
+
case 'select_hide':
|
208 |
+
weaverx_form_select_hide($value);
|
209 |
+
break;
|
210 |
+
case 'select_id':
|
211 |
+
weaverx_form_select_id($value);
|
212 |
+
break;
|
213 |
+
case 'select_layout':
|
214 |
+
weaverx_form_select_layout($value);
|
215 |
+
break;
|
216 |
+
case 'shadows':
|
217 |
+
weaverx_form_shadows($value);
|
218 |
+
break;
|
219 |
+
case 'subheader':
|
220 |
+
weaverx_form_subheader($value);
|
221 |
+
break;
|
222 |
+
case 'subheader_alt':
|
223 |
+
weaverx_form_subheader_alt($value);
|
224 |
+
break;
|
225 |
+
case 'submit':
|
226 |
+
weaverx_form_submit($value);
|
227 |
+
break;
|
228 |
+
case 'text':
|
229 |
+
case 'widetext':
|
230 |
+
weaverx_form_text($value);
|
231 |
+
break;
|
232 |
+
case 'text_xy':
|
233 |
+
weaverx_form_text_xy($value);
|
234 |
+
break;
|
235 |
+
case 'text_xy_em':
|
236 |
+
weaverx_form_text_xy($value,'X','Y','em');
|
237 |
+
break;
|
238 |
+
case 'text_xy_percent':
|
239 |
+
weaverx_form_text_xy($value,'X','Y','%');
|
240 |
+
break;
|
241 |
+
case 'text_tb':
|
242 |
+
weaverx_form_text_xy($value,'T','B');
|
243 |
+
break;
|
244 |
+
case 'text_lr':
|
245 |
+
weaverx_form_text_xy($value,'L','R');
|
246 |
+
break;
|
247 |
+
case 'text_lr_em':
|
248 |
+
weaverx_form_text_xy($value,'L','R','em');
|
249 |
+
break;
|
250 |
+
case 'text_lr_percent':
|
251 |
+
weaverx_form_text_xy($value,'L','R','%');
|
252 |
+
break;
|
253 |
+
case 'textarea':
|
254 |
+
weaverx_form_textarea($value);
|
255 |
+
break;
|
256 |
+
case 'titles':
|
257 |
+
weaverx_form_text_props($value, 'titles');
|
258 |
+
break;
|
259 |
+
case 'titles_area':
|
260 |
+
weaverx_form_text_props($value, 'area');
|
261 |
+
break;
|
262 |
+
case 'titles_content':
|
263 |
+
weaverx_form_text_props($value, 'content');
|
264 |
+
break;
|
265 |
+
case 'titles_menu':
|
266 |
+
weaverx_form_text_props($value, 'menu');
|
267 |
+
break;
|
268 |
+
case 'titles_text':
|
269 |
+
weaverx_form_text_props($value, 'text');
|
270 |
+
break;
|
271 |
+
case 'val_num':
|
272 |
+
weaverx_form_val($value,'');
|
273 |
+
break;
|
274 |
+
case 'val_percent':
|
275 |
+
weaverx_form_val($value,'%');
|
276 |
+
break;
|
277 |
+
case 'val_px':
|
278 |
+
weaverx_form_val($value,'px');
|
279 |
+
break;
|
280 |
+
case 'val_em':
|
281 |
+
weaverx_form_val($value,'em');
|
282 |
+
break;
|
283 |
+
case 'widget_area':
|
284 |
+
weaverx_form_widget_area($value, false);
|
285 |
+
break;
|
286 |
+
case 'widget_area_submit':
|
287 |
+
weaverx_form_widget_area($value, true);
|
288 |
+
break;
|
289 |
+
default:
|
290 |
+
weaverx_form_subheader_alt($value);
|
291 |
+
break;
|
292 |
+
}
|
293 |
+
|
294 |
+
}
|
295 |
+
if ($end_table) {
|
296 |
+
?>
|
297 |
+
</table></div> <!-- close previous tab div -->
|
298 |
+
<br />
|
299 |
+
<?php
|
300 |
+
}
|
301 |
+
}
|
302 |
+
|
303 |
+
function weaverx_fix_type($type) {
|
304 |
+
return apply_filters('weaverx_xtra_type', $type );
|
305 |
+
}
|
306 |
+
|
307 |
+
function weaverx_form_inactive($value, $reason= '') {
|
308 |
+
if ( $reason == '' )
|
309 |
+
$reason = '<small>' . __('Weaver Xtreme Plus Options', 'weaver-xtreme' /*adm*/) . ' </small>';
|
310 |
+
if (!isset($value['name']) || !isset($value['id']) || !isset($value['info'])) { // probably an '=submit'
|
311 |
+
return;
|
312 |
+
}
|
313 |
+
$title = $value['name'];
|
314 |
+
if (strlen($title) < 1) $title = ' '; // make code work for invisibles
|
315 |
+
if ($title[0] == '#')
|
316 |
+
$title = substr($title,4); // strip color
|
317 |
+
echo ' <tr>' . "\n";
|
318 |
+
?>
|
319 |
+
<th scope="row" style="width:200px;"><?php /* NO SAPI SETTING */
|
320 |
+
echo '<span style="color:#777;float:right;">'.$title.': </span>';
|
321 |
+
if (!empty($value['help'])) {
|
322 |
+
weaverx_help_link($value['help'], __('Help for ', 'weaver-xtreme' /*adm*/) . $title);
|
323 |
+
}
|
324 |
+
?>
|
325 |
+
</th>
|
326 |
+
<td style="color:#777;"><?php echo $reason; ?>
|
327 |
+
<input type="hidden" name="<?php weaverx_sapi_main_name($value['id']); ?>" id="<?php echo $value['id']; ?>" value="<?php if ( weaverx_getopt( $value['id'] ) != "") { weaverx_esc_textarea(weaverx_getopt( $value['id'] )); } else { echo ''; } ?>" />
|
328 |
+
</td>
|
329 |
+
<?php
|
330 |
+
if ($value['info'] != '') {
|
331 |
+
echo('<td style="padding-left:10px;color:#777;font-size:x-small;">'); echo $value['info'];
|
332 |
+
echo("</td>\n");
|
333 |
+
}
|
334 |
+
?>
|
335 |
+
</tr>
|
336 |
+
<?php
|
337 |
+
}
|
338 |
+
|
339 |
+
|
340 |
+
function weaverx_echo_name($value, $add_icon = '') {
|
341 |
+
if (!$add_icon) {
|
342 |
+
if (isset($value['icon'])) {
|
343 |
+
$add_icon = $value['icon'];
|
344 |
+
if ($add_icon[0] == '-') {
|
345 |
+
$add_icon = "<span class='i-left dashicons dashicons{$add_icon}'></span>";
|
346 |
+
}
|
347 |
+
}
|
348 |
+
}
|
349 |
+
|
350 |
+
if (isset($value['name']))
|
351 |
+
$l = $value['name'];
|
352 |
+
else
|
353 |
+
$l = '...';
|
354 |
+
if (strlen($l) > 4 && $l[0] == '#') {
|
355 |
+
$l = '<span style="color:' . substr($l,0,4) .
|
356 |
+
';">' . substr($l,4) . '</span>';
|
357 |
+
}
|
358 |
+
|
359 |
+
echo $add_icon . $value['name'];
|
360 |
+
}
|
361 |
+
|
362 |
+
function weaverx_form_ctext( $value, $val_only = false ) {
|
363 |
+
|
364 |
+
$pclass = 'color {hash:true, adjust:false}'; // starting with V 1.3, allow text in color pickers
|
365 |
+
$img_css = '<img src="'. esc_url(get_template_directory_uri() . '/assets/images/theme/css.png') . '" alt="css" />' ;
|
366 |
+
$img_hide = esc_url(get_template_directory_uri() . '/assets/images/theme/hide.png') ;
|
367 |
+
$img_show = esc_url(get_template_directory_uri() . '/assets/images/theme/show.png') ;
|
368 |
+
$help_file = esc_url(get_template_directory_uri() . '/help/css-help.html');
|
369 |
+
$css_id = $value['id'] . '_css';
|
370 |
+
$css_id_text = weaverx_getopt($css_id);
|
371 |
+
if ($css_id_text && !weaverx_getopt( '_hide_auto_css_rules' )) {
|
372 |
+
$img_toggle = $img_hide;
|
373 |
+
} else {
|
374 |
+
$img_toggle = $img_show;
|
375 |
+
}
|
376 |
+
$add_icon = '<span class="i-left-bg dashicons dashicons-admin-appearance"></span>';
|
377 |
+
if (strpos($value['name'], ' BG') === false)
|
378 |
+
$add_icon = '<span class="i-left-fg dashicons dashicons-admin-appearance"></span>';
|
379 |
+
if ( ! $val_only ) { ?>
|
380 |
+
<tr>
|
381 |
+
<th scope="row" align="right"><?php weaverx_echo_name($value, $add_icon ); ?>: </th>
|
382 |
+
<td> <?php
|
383 |
+
} else {
|
384 |
+
echo ' <small>' . $value['info'] . '</small> ';
|
385 |
+
} ?>
|
386 |
+
<input class="<?php echo $pclass; ?>" name="<?php weaverx_sapi_main_name($value['id']); ?>" id="<?php echo $value['id']; ?>" type="text" style="width:90px" value="<?php if ( weaverx_getopt( $value['id'] ) != "") { weaverx_esc_textarea(weaverx_getopt( $value['id'] )); } else { echo ''; } ?>" />
|
387 |
+
<?php
|
388 |
+
echo $img_css; ?><a href="javascript:void(null);" onclick="weaverx_ToggleRowCSS(document.getElementById('<?php echo $css_id . '_js'; ?>'), this, '<?php echo $img_show; ?>', '<?php echo $img_hide; ?>')"><?php echo '<img src="' . esc_url($img_toggle) . '" alt="toggle css" />'; ?></a>
|
389 |
+
<?php if ( ! $val_only ) { ?>
|
390 |
+
</td>
|
391 |
+
<?php weaverx_form_info($value);
|
392 |
+
?>
|
393 |
+
</tr>
|
394 |
+
<?php }
|
395 |
+
$css_rows = weaverx_getopt('_css_rows');
|
396 |
+
if ($css_rows < 1 || $css_rows > 25)
|
397 |
+
$css_rows = 1;
|
398 |
+
if ($css_id_text && !weaverx_getopt( '_hide_auto_css_rules' )) { ?>
|
399 |
+
<tr id="<?php echo $css_id . '_js'; ?>">
|
400 |
+
<th scope="row" align="right"><span style="color:#22a;"><small><?php _e('Custom CSS styling:', 'weaver-xtreme' /*adm*/); ?></small></span></th>
|
401 |
+
<td align="right"><small> </small></td>
|
402 |
+
<td>
|
403 |
+
<small>
|
404 |
+
<?php _e('You can enter CSS rules, enclosed in {}\'s, and separated by <strong>;</strong>. See ', 'weaver-xtreme' /*adm*/); ?>
|
405 |
+
<a href="<?php echo $help_file; ?>" target="_blank"><?php _e('CSS Help', 'weaver-xtreme' /*adm*/); ?></a> <?php _e('for more details.', 'weaver-xtreme' /*adm*/); ?></small><br />
|
406 |
+
<?php weaverx_textarea( $css_id_text, $css_id, $css_rows,'{ font-size:150%; font-weight:bold; } /* for example */' ); ?>
|
407 |
+
</td>
|
408 |
+
</tr>
|
409 |
+
<?php
|
410 |
+
} else {
|
411 |
+
?>
|
412 |
+
<tr id="<?php echo $css_id . '_js'; ?>" style="display:none;">
|
413 |
+
<th scope="row" align="right"><span style="color:green;"><small><?php _e('Custom CSS styling:', 'weaver-xtreme' /*adm*/); ?></small></span></th>
|
414 |
+
<td align="right"><small> </small></td>
|
415 |
+
<td>
|
416 |
+
<small>
|
417 |
+
<?php _e('You can enter CSS rules, enclosed in {}\'s, and separated by <strong>;</strong>. See', 'weaver-xtreme' /*adm*/); ?>
|
418 |
+
<a href="<?php echo $help_file; ?>" target="_blank"><?php _e('CSS Help', 'weaver-xtreme' /*adm*/); ?></a> for more details.</small><br />
|
419 |
+
<?php weaverx_textarea( $css_id_text, $css_id, $css_rows,'{ font-size:150%; font-weight:bold; } /* for example */' ); ?>
|
420 |
+
</td>
|
421 |
+
</tr>
|
422 |
+
<?php
|
423 |
+
}
|
424 |
+
}
|
425 |
+
|
426 |
+
function weaverx_textarea($text, $id, $rows = 0, $place = '', $style = 'width:85%;', $class='wvrx-edit', $filter = true) {
|
427 |
+
$name = weaverx_sapi_main_name($id, false);
|
428 |
+
/* if ($text) {
|
429 |
+
$newrows = count((explode("\n",$text)))+1;
|
430 |
+
if ($newrows > $rows)
|
431 |
+
$rows = $newrows;
|
432 |
+
} else { */
|
433 |
+
if ( $rows < 2 ) {
|
434 |
+
$rows = 1;
|
435 |
+
}
|
436 |
+
if ($rows > 25) $rows = 25;
|
437 |
+
if ( $filter )
|
438 |
+
$text = weaverx_esc_textarea($text, false); // don't echo
|
439 |
+
echo "<textarea class='{$class}' placeholder='{$place}' name='{$name}' rows='$rows' style='{$style}'>{$text}</textarea>\n";
|
440 |
+
}
|
441 |
+
|
442 |
+
|
443 |
+
function weaverx_form_color($value, $val_only = false) {
|
444 |
+
|
445 |
+
$pclass = 'color {hash:true, adjust:false}'; // starting with V 1.3, allow text in color pickers
|
446 |
+
if ( ! $val_only ) {
|
447 |
+
?>
|
448 |
+
<tr>
|
449 |
+
<th scope="row" align="right"><?php weaverx_echo_name($value, '<span class="i-left-fg dashicons dashicons-admin-appearance"></span>'); ?>: </th>
|
450 |
+
<td>
|
451 |
+
<?php } else { echo ' <small>' . $value['info'] . '</small> '; } ?>
|
452 |
+
<input class="<?php echo $pclass; ?>" name="<?php weaverx_sapi_main_name($value['id']); ?>" id="<?php echo $value['id']; ?>" type="text" style="width:90px" value="<?php if ( weaverx_getopt( $value['id'] ) != "") { weaverx_esc_textarea(weaverx_getopt( $value['id'] )); } else { echo ' '; } ?>" />
|
453 |
+
<?php if (! $val_only ) { ?>
|
454 |
+
</td>
|
455 |
+
<?php weaverx_form_info($value);
|
456 |
+
?>
|
457 |
+
</tr>
|
458 |
+
<?php
|
459 |
+
}
|
460 |
+
}
|
461 |
+
|
462 |
+
function weaverx_form_header($value, $narrow=false) {
|
463 |
+
?>
|
464 |
+
<tr class="atw-row-header">
|
465 |
+
<th scope="row" align="left" style="width:200px;"><?php /* NO SAPI SETTING */
|
466 |
+
|
467 |
+
if (isset($value['icon']))
|
468 |
+
$icon = $value['icon'];
|
469 |
+
if ( !isset($icon) || !$icon )
|
470 |
+
$icon = '';
|
471 |
+
|
472 |
+
$dash = '';
|
473 |
+
if ( $icon ) { // add a leading icon
|
474 |
+
$dash = '<span style="padding: .1em .5em 0 .2em" class="dashicons dashicons' . $icon . '"></span>';
|
475 |
+
}
|
476 |
+
echo weaverx_anchor($value['name']) . $dash . '<span style="font-weight:bold; font-size: larger;"><em>'. $value['name'] .'</em></span>';
|
477 |
+
weaverx_form_help($value);
|
478 |
+
?>
|
479 |
+
</th>
|
480 |
+
<?php
|
481 |
+
if ($narrow) echo ('<td style="width:80px;"> </td>'. "\n");
|
482 |
+
else echo ('<td style="width:170px;"> </td>'. "\n");
|
483 |
+
|
484 |
+
if ($value['info'] != '') {
|
485 |
+
echo('<td style="padding-left: 10px"><u><em><strong>'); echo $value['info'];
|
486 |
+
echo("</strong></em></u></td>\n");
|
487 |
+
}
|
488 |
+
?>
|
489 |
+
</tr>
|
490 |
+
<?php
|
491 |
+
}
|
492 |
+
|
493 |
+
function weaverx_anchor( $title ) {
|
494 |
+
if ( $title )
|
495 |
+
return '<a class="anchorx" id="' . sanitize_title( $title ) . '"></a>';
|
496 |
+
return '';
|
497 |
+
}
|
498 |
+
|
499 |
+
function weaverx_form_help($value) {
|
500 |
+
if (!empty($value['help'])) {
|
501 |
+
weaverx_help_link($value['help'], 'Help for ' . $value['name']);
|
502 |
+
}
|
503 |
+
}
|
504 |
+
|
505 |
+
function weaverx_form_subheader($value) {
|
506 |
+
?>
|
507 |
+
<tr class="atw-row-subheader">
|
508 |
+
<th scope="row" align="left" style="width:200px;line-height:2em;"><?php /* NO SAPI SETTING */
|
509 |
+
|
510 |
+
if (isset($value['icon']))
|
511 |
+
$icon = $value['icon'];
|
512 |
+
if ( !isset($icon) || !$icon )
|
513 |
+
$icon = '';
|
514 |
+
|
515 |
+
$dash = '';
|
516 |
+
if ( $icon ) { // add a leading icon
|
517 |
+
$dash = '<span style="padding:.2em;" class="dashicons dashicons' . $icon . '"></span>';
|
518 |
+
}
|
519 |
+
|
520 |
+
echo weaverx_anchor($value['name']) . $dash . '<span style="color:blue; font-weight:bold; "><em><u>'.$value['name'].'</u></em></span>';
|
521 |
+
weaverx_form_help($value);
|
522 |
+
?>
|
523 |
+
</th>
|
524 |
+
<td style="width:170px;"> </td>
|
525 |
+
<?php
|
526 |
+
if ($value['info'] != '') {
|
527 |
+
echo('<td style="padding-left: 10px"><u><em>'); echo $value['info'];
|
528 |
+
echo("</em></u></td>\n");
|
529 |
+
}
|
530 |
+
?>
|
531 |
+
</tr>
|
532 |
+
<?php
|
533 |
+
}
|
534 |
+
|
535 |
+
function weaverx_form_subheader_alt($value) {
|
536 |
+
?>
|
537 |
+
<tr><td> </td></tr>
|
538 |
+
<tr class="atw-row-subheader-alt" >
|
539 |
+
<th scope="row" align="left" style="width:200px;line-height:2em;"><?php /* NO SAPI SETTING */
|
540 |
+
|
541 |
+
if (isset($value['icon']))
|
542 |
+
$icon = $value['icon'];
|
543 |
+
if ( !isset($icon) || !$icon )
|
544 |
+
$icon = '';
|
545 |
+
|
546 |
+
$dash = '';
|
547 |
+
if ( $icon ) { // add a leading icon
|
548 |
+
$dash = '<span style="padding:.2em;" class="dashicons dashicons' . $icon . '"></span>';
|
549 |
+
}
|
550 |
+
echo weaverx_anchor($value['name']) . $dash . '<span style="color:blue; font-weight:bold;padding-left:5px;"><em>'.$value['name'].'</em></span>';
|
551 |
+
weaverx_form_help($value);
|
552 |
+
?>
|
553 |
+
</th>
|
554 |
+
<td style="width:170px;"> </td>
|
555 |
+
<?php
|
556 |
+
if (isset($value['info']) && $value['info'] != '') {
|
557 |
+
echo('<td style="padding-left: 10px;color:blue;">'); echo $value['info'];
|
558 |
+
echo("</td>\n");
|
559 |
+
}
|
560 |
+
?>
|
561 |
+
</tr>
|
562 |
+
<?php
|
563 |
+
}
|
564 |
+
|
565 |
+
function weaverx_form_header_area($value) {
|
566 |
+
?>
|
567 |
+
<tr><td> </td></tr>
|
568 |
+
<tr class="atw-row-subheader-area" >
|
569 |
+
<th scope="row" align="left" style="width:200px;line-height:2em;"><?php /* NO SAPI SETTING */
|
570 |
+
|
571 |
+
if (isset($value['icon']))
|
572 |
+
$icon = $value['icon'];
|
573 |
+
if ( !isset($icon) || !$icon )
|
574 |
+
$icon = '';
|
575 |
+
|
576 |
+
$dash = '';
|
577 |
+
if ( $icon ) { // add a leading icon
|
578 |
+
$dash = '<span style="padding:.2em;" class="dashicons dashicons' . $icon . '"></span>';
|
579 |
+
}
|
580 |
+
|
581 |
+
echo weaverx_anchor($value['name']) . $dash . '<span style="color:blue; font-weight:bold;padding-left:5px;font-size:small;"><em>'.$value['name'].'</em></span>';
|
582 |
+
weaverx_form_help($value);
|
583 |
+
?>
|
584 |
+
</th>
|
585 |
+
<td style="width:170px;"> </td>
|
586 |
+
<?php
|
587 |
+
if ($value['info'] != '') {
|
588 |
+
echo('<td style="padding-left: 10px;color:blue;">'); echo $value['info'];
|
589 |
+
echo("</td>\n");
|
590 |
+
}
|
591 |
+
?>
|
592 |
+
</tr>
|
593 |
+
<?php
|
594 |
+
}
|
595 |
+
|
596 |
+
|
597 |
+
function weaverx_form_textarea($value,$media = false) {
|
598 |
+
$twide = ($value['type'] == 'text') ? '60' : '140';
|
599 |
+
$rows = ( isset($value['val'] ) ) ? $value['val'] : 1;
|
600 |
+
$place = ( isset($value['placeholder'] ) ) ? $value['placeholder'] : ' ';
|
601 |
+
if ( $rows < 1 )
|
602 |
+
$rows = 1;
|
603 |
+
?>
|
604 |
+
<tr>
|
605 |
+
<th scope="row" align="right"><?php weaverx_echo_name($value); ?>: </th>
|
606 |
+
<td colspan=2>
|
607 |
+
<?php weaverx_textarea(weaverx_getopt($value['id']), $value['id'], $rows , $place, 'width:350px;', $class='wvrx-edit'); ?>
|
608 |
+
<?php
|
609 |
+
if ($media) {
|
610 |
+
weaverx_media_lib_button($value['id']);
|
611 |
+
}
|
612 |
+
?>
|
613 |
+
<small><?php echo $value['info']; ?></small>
|
614 |
+
</td>
|
615 |
+
|
616 |
+
</tr>
|
617 |
+
<?php
|
618 |
+
}
|
619 |
+
|
620 |
+
function weaverx_form_text($value,$media=false) {
|
621 |
+
$twide = ($value['type'] == 'text') ? '60' : '160';
|
622 |
+
?>
|
623 |
+
<tr>
|
624 |
+
<th scope="row" align="right"><?php weaverx_echo_name($value); ?>: </th>
|
625 |
+
<td>
|
626 |
+
<input name="<?php weaverx_sapi_main_name($value['id']); ?>" id="<?php echo $value['id']; ?>" type="text" style="width:<?php echo $twide;?>px;height:22px;" class="regular-text" value="<?php echo esc_textarea(weaverx_getopt( $value['id'] )); ?>" />
|
627 |
+
<?php
|
628 |
+
if ($media) {
|
629 |
+
weaverx_media_lib_button($value['id']);
|
630 |
+
}
|
631 |
+
?>
|
632 |
+
</td>
|
633 |
+
<?php weaverx_form_info($value);
|
634 |
+
?>
|
635 |
+
</tr>
|
636 |
+
<?php
|
637 |
+
}
|
638 |
+
|
639 |
+
function weaverx_form_val($value, $unit = '') {
|
640 |
+
?>
|
641 |
+
<tr>
|
642 |
+
<th scope="row" align="right"><?php weaverx_echo_name($value); ?>: </th>
|
643 |
+
<td>
|
644 |
+
<input name="<?php weaverx_sapi_main_name($value['id']); ?>" id="<?php echo $value['id']; ?>" type="text" style="width:50px;height:22px;" class="regular-text" value="<?php echo esc_textarea(weaverx_getopt( $value['id'] )); ?>" /> <?php echo $unit; ?>
|
645 |
+
</td>
|
646 |
+
<?php weaverx_form_info($value);
|
647 |
+
?>
|
648 |
+
</tr>
|
649 |
+
<?php
|
650 |
+
}
|
651 |
+
|
652 |
+
function weaverx_form_text_xy($value,$x='X', $y='Y', $units='px') {
|
653 |
+
$xid = $value['id'] . '_' . $x;
|
654 |
+
$yid = $value['id'] . '_' . $y;
|
655 |
+
$colon = ($value['name']) ? ':' : '';
|
656 |
+
?>
|
657 |
+
<tr>
|
658 |
+
<th scope="row" align="right"><?php weaverx_echo_name($value); echo $colon;?> </th>
|
659 |
+
<td>
|
660 |
+
<?php echo '<span class="rtl-break">' . $x;?>:<input name="<?php weaverx_sapi_main_name($xid); ?>" id="<?php echo $xid; ?>" type="text" style="width:40px;height:20px;" class="regular-text" value="<?php weaverx_esc_textarea(weaverx_getopt( $xid )); ?>" /> <?php echo $units; ?></span>
|
661 |
+
<?php echo '<span class="rtl-break">' . $y;?>:<input name="<?php weaverx_sapi_main_name($yid); ?>" id="<?php echo $yid; ?>" type="text" style="width:40px;height:20px;" class="regular-text" value="<?php weaverx_esc_textarea(weaverx_getopt( $yid )); ?>" /> <?php echo $units; ?></span>
|
662 |
+
</td>
|
663 |
+
<?php weaverx_form_info($value);
|
664 |
+
?>
|
665 |
+
</tr>
|
666 |
+
<?php
|
667 |
+
}
|
668 |
+
|
669 |
+
function weaverx_form_checkbox($value) {
|
670 |
+
?>
|
671 |
+
<tr>
|
672 |
+
<th scope="row" align="right"><?php weaverx_echo_name($value); ?>: </th>
|
673 |
+
<td>
|
674 |
+
<input type="checkbox" name="<?php weaverx_sapi_main_name($value['id']); ?>" id="<?php echo $value['id']; ?>"
|
675 |
+
<?php checked(weaverx_getopt_checked( $value['id'] )); ?> >
|
676 |
+
</td>
|
677 |
+
<?php weaverx_form_info($value);
|
678 |
+
?>
|
679 |
+
</tr>
|
680 |
+
<?php
|
681 |
+
}
|
682 |
+
|
683 |
+
function weaverx_form_radio( $value ) {
|
684 |
+
?>
|
685 |
+
|
686 |
+
<tr>
|
687 |
+
<th scope="row" align="right"><?php weaverx_echo_name($value); ?>: </th>
|
688 |
+
<td colspan="2">
|
689 |
+
|
690 |
+
<?php
|
691 |
+
$cur_val = weaverx_getopt_default( $value['id'], 'black' );
|
692 |
+
foreach ($value['value'] as $option) {
|
693 |
+
$desc = $option['val'];
|
694 |
+
if ( $desc == 'none' ) {
|
695 |
+
$desc = "None";
|
696 |
+
} else {
|
697 |
+
$icon = weaverx_relative_url('assets/css/icons/search-' . $desc . '.png');
|
698 |
+
$desc = '<img style="background-color:#ccc;height:24px; width:24px;" src="' . $icon . '" />';
|
699 |
+
}
|
700 |
+
?>
|
701 |
+
<input type="radio" name="<?php weaverx_sapi_main_name($value['id']); ?>" value="<?php echo $option['val']; ?>"
|
702 |
+
<?php checked($cur_val,$option['val']); ?> > <?php echo $desc; ?>
|
703 |
+
<?php } ?>
|
704 |
+
<?php echo '<br /><small style="margin-left:5%;">' . $value['info'] . '</small>'; ?>
|
705 |
+
</td>
|
706 |
+
</tr>
|
707 |
+
<?php
|
708 |
+
}
|
709 |
+
|
710 |
+
|
711 |
+
function weaverx_form_select_id( $value, $show_row = true ) {
|
712 |
+
if ( $show_row ) { ?>
|
713 |
+
|
714 |
+
<tr>
|
715 |
+
<th scope="row" align="right"><?php weaverx_echo_name($value); ?>: </th>
|
716 |
+
<td>
|
717 |
+
<?php } ?>
|
718 |
+
|
719 |
+
<select name="<?php weaverx_sapi_main_name($value['id']); ?>" id="<?php echo $value['id']; ?>">
|
720 |
+
<?php
|
721 |
+
foreach ($value['value'] as $option) {
|
722 |
+
?>
|
723 |
+
<option value="<?php echo $option['val'] ?>" <?php selected( (weaverx_getopt( $value['id'] ) == $option['val']));?>><?php echo $option['desc']; ?></option>
|
724 |
+
<?php } ?>
|
725 |
+
</select>
|
726 |
+
<?php if ( $show_row ) { ?>
|
727 |
+
</td>
|
728 |
+
<?php weaverx_form_info($value); ?>
|
729 |
+
</tr>
|
730 |
+
<?php }
|
731 |
+
}
|
732 |
+
|
733 |
+
function weaverx_form_select_layout($value) {
|
734 |
+
$list = array(array('val' => 'default', 'desc' => __('Use Default', 'weaver-xtreme' /*adm*/) ),
|
735 |
+
array('val' => 'right', 'desc' => __('Sidebars on Right', 'weaver-xtreme' /*adm*/) ),
|
736 |
+
array('val' => 'right-top', 'desc' => __('Sidebars on Right (stack top)', 'weaver-xtreme' /*adm*/) ),
|
737 |
+
array('val' => 'left', 'desc' => __('Sidebars on Left', 'weaver-xtreme' /*adm*/) ),
|
738 |
+
array('val' => 'left-top', 'desc' => __(' Sidebars on Left (stack top)', 'weaver-xtreme' /*adm*/) ),
|
739 |
+
array('val' => 'split', 'desc' => __('Split - Sidebars on Right and Left', 'weaver-xtreme' /*adm*/) ),
|
740 |
+
array('val' => 'split-top', 'desc' => __('Split (stack top)', 'weaver-xtreme' /*adm*/) ),
|
741 |
+
array('val' => 'one-column', 'desc' => __('No sidebars, content only', 'weaver-xtreme' /*adm*/) )
|
742 |
+
);
|
743 |
+
|
744 |
+
|
745 |
+
$value['value'] = $list;
|
746 |
+
weaverx_form_select_id($value);
|
747 |
+
}
|
748 |
+
|
749 |
+
function weaverx_form_link($value) {
|
750 |
+
$id = $value['id'];
|
751 |
+
|
752 |
+
$link = array ('name' => $value['name'] , 'id' => $id.'_color', 'type' => 'ctext', 'info' => $value['info']);
|
753 |
+
$hover = array ('name' => '<small>' . __('Hover', 'weaver-xtreme' /*adm*/) . '</small>', 'id' => $id.'_hover_color', 'type' => 'ctext', 'info' => __('Hover Color', 'weaver-xtreme' /*adm*/));
|
754 |
+
|
755 |
+
weaverx_form_ctext($link);
|
756 |
+
$id_strong = $id . '_strong';
|
757 |
+
$id_em = $id . '_em';
|
758 |
+
$id_u = $id . '_u';
|
759 |
+
?>
|
760 |
+
<tr><td><small style="float:right;"><?php _e('Link Attributes:', 'weaver-xtreme' /*adm*/); ?></small></td><td colspan="2">
|
761 |
+
|
762 |
+
<small style="margin-left:5em;"><strong><?php _e('Bold', 'weaver-xtreme' /*adm*/); ?></strong></small>
|
763 |
+
|
764 |
+
<?php weaverx_form_font_bold_italic(array('id' => $id_strong)); ?>
|
765 |
+
|
766 |
+
<small><em><?php _e('Italic', 'weaver-xtreme' /*adm*/); ?></em></small>
|
767 |
+
<?php weaverx_form_font_bold_italic(array('id' => $id_em)); ?>
|
768 |
+
|
769 |
+
<small><u><?php _e('Underline', 'weaver-xtreme' /*adm*/); ?></u></small>
|
770 |
+
<input type="checkbox" name="<?php weaverx_sapi_main_name($id_u); ?>" id="<?php echo $id_u; ?>"
|
771 |
+
<?php checked(weaverx_getopt_checked( $id_u )); ?> >
|
772 |
+
|
773 |
+
<?php
|
774 |
+
|
775 |
+
weaverx_form_ctext($hover, true);
|
776 |
+
echo '</td></tr>';
|
777 |
+
}
|
778 |
+
|
779 |
+
|
780 |
+
function weaverx_form_note($value) {
|
781 |
+
?>
|
782 |
+
<tr>
|
783 |
+
<th scope="row" align="right"> </th>
|
784 |
+
<td style="float:right;font-weight:bold;"><?php weaverx_echo_name($value); ?>
|
785 |
+
<?php
|
786 |
+
weaverx_form_help($value);
|
787 |
+
?>
|
788 |
+
</td>
|
789 |
+
<?php
|
790 |
+
weaverx_form_info($value);
|
791 |
+
?>
|
792 |
+
</tr>
|
793 |
+
<?php
|
794 |
+
}
|
795 |
+
|
796 |
+
function weaverx_form_info($value) {
|
797 |
+
if ($value['info'] != '') {
|
798 |
+
echo('<td style="padding-left: 10px"><small>'); echo $value['info']; echo("</small></td>");
|
799 |
+
}
|
800 |
+
}
|
801 |
+
|
802 |
+
|
803 |
+
function weaverx_form_widget_area( $value, $submit = false ) {
|
804 |
+
/* build the rows for area settings
|
805 |
+
* Defined Areas:
|
806 |
+
* 'container' => '0', 'header' => '0', 'header_html' => '0', 'header_sb' => '0',
|
807 |
+
'infobar' => '5px', 'content' => 'T:4px, B:8px', 'post' => '0', 'footer' => '0',
|
808 |
+
'footer_sb' => '0', 'footer_html' => '0', 'widget' => '0', 'primary' => '0',
|
809 |
+
'secondary' => '0', 'extra' => '0', 'top' => '0', 'bottom' => '0', 'wrapper' => '0'
|
810 |
+
*/
|
811 |
+
|
812 |
+
// defaults - these are determined by the =Padding section of style-weaverx.css
|
813 |
+
$default_tb = array(
|
814 |
+
'infobar' => '5px', 'content' => 'T:4px, B:8px', 'post' => '0', 'footer' => '8px',
|
815 |
+
'footer_sb' => '8px', 'primary' => '8px',
|
816 |
+
'secondary' => '8px', 'extra' => '8px', 'top' => '8px', 'bottom' => '8px'
|
817 |
+
);
|
818 |
+
|
819 |
+
$default_lr = array(
|
820 |
+
'infobar' => '5px', 'content' => '2%', 'post' => '0', 'footer' => '8px',
|
821 |
+
'footer_sb' => '8px', 'primary' => '8px',
|
822 |
+
'secondary' => '8px', 'extra' => '8px', 'top' => '8px', 'bottom' => '8px'
|
823 |
+
);
|
824 |
+
|
825 |
+
$default_margins = array(
|
826 |
+
'infobar' => '5px', 'content' => 'T:0, B:10', 'footer' => 'T:0, B:0',
|
827 |
+
'footer_sb' => 'T:0, B:10', 'primary' => 'T:0, B:10', 'widget' => '0, Auto - First: T:0, Last: B:0',
|
828 |
+
'secondary' => 'T:0, B:10', 'extra' => 'T:0, B:10', 'top' => 'T:10, B:10', 'bottom' => 'T:10, B:10',
|
829 |
+
'wrapper' => 'T:0, B:0'
|
830 |
+
);
|
831 |
+
|
832 |
+
$id = $value['id'];
|
833 |
+
|
834 |
+
$def_tb = '0'; $def_lr = '0' ; $def_marg = '0';
|
835 |
+
if ( isset( $default_tb[$id] ) ) $def_tb = $default_tb[$id];
|
836 |
+
if ( isset( $default_lr[$id] ) ) $def_lr = $default_lr[$id];
|
837 |
+
if ( isset( $default_margins[$id] ) ) $def_marg = $default_margins[$id];
|
838 |
+
|
839 |
+
$use_percent = array('content', 'post');
|
840 |
+
|
841 |
+
//echo '<table><tr><td>';
|
842 |
+
$name = $value['name'];
|
843 |
+
|
844 |
+
|
845 |
+
$lr_type = ( in_array($id, $use_percent) ) ? 'text_lr_percent' : 'text_lr';
|
846 |
+
|
847 |
+
|
848 |
+
$opts = array (
|
849 |
+
|
850 |
+
array( 'name' => $name, 'icon' => '-welcome-widgets-menus',
|
851 |
+
'id' => "h-{$id}", 'type' => 'header_area',
|
852 |
+
'info' => $value['info']),
|
853 |
+
|
854 |
+
array( 'name' => $name, 'id' => $id, 'type' => 'titles_area',
|
855 |
+
'info' => $name ),
|
856 |
+
|
857 |
+
array( 'name' => '<span class="i-left dashicons dashicons-align-none"></span>' . __('Padding', 'weaver-xtreme' /*adm*/) ,
|
858 |
+
'id' => $id . '_padding', 'type' => 'text_tb',
|
859 |
+
'info' => '<em>' . $name . '</em>' . __(': Top/Bottom Inner padding [Default: ', 'weaver-xtreme') . $def_tb . ']' ),
|
860 |
+
|
861 |
+
array( 'name' => '', 'id' => $id . '_padding', 'type' => $lr_type,
|
862 |
+
'info' => '<em>' . $name . '</em>' . __(': Left/Right Inner padding [Default: ', 'weaver-xtreme') . $def_lr . ']' ),
|
863 |
+
|
864 |
+
array( 'name' => '<span class="i-left dashicons dashicons-align-none"></span>' . __('Top/Bottom Margins', 'weaver-xtreme'),
|
865 |
+
'id' => $id . '_margin', 'type' => 'text_tb',
|
866 |
+
'info' => '<em>' . $name . '</em>' . __(': Top/Bottom margins. <em>Side margins auto-generated.</em> [Default: ', 'weaver-xtreme') . $def_marg . ']' )
|
867 |
+
|
868 |
+
);
|
869 |
+
|
870 |
+
weaverx_form_show_options($opts, false, false);
|
871 |
+
|
872 |
+
|
873 |
+
$no_lr_margins = array( // areas that can't allow left-right margin or width specifications
|
874 |
+
'primary', 'secondary', 'content', 'post', 'widget'
|
875 |
+
);
|
876 |
+
$no_widgets = array( // areas that don't have widgets
|
877 |
+
'widget', 'content', 'post', 'wrapper', 'container', 'header', 'header_html', 'footer_html', 'footer', 'infobar'
|
878 |
+
);
|
879 |
+
|
880 |
+
$no_hide = array(
|
881 |
+
'wrapper', 'container', 'content','widget', 'post'
|
882 |
+
);
|
883 |
+
|
884 |
+
|
885 |
+
if ( in_array( $id, $no_lr_margins )) {
|
886 |
+
if ( $id != 'widget') {
|
887 |
+
weaverx_form_checkbox(array(
|
888 |
+
'name' => '<span class="i-left dashicons dashicons-align-none"></span>' . __('Add Side Margin(s)', 'weaver-xtreme' /*adm*/),
|
889 |
+
'id' => $id . '_smartmargin',
|
890 |
+
'type' => '',
|
891 |
+
'info' => '<em>' . $name . '</em>' .
|
892 |
+
__(': Automatically add left/right "smart" margins for separation of areas (sidebar/content).', 'weaver-xtreme' /*adm*/) ));
|
893 |
+
}
|
894 |
+
|
895 |
+
weaverx_form_note(array('name' => '<strong>' . __('Width', 'weaver-xtreme' /*adm*/) . '</strong>',
|
896 |
+
'info' => __('The width of this area is automatically determined by the enclosing area', 'weaver-xtreme' /*adm*/)));
|
897 |
+
} else if ( $id != 'wrapper' ) {
|
898 |
+
|
899 |
+
weaverx_form_val( array(
|
900 |
+
'name' => '<span class="i-left" style="font-size:150%;">↔</span> ' . __('Width', 'weaver-xtreme' /*adm*/),
|
901 |
+
'id' => $id . '_width_int', 'type' => '',
|
902 |
+
'info' => '<em>' . $name . '</em>' . __(': Width of Area in % of enclosing area on desktop and small tablet. Hint: use with Center align. (Default: 100%)', 'weaver-xtreme' /*adm*/),
|
903 |
+
'value' => array() ), '%' );
|
904 |
+
|
905 |
+
weaverx_form_align(array(
|
906 |
+
'name' => '<span class="i-left dashicons dashicons-editor-alignleft"></span><small>' . __('Align Area', 'weaver-xtreme' /*adm*/) . '</small>',
|
907 |
+
'id' => $id . '_align',
|
908 |
+
'type' => '',
|
909 |
+
'info' => '<em>' . $name . '</em>' . __(': How to align this area (Default: Left Align)', 'weaver-xtreme' /*adm*/) )
|
910 |
+
|
911 |
+
);
|
912 |
+
}
|
913 |
+
|
914 |
+
|
915 |
+
if ( $id == 'wrapper' ) { // setting #wrapper sets theme width.
|
916 |
+
|
917 |
+
$info = __('<em>Change Theme Width.</em> Standard width is 940px. Use 9999 for full screen width. Widths less than 768px may give unexpected results on mobile devices. Weaver Xtreme can not create a fixed-width site.', 'weaver-xtreme' /*adm*/);
|
918 |
+
|
919 |
+
weaverx_form_val( array(
|
920 |
+
'name' => '<span class="i-left" style="font-size:150%;">↔</span><em style="color:red;">' . __('Theme Width', 'weaver-xtreme' /*adm*/) . '</em>',
|
921 |
+
'id' => 'theme_width_int', 'type' => '',
|
922 |
+
'info' => $info,
|
923 |
+
'value' => array() ), 'px' );
|
924 |
+
}
|
925 |
+
|
926 |
+
if ( in_array( $id, array( 'container', 'header', 'footer') ) ) {
|
927 |
+
$opts_max = array(
|
928 |
+
array(
|
929 |
+
'name' => '<small>' . __('Max Width', 'weaver-xtreme' /*adm*/) . '</small>',
|
930 |
+
'icon' => '<span class="i-left" style="font-size:150%;">↔</span>',
|
931 |
+
'id' => $id . '_max_width_int', 'type' => '+val_px',
|
932 |
+
'info' => '<em>' . $name . '</em>' . __(': Set Max Width of Area for Desktop View. Advanced Option. (★Plus)', 'weaver-xtreme' /*adm*/),
|
933 |
+
'value' => array() ),
|
934 |
+
array(
|
935 |
+
'name' => '<small>' . __('Full-width BG', 'weaver-xtreme' /*adm*/) . '</small>', 'id' => $id . '_extend_bgcolor', 'type' => '+color',
|
936 |
+
'info' => '<em>' . $name . '</em>' . __(': Extend BG color to full theme width on Desktop View (★Plus)', 'weaver-xtreme' /*adm*/),
|
937 |
+
'value' => array() ),
|
938 |
+
|
939 |
+
array(
|
940 |
+
'name' => '<small>' . __('Extend BG Attributes', 'weaver-xtreme' /*adm*/) . '</small>',
|
941 |
+
'icon' => '<span class="i-left" style="font-size:150%;">↔</span>',
|
942 |
+
'id' => $id . '_extend_width', 'type' => 'checkbox',
|
943 |
+
'info' => '<em>' . $name . '</em>' . __(': Extend all BG Attributes to full width. Overrides Full-width BG color.', 'weaver-xtreme' /*adm*/)),
|
944 |
+
|
945 |
+
);
|
946 |
+
|
947 |
+
weaverx_form_show_options($opts_max, false, false);
|
948 |
+
}
|
949 |
+
|
950 |
+
|
951 |
+
if ( ! in_array( $id, $no_widgets) ) {
|
952 |
+
|
953 |
+
$opts02 = array(
|
954 |
+
array('name' => __('Columns', 'weaver-xtreme' /*adm*/),
|
955 |
+
'icon' => '<span class="i-left" style="font-size:120%;"> ☷</span>' ,
|
956 |
+
'id' => $id . '_cols_int', 'type' => 'val_num',
|
957 |
+
'info' => '<em>' . $name . '</em>' . __(': Equal width columns of widgets (Default: 1; max: 8)', 'weaver-xtreme' /*adm*/) ),
|
958 |
+
|
959 |
+
array('name' => '<small>' . __('No Smart Widget Margins', 'weaver-xtreme' /*adm*/) . '</small>', 'icon' => '-align-none',
|
960 |
+
'id' => $id . '_no_widget_margins', 'type' => 'checkbox',
|
961 |
+
'info' => '<em>' . $name . '</em>' . __(': Do not use "smart margins" between widgets on rows.', 'weaver-xtreme' /*adm*/) ),
|
962 |
+
|
963 |
+
array('name' => '<small>' . __('Equal Height Widget Rows', 'weaver-xtreme' /*adm*/) . '</small>',
|
964 |
+
'icon' => '<span class="i-left" style="font-size:140%;"> =</span>',
|
965 |
+
'id' => $id . '_eq_widgets', 'type' => '+checkbox',
|
966 |
+
'info' => '<em>' . $name . '</em>' . __(': Make widgets equal height rows if > 1 column (★Plus)', 'weaver-xtreme' /*adm*/) ),
|
967 |
+
|
968 |
+
);
|
969 |
+
|
970 |
+
weaverx_form_show_options($opts02, false, false);
|
971 |
+
|
972 |
+
|
973 |
+
$custom_widths = array( 'header_sb', 'footer_sb', 'primary', 'secondary', 'top', 'bottom');
|
974 |
+
if ( in_array( $id, $custom_widths) ) { /* if ( $id == 'header_sb' || $id == 'footer_sb' ) { */ ?>
|
975 |
+
<tr><th scope="row" align="right"><span class="i-left" style="font-size:120%;"> ☷</span><small><?php _e('Custom Widget Widths:', 'weaver-xtreme' /*adm*/); ?></small></th><td colspan="2" style="padding-left:20px;">
|
976 |
+
<small><?php _e('You can optionally specify widget widths, including for specific devices. Please read the help entry!', 'weaver-xtreme' /*adm*/); ?>
|
977 |
+
<?php weaverx_help_link('help.html#CustomWidgetWidth',__('Help on Custom Widget Widths', 'weaver-xtreme' /*adm*/)); ?>
|
978 |
+
<?php _e('(★Plus) (♦)', 'weaver-xtreme' /*adm*/); ?></small></td>
|
979 |
+
</tr>
|
980 |
+
<?php
|
981 |
+
$opts2 = array(
|
982 |
+
array('name' => '<small>' . __('Desktop', 'weaver-xtreme' /*adm*/) . '</small>',
|
983 |
+
'icon' => '<span class="i-left dashicons dashicons-desktop"></span>',
|
984 |
+
'id' => '_' . $id . '_lw_cols_list', 'type' => '+textarea',
|
985 |
+
'placeholder' => __('25,25,50; 60,40; - for example', 'weaver-xtreme' /*adm*/),
|
986 |
+
'info' => __('List of widths separated by comma. Use semi-colon (;) for end of each row. (★Plus) (♦)', 'weaver-xtreme' /*adm*/)),
|
987 |
+
array('name' => '<small>' . __('Small Tablet', 'weaver-xtreme' /*adm*/) . '</small>',
|
988 |
+
'icon' => '<span class="i-left dashicons dashicons-tablet"></span>',
|
989 |
+
'id' => '_' . $id . '_mw_cols_list', 'type' => '+textarea',
|
990 |
+
'info' => __('List of widget widths. (★Plus) (♦)', 'weaver-xtreme' /*adm*/)),
|
991 |
+
array('name' => '<small>' . __('Phone', 'weaver-xtreme' /*adm*/) . '</small>',
|
992 |
+
'icon' => '<span class="i-left dashicons dashicons-smartphone"></span>',
|
993 |
+
'id' => '_' . $id . '_sw_cols_list', 'type' => '+textarea',
|
994 |
+
'info' => __('List of widget widths. (★Plus) (♦)', 'weaver-xtreme' /*adm*/)),
|
995 |
+
);
|
996 |
+
|
997 |
+
weaverx_form_show_options($opts2, false, false);
|
998 |
+
}
|
999 |
+
}
|
1000 |
+
|
1001 |
+
$opts3 = array (
|
1002 |
+
array( 'name' => '<small>' . __('Add Border', 'weaver-xtreme' /*adm*/) . '</small>',
|
1003 |
+
'icon' => '<span class="i-left" style="font-size:200%;margin-left:4px;">□</span>',
|
1004 |
+
'id' => $id . '_border', 'type' => 'checkbox',
|
1005 |
+
'info' => '<em>' . $name . '</em>' . __(': Add the "standard" border (as set on Custom tab)', 'weaver-xtreme' /*adm*/)),
|
1006 |
+
array( 'name' => '<small>' . __('Shadow', 'weaver-xtreme' /*adm*/) . '</small>',
|
1007 |
+
'icon' => '<span class="i-left dashicons dashicons-admin-page"></span>',
|
1008 |
+
'id' => $id .'_shadow', 'type' => 'shadows',
|
1009 |
+
'info' => '<em>' . $name . '</em>' . __(': Wrap Area with Shadow.', 'weaver-xtreme' /*adm*/)),
|
1010 |
+
array( 'name' => '<small>' . __('Rounded Corners', 'weaver-xtreme' /*adm*/) . '</small>',
|
1011 |
+
'icon' => '<span class="i-left dashicons dashicons-marker"></span>',
|
1012 |
+
'id' => $id .'_rounded', 'type' => 'rounded',
|
1013 |
+
'info' => '<em>' . $name . '</em>' . __(': Rounded corners. Needs bg color or borders to show. <em>You might need to set overlapping corners for parent/child areas also!</em>', 'weaver-xtreme' /*adm*/) )
|
1014 |
+
);
|
1015 |
+
|
1016 |
+
|
1017 |
+
|
1018 |
+
weaverx_form_show_options($opts3, false, false);
|
1019 |
+
|
1020 |
+
if ( ! in_array( $id, $no_hide) ) {
|
1021 |
+
weaverx_form_select_hide(array(
|
1022 |
+
'name' => '<small>' . __('Hide Area', 'weaver-xtreme' /*adm*/) . '</small>', 'icon' => '-visibility',
|
1023 |
+
'id' => $id .'_hide',
|
1024 |
+
'info' => '<em>' . $name . '</em>' . __(': Hide area on different display devices', 'weaver-xtreme' /*adm*/),
|
1025 |
+
'value' => '' ) );
|
1026 |
+
}
|
1027 |
+
|
1028 |
+
// class names
|
1029 |
+
$opts4 = array (
|
1030 |
+
array( 'name' => '<small>' . __('Add Classes', 'weaver-xtreme' /*adm*/) . '</small>',
|
1031 |
+
'icon' => '<span class="i-left">{ }</span> ',
|
1032 |
+
'id' => $id . '_add_class', 'type' => '+widetext',
|
1033 |
+
'info' => '<em>' . $name . '</em>' . __(': Space separated class names to add to this area (<em>Advanced option</em>) (★Plus)', 'weaver-xtreme' /*adm*/)
|
1034 |
+
)
|
1035 |
+
);
|
1036 |
+
|
1037 |
+
weaverx_form_show_options($opts4, false, false);
|
1038 |
+
|
1039 |
+
if ( $submit )
|
1040 |
+
weaverx_form_submit('');
|
1041 |
+
//echo '</td></tr></table>';
|
1042 |
+
|
1043 |
+
}
|
1044 |
+
|
1045 |
+
|
1046 |
+
|
1047 |
+
|
1048 |
+
|
1049 |
+
function weaverx_form_menu_opts( $value, $submit = false ) {
|
1050 |
+
// build the rows for area settings
|
1051 |
+
|
1052 |
+
//echo '<table><tr><td>';
|
1053 |
+
$name = $value['name'];
|
1054 |
+
$id = $value['id'];
|
1055 |
+
|
1056 |
+
$opts = array(
|
1057 |
+
|
1058 |
+
array( 'name' => $name, 'icon' => '-menu',
|
1059 |
+
'type' => 'header_area',
|
1060 |
+
'id' => "h-{$id}",
|
1061 |
+
'info' => $value['info']),
|
1062 |
+
|
1063 |
+
array( 'name' => __('Menu Bar', 'weaver-xtreme' /*adm*/),
|
1064 |
+
'id' => $id, 'type' => 'titles_menu', // includes color, font size, font family
|
1065 |
+
'info' => __('Entire Menu Bar', 'weaver-xtreme' /*adm*/) ),
|
1066 |
+
|
1067 |
+
array( 'name' => __('Item BG', 'weaver-xtreme' /*adm*/),
|
1068 |
+
'id' => $id . '_link_bgcolor', 'type' => 'ctext',
|
1069 |
+
'info' => '<em>' . $name . '</em>' . __(': Background Color for Menu Bar Items (links)', 'weaver-xtreme' /*adm*/) ),
|
1070 |
+
|
1071 |
+
array( 'name' => '<small>' . __('Dividers between menu items', 'weaver-xtreme' /*adm*/) . '</small>',
|
1072 |
+
'id' => $id . '_dividers_color', 'type' => '+color',
|
1073 |
+
'info' => '<em>' . $name . '</em>' . __(': Add colored dividers between menu items. Leave blank for none. (★Plus)', 'weaver-xtreme' /*adm*/) ),
|
1074 |
+
|
1075 |
+
array( 'name' => '<small>' . __('Hover BG', 'weaver-xtreme' /*adm*/) . '</small>',
|
1076 |
+
'id' => $id . '_hover_bgcolor', 'type' => 'ctext',
|
1077 |
+
'info' => '<em>' . $name . '</em>' . __(': Hover BG Color (Default: rgba(255,255,255,0.15))', 'weaver-xtreme' /*adm*/) ),
|
1078 |
+
array( 'name' => '<small>' . __('Hover Text Color', 'weaver-xtreme' /*adm*/) . '</small>',
|
1079 |
+
'id' => $id . '_hover_color', 'type' => 'color',
|
1080 |
+
'info' => '<em>' . $name . '</em>' . __(': Hover Text Color', 'weaver-xtreme' /*adm*/) ),
|
1081 |
+
|
1082 |
+
|
1083 |
+
array( 'name' => '<small>' . __('<em>Mobile</em> Open Submenu Arrow BG -<br /><em>Not used by SmarMenus</em>', 'weaver-xtreme' /*adm*/) . '</small>',
|
1084 |
+
'id' => $id . '_clickable_bgcolor', 'type' => 'ctext',
|
1085 |
+
'info' => '<em>' . $name . '</em>' . __(': Clickable mobile open submenu arrow BG. Contrasting BG color required for proper user interface. <em>Not used by SmartMenus</em>. (Default: rgba(255,255,255,0.2))', 'weaver-xtreme' /*adm*/) ),
|
1086 |
+
|
1087 |
+
|
1088 |
+
|
1089 |
+
array( 'name' => __('Submenu BG', 'weaver-xtreme' /*adm*/),
|
1090 |
+
'id' => $id . '_sub_bgcolor', 'type' => 'ctext',
|
1091 |
+
'info' => '<em>' . $name . '</em>' . __(': Background Color for submenus', 'weaver-xtreme' /*adm*/) ),
|
1092 |
+
array( 'name' => '<small>' . __('Submenu Text Color', 'weaver-xtreme' /*adm*/) . '</small>',
|
1093 |
+
'id' => $id . '_sub_color', 'type' => 'ctext',
|
1094 |
+
'info' => '<em>' . $name . '</em>' . __(': Text Color for submenus', 'weaver-xtreme' /*adm*/) ),
|
1095 |
+
|
1096 |
+
array( 'name' => '<small>' . __('Submenu Hover BG', 'weaver-xtreme' /*adm*/) . '</small>',
|
1097 |
+
'id' => $id . '_sub_hover_bgcolor', 'type' => 'ctext',
|
1098 |
+
'info' => '<em>' . $name . '</em>' . __(': Submenu Hover BG Color (Default: Inherit Top Level)', 'weaver-xtreme' /*adm*/) ),
|
1099 |
+
array( 'name' => '<small>' . __('Submenu Hover Text Color', 'weaver-xtreme' /*adm*/) . '</small>',
|
1100 |
+
'id' => $id . '_sub_hover_color', 'type' => 'color',
|
1101 |
+
'info' => '<em>' . $name . '</em>' . __(': Submenu Hover Text Color (Default: Inherit Top Level)', 'weaver-xtreme' /*adm*/) ),
|
1102 |
+
|
1103 |
+
// can't get to font properties for the submenus because no way to add the classes
|
1104 |
+
|
1105 |
+
array(
|
1106 |
+
'name' => '<small>' . __('Full-width BG', 'weaver-xtreme' /*adm*/) . '</small>', 'id' => $id . '_extend_bgcolor', 'type' => '+color',
|
1107 |
+
'info' => '<em>' . $name . '</em>' . __(': Extend BG color to full theme width on Desktop View (★Plus)', 'weaver-xtreme' /*adm*/),
|
1108 |
+
'value' => array() ),
|
1109 |
+
array(
|
1110 |
+
'name' => '<small>' . __('Extend BG Attributes', 'weaver-xtreme' /*adm*/) . '</small>',
|
1111 |
+
'icon' => '<span class="i-left" style="font-size:150%;">↔</span>',
|
1112 |
+
'id' => $id . '_extend_width', 'type' => 'checkbox',
|
1113 |
+
'info' => '<em>' . $name . '</em>' . __(': Extend all BG Attributes to full width. Overrides Full-width BG color.', 'weaver-xtreme' /*adm*/)),
|
1114 |
+
|
1115 |
+
|
1116 |
+
array ('name' => __('Align Menu', 'weaver-xtreme' /*adm*/),
|
1117 |
+
'icon' => '-editor-alignleft',
|
1118 |
+
'id' => $id . '_align', 'type' => 'select_id',
|
1119 |
+
'info' => __('Align this menu on desktop view. Mobile, accordion, and vertical menus always left aligned.', 'weaver-xtreme' /*adm*/),
|
1120 |
+
'value' => array(
|
1121 |
+
array('val' => 'left', 'desc' => 'Left'),
|
1122 |
+
array('val' => 'center', 'desc' => 'Center'),
|
1123 |
+
array('val' => 'right', 'desc' => 'Right')
|
1124 |
+
)),
|
1125 |
+
|
1126 |
+
array( 'name' => '<small>' . __('Add Border', 'weaver-xtreme' /*adm*/) . '</small>',
|
1127 |
+
'icon' => '<span class="i-left" style="font-size:200%;margin-left:4px;">□</span>',
|
1128 |
+
'id' => $id . '_border', 'type' => 'checkbox',
|
1129 |
+
'info' => '<em>' . $name . '</em>' . ': Add the "standard" border (as set on Custom tab)' ),
|
1130 |
+
|
1131 |
+
array( 'name' => '<small>' . __('Add Border to Submenus', 'weaver-xtreme' /*adm*/) . '</small>',
|
1132 |
+
'icon' => '<span class="i-left" style="font-size:200%;margin-left:4px;">□</span>',
|
1133 |
+
'id' => $id . '_sub_border', 'type' => 'checkbox',
|
1134 |
+
'info' => '<em>' . $name . '</em>' . ': Add the "standard" border to Submenus' ),
|
1135 |
+
|
1136 |
+
array( 'name' => '<small>' . __('Rounded Submenu Corners', 'weaver-xtreme' /*adm*/) . '</small>',
|
1137 |
+
'icon' => '-marker',
|
1138 |
+
'id' => $id . '_sub_rounded', 'type' => 'checkbox',
|
1139 |
+
'info' => '<em>' . $name . '</em>' . ': Add rounded corners to Submenus' ),
|
1140 |
+
|
1141 |
+
array( 'name' => '<small>' . __('Shadow', 'weaver-xtreme' /*adm*/) . '</small>',
|
1142 |
+
'icon' => '-admin-page',
|
1143 |
+
'id' => $id .'_shadow', 'type' => 'shadows',
|
1144 |
+
'info' => '<em>' . $name . '</em>' . __(': Wrap Menu Bar with Shadow.', 'weaver-xtreme' /*adm*/) ),
|
1145 |
+
array( 'name' => '<small>' . __('Rounded Corners', 'weaver-xtreme' /*adm*/) . '</small>',
|
1146 |
+
'icon' => '-marker',
|
1147 |
+
'id' => $id .'_rounded', 'type' => 'rounded',
|
1148 |
+
'info' => '<em>' . $name . '</em>' . __(': Add rounded corners to menu. <em>You might need to set overlapping corners Header/Wrapper areas also!</em>', 'weaver-xtreme' /*adm*/) ),
|
1149 |
+
|
1150 |
+
);
|
1151 |
+
|
1152 |
+
weaverx_form_show_options($opts, false, false);
|
1153 |
+
|
1154 |
+
|
1155 |
+
if ( $id == 'm_primary' ) {
|
1156 |
+
weaverx_form_checkbox(array(
|
1157 |
+
'name' => '<small>' . __('Move Primary Menu to Top', 'weaver-xtreme' /*adm*/) . '</small>',
|
1158 |
+
'id' => $id . '_move',
|
1159 |
+
'info' => '<em>' . $name . '</em>' . __(': Move Primary Menu at Top of Header Area (Default: Bottom)', 'weaver-xtreme' /*adm*/),
|
1160 |
+
'value' => '' ) );
|
1161 |
+
} elseif ( $id == 'm_secondary' ){
|
1162 |
+
weaverx_form_checkbox(array(
|
1163 |
+
'name' => '<small>' . __('Move Secondary Menu to Bottom', 'weaver-xtreme' /*adm*/) . '</small>',
|
1164 |
+
'id' => $id . '_move',
|
1165 |
+
'info' => '<em>' . $name . '</em>' . __(': Move Secondary Menu at Bottom of Header Area (Default: Top)', 'weaver-xtreme' /*adm*/),
|
1166 |
+
'value' => '' ) );
|
1167 |
+
}
|
1168 |
+
|
1169 |
+
$opts2 = array(
|
1170 |
+
array( 'name' => '<small>' . __('Hide Area', 'weaver-xtreme' /*adm*/) . '</small>', 'icon' => '-visibility',
|
1171 |
+
'id' => $id .'_hide', 'type' => 'select_hide',
|
1172 |
+
'info' => '<em>' . $name . '</em>' . __(': Hide menu on different display devices', 'weaver-xtreme' /*adm*/) ),
|
1173 |
+
array( 'name' => '<small>' . __('Hide Arrows', 'weaver-xtreme' /*adm*/) . '</small>', 'icon' => '-visibility',
|
1174 |
+
'id' => $id . '_hide_arrows', 'type' => 'checkbox',
|
1175 |
+
'info' => '<em>' . $name . '</em>' . __(': Hide Arrows on Desktop Menu', 'weaver-xtreme' /*adm*/)),
|
1176 |
+
|
1177 |
+
array( 'name' => '<small>' . __('Desktop Menu Vertical Padding', 'weaver-xtreme' /*adm*/) . '</small>', 'icon' => '-align-none', 'icon' => '-align-none',
|
1178 |
+
'id' => $id .'_menu_pad_dec', 'type' => 'val_em',
|
1179 |
+
'info' => '<em>' . $name . '</em>' . __(': Add vertical padding to Desktop menu bar and submenus (Default: 0.6em)', 'weaver-xtreme' /*adm*/) ),
|
1180 |
+
|
1181 |
+
array( 'name' => '<small>' . __('Desktop Menu Spacing', 'weaver-xtreme' /*adm*/) . '</small>',
|
1182 |
+
'icon' => '<span class="i-left" style="font-size:150%;">↔</span>',
|
1183 |
+
'id' => $id .'_right_padding_dec' , 'type' => 'val_em',
|
1184 |
+
'info' => '<em>' . $name . '</em>' . __(': Add space between desktop menu bar items (Use value > 1.0)', 'weaver-xtreme' /*adm*/) ),
|
1185 |
+
|
1186 |
+
array( 'name' => '<small>' . __('Add Classes','weaver-xtreme' /*adm*/) . '</small>',
|
1187 |
+
'icon' => '<span class="i-left">{ }</span> ',
|
1188 |
+
'id' => $id . '_add_class', 'type' => '+widetext',
|
1189 |
+
'info' => '<em>' . $name . '</em>' . __(': Space separated class names to add to this area (<em>Advanced option</em>) (★Plus)', 'weaver-xtreme' /*adm*/) ),
|
1190 |
+
array('name' => '<small>' . __('Left HTML', 'weaver-xtreme' /*adm*/) . '</small>', 'icon' => '-editor-code',
|
1191 |
+
'id' => $id . '_html_left', 'type' => '+textarea',
|
1192 |
+
'placeholder' => __('Any HTML, including shortcodes.', 'weaver-xtreme' /*adm*/),
|
1193 |
+
'info' => __('Add HTML Left (Works best with Centered Menu) (♦)(★Plus)', 'weaver-xtreme' /*adm*/)),
|
1194 |
+
array( 'name' => '<small>' . __('Hide Area', 'weaver-xtreme' /*adm*/) . '</small>', 'icon' => '-visibility',
|
1195 |
+
'id' => $id .'_hide_left', 'type' => '+select_hide',
|
1196 |
+
'info' => '<em>' . $name . '</em>' . __(': Hide Left HTML', 'weaver-xtreme' /*adm*/) ),
|
1197 |
+
array('name' => '<small>' . __('Right HTML', 'weaver-xtreme' /*adm*/) . '</small>', 'icon' => '-editor-code',
|
1198 |
+
'id' => $id . '_html_right', 'type' => '+textarea',
|
1199 |
+
'placeholder' => __('Any HTML, including shortcodes.', 'weaver-xtreme' /*adm*/),
|
1200 |
+
'info' => __('Add HTML to Menu on Right (Works best with Centered Menu) (♦)(★Plus)', 'weaver-xtreme' /*adm*/)),
|
1201 |
+
array( 'name' => '<small>' . __('Hide Area', 'weaver-xtreme' /*adm*/) . '</small>', 'icon' => '-visibility',
|
1202 |
+
'id' => $id .'_hide_right', 'type' => '+select_hide',
|
1203 |
+
'info' => '<em>' . $name . '</em>' . __(': Hide Right HTML', 'weaver-xtreme' /*adm*/) ),
|
1204 |
+
array( 'name' => '<small>' . __('HTML: Text Color', 'weaver-xtreme' /*adm*/) . '</small>',
|
1205 |
+
'id' => $id .'_html_color', 'type' => 'ctext',
|
1206 |
+
'info' => '<em>' . $name . '</em>' . __(': Text Color for Left/Right Menu Bar HTML', 'weaver-xtreme' /*adm*/) ),
|
1207 |
+
array( 'name' => '<small>' . __('HTML: Top Margin', 'weaver-xtreme' /*adm*/) . '</small>', 'icon' => '-align-none',
|
1208 |
+
'id' => $id .'_html_margin_dec', 'type' => 'val_em',
|
1209 |
+
'info' => '<em>' . $name . '</em>' . __(': Margin above Added Menu HTML (Used to adjust for Desktop menu. Negative values can help.)', 'weaver-xtreme' /*adm*/) ),
|
1210 |
+
|
1211 |
+
);
|
1212 |
+
|
1213 |
+
weaverx_form_show_options($opts2, false, false);
|
1214 |
+
|
1215 |
+
|
1216 |
+
if ( $submit )
|
1217 |
+
weaverx_form_submit('');
|
1218 |
+
}
|
1219 |
+
|
1220 |
+
|
1221 |
+
|
1222 |
+
function weaverx_form_text_props( $value, $type = 'titles') {
|
1223 |
+
// display text properties for an area or title
|
1224 |
+
|
1225 |
+
$id = $value['id'];
|
1226 |
+
$name = $value['name'];
|
1227 |
+
$info = $value['info'];
|
1228 |
+
|
1229 |
+
$id_colorbg = $id . '_bgcolor';
|
1230 |
+
|
1231 |
+
$id_color = $id . '_color';
|
1232 |
+
$id_size = $id . '_font_size';
|
1233 |
+
$id_family = $id . '_font_family';
|
1234 |
+
$id_bold = $id . '_bold';
|
1235 |
+
$id_normal = $id . '_normal';
|
1236 |
+
$id_italic = $id . '_italic';
|
1237 |
+
|
1238 |
+
// COLOR BG & COLOR BOX
|
1239 |
+
|
1240 |
+
if ($id == 'wrapper') {
|
1241 |
+
echo '<tr><td></td><td colspan="2"><p>';
|
1242 |
+
_e('<strong>Important note:</strong> The Wrapper Area provides default
|
1243 |
+
<em>background color, text color, and text font properties</em>
|
1244 |
+
for most other areas, including Header, Container, Content, Widgets, and more.',
|
1245 |
+
'weaver-xtreme' /*adm*/);
|
1246 |
+
echo "</p></td></tr>\n";
|
1247 |
+
}
|
1248 |
+
|
1249 |
+
weaverx_form_ctext( array(
|
1250 |
+
'name' => $name . ' BG',
|
1251 |
+
'id' => $id_colorbg,
|
1252 |
+
'info' => '<em>' . $info . __(':</em> Background Color (use CSS+ to specify custom CSS for area)', 'weaver-xtreme' /*adm*/)));
|
1253 |
+
|
1254 |
+
if ( $type == 'menu' || $id == 'post_title' )
|
1255 |
+
weaverx_form_ctext( array(
|
1256 |
+
'name' => $name . ' ' . __('Text Color', 'weaver-xtreme' /*adm*/),
|
1257 |
+
'id' => $id_color,
|
1258 |
+
'info' => '<em>' . $info . __(':</em> Text properties', 'weaver-xtreme' /*adm*/)));
|
1259 |
+
else
|
1260 |
+
weaverx_form_color( array(
|
1261 |
+
'name' => $name . ' ' . __('Text Color', 'weaver-xtreme' /*adm*/),
|
1262 |
+
'id' => $id_color,
|
1263 |
+
'info' => '<em>' . $info . __(':</em> Text properties', 'weaver-xtreme' /*adm*/)));
|
1264 |
+
|
1265 |
+
// FONT PROPERTIES
|
1266 |
+
?>
|
1267 |
+
<tr>
|
1268 |
+
<th scope="row" align="right"><span class="i-left font-bold font-italic"><span style="font-size:16px;">a</span><span style="font-size:14px;">b</span><span style="font-size:12px;">c</span></span><small>
|
1269 |
+
<?php echo ($type == 'titles') ? __('Title', 'weaver-xtreme' /*adm*/) : __('Text', 'weaver-xtreme' /*adm*/);?>
|
1270 |
+
<?php _e('Font properties:', 'weaver-xtreme' /*adm*/); ?></small> </th>
|
1271 |
+
<td colspan="2">
|
1272 |
+
<?php
|
1273 |
+
if ( $type != 'content') {
|
1274 |
+
echo ' <span class="rtl-break"><small><em>Size:</em></small>'; weaverx_form_select_font_size(array('id' => $id_size), false); echo '</span>';
|
1275 |
+
}
|
1276 |
+
echo ' <span class="rtl-break"><small><em>Family:</em></small>'; weaverx_form_select_font_family(array('id' => $id_family), false); echo '</span>'; ?>
|
1277 |
+
|
1278 |
+
<?php if ( $type == 'titles' ) { ?>
|
1279 |
+
<span class="rtl-break"><small><?php _e('Normal Weight', 'weaver-xtreme' /*adm*/); ?></small>
|
1280 |
+
<input type="checkbox" name="<?php weaverx_sapi_main_name($id_normal); ?>" id="<?php echo $id_normal; ?>"
|
1281 |
+
<?php checked(weaverx_getopt_checked( $id_normal )); ?> ></span>
|
1282 |
+
|
1283 |
+
<?php } else { ?>
|
1284 |
+
<span class="rtl-break"><small><strong><?php _e('Bold', 'weaver-xtreme' /*adm*/); ?></strong></small>
|
1285 |
+
<?php
|
1286 |
+
weaverx_form_font_bold_italic(array('id' => $id_bold));
|
1287 |
+
|
1288 |
+
/* <input type="checkbox" name="<?php weaverx_sapi_main_name($id_bold); ?>" id="<?php echo $id_bold; ?>"
|
1289 |
+
<?php checked(weaverx_getopt_checked( $id_bold )); ?> >
|
1290 |
+
*/
|
1291 |
+
?>
|
1292 |
+
</span>
|
1293 |
+
<?php } ?>
|
1294 |
+
<span class="rtl-break">
|
1295 |
+
<small><em><?php _e('Italic', 'weaver-xtreme' /*adm*/); ?></em></small>
|
1296 |
+
<?php
|
1297 |
+
weaverx_form_font_bold_italic(array('id' => $id_italic));
|
1298 |
+
/* <input type="checkbox" name="<?php weaverx_sapi_main_name($id_italic); ?>" id="<?php echo $id_italic; ?>"
|
1299 |
+
/<?php checked(weaverx_getopt_checked( $id_italic )); ?> >
|
1300 |
+
*/
|
1301 |
+
?>
|
1302 |
+
</span>
|
1303 |
+
<?php if ( apply_filters('weaverx_xtra_type', '+plus_fonts' ) == 'inactive' )
|
1304 |
+
echo '<small> ' . __('(Add new fonts with <em>Weaver Xtreme Plus</em>)', 'weaver-xtreme' /*adm*/) . '</small>';
|
1305 |
+
else
|
1306 |
+
echo '<small> ' . __('(Add new fonts from Custom & Fonts tab.)', 'weaver-xtreme' /*adm*/) . '</small>';?>
|
1307 |
+
</td>
|
1308 |
+
</tr>
|
1309 |
+
<?php
|
1310 |
+
|
1311 |
+
}
|
1312 |
+
|
1313 |
+
function weaverx_from_fi_location( $value, $is_post = false ) {
|
1314 |
+
$value['value'] = array(
|
1315 |
+
array('val' => 'content-top', 'desc' => __('With Content - top', 'weaver-xtreme' /*adm*/) ),
|
1316 |
+
array('val' => 'content-bottom', 'desc' => __('With Content - bottom', 'weaver-xtreme' /*adm*/) ),
|
1317 |
+
array('val' => 'title-before', 'desc' => __('With Title', 'weaver-xtreme' /*adm*/) ),
|
1318 |
+
array('val' => 'header-image', 'desc' => $is_post ? __('Hide on Blog View', 'weaver-xtreme' /*adm*/) :
|
1319 |
+
__('Header Image Replacement', 'weaver-xtreme' /*adm*/) ),
|
1320 |
+
array('val' => 'post-before', 'desc' => __('Outside of Page/Post', 'weaver-xtreme' /*adm*/) )
|
1321 |
+
);
|
1322 |
+
|
1323 |
+
|
1324 |
+
weaverx_form_select_id($value);
|
1325 |
+
}
|
1326 |
+
|
1327 |
+
|
1328 |
+
function weaverx_form_align( $value ) {
|
1329 |
+
$value['value'] = array(
|
1330 |
+
array('val' => 'float-left', 'desc' => __('Align Left', 'weaver-xtreme' /*adm*/) ),
|
1331 |
+
array('val' => 'center', 'desc' => __('Center', 'weaver-xtreme' /*adm*/) ),
|
1332 |
+
array('val' => 'float-right', 'desc' => __('Align Right', 'weaver-xtreme' /*adm*/) )
|
1333 |
+
);
|
1334 |
+
|
1335 |
+
weaverx_form_select_id($value);
|
1336 |
+
}
|
1337 |
+
|
1338 |
+
|
1339 |
+
function weaverx_form_fi_align( $value ) {
|
1340 |
+
$value['value'] = array(
|
1341 |
+
array('val' => 'fi-alignleft', 'desc' => __('Align Left', 'weaver-xtreme' /*adm*/) ),
|
1342 |
+
array('val' => 'fi-aligncenter', 'desc' => __('Center', 'weaver-xtreme' /*adm*/) ),
|
1343 |
+
array('val' => 'fi-alignright', 'desc' => __('Align Right', 'weaver-xtreme' /*adm*/) ),
|
1344 |
+
array('val' => 'fi-alignnone', 'desc' => __('No Align', 'weaver-xtreme' /*adm*/) )
|
1345 |
+
);
|
1346 |
+
|
1347 |
+
weaverx_form_select_id($value);
|
1348 |
+
}
|
1349 |
+
|
1350 |
+
function weaverx_form_select_hide($value) {
|
1351 |
+
$value['value'] = array(array('val' => 'hide-none', 'desc' => __('Do Not Hide', 'weaver-xtreme' /*adm*/) ),
|
1352 |
+
array('val' => 's-hide', 'desc' => __('Hide: Phones', 'weaver-xtreme' /*adm*/) ),
|
1353 |
+
array('val' => 'm-hide', 'desc' => __('Hide: Small Tablets', 'weaver-xtreme' /*adm*/) ),
|
1354 |
+
array('val' => 'm-hide s-hide', 'desc' => __('Hide: Phones+Tablets', 'weaver-xtreme' /*adm*/) ),
|
1355 |
+
array('val' => 'l-hide', 'desc' => __('Hide: Desktop', 'weaver-xtreme' /*adm*/) ),
|
1356 |
+
array('val' => 'l-hide m-hide', 'desc' => __('Hide: Desktop+Tablets', 'weaver-xtreme' /*adm*/) ),
|
1357 |
+
array('val' => 'hide', 'desc' => __('Hide on All Devices', 'weaver-xtreme' /*adm*/) )
|
1358 |
+
);
|
1359 |
+
|
1360 |
+
weaverx_form_select_id($value);
|
1361 |
+
}
|
1362 |
+
|
1363 |
+
function weaverx_form_select_font_size( $value, $show_row = true ) {
|
1364 |
+
$value['value'] = array(array('val' => 'default', 'desc' => __('Inherit', 'weaver-xtreme' /*adm*/) ),
|
1365 |
+
array('val' => 'm-font-size', 'desc' => __('Medium Font', 'weaver-xtreme' /*adm*/) ),
|
1366 |
+
array('val' => 'xxs-font-size', 'desc' => __('XX-Small Font', 'weaver-xtreme' /*adm*/) ),
|
1367 |
+
array('val' => 'xs-font-size', 'desc' => __('X-Small Font', 'weaver-xtreme' /*adm*/) ),
|
1368 |
+
array('val' => 's-font-size', 'desc' => __('Small Font', 'weaver-xtreme' /*adm*/) ),
|
1369 |
+
array('val' => 'l-font-size', 'desc' => __('Large Font', 'weaver-xtreme' /*adm*/) ),
|
1370 |
+
array('val' => 'xl-font-size', 'desc' => __('X-Large Font', 'weaver-xtreme' /*adm*/) ),
|
1371 |
+
array('val' => 'xxl-font-size', 'desc' => __('XX-Large Font', 'weaver-xtreme' /*adm*/) ),
|
1372 |
+
array('val' => 'customA-font-size', 'desc' => __('Custom Size A', 'weaver-xtreme' /*adm*/) ),
|
1373 |
+
array('val' => 'customB-font-size', 'desc' => __('Custom Size B', 'weaver-xtreme' /*adm*/) )
|
1374 |
+
);
|
1375 |
+
$value['value'] = apply_filters('weaverx_add_font_size', $value['value']);
|
1376 |
+
weaverx_form_select_id( $value, $show_row);
|
1377 |
+
}
|
1378 |
+
|
1379 |
+
|
1380 |
+
function weaverx_form_select_font_family( $value, $show_row = true ) {
|
1381 |
+
$value['value'] = array(array('val' => 'default', 'desc' => __('Inherit', 'weaver-xtreme' /*adm*/) ),
|
1382 |
+
array('val' => 'sans-serif', 'desc' => __('Arial (Sans Serif)', 'weaver-xtreme' /*adm*/) ),
|
1383 |
+
array('val' => 'arialBlack', 'desc' => __('Arial Black', 'weaver-xtreme' /*adm*/) ),
|
1384 |
+
array('val' => 'arialNarrow', 'desc' => __('Arial Narrow', 'weaver-xtreme' /*adm*/) ),
|
1385 |
+
array('val' => 'lucidaSans', 'desc' => __('Lucida Sans', 'weaver-xtreme' /*adm*/) ),
|
1386 |
+
array('val' => 'trebuchetMS', 'desc' => __('Trebuchet MS', 'weaver-xtreme' /*adm*/) ),
|
1387 |
+
array('val' => 'verdana', 'desc' => __('Verdana', 'weaver-xtreme' /*adm*/) ),
|
1388 |
+
|
1389 |
+
array('val' => 'serif', 'desc' => __('Times (Serif)', 'weaver-xtreme' /*adm*/) ),
|
1390 |
+
array('val' => 'cambria', 'desc' => __('Cambria', 'weaver-xtreme' /*adm*/) ),
|
1391 |
+
array('val' => 'garamond', 'desc' => __('Garamond', 'weaver-xtreme' /*adm*/) ),
|
1392 |
+
array('val' => 'georgia', 'desc' => __('Georgia', 'weaver-xtreme' /*adm*/) ),
|
1393 |
+
array('val' => 'lucidaBright', 'desc' => __('Lucida Bright', 'weaver-xtreme' /*adm*/) ),
|
1394 |
+
array('val' => 'palatino', 'desc' => __('Palatino', 'weaver-xtreme' /*adm*/) ),
|
1395 |
+
|
1396 |
+
array('val' => 'monospace', 'desc' => __('Courier (Monospace)', 'weaver-xtreme' /*adm*/) ),
|
1397 |
+
array('val' => 'consolas', 'desc' => __('Consolas', 'weaver-xtreme' /*adm*/) ),
|
1398 |
+
|
1399 |
+
array('val' => 'papyrus', 'desc' => __('Papyrus', 'weaver-xtreme' /*adm*/) ),
|
1400 |
+
array('val' => 'comicSans', 'desc' => __('Comic Sans MS', 'weaver-xtreme' /*adm*/) )
|
1401 |
+
);
|
1402 |
+
$value['value'] = apply_filters('weaverx_add_font_family', $value['value']);
|
1403 |
+
?>
|
1404 |
+
<select name="<?php weaverx_sapi_main_name($value['id']); ?>" id="<?php echo $value['id']; ?>">
|
1405 |
+
<?php
|
1406 |
+
foreach ($value['value'] as $option) {
|
1407 |
+
?>
|
1408 |
+
<option class="font-<?php echo $option['val'];?>" value="<?php echo $option['val'] ?>"<?php selected( (weaverx_getopt( $value['id'] ) == $option['val']));?>><?php echo $option['desc']; ?></option>
|
1409 |
+
<?php } ?>
|
1410 |
+
</select>
|
1411 |
+
<?php
|
1412 |
+
}
|
1413 |
+
|
1414 |
+
function weaverx_form_rounded($value) {
|
1415 |
+
$value['value'] = array(array('val' => 'none', 'desc' => __('None', 'weaver-xtreme' /*adm*/) ),
|
1416 |
+
array('val' => '-all', 'desc' => __('All Corners', 'weaver-xtreme' /*adm*/) ),
|
1417 |
+
array('val' => '-left', 'desc' => __('Left Corners', 'weaver-xtreme' /*adm*/) ),
|
1418 |
+
array('val' => '-right', 'desc' => __('Right Corners', 'weaver-xtreme' /*adm*/) ),
|
1419 |
+
array('val' => '-top', 'desc' => __('Top Corners', 'weaver-xtreme' /*adm*/) ),
|
1420 |
+
array('val' => '-bottom', 'desc' => __('Bottom Corners', 'weaver-xtreme' /*adm*/) ),
|
1421 |
+
);
|
1422 |
+
|
1423 |
+
weaverx_form_select_id($value);
|
1424 |
+
}
|
1425 |
+
|
1426 |
+
function weaverx_form_font_bold_italic($value) {
|
1427 |
+
$value['value'] = array(array('val' => '', 'desc' => __('Inherit', 'weaver-xtreme' /*adm*/) ),
|
1428 |
+
array('val' => 'on', 'desc' => __('On', 'weaver-xtreme' /*adm*/) ),
|
1429 |
+
array('val' => 'off', 'desc' => __('Off', 'weaver-xtreme' /*adm*/) )
|
1430 |
+
);
|
1431 |
+
|
1432 |
+
weaverx_form_select_id($value, false);
|
1433 |
+
}
|
1434 |
+
|
1435 |
+
function weaverx_form_shadows($value) {
|
1436 |
+
$value['value'] = array(array('val' => '-0', 'desc' => __('No Shadow', 'weaver-xtreme' /*adm*/) ), // as in .shadow-0
|
1437 |
+
array('val' => '-1', 'desc' => __('All Sides, 1px', 'weaver-xtreme' /*adm*/) ),
|
1438 |
+
array('val' => '-2', 'desc' => __('All Sides, 2px', 'weaver-xtreme' /*adm*/) ),
|
1439 |
+
array('val' => '-3', 'desc' => __('All Sides, 3px', 'weaver-xtreme' /*adm*/) ),
|
1440 |
+
array('val' => '-4', 'desc' => __('All Sides, 4px', 'weaver-xtreme' /*adm*/) ),
|
1441 |
+
array('val' => '-rb', 'desc' => __('Right + Bottom', 'weaver-xtreme' /*adm*/) ),
|
1442 |
+
array('val' => '-lb', 'desc' => __('Left + Bottom', 'weaver-xtreme' /*adm*/) ),
|
1443 |
+
array('val' => '-tr', 'desc' => __('Top + Right', 'weaver-xtreme' /*adm*/) ),
|
1444 |
+
array('val' => '-tl', 'desc' => __('Top + Left', 'weaver-xtreme' /*adm*/) ),
|
1445 |
+
array('val' => '-custom', 'desc' => __('Custom Shadow', 'weaver-xtreme' /*adm*/) )
|
1446 |
+
);
|
1447 |
+
$value['value'] = apply_filters('weaverx_add_shadows', $value['value']);
|
1448 |
+
|
1449 |
+
weaverx_form_select_id($value);
|
1450 |
+
}
|
1451 |
+
|
1452 |
+
// custom forms
|
1453 |
+
|
1454 |
+
function weaverx_custom_css( $value='' ) {
|
1455 |
+
|
1456 |
+
$css = weaverx_getopt('add_css');
|
1457 |
+
|
1458 |
+
if (isset($value['icon']))
|
1459 |
+
$icon = $value['icon'];
|
1460 |
+
if ( !isset($icon) || !$icon )
|
1461 |
+
$icon = '';
|
1462 |
+
|
1463 |
+
$dash = '';
|
1464 |
+
if ( $icon) { // add a leading icon
|
1465 |
+
$dash = '<span style="padding:.2em;" class="dashicons dashicons' . $icon . '"></span>';
|
1466 |
+
}
|
1467 |
+
?>
|
1468 |
+
<tr class="atw-row-header"><td colspan="3">
|
1469 |
+
<a id="custom-css-rules"></a>
|
1470 |
+
<span style="color:black;padding:.2em;" class="dashicons dashicons-screenoptions"></span>
|
1471 |
+
<span style="font-weight:bold; font-size: larger;"><em>
|
1472 |
+
<?php _e('Custom CSS Rules', 'weaver-xtreme' /*adm*/); ?> <?php weaverx_help_link('help.html#CustomCSS', __('Custom CSS Rules', 'weaver-xtreme' /*adm*/));?></em></span>
|
1473 |
+
</td></tr>
|
1474 |
+
<tr><td colspan="3">
|
1475 |
+
|
1476 |
+
<!-- ======== -->
|
1477 |
+
<p>
|
1478 |
+
<?php _e('Rules you add here will be the <em>last</em> CSS Rules included by Weaver Xtreme, and thus override all other Weaver Xtreme generated CSS rules.
|
1479 |
+
Specify complete CSS rules, but don\'t add the <style> HTML element. You can prefix your selectors with <code>.is-desktop, .is-mobile, .is-smalltablet, or .is-phone</code>
|
1480 |
+
to create rules for specific devices.
|
1481 |
+
<strong>NOTE:</strong> Because Weaver Xtreme uses classes on many of its elements, you may to need to use
|
1482 |
+
<em>!important</em> with your rules to force the style override.
|
1483 |
+
It is possible that other plugins might generate CSS that comes after these rules.', 'weaver-xtreme' /*adm*/); ?>
|
1484 |
+
</p>
|
1485 |
+
<?php weaverx_textarea(weaverx_getopt('add_css'), 'add_css', 12, ' ', 'width:95%;'); ?>
|
1486 |
+
</td></tr>
|
1487 |
+
<?php
|
1488 |
+
}
|
1489 |
+
|
1490 |
+
function weaverx_check_version() {
|
1491 |
+
|
1492 |
+
$version = WEAVERX_VERSION;
|
1493 |
+
|
1494 |
+
$check_site = 'https://weaverxtra.wordpress.com';
|
1495 |
+
$home_site = '//weavertheme.com';
|
1496 |
+
$msg = __(' - Available at:', 'weaver-xtreme' /*adm*/) . ' ' .
|
1497 |
+
'<a href="//weavertheme.com/download/" target="_blank">WeaverTheme.com/download/</a>';
|
1498 |
+
|
1499 |
+
$latest = weaverx_latest_version($check_site); // check if newer version is available
|
1500 |
+
if ( $latest[0] != 'unavailable' && version_compare($version,$latest[0],'<') ) {
|
1501 |
+
if ( ! empty($latest[1]) ) {
|
1502 |
+
$msg = $msg . '<p>' . $latest[1] . '</p>'; }
|
1503 |
+
$saveme = WEAVERX_THEMENAME . __(' Current version: ', 'weaver-xtreme' /*adm*/) . $version . __(' Newer version: ', 'weaver-xtreme' /*adm*/) . $latest[0] .
|
1504 |
+
$msg;
|
1505 |
+
weaverx_save_msg($saveme);
|
1506 |
+
}
|
1507 |
+
return '';
|
1508 |
+
}
|
1509 |
+
|
1510 |
+
function weaverx_latest_version($check_site) {
|
1511 |
+
$rss = fetch_feed($check_site. '/feed/');
|
1512 |
+
if (is_wp_error($rss) ) {
|
1513 |
+
return array('unavailable', '');
|
1514 |
+
}
|
1515 |
+
$out = '';
|
1516 |
+
$items = 1;
|
1517 |
+
$num_items = $rss->get_item_quantity($items);
|
1518 |
+
if ( $num_items < 1 ) {
|
1519 |
+
$out .= 'unavailable';
|
1520 |
+
$rss->__destruct();
|
1521 |
+
unset($rss);
|
1522 |
+
return array($out, '');
|
1523 |
+
}
|
1524 |
+
$rss_items = $rss->get_items(0, $items);
|
1525 |
+
foreach ($rss_items as $item ) {
|
1526 |
+
$title = esc_attr(strip_tags($item->get_title()));
|
1527 |
+
if ( empty($title) )
|
1528 |
+
$title = 'unavailable';
|
1529 |
+
$content = esc_attr(strip_tags($item->get_content()));
|
1530 |
+
}
|
1531 |
+
if (stripos($title,'announcement') === false) {
|
1532 |
+
$blank = strpos($title,' '); // find blank
|
1533 |
+
if ($blank < 1) // problem
|
1534 |
+
$title = 'unavailable';
|
1535 |
+
else {
|
1536 |
+
$title = substr($title,0,$blank);
|
1537 |
+
}
|
1538 |
+
}
|
1539 |
+
$out .= $title;
|
1540 |
+
$rss->__destruct();
|
1541 |
+
unset($rss);
|
1542 |
+
return array( $out, $content );
|
1543 |
+
}
|
1544 |
+
|
1545 |
+
function weaverx_elink( $href, $title, $label, $before='', $after='') {
|
1546 |
+
echo $before . '<a href="' . esc_url($href) . '" title="' . $title . '">' . $label . '</a>' . $after;
|
1547 |
+
}
|
1548 |
+
|
1549 |
+
function weaverx_tab_title( $title, $help_link, $help_title ) {
|
1550 |
+
echo '<h3>'. $title; weaverx_help_link( $help_link, $help_title ) ; echo '</h3>';
|
1551 |
+
}
|
1552 |
+
|
1553 |
+
?>
|
admin/load-weaverx-admin.php
ADDED
@@ -0,0 +1,100 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/* This loads the Admin stuff. It is invoked from functions.php.
|
3 |
+
*
|
4 |
+
* This ultimately will be used to load different admin interfaces -
|
5 |
+
* like the a default Customizer version for WP.org, or the traditional Theme Options version (which it does now)
|
6 |
+
*/
|
7 |
+
|
8 |
+
if (current_user_can('edit_posts')) {
|
9 |
+
|
10 |
+
add_action('admin_menu', 'weaverx_add_admin',5);
|
11 |
+
weaverx_load_admin_aux();
|
12 |
+
|
13 |
+
do_action('weaverx_check_updates');
|
14 |
+
|
15 |
+
|
16 |
+
function weaverx_add_admin() { // action definition
|
17 |
+
|
18 |
+
|
19 |
+
/* adds our admin panel (add_action: admin_menu) */
|
20 |
+
// 'edit_theme_options' works for both single and multisite
|
21 |
+
$page = add_theme_page('WeaverX', __('Weaver Xtreme <small>Admin</small>', 'weaver-xtreme' /*adm*/), 'edit_theme_options', 'WeaverX', 'weaverx_admin_theme_page');
|
22 |
+
/* using registered $page handle to hook stylesheet loading for this admin page */
|
23 |
+
add_action('admin_print_styles-'.$page, 'weaverx_admin_scripts');
|
24 |
+
}
|
25 |
+
|
26 |
+
// callback for add_theme_page
|
27 |
+
function weaverx_admin_theme_page() {
|
28 |
+
$wp_vers = $GLOBALS['wp_version'];
|
29 |
+
$cur_vers = $wp_vers;
|
30 |
+
$beta = strpos($cur_vers, '-');
|
31 |
+
if ( $beta > 0 ) {
|
32 |
+
$cur_vers = substr($cur_vers,0,$beta); // strip the beta part if there
|
33 |
+
}
|
34 |
+
if (version_compare($cur_vers, WEAVERX_MIN_WPVERSION, '<')) {
|
35 |
+
echo '<br><br><h2 style="padding:4px;background:pink;">' . __('ERROR: You are using WordPress Version ', 'weaver-xtreme' /*adm*/) . $GLOBALS['wp_version'] .
|
36 |
+
__(' Weaver Xtreme requires <em>WordPress Version ', 'weaver-xtreme' /*adm*/) . WEAVERX_MIN_WPVERSION .
|
37 |
+
__('</em> or above. You should always upgrade to the latest version of WordPress for maximum site performance and security.', 'weaver-xtreme' /*adm*/) .
|
38 |
+
'</h2>'; // admin message
|
39 |
+
return;
|
40 |
+
}
|
41 |
+
|
42 |
+
|
43 |
+
require_once(dirname( __FILE__ ) . '/admin-top.php'); // NOW - load the admin stuff
|
44 |
+
do_action('weaverxplus_add_admin');
|
45 |
+
weaverx_do_admin();
|
46 |
+
}
|
47 |
+
|
48 |
+
// callback for admin_print_styles in add_admin above
|
49 |
+
function weaverx_admin_scripts() {
|
50 |
+
/* called only on the admin page, enqueue our special style sheet here (for tabbed pages) */
|
51 |
+
wp_enqueue_style('wvrxaStylesheet', get_template_directory_uri().WEAVERX_ADMIN_DIR.'/assets/css/admin-style.css');
|
52 |
+
if ( is_rtl() )
|
53 |
+
wp_enqueue_style('wvrxartlStylesheet', get_template_directory_uri().WEAVERX_ADMIN_DIR.'/assets/css/admin-style-rtl.css');
|
54 |
+
|
55 |
+
wp_enqueue_style ("thickbox");
|
56 |
+
wp_enqueue_script ("thickbox");
|
57 |
+
|
58 |
+
// @@@@@@@@@@@@@@@@ jscolor needs fixing - won't find it with WEAVERX_ADMIN_DIR
|
59 |
+
|
60 |
+
wp_enqueue_script('wvrxJscolor', get_template_directory_uri().'/assets/js/jscolor/jscolor.js',WEAVERX_VERSION); // .min fails
|
61 |
+
wp_enqueue_script('wvrxYetii', get_template_directory_uri().WEAVERX_ADMIN_DIR.'/assets/js/yetii/yetii'.WEAVERX_MINIFY.'.js',WEAVERX_VERSION);
|
62 |
+
wp_enqueue_script('wvrxHide', get_template_directory_uri().WEAVERX_ADMIN_DIR.'/assets/js/theme/hide-css'.WEAVERX_MINIFY.'.js',WEAVERX_VERSION);
|
63 |
+
wp_enqueue_script('wvrxMediaLib', get_template_directory_uri().WEAVERX_ADMIN_DIR.'/assets/js/theme/media-lib'.WEAVERX_MINIFY.'.js',WEAVERX_VERSION);
|
64 |
+
}
|
65 |
+
//--
|
66 |
+
|
67 |
+
// We have to add the SAPI stuff at admin_init time so that the $_POST handling will get handled by SAPI. This means this
|
68 |
+
// gets loaded for the entire Dashboard, not just when there was a submission from the Weaver options panels. Otherwise, the
|
69 |
+
// SAPI code won't be able to process the options.
|
70 |
+
|
71 |
+
add_action('admin_init', 'weaverx_admin_init_cb');
|
72 |
+
|
73 |
+
function weaverx_admin_init_cb() { // action definition
|
74 |
+
|
75 |
+
require_once( dirname( __FILE__ ) . '/admin-sapi-lib.php' );
|
76 |
+
|
77 |
+
weaverx_sapi_options_init(); // This must come first as it hooks update_option used elsewhere
|
78 |
+
return;
|
79 |
+
} //ttt
|
80 |
+
//--
|
81 |
+
|
82 |
+
|
83 |
+
add_action('admin_head', 'weaverx_admin_head');
|
84 |
+
|
85 |
+
function weaverx_admin_head() { // action definition
|
86 |
+
}
|
87 |
+
|
88 |
+
} // END IF CAN EDIT POSTS ---------------------------------------------------------------------
|
89 |
+
|
90 |
+
function weaverx_load_admin_aux() {
|
91 |
+
|
92 |
+
if (current_user_can('edit_posts')) { // allows only admin to see, also avoids loading at runtime
|
93 |
+
require_once(get_template_directory() . WEAVERX_ADMIN_DIR . '/admin-page-posts.php'); // per page-posts admin
|
94 |
+
}
|
95 |
+
|
96 |
+
if (current_user_can('activate_plugins')) { // allows only admin to see, also avoids loading at runtime
|
97 |
+
require_once(get_template_directory() . WEAVERX_ADMIN_DIR . '/addon-plugins.php'); // the tgm plugin checker
|
98 |
+
}
|
99 |
+
}
|
100 |
+
?>
|
includes/wvrx-ts-admin-page-posts.php
CHANGED
@@ -30,21 +30,21 @@ function wvrx_ts_page_checkbox($opt, $msg, $width = 33, $br = 0) {
|
|
30 |
function wvrx_ts_page_layout( $page = 'page' ) {
|
31 |
|
32 |
if ( $page == 'page')
|
33 |
-
$msg = __('Select <em>Sidebar Layout</em> for this page - overrides default Page layout.','
|
34 |
else
|
35 |
-
$msg = __('Select Single Page View <em>Sidebar Layout</em> for this post - overrides default Single View layout.','
|
36 |
|
37 |
$opts = array( 'id' => '_pp_page_layout',
|
38 |
'info' => $msg,
|
39 |
'value' => array(
|
40 |
-
array('val' => '', 'desc' => __('Use Default','
|
41 |
-
array('val' => 'right', 'desc' => __('Sidebars on Right','
|
42 |
-
array('val' => 'right-top', 'desc' => __('Sidebars on Right (stack top)','
|
43 |
-
array('val' => 'left', 'desc' => __('Sidebars on Left','
|
44 |
-
array('val' => 'left-top', 'desc' => __('Sidebars on Left (stack top)','
|
45 |
-
array('val' => 'split', 'desc' => __('Split - Sidebars on Right and Left','
|
46 |
-
array('val' => 'split-top', 'desc' => __('Split (stack top)','
|
47 |
-
array('val' => 'one-column', 'desc' => __('No sidebars, content only','
|
48 |
));
|
49 |
wvrx_ts_pp_select_id($opts);
|
50 |
}
|
@@ -117,12 +117,12 @@ if ( function_exists( 'atw_showposts_installed' ) ) {
|
|
117 |
}
|
118 |
}
|
119 |
echo '</select> ' .
|
120 |
-
__('Use a Filter from <em>Weaver Show Posts Plugin</em> <strong>instead</strong> of above post selection options.','
|
121 |
'<br /> <span style="margin-left:8em;"><span>' .
|
122 |
-
__('(Note: Weaver Show Posts <em>Post Display</em> options and <em>Use Paging</em> option <strong>not</strong> used for posts using this filter.)','
|
123 |
'<br />' . '<br />';
|
124 |
} else {
|
125 |
-
_e('<strong>Want More Post Filtering Options?</strong> Install the <em>Aspen Themeworks Show Posts</em> plugin for more filtering options.','
|
126 |
<br /><br />
|
127 |
<?php }
|
128 |
}
|
@@ -131,14 +131,14 @@ _e('<strong>Want More Post Filtering Options?</strong> Install the <em>Aspen The
|
|
131 |
|
132 |
|
133 |
function wvrx_ts_pwp_type() {
|
134 |
-
$opts = array( 'name' => __('Display posts as:','
|
135 |
-
'info' => __('How to display posts on this Page with Posts (Default: global Full Post/Excerpt setting)','
|
136 |
'value' => array(
|
137 |
array('val' => '', 'desc' => ' ' ),
|
138 |
-
array('val' => 'full', 'desc' => __('Full post','
|
139 |
-
array('val' => 'excerpt', 'desc' => __('Excerpt','
|
140 |
-
array('val' => 'title', 'desc' => __('Title only','
|
141 |
-
array('val' => 'title_featured', 'desc' => __('Title + Featured Image','
|
142 |
));
|
143 |
wvrx_ts_pp_select_id($opts);
|
144 |
}
|
@@ -147,13 +147,13 @@ function wvrx_ts_pwp_type() {
|
|
147 |
function wvrx_ts_page_cols() {
|
148 |
|
149 |
$opts = array( 'name' => '', 'id' => '_pp_page_cols',
|
150 |
-
'info' => __('Display page content in this many columns using CSS column rules.','
|
151 |
'value' => array(
|
152 |
array('val' => '', 'desc' => ' '),
|
153 |
-
array('val' => '1', 'desc' => __('1 Column','
|
154 |
-
array('val' => '2', 'desc' => __('2 Columns','
|
155 |
-
array('val' => '3', 'desc' => __('3 Columns','
|
156 |
-
array('val' => '4', 'desc' => __('4 Columns','
|
157 |
);
|
158 |
wvrx_ts_pp_select_id($opts);
|
159 |
|
@@ -164,35 +164,35 @@ function wvrx_ts_page_cols() {
|
|
164 |
|
165 |
function wvrx_ts_pwp_cols() {
|
166 |
|
167 |
-
$opts = array( 'name' => __('Display post columns:','
|
168 |
-
'info' => __('Display posts in this many columns - left to right, then top to bottom','
|
169 |
'value' => array(
|
170 |
array('val' => '', 'desc' => ' '),
|
171 |
-
array('val' => '1', 'desc' => __('1 Column','
|
172 |
-
array('val' => '2', 'desc' => __('2 Columns','
|
173 |
-
array('val' => '3', 'desc' => __('3 Columns','
|
174 |
);
|
175 |
wvrx_ts_pp_select_id($opts);
|
176 |
|
177 |
weaverx_html_br();
|
178 |
|
179 |
-
$opts2 = array( 'name' => __('Use <em>Masonry</em> columns:','
|
180 |
-
'info' => __('Use <em>Masonry</em> for multi-column display','
|
181 |
'value' => array(
|
182 |
array('val' => '', 'desc' => ' ' ),
|
183 |
-
array('val' => '1', 'desc' => __('1 Column','
|
184 |
-
array('val' => '2', 'desc' => __('2 Columns','
|
185 |
-
array('val' => '3', 'desc' => __('3 Columns','
|
186 |
-
array('val' => '4', 'desc' => __('4 Columns','
|
187 |
-
array('val' => '5', 'desc' => __('5 Columns','
|
188 |
);
|
189 |
wvrx_ts_pp_select_id($opts2);
|
190 |
|
191 |
?>
|
192 |
<br />
|
193 |
<?php
|
194 |
-
wvrx_ts_page_checkbox('_pp_pwp_compact', __('For posts with <em>Post Format</em> specified, use compact layout on blog/archive pages.','
|
195 |
-
wvrx_ts_page_checkbox('_pp_pwp_compact_posts', __('For regular, <em>non-PostFormats</em> posts, show <em>title + first image</em> on blog pages.','
|
196 |
}
|
197 |
|
198 |
function wvrx_ts_page_extras() {
|
@@ -206,17 +206,17 @@ function wvrx_ts_page_extras() {
|
|
206 |
) {
|
207 |
if (isset($opts['_show_per_post_all']) && $opts['_show_per_post_all'])
|
208 |
echo '<p>' .
|
209 |
-
__('You can enable Weaver Xtreme Per Page Options for Custom Post Types on the Weaver Xtreme:Advanced Options:Admin Options tab.','
|
210 |
'</p>';
|
211 |
else
|
212 |
-
echo '<p>' . __('Weaver Xtreme Per Page Options not available for your User Role.','
|
213 |
return; // don't show per post panel
|
214 |
}
|
215 |
|
216 |
echo("<div style=\"line-height:150%;\"><p>\n");
|
217 |
if (get_the_ID() == get_option( 'page_on_front' ) ) { ?>
|
218 |
<div style="padding:2px; border:2px solid yellow; background:#FF8;">
|
219 |
-
<?php _e('Information: This page has been set to serve as your front page in the <em>Dashboard:Settings:Reading</em> \'Front page:\' option.','
|
220 |
</div><br />
|
221 |
<?php
|
222 |
}
|
@@ -230,53 +230,53 @@ on the default WordPress blog page, and any content you may have entered above i
|
|
230 |
If you want this page to serve as your blog page, and enable Weaver Xtreme Per Page options,
|
231 |
including the option of using the Page with Posts page template,
|
232 |
then the <em>Settings:Reading:Posts page</em> selection <strong>must</strong> be set to
|
233 |
-
the <em></em>— Select —</em> default value.','
|
234 |
</div><br />
|
235 |
<?php
|
236 |
return;
|
237 |
}
|
238 |
-
echo '<strong>' . __('Page Templates','
|
239 |
-
weaverx_help_link('help.html#PageTemplates',__('Help for Weaver Xtreme Page Templates','
|
240 |
-
echo '<span style="float:right;">(' . __('This Page\'s ID: ','
|
241 |
weaverx_html_br();
|
242 |
-
_e('Please click the (?) for more information about all the Weaver Xtreme Page Templates.','
|
243 |
weaverx_html_br();
|
244 |
-
echo '<strong>' . __('Per Page Options','
|
245 |
-
weaverx_help_link('help.html#optsperpage', __('Help for Per Page Options','
|
246 |
weaverx_html_br();
|
247 |
-
_e('These settings let you hide various elements on a per page basis.','
|
248 |
weaverx_html_br();
|
249 |
|
250 |
|
251 |
-
wvrx_ts_page_checkbox('_pp_hide_site_title',__('Hide Site Title/Tagline','
|
252 |
-
wvrx_ts_page_checkbox('_pp_hide_header_image',__('Hide Standard Header Image','
|
253 |
-
wvrx_ts_page_checkbox('_pp_hide_header',__('Hide Entire Header','
|
254 |
|
255 |
-
wvrx_ts_page_checkbox('_pp_hide_menus',__('Hide Menus','
|
256 |
-
wvrx_ts_page_checkbox('_pp_hide_page_infobar',__('Hide Info Bar on this page','
|
257 |
-
wvrx_ts_page_checkbox('_pp_hide_footer',__('Hide Entire Footer','
|
258 |
|
259 |
-
wvrx_ts_page_checkbox('_pp_hide_page_title',__('Hide Page Title','
|
260 |
-
wvrx_ts_page_checkbox('_pp_full_browser_height',__('Force full browser height','
|
261 |
|
262 |
wvrx_ts_page_cols();
|
263 |
|
264 |
-
_e('<em>Note:</em> the following options work with the default menu - not custom menus.','
|
265 |
weaverx_html_br();
|
266 |
-
wvrx_ts_page_checkbox('_pp_hide_on_menu',__('Hide Page on the default Primary Menu','
|
267 |
|
268 |
|
269 |
|
270 |
-
wvrx_ts_page_checkbox('_pp_stay_on_page',__('Menu "Placeholder" page. Useful for top-level menu item - don\'t go anywhere when menu item is clicked.','
|
271 |
|
272 |
-
wvrx_ts_page_checkbox('_pp_hide_visual_editor',__('Disable Visual Editor for this page. Useful if you enter simple HTML or other code.','
|
273 |
|
274 |
if (weaverx_allow_multisite()) {
|
275 |
-
wvrx_ts_page_checkbox('_pp_raw_html',__('Allow Raw HTML and scripts. Disables auto paragraph, texturize, and other processing.','
|
276 |
}
|
277 |
|
278 |
?>
|
279 |
-
<p><strong><?php _e('Sidebars & Widgets','
|
280 |
|
281 |
<?php
|
282 |
wvrx_ts_page_layout();
|
@@ -284,51 +284,51 @@ the <em></em>— Select —</em> default value.','weaver-xtreme' /*adm*/
|
|
284 |
<br />
|
285 |
<input type="text" size="4" id="_pp_category" name="_pp_sidebar_width"
|
286 |
value="<?php echo esc_textarea(get_post_meta($post->ID, "_pp_sidebar_width", true)); ?>" />
|
287 |
-
<?php _e('% - <em>Sidebar Width</em> - Per Page Sidebar width (applies to all layouts)','
|
288 |
<?php
|
289 |
|
290 |
-
wvrx_ts_page_checkbox('_pp_primary-widget-area',__('Hide Primary Sidebar','
|
291 |
-
wvrx_ts_page_checkbox('_pp_secondary-widget-area',__('Hide Secondary Sidebar','
|
292 |
|
293 |
-
wvrx_ts_page_checkbox('_pp_sitewide-top-widget-area',__('Hide Sitewide Top Area','
|
294 |
-
wvrx_ts_page_checkbox('_pp_sitewide-bottom-widget-area',__('Hide Sitewide Bottom Area','
|
295 |
|
296 |
-
wvrx_ts_page_checkbox('_pp_top-widget-area',__('Hide Pages Top Area','
|
297 |
-
wvrx_ts_page_checkbox('_pp_bottom-widget-area',__('Hide Pages Bottom Area','
|
298 |
|
299 |
-
wvrx_ts_page_checkbox('_pp_header-widget-area',__('Hide Header Area','
|
300 |
-
wvrx_ts_page_checkbox('_pp_footer-widget-area',__('Hide Footer Area','
|
301 |
?>
|
302 |
|
303 |
-
<p><strong><?php _e('Widget Area Replacements','
|
304 |
<p>
|
305 |
<?php _e('Select extra widget areas to replace the default widget areas for this page.
|
306 |
-
|
307 |
</p>
|
308 |
<?php
|
309 |
-
wvrx_ts_pp_replacement( __('Primary Sidebar','
|
310 |
-
wvrx_ts_pp_replacement( __('Secondary Sidebar','
|
311 |
|
312 |
-
wvrx_ts_pp_replacement( __('Header Widget Area','
|
313 |
-
wvrx_ts_pp_replacement( __('Footer Widget Area','
|
314 |
|
315 |
-
wvrx_ts_pp_replacement( __('Sitewide Top Widget Area','
|
316 |
-
wvrx_ts_pp_replacement( __('Sitewide Bottom Widget Area','
|
317 |
|
318 |
-
wvrx_ts_pp_replacement( __('Pages Top Widget Area','
|
319 |
-
wvrx_ts_pp_replacement( __('Pages Bottom Widget Area','
|
320 |
?>
|
321 |
-
<br style="clear:both;" /><p><strong><?php _e('Featured Image','
|
322 |
<?php
|
323 |
$opts3 = array( 'id' => '_pp_fi_location',
|
324 |
-
'info' => __('How to display Page FI on this page','
|
325 |
'value' => array(
|
326 |
-
array('val' => '', 'desc' => __('Default Page FI','
|
327 |
-
array('val' => 'content-top', 'desc' => __('With Content - top','
|
328 |
-
array('val' => 'content-bottom', 'desc' => __('With Content - bottom','
|
329 |
-
array('val' => 'title-before', 'desc' => __('Before Title','
|
330 |
-
array('val' => 'header-image', 'desc' => __('Header Image Replacement','
|
331 |
-
array('val' => 'hide', 'desc' => __('Hide FI on this Page','
|
332 |
)
|
333 |
);
|
334 |
wvrx_ts_pp_select_id($opts3);
|
@@ -336,18 +336,18 @@ You can define extra widget areas on the bottom of the <em>Main Options → S
|
|
336 |
<br />
|
337 |
<input type="text" size="30" id='_pp_fi_link' name='_pp_fi_link'
|
338 |
value="<?php echo esc_textarea(get_post_meta($post->ID, '_pp_fi_link', true)); ?>" />
|
339 |
-
<?php _e('<em>Featured Image Link</em> - Full URL for link from FI','
|
340 |
<br style="clear:both;" />
|
341 |
<hr />
|
342 |
<input type="text" size="15" id="bodyclass" name="_pp_bodyclass"
|
343 |
value="<?php echo esc_textarea(get_post_meta($post->ID, "_pp_bodyclass", true)); ?>" />
|
344 |
|
345 |
-
<?php _e('<em>Per Page body Class</em> - CSS class name to add to HTML <body> block. Allows Per Page custom styling.','
|
346 |
<br />
|
347 |
</p>
|
348 |
<p>
|
349 |
-
<?php _e('<strong>Settings for "Page with Posts" Template</strong>','
|
350 |
-
weaverx_help_link('help.html#PerPostTemplate',__('Help for Page with Posts Template','
|
351 |
|
352 |
$template = !empty($post->page_template) ? $post->page_template : "Default Template";
|
353 |
if ($template == 'paget-posts.php') {
|
@@ -356,41 +356,41 @@ You can define extra widget areas on the bottom of the <em>Main Options → S
|
|
356 |
<?php _e('These settings are optional, and can filter which posts are displayed when you use the "Page with Posts" template.
|
357 |
Use commas to separate items in lists.
|
358 |
The settings will be combined for the final filtered list of posts displayed.
|
359 |
-
(If you make mistakes in your settings, it won\'t be apparent until you display the page.)','
|
360 |
<br />
|
361 |
|
362 |
<input type="text" size="30" id="_pp_category" name="_pp_category"
|
363 |
value="<?php echo esc_textarea(get_post_meta($post->ID, "_pp_category", true)); ?>" />
|
364 |
-
<?php _e('<em>Category</em> - Enter list of category slugs of posts to include. (-slug will exclude specified category)','
|
365 |
<br />
|
366 |
|
367 |
<input type="text" size="30" id="_pp_tag" name="_pp_tag"
|
368 |
value="<?php echo esc_textarea(get_post_meta($post->ID, "_pp_tag", true)); ?>" />
|
369 |
-
<?php _e("<em>Tags</em> - Enter list of tag slugs of posts to include.",'
|
370 |
|
371 |
<input type="text" size="30" id="_pp_onepost" name="_pp_onepost"
|
372 |
value="<?php echo esc_textarea(get_post_meta($post->ID, "_pp_onepost", true)); ?>" />
|
373 |
-
<?php _e("<em>Single Post</em> - Enter post slug of a single post to display.",'
|
374 |
|
375 |
<input type="text" size="30" id="_pp_orderby" name="_pp_orderby"
|
376 |
value="<?php echo esc_textarea(get_post_meta($post->ID, "_pp_orderby", true)); ?>" />
|
377 |
-
<?php _e("<em>Order by</em> - Enter method to order posts by: author, date, title, or rand.",'
|
378 |
|
379 |
<input type="text" size="30" id="_pp_sort_order" name="_pp_sort_order"
|
380 |
value="<?php echo esc_textarea(get_post_meta($post->ID, "_pp_sort_order", true)); ?>" />
|
381 |
-
<?php _e("<em>Sort order</em> - Enter ASC or DESC for sort order.",'
|
382 |
|
383 |
<input type="text" size="30" id="_pp_posts_per_page" name="_pp_posts_per_page"
|
384 |
value="<?php echo esc_textarea(get_post_meta($post->ID, "_pp_posts_per_page", true)); ?>" />
|
385 |
-
<?php _e("<em>Posts per Page</em> - Enter maximum number of posts per page.",'
|
386 |
|
387 |
<input type="text" size="30" id="_pp_author" name="_pp_author"
|
388 |
value="<?php echo esc_textarea(get_post_meta($post->ID, "_pp_author", true)); ?>" />
|
389 |
-
<?php _e('<em>Author</em> - Enter author (use username, including spaces), or list of author IDs','
|
390 |
|
391 |
<input type="text" size="30" id="_pp_post_type" name="_pp_post_type"
|
392 |
value="<?php echo esc_textarea(get_post_meta($post->ID, "_pp_post_type", true)); ?>" />
|
393 |
-
<?php _e('<em>Custom Post Type</em> - Enter slug of one custom post type to display','
|
394 |
|
395 |
<?php wvrx_ts_pwp_atw_show_post_filter(); ?>
|
396 |
|
@@ -398,27 +398,27 @@ The settings will be combined for the final filtered list of posts displayed.
|
|
398 |
<?php wvrx_ts_pwp_cols(); ?><br />
|
399 |
<input type="text" size="5" id="_pp_fullposts" name="_pp_fullposts"
|
400 |
value="<?php echo esc_textarea(get_post_meta($post->ID, "_pp_fullposts", true)); ?>" />
|
401 |
-
<?php _e("<em>Don't excerpt 1st <em>\"n\"</em> Posts</em> - Display the non-excerpted post for the first \"n\" posts.",'
|
402 |
<br />
|
403 |
|
404 |
<input type="text" size="5" id="_pp_hide_n_posts" name="_pp_hide_n_posts"
|
405 |
value="<?php echo esc_textarea(get_post_meta($post->ID, "_pp_hide_n_posts", true)); ?>" />
|
406 |
<?php echo "<em><span class=\"dashicons dashicons-visibility\"></span>" .
|
407 |
__("Hide first \"n\" posts</em> - Start with post n+1.
|
408 |
-
Useful with plugin that will display first n posts using a shortcode. (e.g., Post slider)",'
|
409 |
|
410 |
<br /><br />
|
411 |
|
412 |
-
<?php wvrx_ts_page_checkbox('_pp_hide_infotop',__('Hide top info line','
|
413 |
-
<?php wvrx_ts_page_checkbox('_pp_hide_infobottom',__('Hide bottom info line','
|
414 |
-
<?php wvrx_ts_page_checkbox('_pp_hide_sticky',__('No special treatment for Sticky Posts','
|
415 |
</p>
|
416 |
<?php
|
417 |
} else { // NOT a page with posts
|
418 |
?> <p>
|
419 |
<?php _e('<strong>Note:</strong> After you choose the "Page with Posts" template from the <em>Template</em>
|
420 |
option in the <em>Page Attributes</em> box, <strong>and</strong> <em>Publish</em> or <em>Save Draft</em>,
|
421 |
-
settings for "Page with Posts" will be displayed here. Current page template:','
|
422 |
<?php echo $template; ?>
|
423 |
</p>
|
424 |
<?php
|
@@ -438,44 +438,44 @@ function wvrx_ts_post_extras() {
|
|
438 |
|| (current_user_can('edit_pages') && !isset($opts['_hide_editor_per'])) // Editor
|
439 |
|| (current_user_can('edit_posts') && !isset($opts['_hide_author_per']))) // Author/Contributor
|
440 |
) {
|
441 |
-
echo '<p>' . __('Weaver Xtreme Per Post Options not available for your User Role.','
|
442 |
return; // don't show per post panel
|
443 |
}
|
444 |
?>
|
445 |
<div style="line-height:150%;">
|
446 |
<p>
|
447 |
<?php
|
448 |
-
echo '<strong>' . __('Per Post Options','
|
449 |
-
weaverx_help_link('help.html#PerPage', __('Help for Per Post Options','
|
450 |
-
echo '<span style="float:right;">(' . __('This Post\'s ID: ','
|
451 |
weaverx_html_br();
|
452 |
-
_e('These settings let you control display of this individual post. Many of these options override global options set on the Weaver Xtreme admin tabs.','
|
453 |
weaverx_html_br();
|
454 |
|
455 |
-
wvrx_ts_page_checkbox('_pp_force_post_excerpt',__('Display post as excerpt','
|
456 |
-
wvrx_ts_page_checkbox('_pp_force_post_full',__('Display as full post where normally excerpted','
|
457 |
|
458 |
|
459 |
-
wvrx_ts_page_checkbox('_pp_show_post_avatar',__('Show author avatar with post','
|
460 |
-
wvrx_ts_page_checkbox('_show_post_bubble',__('Show the comment bubble','
|
461 |
|
462 |
-
wvrx_ts_page_checkbox('_pp_hide_post_format_label',__('Hide <em>Post Format</em> label','
|
463 |
-
wvrx_ts_page_checkbox('_pp_hide_post_title',__('Hide post title','
|
464 |
|
465 |
-
wvrx_ts_page_checkbox('_pp_hide_top_post_meta',__('Hide top post info line','
|
466 |
-
wvrx_ts_page_checkbox('_pp_hide_bottom_post_meta',__('Hide bottom post info line','
|
467 |
-
wvrx_ts_page_checkbox('_pp_masonry_span2',__('For <em>Masonry</em> multi-columns: make this post span two columns.','
|
468 |
|
469 |
-
wvrx_ts_page_checkbox('_pp_post_add_link',__('Show a "link to single page" icon at bottom of post - useful with compact posts','
|
470 |
|
471 |
|
472 |
echo('<br style="clear:both;"/><br /><strong>Per Post Style</strong> (★Plus)' /*a*/ );
|
473 |
-
weaverx_help_link('help.html#perpoststyle', __('Help for Per Post Style','
|
474 |
echo '<br />' .
|
475 |
-
__('Weaver Xtreme Plus supports optional per post CSS style rules.','
|
476 |
<br />
|
477 |
<br />
|
478 |
-
<p><strong><?php _e('<em>Single Page View:</em> Sidebars','
|
479 |
|
480 |
<?php
|
481 |
wvrx_ts_page_layout('post');
|
@@ -483,49 +483,49 @@ __('Weaver Xtreme Plus supports optional per post CSS style rules.','weaver-xtre
|
|
483 |
<br />
|
484 |
<input type="text" size="4" id="_pp_category" name="_pp_sidebar_width"
|
485 |
value="<?php echo esc_textarea(get_post_meta($post->ID, "_pp_sidebar_width", true)); ?>" />
|
486 |
-
<?php _e("% - <em>Sidebar Width</em> - Post Single View Sidebar width (applies to all layouts)",'
|
487 |
<?php
|
488 |
|
489 |
-
wvrx_ts_page_checkbox('_pp_primary-widget-area',__('Hide Primary Sidebar, Single View','
|
490 |
-
wvrx_ts_page_checkbox('_pp_secondary-widget-area',__('Hide Secondary Sidebar, Single View','
|
491 |
|
492 |
-
wvrx_ts_page_checkbox('_pp_sitewide-top-widget-area',__('Hide Sitewide Top Area, Single View','
|
493 |
-
wvrx_ts_page_checkbox('_pp_sitewide-bottom-widget-area',__('Hide Sitewide Bottom Area, Single View','
|
494 |
|
495 |
-
wvrx_ts_page_checkbox('_pp_top-widget-area',__('Hide Blog Top Area, Single View','
|
496 |
-
wvrx_ts_page_checkbox('_pp_bottom-widget-area',__('Hide Blog Bottom Area, Single View','
|
497 |
|
498 |
-
wvrx_ts_page_checkbox('_pp_header-widget-area',__('Hide Header Area, Single View','
|
499 |
-
wvrx_ts_page_checkbox('_pp_footer-widget-area',__('Hide Footer Area, Single View','
|
500 |
?>
|
501 |
</p>
|
502 |
-
<p><strong><?php _e('<em>Single Page View:</em> Widget Area Replacements','
|
503 |
<p>
|
504 |
<?php _e('Select extra widget areas to replace the default widget areas for <em>Single Page</em> view of this post.
|
505 |
-
|
506 |
</p>
|
507 |
<?php
|
508 |
-
wvrx_ts_pp_replacement( __('Primary Sidebar','
|
509 |
-
wvrx_ts_pp_replacement( __('Secondary Sidebar','
|
510 |
|
511 |
-
wvrx_ts_pp_replacement( __('Header Widget Area','
|
512 |
-
wvrx_ts_pp_replacement( __('Footer Widget Area','
|
513 |
|
514 |
wvrx_ts_pp_replacement( 'Sitewide Top Widget Area' , 'sitewide-top-widget-area' );
|
515 |
wvrx_ts_pp_replacement( 'Sitewide Bottom Widget Area' , 'sitewide-bottom-widget-area' );
|
516 |
?>
|
517 |
-
<br style="clear:both;" /><p><strong><?php _e('<em>Single Page View:</em> Featured Image','
|
518 |
<?php
|
519 |
$opts3 = array( 'id' => '_pp_fi_location',
|
520 |
-
'info' => __('Override <em>Single Page</em> setting for where to display FI','
|
521 |
'value' => array(
|
522 |
-
array('val' => '', 'desc' => __('Default Single Page FI','
|
523 |
-
array('val' => 'content-top', 'desc' => __('With Content - top','
|
524 |
-
array('val' => 'content-bottom', 'desc' => __('With Content - bottom','
|
525 |
-
array('val' => 'title-before', 'desc' => __('Before Title','
|
526 |
-
array('val' => 'header-image', 'desc' => __('Header Image Replacement','
|
527 |
-
array('val' => 'post-before', 'desc' => __('Outside of Post','
|
528 |
-
array('val' => 'hide', 'desc' => __('Hide FI on Single Page','
|
529 |
)
|
530 |
);
|
531 |
wvrx_ts_pp_select_id($opts3);
|
@@ -533,24 +533,24 @@ You can define extra widget areas on the bottom of the <em>Main Options → S
|
|
533 |
<br />
|
534 |
<input type="text" size="30" id='_pp_fi_link' name='_pp_fi_link'
|
535 |
value="<?php echo esc_textarea(get_post_meta($post->ID, '_pp_fi_link', true)); ?>" />
|
536 |
-
<?php _e("<em>Featured Image Link</em> - Full URL for link from FI",'
|
537 |
<br style="clear:both;" />
|
538 |
</p><p>
|
539 |
-
<strong><?php _e('Post Editor Options','
|
540 |
|
541 |
<?php
|
542 |
-
wvrx_ts_page_checkbox('_pp_hide_visual_editor',__('Disable Visual Editor for this page. Useful if you enter simple HTML or other code.','
|
543 |
|
544 |
if (weaverx_allow_multisite()) {
|
545 |
-
wvrx_ts_page_checkbox('_pp_raw_html',__('Allow Raw HTML and scripts. Disables auto paragraph, texturize, and other processing.','
|
546 |
}
|
547 |
?>
|
548 |
</p>
|
549 |
<p>
|
550 |
<?php echo('<strong>Post Format</strong>');
|
551 |
-
weaverx_help_link('help.html#gallerypost', __('Help for Per Post Format','
|
552 |
weaverx_html_br();
|
553 |
-
_e('Weaver Xtreme supports Post Formats. Click the ? for more info.','
|
554 |
weaverx_html_br();
|
555 |
weaverx_html_br();
|
556 |
|
30 |
function wvrx_ts_page_layout( $page = 'page' ) {
|
31 |
|
32 |
if ( $page == 'page')
|
33 |
+
$msg = __('Select <em>Sidebar Layout</em> for this page - overrides default Page layout.','weaverx-theme-support' /*adm*/);
|
34 |
else
|
35 |
+
$msg = __('Select Single Page View <em>Sidebar Layout</em> for this post - overrides default Single View layout.','weaverx-theme-support' /*adm*/);
|
36 |
|
37 |
$opts = array( 'id' => '_pp_page_layout',
|
38 |
'info' => $msg,
|
39 |
'value' => array(
|
40 |
+
array('val' => '', 'desc' => __('Use Default','weaverx-theme-support' /*adm*/) ),
|
41 |
+
array('val' => 'right', 'desc' => __('Sidebars on Right','weaverx-theme-support' /*adm*/) ),
|
42 |
+
array('val' => 'right-top', 'desc' => __('Sidebars on Right (stack top)','weaverx-theme-support' /*adm*/) ),
|
43 |
+
array('val' => 'left', 'desc' => __('Sidebars on Left','weaverx-theme-support' /*adm*/) ),
|
44 |
+
array('val' => 'left-top', 'desc' => __('Sidebars on Left (stack top)','weaverx-theme-support' /*adm*/) ),
|
45 |
+
array('val' => 'split', 'desc' => __('Split - Sidebars on Right and Left','weaverx-theme-support' /*adm*/) ),
|
46 |
+
array('val' => 'split-top', 'desc' => __('Split (stack top)','weaverx-theme-support' /*adm*/) ),
|
47 |
+
array('val' => 'one-column', 'desc' => __('No sidebars, content only','weaverx-theme-support' /*adm*/) )
|
48 |
));
|
49 |
wvrx_ts_pp_select_id($opts);
|
50 |
}
|
117 |
}
|
118 |
}
|
119 |
echo '</select> ' .
|
120 |
+
__('Use a Filter from <em>Weaver Show Posts Plugin</em> <strong>instead</strong> of above post selection options.','weaverx-theme-support' /*adm*/) .
|
121 |
'<br /> <span style="margin-left:8em;"><span>' .
|
122 |
+
__('(Note: Weaver Show Posts <em>Post Display</em> options and <em>Use Paging</em> option <strong>not</strong> used for posts using this filter.)','weaverx-theme-support' /*adm*/) .
|
123 |
'<br />' . '<br />';
|
124 |
} else {
|
125 |
+
_e('<strong>Want More Post Filtering Options?</strong> Install the <em>Aspen Themeworks Show Posts</em> plugin for more filtering options.','weaverx-theme-support' /*adm*/); ?>
|
126 |
<br /><br />
|
127 |
<?php }
|
128 |
}
|
131 |
|
132 |
|
133 |
function wvrx_ts_pwp_type() {
|
134 |
+
$opts = array( 'name' => __('Display posts as:','weaverx-theme-support' /*adm*/), 'id' => '_pp_wvrx_pwp_type',
|
135 |
+
'info' => __('How to display posts on this Page with Posts (Default: global Full Post/Excerpt setting)','weaverx-theme-support' /*adm*/),
|
136 |
'value' => array(
|
137 |
array('val' => '', 'desc' => ' ' ),
|
138 |
+
array('val' => 'full', 'desc' => __('Full post','weaverx-theme-support' /*adm*/) ),
|
139 |
+
array('val' => 'excerpt', 'desc' => __('Excerpt','weaverx-theme-support' /*adm*/) ),
|
140 |
+
array('val' => 'title', 'desc' => __('Title only','weaverx-theme-support' /*adm*/) ),
|
141 |
+
array('val' => 'title_featured', 'desc' => __('Title + Featured Image','weaverx-theme-support' /*adm*/) )
|
142 |
));
|
143 |
wvrx_ts_pp_select_id($opts);
|
144 |
}
|
147 |
function wvrx_ts_page_cols() {
|
148 |
|
149 |
$opts = array( 'name' => '', 'id' => '_pp_page_cols',
|
150 |
+
'info' => __('Display page content in this many columns using CSS column rules.','weaverx-theme-support' /*adm*/),
|
151 |
'value' => array(
|
152 |
array('val' => '', 'desc' => ' '),
|
153 |
+
array('val' => '1', 'desc' => __('1 Column','weaverx-theme-support' /*adm*/) ),
|
154 |
+
array('val' => '2', 'desc' => __('2 Columns','weaverx-theme-support' /*adm*/) ),
|
155 |
+
array('val' => '3', 'desc' => __('3 Columns','weaverx-theme-support' /*adm*/) ),
|
156 |
+
array('val' => '4', 'desc' => __('4 Columns','weaverx-theme-support' /*adm*/) ))
|
157 |
);
|
158 |
wvrx_ts_pp_select_id($opts);
|
159 |
|
164 |
|
165 |
function wvrx_ts_pwp_cols() {
|
166 |
|
167 |
+
$opts = array( 'name' => __('Display post columns:','weaverx-theme-support' /*adm*/), 'id' => '_pp_wvrx_pwp_cols',
|
168 |
+
'info' => __('Display posts in this many columns - left to right, then top to bottom','weaverx-theme-support' /*adm*/),
|
169 |
'value' => array(
|
170 |
array('val' => '', 'desc' => ' '),
|
171 |
+
array('val' => '1', 'desc' => __('1 Column','weaverx-theme-support' /*adm*/) ),
|
172 |
+
array('val' => '2', 'desc' => __('2 Columns','weaverx-theme-support' /*adm*/) ),
|
173 |
+
array('val' => '3', 'desc' => __('3 Columns','weaverx-theme-support' /*adm*/) ) )
|
174 |
);
|
175 |
wvrx_ts_pp_select_id($opts);
|
176 |
|
177 |
weaverx_html_br();
|
178 |
|
179 |
+
$opts2 = array( 'name' => __('Use <em>Masonry</em> columns:','weaverx-theme-support' /*adm*/), 'id' => '_pp_pwp_masonry',
|
180 |
+
'info' => __('Use <em>Masonry</em> for multi-column display','weaverx-theme-support' /*adm*/),
|
181 |
'value' => array(
|
182 |
array('val' => '', 'desc' => ' ' ),
|
183 |
+
array('val' => '1', 'desc' => __('1 Column','weaverx-theme-support' /*adm*/) ),
|
184 |
+
array('val' => '2', 'desc' => __('2 Columns','weaverx-theme-support' /*adm*/) ),
|
185 |
+
array('val' => '3', 'desc' => __('3 Columns','weaverx-theme-support' /*adm*/) ),
|
186 |
+
array('val' => '4', 'desc' => __('4 Columns','weaverx-theme-support' /*adm*/) ),
|
187 |
+
array('val' => '5', 'desc' => __('5 Columns','weaverx-theme-support' /*adm*/) ) )
|
188 |
);
|
189 |
wvrx_ts_pp_select_id($opts2);
|
190 |
|
191 |
?>
|
192 |
<br />
|
193 |
<?php
|
194 |
+
wvrx_ts_page_checkbox('_pp_pwp_compact', __('For posts with <em>Post Format</em> specified, use compact layout on blog/archive pages.','weaverx-theme-support' /*adm*/),90,1);
|
195 |
+
wvrx_ts_page_checkbox('_pp_pwp_compact_posts', __('For regular, <em>non-PostFormats</em> posts, show <em>title + first image</em> on blog pages.','weaverx-theme-support' /*adm*/),90,1);
|
196 |
}
|
197 |
|
198 |
function wvrx_ts_page_extras() {
|
206 |
) {
|
207 |
if (isset($opts['_show_per_post_all']) && $opts['_show_per_post_all'])
|
208 |
echo '<p>' .
|
209 |
+
__('You can enable Weaver Xtreme Per Page Options for Custom Post Types on the Weaver Xtreme:Advanced Options:Admin Options tab.','weaverx-theme-support' /*adm*/) .
|
210 |
'</p>';
|
211 |
else
|
212 |
+
echo '<p>' . __('Weaver Xtreme Per Page Options not available for your User Role.','weaverx-theme-support' /*adm*/) . '</p>';
|
213 |
return; // don't show per post panel
|
214 |
}
|
215 |
|
216 |
echo("<div style=\"line-height:150%;\"><p>\n");
|
217 |
if (get_the_ID() == get_option( 'page_on_front' ) ) { ?>
|
218 |
<div style="padding:2px; border:2px solid yellow; background:#FF8;">
|
219 |
+
<?php _e('Information: This page has been set to serve as your front page in the <em>Dashboard:Settings:Reading</em> \'Front page:\' option.','weaverx-theme-support' /*adm*/); ?>
|
220 |
</div><br />
|
221 |
<?php
|
222 |
}
|
230 |
If you want this page to serve as your blog page, and enable Weaver Xtreme Per Page options,
|
231 |
including the option of using the Page with Posts page template,
|
232 |
then the <em>Settings:Reading:Posts page</em> selection <strong>must</strong> be set to
|
233 |
+
the <em></em>— Select —</em> default value.','weaverx-theme-support' /*adm*/); ?>
|
234 |
</div><br />
|
235 |
<?php
|
236 |
return;
|
237 |
}
|
238 |
+
echo '<strong>' . __('Page Templates','weaverx-theme-support' /*adm*/) . '</strong>';
|
239 |
+
weaverx_help_link('help.html#PageTemplates',__('Help for Weaver Xtreme Page Templates','weaverx-theme-support' /*adm*/));
|
240 |
+
echo '<span style="float:right;">(' . __('This Page\'s ID: ','weaverx-theme-support' /*adm*/); the_ID() ; echo ')</span>';
|
241 |
weaverx_html_br();
|
242 |
+
_e('Please click the (?) for more information about all the Weaver Xtreme Page Templates.','weaverx-theme-support' /*adm*/);
|
243 |
weaverx_html_br();
|
244 |
+
echo '<strong>' . __('Per Page Options','weaverx-theme-support' /*adm*/) . '</strong>';
|
245 |
+
weaverx_help_link('help.html#optsperpage', __('Help for Per Page Options','weaverx-theme-support' /*adm*/));
|
246 |
weaverx_html_br();
|
247 |
+
_e('These settings let you hide various elements on a per page basis.','weaverx-theme-support' /*adm*/);
|
248 |
weaverx_html_br();
|
249 |
|
250 |
|
251 |
+
wvrx_ts_page_checkbox('_pp_hide_site_title',__('Hide Site Title/Tagline','weaverx-theme-support' /*adm*/));
|
252 |
+
wvrx_ts_page_checkbox('_pp_hide_header_image',__('Hide Standard Header Image','weaverx-theme-support' /*adm*/));
|
253 |
+
wvrx_ts_page_checkbox('_pp_hide_header',__('Hide Entire Header','weaverx-theme-support' /*adm*/), 33, 1);
|
254 |
|
255 |
+
wvrx_ts_page_checkbox('_pp_hide_menus',__('Hide Menus','weaverx-theme-support' /*adm*/));
|
256 |
+
wvrx_ts_page_checkbox('_pp_hide_page_infobar',__('Hide Info Bar on this page','weaverx-theme-support' /*adm*/));
|
257 |
+
wvrx_ts_page_checkbox('_pp_hide_footer',__('Hide Entire Footer','weaverx-theme-support' /*adm*/),33,1);
|
258 |
|
259 |
+
wvrx_ts_page_checkbox('_pp_hide_page_title',__('Hide Page Title','weaverx-theme-support' /*adm*/));
|
260 |
+
wvrx_ts_page_checkbox('_pp_full_browser_height',__('Force full browser height','weaverx-theme-support' /*adm*/),33,2);
|
261 |
|
262 |
wvrx_ts_page_cols();
|
263 |
|
264 |
+
_e('<em>Note:</em> the following options work with the default menu - not custom menus.','weaverx-theme-support' /*adm*/);
|
265 |
weaverx_html_br();
|
266 |
+
wvrx_ts_page_checkbox('_pp_hide_on_menu',__('Hide Page on the default Primary Menu','weaverx-theme-support' /*adm*/),90,1);
|
267 |
|
268 |
|
269 |
|
270 |
+
wvrx_ts_page_checkbox('_pp_stay_on_page',__('Menu "Placeholder" page. Useful for top-level menu item - don\'t go anywhere when menu item is clicked.','weaverx-theme-support' /*adm*/),90,2);
|
271 |
|
272 |
+
wvrx_ts_page_checkbox('_pp_hide_visual_editor',__('Disable Visual Editor for this page. Useful if you enter simple HTML or other code.','weaverx-theme-support' /*adm*/),90,1);
|
273 |
|
274 |
if (weaverx_allow_multisite()) {
|
275 |
+
wvrx_ts_page_checkbox('_pp_raw_html',__('Allow Raw HTML and scripts. Disables auto paragraph, texturize, and other processing.','weaverx-theme-support' /*adm*/),90,1);
|
276 |
}
|
277 |
|
278 |
?>
|
279 |
+
<p><strong><?php _e('Sidebars & Widgets','weaverx-theme-support' /*adm*/); ?></strong></p>
|
280 |
|
281 |
<?php
|
282 |
wvrx_ts_page_layout();
|
284 |
<br />
|
285 |
<input type="text" size="4" id="_pp_category" name="_pp_sidebar_width"
|
286 |
value="<?php echo esc_textarea(get_post_meta($post->ID, "_pp_sidebar_width", true)); ?>" />
|
287 |
+
<?php _e('% - <em>Sidebar Width</em> - Per Page Sidebar width (applies to all layouts)','weaverx-theme-support' /*adm*/); ?> <br /><br />
|
288 |
<?php
|
289 |
|
290 |
+
wvrx_ts_page_checkbox('_pp_primary-widget-area',__('Hide Primary Sidebar','weaverx-theme-support' /*adm*/),40);
|
291 |
+
wvrx_ts_page_checkbox('_pp_secondary-widget-area',__('Hide Secondary Sidebar','weaverx-theme-support' /*adm*/),40,1);
|
292 |
|
293 |
+
wvrx_ts_page_checkbox('_pp_sitewide-top-widget-area',__('Hide Sitewide Top Area','weaverx-theme-support' /*adm*/),40);
|
294 |
+
wvrx_ts_page_checkbox('_pp_sitewide-bottom-widget-area',__('Hide Sitewide Bottom Area','weaverx-theme-support' /*adm*/),40,1);
|
295 |
|
296 |
+
wvrx_ts_page_checkbox('_pp_top-widget-area',__('Hide Pages Top Area','weaverx-theme-support' /*adm*/),40);
|
297 |
+
wvrx_ts_page_checkbox('_pp_bottom-widget-area',__('Hide Pages Bottom Area','weaverx-theme-support' /*adm*/),40,1);
|
298 |
|
299 |
+
wvrx_ts_page_checkbox('_pp_header-widget-area',__('Hide Header Area','weaverx-theme-support' /*adm*/),40);
|
300 |
+
wvrx_ts_page_checkbox('_pp_footer-widget-area',__('Hide Footer Area','weaverx-theme-support' /*adm*/),40,1);
|
301 |
?>
|
302 |
|
303 |
+
<p><strong><?php _e('Widget Area Replacements','weaverx-theme-support' /*adm*/); ?></strong></p>
|
304 |
<p>
|
305 |
<?php _e('Select extra widget areas to replace the default widget areas for this page.
|
306 |
+
To add areas to the widget area lists below, you <strong>must</strong> first define extra widget areas on the bottom of the <em>Main Options → Sidebars & Layout</em> tab.','weaverx-theme-support' /*adm*/); ?>
|
307 |
</p>
|
308 |
<?php
|
309 |
+
wvrx_ts_pp_replacement( __('Primary Sidebar','weaverx-theme-support' /*adm*/) , 'primary-widget-area' );
|
310 |
+
wvrx_ts_pp_replacement( __('Secondary Sidebar','weaverx-theme-support' /*adm*/) , 'secondary-widget-area' );
|
311 |
|
312 |
+
wvrx_ts_pp_replacement( __('Header Widget Area','weaverx-theme-support' /*adm*/) , 'header-widget-area' );
|
313 |
+
wvrx_ts_pp_replacement( __('Footer Widget Area','weaverx-theme-support' /*adm*/) , 'footer-widget-area' );
|
314 |
|
315 |
+
wvrx_ts_pp_replacement( __('Sitewide Top Widget Area','weaverx-theme-support' /*adm*/) , 'sitewide-top-widget-area' );
|
316 |
+
wvrx_ts_pp_replacement( __('Sitewide Bottom Widget Area','weaverx-theme-support' /*adm*/) , 'sitewide-bottom-widget-area' );
|
317 |
|
318 |
+
wvrx_ts_pp_replacement( __('Pages Top Widget Area','weaverx-theme-support' /*adm*/) , 'page-top-widget-area' );
|
319 |
+
wvrx_ts_pp_replacement( __('Pages Bottom Widget Area','weaverx-theme-support' /*adm*/) , 'page-bottom-widget-area' );
|
320 |
?>
|
321 |
+
<br style="clear:both;" /><p><strong><?php _e('Featured Image','weaverx-theme-support' /*adm*/); ?></strong></p>
|
322 |
<?php
|
323 |
$opts3 = array( 'id' => '_pp_fi_location',
|
324 |
+
'info' => __('How to display Page FI on this page','weaverx-theme-support' /*adm*/),
|
325 |
'value' => array(
|
326 |
+
array('val' => '', 'desc' => __('Default Page FI','weaverx-theme-support' /*adm*/) ),
|
327 |
+
array('val' => 'content-top', 'desc' => __('With Content - top','weaverx-theme-support' /*adm*/) ),
|
328 |
+
array('val' => 'content-bottom', 'desc' => __('With Content - bottom','weaverx-theme-support' /*adm*/) ),
|
329 |
+
array('val' => 'title-before', 'desc' => __('Before Title','weaverx-theme-support' /*adm*/) ),
|
330 |
+
array('val' => 'header-image', 'desc' => __('Header Image Replacement','weaverx-theme-support' /*adm*/) ),
|
331 |
+
array('val' => 'hide', 'desc' => __('Hide FI on this Page','weaverx-theme-support' /*adm*/) )
|
332 |
)
|
333 |
);
|
334 |
wvrx_ts_pp_select_id($opts3);
|
336 |
<br />
|
337 |
<input type="text" size="30" id='_pp_fi_link' name='_pp_fi_link'
|
338 |
value="<?php echo esc_textarea(get_post_meta($post->ID, '_pp_fi_link', true)); ?>" />
|
339 |
+
<?php _e('<em>Featured Image Link</em> - Full URL for link from FI','weaverx-theme-support' /*adm*/); ?>
|
340 |
<br style="clear:both;" />
|
341 |
<hr />
|
342 |
<input type="text" size="15" id="bodyclass" name="_pp_bodyclass"
|
343 |
value="<?php echo esc_textarea(get_post_meta($post->ID, "_pp_bodyclass", true)); ?>" />
|
344 |
|
345 |
+
<?php _e('<em>Per Page body Class</em> - CSS class name to add to HTML <body> block. Allows Per Page custom styling.','weaverx-theme-support' /*adm*/); ?>
|
346 |
<br />
|
347 |
</p>
|
348 |
<p>
|
349 |
+
<?php _e('<strong>Settings for "Page with Posts" Template</strong>','weaverx-theme-support' /*adm*/);
|
350 |
+
weaverx_help_link('help.html#PerPostTemplate',__('Help for Page with Posts Template','weaverx-theme-support' /*adm*/) );
|
351 |
|
352 |
$template = !empty($post->page_template) ? $post->page_template : "Default Template";
|
353 |
if ($template == 'paget-posts.php') {
|
356 |
<?php _e('These settings are optional, and can filter which posts are displayed when you use the "Page with Posts" template.
|
357 |
Use commas to separate items in lists.
|
358 |
The settings will be combined for the final filtered list of posts displayed.
|
359 |
+
(If you make mistakes in your settings, it won\'t be apparent until you display the page.)','weaverx-theme-support' /*adm*/); ?>
|
360 |
<br />
|
361 |
|
362 |
<input type="text" size="30" id="_pp_category" name="_pp_category"
|
363 |
value="<?php echo esc_textarea(get_post_meta($post->ID, "_pp_category", true)); ?>" />
|
364 |
+
<?php _e('<em>Category</em> - Enter list of category slugs of posts to include. (-slug will exclude specified category)','weaverx-theme-support' /*adm*/); ?>
|
365 |
<br />
|
366 |
|
367 |
<input type="text" size="30" id="_pp_tag" name="_pp_tag"
|
368 |
value="<?php echo esc_textarea(get_post_meta($post->ID, "_pp_tag", true)); ?>" />
|
369 |
+
<?php _e("<em>Tags</em> - Enter list of tag slugs of posts to include.",'weaverx-theme-support' /*adm*/); ?> <br />
|
370 |
|
371 |
<input type="text" size="30" id="_pp_onepost" name="_pp_onepost"
|
372 |
value="<?php echo esc_textarea(get_post_meta($post->ID, "_pp_onepost", true)); ?>" />
|
373 |
+
<?php _e("<em>Single Post</em> - Enter post slug of a single post to display.",'weaverx-theme-support' /*adm*/); ?> <br />
|
374 |
|
375 |
<input type="text" size="30" id="_pp_orderby" name="_pp_orderby"
|
376 |
value="<?php echo esc_textarea(get_post_meta($post->ID, "_pp_orderby", true)); ?>" />
|
377 |
+
<?php _e("<em>Order by</em> - Enter method to order posts by: author, date, title, or rand.",'weaverx-theme-support' /*adm*/); ?> <br />
|
378 |
|
379 |
<input type="text" size="30" id="_pp_sort_order" name="_pp_sort_order"
|
380 |
value="<?php echo esc_textarea(get_post_meta($post->ID, "_pp_sort_order", true)); ?>" />
|
381 |
+
<?php _e("<em>Sort order</em> - Enter ASC or DESC for sort order.",'weaverx-theme-support' /*adm*/); ?> <br />
|
382 |
|
383 |
<input type="text" size="30" id="_pp_posts_per_page" name="_pp_posts_per_page"
|
384 |
value="<?php echo esc_textarea(get_post_meta($post->ID, "_pp_posts_per_page", true)); ?>" />
|
385 |
+
<?php _e("<em>Posts per Page</em> - Enter maximum number of posts per page.",'weaverx-theme-support' /*adm*/); ?> <br />
|
386 |
|
387 |
<input type="text" size="30" id="_pp_author" name="_pp_author"
|
388 |
value="<?php echo esc_textarea(get_post_meta($post->ID, "_pp_author", true)); ?>" />
|
389 |
+
<?php _e('<em>Author</em> - Enter author (use username, including spaces), or list of author IDs','weaverx-theme-support' /*adm*/); ?> <br />
|
390 |
|
391 |
<input type="text" size="30" id="_pp_post_type" name="_pp_post_type"
|
392 |
value="<?php echo esc_textarea(get_post_meta($post->ID, "_pp_post_type", true)); ?>" />
|
393 |
+
<?php _e('<em>Custom Post Type</em> - Enter slug of one custom post type to display','weaverx-theme-support' /*adm*/); ?> <br />
|
394 |
|
395 |
<?php wvrx_ts_pwp_atw_show_post_filter(); ?>
|
396 |
|
398 |
<?php wvrx_ts_pwp_cols(); ?><br />
|
399 |
<input type="text" size="5" id="_pp_fullposts" name="_pp_fullposts"
|
400 |
value="<?php echo esc_textarea(get_post_meta($post->ID, "_pp_fullposts", true)); ?>" />
|
401 |
+
<?php _e("<em>Don't excerpt 1st <em>\"n\"</em> Posts</em> - Display the non-excerpted post for the first \"n\" posts.",'weaverx-theme-support' /*adm*/); ?>
|
402 |
<br />
|
403 |
|
404 |
<input type="text" size="5" id="_pp_hide_n_posts" name="_pp_hide_n_posts"
|
405 |
value="<?php echo esc_textarea(get_post_meta($post->ID, "_pp_hide_n_posts", true)); ?>" />
|
406 |
<?php echo "<em><span class=\"dashicons dashicons-visibility\"></span>" .
|
407 |
__("Hide first \"n\" posts</em> - Start with post n+1.
|
408 |
+
Useful with plugin that will display first n posts using a shortcode. (e.g., Post slider)",'weaverx-theme-support' /*adm*/) ; ?>
|
409 |
|
410 |
<br /><br />
|
411 |
|
412 |
+
<?php wvrx_ts_page_checkbox('_pp_hide_infotop',__('Hide top info line','weaverx-theme-support' /*adm*/), 40); ?>
|
413 |
+
<?php wvrx_ts_page_checkbox('_pp_hide_infobottom',__('Hide bottom info line','weaverx-theme-support' /*adm*/), 40, 1); ?>
|
414 |
+
<?php wvrx_ts_page_checkbox('_pp_hide_sticky',__('No special treatment for Sticky Posts','weaverx-theme-support' /*adm*/), 40); ?>
|
415 |
</p>
|
416 |
<?php
|
417 |
} else { // NOT a page with posts
|
418 |
?> <p>
|
419 |
<?php _e('<strong>Note:</strong> After you choose the "Page with Posts" template from the <em>Template</em>
|
420 |
option in the <em>Page Attributes</em> box, <strong>and</strong> <em>Publish</em> or <em>Save Draft</em>,
|
421 |
+
settings for "Page with Posts" will be displayed here. Current page template:','weaverx-theme-support' /*adm*/); ?>
|
422 |
<?php echo $template; ?>
|
423 |
</p>
|
424 |
<?php
|
438 |
|| (current_user_can('edit_pages') && !isset($opts['_hide_editor_per'])) // Editor
|
439 |
|| (current_user_can('edit_posts') && !isset($opts['_hide_author_per']))) // Author/Contributor
|
440 |
) {
|
441 |
+
echo '<p>' . __('Weaver Xtreme Per Post Options not available for your User Role.','weaverx-theme-support' /*adm*/) . '</p>';
|
442 |
return; // don't show per post panel
|
443 |
}
|
444 |
?>
|
445 |
<div style="line-height:150%;">
|
446 |
<p>
|
447 |
<?php
|
448 |
+
echo '<strong>' . __('Per Post Options','weaverx-theme-support' /*adm*/) . '</strong>';
|
449 |
+
weaverx_help_link('help.html#PerPage', __('Help for Per Post Options','weaverx-theme-support' /*adm*/));
|
450 |
+
echo '<span style="float:right;">(' . __('This Post\'s ID: ','weaverx-theme-support' /*adm*/); the_ID() ; echo ')</span>';
|
451 |
weaverx_html_br();
|
452 |
+
_e('These settings let you control display of this individual post. Many of these options override global options set on the Weaver Xtreme admin tabs.','weaverx-theme-support' /*adm*/);
|
453 |
weaverx_html_br();
|
454 |
|
455 |
+
wvrx_ts_page_checkbox('_pp_force_post_excerpt',__('Display post as excerpt','weaverx-theme-support' /*adm*/), 40);
|
456 |
+
wvrx_ts_page_checkbox('_pp_force_post_full',__('Display as full post where normally excerpted','weaverx-theme-support' /*adm*/),55,1);
|
457 |
|
458 |
|
459 |
+
wvrx_ts_page_checkbox('_pp_show_post_avatar',__('Show author avatar with post','weaverx-theme-support' /*adm*/),40);
|
460 |
+
wvrx_ts_page_checkbox('_show_post_bubble',__('Show the comment bubble','weaverx-theme-support' /*adm*/), 40, 1);
|
461 |
|
462 |
+
wvrx_ts_page_checkbox('_pp_hide_post_format_label',__('Hide <em>Post Format</em> label','weaverx-theme-support' /*adm*/),40);
|
463 |
+
wvrx_ts_page_checkbox('_pp_hide_post_title',__('Hide post title','weaverx-theme-support' /*adm*/),40,1);
|
464 |
|
465 |
+
wvrx_ts_page_checkbox('_pp_hide_top_post_meta',__('Hide top post info line','weaverx-theme-support' /*adm*/),40);
|
466 |
+
wvrx_ts_page_checkbox('_pp_hide_bottom_post_meta',__('Hide bottom post info line','weaverx-theme-support' /*adm*/),40,1);
|
467 |
+
wvrx_ts_page_checkbox('_pp_masonry_span2',__('For <em>Masonry</em> multi-columns: make this post span two columns.','weaverx-theme-support' /*adm*/),90,1);
|
468 |
|
469 |
+
wvrx_ts_page_checkbox('_pp_post_add_link',__('Show a "link to single page" icon at bottom of post - useful with compact posts','weaverx-theme-support' /*adm*/),90);
|
470 |
|
471 |
|
472 |
echo('<br style="clear:both;"/><br /><strong>Per Post Style</strong> (★Plus)' /*a*/ );
|
473 |
+
weaverx_help_link('help.html#perpoststyle', __('Help for Per Post Style','weaverx-theme-support' /*adm*/ ));
|
474 |
echo '<br />' .
|
475 |
+
__('Weaver Xtreme Plus supports optional per post CSS style rules.','weaverx-theme-support' /*adm*/); ?>
|
476 |
<br />
|
477 |
<br />
|
478 |
+
<p><strong><?php _e('<em>Single Page View:</em> Sidebars','weaverx-theme-support' /*adm*/); ?></strong></p>
|
479 |
|
480 |
<?php
|
481 |
wvrx_ts_page_layout('post');
|
483 |
<br />
|
484 |
<input type="text" size="4" id="_pp_category" name="_pp_sidebar_width"
|
485 |
value="<?php echo esc_textarea(get_post_meta($post->ID, "_pp_sidebar_width", true)); ?>" />
|
486 |
+
<?php _e("% - <em>Sidebar Width</em> - Post Single View Sidebar width (applies to all layouts)",'weaverx-theme-support' /*adm*/); ?> <br /><br />
|
487 |
<?php
|
488 |
|
489 |
+
wvrx_ts_page_checkbox('_pp_primary-widget-area',__('Hide Primary Sidebar, Single View','weaverx-theme-support' /*adm*/),40);
|
490 |
+
wvrx_ts_page_checkbox('_pp_secondary-widget-area',__('Hide Secondary Sidebar, Single View','weaverx-theme-support' /*adm*/),40,1);
|
491 |
|
492 |
+
wvrx_ts_page_checkbox('_pp_sitewide-top-widget-area',__('Hide Sitewide Top Area, Single View','weaverx-theme-support' /*adm*/),40);
|
493 |
+
wvrx_ts_page_checkbox('_pp_sitewide-bottom-widget-area',__('Hide Sitewide Bottom Area, Single View','weaverx-theme-support' /*adm*/),40,1);
|
494 |
|
495 |
+
wvrx_ts_page_checkbox('_pp_top-widget-area',__('Hide Blog Top Area, Single View','weaverx-theme-support' /*adm*/),40);
|
496 |
+
wvrx_ts_page_checkbox('_pp_bottom-widget-area',__('Hide Blog Bottom Area, Single View','weaverx-theme-support' /*adm*/),40,1);
|
497 |
|
498 |
+
wvrx_ts_page_checkbox('_pp_header-widget-area',__('Hide Header Area, Single View','weaverx-theme-support' /*adm*/),40);
|
499 |
+
wvrx_ts_page_checkbox('_pp_footer-widget-area',__('Hide Footer Area, Single View','weaverx-theme-support' /*adm*/),40,1);
|
500 |
?>
|
501 |
</p>
|
502 |
+
<p><strong><?php _e('<em>Single Page View:</em> Widget Area Replacements','weaverx-theme-support' /*adm*/); ?></strong></p>
|
503 |
<p>
|
504 |
<?php _e('Select extra widget areas to replace the default widget areas for <em>Single Page</em> view of this post.
|
505 |
+
To add areas to the widget area lists below, you <strong>must</strong> first define extra widget areas on the bottom of the <em>Main Options → Sidebars & Layout</em> tab.','weaverx-theme-support' /*adm*/); ?>
|
506 |
</p>
|
507 |
<?php
|
508 |
+
wvrx_ts_pp_replacement( __('Primary Sidebar','weaverx-theme-support' /*adm*/) , 'primary-widget-area' );
|
509 |
+
wvrx_ts_pp_replacement( __('Secondary Sidebar','weaverx-theme-support' /*adm*/) , 'secondary-widget-area' );
|
510 |
|
511 |
+
wvrx_ts_pp_replacement( __('Header Widget Area','weaverx-theme-support' /*adm*/) , 'header-widget-area' );
|
512 |
+
wvrx_ts_pp_replacement( __('Footer Widget Area','weaverx-theme-support' /*adm*/) , 'footer-widget-area' );
|
513 |
|
514 |
wvrx_ts_pp_replacement( 'Sitewide Top Widget Area' , 'sitewide-top-widget-area' );
|
515 |
wvrx_ts_pp_replacement( 'Sitewide Bottom Widget Area' , 'sitewide-bottom-widget-area' );
|
516 |
?>
|
517 |
+
<br style="clear:both;" /><p><strong><?php _e('<em>Single Page View:</em> Featured Image','weaverx-theme-support' /*adm*/); ?></strong></p>
|
518 |
<?php
|
519 |
$opts3 = array( 'id' => '_pp_fi_location',
|
520 |
+
'info' => __('Override <em>Single Page</em> setting for where to display FI','weaverx-theme-support' /*adm*/),
|
521 |
'value' => array(
|
522 |
+
array('val' => '', 'desc' => __('Default Single Page FI','weaverx-theme-support' /*adm*/) ),
|
523 |
+
array('val' => 'content-top', 'desc' => __('With Content - top','weaverx-theme-support' /*adm*/) ),
|
524 |
+
array('val' => 'content-bottom', 'desc' => __('With Content - bottom','weaverx-theme-support' /*adm*/) ),
|
525 |
+
array('val' => 'title-before', 'desc' => __('Before Title','weaverx-theme-support' /*adm*/) ),
|
526 |
+
array('val' => 'header-image', 'desc' => __('Header Image Replacement','weaverx-theme-support' /*adm*/) ),
|
527 |
+
array('val' => 'post-before', 'desc' => __('Outside of Post','weaverx-theme-support' /*adm*/) ),
|
528 |
+
array('val' => 'hide', 'desc' => __('Hide FI on Single Page','weaverx-theme-support' /*adm*/) )
|
529 |
)
|
530 |
);
|
531 |
wvrx_ts_pp_select_id($opts3);
|
533 |
<br />
|
534 |
<input type="text" size="30" id='_pp_fi_link' name='_pp_fi_link'
|
535 |
value="<?php echo esc_textarea(get_post_meta($post->ID, '_pp_fi_link', true)); ?>" />
|
536 |
+
<?php _e("<em>Featured Image Link</em> - Full URL for link from FI",'weaverx-theme-support' /*adm*/); ?>
|
537 |
<br style="clear:both;" />
|
538 |
</p><p>
|
539 |
+
<strong><?php _e('Post Editor Options','weaverx-theme-support' /*adm*/); ?></strong>
|
540 |
|
541 |
<?php
|
542 |
+
wvrx_ts_page_checkbox('_pp_hide_visual_editor',__('Disable Visual Editor for this page. Useful if you enter simple HTML or other code.','weaverx-theme-support' /*adm*/),90, 1);
|
543 |
|
544 |
if (weaverx_allow_multisite()) {
|
545 |
+
wvrx_ts_page_checkbox('_pp_raw_html',__('Allow Raw HTML and scripts. Disables auto paragraph, texturize, and other processing.','weaverx-theme-support' /*adm*/),90, 1);
|
546 |
}
|
547 |
?>
|
548 |
</p>
|
549 |
<p>
|
550 |
<?php echo('<strong>Post Format</strong>');
|
551 |
+
weaverx_help_link('help.html#gallerypost', __('Help for Per Post Format','weaverx-theme-support' /*adm*/));
|
552 |
weaverx_html_br();
|
553 |
+
_e('Weaver Xtreme supports Post Formats. Click the ? for more info.','weaverx-theme-support' /*adm*/);
|
554 |
weaverx_html_br();
|
555 |
weaverx_html_br();
|
556 |
|
includes/wvrx-ts-runtime-lib.php
CHANGED
@@ -33,88 +33,88 @@ add_action('weaverx_theme_support_addon','wvrx_ts_theme_support_addon');
|
|
33 |
function wvrx_ts_theme_support_addon() {
|
34 |
?>
|
35 |
<div class="a-plus">
|
36 |
-
<p><strong style="font-size:110%;"><?php _e('You have Weaver Xtreme Theme Support installed.','
|
37 |
<?php _e('This section shows the shortcodes and widgets available with Weaver X Theme Support.
|
38 |
-
Click the<span style="color:red; vertical-align: middle; margin-left:.25em;" class="dashicons dashicons-editor-help"></span> button to open help entry.','
|
39 |
|
40 |
<?php
|
41 |
$prefix = get_option('wvrx_toggle_shortcode_prefix');
|
42 |
if ( $prefix )
|
43 |
-
echo '<h3 style="color:red;">' . __("Weaver Xtreme Theme Support Shortcodes now prefixed with 'wvrx_'", '
|
44 |
?>
|
45 |
|
46 |
-
<h3><?php _e('Shortcodes','
|
47 |
<ul>
|
48 |
-
<li><?php wvrx_ts_fix_short($prefix, __('<span class="wvr-blue">Blog Info - [bloginfo]</span> - Display blog info as provided by WordPress bloginfo function','
|
49 |
-
<?php wvrx_ts_help_link('help.html#bloginfo',__('Help for Blog Info','
|
50 |
-
<code><?php wvrx_ts_fix_short($prefix, __("[bloginfo name='WP bloginfo name' style='style-rules']",'
|
51 |
</li>
|
52 |
-
<li><?php wvrx_ts_fix_short($prefix, __('<span class="wvr-blue">Box - [box]</span> - Display content in a Box','
|
53 |
-
<?php wvrx_ts_help_link('help.html#box',__('Help for Box','
|
54 |
-
<code><?php wvrx_ts_fix_short($prefix, __("[box background=#fff align=left border=true border_rule='border-css' border_radius=4 color=#000 margin=1 padding=1 shadow=1 style='style-rules' width=100]text[/box]",'
|
55 |
</li>
|
56 |
-
<li><?php wvrx_ts_fix_short($prefix, __('<span class="wvr-blue">DIV - [div]text[/div]</span> - Wrap content in a <div> tag','
|
57 |
-
<?php wvrx_ts_help_link('help.html#scdiv',__('Help for Header Div','
|
58 |
-
<code><?php wvrx_ts_fix_short($prefix, __("[div id='class_id' class='class_name' style='style_values']text[/div]",'
|
59 |
</li>
|
60 |
-
<li<?php wvrx_ts_fix_short($prefix, __('><span class="wvr-blue">Header Image - [header_image]</span> - Display default header image','
|
61 |
-
<?php wvrx_ts_help_link('help.html#headerimage',__('Help for Header Image','
|
62 |
-
<code><?php wvrx_ts_fix_short($prefix, __("[header_image h='size' w='size' style='inline-style']",'
|
63 |
</li>
|
64 |
|
65 |
-
<li><?php wvrx_ts_fix_short($prefix, __('<span class="wvr-blue">HTML - [html]</span> - Wrap content in any HTML tag','
|
66 |
-
<?php wvrx_ts_help_link('help.html#schtml',__('Help for HTML','
|
67 |
-
<code><?php wvrx_ts_fix_short($prefix, __("[html html-tag args='parameters']",'
|
68 |
</li>
|
69 |
-
<li><?php wvrx_ts_fix_short($prefix, __('<span class="wvr-blue">iFrame - [iframe]</span> - Display external content in an iframe','
|
70 |
-
<?php wvrx_ts_help_link('help.html#sciframe',__('Help for iframe','
|
71 |
-
<code><?php wvrx_ts_fix_short($prefix, __("[iframe src='http://example.com' height=600 percent=100 style='style']",'
|
72 |
</li>
|
73 |
-
<li><?php wvrx_ts_fix_short($prefix, __('<span class="wvr-blue">Login - [login]</span> - Show simple Login/Logout link','
|
74 |
-
<?php wvrx_ts_help_link('help.html#sclogin',__('Help for login','
|
75 |
-
<code><?php wvrx_ts_fix_short($prefix, __("[login]",'
|
76 |
</li>
|
77 |
|
78 |
-
<li><?php wvrx_ts_fix_short($prefix, __('<span class="wvr-blue">Show If- [show_if]</span> - Show content only if args meet specified conditions','
|
79 |
-
<?php wvrx_ts_help_link('help.html#scshowif',__('Help for Show/Hide If','
|
80 |
-
<code><?php wvrx_ts_fix_short($prefix, __('[show|hide_if device=device logged_in=true/false not_post_id=id-list post_id=id-list user_can=what]text[/show|hide_if]','
|
81 |
</li>
|
82 |
-
<li><?php wvrx_ts_fix_short($prefix, __('<span class="wvr-blue">Hide If - [hide_if]</span> - Hide content','
|
83 |
</li>
|
84 |
|
85 |
-
<li><?php wvrx_ts_fix_short($prefix, __('<span class="wvr-blue">Site Tagline - [site_tagline style="style" matchtheme=false]</span> - Display the site tagline','
|
86 |
-
<?php wvrx_ts_help_link('help.html#sitetitlesc',__('Help for Site Tagline','
|
87 |
-
<code><?php wvrx_ts_fix_short($prefix, __("[site_tagline style='inline-style']",'
|
88 |
</li>
|
89 |
-
<li><?php wvrx_ts_fix_short($prefix, __('<span class="wvr-blue">Site Title - [site_title style="style" matchtheme=false]</span> - Display the site title','
|
90 |
-
<?php wvrx_ts_help_link('help.html#sitetitlesc',__('Help for Site Title','
|
91 |
-
<code><?php wvrx_ts_fix_short($prefix, __("[site_title style='inline-style']",'
|
92 |
</li>
|
93 |
-
<li><?php wvrx_ts_fix_short($prefix, __('<span class="wvr-blue">SPAN - [span]text[/span]</span> - Wrap content in a <span> tag','
|
94 |
-
<?php wvrx_ts_help_link('help.html#scdiv',__('Help for Span','
|
95 |
-
<code><?php wvrx_ts_fix_short($prefix, __("[span id='class_id' class='class_name' style='style_values']text[/span]",'
|
96 |
</li>
|
97 |
-
<li><?php wvrx_ts_fix_short($prefix, __('<span class="wvr-blue">Tab Group - [tab_group]</span> - Display content on separate tabs','
|
98 |
-
<?php wvrx_ts_help_link('help.html#tab_group',__('Help for Tab Group','
|
99 |
-
<code><?php wvrx_ts_fix_short($prefix, __('[tab_group][tab]...[/tab][tab]...[/tab][/tab_group]','
|
100 |
</li>
|
101 |
-
<li><?php wvrx_ts_fix_short($prefix, __('<span class="wvr-blue">Vimeo - [vimeo]</span> - Display video from Vimeo responsively, with options','
|
102 |
-
<?php wvrx_ts_help_link('help.html#video',__('Help for Video','
|
103 |
-
<code><?php wvrx_ts_fix_short($prefix, __('[vimeo vimeo-url id=videoid sd=0 percent=100 center=1 color=#hex autoplay=0 loop=0 portrait=1 title=1 byline=1]','
|
104 |
</li>
|
105 |
|
106 |
-
<li><?php wvrx_ts_fix_short($prefix, __('<span class="wvr-blue">YouTube - [youtube]</span> - Display video from YouTube responsively, with options','
|
107 |
-
<?php wvrx_ts_help_link('help.html#video',__('Help for Video','
|
108 |
-
<code><?php wvrx_ts_fix_short($prefix, __('[youtube youtube-url id=videoid sd=0 percent=100 center=1 rel=0 privacy=0 see_help_for_others]','
|
109 |
</li>
|
110 |
</ul>
|
111 |
<form enctype="multipart/form-data" name='toggle_shortcode' action="<?php echo $_SERVER["REQUEST_URI"]; ?>" method='post'>
|
112 |
|
113 |
<?php
|
114 |
if ( $prefix )
|
115 |
-
$button = __("Remove 'wvrx_' prefix from shortcode names: [ bloginfo ], etc.", '
|
116 |
else
|
117 |
-
$button = __("Add 'wvrx_' to shortcode names: [ wvrx_bloginfo ], etc.", '
|
118 |
?>
|
119 |
<div style="clear:both;"></div>
|
120 |
<span class='submit'><input name="toggle_shortcode_prefix" type="submit" value="<?php echo $button; ?>" /></span>
|
@@ -123,23 +123,23 @@ Click the<span style="color:red; vertical-align: middle; margin-left:.25em;" cla
|
|
123 |
</form>
|
124 |
<br />
|
125 |
|
126 |
-
<h3><?php _e('Widgets','
|
127 |
<ul>
|
128 |
-
<li><?php _e('<span class="wvr-blue">Weaver X Login Widget</span> - Simplified login widget','
|
129 |
-
<?php wvrx_ts_help_link('help.html#widg-login',__('Help for Login Widget','
|
130 |
</li>
|
131 |
|
132 |
-
<li><?php _e('<span class="wvr-blue">Weaver X Per Page Text</span> - Display text on a per page basis, based on a Custom Field value','
|
133 |
-
<?php wvrx_ts_help_link('help.html##widg_pp_text',__('Help for Per Page Text Widget','
|
134 |
</li>
|
135 |
|
136 |
-
<li><?php _e('<span class="wvr-blue">Weaver X Text 2</span> - Display text in two columns - great for wide top/bottom widgets','
|
137 |
-
<?php wvrx_ts_help_link('help.html#widg_text_2',__('Help for Two Column Text Widget','
|
138 |
</li>
|
139 |
</ul>
|
140 |
|
141 |
|
142 |
-
<h3><?php _e('Per Page/Post Settings','
|
143 |
<p> <?php _e("Click the following button to produce a list of links to all pages and posts that have Per Page or Per Post settings.", 'weaver-xtreme /*adm*/'); ?></p>
|
144 |
<div style="clear:both;"></div>
|
145 |
<form enctype="multipart/form-data" name='toggle_shortcode' action="<?php echo $_SERVER["REQUEST_URI"]; ?>" method='post'>
|
33 |
function wvrx_ts_theme_support_addon() {
|
34 |
?>
|
35 |
<div class="a-plus">
|
36 |
+
<p><strong style="font-size:110%;"><?php _e('You have Weaver Xtreme Theme Support installed.','weaverx-theme-support' /*adm*/); ?></strong><br />
|
37 |
<?php _e('This section shows the shortcodes and widgets available with Weaver X Theme Support.
|
38 |
+
Click the<span style="color:red; vertical-align: middle; margin-left:.25em;" class="dashicons dashicons-editor-help"></span> button to open help entry.','weaverx-theme-support' /*adm*/); ?></p>
|
39 |
|
40 |
<?php
|
41 |
$prefix = get_option('wvrx_toggle_shortcode_prefix');
|
42 |
if ( $prefix )
|
43 |
+
echo '<h3 style="color:red;">' . __("Weaver Xtreme Theme Support Shortcodes now prefixed with 'wvrx_'", 'weaverx-theme-support') . '</h3>';
|
44 |
?>
|
45 |
|
46 |
+
<h3><?php _e('Shortcodes','weaverx-theme-support' /*adm*/); ?></h3>
|
47 |
<ul>
|
48 |
+
<li><?php wvrx_ts_fix_short($prefix, __('<span class="wvr-blue">Blog Info - [bloginfo]</span> - Display blog info as provided by WordPress bloginfo function','weaverx-theme-support' /*adm*/)); ?>
|
49 |
+
<?php wvrx_ts_help_link('help.html#bloginfo',__('Help for Blog Info','weaverx-theme-support' /*adm*/));?><br />
|
50 |
+
<code><?php wvrx_ts_fix_short($prefix, __("[bloginfo name='WP bloginfo name' style='style-rules']",'weaverx-theme-support' /*adm*/)); ?></code>
|
51 |
</li>
|
52 |
+
<li><?php wvrx_ts_fix_short($prefix, __('<span class="wvr-blue">Box - [box]</span> - Display content in a Box','weaverx-theme-support' /*adm*/)); ?>
|
53 |
+
<?php wvrx_ts_help_link('help.html#box',__('Help for Box','weaverx-theme-support' /*adm*/));?><br />
|
54 |
+
<code><?php wvrx_ts_fix_short($prefix, __("[box background=#fff align=left border=true border_rule='border-css' border_radius=4 color=#000 margin=1 padding=1 shadow=1 style='style-rules' width=100]text[/box]",'weaverx-theme-support' /*adm*/)); ?></code>
|
55 |
</li>
|
56 |
+
<li><?php wvrx_ts_fix_short($prefix, __('<span class="wvr-blue">DIV - [div]text[/div]</span> - Wrap content in a <div> tag','weaverx-theme-support' /*adm*/)); ?>
|
57 |
+
<?php wvrx_ts_help_link('help.html#scdiv',__('Help for Header Div','weaverx-theme-support' /*adm*/));?><br />
|
58 |
+
<code><?php wvrx_ts_fix_short($prefix, __("[div id='class_id' class='class_name' style='style_values']text[/div]",'weaverx-theme-support' /*adm*/)); ?></code>
|
59 |
</li>
|
60 |
+
<li<?php wvrx_ts_fix_short($prefix, __('><span class="wvr-blue">Header Image - [header_image]</span> - Display default header image','weaverx-theme-support' /*adm*/)); ?>
|
61 |
+
<?php wvrx_ts_help_link('help.html#headerimage',__('Help for Header Image','weaverx-theme-support' /*adm*/));?><br />
|
62 |
+
<code><?php wvrx_ts_fix_short($prefix, __("[header_image h='size' w='size' style='inline-style']",'weaverx-theme-support' /*adm*/)); ?></code>
|
63 |
</li>
|
64 |
|
65 |
+
<li><?php wvrx_ts_fix_short($prefix, __('<span class="wvr-blue">HTML - [html]</span> - Wrap content in any HTML tag','weaverx-theme-support' /*adm*/)); ?>
|
66 |
+
<?php wvrx_ts_help_link('help.html#schtml',__('Help for HTML','weaverx-theme-support' /*adm*/));?><br />
|
67 |
+
<code><?php wvrx_ts_fix_short($prefix, __("[html html-tag args='parameters']",'weaverx-theme-support' /*adm*/)); ?></code>
|
68 |
</li>
|
69 |
+
<li><?php wvrx_ts_fix_short($prefix, __('<span class="wvr-blue">iFrame - [iframe]</span> - Display external content in an iframe','weaverx-theme-support' /*adm*/)); ?>
|
70 |
+
<?php wvrx_ts_help_link('help.html#sciframe',__('Help for iframe','weaverx-theme-support' /*adm*/));?><br />
|
71 |
+
<code><?php wvrx_ts_fix_short($prefix, __("[iframe src='http://example.com' height=600 percent=100 style='style']",'weaverx-theme-support' /*adm*/)); ?></code>
|
72 |
</li>
|
73 |
+
<li><?php wvrx_ts_fix_short($prefix, __('<span class="wvr-blue">Login - [login]</span> - Show simple Login/Logout link','weaverx-theme-support' /*adm*/)); ?>
|
74 |
+
<?php wvrx_ts_help_link('help.html#sclogin',__('Help for login','weaverx-theme-support' /*adm*/));?><br />
|
75 |
+
<code><?php wvrx_ts_fix_short($prefix, __("[login]",'weaverx-theme-support' /*adm*/)); ?></code>
|
76 |
</li>
|
77 |
|
78 |
+
<li><?php wvrx_ts_fix_short($prefix, __('<span class="wvr-blue">Show If- [show_if]</span> - Show content only if args meet specified conditions','weaverx-theme-support' /*adm*/)); ?>
|
79 |
+
<?php wvrx_ts_help_link('help.html#scshowif',__('Help for Show/Hide If','weaverx-theme-support' /*adm*/));?><br />
|
80 |
+
<code><?php wvrx_ts_fix_short($prefix, __('[show|hide_if device=device logged_in=true/false not_post_id=id-list post_id=id-list user_can=what]text[/show|hide_if]','weaverx-theme-support' /*adm*/)); ?></code>
|
81 |
</li>
|
82 |
+
<li><?php wvrx_ts_fix_short($prefix, __('<span class="wvr-blue">Hide If - [hide_if]</span> - Hide content','weaverx-theme-support' /*adm*/)); ?>
|
83 |
</li>
|
84 |
|
85 |
+
<li><?php wvrx_ts_fix_short($prefix, __('<span class="wvr-blue">Site Tagline - [site_tagline style="style" matchtheme=false]</span> - Display the site tagline','weaverx-theme-support' /*adm*/)); ?>
|
86 |
+
<?php wvrx_ts_help_link('help.html#sitetitlesc',__('Help for Site Tagline','weaverx-theme-support' /*adm*/));?><br />
|
87 |
+
<code><?php wvrx_ts_fix_short($prefix, __("[site_tagline style='inline-style']",'weaverx-theme-support' /*adm*/)); ?></code>
|
88 |
</li>
|
89 |
+
<li><?php wvrx_ts_fix_short($prefix, __('<span class="wvr-blue">Site Title - [site_title style="style" matchtheme=false]</span> - Display the site title','weaverx-theme-support' /*adm*/)); ?>
|
90 |
+
<?php wvrx_ts_help_link('help.html#sitetitlesc',__('Help for Site Title','weaverx-theme-support' /*adm*/));?><br />
|
91 |
+
<code><?php wvrx_ts_fix_short($prefix, __("[site_title style='inline-style']",'weaverx-theme-support' /*adm*/)); ?></code>
|
92 |
</li>
|
93 |
+
<li><?php wvrx_ts_fix_short($prefix, __('<span class="wvr-blue">SPAN - [span]text[/span]</span> - Wrap content in a <span> tag','weaverx-theme-support' /*adm*/)); ?>
|
94 |
+
<?php wvrx_ts_help_link('help.html#scdiv',__('Help for Span','weaverx-theme-support' /*adm*/));?><br />
|
95 |
+
<code><?php wvrx_ts_fix_short($prefix, __("[span id='class_id' class='class_name' style='style_values']text[/span]",'weaverx-theme-support' /*adm*/)); ?></code>
|
96 |
</li>
|
97 |
+
<li><?php wvrx_ts_fix_short($prefix, __('<span class="wvr-blue">Tab Group - [tab_group]</span> - Display content on separate tabs','weaverx-theme-support' /*adm*/));?>
|
98 |
+
<?php wvrx_ts_help_link('help.html#tab_group',__('Help for Tab Group','weaverx-theme-support' /*adm*/));?><br />
|
99 |
+
<code><?php wvrx_ts_fix_short($prefix, __('[tab_group][tab]...[/tab][tab]...[/tab][/tab_group]','weaverx-theme-support' /*adm*/)); ?></code>
|
100 |
</li>
|
101 |
+
<li><?php wvrx_ts_fix_short($prefix, __('<span class="wvr-blue">Vimeo - [vimeo]</span> - Display video from Vimeo responsively, with options','weaverx-theme-support' /*adm*/)); ?>
|
102 |
+
<?php wvrx_ts_help_link('help.html#video',__('Help for Video','weaverx-theme-support' /*adm*/));?><br />
|
103 |
+
<code><?php wvrx_ts_fix_short($prefix, __('[vimeo vimeo-url id=videoid sd=0 percent=100 center=1 color=#hex autoplay=0 loop=0 portrait=1 title=1 byline=1]','weaverx-theme-support' /*adm*/)); ?></code>
|
104 |
</li>
|
105 |
|
106 |
+
<li><?php wvrx_ts_fix_short($prefix, __('<span class="wvr-blue">YouTube - [youtube]</span> - Display video from YouTube responsively, with options','weaverx-theme-support' /*adm*/)); ?>
|
107 |
+
<?php wvrx_ts_help_link('help.html#video',__('Help for Video','weaverx-theme-support' /*adm*/));?><br />
|
108 |
+
<code><?php wvrx_ts_fix_short($prefix, __('[youtube youtube-url id=videoid sd=0 percent=100 center=1 rel=0 privacy=0 see_help_for_others]','weaverx-theme-support' /*adm*/)); ?></code>
|
109 |
</li>
|
110 |
</ul>
|
111 |
<form enctype="multipart/form-data" name='toggle_shortcode' action="<?php echo $_SERVER["REQUEST_URI"]; ?>" method='post'>
|
112 |
|
113 |
<?php
|
114 |
if ( $prefix )
|
115 |
+
$button = __("Remove 'wvrx_' prefix from shortcode names: [ bloginfo ], etc.", 'weaverx-theme-support');
|
116 |
else
|
117 |
+
$button = __("Add 'wvrx_' to shortcode names: [ wvrx_bloginfo ], etc.", 'weaverx-theme-support');
|
118 |
?>
|
119 |
<div style="clear:both;"></div>
|
120 |
<span class='submit'><input name="toggle_shortcode_prefix" type="submit" value="<?php echo $button; ?>" /></span>
|
123 |
</form>
|
124 |
<br />
|
125 |
|
126 |
+
<h3><?php _e('Widgets','weaverx-theme-support' /*adm*/); ?></h3>
|
127 |
<ul>
|
128 |
+
<li><?php _e('<span class="wvr-blue">Weaver X Login Widget</span> - Simplified login widget','weaverx-theme-support' /*adm*/); ?>
|
129 |
+
<?php wvrx_ts_help_link('help.html#widg-login',__('Help for Login Widget','weaverx-theme-support' /*adm*/));?>
|
130 |
</li>
|
131 |
|
132 |
+
<li><?php _e('<span class="wvr-blue">Weaver X Per Page Text</span> - Display text on a per page basis, based on a Custom Field value','weaverx-theme-support' /*adm*/); ?>
|
133 |
+
<?php wvrx_ts_help_link('help.html##widg_pp_text',__('Help for Per Page Text Widget','weaverx-theme-support' /*adm*/));?>
|
134 |
</li>
|
135 |
|
136 |
+
<li><?php _e('<span class="wvr-blue">Weaver X Text 2</span> - Display text in two columns - great for wide top/bottom widgets','weaverx-theme-support' /*adm*/); ?>
|
137 |
+
<?php wvrx_ts_help_link('help.html#widg_text_2',__('Help for Two Column Text Widget','weaverx-theme-support' /*adm*/));?>
|
138 |
</li>
|
139 |
</ul>
|
140 |
|
141 |
|
142 |
+
<h3><?php _e('Per Page/Post Settings','weaverx-theme-support' /*adm*/); ?></h3>
|
143 |
<p> <?php _e("Click the following button to produce a list of links to all pages and posts that have Per Page or Per Post settings.", 'weaver-xtreme /*adm*/'); ?></p>
|
144 |
<div style="clear:both;"></div>
|
145 |
<form enctype="multipart/form-data" name='toggle_shortcode' action="<?php echo $_SERVER["REQUEST_URI"]; ?>" method='post'>
|
includes/wvrx-ts-shortcodes.php
CHANGED
@@ -275,7 +275,7 @@ function wvrx_ts_sc_iframe($args = '') {
|
|
275 |
|
276 |
$sty = $style ? ' style="' . $style . '"' : '';
|
277 |
|
278 |
-
if (!$src) return __('<h4>No src address provided to [iframe].</h4>','
|
279 |
return "\n" . '<iframe src="' . $src . '" height="' . $height . 'px" width="' . $percent . '%"' . $sty . '></iframe>' . "\n";
|
280 |
}
|
281 |
|
@@ -298,7 +298,7 @@ function wvrx_ts_sc_tab_group( $args, $content ) {
|
|
298 |
), $args ) );
|
299 |
|
300 |
if (isset($GLOBALS['wvrx_ts_in_tab_container']) && $GLOBALS['wvrx_ts_in_tab_container']) {
|
301 |
-
return __('<strong>Sorry, you cannot nest tab_containers.</strong>','
|
302 |
}
|
303 |
|
304 |
// enqueue the theme support jslib only now when it will actually be needed!
|
@@ -422,7 +422,7 @@ function wvrx_ts_sc_youtube($args = '') {
|
|
422 |
), $args));
|
423 |
|
424 |
if (!$share && !$id)
|
425 |
-
return __('<strong>No share or id values provided for youtube shortcode.</strong>','
|
426 |
|
427 |
if ($share) { // let the share override any id
|
428 |
$share = str_replace('youtu.be/','',$share);
|
@@ -510,7 +510,7 @@ function wvrx_ts_sc_vimeo($args = '') {
|
|
510 |
'center' => '1'
|
511 |
), $args));
|
512 |
|
513 |
-
if (!$share && !$id) return __('<strong>No share or id values provided for vimeo shortcode.</strong>','
|
514 |
|
515 |
if ($share) { // let the share override any id
|
516 |
$share = str_replace('http://vimeo.com/','',$share);
|
@@ -608,19 +608,19 @@ function wvrx_ts_sc_span($vals = '',$text) { // [span] - all ===============
|
|
608 |
|
609 |
function wvrx_ts_weaverx_sc_info() { // [info] ======================
|
610 |
global $current_user;
|
611 |
-
$out = __('<strong>Theme/User Info</strong><hr />','
|
612 |
|
613 |
get_currentuserinfo();
|
614 |
if (isset($current_user->display_name)) {
|
615 |
-
$out .= __('<em>User:</em> ','
|
616 |
}
|
617 |
$out .= ' ' . wp_register('','<br />',false);
|
618 |
$out .= ' ' . wp_loginout('',false) . '<br />';
|
619 |
|
620 |
-
$agent = __('Not Available','
|
621 |
if (isset($_SERVER["HTTP_USER_AGENT"]) )
|
622 |
$agent = $_SERVER['HTTP_USER_AGENT'];
|
623 |
-
$out .= __('<em>User Agent</em>:','
|
624 |
$out .= '<div id="example"></div>
|
625 |
<script type="text/javascript">
|
626 |
var txt = "";
|
@@ -640,10 +640,10 @@ txt+= "<em>Browser Width: </em>" + myWidth + " px</br>";
|
|
640 |
document.getElementById("example").innerHTML=txt;
|
641 |
</script>';
|
642 |
|
643 |
-
$out .= __('<em>Feed title:</em> ','
|
644 |
|
645 |
-
$out .= __('<br /><em>You are using</em> WordPress ','
|
646 |
-
$out .= __('<br /><em>Memory:</em> ','
|
647 |
return $out;
|
648 |
}
|
649 |
|
275 |
|
276 |
$sty = $style ? ' style="' . $style . '"' : '';
|
277 |
|
278 |
+
if (!$src) return __('<h4>No src address provided to [iframe].</h4>','weaverx-theme-support' /*adm*/);
|
279 |
return "\n" . '<iframe src="' . $src . '" height="' . $height . 'px" width="' . $percent . '%"' . $sty . '></iframe>' . "\n";
|
280 |
}
|
281 |
|
298 |
), $args ) );
|
299 |
|
300 |
if (isset($GLOBALS['wvrx_ts_in_tab_container']) && $GLOBALS['wvrx_ts_in_tab_container']) {
|
301 |
+
return __('<strong>Sorry, you cannot nest tab_containers.</strong>','weaverx-theme-support' /*adm*/);
|
302 |
}
|
303 |
|
304 |
// enqueue the theme support jslib only now when it will actually be needed!
|
422 |
), $args));
|
423 |
|
424 |
if (!$share && !$id)
|
425 |
+
return __('<strong>No share or id values provided for youtube shortcode.</strong>','weaverx-theme-support' /*adm*/);
|
426 |
|
427 |
if ($share) { // let the share override any id
|
428 |
$share = str_replace('youtu.be/','',$share);
|
510 |
'center' => '1'
|
511 |
), $args));
|
512 |
|
513 |
+
if (!$share && !$id) return __('<strong>No share or id values provided for vimeo shortcode.</strong>','weaverx-theme-support' /*adm*/);
|
514 |
|
515 |
if ($share) { // let the share override any id
|
516 |
$share = str_replace('http://vimeo.com/','',$share);
|
608 |
|
609 |
function wvrx_ts_weaverx_sc_info() { // [info] ======================
|
610 |
global $current_user;
|
611 |
+
$out = __('<strong>Theme/User Info</strong><hr />','weaverx-theme-support' /*adm*/);
|
612 |
|
613 |
get_currentuserinfo();
|
614 |
if (isset($current_user->display_name)) {
|
615 |
+
$out .= __('<em>User:</em> ','weaverx-theme-support' /*adm*/) . $current_user->display_name . '<br />';
|
616 |
}
|
617 |
$out .= ' ' . wp_register('','<br />',false);
|
618 |
$out .= ' ' . wp_loginout('',false) . '<br />';
|
619 |
|
620 |
+
$agent = __('Not Available','weaverx-theme-support' /*adm*/);
|
621 |
if (isset($_SERVER["HTTP_USER_AGENT"]) )
|
622 |
$agent = $_SERVER['HTTP_USER_AGENT'];
|
623 |
+
$out .= __('<em>User Agent</em>:','weaverx-theme-support' /*adm*/) . ' <small>' . $agent . '</small>';
|
624 |
$out .= '<div id="example"></div>
|
625 |
<script type="text/javascript">
|
626 |
var txt = "";
|
640 |
document.getElementById("example").innerHTML=txt;
|
641 |
</script>';
|
642 |
|
643 |
+
$out .= __('<em>Feed title:</em> ','weaverx-theme-support' /*adm*/) . get_bloginfo_rss('name') . '<br />' . get_wp_title_rss();
|
644 |
|
645 |
+
$out .= __('<br /><em>You are using</em> WordPress ','weaverx-theme-support' /*adm*/) . $GLOBALS['wp_version'] . '<br /><em>PHP Version:</em> ' . phpversion();
|
646 |
+
$out .= __('<br /><em>Memory:</em> ','weaverx-theme-support' /*adm*/) . round(memory_get_usage()/1024/1024,2) . 'M of ' . (int)ini_get('memory_limit') . 'M <hr />';
|
647 |
return $out;
|
648 |
}
|
649 |
|
includes/wvrx-ts-widgets.php
CHANGED
@@ -7,9 +7,9 @@ class WeaverX_Widget_Text extends WP_Widget {
|
|
7 |
|
8 |
function WeaverX_Widget_Text() {
|
9 |
$widget_ops = array('classname' => 'WeaverX_Widget_Text',
|
10 |
-
'description' => __('Text Widget with Two Columns - with HTML and shortcode support. Also adds shortcodes to standard Text widget.','
|
11 |
$control_ops = array('width' => 400, 'height' => 350);
|
12 |
-
parent::__construct('wvrx2_text', __('Weaver X Text 2','
|
13 |
}
|
14 |
|
15 |
function widget( $args, $instance ) {
|
@@ -73,8 +73,8 @@ class WeaverX_Widget_PPText extends WP_Widget {
|
|
73 |
|
74 |
function WeaverX_Widget_PPText() {
|
75 |
$widget_ops = array('classname' => 'wvrx_widget_pptext', 'description' =>
|
76 |
-
__('Display text on a Per Page basis. Add to Widget area to see instructions.','
|
77 |
-
parent::__construct('wvrx_pptext', __('Weaver X Per Page Text','
|
78 |
}
|
79 |
|
80 |
function widget( $args, $instance ) {
|
@@ -104,7 +104,7 @@ class WeaverX_Widget_PPText extends WP_Widget {
|
|
104 |
fields set on a Per Page basis. For any page, define the Custom Field <em>wvrx_ts_pp_title</em>
|
105 |
if you want a title, and define Custom Field <em>wvrx_ts_pp_text</em> as the content. Content can include arbitrary text,
|
106 |
HTML, and shortcodes. The text will not automatically add paragraphs. The widget will display only if the custom
|
107 |
-
fields are defined when that page is displayed. (This widget won\'t display on the default blog or other archive-like pages.)','
|
108 |
<?php
|
109 |
}
|
110 |
}
|
@@ -115,13 +115,13 @@ fields are defined when that page is displayed. (This widget won\'t display on t
|
|
115 |
class WeaverX_Widget_Login extends WP_Widget {
|
116 |
|
117 |
function WeaverX_Widget_Login() {
|
118 |
-
$widget_ops = array('classname' => 'wvrx_widget_login', 'description' => __( "Log in/out, admin", '
|
119 |
-
parent::__construct('wvrx_login', __('Weaver X Login','
|
120 |
}
|
121 |
|
122 |
function widget( $args, $instance ) {
|
123 |
extract($args);
|
124 |
-
$title = apply_filters('widget_title', empty($instance['title']) ? __('Login', '
|
125 |
|
126 |
echo $before_widget;
|
127 |
if ( $title )
|
@@ -129,7 +129,7 @@ class WeaverX_Widget_Login extends WP_Widget {
|
|
129 |
global $current_user;
|
130 |
get_currentuserinfo();
|
131 |
if (isset($current_user->display_name))
|
132 |
-
echo '<span class="wvrx-welcome-user">' . __('Welcome','
|
133 |
?>
|
134 |
<ul>
|
135 |
<?php wp_register(); ?>
|
@@ -150,7 +150,7 @@ class WeaverX_Widget_Login extends WP_Widget {
|
|
150 |
$instance = wp_parse_args( (array) $instance, array( 'title' => '' ) );
|
151 |
$title = strip_tags($instance['title']);
|
152 |
?>
|
153 |
-
<p><label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:','
|
154 |
<?php
|
155 |
}
|
156 |
}
|
7 |
|
8 |
function WeaverX_Widget_Text() {
|
9 |
$widget_ops = array('classname' => 'WeaverX_Widget_Text',
|
10 |
+
'description' => __('Text Widget with Two Columns - with HTML and shortcode support. Also adds shortcodes to standard Text widget.','weaverx-theme-support' /*adm*/));
|
11 |
$control_ops = array('width' => 400, 'height' => 350);
|
12 |
+
parent::__construct('wvrx2_text', __('Weaver X Text 2','weaverx-theme-support' /*adm*/), $widget_ops, $control_ops);
|
13 |
}
|
14 |
|
15 |
function widget( $args, $instance ) {
|
73 |
|
74 |
function WeaverX_Widget_PPText() {
|
75 |
$widget_ops = array('classname' => 'wvrx_widget_pptext', 'description' =>
|
76 |
+
__('Display text on a Per Page basis. Add to Widget area to see instructions.','weaverx-theme-support' /*adm*/) );
|
77 |
+
parent::__construct('wvrx_pptext', __('Weaver X Per Page Text','weaverx-theme-support' /*adm*/), $widget_ops);
|
78 |
}
|
79 |
|
80 |
function widget( $args, $instance ) {
|
104 |
fields set on a Per Page basis. For any page, define the Custom Field <em>wvrx_ts_pp_title</em>
|
105 |
if you want a title, and define Custom Field <em>wvrx_ts_pp_text</em> as the content. Content can include arbitrary text,
|
106 |
HTML, and shortcodes. The text will not automatically add paragraphs. The widget will display only if the custom
|
107 |
+
fields are defined when that page is displayed. (This widget won\'t display on the default blog or other archive-like pages.)','weaverx-theme-support' /*adm*/); ?><p>
|
108 |
<?php
|
109 |
}
|
110 |
}
|
115 |
class WeaverX_Widget_Login extends WP_Widget {
|
116 |
|
117 |
function WeaverX_Widget_Login() {
|
118 |
+
$widget_ops = array('classname' => 'wvrx_widget_login', 'description' => __( "Log in/out, admin", 'weaverx-theme-support' /*adm*/ ) );
|
119 |
+
parent::__construct('wvrx_login', __('Weaver X Login','weaverx-theme-support' /*adm*/), $widget_ops);
|
120 |
}
|
121 |
|
122 |
function widget( $args, $instance ) {
|
123 |
extract($args);
|
124 |
+
$title = apply_filters('widget_title', empty($instance['title']) ? __('Login', 'weaverx-theme-support' /*adm*/ ) : $instance['title'], $instance, $this->id_base);
|
125 |
|
126 |
echo $before_widget;
|
127 |
if ( $title )
|
129 |
global $current_user;
|
130 |
get_currentuserinfo();
|
131 |
if (isset($current_user->display_name))
|
132 |
+
echo '<span class="wvrx-welcome-user">' . __('Welcome','weaverx-theme-support' /*adm*/) . ' ' . $current_user->display_name . ".</span><br />\n";
|
133 |
?>
|
134 |
<ul>
|
135 |
<?php wp_register(); ?>
|
150 |
$instance = wp_parse_args( (array) $instance, array( 'title' => '' ) );
|
151 |
$title = strip_tags($instance['title']);
|
152 |
?>
|
153 |
+
<p><label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:','weaverx-theme-support' /*adm*/); ?></label> <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo esc_attr($title); ?>" /></p>
|
154 |
<?php
|
155 |
}
|
156 |
}
|
readme.txt
CHANGED
@@ -7,9 +7,10 @@ Contributors: wpweaver
|
|
7 |
Author: wpweaver
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
|
|
10 |
Requires at least: 4.0
|
11 |
Tested up to: 4.3
|
12 |
-
Stable tag: 1.
|
13 |
|
14 |
A useful shortcode and widget collection for Weaver Xtreme
|
15 |
|
@@ -74,6 +75,16 @@ Support for this plugin can best be found at our forum - http://forum.weaverthem
|
|
74 |
This is the initial release of this plugin.
|
75 |
|
76 |
== ChangeLog ==
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
77 |
= 1.3 =
|
78 |
* Fix WP_Widget PHP constructor
|
79 |
* Test with WP 4.3
|
7 |
Author: wpweaver
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
+
Text Domain: weaverx-theme-support
|
11 |
Requires at least: 4.0
|
12 |
Tested up to: 4.3
|
13 |
+
Stable tag: 1.9
|
14 |
|
15 |
A useful shortcode and widget collection for Weaver Xtreme
|
16 |
|
75 |
This is the initial release of this plugin.
|
76 |
|
77 |
== ChangeLog ==
|
78 |
+
|
79 |
+
= 1.9 =
|
80 |
+
* Changes to support Weaver Xtreme Version 2.0 (for alpha test versions)
|
81 |
+
|
82 |
+
= 1.3.1 =
|
83 |
+
* Changed translation text domain to 'weaverx-theme-support'
|
84 |
+
|
85 |
+
= 1.3.1 =
|
86 |
+
* Fixed: tab shortcode styling
|
87 |
+
|
88 |
= 1.3 =
|
89 |
* Fix WP_Widget PHP constructor
|
90 |
* Test with WP 4.3
|
weaverx-ts-style.css
CHANGED
@@ -96,6 +96,18 @@ without modifying theme or plugin .css files.
|
|
96 |
background: #eee; /* tab-current-color */
|
97 |
}
|
98 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
99 |
.wvr-tabs-style .wvr-tabs-pane {
|
100 |
padding: 15px;
|
101 |
border: 1px solid #888; /* border-color */
|
96 |
background: #eee; /* tab-current-color */
|
97 |
}
|
98 |
|
99 |
+
.wvr-tabs-nav span {
|
100 |
+
-moz-box-sizing: border-box;
|
101 |
+
-webkit-box-sizing: border-box;
|
102 |
+
box-sizing: border-box;
|
103 |
+
}
|
104 |
+
|
105 |
+
span.wvr-tabs-current {
|
106 |
+
-moz-box-sizing: content-box;
|
107 |
+
-webkit-box-sizing: content-box;
|
108 |
+
box-sizing: content-box;
|
109 |
+
}
|
110 |
+
|
111 |
.wvr-tabs-style .wvr-tabs-pane {
|
112 |
padding: 15px;
|
113 |
border: 1px solid #888; /* border-color */
|
weaverx-ts-style.min.css
CHANGED
@@ -1,2 +1,2 @@
|
|
1 |
@media screen and (min-width:768px){.wvr-hide-desktop{display:none!important}.wvr-hide-all{display:none!important}.wvr-show-phone{display:none!important}.wvr-show-mobile{display:none!important}.wvr-show-smalltablet{display:none!important}}@media screen and (min-width:581px) and (max-width:767px){.wvr-hide-smalltablet{display:none!important}.wvr-hide-mobile{display:none!important}.wvr-hide-all{display:none!important}.wvr-show-desktop{display:none!important}.wvr-show-phone{display:none!important}}@media screen and (max-width:580px){.wvr-hide-phone{display:none!important}.wvr-hide-mobile{display:none!important}.wvr-hide-all{display:none!important}.wvr-show-desktop{display:none!important}.wvr-show-smalltablet{display:none!important}}.wvr-tabs{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;margin:0 0 1.5em 0;background:transparent}.wvr-tabs-style .wvr-tabs-nav{padding:0 20px 0 0;margin:0;height:32px;background-color:transparent}.wvr-tabs-style .wvr-tabs-nav span{display:block;float:left;padding:0 20px;height:32px;line-height:32px;margin-right:5px;cursor:pointer;border-top:1px solid #888;border-right:1px solid #888;border-left:1px solid #888;background:#ccc;border-top-left-radius:6px;border-top-right-radius:6px;position:relative;z-index:1}
|
2 |
-
.wvr-tabs-style .wvr-tabs-nav span.wvr-tabs-current{position:relative;z-index:3}.wvr-tabs-style .wvr-tabs-nav span.wvr-tabs-current,.wvr-tabs-style .wvr-tabs-nav span:hover{background:#eee}.wvr-tabs-style .wvr-tabs-pane{padding:15px;border:1px solid #888;min-height:20px;background-color:transparent;position:relative;z-index:2}.wvr-tabs-panes{position:relative;z-index:2}.wvr-tabs-nav{position:relative;z-index:3}
|
1 |
@media screen and (min-width:768px){.wvr-hide-desktop{display:none!important}.wvr-hide-all{display:none!important}.wvr-show-phone{display:none!important}.wvr-show-mobile{display:none!important}.wvr-show-smalltablet{display:none!important}}@media screen and (min-width:581px) and (max-width:767px){.wvr-hide-smalltablet{display:none!important}.wvr-hide-mobile{display:none!important}.wvr-hide-all{display:none!important}.wvr-show-desktop{display:none!important}.wvr-show-phone{display:none!important}}@media screen and (max-width:580px){.wvr-hide-phone{display:none!important}.wvr-hide-mobile{display:none!important}.wvr-hide-all{display:none!important}.wvr-show-desktop{display:none!important}.wvr-show-smalltablet{display:none!important}}.wvr-tabs{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;margin:0 0 1.5em 0;background:transparent}.wvr-tabs-style .wvr-tabs-nav{padding:0 20px 0 0;margin:0;height:32px;background-color:transparent}.wvr-tabs-style .wvr-tabs-nav span{display:block;float:left;padding:0 20px;height:32px;line-height:32px;margin-right:5px;cursor:pointer;border-top:1px solid #888;border-right:1px solid #888;border-left:1px solid #888;background:#ccc;border-top-left-radius:6px;border-top-right-radius:6px;position:relative;z-index:1}
|
2 |
+
.wvr-tabs-style .wvr-tabs-nav span.wvr-tabs-current{position:relative;z-index:3}.wvr-tabs-style .wvr-tabs-nav span.wvr-tabs-current,.wvr-tabs-style .wvr-tabs-nav span:hover{background:#eee}.wvr-tabs-nav span{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}span.wvr-tabs-current{-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}.wvr-tabs-style .wvr-tabs-pane{padding:15px;border:1px solid #888;min-height:20px;background-color:transparent;position:relative;z-index:2}.wvr-tabs-panes{position:relative;z-index:2}.wvr-tabs-nav{position:relative;z-index:3}
|
weaverx-ts.php
CHANGED
@@ -5,7 +5,7 @@ Plugin URI: http://weavertheme.com/plugins
|
|
5 |
Description: Weaver X Theme Support - a package of useful shortcodes and widgets that integrates closely with the Weaver X theme. This plugin Will also allow you to switch from Weaver X to any other theme and still be able to use the shortcodes and widgets from Weaver X with minimal effort.
|
6 |
Author: wpweaver
|
7 |
Author URI: http://weavertheme.com/about/
|
8 |
-
Version: 1.
|
9 |
License: GPL V3
|
10 |
|
11 |
Weaver Xtreme Theme Support
|
@@ -33,7 +33,7 @@ $theme = get_template_directory();
|
|
33 |
|
34 |
if ( strpos( $theme, '/weaver-xtreme') !== false ) { // only load if Weaver Xtreme is the theme
|
35 |
|
36 |
-
define ('WVRX_TS_VERSION','1.
|
37 |
define ('WVRX_TS_MINIFY','.min'); // '' for dev, '.min' for production
|
38 |
define ('WVRX_TS_APPEARANCE_PAGE', false );
|
39 |
|
@@ -69,13 +69,21 @@ require_once(dirname( __FILE__ ) . '/includes/wvrx-ts-runtime-lib.php'); // NOW
|
|
69 |
require_once(dirname( __FILE__ ) . '/includes/wvrx-ts-widgets.php'); // widgets runtime library
|
70 |
require_once(dirname( __FILE__ ) . '/includes/wvrx-ts-shortcodes.php'); // load the shortcode definitions
|
71 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
72 |
if ( ! ( function_exists( 'weaverxplus_plugin_installed' ) && version_compare(WEAVER_XPLUS_VERSION,'0.13','>') ) ) {
|
73 |
|
74 |
add_action('admin_menu', 'wvrx_ts_add_page_fields',11); // allow X-Plus to override us
|
75 |
|
76 |
function wvrx_ts_add_page_fields() {
|
77 |
-
add_meta_box('page-box', __('Weaver Xtreme Options For This Page (Theme Support Per Page Options)','
|
78 |
-
add_meta_box('post-box', __('Weaver Xtreme Options For This Post (Theme Support Per Post Options)','
|
79 |
global $post;
|
80 |
$opts = get_option( apply_filters('weaverx_options','weaverx_settings') , array()); // need to fetch Weaver Xtreme options
|
81 |
if ((isset($opts['_show_per_post_all']) && $opts['_show_per_post_all']) || function_exists('atw_slider_plugins_loaded') ) {
|
@@ -83,7 +91,7 @@ function wvrx_ts_add_page_fields() {
|
|
83 |
$args=array( 'public' => true, '_builtin' => false );
|
84 |
$post_types = get_post_types($args,'names','and');
|
85 |
foreach ($post_types as $post_type ) {
|
86 |
-
add_meta_box('post-box' . $i, __('Weaver Xtreme Options For This Post (Theme Support Per Post Options)','
|
87 |
$i++;
|
88 |
}
|
89 |
}
|
@@ -104,7 +112,7 @@ function wvrx_ts_post_extras_load() {
|
|
104 |
add_action('weaverx_child_show_extrathemes','wvrx_ts_child_show_extrathemes_action');
|
105 |
|
106 |
function wvrx_ts_child_show_extrathemes_action() {
|
107 |
-
echo '<h3 class="atw-option-subheader">' . __('Select an Add-on Subtheme You Have Uploaded','
|
108 |
$addon_dir = weaverx_f_uploads_base_dir() . 'weaverx-subthemes/addon-subthemes/';
|
109 |
$addon_url = weaverx_f_uploads_base_url() . 'weaverx-subthemes/addon-subthemes/';
|
110 |
|
@@ -125,11 +133,11 @@ function wvrx_ts_child_show_extrathemes_action() {
|
|
125 |
|
126 |
$cur_addon = weaverx_getopt('wvrx_addon_name');
|
127 |
if ($cur_addon)
|
128 |
-
echo '<h3>' . __('Currently selected Add-on Subtheme: ','
|
129 |
?>
|
130 |
<form enctype="multipart/form-data" name='pick_added_theme' action="<?php echo $_SERVER["REQUEST_URI"]; ?>" method='post'>
|
131 |
|
132 |
-
<h4><?php _e('Select an add-on subtheme:','
|
133 |
|
134 |
<?php
|
135 |
foreach ($addon_list as $addon) {
|
@@ -143,31 +151,31 @@ function wvrx_ts_child_show_extrathemes_action() {
|
|
143 |
}
|
144 |
?>
|
145 |
<div style="clear:both;"></div>
|
146 |
-
<br /><span class='submit'><input name="set_added_subtheme" type="submit" value="<?php _e('Set to Selected Add-on Subtheme','
|
147 |
<small style="color:#b00;"><br /><?php _e('<strong>Note:</strong> Selecting a new subtheme will change only theme related settings.
|
148 |
Options labelled with (♦) will be retained.
|
149 |
-
You can use the Save/Restore tab to save a copy of all your current settings first.','
|
150 |
|
151 |
<?php weaverx_nonce_field('set_added_subtheme'); ?>
|
152 |
|
153 |
-
<br /><br /><span class='atw-small-submit' style="margin-left:100px;"><input name="delete_added_subtheme" type="submit" value="<?php _e('Delete Selected Add-on Subtheme','
|
154 |
-
<small><?php _e('This will delete the selected Add-on Subtheme from the Add-on directory','
|
155 |
<?php weaverx_nonce_field('delete_added_subtheme'); ?>
|
156 |
</form>
|
157 |
<?php
|
158 |
} else {
|
159 |
?>
|
160 |
-
<p><?php _e('No Add-on Subthemes available.','
|
161 |
<?php
|
162 |
}
|
163 |
echo '<h3 class="atw-option-subheader">Upload an Add-on Subtheme From Your Computer</h3>';
|
164 |
?>
|
165 |
-
<p><?php _e('You can find additional free and premium Add-on Subthemes for <em>Weaver Xtreme</em>','
|
166 |
-
<a href="http://xtreme.weavertheme.com/add-on-subthemes/" title="<?php _e('Weaver Xtreme Add-on Subthemes','
|
167 |
<form name='form_added_theme' enctype="multipart/form-data" action="<?php echo $_SERVER["REQUEST_URI"]; ?>" method="POST">
|
168 |
<table>
|
169 |
<tr valign="top">
|
170 |
-
<td><strong><?php _e('Select Add-on Subtheme .zip file to upload:','
|
171 |
<input name="uploaded_addon" type="file" />
|
172 |
<input type="hidden" name="uploadaddon" value="yes" />
|
173 |
</td>
|
@@ -175,7 +183,7 @@ function wvrx_ts_child_show_extrathemes_action() {
|
|
175 |
<tr><td>
|
176 |
<span style="margin-left:50px;" class='submit'>
|
177 |
<input name="upload_addon" type="submit" value="Upload Add-on Subtheme" /><br />
|
178 |
-
</span> <small><?php _e('<strong>Upload and Save</strong> an Add-on Subtheme or Subtheme collection from .zip file on your computer. Will be saved on your site\'s filesystem.','
|
179 |
</td></tr>
|
180 |
</table>
|
181 |
<?php weaverx_nonce_field('upload_addon'); ?>
|
@@ -198,9 +206,9 @@ function wvrx_ts_child_process_options() {
|
|
198 |
if (!weaverx_ex_set_current_to_serialized_values($contents,'weaverx_uploadit:'.$openname)) {
|
199 |
echo '<div id="message" class="updated fade"><p><strong><em style="color:red;">' .
|
200 |
__('Sorry, there was a problem uploading your add on theme. The name you picked did not have a valid
|
201 |
-
Weaver Xtreme theme file in the /weaverx-subthemes/addon-subthemes directory.','
|
202 |
} else {
|
203 |
-
weaverx_save_msg(__('Weaver Xtreme theme reset to ','
|
204 |
ucwords(str_replace('-',' ',$name )) . ' add-on subtheme.');
|
205 |
weaverx_setopt('wvrx_addon_name',$name);
|
206 |
}
|
@@ -213,8 +221,8 @@ Weaver Xtreme theme file in the /weaverx-subthemes/addon-subthemes directory.','
|
|
213 |
$name = $_POST['wvrx_addon_name'];
|
214 |
@unlink(weaverx_f_uploads_base_dir() . 'weaverx-subthemes/addon-subthemes/' . $name . '.wxt');
|
215 |
@unlink(weaverx_f_uploads_base_dir() . 'weaverx-subthemes/addon-subthemes/' . $name . '.jpg');
|
216 |
-
weaverx_save_msg(__('Deleted ','
|
217 |
-
ucwords(str_replace('-',' ',$name )) . __(' add-on subtheme.','
|
218 |
}
|
219 |
}
|
220 |
|
@@ -230,10 +238,10 @@ Weaver Xtreme theme file in the /weaverx-subthemes/addon-subthemes directory.','
|
|
230 |
$val = get_option('wvrx_toggle_shortcode_prefix');
|
231 |
if ( $val ) {
|
232 |
delete_option('wvrx_toggle_shortcode_prefix');
|
233 |
-
weaverx_save_msg(__("Weaver Xtreme Theme Support Shortcodes NOT prefixed with 'wvrx_'", '
|
234 |
} else {
|
235 |
update_option('wvrx_toggle_shortcode_prefix', 'wvrx_');
|
236 |
-
weaverx_save_msg(__("Weaver Xtreme Theme Support Shortcodes now prefixed with 'wvrx_'", '
|
237 |
}
|
238 |
} else if ( weaverx_submitted('show_per_page_report')) {
|
239 |
wvrx_ts_per_page_report();
|
@@ -266,17 +274,17 @@ function wvrx_ts_wunpackzip($uploaded, $to_dir) {
|
|
266 |
$ext_check = end($end);
|
267 |
|
268 |
if (false && !weaverx_f_file_access_available()) {
|
269 |
-
$errors[] = __('Sorry - Theme unable to access files.','
|
270 |
$ok = false;
|
271 |
}
|
272 |
|
273 |
if ($filename == "") {
|
274 |
-
$errors[] = __('You didn\'t select a file to upload.','
|
275 |
$ok = false;
|
276 |
}
|
277 |
|
278 |
if ($ok && $ext_check != 'zip'){
|
279 |
-
$errors[] = __("Uploaded files must have <em>.zip</em> extension.",'
|
280 |
$ok = false;
|
281 |
}
|
282 |
|
@@ -284,7 +292,7 @@ function wvrx_ts_wunpackzip($uploaded, $to_dir) {
|
|
284 |
if (!weaverx_f_exists($openname)) {
|
285 |
$errors[] = '<strong><em style="color:red;">' .
|
286 |
__('Sorry, there was a problem uploading your file. You may need to check your folder permissions
|
287 |
-
or other server settings.','
|
288 |
$ok = false;
|
289 |
}
|
290 |
}
|
@@ -298,7 +306,7 @@ or other server settings.','weaver-xtreme' /*adm*/) . '</em></strong><br />' . _
|
|
298 |
remove_filter('filesystem_method', 'wvrx_ts_wvx_return_direct');
|
299 |
if (!$try2) {
|
300 |
$errors[] = __('Sorry, there\'s a problem trying to use the WordPress unzip function. Please
|
301 |
-
see the FAQ at weavertheme.com support for more information.','
|
302 |
$ok = false;
|
303 |
}
|
304 |
}
|
@@ -308,16 +316,16 @@ or other server settings.','weaver-xtreme' /*adm*/) . '</em></strong><br />' . _
|
|
308 |
// $filename has name of file uploaded
|
309 |
$is_error = unzip_file( $openname, $to_dir );
|
310 |
if ( !is_wp_error( $is_error ) ) {
|
311 |
-
weaverx_save_msg(__('File ','
|
312 |
@unlink($openname); // delete temp file...
|
313 |
} else {
|
314 |
-
$errors[] = __("Sorry, unpacking the .zip you selected file failed. You may have a corrupt .zip file, or there many a file permissions problem on your WordPress installation.",'
|
315 |
$errors[] = $is_error->get_error_message();
|
316 |
$ok = false;
|
317 |
}
|
318 |
}
|
319 |
if (!$ok) {
|
320 |
-
echo '<div id="message" class="updated fade"><p><strong><em style="color:red;">' . __('ERROR','
|
321 |
foreach($errors as $error){
|
322 |
echo $error.'<br />';
|
323 |
}
|
@@ -332,7 +340,7 @@ function wvrx_ts_child_saverestore_action() {
|
|
332 |
tab to upload Add-on Subthemes.</h3><p>You can upload extra add-on subthemes you\'ve downloaded using the
|
333 |
Subthemes tab. Note: the Save and Restore options on this page are for the custom settings you
|
334 |
have created. These save/restore options are not related to Add-on Subthemes, although you can
|
335 |
-
modify an Add-on Subtheme, and save your changes here.</p>','
|
336 |
}
|
337 |
|
338 |
add_action('weaverx_check_updates', 'weaverx_check_updates_action');
|
5 |
Description: Weaver X Theme Support - a package of useful shortcodes and widgets that integrates closely with the Weaver X theme. This plugin Will also allow you to switch from Weaver X to any other theme and still be able to use the shortcodes and widgets from Weaver X with minimal effort.
|
6 |
Author: wpweaver
|
7 |
Author URI: http://weavertheme.com/about/
|
8 |
+
Version: 1.9
|
9 |
License: GPL V3
|
10 |
|
11 |
Weaver Xtreme Theme Support
|
33 |
|
34 |
if ( strpos( $theme, '/weaver-xtreme') !== false ) { // only load if Weaver Xtreme is the theme
|
35 |
|
36 |
+
define ('WVRX_TS_VERSION','1.9');
|
37 |
define ('WVRX_TS_MINIFY','.min'); // '' for dev, '.min' for production
|
38 |
define ('WVRX_TS_APPEARANCE_PAGE', false );
|
39 |
|
69 |
require_once(dirname( __FILE__ ) . '/includes/wvrx-ts-widgets.php'); // widgets runtime library
|
70 |
require_once(dirname( __FILE__ ) . '/includes/wvrx-ts-shortcodes.php'); // load the shortcode definitions
|
71 |
|
72 |
+
// load traditional Weaver Xtreme Options
|
73 |
+
|
74 |
+
function weaver_xtreme_load_admin_action() {
|
75 |
+
require_once(dirname( __FILE__ ) . '/admin/load-weaverx-admin.php'); // NOW - load the traditional opions admin
|
76 |
+
}
|
77 |
+
|
78 |
+
add_action('weaver_xtreme_load_admin','weaver_xtreme_load_admin_action');
|
79 |
+
|
80 |
if ( ! ( function_exists( 'weaverxplus_plugin_installed' ) && version_compare(WEAVER_XPLUS_VERSION,'0.13','>') ) ) {
|
81 |
|
82 |
add_action('admin_menu', 'wvrx_ts_add_page_fields',11); // allow X-Plus to override us
|
83 |
|
84 |
function wvrx_ts_add_page_fields() {
|
85 |
+
add_meta_box('page-box', __('Weaver Xtreme Options For This Page (Theme Support Per Page Options)','weaverx-theme-support' /*adm*/), 'wvrx_ts_page_extras_load', 'page', 'normal', 'high');
|
86 |
+
add_meta_box('post-box', __('Weaver Xtreme Options For This Post (Theme Support Per Post Options)','weaverx-theme-support' /*adm*/), 'wvrx_ts_post_extras_load', 'post', 'normal', 'high');
|
87 |
global $post;
|
88 |
$opts = get_option( apply_filters('weaverx_options','weaverx_settings') , array()); // need to fetch Weaver Xtreme options
|
89 |
if ((isset($opts['_show_per_post_all']) && $opts['_show_per_post_all']) || function_exists('atw_slider_plugins_loaded') ) {
|
91 |
$args=array( 'public' => true, '_builtin' => false );
|
92 |
$post_types = get_post_types($args,'names','and');
|
93 |
foreach ($post_types as $post_type ) {
|
94 |
+
add_meta_box('post-box' . $i, __('Weaver Xtreme Options For This Post (Theme Support Per Post Options)','weaverx-theme-support' /*adm*/), 'wvrx_ts_post_extras', $post_type, 'normal', 'high');
|
95 |
$i++;
|
96 |
}
|
97 |
}
|
112 |
add_action('weaverx_child_show_extrathemes','wvrx_ts_child_show_extrathemes_action');
|
113 |
|
114 |
function wvrx_ts_child_show_extrathemes_action() {
|
115 |
+
echo '<h3 class="atw-option-subheader">' . __('Select an Add-on Subtheme You Have Uploaded','weaverx-theme-support' /*adm*/) . '</h3>';
|
116 |
$addon_dir = weaverx_f_uploads_base_dir() . 'weaverx-subthemes/addon-subthemes/';
|
117 |
$addon_url = weaverx_f_uploads_base_url() . 'weaverx-subthemes/addon-subthemes/';
|
118 |
|
133 |
|
134 |
$cur_addon = weaverx_getopt('wvrx_addon_name');
|
135 |
if ($cur_addon)
|
136 |
+
echo '<h3>' . __('Currently selected Add-on Subtheme: ','weaverx-theme-support' /*adm*/) . ucwords(str_replace('-',' ',$cur_addon)) . '</h3>';
|
137 |
?>
|
138 |
<form enctype="multipart/form-data" name='pick_added_theme' action="<?php echo $_SERVER["REQUEST_URI"]; ?>" method='post'>
|
139 |
|
140 |
+
<h4><?php _e('Select an add-on subtheme:','weaverx-theme-support' /*adm*/); ?></h4>
|
141 |
|
142 |
<?php
|
143 |
foreach ($addon_list as $addon) {
|
151 |
}
|
152 |
?>
|
153 |
<div style="clear:both;"></div>
|
154 |
+
<br /><span class='submit'><input name="set_added_subtheme" type="submit" value="<?php _e('Set to Selected Add-on Subtheme','weaverx-theme-support' /*adm*/); ?>" /></span>
|
155 |
<small style="color:#b00;"><br /><?php _e('<strong>Note:</strong> Selecting a new subtheme will change only theme related settings.
|
156 |
Options labelled with (♦) will be retained.
|
157 |
+
You can use the Save/Restore tab to save a copy of all your current settings first.','weaverx-theme-support' /*adm*/); ?></small>
|
158 |
|
159 |
<?php weaverx_nonce_field('set_added_subtheme'); ?>
|
160 |
|
161 |
+
<br /><br /><span class='atw-small-submit' style="margin-left:100px;"><input name="delete_added_subtheme" type="submit" value="<?php _e('Delete Selected Add-on Subtheme','weaverx-theme-support' /*adm*/); ?>" /></span>
|
162 |
+
<small><?php _e('This will delete the selected Add-on Subtheme from the Add-on directory','weaverx-theme-support' /*adm*/); ?></small>
|
163 |
<?php weaverx_nonce_field('delete_added_subtheme'); ?>
|
164 |
</form>
|
165 |
<?php
|
166 |
} else {
|
167 |
?>
|
168 |
+
<p><?php _e('No Add-on Subthemes available.','weaverx-theme-support' /*adm*/); ?></p>
|
169 |
<?php
|
170 |
}
|
171 |
echo '<h3 class="atw-option-subheader">Upload an Add-on Subtheme From Your Computer</h3>';
|
172 |
?>
|
173 |
+
<p><?php _e('You can find additional free and premium Add-on Subthemes for <em>Weaver Xtreme</em>','weaverx-theme-support' /*adm*/); ?>
|
174 |
+
<a href="http://xtreme.weavertheme.com/add-on-subthemes/" title="<?php _e('Weaver Xtreme Add-on Subthemes','weaverx-theme-support' /*adm*/); ?>"><strong><?php _e('HERE','weaverx-theme-support' /*adm*/); ?></strong></a>.</p>
|
175 |
<form name='form_added_theme' enctype="multipart/form-data" action="<?php echo $_SERVER["REQUEST_URI"]; ?>" method="POST">
|
176 |
<table>
|
177 |
<tr valign="top">
|
178 |
+
<td><strong><?php _e('Select Add-on Subtheme .zip file to upload:','weaverx-theme-support' /*adm*/); ?></strong>
|
179 |
<input name="uploaded_addon" type="file" />
|
180 |
<input type="hidden" name="uploadaddon" value="yes" />
|
181 |
</td>
|
183 |
<tr><td>
|
184 |
<span style="margin-left:50px;" class='submit'>
|
185 |
<input name="upload_addon" type="submit" value="Upload Add-on Subtheme" /><br />
|
186 |
+
</span> <small><?php _e('<strong>Upload and Save</strong> an Add-on Subtheme or Subtheme collection from .zip file on your computer. Will be saved on your site\'s filesystem.','weaverx-theme-support' /*adm*/); ?></small>
|
187 |
</td></tr>
|
188 |
</table>
|
189 |
<?php weaverx_nonce_field('upload_addon'); ?>
|
206 |
if (!weaverx_ex_set_current_to_serialized_values($contents,'weaverx_uploadit:'.$openname)) {
|
207 |
echo '<div id="message" class="updated fade"><p><strong><em style="color:red;">' .
|
208 |
__('Sorry, there was a problem uploading your add on theme. The name you picked did not have a valid
|
209 |
+
Weaver Xtreme theme file in the /weaverx-subthemes/addon-subthemes directory.','weaverx-theme-support' /*adm*/) . '</em></strong></p></div>';
|
210 |
} else {
|
211 |
+
weaverx_save_msg(__('Weaver Xtreme theme reset to ','weaverx-theme-support' /*adm*/) .
|
212 |
ucwords(str_replace('-',' ',$name )) . ' add-on subtheme.');
|
213 |
weaverx_setopt('wvrx_addon_name',$name);
|
214 |
}
|
221 |
$name = $_POST['wvrx_addon_name'];
|
222 |
@unlink(weaverx_f_uploads_base_dir() . 'weaverx-subthemes/addon-subthemes/' . $name . '.wxt');
|
223 |
@unlink(weaverx_f_uploads_base_dir() . 'weaverx-subthemes/addon-subthemes/' . $name . '.jpg');
|
224 |
+
weaverx_save_msg(__('Deleted ','weaverx-theme-support' /*adm*/) .
|
225 |
+
ucwords(str_replace('-',' ',$name )) . __(' add-on subtheme.','weaverx-theme-support' /*adm*/));
|
226 |
}
|
227 |
}
|
228 |
|
238 |
$val = get_option('wvrx_toggle_shortcode_prefix');
|
239 |
if ( $val ) {
|
240 |
delete_option('wvrx_toggle_shortcode_prefix');
|
241 |
+
weaverx_save_msg(__("Weaver Xtreme Theme Support Shortcodes NOT prefixed with 'wvrx_'", 'weaverx-theme-support'));
|
242 |
} else {
|
243 |
update_option('wvrx_toggle_shortcode_prefix', 'wvrx_');
|
244 |
+
weaverx_save_msg(__("Weaver Xtreme Theme Support Shortcodes now prefixed with 'wvrx_'", 'weaverx-theme-support'));
|
245 |
}
|
246 |
} else if ( weaverx_submitted('show_per_page_report')) {
|
247 |
wvrx_ts_per_page_report();
|
274 |
$ext_check = end($end);
|
275 |
|
276 |
if (false && !weaverx_f_file_access_available()) {
|
277 |
+
$errors[] = __('Sorry - Theme unable to access files.','weaverx-theme-support' /*adm*/) . '<br />';
|
278 |
$ok = false;
|
279 |
}
|
280 |
|
281 |
if ($filename == "") {
|
282 |
+
$errors[] = __('You didn\'t select a file to upload.','weaverx-theme-support' /*adm*/) . '<br />';
|
283 |
$ok = false;
|
284 |
}
|
285 |
|
286 |
if ($ok && $ext_check != 'zip'){
|
287 |
+
$errors[] = __("Uploaded files must have <em>.zip</em> extension.",'weaverx-theme-support' /*adm*/) . "<br />";
|
288 |
$ok = false;
|
289 |
}
|
290 |
|
292 |
if (!weaverx_f_exists($openname)) {
|
293 |
$errors[] = '<strong><em style="color:red;">' .
|
294 |
__('Sorry, there was a problem uploading your file. You may need to check your folder permissions
|
295 |
+
or other server settings.','weaverx-theme-support' /*adm*/) . '</em></strong><br />' . __('Trying to use file','weaverx-theme-support' /*adm*/) . "'$openname'";
|
296 |
$ok = false;
|
297 |
}
|
298 |
}
|
306 |
remove_filter('filesystem_method', 'wvrx_ts_wvx_return_direct');
|
307 |
if (!$try2) {
|
308 |
$errors[] = __('Sorry, there\'s a problem trying to use the WordPress unzip function. Please
|
309 |
+
see the FAQ at weavertheme.com support for more information.','weaverx-theme-support' /*adm*/);
|
310 |
$ok = false;
|
311 |
}
|
312 |
}
|
316 |
// $filename has name of file uploaded
|
317 |
$is_error = unzip_file( $openname, $to_dir );
|
318 |
if ( !is_wp_error( $is_error ) ) {
|
319 |
+
weaverx_save_msg(__('File ','weaverx-theme-support' /*adm*/) . $filename . __(' successfully uploaded and unpacked to: <br />','weaverx-theme-support' /*adm*/) . $to_dir);
|
320 |
@unlink($openname); // delete temp file...
|
321 |
} else {
|
322 |
+
$errors[] = __("Sorry, unpacking the .zip you selected file failed. You may have a corrupt .zip file, or there many a file permissions problem on your WordPress installation.",'weaverx-theme-support' /*adm*/);
|
323 |
$errors[] = $is_error->get_error_message();
|
324 |
$ok = false;
|
325 |
}
|
326 |
}
|
327 |
if (!$ok) {
|
328 |
+
echo '<div id="message" class="updated fade"><p><strong><em style="color:red;">' . __('ERROR','weaverx-theme-support' /*adm*/) . '</em></strong></p><p>';
|
329 |
foreach($errors as $error){
|
330 |
echo $error.'<br />';
|
331 |
}
|
340 |
tab to upload Add-on Subthemes.</h3><p>You can upload extra add-on subthemes you\'ve downloaded using the
|
341 |
Subthemes tab. Note: the Save and Restore options on this page are for the custom settings you
|
342 |
have created. These save/restore options are not related to Add-on Subthemes, although you can
|
343 |
+
modify an Add-on Subtheme, and save your changes here.</p>','weaverx-theme-support' /*adm*/);
|
344 |
}
|
345 |
|
346 |
add_action('weaverx_check_updates', 'weaverx_check_updates_action');
|