PageRenderTime 45ms CodeModel.GetById 11ms RepoModel.GetById 0ms app.codeStats 0ms

/wp-content/plugins/wp-ui/admin/admin-options.php

https://gitlab.com/Blueprint-Marketing/interoccupy.net
PHP | 704 lines | 479 code | 114 blank | 111 comment | 85 complexity | 1094c692bfcf096915ecca93c858d277 MD5 | raw file
  1. <?php
  2. /**
  3. * Plugin Options template
  4. *
  5. * Plugin options class using WP Settings API.
  6. *
  7. * Initially derived from the theme options class works by Alison
  8. * Barret( @alisothegeek @link: http://alisothegeek.com ). Much Thanks to her.
  9. *
  10. * @since $Id$
  11. * @package wp-ui
  12. * @subpackage admin-options
  13. **/
  14. /**
  15. * Plugin Options class.
  16. */
  17. if ( ! class_exists( 'quark_admin_options') ) {
  18. class quark_admin_options
  19. {
  20. public $sections, $fields, $page_id, $admin_scripts, $plugin_details, $plugin_db_prefix, $plugin_page_prefix, $help_tabs, $options;
  21. private $defaults = array(
  22. 'id' => 'default_field',
  23. 'title' => 'Default Field',
  24. 'desc' => 'Description',
  25. 'type' => 'text',
  26. 'std' => '',
  27. 'section' => 'general',
  28. 'choices' => array(),
  29. 'class' => '',
  30. 'extras' => '',
  31. 'fields' => array(),
  32. 'enclose' => array( 'before' => '', 'after' => '' )
  33. );
  34. function __construct( $plugin_details=array() )
  35. {
  36. $this->plugin_details = $plugin_details;
  37. foreach ( $plugin_details as $key => $value ) {
  38. $this->{$key} = $value;
  39. }
  40. $this->quark_admin_options();
  41. $this->options = get_option( $this->db_prefix . '_options' );
  42. }
  43. public function quark_admin_options() {
  44. add_action( 'admin_menu' , array(&$this, 'menu_admin'));
  45. add_action( 'admin_init' , array(&$this, 'init_admin'));
  46. $this->set_page_id($this->page_id);
  47. }
  48. public function init_admin() {
  49. $this->register_options();
  50. }
  51. public function menu_admin() {
  52. $page_str = add_options_page( $this->name . ' Options', $this->name, 'manage_options', $this->page_prefix . '-options', array(&$this, 'render_options_page') );
  53. if ( floatval( get_bloginfo( 'version' ) ) >= 3.3 )
  54. add_action( 'admin_print_styles-' . $page_str, array( &$this, 'provide_help' ) );
  55. $this->page_id = $page_str;
  56. add_action( 'admin_print_styles-' . $page_str , array( &$this, 'script_action' ) );
  57. }
  58. function script_action() {
  59. do_action( 'plugin_' . $this->page_prefix . '_load_scripts' );
  60. }
  61. public function render_options_page() {
  62. echo '<div class="wrap">
  63. <div class="cap-icon" id="icon-options-general"></div>
  64. <h2 style="font-size : 35px;"><a href="http://kav.in">
  65. <img width="32px" style="display: inline" src="' . plugins_url( "/wp-ui/images/cap-badge.png" ) . '" /></a> ' . $this->name . '</h2>';
  66. /**
  67. * Hook for inserting info *above* your plugin's option page.
  68. * Can be used for information about the plugin, warnings etc.
  69. */
  70. // do_meta_boxes( 'top-' . $this->db_prefix, 'normal', null );
  71. do_action( $this->page_prefix . '_above_options_page' );
  72. /**
  73. * Start the form tag.
  74. */
  75. echo '<form id="optionsform" action="options.php" method="post">
  76. <div id="options-wrap">';
  77. /**
  78. * Display the options.
  79. */
  80. settings_fields( $this->db_prefix . '_options');
  81. do_settings_sections( $_GET['page'] );
  82. echo '</div><!-- end #options-wrap -->
  83. <p class="submit">
  84. <input name="' . $this->db_prefix . '_options[submit]" type="submit" class="button-primary" value="' . __( 'Save Options' ) . '" />
  85. <input name="' . $this->db_prefix . '_options[reset]" type="submit" class="button-secondary" value="' . __( 'Reset Defaults' ) . '" />
  86. </p><!-- end p.submit -->
  87. </form><!-- end form#optionsform -->';
  88. /**
  89. * Hook for inserting info *below* your plugin's option page.
  90. * Useful for credits and similar.
  91. */
  92. // do_meta_boxes( 'below-' . $this->db_prefix, 'normal', null );
  93. do_action( $this->page_prefix . '_below_options_page' );
  94. }
  95. public function register_options() {
  96. register_setting( $this->db_prefix . '_options', $this->db_prefix . '_options', array(&$this, 'validate_options'));
  97. foreach( $this->sections as $slug => $title ) {
  98. add_settings_section( $slug, $title , array( &$this, 'display_section'), $this->page_prefix . '-options');
  99. }
  100. foreach ( $this->fields as $field ) {
  101. $this->create_option( $field );
  102. }
  103. } // END method register_options.
  104. public function display_section() {
  105. }
  106. function postbox( $id, $title, $content ) {
  107. ?>
  108. <div id="<?php echo $id; ?>" class="postbox wpui-postbox">
  109. <div class="handlediv" title="Click To Toggle"><br /></div>
  110. <h3 class="hndle"><span><?php echo $title ?></span></h3>
  111. <div class="inside"><?php echo $content ?></div>
  112. </div><!-- end .wpui-postbox -->
  113. <?php
  114. }
  115. public function create_option( $args = array() ) {
  116. $defaults = array(
  117. 'id' => 'default_field',
  118. 'title' => 'Default Field',
  119. 'desc' => 'Description, nonetheless.',
  120. 'type' => 'text',
  121. 'subtype' => '',
  122. 'std' => '',
  123. 'section' => 'general',
  124. 'choices' => array(),
  125. 'label_for' => '',
  126. 'field_class' => '',
  127. 'text_length' => '',
  128. 'textarea_size' => array(),
  129. 'extras' => '',
  130. 'fields' => array(),
  131. 'enclose' => array( 'before' => '', 'after' => '' )
  132. );
  133. extract( wp_parse_args( $args, $defaults) );
  134. $option_args = array(
  135. 'type' => $type,
  136. 'subtype' => $subtype,
  137. 'id' => $id,
  138. 'desc' => $desc,
  139. 'std' => $std,
  140. 'choices' => $choices,
  141. 'label_for' => $id,
  142. 'field_class' => $field_class,
  143. 'text_length' => $text_length,
  144. 'textarea_size' => $textarea_size,
  145. 'extras' => $extras,
  146. 'fields' => $fields,
  147. 'enclose' => $enclose
  148. );
  149. add_settings_field( $id, $title, array( &$this, 'display_option'), $this->page_prefix . '-options', $section, $option_args);
  150. } // END method create_option.
  151. /**
  152. * Regular checkbox.
  153. */
  154. private function checkbox( $args=array() ) {
  155. $defs = array(
  156. 'id' => '',
  157. 'name' => '',
  158. 'desc' => '',
  159. 'nested'=> false );
  160. extract(wp_parse_args( $args, $defs ));
  161. $checked = '';
  162. if( isset( $this->options ) && $this->opt( $id ) == 'on' ) $checked = ' checked="checked"';
  163. echo '<input id="' . $id . '" type="checkbox" name="' . $name . '" value="on"' . $checked . '/><label for="' . $id . '"> ' . $desc . '</label>';
  164. } // end checkbox.
  165. /**
  166. * Select or Combo box.
  167. */
  168. private function select($args=array()) {
  169. $defs = array(
  170. 'id' => '',
  171. 'name' => '',
  172. 'desc' => '',
  173. 'choices' => array(),
  174. 'extras' => '',
  175. 'nested' => false );
  176. extract(wp_parse_args( $args, $defs ));
  177. echo '<select id="' . $id . '" name="' . $name . '">';
  178. foreach ( $choices as $value=>$label ) {
  179. $selected = '';
  180. if ( $this->opt($id) == $value ) $selected = ' selected';
  181. if ( stristr( $value, 'startoptgroup' ) ) {
  182. echo '<optgroup label="' . $label . '">';
  183. } else if ( stristr( $value, 'endoptgroup') ) {
  184. echo '</optgroup>';
  185. } else {
  186. echo '<option value="' . $value . '"' . $selected . '>' . $label . '</option>';
  187. }
  188. }
  189. echo '</select>';
  190. if ( $extras != '' && ! $nested )
  191. echo $extras;
  192. if( $desc != '' && ! $nested )
  193. echo '<br /> ' . $desc;
  194. }
  195. /**
  196. * Radio boxes
  197. */
  198. private function radio( $args=array() ) {
  199. $defs = array(
  200. 'id' => '',
  201. 'name' => '',
  202. 'desc' => '',
  203. 'choices' => array(),
  204. 'extras' => '',
  205. 'subtype' => 'normal',
  206. 'nested' => false
  207. );
  208. extract(wp_parse_args( $args, $defs ));
  209. if ( $subtype == 'descriptive' ) {
  210. if( $desc != '' )
  211. echo $desc . '<br /><br />';
  212. $style_elem = "style='float:left;margin-right:20px;margin-bottom:20px;border: 1px solid #bbb;-moz-box-shadow: 0px 1px 2px #AAA;-webkit-box-shadow: 2px 2px 2px #777;box-shadow: 2px 2px 2px #777;'";
  213. foreach ( $choices as $choice )
  214. {
  215. $active = ( $this->opt( $id ) == $choice['slug']) ? 'class="active-layout"' : '';
  216. echo "<dl style='float:left; padding:5px; text-align:center; max-width:160px' " . $active . ">";
  217. $checked = ( $this->opt( $id ) == $choice['slug']) ? ' checked ' : '';
  218. echo "<dt>" . $choice['name'] . "</dt>";
  219. echo "<dd style='text-align:center'><img src='". $choice['image'] ."' /></dd>";
  220. echo "<dd>";
  221. echo "<input name='" . $name . "' " . $checked . " id='" . $id . "' value='" . $choice['slug'] . "' type='radio' />";
  222. echo "</dd>";
  223. echo "<dd>" . $choice['description'] . "</dd>";
  224. echo '</dl>';
  225. }
  226. }
  227. else // Regular radio buttons.
  228. {
  229. $i = 0;
  230. foreach( $choices as $value => $label ) {
  231. $selected = '';
  232. if ( $this->opt( $id ) == $value )
  233. $selected = ' checked="checked"';
  234. echo '<input type="radio" name="' . $name . '" value="' . $value . '"' . $selected . '><label for="' . $id . $i . '">' . $label . '</label>';
  235. if ( $i < count( $choices ) -1 )
  236. echo '<br />';
  237. $i++;
  238. }
  239. if( $desc != '' && ! $nested )
  240. echo '<br /> ' . $desc;
  241. }
  242. } // I am radio. End.
  243. /**
  244. * Textareas
  245. */
  246. private function textarea($args=array()) {
  247. $defs = array(
  248. 'id' => '',
  249. 'name' => '',
  250. 'desc' => '',
  251. 'textarea_size' => array(),
  252. 'nested' => false );
  253. extract(wp_parse_args( $args, $defs ));
  254. $text_cols = ''; $text_rows = ''; $autocomplete = 'on';
  255. if (!empty($textarea_size)) {
  256. $text_cols = ' cols="' . $textarea_size['cols'] . '"';
  257. $text_rows = ' rows="' . $textarea_size['rows'] . '"';
  258. if( isset( $textarea_size[ 'autocomplete' ] ) )
  259. $autocomplete = $textarea_size[ 'autocomplete' ];
  260. }
  261. echo '<textarea' . $text_cols . $text_rows . ' autocomplete="' . $autocomplete . '" id="' . $id . '" name="' . $name . '">' . $this->opt( $id ) . '</textarea>';
  262. if( $desc != '' && ! $nested )
  263. echo '<br /> ' . $desc;
  264. } // end fun textarea.
  265. private function fileinput( $id, $name, $desc, $nested=false ) {
  266. $defs = array(
  267. 'id' => '',
  268. 'name' => '',
  269. 'desc' => '',
  270. 'nested'=> false );
  271. wp_parse_args( $args, $defs );
  272. echo '<input type="file" id="' . $id . '" name="' . $id . '" />';
  273. if ( $desc != '' && ! $nested )
  274. echo '<br /> ' . $desc;
  275. if ( $file = $this->opt( $id ) ) {
  276. // var_dump($file);
  277. echo '<br /> <br /><a class="thickbox" href=' . $file['url'] . '>' . __('Currently uploaded image', 'wp-ui' ) . '</a>';
  278. }
  279. }
  280. /**
  281. * Regular text input - Default.
  282. */
  283. private function textinput( $args=array() ) {
  284. $defs = array(
  285. 'id' => '',
  286. 'name' => '',
  287. 'desc' => '',
  288. 'text_length' => '',
  289. 'type' => 'text',
  290. 'nested'=> false );
  291. extract(wp_parse_args( $args, $defs ));
  292. $style = '';
  293. if ( $type == 'farbtastic' )
  294. $style = ' style="position:relative" ';
  295. elseif( $type == 'jscolor' )
  296. $style = ' class="color {hash:true}" ';
  297. elseif ( $type == 'media-upload' )
  298. $style = ' style="text-align : right;"';
  299. if ($text_length != '') {
  300. $text_length = ' size="' . $text_length . '"';
  301. }
  302. $thisVal = ($this->opt( $id )) ? $this->opt( $id ) : '';
  303. echo '<input' . $text_length . $style . ' type="text" id="' . $id . '" name="' . $name . '" value="' . $thisVal . '" />';
  304. $nid = $id;
  305. if ( $type == 'farbtastic' ) {
  306. // Init farbtastic color-picker.
  307. echo '<div id="colorpicker"></div>';
  308. echo '<script type="text/javascript">
  309. // Hide the colorpicker first.
  310. jQuery("#colorpicker").hide();
  311. // Open the color picker on clicking the textfield.
  312. jQuery("#' . $nid . '").click(function() {
  313. jQuery("#colorpicker").farbtastic("#' . $nid . '").slideDown(500);
  314. });
  315. // Hide the color-picker on Double click.
  316. jQuery("#' . $nid . '").dblclick(function() {
  317. jQuery("#colorpicker").slideUp(300);
  318. });
  319. </script><!-- End farbtastic init script. -->';
  320. } else if( $type == 'jscolor' ) {
  321. // Jscolor, chosen.
  322. $optjsurl = get_bloginfo('template_url'). '/lib/options/js/';
  323. wp_enqueue_script('jscolor', $optjsurl . '/jscolor/jscolor.js');
  324. } else if( $type == 'media-upload' ) {
  325. echo '<input id="' . $nid . '_trigger" type="button" class="button-secondary" value="Upload" />';
  326. $post_id = 0;
  327. echo "<script type=\"text/javascript\">
  328. instance = 0;
  329. jQuery('#" . $nid . "_trigger').click(function() {
  330. instance++; if ( instance > 1 ) return false;
  331. backup_send = window.send_to_editor;
  332. formfield = jQuery('label[for=$nid]').text();
  333. window.send_to_editor = window.send_to_editor_$nid;
  334. tb_show('Upload images for ' + formfield, 'media-upload.php?post_id=0&type=image&amp;TB_iframe=true');
  335. return false;
  336. });
  337. window.send_to_editor_$nid = function(html) {
  338. imgURL = jQuery('img', html).attr('src');
  339. jQuery('#$nid').val(imgURL);
  340. tb_remove();
  341. reverseSend();
  342. return false;
  343. }
  344. var reverseSend = function() {
  345. window.send_to_editor = backup_send;
  346. };
  347. </script>";
  348. if ( $this->opt($id) != '' ) {
  349. echo '<br /> <br /><a class="thickbox" href=' . $this->opt($id) . '>' . __('Currently uploaded image') . '</a>';
  350. }
  351. }
  352. if ( $desc != '' && ! $nested )
  353. echo '<br /> ' . $desc;
  354. } // END good ol` regular text input.
  355. public function display_option( $args = array() ) {
  356. extract( $args );
  357. $options = get_option( $this->db_prefix . '_options');
  358. if ( !isset( $options[$id] ) && 'type' != 'checkbox' )
  359. $options[$id] = $std;
  360. echo $enclose[ 'before' ];
  361. switch( $type ) {
  362. ////////////////////////////////////////////////
  363. //////////////// Checkbox //////////////////////
  364. ////////////////////////////////////////////////
  365. case 'checkbox':
  366. $this->checkbox( array(
  367. 'id' => $id,
  368. 'name' => $this->db_prefix . '_options[' . $id . ']',
  369. 'desc' => $desc,
  370. ));
  371. // $this->checkbox( $id, $this->db_prefix . '_options[' . $id . ']', $desc );
  372. break;
  373. ////////////////////////////////////////////////
  374. /////////// Combo boxes (select) ///////////////
  375. ////////////////////////////////////////////////
  376. case 'select':
  377. $this->select( array(
  378. 'id' => $id,
  379. 'name' => $this->db_prefix . '_options[' . $id . ']',
  380. 'desc' => $desc,
  381. 'choices' => $choices,
  382. 'extras' => $extras
  383. ));
  384. // $this->select( $id, $this->db_prefix . '_options[' . $id . ']', $desc, $choices, $extras );
  385. break;
  386. ////////////////////////////////////////////////
  387. //////////////// Radio buttons /////////////////
  388. ////////////////////////////////////////////////
  389. case 'radio':
  390. $this->radio( array(
  391. 'id' => $id,
  392. 'name' => $this->db_prefix . '_options[' . $id . ']',
  393. 'desc' => $desc,
  394. 'choices' => $choices,
  395. 'extras' => $extras
  396. ));
  397. break;
  398. ////////////////////////////////////////////////
  399. //////////////// Text areas ////////////////////
  400. ////////////////////////////////////////////////
  401. case 'textarea':
  402. $this->textarea( array(
  403. 'id' => $id,
  404. 'name' => $this->db_prefix . '_options[' . $id . ']',
  405. 'desc' => $desc,
  406. 'textarea_size' => $textarea_size,
  407. ));
  408. break;
  409. ////////////////////////////////////////////////
  410. //////////////// Rich text edit ////////////////
  411. ////////////////////////////////////////////////
  412. // case 'richtext':
  413. // if (!empty($textarea_size)) {
  414. // $text_cols = ' cols="' . $textarea_size['cols'] . '"';
  415. // $text_rows = ' rows="' . $textarea_size['rows'] . '"';
  416. // if( isset( $textarea_size[ 'autocomplete' ] ) )
  417. // $autocomplete = $textarea_size[ 'autocomplete' ];
  418. // }
  419. // echo '<p class="switch-editors" align="right"><a class="toggleVisual">Visual</a><a class="toggleHTML">HTML</a></p>';
  420. // echo '<textarea' . $field_class . $text_cols . $text_rows . ' id="' . $id . '" class="rich-text-editor" name="' . $this->db_prefix . '_options[' . $id . ']">' . $options[$id] . '</textarea>';
  421. // if( $desc != '' )
  422. // echo '<br /> ' . $desc;
  423. // if( function_exists( 'wp_tiny_mce' ) ) wp_tiny_mce(false, array( 'editor_selector' => 'rich-text-editor' , 'height' => 300, 'mce_external_plugins' => array()));
  424. // echo '<script type="text/javascript">
  425. // jQuery(document).ready(function() {
  426. // jQuery("a.toggleVisual").click(function(){
  427. // tinyMCE.execCommand("mceAddControl", false, "' . $id . '");
  428. // });
  429. // jQuery("a.toggleHTML").click(function(){
  430. // tinyMCE.execCommand("mceRemoveControl", false, "' . $id .'");
  431. // });
  432. //
  433. // }); // END document ready
  434. //
  435. // </script>';
  436. // break;
  437. ////////////////////////////////////////////////
  438. //////////////// Password //////////////////////
  439. ////////////////////////////////////////////////
  440. case 'password':
  441. echo '<input id="' . $id . '" type="password" name="' . $this->db_prefix . '_options[' . $id . ']" value="' . $options[$id] . '" />';
  442. if( $desc != '' )
  443. echo '<br /> ' . $desc;
  444. break;
  445. ////////////////////////////////////////////////
  446. /////////// Regular PHP file uploader //////////
  447. ////////////////////////////////////////////////
  448. case 'file':
  449. $this->fileinput( $id, $this->db_prefix . '_options[' . $id . ']', $desc, $file );
  450. break;
  451. ////////////////////////////////////////////////
  452. /////////// Wordpress Media uploader ///////////
  453. ////////////////////////////////////////////////
  454. case 'media-upload':
  455. $this->textinput(array(
  456. 'id' => $id,
  457. 'name' => $this->db_prefix . '_options[' . $id . ']',
  458. 'desc' => $desc,
  459. 'text_length' => $text_length,
  460. 'type' => 'media-upload'
  461. ));
  462. break;
  463. ////////////////////////////////////////////////
  464. //////////////// Color picker //////////////////
  465. ////////////////////////////////////////////////
  466. case 'color':
  467. $this->textinput(array(
  468. 'id' => $id,
  469. 'name' => $this->db_prefix . '_options[' . $id . ']',
  470. 'desc' => $desc,
  471. 'text_length' => $text_length,
  472. 'type' => $this->color_picker ));
  473. break;
  474. case 'separator':
  475. echo '<br /></tr></table><hr color="#D5D5D5"><table class="form-table"><tbody><tr>';
  476. break;
  477. case 'multiple':
  478. foreach( $fields as $field ) {
  479. if ( isset( $field[ 'enclose' ] ) )
  480. echo $field[ 'enclose' ]['before' ];
  481. $args_arr = array(
  482. 'id' => $id . 'KKKKK' . $field[ 'idkey' ],
  483. 'name' => $this->db_prefix . '_options[' . $id . '][' . $field[ 'idkey' ] . ']',
  484. 'desc' => $field[ 'desc' ]
  485. );
  486. if ( $field['type'] == 'textinput' ) {
  487. $args_arr['text_length'] = $field[ 'text_length' ];
  488. $args_arr['type'] = 'text';
  489. } elseif ( $field['type'] == 'media-upload' ) {
  490. $args_arr['text_length'] = $field[ 'text_length' ];
  491. $args_arr['type'] = 'media-upload';
  492. $field[ 'type' ] = 'textinput';
  493. } elseif ( $field['type'] == 'select' ) {
  494. $args_arr['choices'] = $field[ 'choices' ];
  495. if ( isset( $field['extras'] ) )
  496. $args_arr['extras'] = $field[ 'extras' ];
  497. } elseif ( $field['type'] == 'radio' ) {
  498. $args_arr['choices'] = $field[ 'choices' ];
  499. }
  500. // Nested
  501. $args_arr['nested'] = true;
  502. call_user_func_array( array( &$this, $field[ 'type' ] ), array($args_arr) );
  503. if ( isset( $field[ 'enclose' ] ) )
  504. echo $field[ 'enclose' ]['after' ];
  505. }
  506. if ( $desc != '' )
  507. echo $desc;
  508. break;
  509. ////////////////////////////////////////////////
  510. ////////////////// Textbox /////////////////////
  511. ////////////////////////////////////////////////
  512. case 'text':
  513. default:
  514. $this->textinput(array(
  515. 'id' => $id,
  516. 'name' => $this->db_prefix . '_options[' . $id . ']',
  517. 'desc' => $desc,
  518. 'text_length' => $text_length,
  519. 'type' => 'text' ));
  520. break;
  521. } // END switch $type.
  522. echo $enclose[ 'after' ];
  523. }
  524. private function opt( $id, $just=false ) {
  525. if ( ! isset( $this->options ) ) return false;
  526. $arr = explode( 'KKKKK', $id );
  527. if ( $just && count( $arr ) > 1) return $arr[ 1 ];
  528. if ( is_array( $arr) && count( $arr ) > 1 && isset( $this->options[ $arr[ 0 ] ]))
  529. return $this->options[ $arr[ 0 ] ][ $arr[ 1 ] ];
  530. else
  531. return ( isset( $this->options ) && isset( $this->options[ $id ] ) )
  532. ? $this->options[ $id ]
  533. : false;
  534. }
  535. public function validate_options( $input ) {
  536. // echo '<pre>';
  537. // print_r($input);
  538. //
  539. // echo '</pre>';
  540. return $input;
  541. }
  542. public function provide_help( $input ) {
  543. $screen = get_current_screen();
  544. if ( ! is_array( $this->help_tabs ) ) return;
  545. foreach( (array)$this->help_tabs as $help=>$tab ) {
  546. if ( ! isset( $tab[ 'id'] ) || !isset( $tab[ 'title' ]) || ! isset( $tab[ 'content' ] ) ) continue;
  547. $screen->add_help_tab( array(
  548. 'id' => strip_tags($tab[ 'id' ]),
  549. 'title' => $tab['title'],
  550. 'content' => $tab['content']
  551. ));
  552. }
  553. }
  554. public function set_sections( $sections ) {
  555. return $this->sections = $sections;
  556. }
  557. public function get_sections() {
  558. return $this->sections;
  559. }
  560. public function set_fields( $fields ) {
  561. return $this->fields = $fields;
  562. }
  563. public function get_fields() {
  564. return $this->fields;
  565. }
  566. public function set_plugin_details( $plugin_details = array() ) {
  567. return $this->plugin_details = $plugin_details;
  568. }
  569. public function get_plugin_details() {
  570. return $this->plugin_details;
  571. }
  572. public function set_page_id( $page_id ) {
  573. return $this->page_id = $page_id;
  574. }
  575. public function get_page_id() {
  576. return $this->page_id;
  577. }
  578. public function set_admin_scripts( $admin_scripts = array() ) {
  579. return $this->admin_scripts = $admin_scripts;
  580. }
  581. public function get_admin_scripts() {
  582. return $this->admin_scripts;
  583. }
  584. public function set_help_tabs( $help_tabs=array() ) {
  585. return $this->help_tabs = $help_tabs;
  586. }
  587. } // END class quark_admin_options.
  588. } // END if class_exists check for quark_admin_options.
  589. ?>