Ejemplo n.º 1
0
function weaver_adv_admin_opts()
{
    ?>
		<a name="adminopts" id="adminopts"></a>
		<label><span style="color:#00f; font-weight:bold; font-size: larger;"><b>Administrative Options</b></span></label><br/>
		These options control some administrative options and appearance features.
		<br />

<br /> <small><span style="color:red;"><b>IMPORTANT NOTE:</b></span> Weaver includes support for Rounded Corners and Shadows for Internet Explorer 7/8
via an add-on script called PIE. The script has been <strong>enabled</strong> by default. PIE doesn't work with the rounded menus. It also may have
a few incompatibilities with some Flash content and other images that might require z-index adjustment.
If you have difficulties or don't like the way your site renders in IE 7/8, you can disable the support.</small>

<br />
    <input type="checkbox" name="<?php 
    weaver_sapi_advanced_name('ttw_hide_PIE');
    ?>
" id="ttw_hide_PIE" <?php 
    checked(weaver_getopt_checked('ttw_hide_PIE'));
    ?>
 />
    <label>Disable IE rounded corners support - </label><small>If you are having issues with IE and rounded corners, please disable this option.</small><br />

<br />
    <input type="checkbox" name="<?php 
    weaver_sapi_advanced_name('ttw_hide_editor_style');
    ?>
" id="ttw_hide_editor_style" <?php 
    checked(weaver_getopt_checked('ttw_hide_editor_style'));
    ?>
 />
	<label>Disable Page/Post Editor Styling - </label><small>Checking this box will disable the Weaver sub-theme based styling in the Page/Post editor.
	If you have a theme using transparent backgrounds, this option will likely improve the Post/Page editor visibility.</small><br />

    <input type="checkbox" name="<?php 
    weaver_sapi_advanced_name('ttw_show_preview');
    ?>
" id="ttw_show_preview" <?php 
    checked(weaver_getopt_checked('ttw_show_preview'));
    ?>
 />
	<label>Show Site Preview - </label><small>Checking this box will show a Site Preview at the bottom of the screen which might slow down response a bit.</small><br />

    <input type="checkbox" name="<?php 
    weaver_sapi_advanced_name('ttw_hide_updatemsg');
    ?>
" id="ttw_hide_updatemsg" <?php 
    checked(weaver_getopt_checked('ttw_hide_updatemsg'));
    ?>
 />
	<label>Hide Update Messages - </label><small>Checking this box will hide the Weaver version update announcements on the Weaver Admin page.</small><br />

    <input type="checkbox" name="<?php 
    weaver_sapi_advanced_name('ttw_hide_theme_thumbs');
    ?>
" id="ttw_hide_theme_thumbs" <?php 
    checked(weaver_getopt_checked('ttw_hide_theme_thumbs'));
    ?>
 />
	<label>Hide Theme Thumbnails - </label><small>Checking this box will hide the Sub-theme preview thumbnails on the Weaver Themes tab which might speed up response a bit.</small><br />

    <input type="checkbox" name="<?php 
    weaver_sapi_advanced_name('ttw_hide_auto_css_rules');
    ?>
" id="ttw_hide_auto_css_rules" <?php 
    checked(weaver_getopt_checked('ttw_hide_auto_css_rules'));
    ?>
 />
	<label>Don't auto-display CSS rules - </label><small>Checking this box will disable the auto-display of Main Option elements that have CSS settings.</small><br />

    <input name="<?php 
    weaver_sapi_advanced_name('ttw_css_rows');
    ?>
" id="ttw_css_rows" type="text" style="width:30px;height:20px;" class="regular-text" value="<?php 
    echo weaver_esc_textarea(weaver_getopt('ttw_css_rows'));
    ?>
" />
    <label>Set CSS+ text box height - </label><small>You can increase the default height of the CSS+ input area.</small>
<br />

    <input type="checkbox" name="<?php 
    weaver_sapi_advanced_name('ttw_notab_mainoptions');
    ?>
" id="ttw_notab_mainoptions" <?php 
    checked(weaver_getopt_checked('ttw_notab_mainoptions'));
    ?>
 />
	<label>Show All Main Options at once - </label><small>If you want to see all the main options at once (not displayed by tabs), check this box.</small><br />

    <input type="checkbox" name="<?php 
    weaver_sapi_advanced_name('ttw_force_inline_css');
    ?>
" id="ttw_force_inline_css" <?php 
    checked(weaver_getopt_checked('ttw_force_inline_css'));
    ?>
 />
	<label>Use Inline CSS - </label><small>Checking this box will have Weaver generate CSS inline rather than use the style-weaver.css external style sheet.</small><br />

<?php 
    if (get_option('ttw_options')) {
        ?>
	<input type="checkbox" name="<?php 
        weaver_sapi_advanced_name('wvr_hide_if_are_oldWeaver_opts');
        ?>
" id="wvr_hide_if_are_oldWeaver_opts" <?php 
        checked(weaver_getopt_checked('wvr_hide_if_are_oldWeaver_opts'));
        ?>
 />
	<label>Hide import notice if settings from old Weaver versions exist - </label><small>This option controls the display of the import old Weaver settings box.</small><br />
<?php 
    }
    $type = get_filesystem_method(array());
    if ($type == 'ftpext' && !function_exists('weaver_fileio_plugin')) {
        ?>
	<br /><br /><label><span style="color:#00f; font-weight:bold; font-size: larger;"><b>FTP File Access</b></span></label><br/>
	<p>Your system requires internal FTP access for full file access functionality. You do not have the Weaver File Access
	Plugin installed. If you don't have the ftp access credentials defined in your wp-config.php file, you will have options
	here to provide the required values.
<?php 
        if (!(defined('FTP_HOST') && defined('FTP_USER') && defined('FTP_PASS'))) {
            _e('Please enter your FTP credentials to proceed.', WEAVER_TRANSADMIN);
            echo ' ';
            _e('If you do not remember your credentials, you should contact your web host.', WEAVER_TRANSADMIN);
            echo "</p>\n";
            ?>
	<br /><label><?php 
            _e('Hostname', WEAVER_TRANSADMIN);
            ?>
: &nbsp;&nbsp;&nbsp;</label><input name="<?php 
            weaver_sapi_advanced_name('ftp_hostname');
            ?>
" id="ftp_hostname" type="text" style="width:300px;height:20px;" class="regular-text" value="<?php 
            echo weaver_esc_textarea(weaver_getopt('ftp_hostname'));
            ?>
" />
    <small>Specify the name of your host. Usually something like 'example.com'.</small>
    <br /><label><?php 
            echo __('FTP Username', WEAVER_TRANSADMIN);
            ?>
: </label><input name="<?php 
            weaver_sapi_advanced_name('ftp_username');
            ?>
" id="ftp_username" type="text" style="width:300px;height:20px;" class="regular-text" value="<?php 
            echo weaver_esc_textarea(weaver_getopt('ftp_username'));
            ?>
" />
    <small>Specify your FTP Username.</small>
    <br /><label><?php 
            _e('FTP Password', WEAVER_TRANSADMIN);
            ?>
: </label><input name="<?php 
            weaver_sapi_advanced_name('ftp_password');
            ?>
" id="ftp_password" type="password" style="width:300px;height:20px;" class="regular-text" value="<?php 
            echo weaver_esc_textarea(weaver_decrypt(weaver_getopt('ftp_password')));
            ?>
" />
    <small>Specify your FTP Password. This will be saved in an encrypted form.</small>
<br />
<?php 
        } else {
            ?>
	    <p><em>FTP Credentials used from your wp-config.php file.</em></p>
<?php 
        }
        ?>
<br /><label>Hide FTP Access Start up Dialog: </label>
<input type="checkbox" name="<?php 
        weaver_sapi_advanced_name('ftp_hide_check_message');
        ?>
" id="ftp_hide_check_message" <?php 
        checked(weaver_getopt_checked('ftp_hide_check_message'));
        ?>
 />
	<small>If you check this, then the FTP File Access message box will not be displayed when you enter Weaver Admin. Weaver will continue to operate in
	reduced functionality mode: no editor styling, no save/restore, Inline CSS.</small><br />
<?php 
    }
    ?>

    <br /><?php 
    weaver_sapi_submit('saveadvanced', 'Save All Advanced Options');
    ?>
<br /><br />
    <?php 
    /* The following three hidden inputs allow the SAPI to save the values. If you don't do this here, then the values will
       be set to false, and lost! SAPI is not tolerant of submitting a form that doesn't include every setting for the form group. */
    ?>
    <input name="<?php 
    weaver_sapi_advanced_name('ttw_subtheme');
    ?>
" id="ttw_subtheme" type="hidden" value="<?php 
    echo weaver_getopt('ttw_subtheme');
    ?>
" />
    <input name="<?php 
    weaver_sapi_advanced_name('ttw_theme_image');
    ?>
" id="ttw_theme_image" type="hidden" value="<?php 
    echo weaver_getopt('ttw_theme_image');
    ?>
" />
    <input name="<?php 
    weaver_sapi_advanced_name('ttw_theme_description');
    ?>
" id="ttw_theme_description" type="hidden" value="<?php 
    echo weaver_getopt('ttw_theme_description');
    ?>
" />
    <input name="<?php 
    weaver_sapi_advanced_name('ttw_themename');
    ?>
" id="ttw_themename" type="hidden" value="<?php 
    echo weaver_getopt('ttw_themename');
    ?>
" />
    <input name="<?php 
    weaver_sapi_advanced_name('ttw_version_id');
    ?>
" id="ttw_version_id" type="hidden" value="<?php 
    echo weaver_getopt('ttw_version_id');
    ?>
" />
    <input name="<?php 
    weaver_sapi_advanced_name('ttw_style_version');
    ?>
" id="ttw_style_version" type="hidden" value="<?php 
    echo weaver_getopt('ttw_style_version');
    ?>
" />

    <hr />
    <p><em>Note: </em>Clear all settings moved to Save/Restore tab<p>
<?php 
}
Ejemplo n.º 2
0
function weaver_put_main_options_form($weaver_olist, $submit_action, $submit_label)
{
    /* output a list of options - this really does the layout for the options defined in an array */
    weaver_sapi_form_top('weaver_main_settings_group', 'weaver_main_options_form');
    weaver_sapi_submit($submit_action, $submit_label);
    echo "&nbsp;&nbsp;<small>All \"" . $submit_label . "\" buttons save Main Options from <em>all</em> sub-tabs.</small><br>\n";
    ?>
<div><table>	<!-- open, empty tab div -->
<?php 
    foreach ($weaver_olist as $value) {
        if ($value['type'] == "text" || $value['type'] == 'widetext') {
            /* ============= text ============= */
            if ($value['type'] == 'text') {
                $twide = '60';
            } else {
                $twide = '140';
            }
            ?>
		<tr>
		<th scope="row" align="right"><?php 
            echo $value['name'];
            ?>
:&nbsp;</th>
		<td>
		<input name="<?php 
            weaver_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 weaver_esc_textarea(weaver_getopt($value['id']));
            ?>
" />
		</td>
		<?php 
            if ($value['info'] != '') {
                echo '<td style="padding-left: 10px"><small>';
                echo $value['info'];
                echo "</small></td>";
            }
            ?>
		</tr>
	<?php 
        } elseif ($value['type'] == "text_xy") {
            /* ============= text_xy ============= */
            ?>
		<tr>
		<th scope="row" align="right"><?php 
            echo $value['name'];
            ?>
:&nbsp;</th>
		<td>
		X:<input name="<?php 
            weaver_sapi_main_name($value['id'] . '_X');
            ?>
" id="<?php 
            echo $value['id'];
            ?>
_X" type="text" style="width:40px;height:20px;" class="regular-text" value="<?php 
            echo weaver_esc_textarea(weaver_getopt($value['id'] . '_X'));
            ?>
" />
		&nbsp;Y:<input name="<?php 
            weaver_sapi_main_name($value['id'] . '_Y');
            ?>
" id="<?php 
            echo $value['id'];
            ?>
_Y" type="text" style="width:40px;height:20px;" class="regular-text" value="<?php 
            echo weaver_esc_textarea(weaver_getopt($value['id'] . '_Y'));
            ?>
" />
		</td>
		<?php 
            if ($value['info'] != '') {
                echo '<td style="padding-left: 10px"><small>';
                echo $value['info'];
                echo "</small></td>";
            }
            ?>
		</tr>
	<?php 
        } elseif ($value['type'] == "ctext") {
            /* ============= ctext ============= */
            $pclass = 'color {hash:true, adjust:false}';
            // starting with V 1.3, allow text in color pickers
            $img_css = '<img src="' . get_template_directory_uri() . '/images/weaver/css.png" />';
            $img_hide = get_template_directory_uri() . '/images/weaver/hide.png';
            $img_show = get_template_directory_uri() . '/images/weaver/show.png';
            $help_file = get_template_directory_uri() . '/css-help.html';
            $css_id = $value['id'] . '_css';
            $css_id_text = weaver_getopt($css_id);
            if ($css_id_text && !weaver_getopt('ttw_hide_auto_css_rules')) {
                $img_toggle = $img_hide;
            } else {
                $img_toggle = $img_show;
            }
            ?>
		<tr>
		<th scope="row" align="right"><?php 
            echo $value['name'];
            ?>
:&nbsp;</th>
		<td>
		<input class="<?php 
            echo $pclass;
            ?>
" name="<?php 
            weaver_sapi_main_name($value['id']);
            ?>
" id="<?php 
            echo $value['id'];
            ?>
" type="text" style="width:110px" value="<?php 
            if (weaver_getopt($value['id']) != "") {
                echo weaver_esc_textarea(weaver_getopt($value['id']));
            } else {
                echo WEAVER_DEFAULT_COLOR;
            }
            ?>
" />
		<?php 
            echo $img_css;
            ?>
<a href="javascript:void(null);"
			onclick="wvr_ToggleRowCSS(document.getElementById('<?php 
            echo $css_id . '_js';
            ?>
'), this, '<?php 
            echo $img_show;
            ?>
', '<?php 
            echo $img_hide;
            ?>
')"><?php 
            echo '<img src="' . $img_toggle . '" />';
            ?>
</a>
		</td>
		<?php 
            if ($value['info'] != '') {
                echo '<td style="padding-left: 10px"><small>';
                echo $value['info'];
                echo "</small></td>";
            }
            ?>
		</tr>
		<?php 
            $css_rows = weaver_getopt('ttw_css_rows');
            if ($css_rows < 1 || $css_rows > 25) {
                $css_rows = 1;
            }
            ?>
		<?php 
            if ($css_id_text && !weaver_getopt('ttw_hide_auto_css_rules')) {
                ?>
		<tr id="<?php 
                echo $css_id . '_js';
                ?>
">
		<th scope="row" align="right"><span style="color:green;"><small>Custom CSS styling:</small></span></th>
		<td align="right"><small>&nbsp;</small></td>
		<td>
		    <small>You can enter CSS rules, enclosed in {}'s, and separated by <strong>;</strong>.
		    See <a href="<?php 
                echo $help_file;
                ?>
" target="_blank">CSS Help</a> for more details.</small><br />
		    <textarea name="<?php 
                weaver_sapi_main_name($css_id);
                ?>
" rows=<?php 
                echo $css_rows;
                ?>
 style="width: 85%"><?php 
                echo weaver_esc_textarea($css_id_text);
                ?>
</textarea>
		</td></tr>
		<?php 
            } else {
                ?>
		<tr id="<?php 
                echo $css_id . '_js';
                ?>
" style="display:none;">
		<th scope="row" align="right"><span style="color:green;"><small>Custom CSS styling:</small></span></th>
		<td align="right"><small>&nbsp;</small></td>
		<td>
		    <small>You can enter CSS rules, enclosed in {}'s, and separated by <strong>;</strong>.
		    See <a href="<?php 
                echo $help_file;
                ?>
" target="_blank">CSS Help</a> for more details.</small><br />
		    <textarea name="<?php 
                weaver_sapi_main_name($css_id);
                ?>
" rows=<?php 
                echo $css_rows;
                ?>
 style="width: 85%"><?php 
                echo weaver_esc_textarea($css_id_text);
                ?>
</textarea>
		</td></tr>
		<?php 
            }
            ?>
	<?php 
        } elseif ($value['type'] == "checkbox") {
            /* ============= checkbox ============= */
            ?>
		<tr>
		<th scope="row" align="right"><?php 
            echo $value['name'];
            ?>
:&nbsp;</th>
		<td>
		<input type="checkbox" name="<?php 
            weaver_sapi_main_name($value['id']);
            ?>
" id="<?php 
            echo $value['id'];
            ?>
"
		  <?php 
            checked(weaver_getopt_checked($value['id']));
            ?>
 >
		</td>
		<?php 
            if ($value['info'] != '') {
                echo '<td style="padding-left: 10px"><small>';
                echo $value['info'];
                echo "</small></td>";
            }
            ?>
		</tr>
	<?php 
        } elseif ($value['type'] == "select") {
            /* ============= select ============= */
            ?>
		<tr>
		<th scope="row" align="right"><?php 
            echo $value['name'];
            ?>
:&nbsp;</th>
		<td>
		<select name="<?php 
            weaver_sapi_main_name($value['id']);
            ?>
" id="<?php 
            echo $value['id'];
            ?>
">
                <?php 
            foreach ($value['value'] as $option) {
                ?>
                <option<?php 
                if (weaver_getopt($value['id']) == $option) {
                    echo ' selected="selected"';
                }
                ?>
><?php 
                echo $option;
                ?>
</option>
                <?php 
            }
            ?>
		</select>
		</td>

		<?php 
            if ($value['info'] != '') {
                echo '<td style="padding-left: 10px"><small>';
                echo $value['info'];
                echo "</small></td>";
            }
            ?>
		</tr>
        <?php 
        } elseif ($value['type'] == "imgselect") {
            /* ============= imgselect ============= */
            /* special handling of bullet images - will add the bullet image to each item */
            ?>
		<tr>
		<th scope="row" align="right"><?php 
            echo $value['name'];
            ?>
:&nbsp;</th>
		<td>
		<select name="<?php 
            echo weaver_sapi_main_name($value['id']);
            ?>
" id="<?php 
            echo $value['id'];
            ?>
">
                <?php 
            foreach ($value['value'] as $opt) {
                $img = get_template_directory_uri() . '/images/bullets/' . $opt . '.gif';
                if ($opt == '') {
                    /* special case - the empty default option */
                    $style = '';
                } else {
                    $style = ' style="background-image:url(' . $img . ');background-repeat:no-repeat;padding-left:16px;height:16px;line-height:16px;"';
                }
                if (weaver_getopt($value['id']) == $opt) {
                    $sel = ' selected="selected" ';
                } else {
                    $sel = '';
                }
                printf('<option%s%s>%s</option>', $sel, $style, $opt);
                echo "\n";
            }
            ?>
                </select>
		</td>
		<?php 
            if ($value['info'] != '') {
                echo '<td style="padding-left: 10px"><small>';
                echo $value['info'];
                echo "</small></td>";
            }
            ?>
		</tr>
	<?php 
        } elseif ($value['type'] == "note") {
            /* ============= note ============= */
            ?>
		<tr>
		<th scope="row" align="right">&nbsp;</th>
		<td style="float:right;font-weight:bold;"><?php 
            echo $value['name'];
            ?>
&nbsp;</td>
		<?php 
            if ($value['info'] != '') {
                echo '<td style="padding-left: 10px"><small>';
                echo $value['info'];
                echo "</small></td>";
            }
            ?>
		</tr>

	<?php 
        } elseif ($value['type'] == "header") {
            /* ============= header ============= */
            ?>
</table></div>	<!-- close tab -->
<div id="<?php 
            echo $value['id'];
            ?>
" class="tab_mainopt" >
<table class="optiontable" style="margin-top:6px;">
		<tr>
		<th scope="row" align="left" style="width:25%;"><?php 
            /* NO SAPI SETTING */
            echo '<span style="color:blue; font-weight:bold; font-size: larger;"><em>' . $value['name'] . '</em></span>';
            if (!empty($value['value'])) {
                weaver_help_link($value['value'], 'Help for ' . $value['name']);
            }
            ?>
		</th>
		<td style="width:170px;">&nbsp;</td>
		<?php 
            if ($value['info'] != '') {
                // has own nonce
                echo '<td style="padding-left: 10px"><u><em><strong>';
                echo $value['info'];
                echo "</strong></em></u></td>\n";
            }
            ?>
		</tr>
	<?php 
        }
    }
    ?>
</table></div> <!-- close previous tab div -->
 	<br />
	<?php 
    weaver_sapi_submit($submit_action, $submit_label);
    ?>
	<br /><br />
<?php 
    weaver_sapi_form_bottom('weaver_main_options_form');
}