PageRenderTime 50ms CodeModel.GetById 22ms RepoModel.GetById 0ms app.codeStats 0ms

/blog/wp-content/themes/vigilance/functions/vigilance-extend.php

https://bitbucket.org/sergiohzlz/reportaprod
PHP | 167 lines | 117 code | 21 blank | 29 comment | 3 complexity | 7fe866389d562d698378377a3e33b62f MD5 | raw file
Possible License(s): GPL-2.0, GPL-3.0, AGPL-1.0, LGPL-2.1
  1. <?php
  2. /* REQUIRE THE CORE CLASS */
  3. require_once( 'vigilance-admin.php' );
  4. /*
  5. Class Definition
  6. */
  7. if (!class_exists('Vigilance')) {
  8. class Vigilance extends JestroCore {
  9. /* PHP4 Constructor */
  10. function Vigilance () {
  11. /* SET UP THEME SPECIFIC VARIABLES */
  12. $this->themename = "Vigilance";
  13. $this->themeurl = "http://thethemefoundry.com/vigilance/";
  14. $this->shortname = "V";
  15. $directory = get_bloginfo('stylesheet_directory');
  16. /*
  17. OPTION TYPES:
  18. - checkbox: name, id, desc, std, type
  19. - radio: name, id, desc, std, type, options
  20. - text: name, id, desc, std, type
  21. - colorpicker: name, id, desc, std, type
  22. - select: name, id, desc, std, type, options
  23. - textarea: name, id, desc, std, type, options
  24. */
  25. $this->options = array(
  26. array( "name" => __('Navigation', 'vigilance'),
  27. "type" => "subhead",
  28. 'hidden' => true),
  29. array( "name" => __('Exclude specific pages', 'vigilance'),
  30. "id" => $this->shortname."_pages_to_exclude",
  31. "desc" => __('The page ID of pages you do not want displayed in your navigation menu. Use a comma-delimited list, eg. 1,2,3.<br /><br /><em>Note:</em> this theme now offers a fully customizable menu. To enable go to <em>Appearance</em> &rarr; <em>Menus</em>.', 'vigilance'),
  32. "std" => '',
  33. "type" => "text"),
  34. array( "name" => __('Color Scheme', 'vigilance'),
  35. "type" => "subhead"),
  36. array( "name" => __('Customize colors', 'vigilance'),
  37. "id" => $this->shortname."_background_css",
  38. "desc" => __('If enabled your theme will use the colors you choose below.', 'vigilance'),
  39. "std" => "Disabled",
  40. "type" => "select",
  41. "options" => array( "Disabled" => __('Disabled', 'vigilance'),
  42. "Enabled" => __('Enabled', 'vigilance'))),
  43. array( "name" => __('Background color', 'vigilance'),
  44. "id" => $this->shortname."_background_color",
  45. "desc" => __('Use hex values and be sure to include the leading #.', 'vigilance'),
  46. "std" => "#a39c8a",
  47. "type" => "colorpicker"),
  48. array( "name" => __('Border color', 'vigilance'),
  49. "id" => $this->shortname."_border_color",
  50. "desc" => __('Use hex values and be sure to include the leading #.', 'vigilance'),
  51. "std" => "#9a927f",
  52. "type" => "colorpicker"),
  53. array( "name" => __('Link color', 'vigilance'),
  54. "id" => $this->shortname."_link_color",
  55. "desc" => __('Use hex values and be sure to include the leading #.', 'vigilance'),
  56. "std" => "#772124",
  57. "type" => "colorpicker"),
  58. array( "name" => __('Link hover color', 'vigilance'),
  59. "id" => $this->shortname."_hover_color",
  60. "desc" => __('Use hex values and be sure to include the leading #.', 'vigilance'),
  61. "std" => "#58181b",
  62. "type" => "colorpicker"),
  63. array( "name" => __('Disable hover background images', 'vigilance'),
  64. "id" => $this->shortname."_image_hover",
  65. "desc" => __('Check this box if you use custom link colors and do not want the default red showing when a user hovers over the comments bubble or the sidebar menu items.', 'vigilance'),
  66. "std" => "false",
  67. "type" => "checkbox"),
  68. array( "name" => __('Alert Box', 'vigilance'),
  69. "type" => "subhead"),
  70. array( "name" => __('Alert Box on/off switch', 'vigilance'),
  71. "id" => $this->shortname."_alertbox_state",
  72. "desc" => __('Toggle the alert box on or off.', 'vigilance'),
  73. "std" => "Off",
  74. "type" => "select",
  75. "options" => array( "Off" => __('Off', 'vigilance'),
  76. "On" => __('On', 'vigilance'))),
  77. array( "name" => __('Alert Title', 'vigilance'),
  78. "id" => $this->shortname."_alertbox_title",
  79. "desc" => __('The heading for your alert.', 'vigilance'),
  80. "std" => "Your Alert Header",
  81. "type" => "text"),
  82. array( "name" => __('Alert Message', 'vigilance'),
  83. "id" => $this->shortname."_alertbox_content",
  84. "desc" => __('A special alert message that is shown on the front page of your site.', 'vigilance'),
  85. "std" => "Your alert message goes here.",
  86. "type" => "textarea",
  87. "options" => array( "rows" => "8",
  88. "cols" => "70")),
  89. );
  90. parent::JestroCore();
  91. }
  92. /*
  93. ALL OF THE FUNCTIONS BELOW
  94. ARE BASED ON THE OPTIONS ABOVE
  95. EVERY OPTION SHOULD HAVE A FUNCTION
  96. THESE FUNCTIONS CURRENTLY JUST
  97. RETURN THE OPTION, BUT COULD BE
  98. REWRITTEN TO RETURN DIFFERENT DATA
  99. */
  100. /* NAVIGATION FUNCTIONS */
  101. function excludedPages () {
  102. return get_option($this->shortname.'_pages_to_exclude');
  103. }
  104. /* ALERTBOX FUNCTIONS */
  105. function alertboxState() {
  106. return get_option($this->shortname.'_alertbox_state');
  107. }
  108. function alertboxTitle() {
  109. return stripslashes(wp_filter_post_kses(get_option($this->shortname.'_alertbox_title')));
  110. }
  111. function alertboxContent() {
  112. return stripslashes(wp_filter_post_kses(wpautop(get_option($this->shortname.'_alertbox_content'))));
  113. }
  114. /* CSS FUNCTIONS */
  115. function backgroundCss() {
  116. return get_option( $this->shortname.'_background_css' );
  117. }
  118. function backgroundColor() {
  119. return $this->check_hash( get_option( $this->shortname.'_background_color' ) );
  120. }
  121. function borderColor() {
  122. return $this->check_hash( get_option( $this->shortname.'_border_color' ) );
  123. }
  124. function linkColor() {
  125. return $this->check_hash( get_option( $this->shortname.'_link_color' ) );
  126. }
  127. function hoverColor() {
  128. return $this->check_hash( get_option( $this->shortname.'_hover_color' ) );
  129. }
  130. function imageHover() {
  131. return get_option( $this->shortname.'_image_hover' );
  132. }
  133. function check_hash( $value ) {
  134. // if color value doesn't have a hash, add it
  135. if ( false === strpos( $value, '#' ) )
  136. $value = '#' . $value;
  137. return $value;
  138. }
  139. }
  140. }
  141. /* SETTING EVERYTHING IN MOTION */
  142. if (class_exists('Vigilance')) {
  143. $vigilance = new Vigilance();
  144. }
  145. ?>