settings.php 1.81 KB
<?php
namespace Tz\WordPress\Tools\HybridGallery;
?>

<div id="ChatterBox_AdminContainer" class="wrap">
    <?php screen_icon(); ?>
    <h2>Hybrid Gallery Settings</h2>
    
    <form method="post" action="options.php">
        
        <?php
        settings_fields(SETTINGS_NS);
        ?>
        
        
        <table cellspacing="0" class="widefat post fixed" style="margin-top:15px;">
            <thead>
                <tr>
                    <th scope="col" width="200" class="manage-column">Option</th>
                    <th scope="col" class="manage-column">Description/Usage</th>
                    <th scope="col" width="100" class="manage-column">Default Value</th>
                    <th scope="col" width="140" class="manage-column">Your Value</th>
                </tr>
            </thead>
            <tbody>
                <?php foreach($defaults as $option=>$item): 
                $wp_option = SETTINGS_NS . '[' . $option . ']';
                ?>
                    <tr>
                        <td><strong><?php echo $option; ?></strong></td>
                        <td><?php echo $item[1]; ?><br /><span style="color:#999;"><?php echo ($item[2]=="optional") ? "(optional)" : "(required)"; ?></span> <?php if($item[3]):?><strong>Shortcode Usage:</strong> [HybridGallery <?php echo $option; ?>="<?php echo $item[0]; ?>"]<?php endif;?></td>
                        <td><?php echo $item[0]; ?></td>
                        <td><input type="text" name="<?php echo $wp_option; ?>" value="<?php echo Vars::$WP_Settings[$option]; ?>" style="width:120px;" /></td>
                    </tr>
                <?php endforeach; ?>
            </tbody>
        </table>
        <p class="submit" style="margin-top:5px;padding-top:0px;"><input type="submit" class="button-primary" value="Save Changes" /></p>
    </form>
    
</div>