示例#1
0
function gplus_theme_options_do_page()
{
    global $gplus_items;
    if (gplus_is_post()) {
        echo 111;
    }
    if (!isset($_REQUEST['updated'])) {
        $_REQUEST['updated'] = false;
    }
    ?>
<div class=wrap><?php 
    screen_icon();
    echo "<h2>" . sprintf(__('%1$s Theme Options', 'gplus'), get_current_theme()) . "</h2>";
    if (false !== $_REQUEST['updated']) {
        ?>
<div class="updated fade"><p><strong><?php 
        _e('Options saved', 'gplus');
        ?>
</strong></p></div><?php 
    }
    ?>
<form method=post action=options.php><?php 
    settings_fields('gplus_options');
    $options = get_option('gplus_options');
    ?>
<table class=form-table><?php 
    foreach ($gplus_items as $item) {
        ?>
<tr valign=top style="margin:0 10px;border-bottom:1px solid #ddd;"><th scope=row><?php 
        echo $item['name'];
        ?>
</th><td><?php 
        if ($item['type'] == 'radio') {
            if ($item['id'] == 'js_framework') {
                ?>
<input name="<?php 
                echo 'gplus_options[' . $item['id'] . ']';
                ?>
" type="<?php 
                echo $item['type'];
                ?>
" value="" <?php 
                if (!$options[$item['id']]) {
                    ?>
 checked <?php 
                }
                ?>
> jquery&nbsp;&nbsp;<input name="<?php 
                echo 'gplus_options[' . $item['id'] . ']';
                ?>
" type="<?php 
                echo $item['type'];
                ?>
" value=qwrap <?php 
                if ($options[$item['id']] == 'qwrap') {
                    ?>
 checked <?php 
                }
                ?>
> qwrap&nbsp;&nbsp;<input name="<?php 
                echo 'gplus_options[' . $item['id'] . ']';
                ?>
" type="<?php 
                echo $item['type'];
                ?>
" value=kissy <?php 
                if ($options[$item['id']] == 'kissy') {
                    ?>
 checked <?php 
                }
                ?>
> kissy<?php 
            } else {
                ?>
<input name="<?php 
                echo 'gplus_options[' . $item['id'] . ']';
                ?>
" type="<?php 
                echo $item['type'];
                ?>
" value="" <?php 
                if (!$options[$item['id']]) {
                    ?>
 checked <?php 
                }
                ?>
> none&nbsp;&nbsp;<input name="<?php 
                echo 'gplus_options[' . $item['id'] . ']';
                ?>
" type="<?php 
                echo $item['type'];
                ?>
" value=fade <?php 
                if ($options[$item['id']] == 'fade') {
                    ?>
 checked <?php 
                }
                ?>
> fade<?php 
            }
        } elseif ($item['type'] == 'checkbox') {
            ?>
<input name="<?php 
            echo 'gplus_options[' . $item['id'] . ']';
            ?>
" type="<?php 
            echo $item['type'];
            ?>
" value=true <?php 
            if ($options[$item['id']]) {
                ?>
 checked <?php 
            }
            ?>
 size=80><?php 
        } elseif ($item['type'] == 'textarea') {
            ?>
<textarea style="width:500px"  name="<?php 
            echo 'gplus_options[' . $item['id'] . ']';
            ?>
" rows="8" cols="50"><?php 
            if ($options[$item['id']]) {
                echo gplus_stripvalue($options[$item['id']]);
            } else {
                echo gplus_stripvalue($item['default_value']);
            }
            ?>
</textarea><?php 
        } else {
            ?>
<input style=width:500px name="<?php 
            echo 'gplus_options[' . $item['id'] . ']';
            ?>
" type="<?php 
            echo $item['type'];
            ?>
" <?php 
            if ($options[$item['id']] != "") {
                ?>
 value="<?php 
                echo $options[$item['id']];
                ?>
" <?php 
            } else {
                ?>
 value="" <?php 
            }
            ?>
 size=80><?php 
        }
        ?>
<br><label class=description for="<?php 
        echo 'gplus_options[' . $item['id'] . ']';
        ?>
"><?php 
        echo $item['desc'];
        ?>
</label><?php 
    }
    ?>
</table><p class=submit><input type=submit class=button-primary value="<?php 
    _e('Save Options', 'gplus');
    ?>
"></p></form></div><?php 
}
示例#2
0
true<?php 
    }
    ?>
, pjaxCacheTime=<?php 
    if (strlen($options['cache_time'])) {
        echo intval($options['cache_time']);
    } else {
        ?>
true<?php 
    }
    ?>
, pjaxFx="<?php 
    echo $options['show_fx'];
    ?>
",pjaxCallback=function(){try{<?php 
    echo $options['callback_function'] ? gplus_stripvalue($options['callback_function']) : ';';
    ?>
}catch(e){}}</script>
	<?php 
    if ($options['js_framework'] == 'qwrap') {
        ?>
		<script src="<?php 
        echo get_stylesheet_directory_uri(true);
        ?>
/js/qwrap.all.js?v=<?php 
        echo gplus_version();
        ?>
"></script>
	<?php 
    } elseif ($options['js_framework'] == 'kissy') {
        ?>