コード例 #1
0
function weaverii_hide_advanced_optval($opt = '')
{
    if (weaverii_getopt('hide_advanced') == 'hide') {
        if ($opt != '') {
            weaverii_adv_hidden_opt($opt);
            // needs a hidden field
        }
        return true;
    } else {
        return false;
    }
}
コード例 #2
0
function weaverii_add_html_field($title, $name, $info, $help = '')
{
    if ($name == 'submit') {
        weaverii_sapi_submit('', "<br /><br />\n");
        return;
    }
    $pro = weaverii_fix_type($name);
    if ($name[0] == '+') {
        $name = substr($name, 1);
    }
    // fix locally
    $area_name = 'wii_' . $name . '_insert';
    $hide_front = 'wii_hide_front_' . $name;
    $hide_rest = 'wii_hide_rest_' . $name;
    $style_id = 'inject_' . $name;
    $val = array('name' => $title . ' BG', 'id' => $style_id . '_bgcolor', 'info' => 'BG Color for area', 'help' => '');
    if ($pro == 'inactive') {
        if ($title[0] == '#') {
            $title = substr($title, 4);
        }
        ?>
<div class="wvr-option-subheader"><span style="color:#999;"><b><?php 
        echo $title;
        ?>
</b> - (Pro Version)</span><br /></div><br />
<?php 
        if ($info) {
            echo '<span style="color:#999;">' . $info . "<br /> <br />\n";
        }
        weaverii_adv_hidden_opt($area_name);
        // keep it working for Pro settings, even on free version
        weaverii_adv_hidden_opt($hide_front);
        weaverii_adv_hidden_opt($hide_rest);
        if ($info) {
            echo '</span>';
        }
        return;
    }
    ?>
<div class="wvr-option-subheader"><span style="color:blue;"><b><?php 
    echo $title;
    ?>
</b></span></div><br />
<?php 
    if ($info) {
        echo $info;
    }
    if ($style_id == 'inject_postpostcontent') {
        echo " (Style with <em>class</em> <code>.{$style_id}</code>.)";
    } else {
        echo " (Style with <code>#{$style_id}</code>.)";
    }
    ?>
	<br />
	<textarea name="<?php 
    weaverii_sapi_main_name($area_name);
    ?>
" rows=3 style="width: 95%"><?php 
    weaverii_esc_textarea(weaverii_getopt($area_name));
    ?>
</textarea>
	<br />
<?php 
    echo '<table>';
    weaverii_form_row_ctext($val);
    echo '</table>';
    ?>
	<label>Hide on front page: <input type="checkbox" name="<?php 
    weaverii_sapi_main_name($hide_front);
    ?>
" id="<?php 
    echo $hide_front;
    ?>
" <?php 
    checked(weaverii_getopt_checked($hide_front));
    ?>
 /></label>
	<small>If you check this box, then the code from this area will not be displayed on the front (home) page.</small><br />
	<label>Hide on non-front pages: <input type="checkbox" name="<?php 
    weaverii_sapi_main_name($hide_rest);
    ?>
" id="<?php 
    echo $hide_rest;
    ?>
" <?php 
    checked(weaverii_getopt_checked($hide_rest));
    ?>
 /></label>
	<small>If you check this box, then the code from this area will not be displayed on non-front pages.</small>
<?php 
    if ($name == 'footer') {
        ?>
<br /><label>Move to before widget areas: <input type="checkbox" name="<?php 
        weaverii_sapi_main_name('wii_footer_inject_move');
        ?>
" id="wii_footer_inject_move" <?php 
        checked(weaverii_getopt_checked('wii_footer_inject_move'));
        ?>
 /></label>
	<small>If you check this box, then the code from this area will be inserted <em>before</em> the footer widgets instead of after.</small>
<?php 
    }
    ?>
	<br /><br />
<?php 
}