示例#1
0
function weaver_advanced_admin()
{
    ?>

<div id="tabwrap_adv" style="padding-left:5px;">
    <div id="tab-container-adv" class='yetiisub'>
	<ul id="tab-container-adv-nav" class='yetiisub'>
<?php 
    if (weaver_allow_multisite()) {
        ?>
	    <li><a href="#adtab0"><?php 
        echo __('&lt;HEAD&gt; Section', WEAVER_TRANSADMIN);
        ?>
</a></li>
	    <li><a href="#adtab1"><?php 
        echo __('HTML Insertion', WEAVER_TRANSADMIN);
        ?>
</a></li>
<?php 
    }
    ?>
	    <li><a href="#adtab2"><?php 
    echo __('Page Template Options', WEAVER_TRANSADMIN);
    ?>
</a></li>
<?php 
    if (weaver_allow_multisite()) {
        ?>
	    <li><a href="#adtab3"><?php 
        echo __('Site Options', WEAVER_TRANSADMIN);
        ?>
</a></li>
<?php 
    }
    ?>
	    <li><a href="#adtab4"><?php 
    echo __('Shortcodes', WEAVER_TRANSADMIN);
    ?>
</a></li>
	    <li><a href="#adtab5"><?php 
    echo __('Administrative', WEAVER_TRANSADMIN);
    ?>
</a></li>
	</ul>

        <?php 
    weaver_sapi_form_top('weaver_advanced_settings_group', 'ttw_advanced_options_form');
    ?>
	    <h3>Advanced Options
<?php 
    weaver_help_link('help.html#AdvancedOptions', 'Help for Advanced Options');
    ?>
</h3>
<?php 
    /*
    	    <div style="float:right; width:33%; border:1px solid #888; padding-left:8px;"><small>Are you a professional website designer?
    	    If Weaver is helping you do your job, please make a donation to this theme!</small></div> */
    weaver_sapi_submit('saveadvanced', 'Save All Advanced Options');
    ?>
<br /><br />

<!-- ***************************************************** -->
<div id="adtab0" class="tab_adv" >
    <?php 
    weaver_adv_head_section();
    ?>
</div> <!-- adtab 0 -->

<!-- ***************************************************** -->
<?php 
    if (weaver_allow_multisite()) {
        ?>
<div id="adtab1" class="tab_adv" >
    <?php 
        weaver_adv_html_insert();
        ?>
</div> <!-- adtab1 -->
<?php 
    }
    // end of major section of not allowed on multisite
    ?>

<!-- ***************************************************** -->
<div id="adtab2" class="tab_adv" >
    <?php 
    weaver_adv_page_template();
    ?>
</div> <!-- adtab2 -->

<!-- ***************************************************** -->
<?php 
    if (weaver_allow_multisite()) {
        ?>
<div id="adtab3" class="tab_adv" >
    <?php 
        weaver_adv_site_opts();
        ?>
</div> <!-- site options -->
<?php 
    }
    ?>

<!-- ***************************************************** -->
<div id="adtab4" class="tab_adv" >
    <?php 
    weaver_adv_wvr_shortcodes();
    ?>
</div> <!-- shortcodes -->

<!-- ***************************************************** -->
<div id="adtab5" class="tab_adv" >
    <?php 
    weaver_adv_admin_opts();
    ?>
</div> <!-- admin -->

<?php 
    weaver_sapi_form_bottom('ttw_advanced_options_form');
    // can't cross divs (IE9)
    ?>

</div> <!-- tab-container-adv -->
</div> <!-- #tabwrap_adv-->

<script type="text/javascript">
	var tabberAdv = new Yetii({
	id: 'tab-container-adv',
	tabclass: 'tab_adv',
	persist: true
	});
</script>
<hr />
<?php 
}
示例#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');
}