Guest User

Untitled

a guest
Apr 8th, 2013
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.40 KB | None | 0 0
  1.  
  2. function o99_brsa_options_page() {
  3.  
  4. $my_options = get_option( 'o99_brsa_settings' );
  5.  
  6.  
  7. $currentsettings = "";
  8. if ( isset( $_POST['import'] ) && trim($_POST['exccc']) != "" ) {
  9. $currentsettings = $_POST['exccc'];
  10. update_option( 'o99_brsa_settings', serialize($currentsettings));
  11.  
  12. } elseif ( isset( $my_options ) && ( $my_options != "" ) ) {
  13. if ($o99_brsa_options['brsa_keep_settings_exp'] !='') {
  14. $currentsettings = $o99_brsa_options['brsa_keep_settings_exp'];
  15. } else {
  16. $currentsettings = serialize( $my_options );
  17. }
  18. }
  19.  
  20. global $o99_brsa_options; // declare as global so we can access everywhere
  21.  
  22. ob_start(); ?>
  23.  
  24. <div class="wrap">
  25. <h2><?php echo _e('o99 Some Plugin', 'o99-brsa-domain') ?></h2>
  26.  
  27. <form method="post" action="options.php">
  28.  
  29. <?php settings_fields('o99_brsa_settings_group'); ?>
  30.  
  31. <!-- /Enable Plugin -->
  32.  
  33. <h3><?php _e('Enable', 'o99-brsa-domain'); ?></h3>
  34. <?php _e('This plugin will rebrand your wp installation to a white board (when finished)', 'o99-brsa-domain'); ?>
  35.  
  36. <!-- /Enable General $o99_brsa_options['brsa_enable_all'] -->
  37.  
  38. <p>
  39. <input id="o99_brsa_settings[brsa_enable_all]" name="o99_brsa_settings[brsa_enable_all]" type="checkbox" value="1" <?php checked(1, $o99_brsa_options['brsa_enable_all']); ?> />
  40.  
  41. <label class="description" for="o99_brsa_settings[brsa_enable_all]"><b><?php _e('Enable all functions', 'o99-brsa-domain'); ?></b>
  42. </label>
  43. ? </br><?php _e('This will Enable all the functions at once', 'o99-brsa-domain'); ?>
  44. </p>
  45.  
  46.  
  47. <?php /// HERE I HAVE MANY MANY MORE OPTIONS SIMILAR TO ABOVE ... ?>
  48.  
  49. <p class="submit">
  50. <input type="submit" class="button-primary" value="<?php _e('Save Options', 'o99-brsa-domain'); ?>" />
  51. </p>
  52.  
  53. </form>
  54.  
  55. <!-- /SECOND FORM ONLY FOR EXPORT IMPORT OF OPTIONS -->
  56.  
  57. <form id="impexp" method="post" action="#">
  58. <p>
  59. <textarea readonly="yes" class="code" cols="50" rows="5" id="o99_brsa_settings[brsa_keep_settings_exp]" name="o99_brsa_settings[brsa_keep_settings_exp]" /><?php
  60. echo $currentsettings3; // leave the php tags seperated t oavoid tabs and spaces in the code ..
  61. ?></textarea>
  62. <label class="code ltr" for="o99_brsa_settings[brsa_keep_settings_exp]">
  63. </br><?php _e('Export Data', 'o99-brsa-domain'); ?>
  64. </label>
  65. </p>
  66. <p>
  67. <textarea class="code ltr" cols="50" rows="5" id="exccc" name="exccc" /><?php
  68. // echo $currentsettings; // leave the php tags seperated t oavoid tabs and spaces in the code ..
  69. ?></textarea>
  70. <label class="description" for="exccc">
  71. </br><?php _e('Export Data', 'o99-brsa-domain'); ?>
  72. </label>
  73. </p>
  74. <!-- / IMPORT o99_brsa_settings[brsa_keep_settings_exp] -->
  75.  
  76. <input type="submit" value="<?php _e('Import', 'o99-brsa-domain'); ?>" id="import" name="import" class="button-primary" onClick="return confirm('<?php _e('Are you sure you want to import the settings?', 'o99-brsa-domain'); ?>')">
  77. </form>
  78. </div>
  79.  
  80. <?php
  81. echo ob_get_clean();
  82.  
  83. }
Advertisement
Add Comment
Please, Sign In to add comment