| 1 | <?php |
|---|
| 2 | include_once('RCCWP_Options.php'); |
|---|
| 3 | |
|---|
| 4 | class RCCWP_OptionsPage |
|---|
| 5 | { |
|---|
| 6 | |
|---|
| 7 | function Main() |
|---|
| 8 | { |
|---|
| 9 | $customWritePanels = RCCWP_CustomWritePanel::GetCustomWritePanels(); |
|---|
| 10 | $customWritePanelOptions = RCCWP_Options::Get(); |
|---|
| 11 | |
|---|
| 12 | if (function_exists('is_site_admin') && !is_site_admin()) |
|---|
| 13 | update_option("Flutter_notTopAdmin", true); |
|---|
| 14 | else |
|---|
| 15 | update_option("Flutter_notTopAdmin", false); |
|---|
| 16 | |
|---|
| 17 | ?> |
|---|
| 18 | |
|---|
| 19 | <div class="wrap"> |
|---|
| 20 | |
|---|
| 21 | <h2>Flutter Options</h2> |
|---|
| 22 | |
|---|
| 23 | <form action="" method="post" id="custom-write-panel-options-form"> |
|---|
| 24 | |
|---|
| 25 | |
|---|
| 26 | <h3>Write Panel Options</h3> |
|---|
| 27 | <table class="form-table" width="100%" border="0" cellspacing="0" cellpadding="6"> |
|---|
| 28 | |
|---|
| 29 | <tr valign="top"> |
|---|
| 30 | <th scope="row">Hide Post Panel</th> |
|---|
| 31 | <td> |
|---|
| 32 | <label for="hide-write-post"> |
|---|
| 33 | <input name="hide-write-post" id="hide-write-post" value="1" <?php echo RCCWP_OptionsPage::GetCheckboxState($customWritePanelOptions['hide-write-post'])?> type="checkbox"> |
|---|
| 34 | Hide Wordpress Post panel</label> |
|---|
| 35 | </td> |
|---|
| 36 | </tr> |
|---|
| 37 | |
|---|
| 38 | <tr valign="top"> |
|---|
| 39 | <th scope="row">Hide Page Panel</th> |
|---|
| 40 | <td> |
|---|
| 41 | <label for="hide-write-page"> |
|---|
| 42 | <input name="hide-write-page" id="hide-write-page" value="1" <?php echo RCCWP_OptionsPage::GetCheckboxState($customWritePanelOptions['hide-write-page'])?> type="checkbox"> |
|---|
| 43 | Hide Wordpress Page panel</label> |
|---|
| 44 | </td> |
|---|
| 45 | </tr> |
|---|
| 46 | |
|---|
| 47 | <tr valign="top"> |
|---|
| 48 | <th scope="row">Editing Prompt</th> |
|---|
| 49 | <td> |
|---|
| 50 | <label for="prompt-editing-post"> |
|---|
| 51 | <input name="prompt-editing-post" id="prompt-editing-post" value="1" <?php echo RCCWP_OptionsPage::GetCheckboxState($customWritePanelOptions['prompt-editing-post'])?> type="checkbox"> |
|---|
| 52 | Prompt when editing a Post not created with Custom Write Panel.</label> |
|---|
| 53 | </td> |
|---|
| 54 | </tr> |
|---|
| 55 | |
|---|
| 56 | <tr valign="top"> |
|---|
| 57 | <th scope="row">Assign to Role</th> |
|---|
| 58 | <td> |
|---|
| 59 | <label for="assign-to-role"> |
|---|
| 60 | <input name="assign-to-role" id="assign-to-role" value="1" <?php echo RCCWP_OptionsPage::GetCheckboxState($customWritePanelOptions['assign-to-role'])?> type="checkbox"> |
|---|
| 61 | This option will create a capability for each write panel such that the write panel is accessible by the Administrator only by default. |
|---|
| 62 | You can assign the write panel to other roles using </label><a target="_blank" href="http://sourceforge.net/projects/role-manager">Role Manager Plugin</a>. |
|---|
| 63 | </td> |
|---|
| 64 | </tr> |
|---|
| 65 | |
|---|
| 66 | <tr valign="top"> |
|---|
| 67 | <th scope="row">Default Panel</th> |
|---|
| 68 | <td> |
|---|
| 69 | |
|---|
| 70 | <label for="default-custom-write-panel"> |
|---|
| 71 | <select name="default-custom-write-panel" id="default-custom-write-panel"> |
|---|
| 72 | <option value="">(None)</option> |
|---|
| 73 | <?php |
|---|
| 74 | $defaultCustomWritePanel = $customWritePanelOptions['default-custom-write-panel']; |
|---|
| 75 | foreach ($customWritePanels as $panel) : |
|---|
| 76 | $selected = $panel->id == $defaultCustomWritePanel ? 'selected="selected"' : ''; |
|---|
| 77 | ?> |
|---|
| 78 | <option value="<?php echo $panel->id?>" <?php echo $selected?>><?php echo $panel->name?></option> |
|---|
| 79 | <?php |
|---|
| 80 | endforeach; |
|---|
| 81 | ?> |
|---|
| 82 | </select> |
|---|
| 83 | </label> |
|---|
| 84 | |
|---|
| 85 | </td> |
|---|
| 86 | </tr> |
|---|
| 87 | |
|---|
| 88 | </table> |
|---|
| 89 | |
|---|
| 90 | |
|---|
| 91 | <br /> |
|---|
| 92 | <h3>Layout Options</h3> |
|---|
| 93 | <p>Allows you to add modules to the blog.</p> |
|---|
| 94 | <table class="form-table" width="100%" border="0" cellspacing="0" cellpadding="6"> |
|---|
| 95 | |
|---|
| 96 | <tr valign="top"> |
|---|
| 97 | <th scope="row">Layout Tab</th> |
|---|
| 98 | <td> |
|---|
| 99 | <label for="canvas_show"> |
|---|
| 100 | <input name="canvas_show" id="canvas_show" value="1" <?php echo RCCWP_OptionsPage::GetCheckboxState($customWritePanelOptions['canvas_show'])?> type="checkbox"> |
|---|
| 101 | Show Layout tab.</label> |
|---|
| 102 | </td> |
|---|
| 103 | </tr> |
|---|
| 104 | |
|---|
| 105 | |
|---|
| 106 | <tr valign="top"> |
|---|
| 107 | <th scope="row">Style Tab</th> |
|---|
| 108 | <td> |
|---|
| 109 | <label for="ink_show"> |
|---|
| 110 | <input name="ink_show" id="ink_show" value="1" <?php echo RCCWP_OptionsPage::GetCheckboxState($customWritePanelOptions['ink_show'])?> type="checkbox"> |
|---|
| 111 | Show Style tab.</label> |
|---|
| 112 | </td> |
|---|
| 113 | </tr> |
|---|
| 114 | |
|---|
| 115 | |
|---|
| 116 | <tr valign="top"> |
|---|
| 117 | <th scope="row">Layout Instructions</th> |
|---|
| 118 | <td> |
|---|
| 119 | <label for="canvas_show_instructions"> |
|---|
| 120 | <input name="canvas_show_instructions" id="canvas_show_instructions" value="1" <?php echo RCCWP_OptionsPage::GetCheckboxState($customWritePanelOptions['canvas_show_instructions'])?> type="checkbox"> |
|---|
| 121 | Display the instructions on the Layout page.</label> |
|---|
| 122 | </td> |
|---|
| 123 | </tr> |
|---|
| 124 | |
|---|
| 125 | |
|---|
| 126 | <tr valign="top"> |
|---|
| 127 | <th scope="row">Zones Names</th> |
|---|
| 128 | <td> |
|---|
| 129 | <label for="canvas_show_zone_name"> |
|---|
| 130 | <input name="canvas_show_zone_name" id="canvas_show_zone_name" value="1" <?php echo RCCWP_OptionsPage::GetCheckboxState($customWritePanelOptions['canvas_show_zone_name'])?> type="checkbox"> |
|---|
| 131 | Show zones names on droppable zones.</label> |
|---|
| 132 | </td> |
|---|
| 133 | </tr> |
|---|
| 134 | |
|---|
| 135 | </table> |
|---|
| 136 | |
|---|
| 137 | <?php if (version_compare(PHP_VERSION, '5.0.0') === 1){ ?> |
|---|
| 138 | <br /> |
|---|
| 139 | <h3>HTML Purifier</h3> |
|---|
| 140 | <p>Ensures the post is valid XHTML. (php5 only)</p> |
|---|
| 141 | <table class="form-table" width="100%" border="0" cellspacing="0" cellpadding="6"> |
|---|
| 142 | |
|---|
| 143 | <tr valign="top"> |
|---|
| 144 | <th scope="row">HTML Purifier</th> |
|---|
| 145 | <td> |
|---|
| 146 | <label for="enable-HTMLPurifier"> |
|---|
| 147 | <input name="enable-HTMLPurifier" id="enable-HTMLPurifier" value="1" <?php echo RCCWP_OptionsPage::GetCheckboxState($customWritePanelOptions['enable-HTMLPurifier'])?> type="checkbox"> |
|---|
| 148 | Enable HTML Purifier.</label> |
|---|
| 149 | </td> |
|---|
| 150 | </tr> |
|---|
| 151 | |
|---|
| 152 | <tr valign="top"> |
|---|
| 153 | <th scope="row">Tidy level</th> |
|---|
| 154 | <td> |
|---|
| 155 | <select name="tidy-level" id="tidy-level"> |
|---|
| 156 | <option <?php if ('none' == $customWritePanelOptions['tidy-level']) echo "selected"; ?> value="none">none</option> |
|---|
| 157 | <option <?php if ('light' == $customWritePanelOptions['tidy-level']) echo "selected"; ?> value="light">light</option> |
|---|
| 158 | <option <?php if ('medium' == $customWritePanelOptions['tidy-level']) echo "selected"; ?> value="medium">medium</option> |
|---|
| 159 | <option <?php if ('heavy' == $customWritePanelOptions['tidy-level']) echo "selected"; ?> value="heavy">heavy</option> |
|---|
| 160 | </select> |
|---|
| 161 | </td> |
|---|
| 162 | </tr> |
|---|
| 163 | |
|---|
| 164 | </table> |
|---|
| 165 | <?php } ?> |
|---|
| 166 | |
|---|
| 167 | <br /> |
|---|
| 168 | <h3>Other Options</h3> |
|---|
| 169 | <table class="form-table" width="100%" border="0" cellspacing="0" cellpadding="6"> |
|---|
| 170 | |
|---|
| 171 | <tr valign="top"> |
|---|
| 172 | <th scope="row">Snipshot</th> |
|---|
| 173 | <td> |
|---|
| 174 | <label for="use-snipshot"> |
|---|
| 175 | <input name="use-snipshot" id="use-snipshot" value="1" <?php echo RCCWP_OptionsPage::GetCheckboxState($customWritePanelOptions['use-snipshot'])?> type="checkbox"> |
|---|
| 176 | Use Snipshot services instead of cropper to edit photos.</label> |
|---|
| 177 | </td> |
|---|
| 178 | </tr> |
|---|
| 179 | |
|---|
| 180 | <tr valign="top"> |
|---|
| 181 | <th scope="row">Edit-n-place</th> |
|---|
| 182 | <td> |
|---|
| 183 | <label for="enable-editnplace"> |
|---|
| 184 | <input name="enable-editnplace" id="enable-editnplace" value="1" <?php echo RCCWP_OptionsPage::GetCheckboxState($customWritePanelOptions['enable-editnplace'])?> type="checkbox"> |
|---|
| 185 | Edit posts instantly from the post page.</label> |
|---|
| 186 | </td> |
|---|
| 187 | </tr> |
|---|
| 188 | |
|---|
| 189 | <tr> |
|---|
| 190 | <th scope="row">Use Flash Uploader</th> |
|---|
| 191 | <td> |
|---|
| 192 | <label for="enable-swfupload"> |
|---|
| 193 | <input name="enable-swfupload" id="enable-swfupload" value="1" <?php echo RCCWP_OptionsPage::GetCheckboxState($customWritePanelOptions['enable-swfupload']) ?> type="checkbox"> |
|---|
| 194 | Use Flash Uploader instead of Browser upload. </label> |
|---|
| 195 | </td> |
|---|
| 196 | </tr> |
|---|
| 197 | |
|---|
| 198 | </table> |
|---|
| 199 | |
|---|
| 200 | <br /> |
|---|
| 201 | <h3>Uninstall Flutter</h3> |
|---|
| 202 | <table class="form-table" width="100%" border="0" cellspacing="0" cellpadding="6"> |
|---|
| 203 | |
|---|
| 204 | <tr valign="top"> |
|---|
| 205 | <th scope="row">Uninstall Flutter</th> |
|---|
| 206 | <td> |
|---|
| 207 | <input type="text" id="uninstall-custom-write-panel" name="uninstall-custom-write-panel" size="25" /><br /> |
|---|
| 208 | <label for="uninstall-custom-write-panel"> |
|---|
| 209 | Type <strong>uninstall</strong> into the textbox, click <strong>Update Options</strong>, and all the tables created by this plugin will be deleted</label> |
|---|
| 210 | |
|---|
| 211 | </td> |
|---|
| 212 | </tr> |
|---|
| 213 | |
|---|
| 214 | </table> |
|---|
| 215 | |
|---|
| 216 | <p class="submit" ><input name="update-custom-write-panel-options" type="submit" value="Update Options" /></p> |
|---|
| 217 | |
|---|
| 218 | </form> |
|---|
| 219 | |
|---|
| 220 | </div> |
|---|
| 221 | |
|---|
| 222 | <?php |
|---|
| 223 | } |
|---|
| 224 | |
|---|
| 225 | function GetCheckboxState($optionValue) |
|---|
| 226 | { |
|---|
| 227 | if ($optionValue == '' || $optionValue == 0) |
|---|
| 228 | return ''; |
|---|
| 229 | else |
|---|
| 230 | return 'checked="checked"'; |
|---|
| 231 | } |
|---|
| 232 | |
|---|
| 233 | } |
|---|
| 234 | |
|---|
| 235 | ?> |
|---|