GMMediaTags.class.php
10 years ago
GMMediaTags.js
10 years ago
GMMediaTagsAdmin.class.php
10 years ago
options.php
9 years ago
types.php
8 years ago
options.php
88 lines
| 1 | <?php |
| 2 | /*************************/ |
| 3 | /********* OPTIONS *******/ |
| 4 | /*************************/ |
| 5 | |
| 6 | function folders_admin_page(){ |
| 7 | add_menu_page('Folder Settings', 'Folder Settings', 'publish_pages', 'folders-settings', 'folders_admin_page_callback', 'dashicons-category'); |
| 8 | } |
| 9 | add_action('admin_menu', 'folders_admin_page'); |
| 10 | |
| 11 | function folders_register_settings(){ |
| 12 | register_setting('folders_settings', 'folders_settings', 'folders_settings_validate'); |
| 13 | } |
| 14 | add_action('admin_init', 'folders_register_settings'); |
| 15 | |
| 16 | function folders_settings_validate($args){ |
| 17 | return $args; |
| 18 | } |
| 19 | |
| 20 | function folders_admin_notices(){ |
| 21 | settings_errors(); |
| 22 | } |
| 23 | add_action('admin_notices', 'folders_admin_notices'); |
| 24 | |
| 25 | function folders_admin_page_callback(){ |
| 26 | global $globOptions; |
| 27 | ?> |
| 28 | <style> |
| 29 | #side-info-column { |
| 30 | width: 250px; |
| 31 | float: right; |
| 32 | } |
| 33 | #side-info-column h3 { |
| 34 | margin: 10px; |
| 35 | } |
| 36 | .form-table th { |
| 37 | width: 250px; |
| 38 | } |
| 39 | </style> |
| 40 | <div class="wrap"> |
| 41 | <h2>Folder Settings</h2> |
| 42 | <form style="width: 300px; float:left" action="options.php" method="post"><?php |
| 43 | settings_fields( 'folders_settings' ); |
| 44 | do_settings_sections( __FILE__ ); |
| 45 | |
| 46 | $options = $globOptions; ?> |
| 47 | <table class="form-table"> |
| 48 | <?php |
| 49 | $args = array( |
| 50 | 'public' => true |
| 51 | ); |
| 52 | $postTypes = get_post_types($args); |
| 53 | foreach ($postTypes as $type) { ?> |
| 54 | <tr> |
| 55 | <th scope="row"><label for="folders4<?php echo $type; ?>">Use Folders with <?php echo ucfirst($type); ?></label></th> |
| 56 | <td> |
| 57 | <fieldset> |
| 58 | <input name="folders_settings[folders4<?php echo $type; ?>]" type="checkbox" id="folders4<?php echo $type; ?>" value="1" <?php if (!empty($options['folders4'.$type]) && $options['folders4'.$type] == 1) {echo 'checked';} ?>/> |
| 59 | <br /> |
| 60 | </fieldset> |
| 61 | </td> |
| 62 | </tr> |
| 63 | <?php } ?> |
| 64 | </table> |
| 65 | <?php submit_button(); ?> |
| 66 | </form> |
| 67 | <div id="side-info-column"> |
| 68 | <div class="postbox"> |
| 69 | <h3><span>Donate</span></h3> |
| 70 | <div class="inside"> |
| 71 | <p>Please consider donating a small amount to help us keep Folders in development.</p> |
| 72 | <a href="http://62design.co.uk/wordpress-plugins/folders/" target="_blank">Click here to donate</a> |
| 73 | </div> |
| 74 | </div> |
| 75 | </div> |
| 76 | |
| 77 | <div id="side-info-column" style="clear:right;"> |
| 78 | <div class="postbox"> |
| 79 | <h3><span>Rate Folders</span></h3> |
| 80 | <div class="inside"> |
| 81 | <strong>Please Rate Folders on WordPress</strong> |
| 82 | <p><a href="https://wordpress.org/support/view/plugin-reviews/folders">Click to rate folders plugin</a></p> |
| 83 | </div> |
| 84 | </div> |
| 85 | </div> |
| 86 | </div> |
| 87 | <?php } |
| 88 |