pluginoptions.php 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223
  1. <div class="wrap">
  2. <div id="icon-options-general" class="icon32"></div>
  3. <h2><?php echo ($this->plugintitle) ?> Plugin Configuration</h2>
  4. <?php if (isset($_GET['msg']) && !empty($_GET['msg'])): ?>
  5. <div id="<?php echo ($this->pluginname) ?>-settings_updated" class="updated settings-error">
  6. <p><strong><?php echo $_GET['msg']; ?></strong></p>
  7. </div>
  8. <?php endif;?>
  9. <hr>
  10. <div style="float: right;"><a href="<?php echo ($this->readme_url); ?>">Readme</a></div>
  11. <pre>
  12. Version: <?php echo ($this->version); ?> <?php echo ($this->publish_date); ?>
  13. <?php dags_extras();?></pre>
  14. <hr>
  15. <?php if (isset($_GET['focus'])) {
  16. ?>
  17. <?php
  18. if (isset($this->dagsopt['plug_' . $_GET['focus']])) {
  19. ?>
  20. <?php
  21. $plug = $this->dagsopt['plug_' . $_GET['focus']];
  22. if (method_exists($plug, 'fullscreen')) {
  23. echo ($plug->fullscreen());
  24. }
  25. ?>
  26. <?php }?>
  27. <?php } else {
  28. ?>
  29. <form method="post" action="" enctype="multipart/form-data">
  30. <table class="form-table">
  31. </table>
  32. <table class="form-table">
  33. <?php
  34. foreach ($this->dagsopt as $plugname => $plug) {
  35. $short = str_replace("plug_", "", $plugname);
  36. $vis = get_option($this->pluginname . '_' . $short, true);
  37. if (isset($plug->hasform) && !($plug->hasform && !$vis)) {
  38. ?>
  39. <tr valign="top">
  40. <td width="120"><label for="<?php echo ($this->pluginname) ?>_<?php echo ($short); ?>"><?php echo (!empty($plug->title) ? $plug->title : $short); ?></label> <?php echo ($short); ?></td>
  41. <td width="30">
  42. <input name="<?php echo ($this->pluginname) ?>_<?php echo ($short); ?>" type="checkbox" id="<?php echo ($this->pluginname) ?>_<?php echo ($short); ?>" <?php if ($vis) {
  43. echo 'checked';
  44. }
  45. ?> />
  46. </td>
  47. <td>
  48. </td>
  49. <td width="120"><code><?php if (method_exists($plug, "help")) {echo ($plug->help());} else {}?></code>
  50. </td>
  51. </tr>
  52. <?php
  53. } else {
  54. ?>
  55. <tr valign="top">
  56. <td width="120"><label for="<?php echo ($this->pluginname) ?>_<?php echo ($short); ?>"><?php echo (!empty($plug->title) ? $plug->title : $short); ?></label> ::<?php echo ($short); ?></td>
  57. <td width="30">
  58. <input name="<?php echo ($this->pluginname) ?>_<?php echo ($short); ?>" type="checkbox" id="<?php echo ($this->pluginname) ?>_<?php echo ($short); ?>" <?php if ($vis) {
  59. echo 'checked';
  60. }
  61. ?> />
  62. </td>
  63. <td>
  64. <?php if ($vis) {echo ($plug->admin_line($this->pluginname . '_' . $short));} else {}?>
  65. </td>
  66. <td width="120"><code><?php if (method_exists($plug, "help")) {echo ($plug->help());} else {}?></code>
  67. </td>
  68. </tr>
  69. <?php }}?>
  70. <tr valign="top">
  71. <td><label for="<?php echo ($this->pluginname) ?>_cron_enabled"><?php _e('Cron Enabled', 'dagsopt')?></label></td>
  72. <td >
  73. <input name="<?php echo ($this->pluginname) ?>_cron_enabled" type="checkbox" id="<?php echo ($this->pluginname) ?>_cron_enabled" <?php if (get_option($this->pluginname . '_cron_enabled', true)) {
  74. echo 'checked';
  75. }
  76. ?> />
  77. </td><td>
  78. <div style="<?php if (get_option($this->pluginname . '_cron_enabled', true)) {
  79. echo 'background-color:#afffaf;';
  80. }
  81. ?> ">
  82. <table style="<?php if (get_option($this->pluginname . '_cron_enabled') == false) {
  83. echo 'display: none;';
  84. }
  85. ?>" >
  86. <tr valign="top">
  87. <th scope="row"><label for="<?php echo ($this->pluginname) ?>_last_build"><?php _e('Last Build', 'dagsopt')?></label></th>
  88. <td >
  89. <?php $dd = date("j. M @ H:i", (get_option($this->pluginname . '_last_build', 0) + (60 * 60 * 2)));
  90. echo ($dd);?>
  91. </td>
  92. </tr>
  93. <tr valign="top">
  94. <th scope="row"><label for="<?php echo ($this->pluginname) ?>_next_build"><?php _e('Next Build', 'dagsopt')?></label></th>
  95. <td >
  96. <?php $dd = date("j. M @ H:i", (($this->next_scheduled) + (60 * 60 * 2)));
  97. echo ($dd);?>
  98. </td>
  99. </tr>
  100. <tr valign="top">
  101. <td scope="row"><label for="<?php echo ($this->pluginname) ?>_cron_interval"><?php _e('Cron Execution Interval', 'dagsopt')?></label></t>
  102. <td>
  103. <select name="<?php echo ($this->pluginname) ?>_cron_interval" id="<?php echo ($this->pluginname) ?>_cron_interval">
  104. <?php
  105. $selectValue = get_option($this->pluginname . '_cron_interval', 300);
  106. for ($counter = 300; $counter <= 7200; $counter = $counter + 300) {
  107. $cc = $counter / 60;
  108. if ($selectValue == $counter) {
  109. print "\n\t<option selected='selected' value='{$counter}'>{$cc} min</option>";
  110. } else {
  111. print "\n\t<option value='{$counter}'>{$cc} min</option>";
  112. }
  113. }
  114. ?>
  115. </select>
  116. </td>
  117. </tr>
  118. </table>
  119. </div>
  120. </td>
  121. </tr>
  122. </table>
  123. <p class="submit">
  124. <input type="submit" name="Submit" class="button-primary" value="<?php esc_attr_e('Save Changes', 'dagsopt')?>" />
  125. </p>
  126. </form>
  127. <table class="form-table">
  128. <?php
  129. foreach ($this->dagsopt as $plugname => $plug) {
  130. $short = str_replace("plug_", "", $plugname);
  131. $vis = get_option($this->pluginname . '_' . $short, true);
  132. if (isset($plug->hasform) && $vis) {
  133. ?>
  134. <tr valign="top">
  135. <td width="120"><label for="<?php echo ($this->pluginname) ?>_<?php echo ($short); ?>"><?php echo ($plug->title); ?></label></td>
  136. <td width="300">
  137. </td>
  138. <td>
  139. <?php if ($vis) {echo ($plug->admin_line($this->pluginname . '_' . $short));} else {}?>
  140. </td>
  141. </tr>
  142. <?php }}?>
  143. </table>
  144. </div>
  145. <?php }?>
  146. <?php if (isset($_REQUEST['debug'])) {
  147. ?>
  148. <div>
  149. <h3>Debug</h3>
  150. <textarea style="width: 100%; height: 300px;">
  151. <?php $ttt = get_defined_vars();
  152. print_r($ttt);?>
  153. </textarea>
  154. <textarea style="width: 100%; height: 300px;">
  155. <?php $ttt = get_defined_vars();
  156. print_r($ttt);?>
  157. </textarea>
  158. <textarea style="width: 100%; height: 300px;">
  159. <?php $tt = getenv();
  160. print_r($tt);?>
  161. </textarea>
  162. <textarea style="width: 100%; height: 300px;">
  163. <?php print_r($_ENV);?>
  164. </textarea>
  165. <textarea style="width: 100%; height: 300px;">
  166. <?php print_r($_SERVER);?>
  167. </textarea>
  168. <textarea style="width: 100%; height: 300px;">
  169. </textarea>
  170. </div>
  171. <?php }?>