Testimonials Widget - Version 3.0.1

Version Description

= 3.0.0 =

This is a major overhaul without backwards compliance of over 80 changes. Please read the Testimonials Widget 3.0 and Testimonials Widget Premium 2.0 Upgrade Notice for more help.

If you use custom CSS, actions, or filters to modify Testimonials Widget and Testimonials Widget Premium actions or output, this upgrade will not be compatible with those modifications until corrections are made.

= Older Versions =

Read UPGRADING.

Download this release

Release Info

Developer comprock
Plugin Icon wp plugin Testimonials Widget
Version 3.0.1
Comparing to
See all releases

Code changes from version 3.0.0 to 3.0.1

Files changed (221) hide show
  1. CHANGELOG.md +13 -0
  2. includes/class-testimonials-widget-settings.php +10 -2
  3. includes/class-testimonials-widget.php +10 -8
  4. includes/libraries/aihrus-framework/CHANGELOG.md +4 -0
  5. includes/libraries/aihrus-framework/README.md +5 -1
  6. includes/libraries/aihrus-framework/aihrus-framework.php +1 -1
  7. includes/libraries/aihrus-framework/includes/class-aihrus-common.php +5 -5
  8. includes/libraries/aihrus-framework/includes/class-aihrus-settings.php +2 -2
  9. includes/libraries/aihrus-framework/includes/class-aihrus-widget.php +1 -1
  10. includes/requirements.php +1 -1
  11. languages/testimonials-widget.pot +172 -164
  12. readme.txt +19 -3
  13. testimonials-widget.php +3 -5
  14. trunk/API.md +0 -267
  15. trunk/CHANGELOG.md +0 -1415
  16. trunk/CONTRIBUTING.md +0 -41
  17. trunk/DEPRECATED.md +0 -11
  18. trunk/EXAMPLES.md +0 -51
  19. trunk/LICENSE +0 -339
  20. trunk/README.md +0 -42
  21. trunk/UPGRADING.md +0 -159
  22. trunk/assets/css/images/bx_loader.gif +0 -0
  23. trunk/assets/css/images/controls.png +0 -0
  24. trunk/assets/css/jquery.bxslider.css +0 -204
  25. trunk/assets/css/testimonials-widget-2.14.0.css +0 -120
  26. trunk/assets/css/testimonials-widget-ie7.css +0 -15
  27. trunk/assets/css/testimonials-widget.css +0 -128
  28. trunk/assets/images/michael-cannon-red-square-300x2251.jpg +0 -0
  29. trunk/assets/js/jquery.bxslider.js +0 -1343
  30. trunk/assets/js/jquery.bxslider.min.js +0 -10
  31. trunk/assets/js/jquery.easing.1.3.js +0 -205
  32. trunk/assets/js/jquery.fitvids.js +0 -80
  33. trunk/includes/class-testimonials-widget-archives-widget.php +0 -82
  34. trunk/includes/class-testimonials-widget-categories-widget.php +0 -92
  35. trunk/includes/class-testimonials-widget-recent-testimonials-widget.php +0 -85
  36. trunk/includes/class-testimonials-widget-settings.php +0 -1079
  37. trunk/includes/class-testimonials-widget-slider-widget.php +0 -116
  38. trunk/includes/class-testimonials-widget-tag-cloud-widget.php +0 -95
  39. trunk/includes/class-testimonials-widget-template-loader.php +0 -45
  40. trunk/includes/class-testimonials-widget-widget.php +0 -117
  41. trunk/includes/class-testimonials-widget.php +0 -2322
  42. trunk/includes/libraries/Gamajo-Template-Loader/LICENSE +0 -339
  43. trunk/includes/libraries/Gamajo-Template-Loader/README.md +0 -60
  44. trunk/includes/libraries/Gamajo-Template-Loader/class-gamajo-template-loader.php +0 -222
  45. trunk/includes/libraries/Gamajo-Template-Loader/class-meal-planner-template-loader.php +0 -58
  46. trunk/includes/libraries/Gamajo-Template-Loader/composer.json +0 -24
  47. trunk/includes/libraries/aihrus-framework/CHANGELOG.md +0 -141
  48. trunk/includes/libraries/aihrus-framework/LICENSE +0 -339
  49. trunk/includes/libraries/aihrus-framework/README.md +0 -74
  50. trunk/includes/libraries/aihrus-framework/aihrus-framework.php +0 -367
  51. trunk/includes/libraries/aihrus-framework/class-aihrus-common.php +0 -462
  52. trunk/includes/libraries/aihrus-framework/class-aihrus-licensing.php +0 -188
  53. trunk/includes/libraries/aihrus-framework/class-aihrus-settings.php +0 -757
  54. trunk/includes/libraries/aihrus-framework/class-aihrus-widget.php +0 -252
  55. trunk/includes/libraries/aihrus-framework/includes/class-aihrus-common.php +0 -780
  56. trunk/includes/libraries/aihrus-framework/includes/class-aihrus-licensing.php +0 -221
  57. trunk/includes/libraries/aihrus-framework/includes/class-aihrus-settings.php +0 -903
  58. trunk/includes/libraries/aihrus-framework/includes/class-aihrus-widget.php +0 -363
  59. trunk/includes/libraries/aihrus-framework/includes/interface-aihrus-common.php +0 -27
  60. trunk/includes/libraries/aihrus-framework/includes/interface-aihrus-licensing.php +0 -28
  61. trunk/includes/libraries/aihrus-framework/includes/interface-aihrus-widget.php +0 -33
  62. trunk/includes/libraries/aihrus-framework/includes/libraries/class-redrokk-metabox-class.php +0 -1471
  63. trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/LICENSE.txt +0 -20
  64. trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/Parsedown.php +0 -1402
  65. trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/README.md +0 -43
  66. trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/composer.json +0 -18
  67. trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/phpunit.xml.dist +0 -8
  68. trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/Test.php +0 -65
  69. trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/bootstrap.php +0 -3
  70. trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/HTML_Comment.html +0 -5
  71. trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/HTML_Comment.md +0 -8
  72. trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/aesthetic_table.html +0 -18
  73. trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/aesthetic_table.md +0 -4
  74. trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/aligned_table.html +0 -21
  75. trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/aligned_table.md +0 -4
  76. trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/atx_heading.html +0 -9
  77. trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/atx_heading.md +0 -17
  78. trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/automatic_link.html +0 -1
  79. trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/automatic_link.md +0 -1
  80. trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/block-level_html.html +0 -13
  81. trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/block-level_html.md +0 -17
  82. trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/code_block.html +0 -8
  83. trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/code_block.md +0 -10
  84. trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/code_span.html +0 -6
  85. trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/code_span.md +0 -11
  86. trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/compound_blockquote.html +0 -9
  87. trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/compound_blockquote.md +0 -10
  88. trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/compound_emphasis.html +0 -2
  89. trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/compound_emphasis.md +0 -4
  90. trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/compound_list.html +0 -12
  91. trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/compound_list.md +0 -7
  92. trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/deeply_nested_list.html +0 -12
  93. trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/deeply_nested_list.md +0 -6
  94. trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/em_strong.html +0 -8
  95. trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/em_strong.md +0 -15
  96. trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/email.html +0 -1
  97. trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/email.md +0 -1
  98. trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/emphasis.html +0 -8
  99. trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/emphasis.md +0 -13
  100. trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/escaping.html +0 -4
  101. trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/escaping.md +0 -7
  102. trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/fenced_code_block.html +0 -6
  103. trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/fenced_code_block.md +0 -14
  104. trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/horizontal_rule.html +0 -5
  105. trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/horizontal_rule.md +0 -9
  106. trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/html_entity.html +0 -1
  107. trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/html_entity.md +0 -1
  108. trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/image_reference.html +0 -1
  109. trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/image_reference.md +0 -3
  110. trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/image_title.html +0 -1
  111. trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/image_title.md +0 -1
  112. trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/implicit_reference.html +0 -4
  113. trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/implicit_reference.md +0 -13
  114. trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/inline_link.html +0 -4
  115. trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/inline_link.md +0 -7
  116. trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/inline_link_title.html +0 -1
  117. trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/inline_link_title.md +0 -1
  118. trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/inline_title.html +0 -1
  119. trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/inline_title.md +0 -1
  120. trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/lazy_blockquote.html +0 -6
  121. trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/lazy_blockquote.md +0 -5
  122. trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/lazy_list.html +0 -4
  123. trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/lazy_list.md +0 -2
  124. trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/line_break.html +0 -2
  125. trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/line_break.md +0 -2
  126. trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/multiline_list_paragraph.html +0 -7
  127. trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/multiline_list_paragraph.md +0 -4
  128. trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/nested_block-level_html.html +0 -10
  129. trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/nested_block-level_html.md +0 -11
  130. trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/ordered_list.html +0 -13
  131. trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/ordered_list.md +0 -11
  132. trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/paragraph_list.html +0 -12
  133. trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/paragraph_list.md +0 -9
  134. trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/reference_title.html +0 -2
  135. trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/reference_title.md +0 -6
  136. trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/self-closing_html.html +0 -12
  137. trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/self-closing_html.md +0 -12
  138. trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/separated_nested_list.html +0 -9
  139. trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/separated_nested_list.md +0 -4
  140. trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/setext_header.html +0 -5
  141. trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/setext_header.md +0 -12
  142. trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/simple_blockquote.html +0 -11
  143. trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/simple_blockquote.md +0 -7
  144. trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/simple_table.html +0 -37
  145. trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/simple_table.md +0 -11
  146. trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/span-level_html.html +0 -5
  147. trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/span-level_html.md +0 -8
  148. trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/sparse_dense_list.html +0 -7
  149. trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/sparse_dense_list.md +0 -4
  150. trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/sparse_list.html +0 -15
  151. trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/sparse_list.md +0 -9
  152. trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/special_characters.html +0 -6
  153. trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/special_characters.md +0 -13
  154. trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/strikethrough.html +0 -3
  155. trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/strikethrough.md +0 -5
  156. trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/strong_em.html +0 -6
  157. trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/strong_em.md +0 -11
  158. trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/tab-indented_code_block.html +0 -6
  159. trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/tab-indented_code_block.md +0 -6
  160. trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/table_inline_markdown.html +0 -18
  161. trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/table_inline_markdown.md +0 -4
  162. trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/text_reference.html +0 -8
  163. trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/text_reference.md +0 -21
  164. trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/unordered_list.html +0 -10
  165. trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/unordered_list.md +0 -8
  166. trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/untidy_table.html +0 -18
  167. trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/untidy_table.md +0 -4
  168. trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/url_autolinking.html +0 -3
  169. trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/url_autolinking.md +0 -5
  170. trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/whitespace.html +0 -1
  171. trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/whitespace.md +0 -5
  172. trunk/includes/libraries/aihrus-framework/includes/libraries/wp_custom_post_status.php +0 -234
  173. trunk/includes/libraries/aihrus-framework/interface-aihrus-common.php +0 -27
  174. trunk/includes/libraries/aihrus-framework/interface-aihrus-licensing.php +0 -28
  175. trunk/includes/libraries/aihrus-framework/interface-aihrus-widget.php +0 -33
  176. trunk/includes/libraries/aihrus-framework/requirements.php +0 -270
  177. trunk/includes/libraries/bxslider-4/bower.json +0 -25
  178. trunk/includes/libraries/bxslider-4/images/bx_loader.gif +0 -0
  179. trunk/includes/libraries/bxslider-4/images/controls.png +0 -0
  180. trunk/includes/libraries/bxslider-4/jquery.bxslider.css +0 -204
  181. trunk/includes/libraries/bxslider-4/jquery.bxslider.js +0 -1343
  182. trunk/includes/libraries/bxslider-4/jquery.bxslider.min.js +0 -10
  183. trunk/includes/libraries/bxslider-4/plugins/jquery.easing.1.3.js +0 -205
  184. trunk/includes/libraries/bxslider-4/plugins/jquery.fitvids.js +0 -80
  185. trunk/includes/libraries/bxslider-4/readme.md +0 -578
  186. trunk/includes/libraries/class-redrokk-metabox-class.php +0 -1436
  187. trunk/includes/requirements.php +0 -69
  188. trunk/languages/testimonials-widget-he_IL.mo +0 -0
  189. trunk/languages/testimonials-widget-he_IL.po +0 -546
  190. trunk/languages/testimonials-widget-nl_NL.mo +0 -0
  191. trunk/languages/testimonials-widget-nl_NL.po +0 -631
  192. trunk/languages/testimonials-widget.pot +0 -1164
  193. trunk/readme.txt +0 -370
  194. trunk/templates/span-author-email.php +0 -9
  195. trunk/templates/span-author-url.php +0 -8
  196. trunk/templates/span-author.php +0 -8
  197. trunk/templates/span-company-url.php +0 -6
  198. trunk/templates/span-company.php +0 -6
  199. trunk/templates/span-email.php +0 -9
  200. trunk/templates/span-job-title.php +0 -6
  201. trunk/templates/span-join-company.php +0 -4
  202. trunk/templates/span-join-location.php +0 -4
  203. trunk/templates/span-join-title.php +0 -4
  204. trunk/templates/span-location.php +0 -6
  205. trunk/templates/span-url.php +0 -9
  206. trunk/templates/testimonial-bottom.php +0 -6
  207. trunk/templates/testimonial-cite.php +0 -78
  208. trunk/templates/testimonial-close.php +0 -4
  209. trunk/templates/testimonial-content.php +0 -35
  210. trunk/templates/testimonial-extra.php +0 -6
  211. trunk/templates/testimonial-image.php +0 -6
  212. trunk/templates/testimonial-open.php +0 -41
  213. trunk/templates/testimonials-archives.php +0 -42
  214. trunk/templates/testimonials-categories.php +0 -50
  215. trunk/templates/testimonials-close.php +0 -4
  216. trunk/templates/testimonials-open.php +0 -18
  217. trunk/templates/testimonials-paging.php +0 -41
  218. trunk/templates/testimonials-recent.php +0 -40
  219. trunk/templates/testimonials-tag-cloud.php +0 -13
  220. trunk/testimonials-widget.php +0 -201
  221. trunk/wpml-config.xml +0 -20
CHANGELOG.md CHANGED
@@ -2,6 +2,19 @@
2
 
3
  ## master
4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5
  ## 3.0.0
6
  * Add DEPRECATED.md, EXAMPLES.md, and UPGRADING.md documentation
7
  * Add filter `tw_examples_html`
2
 
3
  ## master
4
 
5
+ ## 3.0.1
6
+ * Add Documentation section to readme
7
+ * FAQ Got `The plugin does not have a valid header` error?
8
+ * Require Aihrus Framework 1.1.6
9
+ * RESOLVE #158 Minify JS
10
+ * RESOLVE is_array( $args['tax_query'] ) notice
11
+ * RESOLVE Missing slideWidth 0
12
+ * RESOLVE Notice: Undefined index: tag_slug__in
13
+ * RESOLVE Slide Width stuck on 200 pixels
14
+ * RESOLVE The plugin does not have a valid header - remove blank lines between header comments
15
+ * Restore settings page name as Testimonials Widget Settings
16
+ * Swap Shortcode Examples and Attributes tab positions
17
+
18
  ## 3.0.0
19
  * Add DEPRECATED.md, EXAMPLES.md, and UPGRADING.md documentation
20
  * Add filter `tw_examples_html`
includes/class-testimonials-widget-settings.php CHANGED
@@ -33,7 +33,7 @@ if ( class_exists( 'Testimonials_Widget_Settings' ) ) {
33
 
34
  class Testimonials_Widget_Settings extends Aihrus_Settings {
35
  const ID = 'testimonialswidget_settings';
36
- const NAME = 'Testimonials Settings';
37
 
38
  public static $admin_page;
39
  public static $class = __CLASS__;
@@ -120,8 +120,8 @@ class Testimonials_Widget_Settings extends Aihrus_Settings {
120
 
121
  parent::sections();
122
 
123
- self::$sections['examples'] = esc_html__( 'Shortcode Examples', 'testimonials-widget' );
124
  self::$sections['options'] = esc_html__( 'Shortcode Attributes', 'testimonials-widget' );
 
125
 
126
  self::$sections = apply_filters( 'tw_sections', self::$sections );
127
  }
@@ -197,6 +197,14 @@ class Testimonials_Widget_Settings extends Aihrus_Settings {
197
  'std' => 1,
198
  );
199
 
 
 
 
 
 
 
 
 
200
  self::$settings['transition_mode'] = array(
201
  'section' => 'widget',
202
  'title' => esc_html__( 'Transition Mode?', 'testimonials-widget' ),
33
 
34
  class Testimonials_Widget_Settings extends Aihrus_Settings {
35
  const ID = 'testimonialswidget_settings';
36
+ const NAME = 'Testimonials Widget Settings';
37
 
38
  public static $admin_page;
39
  public static $class = __CLASS__;
120
 
121
  parent::sections();
122
 
 
123
  self::$sections['options'] = esc_html__( 'Shortcode Attributes', 'testimonials-widget' );
124
+ self::$sections['examples'] = esc_html__( 'Shortcode Examples', 'testimonials-widget' );
125
 
126
  self::$sections = apply_filters( 'tw_sections', self::$sections );
127
  }
197
  'std' => 1,
198
  );
199
 
200
+ self::$settings['slide_width'] = array(
201
+ 'section' => 'widget',
202
+ 'title' => esc_html__( 'Slide Width?', 'testimonials-widget' ),
203
+ 'desc' => esc_html__( 'Width of each testimonial. Increase to thumbnail width or greater for improved looks. Requried for horizontal transitions.', 'testimonials-widget' ),
204
+ 'validate' => 'intval',
205
+ 'std' => 0,
206
+ );
207
+
208
  self::$settings['transition_mode'] = array(
209
  'section' => 'widget',
210
  'title' => esc_html__( 'Transition Mode?', 'testimonials-widget' ),
includes/class-testimonials-widget.php CHANGED
@@ -751,7 +751,7 @@ class Testimonials_Widget extends Aihrus_Common {
751
  wp_enqueue_script( 'jquery.fitvids' );
752
  }
753
 
754
- wp_register_script( 'jquery.bxslider', self::$library_assets . 'bxslider-4/jquery.bxslider.js', array( 'jquery' ), '4.1.2', true );
755
  wp_enqueue_script( 'jquery.bxslider' );
756
 
757
  do_action( 'tw_scripts', $atts );
@@ -811,6 +811,7 @@ class Testimonials_Widget extends Aihrus_Common {
811
  $adaptive_height = $atts['adaptive_height'] ? 'true' : 'false';
812
  $enable_video = $atts['enable_video'];
813
  $show_start_stop = $atts['show_start_stop'];
 
814
  $transition_mode = $atts['transition_mode'];
815
 
816
  $auto = $refresh_interval ? 'true' : 'false';
@@ -835,7 +836,8 @@ jQuery(document).ready(function() {
835
  {$pager},
836
  pause: {$pause},
837
  {$video},
838
- slideMargin: 2
 
839
  });
840
  });
841
  EOF;
@@ -996,7 +998,7 @@ EOF;
996
  * @SuppressWarnings(PHPMD.Superglobals)
997
  */
998
  public static function format_content( $content, $widget_number, $atts ) {
999
- if ( empty ( $content ) ) {
1000
  return $content;
1001
  }
1002
 
@@ -1147,14 +1149,14 @@ EOF;
1147
  foreach ( $tags as $tag ) {
1148
  if ( ! preg_match( '#^\d+$#', $tag ) ) {
1149
  if ( $tags_all ) {
1150
- if ( ! is_array( $args['tag_slug__and'] ) ) {
1151
  $args['tag_slug__and'] = array();
1152
  }
1153
 
1154
  $args['tag_slug__and'][] = $tag;
1155
  }
1156
  else {
1157
- if ( ! is_array( $args['tag_slug__in'] ) ) {
1158
  $args['tag_slug__in'] = array();
1159
  }
1160
 
@@ -1162,14 +1164,14 @@ EOF;
1162
  }
1163
  } else {
1164
  if ( $tags_all ) {
1165
- if ( ! is_array( $args['tag__and'] ) ) {
1166
  $args['tag__and'] = array();
1167
  }
1168
 
1169
  $args['tag__and'][] = $tag;
1170
  }
1171
  else {
1172
- if ( ! is_array( $args['tag__in'] ) ) {
1173
  $args['tag__in'] = array();
1174
  }
1175
 
@@ -1179,7 +1181,7 @@ EOF;
1179
  }
1180
  }
1181
  } else {
1182
- if ( ! is_array( $args['tax_query'] ) ) {
1183
  $args['tax_query'] = array();
1184
  }
1185
 
751
  wp_enqueue_script( 'jquery.fitvids' );
752
  }
753
 
754
+ wp_register_script( 'jquery.bxslider', self::$library_assets . 'bxslider-4/jquery.bxslider.min.js', array( 'jquery' ), '4.1.2', true );
755
  wp_enqueue_script( 'jquery.bxslider' );
756
 
757
  do_action( 'tw_scripts', $atts );
811
  $adaptive_height = $atts['adaptive_height'] ? 'true' : 'false';
812
  $enable_video = $atts['enable_video'];
813
  $show_start_stop = $atts['show_start_stop'];
814
+ $slide_width = empty( $slide_width ) ? 0 : $atts['slide_width'];
815
  $transition_mode = $atts['transition_mode'];
816
 
817
  $auto = $refresh_interval ? 'true' : 'false';
836
  {$pager},
837
  pause: {$pause},
838
  {$video},
839
+ slideMargin: 2,
840
+ slideWidth: {$slide_width}
841
  });
842
  });
843
  EOF;
998
  * @SuppressWarnings(PHPMD.Superglobals)
999
  */
1000
  public static function format_content( $content, $widget_number, $atts ) {
1001
+ if ( empty( $content ) ) {
1002
  return $content;
1003
  }
1004
 
1149
  foreach ( $tags as $tag ) {
1150
  if ( ! preg_match( '#^\d+$#', $tag ) ) {
1151
  if ( $tags_all ) {
1152
+ if ( empty( $args['tag_slug__and'] ) || ! is_array( $args['tag_slug__and'] ) ) {
1153
  $args['tag_slug__and'] = array();
1154
  }
1155
 
1156
  $args['tag_slug__and'][] = $tag;
1157
  }
1158
  else {
1159
+ if ( empty( $args['tag_slug__in'] ) || ! is_array( $args['tag_slug__in'] ) ) {
1160
  $args['tag_slug__in'] = array();
1161
  }
1162
 
1164
  }
1165
  } else {
1166
  if ( $tags_all ) {
1167
+ if ( empty( $args['tag__and'] ) || ! is_array( $args['tag__and'] ) ) {
1168
  $args['tag__and'] = array();
1169
  }
1170
 
1171
  $args['tag__and'][] = $tag;
1172
  }
1173
  else {
1174
+ if ( empty( $args['tag__in'] ) || ! is_array( $args['tag__in'] ) ) {
1175
  $args['tag__in'] = array();
1176
  }
1177
 
1181
  }
1182
  }
1183
  } else {
1184
+ if ( empty( $args['tax_query'] ) || ! is_array( $args['tax_query'] ) ) {
1185
  $args['tax_query'] = array();
1186
  }
1187
 
includes/libraries/aihrus-framework/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@
2
 
3
  ## master
4
 
 
 
 
 
5
  ## 1.1.5
6
  * Abstract do_validate_settings for easier reuse
7
  * Add 'content' option to settings display
2
 
3
  ## master
4
 
5
+ ## 1.1.6
6
+ * RESOLVE michael-cannon/testimonials-widget#162 Error: This is not a valid feed template with WordPress SEO sitemap
7
+ * Denote included libraries
8
+
9
  ## 1.1.5
10
  * Abstract do_validate_settings for easier reuse
11
  * Add 'content' option to settings display
includes/libraries/aihrus-framework/README.md CHANGED
@@ -21,7 +21,7 @@ A helper library for WordPress plugins by Aihrus.
21
  ```
22
  git remote add aihrus https://github.com/michael-cannon/aihrus-framework.git
23
  git subtree add -P include/libraries/aihrus-framework aihrus master
24
- git commit -a -m "Readd aihrus framework"
25
  git push origin master
26
  ```
27
 
@@ -72,3 +72,7 @@ git subtree pull -P include/libraries/aihrus-framework aihrus master
72
  ```
73
  git push origin master
74
  ```
 
 
 
 
21
  ```
22
  git remote add aihrus https://github.com/michael-cannon/aihrus-framework.git
23
  git subtree add -P include/libraries/aihrus-framework aihrus master
24
+ git commit -a -m "Read aihrus framework"
25
  git push origin master
26
  ```
27
 
72
  ```
73
  git push origin master
74
  ```
75
+
76
+ ## Included Libraries
77
+
78
+ * [Parsedown](http://parsedown.org/)
includes/libraries/aihrus-framework/aihrus-framework.php CHANGED
@@ -35,7 +35,7 @@ if ( ! defined( 'AIHR_DIR_LIB' ) ) {
35
  }
36
 
37
  if ( ! defined( 'AIHR_VERSION' ) ) {
38
- define( 'AIHR_VERSION', '1.1.5' );
39
  }
40
 
41
  require_once ABSPATH . 'wp-admin/includes/plugin.php';
35
  }
36
 
37
  if ( ! defined( 'AIHR_VERSION' ) ) {
38
+ define( 'AIHR_VERSION', '1.1.6' );
39
  }
40
 
41
  require_once ABSPATH . 'wp-admin/includes/plugin.php';
includes/libraries/aihrus-framework/includes/class-aihrus-common.php CHANGED
@@ -568,7 +568,7 @@ EOD;
568
  public static function get_archive_slug( $cpt ) {
569
  $post_type = get_post_type_object( $cpt );
570
  $archive_slug = $post_type->has_archive;
571
- if ( $archive_slug === true ) {
572
  $archive_slug = $post_type->name;
573
  }
574
 
@@ -585,7 +585,7 @@ EOD;
585
  public static function rewrite_rules_date_archives( $cpt, $wp_rewrite ) {
586
  $rules = array();
587
  $slug_archive = self::get_archive_slug( $cpt );
588
- if ( $slug_archive === false ) {
589
  return $rules;
590
  }
591
 
@@ -640,10 +640,10 @@ EOD;
640
  }
641
 
642
 
643
- public static function rewrite_rules_feed( $wp_rewrite ) {
644
  $rules = array(
645
- 'feed/(.+)' => 'index.php?feed=' . $wp_rewrite->preg_index( 1 ),
646
- '(.+).xml' => 'index.php?feed=' . $wp_rewrite->preg_index( 1 ),
647
  );
648
 
649
  return $rules;
568
  public static function get_archive_slug( $cpt ) {
569
  $post_type = get_post_type_object( $cpt );
570
  $archive_slug = $post_type->has_archive;
571
+ if ( true === $archive_slug ) {
572
  $archive_slug = $post_type->name;
573
  }
574
 
585
  public static function rewrite_rules_date_archives( $cpt, $wp_rewrite ) {
586
  $rules = array();
587
  $slug_archive = self::get_archive_slug( $cpt );
588
+ if ( false === $slug_archive ) {
589
  return $rules;
590
  }
591
 
640
  }
641
 
642
 
643
+ public static function rewrite_rules_feed( $wp_rewrite, $slug ) {
644
  $rules = array(
645
+ "feed/({$slug})" => 'index.php?feed=' . $wp_rewrite->preg_index( 1 ),
646
+ "({$slug}).xml" => 'index.php?feed=' . $wp_rewrite->preg_index( 1 ),
647
  );
648
 
649
  return $rules;
includes/libraries/aihrus-framework/includes/class-aihrus-settings.php CHANGED
@@ -344,7 +344,7 @@ abstract class Aihrus_Settings {
344
  $options[ $id ] = $input;
345
  }
346
 
347
- if ( ! isset( $options[ $id ] ) && $type != 'checkbox' ) {
348
  $options[ $id ] = $std;
349
  } elseif ( ! isset( $options[ $id ] ) ) {
350
  $options[ $id ] = 0;
@@ -491,7 +491,7 @@ abstract class Aihrus_Settings {
491
  register_setting( static::ID, static::ID, array( static::$class, 'validate_settings' ) );
492
 
493
  foreach ( static::$sections as $slug => $title ) {
494
- if ( $slug == 'about' ) {
495
  add_settings_section( $slug, $title, array( static::$class, 'display_about' ), static::ID );
496
  } else {
497
  add_settings_section( $slug, $title, array( static::$class, 'display_section' ), static::ID );
344
  $options[ $id ] = $input;
345
  }
346
 
347
+ if ( ! isset( $options[ $id ] ) && 'checkbox' != $type ) {
348
  $options[ $id ] = $std;
349
  } elseif ( ! isset( $options[ $id ] ) ) {
350
  $options[ $id ] = 0;
491
  register_setting( static::ID, static::ID, array( static::$class, 'validate_settings' ) );
492
 
493
  foreach ( static::$sections as $slug => $title ) {
494
+ if ( 'about' == $slug ) {
495
  add_settings_section( $slug, $title, array( static::$class, 'display_about' ), static::ID );
496
  } else {
497
  add_settings_section( $slug, $title, array( static::$class, 'display_section' ), static::ID );
includes/libraries/aihrus-framework/includes/class-aihrus-widget.php CHANGED
@@ -201,7 +201,7 @@ abstract class Aihrus_Widget extends WP_Widget {
201
  return;
202
  }
203
 
204
- if ( ! isset( $options[ $id ] ) && $type != 'checkbox' ) {
205
  $options[ $id ] = $std;
206
  } elseif ( ! isset( $options[ $id ] ) ) {
207
  $options[ $id ] = 0;
201
  return;
202
  }
203
 
204
+ if ( ! isset( $options[ $id ] ) && 'checkbox' != $type ) {
205
  $options[ $id ] = $std;
206
  } elseif ( ! isset( $options[ $id ] ) ) {
207
  $options[ $id ] = 0;
includes/requirements.php CHANGED
@@ -23,7 +23,7 @@ require_once TW_DIR_LIB . 'aihrus-framework/aihrus-framework.php';
23
 
24
  function tw_requirements_check( $force_check = false ) {
25
  $check_okay = get_transient( 'tw_requirements_check' );
26
- if ( empty( $force_check ) && $check_okay !== false ) {
27
  return $check_okay;
28
  }
29
 
23
 
24
  function tw_requirements_check( $force_check = false ) {
25
  $check_okay = get_transient( 'tw_requirements_check' );
26
+ if ( empty( $force_check ) && false !== $check_okay ) {
27
  return $check_okay;
28
  }
29
 
languages/testimonials-widget.pot CHANGED
@@ -2,9 +2,9 @@
2
  # This file is distributed under the same license as the Testimonials Widget package.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: Testimonials Widget 3.0.0\n"
6
  "Report-Msgid-Bugs-To: http://wordpress.org/tag/testimonials-widget\n"
7
- "POT-Creation-Date: 2014-10-14 19:31:18+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
@@ -68,46 +68,46 @@ msgid "Settings"
68
  msgstr ""
69
 
70
  #: includes/class-testimonials-widget-settings.php:113
71
- #: includes/class-testimonials-widget-settings.php:936
72
  msgid "General"
73
  msgstr ""
74
 
75
  #: includes/class-testimonials-widget-settings.php:114
76
- #: includes/class-testimonials-widget-settings.php:944
77
  msgid "Fields"
78
  msgstr ""
79
 
80
  #: includes/class-testimonials-widget-settings.php:115
81
- #: includes/class-testimonials-widget-settings.php:952
82
  msgid "Selection"
83
  msgstr ""
84
 
85
  #: includes/class-testimonials-widget-settings.php:116
86
- #: includes/class-testimonials-widget-settings.php:960
87
  msgid "Ordering"
88
  msgstr ""
89
 
90
  #: includes/class-testimonials-widget-settings.php:117
91
- #: includes/class-testimonials-widget-settings.php:968
92
  msgid "Columns"
93
  msgstr ""
94
 
95
  #: includes/class-testimonials-widget-settings.php:118
96
- #: includes/class-testimonials-widget-settings.php:976
97
  msgid "Post Type"
98
  msgstr ""
99
 
100
  #: includes/class-testimonials-widget-settings.php:119
101
- #: includes/class-testimonials-widget-settings.php:984
102
  msgid "Slider Widget"
103
  msgstr ""
104
 
105
  #: includes/class-testimonials-widget-settings.php:123
106
- msgid "Shortcode Examples"
107
  msgstr ""
108
 
109
  #: includes/class-testimonials-widget-settings.php:124
110
- msgid "Shortcode Attributes"
111
  msgstr ""
112
 
113
  #: includes/class-testimonials-widget-settings.php:139
@@ -180,479 +180,487 @@ msgid "Display start and stop buttons underneath the testimonial slider."
180
  msgstr ""
181
 
182
  #: includes/class-testimonials-widget-settings.php:202
183
- msgid "Transition Mode?"
184
  msgstr ""
185
 
186
  #: includes/class-testimonials-widget-settings.php:203
 
 
 
 
 
 
 
 
187
  msgid "Type of transition between slides."
188
  msgstr ""
189
 
190
- #: includes/class-testimonials-widget-settings.php:206
191
  msgid "Fade"
192
  msgstr ""
193
 
194
- #: includes/class-testimonials-widget-settings.php:207
195
  msgid "Horizontal"
196
  msgstr ""
197
 
198
- #: includes/class-testimonials-widget-settings.php:208
199
  msgid "Vertical"
200
  msgstr ""
201
 
202
- #: includes/class-testimonials-widget-settings.php:220
203
  msgid "General Options"
204
  msgstr ""
205
 
206
- #: includes/class-testimonials-widget-settings.php:225
207
  msgid "Default Reviewed Item?"
208
  msgstr ""
209
 
210
- #: includes/class-testimonials-widget-settings.php:226
211
  msgid "Name of thing being referenced in testimonials."
212
  msgstr ""
213
 
214
- #: includes/class-testimonials-widget-settings.php:233
215
  msgid "Default Reviewed Item URL?"
216
  msgstr ""
217
 
218
- #: includes/class-testimonials-widget-settings.php:234
219
  msgid "URL of thing being referenced in testimonials."
220
  msgstr ""
221
 
222
- #: includes/class-testimonials-widget-settings.php:241
223
  msgid "Disable built-in quotes?"
224
  msgstr ""
225
 
226
- #: includes/class-testimonials-widget-settings.php:242
227
  msgid "Remove open and close quote span tags surrounding testimonial content."
228
  msgstr ""
229
 
230
- #: includes/class-testimonials-widget-settings.php:248
231
  msgid "Disable \"Testimonials Not Found\"?"
232
  msgstr ""
233
 
234
- #: includes/class-testimonials-widget-settings.php:249
235
  msgid "Remove \"Testimonials Not Found\" content when no testimonials are found to be displayed."
236
  msgstr ""
237
 
238
- #: includes/class-testimonials-widget-settings.php:255
239
  msgid "Enable Paging?"
240
  msgstr ""
241
 
242
- #: includes/class-testimonials-widget-settings.php:256
243
  msgid "Show paging controls for `[testimonials]` listing."
244
  msgstr ""
245
 
246
- #: includes/class-testimonials-widget-settings.php:259
247
  msgid "Disable"
248
  msgstr ""
249
 
250
- #: includes/class-testimonials-widget-settings.php:260
251
  msgid "Enable"
252
  msgstr ""
253
 
254
- #: includes/class-testimonials-widget-settings.php:261
255
  msgid "Before testimonials"
256
  msgstr ""
257
 
258
- #: includes/class-testimonials-widget-settings.php:262
259
  msgid "After testimonials"
260
  msgstr ""
261
 
262
- #: includes/class-testimonials-widget-settings.php:268
263
  msgid "Adds HTML tag markup per the <a href=\"%s\">Review schema</a> to testimonials. Search engines including Bing, Google, Yahoo! and Yandex rely on this markup to improve the display of search results."
264
  msgstr ""
265
 
266
- #: includes/class-testimonials-widget-settings.php:271
267
  msgid "Enable Review Schema?"
268
  msgstr ""
269
 
270
- #: includes/class-testimonials-widget-settings.php:279
271
  msgid "Enable [shortcodes]?"
272
  msgstr ""
273
 
274
- #: includes/class-testimonials-widget-settings.php:280
275
  msgid "If unchecked, shortcodes are stripped."
276
  msgstr ""
277
 
278
- #: includes/class-testimonials-widget-settings.php:287
279
  msgid "Enable Video?"
280
  msgstr ""
281
 
282
- #: includes/class-testimonials-widget-settings.php:288
283
  msgid "Only enable when displaying video content."
284
  msgstr ""
285
 
286
- #: includes/class-testimonials-widget-settings.php:294
287
  msgid "Exclude bxSlider CSS?"
288
  msgstr ""
289
 
290
- #: includes/class-testimonials-widget-settings.php:295
291
  msgid "For a bare-bones, unthemed slider."
292
  msgstr ""
293
 
294
- #: includes/class-testimonials-widget-settings.php:303
295
  msgid "Exclude default CSS?"
296
  msgstr ""
297
 
298
- #: includes/class-testimonials-widget-settings.php:304
299
  msgid "Prevent default CSS from being loaded."
300
  msgstr ""
301
 
302
- #: includes/class-testimonials-widget-settings.php:312
303
  msgid "Remove `.hentry` CSS?"
304
  msgstr ""
305
 
306
- #: includes/class-testimonials-widget-settings.php:313
307
  msgid "Some themes use class `.hentry` in a manner that breaks Testimonials' CSS."
308
  msgstr ""
309
 
310
- #: includes/class-testimonials-widget-settings.php:320
311
  msgid "URL Target"
312
  msgstr ""
313
 
314
- #: includes/class-testimonials-widget-settings.php:321
315
  msgid "Add target to all URLs; leave blank if none."
316
  msgstr ""
317
 
318
- #: includes/class-testimonials-widget-settings.php:326
319
  msgid "Use `&lt;q&gt;` tag?"
320
  msgstr ""
321
 
322
- #: includes/class-testimonials-widget-settings.php:327
323
  msgid "Not HTML5 compliant."
324
  msgstr ""
325
 
326
- #: includes/class-testimonials-widget-settings.php:339
327
  msgid "Field Options"
328
  msgstr ""
329
 
330
- #: includes/class-testimonials-widget-settings.php:345
331
- #: includes/class-testimonials-widget-settings.php:611
332
  msgid "Hide Author?"
333
  msgstr ""
334
 
335
- #: includes/class-testimonials-widget-settings.php:348
336
  msgid "Don't display testimonial title in cite."
337
  msgstr ""
338
 
339
- #: includes/class-testimonials-widget-settings.php:353
340
- #: includes/class-testimonials-widget-settings.php:621
341
  msgid "Hide Company?"
342
  msgstr ""
343
 
344
- #: includes/class-testimonials-widget-settings.php:356
345
  msgid "Don't display testimonial company in cite."
346
  msgstr ""
347
 
348
- #: includes/class-testimonials-widget-settings.php:361
349
  msgid "Hide Content?"
350
  msgstr ""
351
 
352
- #: includes/class-testimonials-widget-settings.php:364
353
  msgid "Don't display testimonial content in a view."
354
  msgstr ""
355
 
356
- #: includes/class-testimonials-widget-settings.php:369
357
- #: includes/class-testimonials-widget-settings.php:631
358
  msgid "Hide Email?"
359
  msgstr ""
360
 
361
- #: includes/class-testimonials-widget-settings.php:373
362
  msgid "Don't display or link to testimonial email in cite."
363
  msgstr ""
364
 
365
- #: includes/class-testimonials-widget-settings.php:378
366
  msgid "Hide Gravatar?"
367
  msgstr ""
368
 
369
- #: includes/class-testimonials-widget-settings.php:381
370
  msgid "Don't display Gravatar image with testimonial."
371
  msgstr ""
372
 
373
- #: includes/class-testimonials-widget-settings.php:386
374
- #: includes/class-testimonials-widget-settings.php:651
375
  msgid "Hide Image?"
376
  msgstr ""
377
 
378
- #: includes/class-testimonials-widget-settings.php:389
379
  msgid "Don't display featured image with testimonial."
380
  msgstr ""
381
 
382
- #: includes/class-testimonials-widget-settings.php:394
383
  msgid "Hide Image in Single View?"
384
  msgstr ""
385
 
386
- #: includes/class-testimonials-widget-settings.php:402
387
- #: includes/class-testimonials-widget-settings.php:660
388
  msgid "Hide Job Title?"
389
  msgstr ""
390
 
391
- #: includes/class-testimonials-widget-settings.php:405
392
  msgid "Don't display testimonial job title in cite."
393
  msgstr ""
394
 
395
- #: includes/class-testimonials-widget-settings.php:410
396
- #: includes/class-testimonials-widget-settings.php:670
397
  msgid "Hide Location?"
398
  msgstr ""
399
 
400
- #: includes/class-testimonials-widget-settings.php:413
401
  msgid "Don't display testimonial location in cite."
402
  msgstr ""
403
 
404
- #: includes/class-testimonials-widget-settings.php:418
405
- #: includes/class-testimonials-widget-settings.php:689
406
  msgid "Hide URL?"
407
  msgstr ""
408
 
409
- #: includes/class-testimonials-widget-settings.php:421
410
  msgid "Don't display or link to testimonial URL in cite."
411
  msgstr ""
412
 
413
- #: includes/class-testimonials-widget-settings.php:431
414
  msgid "Selection Options"
415
  msgstr ""
416
 
417
- #: includes/class-testimonials-widget-settings.php:437
418
  msgid "Category Filter"
419
  msgstr ""
420
 
421
- #: includes/class-testimonials-widget-settings.php:438
422
  msgid "Comma separated category names or IDs."
423
  msgstr ""
424
 
425
- #: includes/class-testimonials-widget-settings.php:445
426
  msgid "Exclude IDs Filter"
427
  msgstr ""
428
 
429
- #: includes/class-testimonials-widget-settings.php:446
430
- #: includes/class-testimonials-widget-settings.php:453
431
  msgid "Comma separated testimonial IDs."
432
  msgstr ""
433
 
434
- #: includes/class-testimonials-widget-settings.php:452
435
  msgid "Include IDs Filter"
436
  msgstr ""
437
 
438
- #: includes/class-testimonials-widget-settings.php:459
439
  msgid "Limit"
440
  msgstr ""
441
 
442
- #: includes/class-testimonials-widget-settings.php:460
443
  msgid "Number of testimonials to select per instance."
444
  msgstr ""
445
 
446
- #: includes/class-testimonials-widget-settings.php:467
447
  msgid "Require All Tags?"
448
  msgstr ""
449
 
450
- #: includes/class-testimonials-widget-settings.php:468
451
  msgid "Select only testimonials with all of the given tags."
452
  msgstr ""
453
 
454
- #: includes/class-testimonials-widget-settings.php:475
455
  msgid "Tags Filter"
456
  msgstr ""
457
 
458
- #: includes/class-testimonials-widget-settings.php:476
459
  msgid "Comma separated tag names or IDs."
460
  msgstr ""
461
 
462
- #: includes/class-testimonials-widget-settings.php:489
463
  msgid "Ordering Options"
464
  msgstr ""
465
 
466
- #: includes/class-testimonials-widget-settings.php:495
467
  msgid "ORDER BY"
468
  msgstr ""
469
 
470
- #: includes/class-testimonials-widget-settings.php:496
471
  msgid "Used when \"Random Order\" is disabled."
472
  msgstr ""
473
 
474
- #: includes/class-testimonials-widget-settings.php:499
475
  msgid "Testimonial ID"
476
  msgstr ""
477
 
478
- #: includes/class-testimonials-widget-settings.php:500
479
- #: includes/class-testimonials-widget-settings.php:503
480
  #: includes/class-testimonials-widget.php:503
481
  #: includes/class-testimonials-widget.php:534
482
- #: includes/class-testimonials-widget.php:1363
483
  msgid "Author"
484
  msgstr ""
485
 
486
- #: includes/class-testimonials-widget-settings.php:501
487
  #: includes/class-testimonials-widget.php:505
488
  msgid "Date"
489
  msgstr ""
490
 
491
- #: includes/class-testimonials-widget-settings.php:502
492
  msgid "Menu Order"
493
  msgstr ""
494
 
495
- #: includes/class-testimonials-widget-settings.php:504
496
  msgid "No order"
497
  msgstr ""
498
 
499
- #: includes/class-testimonials-widget-settings.php:512
500
  msgid "ORDER BY meta_key"
501
  msgstr ""
502
 
503
- #: includes/class-testimonials-widget-settings.php:513
504
  msgid "Used when \"Random Order\" is disabled and sorting by a testimonials meta key is needed. Overrides ORDER BY."
505
  msgstr ""
506
 
507
- #: includes/class-testimonials-widget-settings.php:516
508
  msgid "None"
509
  msgstr ""
510
 
511
- #: includes/class-testimonials-widget-settings.php:517
512
  #: includes/class-testimonials-widget.php:539
513
- #: includes/class-testimonials-widget.php:1369
514
  msgid "Job Title"
515
  msgstr ""
516
 
517
- #: includes/class-testimonials-widget-settings.php:518
518
  #: includes/class-testimonials-widget.php:554
519
- #: includes/class-testimonials-widget.php:1387
520
  msgid "Email"
521
  msgstr ""
522
 
523
- #: includes/class-testimonials-widget-settings.php:519
524
  #: includes/class-testimonials-widget.php:544
525
- #: includes/class-testimonials-widget.php:1375
526
  msgid "Location"
527
  msgstr ""
528
 
529
- #: includes/class-testimonials-widget-settings.php:520
530
  #: includes/class-testimonials-widget.php:549
531
- #: includes/class-testimonials-widget.php:1381
532
  msgid "Company"
533
  msgstr ""
534
 
535
- #: includes/class-testimonials-widget-settings.php:521
536
  #: includes/class-testimonials-widget.php:559
537
- #: includes/class-testimonials-widget.php:1393
538
  msgid "URL"
539
  msgstr ""
540
 
541
- #: includes/class-testimonials-widget-settings.php:528
542
  msgid "ORDER BY Order"
543
  msgstr ""
544
 
545
- #: includes/class-testimonials-widget-settings.php:531
546
  msgid "Descending"
547
  msgstr ""
548
 
549
- #: includes/class-testimonials-widget-settings.php:532
550
  msgid "Ascending"
551
  msgstr ""
552
 
553
- #: includes/class-testimonials-widget-settings.php:540
554
  msgid "Random Order?"
555
  msgstr ""
556
 
557
- #: includes/class-testimonials-widget-settings.php:541
558
  msgid "If checked, ignores ORDER BY, ORDER BY meta_key, and ORDER BY Order. Widgets are random by default automatically."
559
  msgstr ""
560
 
561
- #: includes/class-testimonials-widget-settings.php:554
562
  msgid "Allow Comments?"
563
  msgstr ""
564
 
565
- #: includes/class-testimonials-widget-settings.php:555
566
  msgid "Only affects the Testimonials post edit page. Your theme controls the front-end view."
567
  msgstr ""
568
 
569
- #: includes/class-testimonials-widget-settings.php:562
570
  msgid "URL slug-name for <a href=\"%1s\">testimonials archive</a> page."
571
  msgstr ""
572
 
573
- #: includes/class-testimonials-widget-settings.php:568
574
  msgid "Archive Page URL"
575
  msgstr ""
576
 
577
- #: includes/class-testimonials-widget-settings.php:578
578
  msgid "Disable Default Taxonomies?"
579
  msgstr ""
580
 
581
- #: includes/class-testimonials-widget-settings.php:581
582
  msgid "If checked, use Testimonials' own category and tag taxonomies than WordPress' defaults."
583
  msgstr ""
584
 
585
- #: includes/class-testimonials-widget-settings.php:587
586
  msgid "Include testimonials in archive and category views."
587
  msgstr ""
588
 
589
- #: includes/class-testimonials-widget-settings.php:590
590
  msgid "Enable archives view?"
591
  msgstr ""
592
 
593
- #: includes/class-testimonials-widget-settings.php:596
594
  msgid "URL slug-name for testimonial view pages. Shouldn't be the same as the Archive Page URL nor should it match a page URL slug."
595
  msgstr ""
596
 
597
- #: includes/class-testimonials-widget-settings.php:600
598
  msgid "Testimonial Page URL"
599
  msgstr ""
600
 
601
- #: includes/class-testimonials-widget-settings.php:641
602
  msgid "Hide ID?"
603
  msgstr ""
604
 
605
- #: includes/class-testimonials-widget-settings.php:680
606
  msgid "Hide Shortcode?"
607
  msgstr ""
608
 
609
- #: includes/class-testimonials-widget-settings.php:700
610
- #: includes/class-testimonials-widget-settings.php:992
611
  #: includes/libraries/aihrus-framework/includes/class-aihrus-settings.php:65
612
  msgid "Reset"
613
  msgstr ""
614
 
615
- #: includes/class-testimonials-widget-settings.php:922
616
  msgid "These Testimonials Settings establish the default option values for shortcodes, theme functions, and widget instances. Widgets, once created no longer inherit these global settings. Therefore, you'll need to update each widget with the new settings. It might be easier to delete the widget and then recreate it."
617
  msgstr ""
618
 
619
- #: includes/class-testimonials-widget-settings.php:924
620
  msgid "Shortcode option names are listed below each entry."
621
  msgstr ""
622
 
623
- #: includes/class-testimonials-widget-settings.php:927
624
  msgid "View the <a href=\"%s\">Testimonials documentation</a>."
625
  msgstr ""
626
 
627
- #: includes/class-testimonials-widget-settings.php:937
628
  msgid "General options."
629
  msgstr ""
630
 
631
- #: includes/class-testimonials-widget-settings.php:945
632
  msgid "Show or hide fields."
633
  msgstr ""
634
 
635
- #: includes/class-testimonials-widget-settings.php:953
636
  msgid "Options used to select testimonials."
637
  msgstr ""
638
 
639
- #: includes/class-testimonials-widget-settings.php:961
640
  msgid "Options used to determine displayed testimonials ordering."
641
  msgstr ""
642
 
643
- #: includes/class-testimonials-widget-settings.php:969
644
  msgid "Allowed columns to display on edit page."
645
  msgstr ""
646
 
647
- #: includes/class-testimonials-widget-settings.php:977
648
  msgid "Archive and singular page URL related testimonials options."
649
  msgstr ""
650
 
651
- #: includes/class-testimonials-widget-settings.php:985
652
  msgid "Options related to showing testimonials in widgets."
653
  msgstr ""
654
 
655
- #: includes/class-testimonials-widget-settings.php:993
656
  msgid "Backwards compatibility, import/export options, and reset options."
657
  msgstr ""
658
 
@@ -732,7 +740,7 @@ msgid "Edit Testimonial"
732
  msgstr ""
733
 
734
  #: includes/class-testimonials-widget.php:575
735
- #: includes/class-testimonials-widget.php:873
736
  msgid "No testimonials found"
737
  msgstr ""
738
 
@@ -745,8 +753,8 @@ msgid "Search Testimonials"
745
  msgstr ""
746
 
747
  #: includes/class-testimonials-widget.php:579
748
- #: includes/class-testimonials-widget.php:1454
749
- #: includes/class-testimonials-widget.php:1817
750
  msgid "Testimonial"
751
  msgstr ""
752
 
@@ -754,84 +762,84 @@ msgstr ""
754
  msgid "View Testimonial"
755
  msgstr ""
756
 
757
- #: includes/class-testimonials-widget.php:1366
758
  msgid "Use when the testimonial title is not the authors' name."
759
  msgstr ""
760
 
761
- #: includes/class-testimonials-widget.php:1390
762
  msgid "If an email is provided, but not an image, a Gravatar icon will be attempted to be loaded."
763
  msgstr ""
764
 
765
- #: includes/class-testimonials-widget.php:1405
766
  msgid "Testimonial Data"
767
  msgstr ""
768
 
769
- #: includes/class-testimonials-widget.php:1429
770
  msgid "Testimonial updated. <a href=\"%s\">View testimonial</a>"
771
  msgstr ""
772
 
773
- #: includes/class-testimonials-widget.php:1430
774
  msgid "Custom field updated."
775
  msgstr ""
776
 
777
- #: includes/class-testimonials-widget.php:1431
778
  msgid "Custom field deleted."
779
  msgstr ""
780
 
781
- #: includes/class-testimonials-widget.php:1432
782
  msgid "Testimonial updated."
783
  msgstr ""
784
 
785
  #. translators: %s: date and time of the revision
786
 
787
- #: includes/class-testimonials-widget.php:1434
788
  msgid "Testimonial restored to revision from %s"
789
  msgstr ""
790
 
791
- #: includes/class-testimonials-widget.php:1435
792
  msgid "Testimonial published. <a href=\"%s\">View testimonial</a>"
793
  msgstr ""
794
 
795
- #: includes/class-testimonials-widget.php:1436
796
  msgid "Testimonial saved."
797
  msgstr ""
798
 
799
- #: includes/class-testimonials-widget.php:1437
800
  msgid "Testimonial submitted. <a target=\"_blank\" href=\"%s\">Preview testimonial</a>"
801
  msgstr ""
802
 
803
- #: includes/class-testimonials-widget.php:1438
804
  msgid "Testimonial scheduled for: <strong>%1$s</strong>. <a target=\"_blank\" href=\"%2$s\">Preview testimonial</a>"
805
  msgstr ""
806
 
807
- #: includes/class-testimonials-widget.php:1439
808
  msgid "Testimonial draft updated. <a target=\"_blank\" href=\"%s\">Preview testimonial</a>"
809
  msgstr ""
810
 
811
- #: includes/class-testimonials-widget.php:1712
812
  msgid "If your Testimonials display has gone to funky town, please <a href=\"%s\">read the FAQ</a> about possible fixes."
813
  msgstr ""
814
 
815
- #: includes/class-testimonials-widget.php:1731
816
  msgid "Failed version check"
817
  msgstr ""
818
 
819
- #: includes/class-testimonials-widget.php:1762
820
  msgid "Shortcode"
821
  msgstr ""
822
 
823
- #: includes/class-testimonials-widget.php:2178
824
- #: includes/class-testimonials-widget.php:2251
825
  msgid "Used with: "
826
  msgstr ""
827
 
828
- #: includes/class-testimonials-widget.php:2215
829
- #: includes/class-testimonials-widget.php:2279
830
  msgid "Options: "
831
  msgstr ""
832
 
833
- #: includes/class-testimonials-widget.php:2220
834
- #: includes/class-testimonials-widget.php:2284
835
  msgid "Usage: "
836
  msgstr ""
837
 
2
  # This file is distributed under the same license as the Testimonials Widget package.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: Testimonials Widget 3.0.1\n"
6
  "Report-Msgid-Bugs-To: http://wordpress.org/tag/testimonials-widget\n"
7
+ "POT-Creation-Date: 2014-12-13 18:49:17+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
68
  msgstr ""
69
 
70
  #: includes/class-testimonials-widget-settings.php:113
71
+ #: includes/class-testimonials-widget-settings.php:944
72
  msgid "General"
73
  msgstr ""
74
 
75
  #: includes/class-testimonials-widget-settings.php:114
76
+ #: includes/class-testimonials-widget-settings.php:952
77
  msgid "Fields"
78
  msgstr ""
79
 
80
  #: includes/class-testimonials-widget-settings.php:115
81
+ #: includes/class-testimonials-widget-settings.php:960
82
  msgid "Selection"
83
  msgstr ""
84
 
85
  #: includes/class-testimonials-widget-settings.php:116
86
+ #: includes/class-testimonials-widget-settings.php:968
87
  msgid "Ordering"
88
  msgstr ""
89
 
90
  #: includes/class-testimonials-widget-settings.php:117
91
+ #: includes/class-testimonials-widget-settings.php:976
92
  msgid "Columns"
93
  msgstr ""
94
 
95
  #: includes/class-testimonials-widget-settings.php:118
96
+ #: includes/class-testimonials-widget-settings.php:984
97
  msgid "Post Type"
98
  msgstr ""
99
 
100
  #: includes/class-testimonials-widget-settings.php:119
101
+ #: includes/class-testimonials-widget-settings.php:992
102
  msgid "Slider Widget"
103
  msgstr ""
104
 
105
  #: includes/class-testimonials-widget-settings.php:123
106
+ msgid "Shortcode Attributes"
107
  msgstr ""
108
 
109
  #: includes/class-testimonials-widget-settings.php:124
110
+ msgid "Shortcode Examples"
111
  msgstr ""
112
 
113
  #: includes/class-testimonials-widget-settings.php:139
180
  msgstr ""
181
 
182
  #: includes/class-testimonials-widget-settings.php:202
183
+ msgid "Slide Width?"
184
  msgstr ""
185
 
186
  #: includes/class-testimonials-widget-settings.php:203
187
+ msgid "Width of each testimonial. Increase to thumbnail width or greater for improved looks. Requried for horizontal transitions."
188
+ msgstr ""
189
+
190
+ #: includes/class-testimonials-widget-settings.php:210
191
+ msgid "Transition Mode?"
192
+ msgstr ""
193
+
194
+ #: includes/class-testimonials-widget-settings.php:211
195
  msgid "Type of transition between slides."
196
  msgstr ""
197
 
198
+ #: includes/class-testimonials-widget-settings.php:214
199
  msgid "Fade"
200
  msgstr ""
201
 
202
+ #: includes/class-testimonials-widget-settings.php:215
203
  msgid "Horizontal"
204
  msgstr ""
205
 
206
+ #: includes/class-testimonials-widget-settings.php:216
207
  msgid "Vertical"
208
  msgstr ""
209
 
210
+ #: includes/class-testimonials-widget-settings.php:228
211
  msgid "General Options"
212
  msgstr ""
213
 
214
+ #: includes/class-testimonials-widget-settings.php:233
215
  msgid "Default Reviewed Item?"
216
  msgstr ""
217
 
218
+ #: includes/class-testimonials-widget-settings.php:234
219
  msgid "Name of thing being referenced in testimonials."
220
  msgstr ""
221
 
222
+ #: includes/class-testimonials-widget-settings.php:241
223
  msgid "Default Reviewed Item URL?"
224
  msgstr ""
225
 
226
+ #: includes/class-testimonials-widget-settings.php:242
227
  msgid "URL of thing being referenced in testimonials."
228
  msgstr ""
229
 
230
+ #: includes/class-testimonials-widget-settings.php:249
231
  msgid "Disable built-in quotes?"
232
  msgstr ""
233
 
234
+ #: includes/class-testimonials-widget-settings.php:250
235
  msgid "Remove open and close quote span tags surrounding testimonial content."
236
  msgstr ""
237
 
238
+ #: includes/class-testimonials-widget-settings.php:256
239
  msgid "Disable \"Testimonials Not Found\"?"
240
  msgstr ""
241
 
242
+ #: includes/class-testimonials-widget-settings.php:257
243
  msgid "Remove \"Testimonials Not Found\" content when no testimonials are found to be displayed."
244
  msgstr ""
245
 
246
+ #: includes/class-testimonials-widget-settings.php:263
247
  msgid "Enable Paging?"
248
  msgstr ""
249
 
250
+ #: includes/class-testimonials-widget-settings.php:264
251
  msgid "Show paging controls for `[testimonials]` listing."
252
  msgstr ""
253
 
254
+ #: includes/class-testimonials-widget-settings.php:267
255
  msgid "Disable"
256
  msgstr ""
257
 
258
+ #: includes/class-testimonials-widget-settings.php:268
259
  msgid "Enable"
260
  msgstr ""
261
 
262
+ #: includes/class-testimonials-widget-settings.php:269
263
  msgid "Before testimonials"
264
  msgstr ""
265
 
266
+ #: includes/class-testimonials-widget-settings.php:270
267
  msgid "After testimonials"
268
  msgstr ""
269
 
270
+ #: includes/class-testimonials-widget-settings.php:276
271
  msgid "Adds HTML tag markup per the <a href=\"%s\">Review schema</a> to testimonials. Search engines including Bing, Google, Yahoo! and Yandex rely on this markup to improve the display of search results."
272
  msgstr ""
273
 
274
+ #: includes/class-testimonials-widget-settings.php:279
275
  msgid "Enable Review Schema?"
276
  msgstr ""
277
 
278
+ #: includes/class-testimonials-widget-settings.php:287
279
  msgid "Enable [shortcodes]?"
280
  msgstr ""
281
 
282
+ #: includes/class-testimonials-widget-settings.php:288
283
  msgid "If unchecked, shortcodes are stripped."
284
  msgstr ""
285
 
286
+ #: includes/class-testimonials-widget-settings.php:295
287
  msgid "Enable Video?"
288
  msgstr ""
289
 
290
+ #: includes/class-testimonials-widget-settings.php:296
291
  msgid "Only enable when displaying video content."
292
  msgstr ""
293
 
294
+ #: includes/class-testimonials-widget-settings.php:302
295
  msgid "Exclude bxSlider CSS?"
296
  msgstr ""
297
 
298
+ #: includes/class-testimonials-widget-settings.php:303
299
  msgid "For a bare-bones, unthemed slider."
300
  msgstr ""
301
 
302
+ #: includes/class-testimonials-widget-settings.php:311
303
  msgid "Exclude default CSS?"
304
  msgstr ""
305
 
306
+ #: includes/class-testimonials-widget-settings.php:312
307
  msgid "Prevent default CSS from being loaded."
308
  msgstr ""
309
 
310
+ #: includes/class-testimonials-widget-settings.php:320
311
  msgid "Remove `.hentry` CSS?"
312
  msgstr ""
313
 
314
+ #: includes/class-testimonials-widget-settings.php:321
315
  msgid "Some themes use class `.hentry` in a manner that breaks Testimonials' CSS."
316
  msgstr ""
317
 
318
+ #: includes/class-testimonials-widget-settings.php:328
319
  msgid "URL Target"
320
  msgstr ""
321
 
322
+ #: includes/class-testimonials-widget-settings.php:329
323
  msgid "Add target to all URLs; leave blank if none."
324
  msgstr ""
325
 
326
+ #: includes/class-testimonials-widget-settings.php:334
327
  msgid "Use `&lt;q&gt;` tag?"
328
  msgstr ""
329
 
330
+ #: includes/class-testimonials-widget-settings.php:335
331
  msgid "Not HTML5 compliant."
332
  msgstr ""
333
 
334
+ #: includes/class-testimonials-widget-settings.php:347
335
  msgid "Field Options"
336
  msgstr ""
337
 
338
+ #: includes/class-testimonials-widget-settings.php:353
339
+ #: includes/class-testimonials-widget-settings.php:619
340
  msgid "Hide Author?"
341
  msgstr ""
342
 
343
+ #: includes/class-testimonials-widget-settings.php:356
344
  msgid "Don't display testimonial title in cite."
345
  msgstr ""
346
 
347
+ #: includes/class-testimonials-widget-settings.php:361
348
+ #: includes/class-testimonials-widget-settings.php:629
349
  msgid "Hide Company?"
350
  msgstr ""
351
 
352
+ #: includes/class-testimonials-widget-settings.php:364
353
  msgid "Don't display testimonial company in cite."
354
  msgstr ""
355
 
356
+ #: includes/class-testimonials-widget-settings.php:369
357
  msgid "Hide Content?"
358
  msgstr ""
359
 
360
+ #: includes/class-testimonials-widget-settings.php:372
361
  msgid "Don't display testimonial content in a view."
362
  msgstr ""
363
 
364
+ #: includes/class-testimonials-widget-settings.php:377
365
+ #: includes/class-testimonials-widget-settings.php:639
366
  msgid "Hide Email?"
367
  msgstr ""
368
 
369
+ #: includes/class-testimonials-widget-settings.php:381
370
  msgid "Don't display or link to testimonial email in cite."
371
  msgstr ""
372
 
373
+ #: includes/class-testimonials-widget-settings.php:386
374
  msgid "Hide Gravatar?"
375
  msgstr ""
376
 
377
+ #: includes/class-testimonials-widget-settings.php:389
378
  msgid "Don't display Gravatar image with testimonial."
379
  msgstr ""
380
 
381
+ #: includes/class-testimonials-widget-settings.php:394
382
+ #: includes/class-testimonials-widget-settings.php:659
383
  msgid "Hide Image?"
384
  msgstr ""
385
 
386
+ #: includes/class-testimonials-widget-settings.php:397
387
  msgid "Don't display featured image with testimonial."
388
  msgstr ""
389
 
390
+ #: includes/class-testimonials-widget-settings.php:402
391
  msgid "Hide Image in Single View?"
392
  msgstr ""
393
 
394
+ #: includes/class-testimonials-widget-settings.php:410
395
+ #: includes/class-testimonials-widget-settings.php:668
396
  msgid "Hide Job Title?"
397
  msgstr ""
398
 
399
+ #: includes/class-testimonials-widget-settings.php:413
400
  msgid "Don't display testimonial job title in cite."
401
  msgstr ""
402
 
403
+ #: includes/class-testimonials-widget-settings.php:418
404
+ #: includes/class-testimonials-widget-settings.php:678
405
  msgid "Hide Location?"
406
  msgstr ""
407
 
408
+ #: includes/class-testimonials-widget-settings.php:421
409
  msgid "Don't display testimonial location in cite."
410
  msgstr ""
411
 
412
+ #: includes/class-testimonials-widget-settings.php:426
413
+ #: includes/class-testimonials-widget-settings.php:697
414
  msgid "Hide URL?"
415
  msgstr ""
416
 
417
+ #: includes/class-testimonials-widget-settings.php:429
418
  msgid "Don't display or link to testimonial URL in cite."
419
  msgstr ""
420
 
421
+ #: includes/class-testimonials-widget-settings.php:439
422
  msgid "Selection Options"
423
  msgstr ""
424
 
425
+ #: includes/class-testimonials-widget-settings.php:445
426
  msgid "Category Filter"
427
  msgstr ""
428
 
429
+ #: includes/class-testimonials-widget-settings.php:446
430
  msgid "Comma separated category names or IDs."
431
  msgstr ""
432
 
433
+ #: includes/class-testimonials-widget-settings.php:453
434
  msgid "Exclude IDs Filter"
435
  msgstr ""
436
 
437
+ #: includes/class-testimonials-widget-settings.php:454
438
+ #: includes/class-testimonials-widget-settings.php:461
439
  msgid "Comma separated testimonial IDs."
440
  msgstr ""
441
 
442
+ #: includes/class-testimonials-widget-settings.php:460
443
  msgid "Include IDs Filter"
444
  msgstr ""
445
 
446
+ #: includes/class-testimonials-widget-settings.php:467
447
  msgid "Limit"
448
  msgstr ""
449
 
450
+ #: includes/class-testimonials-widget-settings.php:468
451
  msgid "Number of testimonials to select per instance."
452
  msgstr ""
453
 
454
+ #: includes/class-testimonials-widget-settings.php:475
455
  msgid "Require All Tags?"
456
  msgstr ""
457
 
458
+ #: includes/class-testimonials-widget-settings.php:476
459
  msgid "Select only testimonials with all of the given tags."
460
  msgstr ""
461
 
462
+ #: includes/class-testimonials-widget-settings.php:483
463
  msgid "Tags Filter"
464
  msgstr ""
465
 
466
+ #: includes/class-testimonials-widget-settings.php:484
467
  msgid "Comma separated tag names or IDs."
468
  msgstr ""
469
 
470
+ #: includes/class-testimonials-widget-settings.php:497
471
  msgid "Ordering Options"
472
  msgstr ""
473
 
474
+ #: includes/class-testimonials-widget-settings.php:503
475
  msgid "ORDER BY"
476
  msgstr ""
477
 
478
+ #: includes/class-testimonials-widget-settings.php:504
479
  msgid "Used when \"Random Order\" is disabled."
480
  msgstr ""
481
 
482
+ #: includes/class-testimonials-widget-settings.php:507
483
  msgid "Testimonial ID"
484
  msgstr ""
485
 
486
+ #: includes/class-testimonials-widget-settings.php:508
487
+ #: includes/class-testimonials-widget-settings.php:511
488
  #: includes/class-testimonials-widget.php:503
489
  #: includes/class-testimonials-widget.php:534
490
+ #: includes/class-testimonials-widget.php:1365
491
  msgid "Author"
492
  msgstr ""
493
 
494
+ #: includes/class-testimonials-widget-settings.php:509
495
  #: includes/class-testimonials-widget.php:505
496
  msgid "Date"
497
  msgstr ""
498
 
499
+ #: includes/class-testimonials-widget-settings.php:510
500
  msgid "Menu Order"
501
  msgstr ""
502
 
503
+ #: includes/class-testimonials-widget-settings.php:512
504
  msgid "No order"
505
  msgstr ""
506
 
507
+ #: includes/class-testimonials-widget-settings.php:520
508
  msgid "ORDER BY meta_key"
509
  msgstr ""
510
 
511
+ #: includes/class-testimonials-widget-settings.php:521
512
  msgid "Used when \"Random Order\" is disabled and sorting by a testimonials meta key is needed. Overrides ORDER BY."
513
  msgstr ""
514
 
515
+ #: includes/class-testimonials-widget-settings.php:524
516
  msgid "None"
517
  msgstr ""
518
 
519
+ #: includes/class-testimonials-widget-settings.php:525
520
  #: includes/class-testimonials-widget.php:539
521
+ #: includes/class-testimonials-widget.php:1371
522
  msgid "Job Title"
523
  msgstr ""
524
 
525
+ #: includes/class-testimonials-widget-settings.php:526
526
  #: includes/class-testimonials-widget.php:554
527
+ #: includes/class-testimonials-widget.php:1389
528
  msgid "Email"
529
  msgstr ""
530
 
531
+ #: includes/class-testimonials-widget-settings.php:527
532
  #: includes/class-testimonials-widget.php:544
533
+ #: includes/class-testimonials-widget.php:1377
534
  msgid "Location"
535
  msgstr ""
536
 
537
+ #: includes/class-testimonials-widget-settings.php:528
538
  #: includes/class-testimonials-widget.php:549
539
+ #: includes/class-testimonials-widget.php:1383
540
  msgid "Company"
541
  msgstr ""
542
 
543
+ #: includes/class-testimonials-widget-settings.php:529
544
  #: includes/class-testimonials-widget.php:559
545
+ #: includes/class-testimonials-widget.php:1395
546
  msgid "URL"
547
  msgstr ""
548
 
549
+ #: includes/class-testimonials-widget-settings.php:536
550
  msgid "ORDER BY Order"
551
  msgstr ""
552
 
553
+ #: includes/class-testimonials-widget-settings.php:539
554
  msgid "Descending"
555
  msgstr ""
556
 
557
+ #: includes/class-testimonials-widget-settings.php:540
558
  msgid "Ascending"
559
  msgstr ""
560
 
561
+ #: includes/class-testimonials-widget-settings.php:548
562
  msgid "Random Order?"
563
  msgstr ""
564
 
565
+ #: includes/class-testimonials-widget-settings.php:549
566
  msgid "If checked, ignores ORDER BY, ORDER BY meta_key, and ORDER BY Order. Widgets are random by default automatically."
567
  msgstr ""
568
 
569
+ #: includes/class-testimonials-widget-settings.php:562
570
  msgid "Allow Comments?"
571
  msgstr ""
572
 
573
+ #: includes/class-testimonials-widget-settings.php:563
574
  msgid "Only affects the Testimonials post edit page. Your theme controls the front-end view."
575
  msgstr ""
576
 
577
+ #: includes/class-testimonials-widget-settings.php:570
578
  msgid "URL slug-name for <a href=\"%1s\">testimonials archive</a> page."
579
  msgstr ""
580
 
581
+ #: includes/class-testimonials-widget-settings.php:576
582
  msgid "Archive Page URL"
583
  msgstr ""
584
 
585
+ #: includes/class-testimonials-widget-settings.php:586
586
  msgid "Disable Default Taxonomies?"
587
  msgstr ""
588
 
589
+ #: includes/class-testimonials-widget-settings.php:589
590
  msgid "If checked, use Testimonials' own category and tag taxonomies than WordPress' defaults."
591
  msgstr ""
592
 
593
+ #: includes/class-testimonials-widget-settings.php:595
594
  msgid "Include testimonials in archive and category views."
595
  msgstr ""
596
 
597
+ #: includes/class-testimonials-widget-settings.php:598
598
  msgid "Enable archives view?"
599
  msgstr ""
600
 
601
+ #: includes/class-testimonials-widget-settings.php:604
602
  msgid "URL slug-name for testimonial view pages. Shouldn't be the same as the Archive Page URL nor should it match a page URL slug."
603
  msgstr ""
604
 
605
+ #: includes/class-testimonials-widget-settings.php:608
606
  msgid "Testimonial Page URL"
607
  msgstr ""
608
 
609
+ #: includes/class-testimonials-widget-settings.php:649
610
  msgid "Hide ID?"
611
  msgstr ""
612
 
613
+ #: includes/class-testimonials-widget-settings.php:688
614
  msgid "Hide Shortcode?"
615
  msgstr ""
616
 
617
+ #: includes/class-testimonials-widget-settings.php:708
618
+ #: includes/class-testimonials-widget-settings.php:1000
619
  #: includes/libraries/aihrus-framework/includes/class-aihrus-settings.php:65
620
  msgid "Reset"
621
  msgstr ""
622
 
623
+ #: includes/class-testimonials-widget-settings.php:930
624
  msgid "These Testimonials Settings establish the default option values for shortcodes, theme functions, and widget instances. Widgets, once created no longer inherit these global settings. Therefore, you'll need to update each widget with the new settings. It might be easier to delete the widget and then recreate it."
625
  msgstr ""
626
 
627
+ #: includes/class-testimonials-widget-settings.php:932
628
  msgid "Shortcode option names are listed below each entry."
629
  msgstr ""
630
 
631
+ #: includes/class-testimonials-widget-settings.php:935
632
  msgid "View the <a href=\"%s\">Testimonials documentation</a>."
633
  msgstr ""
634
 
635
+ #: includes/class-testimonials-widget-settings.php:945
636
  msgid "General options."
637
  msgstr ""
638
 
639
+ #: includes/class-testimonials-widget-settings.php:953
640
  msgid "Show or hide fields."
641
  msgstr ""
642
 
643
+ #: includes/class-testimonials-widget-settings.php:961
644
  msgid "Options used to select testimonials."
645
  msgstr ""
646
 
647
+ #: includes/class-testimonials-widget-settings.php:969
648
  msgid "Options used to determine displayed testimonials ordering."
649
  msgstr ""
650
 
651
+ #: includes/class-testimonials-widget-settings.php:977
652
  msgid "Allowed columns to display on edit page."
653
  msgstr ""
654
 
655
+ #: includes/class-testimonials-widget-settings.php:985
656
  msgid "Archive and singular page URL related testimonials options."
657
  msgstr ""
658
 
659
+ #: includes/class-testimonials-widget-settings.php:993
660
  msgid "Options related to showing testimonials in widgets."
661
  msgstr ""
662
 
663
+ #: includes/class-testimonials-widget-settings.php:1001
664
  msgid "Backwards compatibility, import/export options, and reset options."
665
  msgstr ""
666
 
740
  msgstr ""
741
 
742
  #: includes/class-testimonials-widget.php:575
743
+ #: includes/class-testimonials-widget.php:875
744
  msgid "No testimonials found"
745
  msgstr ""
746
 
753
  msgstr ""
754
 
755
  #: includes/class-testimonials-widget.php:579
756
+ #: includes/class-testimonials-widget.php:1456
757
+ #: includes/class-testimonials-widget.php:1819
758
  msgid "Testimonial"
759
  msgstr ""
760
 
762
  msgid "View Testimonial"
763
  msgstr ""
764
 
765
+ #: includes/class-testimonials-widget.php:1368
766
  msgid "Use when the testimonial title is not the authors' name."
767
  msgstr ""
768
 
769
+ #: includes/class-testimonials-widget.php:1392
770
  msgid "If an email is provided, but not an image, a Gravatar icon will be attempted to be loaded."
771
  msgstr ""
772
 
773
+ #: includes/class-testimonials-widget.php:1407
774
  msgid "Testimonial Data"
775
  msgstr ""
776
 
777
+ #: includes/class-testimonials-widget.php:1431
778
  msgid "Testimonial updated. <a href=\"%s\">View testimonial</a>"
779
  msgstr ""
780
 
781
+ #: includes/class-testimonials-widget.php:1432
782
  msgid "Custom field updated."
783
  msgstr ""
784
 
785
+ #: includes/class-testimonials-widget.php:1433
786
  msgid "Custom field deleted."
787
  msgstr ""
788
 
789
+ #: includes/class-testimonials-widget.php:1434
790
  msgid "Testimonial updated."
791
  msgstr ""
792
 
793
  #. translators: %s: date and time of the revision
794
 
795
+ #: includes/class-testimonials-widget.php:1436
796
  msgid "Testimonial restored to revision from %s"
797
  msgstr ""
798
 
799
+ #: includes/class-testimonials-widget.php:1437
800
  msgid "Testimonial published. <a href=\"%s\">View testimonial</a>"
801
  msgstr ""
802
 
803
+ #: includes/class-testimonials-widget.php:1438
804
  msgid "Testimonial saved."
805
  msgstr ""
806
 
807
+ #: includes/class-testimonials-widget.php:1439
808
  msgid "Testimonial submitted. <a target=\"_blank\" href=\"%s\">Preview testimonial</a>"
809
  msgstr ""
810
 
811
+ #: includes/class-testimonials-widget.php:1440
812
  msgid "Testimonial scheduled for: <strong>%1$s</strong>. <a target=\"_blank\" href=\"%2$s\">Preview testimonial</a>"
813
  msgstr ""
814
 
815
+ #: includes/class-testimonials-widget.php:1441
816
  msgid "Testimonial draft updated. <a target=\"_blank\" href=\"%s\">Preview testimonial</a>"
817
  msgstr ""
818
 
819
+ #: includes/class-testimonials-widget.php:1714
820
  msgid "If your Testimonials display has gone to funky town, please <a href=\"%s\">read the FAQ</a> about possible fixes."
821
  msgstr ""
822
 
823
+ #: includes/class-testimonials-widget.php:1733
824
  msgid "Failed version check"
825
  msgstr ""
826
 
827
+ #: includes/class-testimonials-widget.php:1764
828
  msgid "Shortcode"
829
  msgstr ""
830
 
831
+ #: includes/class-testimonials-widget.php:2180
832
+ #: includes/class-testimonials-widget.php:2253
833
  msgid "Used with: "
834
  msgstr ""
835
 
836
+ #: includes/class-testimonials-widget.php:2217
837
+ #: includes/class-testimonials-widget.php:2281
838
  msgid "Options: "
839
  msgstr ""
840
 
841
+ #: includes/class-testimonials-widget.php:2222
842
+ #: includes/class-testimonials-widget.php:2286
843
  msgid "Usage: "
844
  msgstr ""
845
 
readme.txt CHANGED
@@ -5,7 +5,7 @@ Donate link: http://aihr.us/about-aihrus/donate/
5
  Tags: aihrus, client, customer, portfolio, quote, quotes, random, recommendation, reference, review, reviews, slider, testimonial, testimonials, wpml
6
  Requires at least: 3.6
7
  Tested up to: 4.1.0
8
- Stable tag: 3.0.1RC1
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
@@ -39,10 +39,10 @@ Testimonials Widget lets you randomly slide or list selected portfolios, quotes,
39
 
40
  Testimonials Widget Premium increases all of Testimonials Widget' benefits and features to over a 100 with…
41
 
 
42
  * 5-star ratings
43
  * Caching
44
  * Excerpts
45
- * Free, comprehensive support
46
  * More selection options
47
  * Read more links
48
  * RSS feeds
@@ -54,7 +54,7 @@ Testimonials Widget Premium increases all of Testimonials Widget' benefits and f
54
 
55
  = Testimonials Widget Premium Doesn't Work For You? =
56
 
57
- No problem, get a 100% refund and keep the software. Your license for support and updates will be revoked though.
58
 
59
  = General Information =
60
 
@@ -257,6 +257,19 @@ Details on the Shortcode Attributes tab at WordPress Admin > Testimonials > Sett
257
  * Click the "Delete" link for "Testimonials Widget" at WordPress Admin > Plugins
258
  * Click the "Yes, Delete these files and data" button to confirm "Testimonials Widget" plugin removal
259
 
 
 
 
 
 
 
 
 
 
 
 
 
 
260
 
261
  == Frequently Asked Questions ==
262
 
@@ -267,6 +280,7 @@ This is a major overhaul *without* backwards compliance of over 80 changes. Plea
267
  = Most Common Issues =
268
 
269
  * Got `Parse error: syntax error, unexpected T_STATIC…`? See [Most Aihrus Plugins Require PHP 5.3+](https://aihrus.zendesk.com/entries/30678006)
 
270
  * Shortcode not working? Make sure your theme isn't using same shortcode.
271
  * [404 - Page not found](https://aihrus.zendesk.com/entries/23679301)
272
  * [Add testimonials using Gravity Forms](http://webtrainingwheels.com/how-to-collect-user-submitted-testimonials-wordpress/)
@@ -372,3 +386,5 @@ You can translate this plugin into your own language if it's not done so already
372
  A big, special thank you to [Joe Weber](https://plus.google.com/100063271269277312276/posts) of [12 Star Creative](http://www.12starcreative.com/) for creating the Testimonials Widget banner. It's fantastic.
373
 
374
  A cool thanks to RedRokk Library for the [redrokk_metabox_class](https://gist.github.com/1880770). It makes configuring meta boxes for your posts, pages or custom post types a snap.
 
 
5
  Tags: aihrus, client, customer, portfolio, quote, quotes, random, recommendation, reference, review, reviews, slider, testimonial, testimonials, wpml
6
  Requires at least: 3.6
7
  Tested up to: 4.1.0
8
+ Stable tag: 3.0.1
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
39
 
40
  Testimonials Widget Premium increases all of Testimonials Widget' benefits and features to over a 100 with…
41
 
42
+ * **Free, comprehensive support**
43
  * 5-star ratings
44
  * Caching
45
  * Excerpts
 
46
  * More selection options
47
  * Read more links
48
  * RSS feeds
54
 
55
  = Testimonials Widget Premium Doesn't Work For You? =
56
 
57
+ No problem, it has a 30-day, money back guarantee. Also, you can keep the software, sans support and updates.
58
 
59
  = General Information =
60
 
257
  * Click the "Delete" link for "Testimonials Widget" at WordPress Admin > Plugins
258
  * Click the "Yes, Delete these files and data" button to confirm "Testimonials Widget" plugin removal
259
 
260
+ = Documentation =
261
+
262
+ * [Installation Guide](https://wordpress.org/plugins/testimonials-widget/installation/)
263
+ * [Frequently Asked Questions](https://wordpress.org/plugins/testimonials-widget/faq/)
264
+ * [Options](http://aihr.us/best-wordpress-testimonials-plugin/shortcode-widget-options/)
265
+ * [API](https://github.com/michael-cannon/testimonials-widget/blob/master/API.md)
266
+ * [Benefits and Features](https://wordpress.org/plugins/testimonials-widget/)
267
+ * [CHANGELOG](https://github.com/michael-cannon/testimonials-widget/blob/master/CHANGELOG.md)
268
+ * [CONTRIBUTING](https://github.com/michael-cannon/testimonials-widget/blob/master/CONTRIBUTING.md)
269
+ * [DEPRECATED](https://github.com/michael-cannon/testimonials-widget/blob/master/DEPRECATED.md)
270
+ * [EXAMPLES](http://aihr.us/best-wordpress-testimonials-plugin/shortcode-examples/)
271
+ * [UPGRADING](https://github.com/michael-cannon/testimonials-widget/blob/master/UPGRADING.md)
272
+
273
 
274
  == Frequently Asked Questions ==
275
 
280
  = Most Common Issues =
281
 
282
  * Got `Parse error: syntax error, unexpected T_STATIC…`? See [Most Aihrus Plugins Require PHP 5.3+](https://aihrus.zendesk.com/entries/30678006)
283
+ * Got `The plugin does not have a valid header` error? See [Error: The plugin does not have a valid header](https://aihrus.zendesk.com/entries/68888915)
284
  * Shortcode not working? Make sure your theme isn't using same shortcode.
285
  * [404 - Page not found](https://aihrus.zendesk.com/entries/23679301)
286
  * [Add testimonials using Gravity Forms](http://webtrainingwheels.com/how-to-collect-user-submitted-testimonials-wordpress/)
386
  A big, special thank you to [Joe Weber](https://plus.google.com/100063271269277312276/posts) of [12 Star Creative](http://www.12starcreative.com/) for creating the Testimonials Widget banner. It's fantastic.
387
 
388
  A cool thanks to RedRokk Library for the [redrokk_metabox_class](https://gist.github.com/1880770). It makes configuring meta boxes for your posts, pages or custom post types a snap.
389
+
390
+ Current development by [Michael Cannon](https://profiles.wordpress.org/comprock/) of [Aihrus](http://aihr.us/about-aihrus/).
testimonials-widget.php CHANGED
@@ -4,15 +4,13 @@
4
  * Plugin URI: http://wordpress.org/plugins/testimonials-widget/
5
  * Description: Easily add social proofing to your website with Testimonials Widget. List or slide reviews via functions, shortcodes, or widgets.
6
  * lets you socially randomly slide or list selected portfolios, quotes, reviews, or text with images or videos on your WordPress site.
7
- * Version: 3.0.0
8
  * Author: Michael Cannon
9
  * Author URI: http://aihr.us/resume/
10
  * License: GPLv2 or later
11
  * Text Domain: testimonials-widget
12
  * Domain Path: /languages
13
  */
14
-
15
-
16
  /**
17
  Testimonials Widget
18
  Copyright (C) 2014 Michael Cannon
@@ -38,7 +36,7 @@ if ( ! defined( 'ABSPATH' ) ) {
38
  }
39
 
40
  if ( ! defined( 'TW_AIHR_VERSION' ) ) {
41
- define( 'TW_AIHR_VERSION', '1.1.5' );
42
  }
43
 
44
  if ( ! defined( 'TW_BASE' ) ) {
@@ -66,7 +64,7 @@ if ( ! defined( 'TW_PREMIUM_LINK' ) ) {
66
  }
67
 
68
  if ( ! defined( 'TW_VERSION' ) ) {
69
- define( 'TW_VERSION', '3.0.0' );
70
  }
71
 
72
  require_once TW_DIR_INC . 'requirements.php';
4
  * Plugin URI: http://wordpress.org/plugins/testimonials-widget/
5
  * Description: Easily add social proofing to your website with Testimonials Widget. List or slide reviews via functions, shortcodes, or widgets.
6
  * lets you socially randomly slide or list selected portfolios, quotes, reviews, or text with images or videos on your WordPress site.
7
+ * Version: 3.0.1
8
  * Author: Michael Cannon
9
  * Author URI: http://aihr.us/resume/
10
  * License: GPLv2 or later
11
  * Text Domain: testimonials-widget
12
  * Domain Path: /languages
13
  */
 
 
14
  /**
15
  Testimonials Widget
16
  Copyright (C) 2014 Michael Cannon
36
  }
37
 
38
  if ( ! defined( 'TW_AIHR_VERSION' ) ) {
39
+ define( 'TW_AIHR_VERSION', '1.1.6' );
40
  }
41
 
42
  if ( ! defined( 'TW_BASE' ) ) {
64
  }
65
 
66
  if ( ! defined( 'TW_VERSION' ) ) {
67
+ define( 'TW_VERSION', '3.0.1' );
68
  }
69
 
70
  require_once TW_DIR_INC . 'requirements.php';
trunk/API.md DELETED
@@ -1,267 +0,0 @@
1
- # API - Testimonials Widget
2
-
3
- The [Testimonials Widget plugin](http://wordpress.org/plugins/testimonials-widget/) comes with its own set of actions and filters, as described below.
4
-
5
- ## Actions
6
-
7
- * `tw_settings_add_help_tabs`
8
-
9
- Modify the settings page help tabs.
10
-
11
- * `tw_scripts`
12
-
13
- Make additional `wp_register_script` and `wp_enqueue_script` calls as needed.
14
-
15
- * `tw_styles`
16
-
17
- Make additional `wp_register_style` and `wp_enqueue_style` calls as needed.
18
-
19
- * `tw_update`
20
-
21
- Make additional update related calls as needed.
22
-
23
- ## Filters
24
-
25
- ### Frontend
26
-
27
- * `tw_cite_html`
28
-
29
- Adjust cite contents. [example](https://aihrus.zendesk.com/entries/24012926)
30
-
31
- * `tw_content_more`
32
-
33
- More content ellipsis. [example](https://aihrus.zendesk.com/entries/23691577)
34
-
35
- * `tw_get_testimonials_html`
36
-
37
- Customize the contents and layout within `get_testimonials_html`.
38
-
39
- * `tw_get_testimonial_html`
40
-
41
- Customize testimonial contents and layout within `get_testimonial_html`. Useful for moving processed parts around than regenerating everything from scratch. [example](https://aihrus.zendesk.com/entries/23693433)
42
-
43
- * `tw_gravatar_size`
44
-
45
- Change the Gravatar size. [example](https://aihrus.zendesk.com/entries/23679271)
46
-
47
- * `tw_image_size`
48
-
49
- Change the image size. [example](https://aihrus.zendesk.com/entries/23677122)
50
-
51
- * `tw_next_posts_link_text`
52
-
53
- Configure Next page indicator. [example](https://aihrus.zendesk.com/entries/23691587)
54
-
55
- * `tw_previous_posts_link_text`
56
-
57
- Configure Previous page indicator. [example](https://aihrus.zendesk.com/entries/23691587)
58
-
59
- * `tw_testimonial_html_single_content`
60
-
61
- Customize single view content before appending filter `tw_testimonial_html_single` results. [example](https://gist.github.com/michael-cannon/5833657)
62
-
63
- * `tw_testimonial_html_single`
64
-
65
- Customize testimonials single view output post `get_testimonial_html`. [example](https://aihrus.zendesk.com/entries/23679391)
66
-
67
- * `tw_testimonial_html`
68
-
69
- Customize testimonials list and widget output post `get_testimonial_html`. [example](https://aihrus.zendesk.com/entries/23693413)
70
-
71
- * `tw_get_testimonial_html_class`
72
-
73
- Alter dynamically generated CSS per testimonial
74
-
75
- * `tw_testimonials_css`
76
-
77
- Alter dynamically generated CSS
78
-
79
- * `tw_testimonials_js`
80
-
81
- Alter dynamically generated JavaScript. [example](https://gist.github.com/michael-cannon/5833678)
82
-
83
- * `tw_testimonials_js_internal`
84
-
85
- Inject dynamically generated JavaScript to `active/next` functional area..
86
-
87
- * `tw_wp_pagenavi`
88
-
89
- Configure WP-PageNavi specifically for Testimonial Widgets. [example](https://aihrus.zendesk.com/entries/23679361)
90
-
91
- * `tw_review_name_length`
92
-
93
- Maximium length of review schema's name. Default is 156 characters.
94
-
95
- * `tw_schema`
96
-
97
- Customize schema contents.
98
-
99
- * `tw_schema_review`
100
-
101
- Customize schema review meta contents.
102
-
103
- * `tw_schema_agg_rating`
104
-
105
- Customize schema aggregate rating for item.
106
-
107
- * `tw_schema_author`
108
-
109
- Customize schema author contents.
110
-
111
- * `tw_schema_item`
112
-
113
- Customize schema reviewed item contents.
114
-
115
- * `tw_get_template_part`
116
-
117
- Allow template choices to be filtered. [Usage](https://github.com/GaryJones/Gamajo-Template-Loader/blob/develop/class-gamajo-template-loader.php#L120)
118
-
119
- * `tw_template_paths`
120
-
121
- Allow ordered list of template paths to be amended. [Usage](https://github.com/GaryJones/Gamajo-Template-Loader/blob/develop/class-gamajo-template-loader.php#L201)
122
-
123
- * `tw_categories_dropdown_args`
124
-
125
- Used for modifying [wp_dropdown_categories](http://codex.wordpress.org/Function_Reference/wp_dropdown_categories) as part of the testimonials' categories widget.
126
-
127
- * `tw_categories_args`
128
-
129
- Used for modifying [wp_list_categories](http://codex.wordpress.org/Function_Reference/wp_list_categories) as part of the testimonials' categories widget.
130
-
131
- * `tw_tag_cloud_args`
132
-
133
- Used for modifying [wp_tag_cloud](http://codex.wordpress.org/Function_Reference/wp_tag_cloud) as part of the testimonials' tag cloud widget.
134
-
135
- * `tw_recent_testimonials_args`
136
-
137
- Used for modifying [WP_Query](http://codex.wordpress.org/Function_Reference/WP_Query) as part of the recent testimonials widget.
138
-
139
- * `tw_archives_dropdown_args`
140
-
141
- Used for modifying [wp_get_archives](http://codex.wordpress.org/Function_Reference/wp_get_archives) as part of the testimonials archive widget.
142
-
143
- * `tw_archives_args`
144
-
145
- Used for modifying [wp_get_archives](http://codex.wordpress.org/Function_Reference/wp_get_archives) as part of the testimonials archive widget.
146
-
147
- ### Backend
148
-
149
- * `tw_cache_get`
150
-
151
- Caching grabber. [example](https://gist.github.com/michael-cannon/5833685)
152
-
153
- * `tw_cache_set`
154
-
155
- Caching setter. [example](https://gist.github.com/michael-cannon/5833685)
156
-
157
- * `tw_columns`
158
-
159
- Customize testimonial posts column headers. [example](https://gist.github.com/michael-cannon/5833693)
160
-
161
- * `tw_content`
162
-
163
- Testimonial content parser helper. [example](https://gist.github.com/michael-cannon/5833700)
164
-
165
- * `tw_data`
166
-
167
- Process testimonials data before display processing. [example](https://aihrus.zendesk.com/entries/23692056)
168
-
169
- * `tw_defaults_single`
170
-
171
- Create a global or central Testimonials configuration for single view. [example](https://aihrus.zendesk.com/entries/23679071). [example](https://aihrus.zendesk.com/entries/23679111)
172
-
173
- * `tw_defaults`
174
-
175
- Create a global or central Testimonials configuration. [example](https://aihrus.zendesk.com/entries/23691607)
176
-
177
- * `tw_meta_box`
178
-
179
- Modify Testimonial Data fields. [example](https://gist.github.com/michael-cannon/5833704). [Configuration examples](https://github.com/michael-cannon/aihrus-framework/blob/master/includes/libraries/class-redrokk-metabox-class.php#L815)
180
-
181
- * `tw_posts_custom_column`
182
-
183
- Customize testimonial posts column contents. [example](https://gist.github.com/michael-cannon/5833716)
184
-
185
- * `tw_query_args`
186
-
187
- Alter WP_Query arguments for testimonial selection. [example](https://gist.github.com/michael-cannon/5833740)
188
-
189
- * `tw_sections`
190
-
191
- Alter section options. [example](https://gist.github.com/michael-cannon/5833757)
192
-
193
- * `tw_settings`
194
-
195
- Alter setting options. [example](https://gist.github.com/michael-cannon/5833757)
196
-
197
- * `tw_validate_settings`
198
-
199
- Validate settings helper. [example](https://gist.github.com/michael-cannon/5833768)
200
-
201
- * `tw_version`
202
-
203
- Version tracking for settings. [example](https://gist.github.com/michael-cannon/5833774)
204
-
205
- * `tw_slider_widget_options`
206
-
207
- Alters displayed widget options. [example](https://gist.github.com/michael-cannon/5833782)
208
-
209
- * `tw_categories_widget_options`
210
-
211
- Used for modifying widget options as part of the testimonials' categories widget. [similar example](https://gist.github.com/michael-cannon/5833782)
212
-
213
- * `tw_tag_cloud_widget_options`
214
-
215
- Used for modifying widget options as part of the testimonials' tag cloud widget. [similar example](https://gist.github.com/michael-cannon/5833782)
216
-
217
- * `tw_recent_testimonials_widget_options`
218
-
219
- Used for modifying widget options as part of the recent testimonials widget. [similar example](https://gist.github.com/michael-cannon/5833782)
220
-
221
- * `tw_archives_widget_options`
222
-
223
- Used for modifying widget options as part of the testimonials archives widget. [similar example](https://gist.github.com/michael-cannon/5833782)
224
-
225
- * `tw_display_setting`
226
-
227
- Alows for display of custom input types.
228
-
229
- * `tw_settings_defaults`
230
-
231
- Override settings defaults with your own.
232
-
233
- * `tw_register_post_type_args`
234
-
235
- Overrides `register_post_type` arguments. [example](https://gist.github.com/michael-cannon/8fc217199ae1e8d5eecb)
236
-
237
- * `tw_register_category_args`
238
-
239
- Overrides `register_taxonomy` arguments.
240
-
241
- * `tw_register_tags_args`
242
-
243
- Overrides `register_taxonomy` arguments.
244
-
245
- * `tw_examples_html`
246
-
247
- Enhance or override examples HTML.
248
-
249
- * `tw_used_with_codes`
250
-
251
- Enhance or override primary widgets shortcode and theme function accessibility.
252
-
253
- * `tw_options_widgets`
254
-
255
- Enhance or override widgets included for options documentation.
256
-
257
- * `tw_used_with_codes_widgets`
258
-
259
- Enhance or override additionally widgets shortcode and theme function accessibility.
260
-
261
- * `tw_options_html`
262
-
263
- Enhance or override options HTML.
264
-
265
- ## Need More?
266
-
267
- Further examples and more can be found by reading and searching the [Testimonials Knowledge Base](https://aihrus.zendesk.com/categories/20104507) and [source code](https://github.com/michael-cannon/testimonials-widget).
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/CHANGELOG.md DELETED
@@ -1,1415 +0,0 @@
1
- # CHANGELOG - Testimonials Widget
2
-
3
- ## master
4
-
5
- ## 3.0.0
6
- * Add DEPRECATED.md, EXAMPLES.md, and UPGRADING.md documentation
7
- * Add filter `tw_examples_html`
8
- * Add filter `tw_examples`
9
- * Add filter `tw_get_template_part`
10
- * Add filter `tw_options_html`
11
- * Add filter `tw_options_widgets`
12
- * Add filter `tw_template_paths`
13
- * Add filter `tw_used_with_codes_widgets`
14
- * Add filter `tw_used_with_codes`
15
- * Add filter `tw_widget_categories_args`
16
- * Add filter `tw_widget_categories_dropdown_args`
17
- * Add filter `tw_widget_categories_options`
18
- * Add filter `tw_widget_recent_testimonials_args`
19
- * Add filter `tw_widget_recent_testimonials_options`
20
- * Add filter `tw_widget_tag_cloud_args`
21
- * Add filter `tw_widget_tag_cloud_options`
22
- * Add more shortcode examples
23
- * Add Plugin Deactivation & Deletion section to readme
24
- * Add shortcode and theme function `testimonials_archives`
25
- * Add shortcode and theme function `testimonials_categories`
26
- * Add shortcode and theme function `testimonials_examples`
27
- * Add shortcode and theme function `testimonials_options`
28
- * Add shortcode and theme function `testimonials_recent`
29
- * Add shortcode and theme function `testimonials_tag_cloud`
30
- * Added recent testimonials widget
31
- * Added testimonials category widget
32
- * Added testimonials tag cloud widget
33
- * API link updates
34
- * Author field to override title when it's not the testimonial source
35
- * Begin updating to WordPress-VIP coding standards
36
- * Don't shortcode attribute for global level options
37
- * Link help to FAQ
38
- * Moved aggregate review schema data to premium
39
- * Moved email column and data input before URL
40
- * Moved Tutorials to below Usage section in readme
41
- * Put latest Update Notice in readme.txt
42
- * Readme.txt updates
43
- * Remove `show_code` examples from settings entries
44
- * Removed customized edit title
45
- * Removed options: `include_ie7_css`,`use_bxslider`, `disable_animation`, `fade_out_speed`, `fade_in_speed`, `height`, `min_height`, `max_height`
46
- * Removed pre-2.0.0 migration code
47
- * Removed shortcodes: `testimonialswidget_list`, `testimonialswidget_widget`
48
- * Reorganize settings
49
- * Replace "Source" with "Author"
50
- * Replace "Source" with "Author"
51
- * Replace `tw_shortcodes` with `tw_examples`
52
- * Require Aihrus Framework 1.1.5
53
- * RESOLVE #103 Example of every option
54
- * RESOLVE #104 Include help in the plugin
55
- * RESOLVE #111 bottom_text=false shows false
56
- * RESOLVE #112 Remove deprecated methods
57
- * RESOLVE #113 Replace testimonials_widget_ of actions, filters, and functions with tw_
58
- * RESOLVE #117 Revise benefits content
59
- * RESOLVE #119 Confirm WPML integration works
60
- * RESOLVE #120 Implement ease of use
61
- * RESOLVE #121 Updated screenshots
62
- * RESOLVE #123 Revise installation and usage instructions for ease of use
63
- * RESOLVE #124 Optionally include testimonials in category archives
64
- * RESOLVE #127 Use category and tag IDs in addition to names for testimonials selection
65
- * RESOLVE #128 Move bxSlider to being library
66
- * RESOLVE #129 Testimonials Archive widget
67
- * RESOLVE #130 Recent Testimonials widget
68
- * RESOLVE #131 Implement widget content caching
69
- * RESOLVE #132 Implement shortcodes for all widgets
70
- * RESOLVE #134 Implement testimonials date archives
71
- * RESOLVE #137 Simple aggregrate numbers needed in freebie
72
- * RESOLVE #138 Add shortcode attributes example tab to settings page
73
- * RESOLVE #139 Auto-generate option examples
74
- * RESOLVE #149 Restore deprecated shortcodes and theme functions to TW
75
- * RESOLVE #18 Testimonials category/tag list/cloud widget
76
- * RESOLVE #19 Template engine
77
- * RESOLVE #23 Reorganize meta data fields - Author to top
78
- * RESOLVE Flush rewrite rules if baseline taxonomy changes
79
- * RESOLVE Videos not showing in single view
80
- * Restore Testimonials Widget branding
81
- * Restore Testimonials Widget Premium branding
82
- * Revise descriptions
83
- * Revise upgrade notice
84
- * Revise widget class and files names
85
- * Simplify Review schema handling
86
- * Slider schema enabled by default
87
- * Update keywords
88
- * Update licensing entries
89
- * Update shortcode examples with description first
90
- * Update widget title handling
91
- * Update [bxSlider 4.1.2](https://github.com/stevenwanderski/bxslider-4)
92
- * Use [bxSlider](https://github.com/stevenwanderski/bxslider-4) as a library
93
-
94
- ## 2.19.9
95
- * Add example for `tw_register_post_type_args`
96
- * Add FAQ Gravity Forms
97
- * Add filter `tw_register_category_args`
98
- * Add filter `tw_register_post_type_args`
99
- * Add filter `tw_register_tags_args`
100
- * Add `margin-bottom: 2em;` to `.testimonials-widget-testimonial.list`
101
-
102
- ## 2.19.8
103
- * Add Configuration examples for filter tw_meta_box
104
- * Add option Exclude default CSS?
105
- * Disable WordPress.WhiteSpace.ControlStructureSpacing coding standard
106
- * RESOLVE #95 Incoming YouTube links not embedded
107
- * RESOLVE #99 Swap location and company data placements
108
-
109
- ## 2.19.7
110
- * RESOLVE Testimonials content has the_content filter applied
111
-
112
- ## 2.19.6
113
- * RESOLVE #92 Embed YouTube videos in reviews
114
- * Revise readme description
115
-
116
- ## 2.19.5.1
117
- * Add tutorial videos
118
- * Tested up to: 4.0.0
119
-
120
- ## 2.19.5
121
- * Remove Testimonials menu for authors removal code
122
- * Require Aihrus Framework 1.1.4
123
- * Revise premium introduction
124
- * Update premium links
125
-
126
- ## 2.19.4
127
- * Add Testimonials to Dashboard's At a Glance
128
- * Hide version based options is bxSlider is enabled
129
- * RELATED #78 Show revert link in deactivation admin notice
130
- * RESOLVE #71 Permissions for Contributor
131
- * RESOLVE Authors seeing more than own testimonials for editing
132
- * Require Aihrus Framework 1.1.3
133
- * Revise readme options layout
134
- * Revise screenshots
135
-
136
- ## 2.19.3
137
- * Refactor get_defaults
138
- * Replace [[/]] with [/]
139
- * Require Aihrus Framework 1.1.2
140
- * RESOLVE #80 DB Performance Issues
141
- * Revise FAQ section
142
- * Update settings page detection
143
-
144
- ## 2.19.2
145
- * Force WordPress to update files
146
-
147
- ## 2.19.1
148
- * Please resave your Testimonials > Settings and Widget options for defaults to be corrected
149
- * Remove unsued `widget_options`
150
- * Require Aihrus Framework 1.1.1
151
-
152
- ## 2.19.0
153
- * Add screenshot 22. Testimonials Settings > Columns tab
154
- * Check system requirements after update
155
- * CSS class `.title` is now `.job-title`. Thank you Mark
156
- * Enable adaptive slider height
157
- * Only check system requirements once a week
158
- * Please resave your WordPress Admin > Testimonials > Settings so that missing aoptions are included again.
159
- * RELATE #64 Remove deprecated options and codes
160
- * Require Aihrus Framework 1.1.0
161
- * RESOLVE #20 Simplify shortcodes
162
- * RESOLVE #45 Plugin Disables Itself
163
- * RESOLVE #56 Prevent edit page column overload
164
- * RESOLVE #67 Use .job-title than .title for job title span class
165
- * RESOLVE #76 Undefined index: hide_image_single
166
- * Revise Aihrus framework includes
167
- * Revise version_check
168
- * Shortcode and theme function `testimonialswidget_list` being deprecated by `testimonials`
169
- * Shortcode and theme function `testimonialswidget_widget` being deprecated by `testimonials_slider`
170
- * Update BxSlider v4.1.2
171
- * Use aihr_deactivate_plugin call to deactivate
172
-
173
- ## 2.18.4
174
- * RESOLVE #69 Disallow .display-none when only 1 testimonials or no refresh_interval
175
-
176
- ## 2.18.3
177
- * Add option "Exclude bxSlider CSS?"
178
- * Exit if accessed directly
179
- * Initially no show bxSlider widget testimonials entries
180
- * RESOLVE #61 Horizontal transitions not working in widget
181
- * RESOLVE #62 Bootstrap class name hide conflict
182
- * RESOLVE #65 Widget blank options aren't saving correctly
183
- * Update copyright year
184
-
185
- ## 2.18.2
186
- * RESOLVE #57 Testimonials Stacking on first load
187
-
188
- ## 2.18.1
189
- * Add FAQ How do I create a testimonial record?
190
- * Add screenshot 21. Shortcode helpers on category and tag admin screens
191
- * Correct Codeship image include
192
- * jQuery 1.10+ note
193
- * Remove "Use bxSlider?" and "Include IE7 CSS" from widget options
194
- * Remove option "Always Load CSS?" `force_css_loading`
195
- * Remove Travis CI configuration. Using Codeship.io instead
196
- * Require Aihrus Framework 1.0.3
197
- * RESOLVE #2 Add shortcode column to categories page
198
- * RESOLVE #3 Add shortcode column to tags page
199
- * RESOLVE #54 Notice: Constant TW_AIHR_VERSION already defined
200
- * RESOLVE #8 Validate HTML
201
- * RESOLVE Featured image via Gravatar not saving correctly
202
- * RESOLVE Not passing requirements failure to premium plugin
203
- * RESOLVE Schema output cluttered up single view
204
- * RESOLVE Scripts not loading in footer
205
- * Support JetPack's Publicize module
206
- * Verbiage updates
207
- * Widgets don't rotate notice
208
-
209
- ## 2.18.0
210
- * Add Codeship.io status
211
- * Check for init and theme functions to exist
212
- * CLOSE #11 Conflicts with "Re-order posts within Categories"
213
- * Link to Testimonials by WooThemes migrator
214
- * Move ci to tests
215
- * Move CSS to assets
216
- * Move files to assets
217
- * Move lib to includes/libraries
218
- * Move main class to own class file
219
- * Remove Travis CI status
220
- * RESOLVE #43 hatom feed errors
221
- * RESOLVE #45 Plugin Disables Itself
222
- * RESOLVE #7 Support subdirectory testimonial landing page
223
- * RESOLVE Non-SSL protocol used for scripts and styles
224
- * Revise required file paths
225
- * Specify a “Text Domain” and “Domain Path”
226
- * Update shortcode examples
227
- * Update verbiage
228
- * Use $plugin_assets than $plugin_path
229
-
230
- ## 2.17.3
231
- * RESOLVE #44 Blank testimonial between each rotating testimonial
232
-
233
- ## 2.17.2
234
- * RESOLVE Testimonials Widget Premium load issue
235
- * RESOLVE [Testimonial box displays as all white in widget on IE9](http://wordpress.org/support/topic/testimonial-box-displays-as-all-white-in-widget-on-ie9). Thank you [jbmoore](http://wordpress.org/support/profile/jbmoore)
236
-
237
- ## 2.17.1
238
- * No show premium link when it's installed
239
- * RESOLVE #34 Non-SSL protocol used for image inclusion
240
- * Use Aihrus Framework 1.0.1
241
- * Use aihr_check_aihrus_framework
242
- * Use strip_protocol
243
-
244
- ## 2.17.0
245
- * BUGFIX No notices on deactivation
246
- * Convert TODO to https://github.com/michael-cannon/testimonials-widget/issues
247
- * Implement PHP version checking
248
- * Implement WordPress version checking
249
- * Restructure readme
250
- * Tested up to 3.9.0
251
-
252
- ## 2.16.6
253
- * BUGFIX Widget title is same as link
254
-
255
- ## 2.16.5
256
- * BUGFIX Setting's defaults missing during validation
257
-
258
- ## 2.16.4
259
- * BUGFIX #1 Widget title displays "array" than link
260
- * BUGUnreproducible Call to undefined method Testimonials_Widget::clean_string
261
-
262
- ## 2.16.3
263
- * Check for PHP 5.3
264
- * Move helper methods to Aihrus_Common
265
- * Restore pre-2.0.0 auto-migration
266
- * Use Aihrus_Common::add_media
267
-
268
- ## 2.16.2
269
- * **Version 2.16.0 requires PHP 5.3+**
270
-
271
- ## 2.16.1
272
- * $this to __CLASS__
273
-
274
- ## 2.16.0
275
- * Add Expand/Collapse All Options helper for widget options - Thank you Scott Hendison
276
- * Add Shortcodes helper page - Thank you Scott Hendison
277
- * Add screenshot 20. Testimonials Shortcode Examples page
278
- * Add version_check
279
- * BUGFIX Donate notice shows despite `disable_donate` set
280
- * BUGFIX JavaScript generated even when no testimonials
281
- * BUGFIX Page Display of Testimonial duplicating Text - Elegant Themes' Trim theme
282
- * BUGFIX Saving settings doesn't show update notice
283
- * Delete notices on deactivation
284
- * Disable schemas by default for widgets
285
- * Enabled resetting widget options
286
- * Mark cacheables with similar key for easier cleanup
287
- * Rebrand Testimonials Widget as Testimonials
288
- * Removed Testimonials Widget pre-2.0.0 migration code
289
- * Rename no_code to show_code
290
- * Replace JS_KEY with SLUG
291
- * Revise Shortcode Examples formatting
292
- * Revise short description
293
- * Simplify display_setting
294
- * Update TODO
295
- * Update readme verbiage
296
- * Update to use `TW_PLUGIN_DIR_LIB`
297
- * Use abstract class Aihrus_Settings
298
- * Use abstract class Aihrus_Widget
299
- * Use aihrus framework
300
-
301
- ## 2.15.1
302
- * BUGFIX Fatal error: Access to undeclared static property: Testimonials_Widget_Settings::$cpt_category
303
- * Encapsulate shortcodes
304
- * [BUGFIX](http://wordpress.org/support/topic/2151-warning-illegal-offset-type-in-isset-or-empty?replies=3) Warning: Illegal offset type in isset or empty
305
-
306
- ## 2.15.0
307
- * Add 2.15.0 upgrade notice
308
- * Add filter `tw_get_testimonials_html`
309
- * Add option Always Load CSS?
310
- * Add option Enable Video?
311
- * Add option Start/Stop
312
- * Add option Transition Mode
313
- * BUGFIX JS slider_var not global
314
- * BUGFIX active and display-none classes still included though using bxSlider
315
- * Bump $2 donation request to $5
316
- * Hide non-widget settings
317
- * If upgrading, bxSlider will not be enabled by default. You must enable it in your widget and global settings. CSS customizations must be reviewed to have the `.active` and `.display-none` classes removed. The main `.testimonials-widget-testimonial` class also need the `display: none;` and `clear: left;` removed.
318
- * Match transition defaults to those of current testimonials widget
319
- * Move 2.14.0 transition options to Compatibility tab
320
- * Move height options to Compatibility tab
321
- * Moved testimonials-widget-2.14.0.css -> css/testimonials-widget-2.14.0.css
322
- * Moved testimonials-widget-ie7.css -> css/testimonials-widget-ie7.css
323
- * Reduce `empty` usage
324
- * Require at least WordPress 3.6
325
- * Simplify `wp_enqueue_style` handling
326
- * Update .travis for phpmd exclusions
327
- * Update FAQ
328
- * Update PHPCS config
329
- * Update TODO
330
- * Use const JS_KEY
331
- * [Auto-suggest category and tag options](http://wordpress.org/support/topic/feature-request-menus-in-the-widget)
332
- * [Responsively set height](http://wordpress.org/support/topic/better-set-height?replies=3#post-4788316)
333
- * [Use bxSlider JavaScript slider](http://bxslider.com/examples/auto-show-start-stop-controls) to make the transitions and navigation more slider like with a [pause button on testimonials](http://wordpress.org/support/topic/play-pause-icon-on-testimonial)
334
-
335
- ## 2.14.0
336
- * Abstact schema generation
337
- * Add API action tw_styles
338
- * Add API action tw_update
339
- * Add API filter tw_display_setting
340
- * Add API filter tw_review_name_length
341
- * Add API filter tw_schema
342
- * Add API filter tw_schema_agg_rating
343
- * Add API filter tw_schema_author
344
- * Add API filter tw_schema_item
345
- * Add API filter tw_schema_review
346
- * Add Review schema date modified
347
- * Add aggregate review data
348
- * Add item reviewed name and url to Review schema
349
- * Add screenshot 19. Using Review and AggregateRating schema data structures
350
- * Added shortcode option variable names on Settings screen
351
- * Added validate case is_true
352
- * Auto create Review schema name from post content - like excerpt
353
- * BUGFIX Errors show when no testimonials
354
- * BUGFIX Javascript and CSS not carried through when testimonials are cached
355
- * BUGFIX PHP Notice `no_code`
356
- * BUGFIX Schema properties contain HTML and entities
357
- * BUGFIX Testimonials go blank during rotations (javacript var)
358
- * BUGFIX aggregate data prevents testimonials from recycling
359
- * BUGFIX animation transitions aren't smooth
360
- * BUGFIX correct aggregate total
361
- * BUGFIX gravatar size not based upon image size
362
- * BUGFIX has_archive option network_site_url
363
- * BUGFIX missing space after itemprop="image"
364
- * BUGFIX paging arrows not positioned correctly
365
- * BUGFIX schema meta method doesn't handle schema property wrapping
366
- * BUGFIX single content not wrapped with review schema
367
- * BUGFIX single view doesn't support caching
368
- * BUGFIX styles not included for `get_single`
369
- * CSS wp_register_style and wp_enqueue_style slug changed from 'testimonials-widget' to 'Testimonials_Widget'
370
- * Clean up JavaScript
371
- * Correct Review schema name usage
372
- * Default `do_shortcode` on
373
- * Default enable custom taxonomy 'show_admin_column'
374
- * Enable [rich snippets/structured data](http://wordpress.org/support/topic/lots-of-options-4?replies=3#post-4754108) per [review schema](http://schema.org/Review)
375
- * Gravatars saved as featured images to testimonials when no featured image exists
376
- * Implement AggregateRating, Organization, Person, Place, Review, and Thing structured data
377
- * Move Review schema image to `get_schema`
378
- * Prevent `has_archive` and `rewrite_slug` matching existing slugs and same
379
- * Refactor Review schema handling with easier API use
380
- * Refactored CSS/JS generation and inclusion
381
- * Refactored scripts and styles handling
382
- * Remove `refresh_interval=0`'s automatic setting of `limit=1` - Thank you Phillip Gapp
383
- * Remove default overrides for custom post type
384
- * Scripts `ksort` removed. Use `array_unshift` in your `tw_testimonials_js` filters instead.
385
- * Travis ignore WordPress.WhiteSpace.ControlStructureSpacing - false positives
386
- * Update FAQ
387
- * Update TODO
388
- * Update examples
389
- * Update readme option ordering
390
- * Update screenshots
391
- * Update screenshots
392
- * Update verbiage
393
- * Validate reviewed_item_url as url
394
- * [Load scripts and stylesheets only on Testimonials Page](http://wordpress.org/support/topic/load-scripts-and-stylesheets-only-on-testimonials-page)
395
- * https jQuery transport
396
-
397
- ## 2.13.6
398
- * Add IDs column to edit testimonials listing page
399
- * Add filter `tw_settings_add_help_tabs`
400
- * Add option Fade In Speed
401
- * Add option Fade Out Speed
402
- * Add settings page help tab
403
- * BUGFIX index has_archive and rewrite_slug not set
404
- * BUGFIX plugin_row_meta not returning default state
405
- * IE7 CSS moved to separate file. Include via Testimonials > Settings if needed
406
- * Localize text
407
- * Pass YSlow and Google PageSpeed testing
408
- * Performance optimizations
409
- * Prevent Testimonials Widget custom post type URL slug naming conflicts
410
- * Update premium shortcodes
411
- * Validate URL submissions
412
- * [Begin CSS testing](http://www.netmagazine.com/tutorials/4-tools-automatic-css-testing)
413
-
414
- ## 2.13.5
415
- * BUGFIX Caching defaults not correct
416
-
417
- ## 2.13.4
418
- * Add $atts parameter to filter `tw_data`
419
- * Add action `tw_scripts`
420
- * Add filter `tw_get_testimonial_html_class`
421
- * Add filter `tw_testimonials_js_internal`
422
- * BUGFIX instance numbers breaking caching
423
- * BUGFIX settings page missing page title
424
- * Change &$this variable calls to $this
425
- * Enabling sorting of scripts for precedence
426
- * Remove unused first parameter from `tw_cache_get` filter call
427
- * Tie-in premium disable_donate option
428
-
429
- ## 2.13.3
430
- * [Add shortcode category example](http://wordpress.org/support/topic/category-shortcode-1?replies=2#post-4550244) - Thank you ashleynlinares
431
- * Add do shortcodes option inside of testimonials content
432
- * BUGFIX keep shortcodes inside of widgets, let theme function handle to do them or not
433
- * Expand FAQ section
434
- * Rename Title to Job Title as appropriate
435
- * Update POT
436
- * Update TODO
437
-
438
- ## 2.13.2
439
- * Add StillMaintained.com notice
440
- * BUGFIX Extra meta box fields are no show
441
- * Disengaged from hard coded wp-content path
442
- * Escape translations
443
-
444
- ## 2.13.1
445
- * Add demo link
446
- * Add shortcode example explanations
447
- * Add video introduction
448
- * Disable animation by default
449
- * Move localization load to init()
450
- * Update donation request text
451
- * Update premium features
452
-
453
- ## 2.13.0
454
- * Add PHP Copy and Paste Detector
455
- * Add PHP run-time checks
456
- * Add Travis CI with PHP Code Sniffer
457
- * Add developer README and CONTRIBUTING docs
458
- * BUGFIX DOM Element error on last testimonial rotation
459
- * BUGFIX Data delete on uninstall not firing
460
- * BUGFIX Testimonials Widget edit page doesn't display custom taxonomies
461
- * Beta test update text
462
- * Coding standards updates
463
- * Create TODO doc
464
- * Disabled PHP Mess Detector
465
- * Don't escape already escaped text
466
- * Don't load plugin till all are loaded
467
- * FEATURE [Animated widget rotation](http://wordpress.org/support/topic/animate-jumpy-widget)
468
- * OPTION Add Disable animation?
469
- * Relocate activation, deactivation, and uninstall hooks
470
- * Remove WP_UNINSTALL_PLUGIN reference
471
- * Remove class from settings page link
472
- * Rename class-settings-testimonials-widget.php to class-testimonials-widget-settings.php
473
- * Revise API doc headings
474
- * Revise instance creators to only fire when ready
475
- * Update Filters listing to API document
476
- * Update POT
477
-
478
- ## 2.12.8
479
- * Add filter `tw_cite_html` to adjust cite contents - Thank you [Dimitrios](http://visualweb.gr/) for the suggestion
480
- * BUGFIX Warning: Illegal string offset 'exclude'
481
- * Replace __ with esc_html__
482
- * Update Premium features
483
-
484
- ## 2.12.7
485
- * BUGFIX Link targets affected page navigation
486
- * Removed donate monthly show code
487
-
488
- ## 2.12.6
489
- * BUGFIX If no refresh_interval, then LIMIT 1
490
- * Change donate from $1 to $2 due to fees
491
- * Dashboard testimonials count statistics
492
- * Display donate on major/minor version release or if it's been a month
493
- * Remove braces from simple if/else structures
494
- * Settings page inheritance note
495
- * Update premium features listing
496
- * Use donate button than text
497
-
498
- ## 2.12.5
499
- * BUGFIX Correct loose vs strict comparison for intval and absint
500
- * If no refresh_interval, then LIMIT 1
501
-
502
- ## 2.12.4
503
- * BUGFIX Settings jQuery UI Tabs conflict
504
- * NOT BUG [WPML bug](http://wordpress.org/support/topic/wpml-bug?replies=1)
505
- * Remove settings.css
506
- * Settings about section height fix
507
- * TODOs update
508
- * Update Premium product page URL
509
- * Update WPML configuration
510
- * Use PayPal donate image in settings
511
-
512
- ## 2.12.3
513
- * BUGFIX Import option constantly overrides settings
514
- * BUGFIX [Error When Database Does Not Exist Yet](http://wordpress.org/support/topic/error-when-database-does-not-exist-yet)
515
-
516
- ## 2.12.2
517
- * $1 donation link admin_notice on installation or major/minor update
518
- * Add forum responses cheat sheet
519
- * Auto flush URLs if archive or testimonial slugs change
520
- * BUGFIX Respect attribute settings by preventing reset_defaults and importexport activating on front-end
521
- * Convert slug, slugs, and term setting items to lowercase on save
522
- * Correctly delete all testimonials options on delete
523
- * Don't create class instance unless plugin is activated
524
- * FEATURE Allow for custom post type categories and tags [Idea via crdunst](http://wordpress.org/support/topic/feedback-tagscategories?replies=3#post-4160839)
525
- * Prevent same has_archive and rewrite_slug which causes URL problems
526
- * Remove excess FAQ text
527
- * Remove unused settings and methods
528
- * Remove unused testing settings
529
- * Set version for which admin notice to display
530
-
531
- ## 2.12.1
532
- * BUGFIX Settings memory leak [Sites hosed after update 2.12.0](http://wordpress.org/support/topic/premium-sites-hosed-after-update-2120)
533
- * BUGFIX [importexport settings failure](http://wordpress.org/support/topic/errors-after-updating)
534
- * Change update warning verbiage
535
- * Update FAQ & support links to knowledge base
536
-
537
- ## 2.12.0
538
- * Add file headers to lib/class*
539
- * Add filter tw_widget_options to alter displayed widget options
540
- * BUGFIX Correct settings required validation `break 2`
541
- * BUGFIX Non-static method Testimonials_Widget::get_testimonials_html() should not be called statically
542
- * CSS rename testimonialswidget_testimonial(s) to testimonials-widget-testimonial(s)
543
- * Correct static get_testimonials_html, get_testimonials_htmls, widget_options function declaration
544
- * Correct static validators call
545
- * Explain options inheritance
546
- * FEATURE Remove Plugin Data on Deletion? - Delete all Testimonials Widget data and options from database on plugin deletion
547
- * FEATURE Settings export/import
548
- * Refactor out get_quote and get_cite from get_testimonial_html
549
- * Refactor excess settings grab in widget_options
550
- * Remove $blank from testimonials_truncate()
551
- * Remove unused code
552
- * Rename metabox.class.php class-redrokk-metabox-class.php
553
- * Rename settings.testimonials-widget.php class-settings-testimonials-widget.php
554
- * Rename testimonials-widget-widget.php class-testimonials-widget-widget.php
555
- * Revise FAQ
556
- * SCREENSHOT 17. Testimonials Widget Settings > Compatibility & Reset tab
557
- * Show latest updates notice on activation
558
- * Spellcheck readme.txt
559
- * Update CSS for WordPress Coding standards
560
- * Update FAQ
561
- * Update JavaScript for WordPress Coding standards
562
- * Update PHP for WordPress Coding Standards
563
- * Update POT
564
- * Update TODOs
565
- * Update premium features
566
- * Update rulesets
567
- * Use ID for widget
568
-
569
- ## 2.11.3
570
- * BUGFIX [Can't set featured image](http://wordpress.org/support/topic/cant-set-featured-image-3)
571
- * Begin WordPress coding standard cleanup
572
- * Bold option headers
573
- * Change `has_archive` default from `testimonials` to `testimonials-archive`
574
- * Clean up static method calls to prevent PHP Strict notices
575
- * Correct filter name `tw_next_posts_link` to `tw_next_posts_link_text`
576
- * Correct static methods calling
577
- * Secure activation, deactivation, uninstall operations
578
- * Update POT
579
- * Update profile
580
-
581
- ## 2.11.2
582
- * Add `min1` and `nozero` validation
583
- * Always include settings class
584
- * BUGFIX Don't prepend http to email addresses
585
- * Move lesser used widget options to expandable Additional Widget Options section
586
- * Move settings setup to `init`
587
- * Revise `absint` and `intval` validation to default on blank entry
588
- * Update POT
589
- * Update TODO
590
- * Update text domain for localization and POT
591
- * Use `links_add_target` for widget title link
592
-
593
- ## 2.11.1
594
- * BUGFIX [Fatal error: Testimonials_Widget_Settings](http://wordpress.org/support/topic/fatal-error-tw_settings)
595
-
596
- ## 2.11.0
597
- * Add Option "Hide Image in Single View?" `hide_image_single`
598
- * Add `.author` and `.email` to CSS
599
- * Add `.single` to single view testimonials
600
- * Add location to meta_key ordering options
601
- * BUGFIX [Convert q tags to blockquote](http://wordpress.org/support/topic/open-link-in-new-tab-html-validation) [Why?](http://www.w3schools.com/tags/tag_blockquote.asp)
602
- * BUGFIX [Fix cite tag usage - it's title, not source](http://www.w3.org/html/wg/drafts/html/master/text-level-semantics.html#the-cite-element) using [T](http://html5doctor.com/blockquote-q-cite/) [BD](http://oli.jp/2011/blockquote/)
603
- * Beta testers needed section added
604
- * Disable self-generated quotation marks
605
- * Enable backwards compatibility for default options
606
- * Ignore init() during AJAX and autosave operations
607
- * Optimize DB after uninstall
608
- * Rename CSS attributes to credit
609
- * Revise README verbiage in general
610
- * Simplify CSS naming
611
- * Update Allow Comments verbiage
612
- * Update TODOs
613
- * Update features listing
614
- * Update options listing
615
- * Update premium features
616
- * Update readme formatting
617
-
618
- ## 2.10.3
619
- * Add "Menu Order" to Order By options
620
- * Add Height option to automatically set min and max height
621
- * BUGFIX [Only one testimonial displaying](http://wordpress.org/support/topic/only-one-testimonial-displaying)
622
- * BUGFIX [Post Types Order](http://wordpress.org/support/topic/random-order-doesnt-work) - sorting conflict
623
- * Delete data on uninstall
624
- * Enable quotes and join for IE7 - Thank you [SFMichael](http://wordpress.org/support/topic/ie-7-quotes-fix)
625
- * Flush URLs on deactivation
626
- * Revise self::$base usage
627
- * Revise settings_link handling
628
- * Screenshot 16 Testimonials Widget Settings > Widget tab
629
- * Update Premium link
630
- * Update TODOs
631
-
632
- ## 2.10.2
633
- * BUGFIX Settings initialization overwrote previous settings
634
-
635
- ## 2.10.1
636
- * Moved [FAQ](http://aihr.us/testimonials-widget/faq/)
637
- * Removed premium screenshots
638
- * Rename screenshot-3.png screenshot-2.png
639
- * Rename screenshot-4.png screenshot-3.png
640
- * Rename screenshot-5.png screenshot-4.png
641
- * Rename screenshot-6.png screenshot-5.png
642
- * Rename screenshot-7.png screenshot-6.png
643
- * Rename screenshot-8.png screenshot-7.png
644
- * Rename screenshot-13.png screenshot-8.png
645
- * Rename screenshot-14.png screenshot-9.png
646
- * Rename screenshot-21.png screenshot-10.png
647
- * Rename screenshot-22.png screenshot-11.png
648
- * Rename screenshot-23.png screenshot-12.png
649
- * Rename screenshot-24.png screenshot-13.png
650
- * Rename screenshot-25.png screenshot-14.png
651
- * Rename screenshot-26.png screenshot-15.png
652
- * Screenshot 2 removed
653
- * Screenshot 9 removed
654
- * Screenshot 10 removed
655
- * Screenshot 11 removed
656
- * Screenshot 12 removed
657
- * Screenshot 15 removed
658
- * Screenshot 16 removed
659
- * Screenshot 17 removed
660
- * Screenshot 18 removed
661
- * Screenshot 19 removed
662
- * Screenshot 20 removed
663
- * Screenshot 27 removed
664
- * Screenshot 28 removed
665
-
666
- ## 2.10.0
667
- * Add `hide_content` option verbiage
668
- * Add screenshot 27 `[[testimonialswidgetpremium_form]]` – Add a Testimonial
669
- * Add screenshot 28 Testimonials Widget Settings > Entry Form tab
670
- * Added rel="nofollow" to URL - Thank you Nicholas Corrieri for the suggestion
671
- * Convert validation to configuration
672
- * Correct breakline on radio settings display
673
- * Correct checkbox checking
674
- * Correct paging handling
675
- * Correct post_status selection for single view
676
- * Describe settings defaults
677
- * Dutch translation by Bjorn Robijns
678
- * Enable echo/return for display_setting
679
- * Enable file input for settings
680
- * Enable widget options no-show
681
- * Finish validation configuration move
682
- * Form demo link
683
- * Move Changelog to changelog.txt
684
- * Rename load_sections > _sections
685
- * Rename load_settings > settings
686
- * Save option defaults
687
- * Set missing checkbox values to 0 on validate
688
- * TODO Delete data option on deactivation
689
- * Update Premium description
690
- * Update WPML configuration
691
-
692
- ## 2.9.1
693
- * BUGFIX Assigning the return value of new by reference is deprecated in metabox.class.php
694
-
695
- ## 2.9.0
696
- * Add location meta field after title
697
- * Add location related options
698
- * FAQ 18, 34, 35 update
699
- * Screenshot 2, 4, 5 updated
700
- * Update POT
701
-
702
- ## 2.8.4
703
- * BUGFIX [Title link does not allow a relative link](http://wordpress.org/support/topic/title-link-does-not-allow-a-relative-link)
704
-
705
- ## 2.8.3
706
- * BUGFIX [Selection > Category Filter doesn't remember >1 category](http://wordpress.org/support/topic/selection-category-filter-doesnt-remember-1-category)
707
- * FAQ 67 testimonials paging doesn't work
708
- * FAQ 68 feature XYZ
709
-
710
- ## 2.8.2
711
- * Add filter `tw_version`
712
- * Screenshot 11/16 updated
713
- * Update POT
714
- * Update Premium features
715
- * Version tracking for default settings
716
-
717
- ## 2.8.1
718
- * Customizable archive and testimonial URLs
719
- * FAQ 66 Change the testimonials archive or single view URL
720
- * Optional commenting on testimonial single-view pages
721
- * Screenshot 26 Testimonials Widget Settings > Post Type tab
722
- * Update POT
723
-
724
- ## 2.8.0
725
- * Merge in settings branch
726
- * Add `tw_get_options`
727
- * Add filter `tw_sections` – Alter section options
728
- * Add filter `tw_settings` – Alter setting options
729
- * Add settings page 'Selection', 'Ordering', and 'Widget' tabs
730
- * BUG with "Post Types Order"
731
- * BUGFIX paging when not in singular view
732
- * Configure settings within Testimonials_Widget_Settings class
733
- * Enable 'Expand/Collapse' view in Widget options
734
- * FAQ 65 Disable the stylesheet
735
- * FEATURE Remove `.hentry` CSS?
736
- * FEATURE Testimonials Widget Settings screen
737
- * Removed filters `tw_options_update`, `tw_options_form`
738
- * Rename `widget_text` to `bottom_text`
739
- * Revise About page content
740
- * Revise Settings page footer
741
- * Revise widget options update and validation
742
- * Screenshot 11 updated
743
- * Screenshot 16 updated
744
- * Screenshot 2 updated
745
- * Screenshot 22 Testimonials Widget Settings > General tab
746
- * Screenshot 23 Expanded 'Selection Options' Testimonials Widget
747
- * Screenshot 24 Expanded 'Ordering Options' Testimonials Widget
748
- * Screenshot 25 Testimonials Widget Settings > Selection tab
749
- * Screenshot 3 updated
750
- * Screenshot 4 updated, Expanded 'General Options' Testimonials Widget
751
- * Update "Shortcode and Widget Options" verbiage
752
- * Update POT file
753
- * Use defaults via Testimonials_Widget_Settings class
754
- * Validate shortcode and widget options via Testimonials_Widget_Settings::validate_settings
755
- * Verbiage updates
756
-
757
- ## 2.7.17
758
- * Add purchase Testimonials Widget Premium plugin meta link
759
- * Begin settings screen work
760
- * FAQ 20 Update
761
- * FAQ 31 Update
762
- * FAQ 63 Remove the cite –
763
- * FAQ 64 Plugin conflict
764
- * Screenshot 21 Poedit Catalog properties
765
- * TODO class removal
766
- * Update localization verbiage
767
-
768
- ## 2.7.16
769
- * Add comments panel to edit screen - [Thank you BarrieSpence](http://wordpress.org/support/topic/disable-comments-10?replies=1)
770
- * TODO Admin panel
771
-
772
- ## 2.7.15
773
- * Add "CSS class" to widget options window
774
- * FAQ 31/34/35/50/53/55 updates
775
- * FAQ 61 Determine .testimonialswidget_testimonialsNNN
776
- * FAQ 62 Category and tag selection
777
- * Feature updates
778
- * Localization, Hebrew
779
- * Screenshot 3 updated
780
-
781
- ## 2.7.14
782
- * BUGFIX [Testimonials archive view URL conflicts with Page slug](http://wordpress.org/support/topic/testimonials-archive-view-url-conflicts-with-page-slug)
783
- * FAQ 1 Update - Thank you [aaaronscat](http://wordpress.org/support/topic/writing-php-to-display-rotating-widget-in-a-template) for the inspiration
784
- * FAQ 60 Download older versions of Testimonials Widget
785
- * Premium feature update
786
- * Screenshot 20 added
787
-
788
- ## 2.7.13
789
- * Adapt for `mb_strcut` and `mb_strlen` alternatives
790
- * BUGFIX [Widget doesn't appear](http://wordpress.org/support/topic/widget-doesnt-appear-1)
791
- * Update POT
792
-
793
- ## 2.7.12
794
- * Change Aihrus support email to contact form
795
- * FAQ 1 Update - Thank you [aaaronscat](http://wordpress.org/support/topic/writing-php-to-display-rotating-widget-in-a-template) for the inspiration
796
- * Update Testimonials Widget Premium URL
797
-
798
- ## 2.7.11
799
- * Citation styling note
800
- * Removed sub-category shortcode example
801
- * Thanks to Joe Weber for asset header
802
- * Update premium URL
803
- * Update premium features
804
- * Update premium purchase URL
805
-
806
- ## 2.7.10
807
- * BUGFIX extra excerpt in single view
808
- * Screenshot 11 updated
809
- * Update premium features
810
-
811
- ## 2.7.9
812
- * Revise content truncation to respect HTML tags
813
- * Update premium description
814
- * Update premium features
815
-
816
- ## 2.7.8
817
- * Add `before` and `after` options to `paging`
818
- * FAQ 58 Specify testimonials per page or section
819
- * FAQ 59 Rotating widget show all testimonials than only one at a time
820
- * Revert on-demand CSS to always included
821
- * Support process and donation update
822
- * Thank you to [mkearns](http://wordpress.org/support/topic/just-excellent-3) for specifying a sub-category shortcode example
823
- * Update premium URL
824
- * Update premium features
825
-
826
- ## 2.7.7
827
- * FAQ 13 Update
828
- * FAQ 31 Update
829
- * Shortcode examples "[[" to "["
830
-
831
- ## 2.7.6
832
- * Add `[[testimonialswidget_widget]]` to Shortcodes column
833
- * CSS cite `margin-top` adjustment
834
- * Enable testimonials archive view
835
- * FAQ 1 Update
836
- * FAQ 52 Update
837
- * FAQ 53 Update
838
- * FAQ 55 Style page and instance testimonials
839
- * FAQ 56 Testimonials archive view URL
840
- * FAQ 57 Testimonial single view URL
841
- * Only include CSS if testimonials instance called
842
- * Screenshot 19 `[[testimonialswidget_widget unique=true]]` Show multiple testimonials in rotation
843
- * Set arg defaults via `defaults`
844
-
845
- ## 2.7.5
846
- * BUGFIX PHP Warning for new fields in widget when widget already exists
847
- * Exclude IDs option
848
- * Implement instance tracking
849
- * Protect shortcode examples
850
- * Update asset header size
851
- * Update premium features
852
-
853
- ## 2.7.4
854
- * Asset header help request
855
- * Premium feature updates
856
- * Screenshot 9 updated
857
- * Screenshot 10 replaced
858
- * Screenshot 11 updated
859
- * Screenshot 15 updated
860
- * Screenshot 17 Single `[[testimonialswidget_list]]` entry with and without 'Read more' link
861
- * Screenshot 18 `[[testimonialswidgetpremium_count]]` Examples
862
-
863
- ## 2.7.3
864
- * Apply quotes only around testimonial content
865
- * FAQ 13 update
866
- * FAQ 34 update
867
- * FAQ 35 update
868
- * Screenshot 8 replaced
869
- * Simplified quotes handling
870
- * Upgrade notification
871
-
872
- ## 2.7.2
873
- * FAQ 54 update
874
- * Screenshot 12 update
875
- * Screenshot 16 Edit testimonial with "Excerpt" and "Read More Link" fields - Testimonials Widget Premium plugin
876
-
877
- ## 2.7.1
878
- * Description update
879
- * FAQ 1 update
880
- * FAQ 2 update
881
- * FAQ 4 update
882
- * FAQ 5 update
883
- * FAQ 6 update
884
- * FAQ 7 update
885
- * FAQ 8 update
886
- * FAQ 9 update
887
- * FAQ 12 update
888
- * FAQ 14 update
889
- * FAQ 15 update
890
- * FAQ 17 update
891
- * FAQ 22 update
892
- * FAQ 25 update
893
- * FAQ 26 update
894
- * FAQ 30 update
895
- * FAQ 32 update
896
- * FAQ 34 update
897
- * FAQ 35 update
898
- * FAQ 37 update
899
- * FAQ 53 update
900
- * Feature update
901
- * Installation update
902
- * Screenshot 1 update
903
- * Screenshot 2 update
904
- * Screenshot 3 update
905
- * Screenshot 4 update
906
- * Screenshot 5 update
907
- * Screenshot 6 update
908
- * Screenshot 7 update
909
- * Screenshot 8 replaced
910
- * Screenshot 9 replaced
911
- * Screenshot 12 update
912
- * Screenshot 15 update
913
- * Screenshot 16 removed
914
- * Screenshot 17 removed
915
- * Screenshot 18 removed
916
-
917
- ## 2.7.0
918
- * FAQ 13 Update
919
- * FAQ 54 Release early. Release often.
920
- * Redo content opening and closing quotes display
921
- * Upgrade notification for 2.7.0
922
-
923
- ## 2.6.6
924
- * Remove CSS `overflow: auto` - too many complaints
925
- * FAQ 53 Scroll widget based testimonial content
926
-
927
- ## 2.6.5
928
- * BUGFIX: overflow auto than scroll
929
- * Correct screenshot 11 & 18
930
-
931
- ## 2.6.4
932
- * Add filters `tw_posts_custom_column`, `tw_columns`, `tw_meta_box`
933
- * BUGFIX Testimonial posts page column URL now correctly clickable
934
- * Code spacing cleanup
935
- * Enabled [scrolling text](http://wordpress.org/support/topic/plugin-testimonials-widget-scroll-for-a-single-but-long-testimonial) for maximum height restricted testimonial widgets
936
- * FAQ 34/35 CSS styling update
937
- * Scrolling testimonials for maximum height restricted widgets
938
- * Testimonials have `get_post_class` applied
939
- * Update premium features
940
-
941
- ## 2.6.3
942
- * Add filter `tw_query_args`
943
- * Add filters `tw_testimonials_css`, `tw_testimonials_js`
944
- * Allow `limit=-1`
945
- * BUGFIX Repeated footer CSS and JavaScript
946
- * CSS - block disply widget image
947
- * FAQ 52 Include testimonies in archive view
948
- * Refactor `get_query_args` out of `get_testimonials`
949
- * Revise JavaScript handling
950
- * Screenshot 17 `require_image`, `minimum_length` and `maximum_length` shortcode option examples
951
- * Screenshot 18 Widget with 'Next testimonial…' link
952
- * Update POT
953
- * Update premium features
954
- * Update premium screenshots
955
-
956
- ## 2.6.2
957
- * Compatible with WordPress 3.6
958
- * Fix single view PHP warning
959
-
960
- ## 2.6.1
961
- * Add filter `tw_testimonial_html_single_content`
962
- * Add `force_pad` option to `testimonials_truncate`
963
- * Copyright year update
964
- * Update Premium features
965
-
966
- ## 2.6.0
967
- * Add FAQ 51 filter `tw_get_testimonial_html` usage
968
- * FAQ 50 Revise
969
- * Reorganize `get_testimonial_html`
970
-
971
- ## 2.5.6
972
- * Add FAQ 50 Example to set widget gradient background color
973
- * FAQ 13 Update
974
- * FAQ 20 Add PHP tags
975
- * FAQ 48 Code correction
976
- * FAQ 49 Code correction
977
-
978
- ## 2.5.5
979
- * Enable widget caching
980
- * Refactor `get_testimonials_html` to break out CSS/JS generation
981
- * Respect [meta capabilities](http://wordpress.org/support/topic/plugin-testimonials-widget-version-20-rewrite-suggestions-request?replies=18#post-3359157)
982
- * Revise TODO text
983
- * TODO remove Template engine - see `tw_testimonial_html*` filters
984
-
985
- ## 2.5.4
986
- * Add filter `tw_testimonial_html_single`
987
- * Add filter `tw_testimonial_html`
988
- * Aihrus testimonial URL correction
989
- * FAQ 34 Find `testimonialswidget_testimonialsNNN` instance naming
990
- * FAQ 48 Customize testimonial list/widget output
991
- * FAQ 49 Customize testimonial single output
992
-
993
- ## 2.5.3
994
- * Add donate link in plugin section
995
- * Donate links
996
-
997
- ## 2.5.2
998
- * Aihrus branding
999
-
1000
- ## 2.5.1
1001
- * Update POT file
1002
-
1003
- ## 2.5.0
1004
- * Add option Keep whitespace? - Thank you [kangchenjunga](http://wordpress.org/support/topic/optional-wpautop-functionality-for-better-formatting?replies=2) for the suggestion
1005
- * Revise FAQ 47
1006
- * Screenshot 16 - Widget whitespace kept
1007
- * Update Author URL
1008
-
1009
- ## 2.4.8
1010
- * Donate to purchase verbiage change - One bad experience ruins it for all
1011
- * FAQ 47 testimonials list in a widget
1012
- * TODO Add location field
1013
- * TODO Add plugin donate link
1014
- * [CleanCSS](http://cleancss.com/) the CSS
1015
-
1016
- ## 2.4.7
1017
- * Add filter `tw_defaults_single`
1018
- * TODO clean up for premium version
1019
- * TODO Optional wpautop functionality for better formatting
1020
-
1021
- ## 2.4.6
1022
- * Add 'No order' as an Order By widget option
1023
- * Add FAQ 45 testimonial character limit
1024
- * Add Recommendation heading
1025
- * FAQ 23 mention 404
1026
- * FAQ 46 testimonial ordering by given IDs
1027
- * Update filters listing
1028
- * Use `posts_results` filter to put posts in same orders as post__in when orderby=none
1029
-
1030
- ## 2.4.5
1031
- * BUGFIX Missing CSS for testimonialswidget_join_title
1032
- * FAQ 44 Refresh interval - Thank you [biztips](http://wordpress.org/support/topic/fatal-error-558?replies=6#post-3475595)
1033
-
1034
- ## 2.4.4
1035
- * Add screenshot 15
1036
- * FAQ 34 Update CSS
1037
- * FAQ 35 Update CSS
1038
- * FAQ 42 Exclude testimonial categories from Category widget
1039
- * FAQ 43 Exclude testimonial categories from my sitemap
1040
- * Update premium features
1041
-
1042
- ## 2.4.3
1043
- * Adjust default `limit` to 10 from 25
1044
- * Add CSS `margin-top` to `cite`, `.testimonialswidget_extra` and `.testimonialswidget_text`
1045
- * BUGFIX [Keep `widget_text` with each testimonial](http://wordpress.org/support/topic/images-not-showin?replies=10)
1046
- * Donate link update
1047
- * FAQ 41 Widget height consistency
1048
-
1049
- ## 2.4.2
1050
- * BUGFIX [No image](http://wordpress.org/support/topic/update-17?replies=4) in [widget](http://wordpress.org/support/topic/plugin-testimonials-widget-short-rotating-testimonial-link-to-the-full-testimonial?replies=16)
1051
- * TODO Add refactor `get_testimonials_html`
1052
-
1053
- ## 2.4.1
1054
- * BUGFIX `testimonialswidget_widget` always random
1055
- * Comment and verbiage cleanups
1056
- * Minor refactor of `get_testimonial_html`
1057
- * TODO Added Template engine
1058
-
1059
- ## 2.4.0
1060
- * FAQ 39 Style the custom widget text
1061
- * FAQ 40 Page number pagination
1062
- * FEATURE Custom widget text
1063
- * FEATURE Make the widget title clickable
1064
- * FEATURE Page numbers via WP-PageNavi
1065
- * Refactor paging to use WordPress functions
1066
- * SCREENSHOT 12 recrop
1067
- * SCREENSHOT 13 Widget with clickable title and custom text/HTML on bottom
1068
- * SCREENSHOT 14 WP-PageNavi compatible for page numbers than default arrows
1069
- * SCREENSHOT 3 update
1070
- * SCREENSHOT 4 update
1071
- * TODO Remove Custom widget text - added
1072
- * TODO Remove Make the widget title clickable - added
1073
- * TODO Remove Page numbers - added
1074
- * TODO Remove fields to show - done via theme
1075
-
1076
- ## 2.3.4
1077
- * BUGFIX [Testimonial plugin means Set Feature Image Not Displaying](http://wordpress.org/support/topic/testimonial-plugin-means-set-feature-image-not-displaying)
1078
- * Test with WordPress 3.5.0RC1
1079
- * TODO remove Publish & New - just click 'New Testimonial' after Publishing
1080
- * Update donate link
1081
-
1082
- ## 2.3.3
1083
- * FEATURE Improved single page view
1084
- * SCREENSHOT Single testimonial view
1085
- * TODO Meta capabilities
1086
-
1087
- ## 2.3.2
1088
- * Add filters `tw_options_update`, `tw_options_form`
1089
- * BUGFIX ["featured image" module disappeared](http://wordpress.org/support/topic/no-image-upload?replies=12#post-3423001)
1090
- * Clean up tags per [plugin guidelines](http://wordpress.org/extend/plugins/about/guidelines/)
1091
- * Combine source and url display when no email or company
1092
- * FAQ renumber second 36 to 37
1093
- * FAQ 38 Use filter `tw_defaults`
1094
- * FEATURE Centralized defaults via filter `tw_defaults`
1095
- * Only grab `paged` information once
1096
- * Prepend HTTP protocol if missing in URL
1097
- * SCREENSHOT Widget Premium Options
1098
- * Simplify filter `tw_content`
1099
- * Simplify read more ellipsis
1100
- * Trim content after formatting
1101
-
1102
- ## 2.3.1
1103
- * BUGFIX [No image upload](http://wordpress.org/support/topic/no-image-upload)
1104
- * FAQ 36 Why donate?
1105
-
1106
- ## 2.3.0
1107
- * BUGFIX No paging when cached
1108
- * FAQ 3 Check for empty $data
1109
- * FAQ 33 Change more content ellipsis
1110
- * FAQ 34/35 Clarify CSS classes
1111
- * FAQ 36 Configure Next and Previous page indicators
1112
- * FEATURE (Premium) [Read More links](http://wordpress.org/support/topic/plugin-testimonials-widget-short-rotating-testimonial-link-to-the-full-testimonial) to [full testimonial page](http://wordpress.org/support/topic/very-easy-to-use-moderately-easy-to-style)
1113
- * FEATURE Easier to configure Next and Previous page indicators
1114
- * Refactor `get_testimonial_html`
1115
- * Refactor testimonial HTML creation methods
1116
- * Remove "Read more…" preparations
1117
- * Replace `testimonials_truncate` with WordPress's `wp_trim_words`
1118
- * SCREENSHOTS 'Read more' links
1119
- * Sanitize names
1120
- * TEMP Prevent widget caching
1121
- * TODO Clarify 'Read more'
1122
- * TODO Remove - CSV Export
1123
- * TODO Updates
1124
- * Update POT file
1125
-
1126
- ## 2.2.9
1127
- * BUGFIX [Testimonial List Loading 2nd Blank Box](http://wordpress.org/support/topic/testimonial-list-loading-2nd-blank-box)
1128
-
1129
- ## 2.2.8
1130
- * Begin "Read more…" preparations
1131
- * Correct content display processing
1132
- * FAQ 32 Min-height usage
1133
- * FAQ 4 Custom code placement clarification
1134
- * TODO Updates
1135
- * Widgets display content sans `wpautop` formatting
1136
-
1137
- ## 2.2.7
1138
- * Catch widget number in cache
1139
- * FAQ Custom query code. Thank you [tcwebguru](http://wordpress.org/support/topic/display-on-page-without-widget)
1140
- * FAQ Change Testimonials Widget text labels
1141
- * Language verbiage correction
1142
- * PHP notice fix - esc_attr
1143
- * Remove premium code include
1144
-
1145
- ## 2.2.6
1146
- * BUGFIX Widget config not saving correctly
1147
- * FAQ Export/import
1148
- * TODO Updates
1149
-
1150
- ## 2.2.5
1151
- * Adapt for [Testimonials Widget Premium plugin](http://aihr.us/downloads/testimonials-widget-premium-wordpress-plugin/)
1152
- * Add support text
1153
- * Correct verbiage spacing
1154
- * Explain `limit`
1155
- * TODO revisions
1156
-
1157
- ## 2.2.4
1158
- * BUGFIX [Tags - no more than 2?](http://wordpress.org/support/topic/tags-no-more-than-2)
1159
- * Clean up PHP notices
1160
- * Fix Changelog link
1161
- * PREMIUM Implement testimonials query and content caching
1162
- * TODO update
1163
-
1164
- ## 2.2.3
1165
- * Begin premium plugin adaptions
1166
- * BUGFIX [Tags - no more than 2?](http://wordpress.org/support/topic/tags-no-more-than-2)
1167
- * BUGFIX [Updated - Now getting fatal error when using testimonialswidget_list()](http://wordpress.org/support/topic/updated-now-getting-fatal-error-when-using-testimonialswidget_list)
1168
- * Clean up links in readme.txt
1169
- * Correct company and URL link usage
1170
- * [Correct readme.txt to standard](http://wordpress.org/extend/plugins/about/readme.txt)
1171
- * Don't rotate testimonial if only 1
1172
- * TODO updates
1173
-
1174
- ## 2.2.2
1175
- * BUGFIX [Now getting fatal error when using testimonialswidget_list()](http://wordpress.org/support/topic/updated-now-getting-fatal-error-when-using-testimonialswidget_list)
1176
- * Theme function defaults
1177
- * TODO updates
1178
- * URL pointing update
1179
-
1180
- ## 2.2.1
1181
- * Number FAQ Entries
1182
- * Revise Installation Usage text
1183
- * Revise Shortcode and Widget Options text
1184
-
1185
- ## 2.2.0
1186
- * FAQ `testimonialswidget_widget()` example
1187
- * Multisite compatible
1188
- * Reversion as 2.1.10 was a minor release than only bug fixes
1189
-
1190
- ## 2.1.10
1191
- * [Add title field ](http://wordpress.org/support/topic/plugin-testimonials-widget-just-tried-216-thoughts-suggestions)
1192
- * Consolidate defaults to simplify code maintenance
1193
- * Correct CSS testimonial list spacing
1194
- * Debug true - clear out PHP notices and such
1195
- * Default minimum height removed for widgets, now optional
1196
- * Maximum height setting
1197
- * [Remove CSS `position` attributes `.testimonialswidget_testimonial { position: absolute; }`](http://wordpress.org/support/topic/testimonials-widget-not-showing-correctly-on-sub-pages)
1198
- * TODO cleanup
1199
- * Update language POT
1200
- * Update screenshots
1201
- * Update WPML
1202
- * Widget options dropdown for ORDER BY entries
1203
-
1204
- ## 2.1.9
1205
- * Allow min_height 0
1206
- * FAQ - How do I use the theme function `testimonialswidget_list()`?
1207
- * Move CSS include to header
1208
-
1209
- ## 2.1.8
1210
- * Remove testimonialswidget_widget char_limit default
1211
- * TODO - debug true
1212
-
1213
- ## 2.1.7
1214
- * [0 disables char_limit](http://wordpress.org/support/topic/plugin-testimonials-widget-more-than-one-testimonial-appears-overlaps-content-below-the-widget)
1215
- * [Set link target](http://wordpress.org/support/topic/plugin-testimonials-widget-just-tried-216-thoughts-suggestions)
1216
- * Update widget option top screenshot
1217
-
1218
- ## 2.1.6
1219
- * FAQ: `ORDER BY` explanation
1220
- * FAQ: `testimonial_extra` explanation
1221
- * [Moved CSS to footer](http://wordpress.org/support/topic/plugin-testimonials-widget-html-validation)
1222
- * Next testimonial link idea
1223
- * Option: Add `hide_not_found` to prevent showing "No testimonials found"
1224
- * Revise theme methods as functions
1225
- * Screenshot: Update upper widget options
1226
- * Staged widget testimonials are initially `display: none` via CSS `.testimonialswidget_display_none`
1227
- * TODO updates
1228
- * Verbiage: Refresh Interval to Rotation Speed
1229
- * Widget option explanations
1230
-
1231
- ## 2.1.5
1232
- * Always apply min-height
1233
-
1234
- ## 2.1.4
1235
- * Enable WPML
1236
- * Idea - Maximum height setting
1237
- * Revise description
1238
- * Revise TODO
1239
-
1240
- ## 2.1.3
1241
- * Allow commas in meta_key
1242
- * FAQ on page not found
1243
- * Fix widget Random order always true condition
1244
- * Increase bottom margin spacing for listed testimonials
1245
- * TODO vote casting note
1246
- * Update localization pot file
1247
-
1248
- ## 2.1.2
1249
- * Add `hide_gravatar` option
1250
- * Add apply_filters( 'tw_data', $testimonial_data ) to process data before display
1251
- * Add right margin to gravatar image
1252
- * Added empty testimonial data field `testimonial_extra` for customization in testimonials
1253
- * Allow widget and shortcode sorting by post meta values via `meta_key`
1254
- * Correct PHP static accessors
1255
- * Update FAQ
1256
- * Update widget options screenshots
1257
- * Working full testimonial URLs
1258
-
1259
- ## 2.1.1
1260
- * Add [[testimonialswidget_list]] paging screenshot
1261
-
1262
- ## 2.1.0
1263
- * Enable paging for [[testimonialswidget_list]] shortcode
1264
- * Flush rewrite rules on activation
1265
- * Disallow paging in widget and [[testimonialswidget_widget]] shortcode
1266
-
1267
- ## 2.0.6
1268
- * Update shortcode option directions
1269
-
1270
- ## 2.0.5
1271
- * Ignore already imported
1272
- * Mark `testimonialswidget_widget() $number` argument as optional
1273
-
1274
- ## 2.0.4
1275
- * Allow for 0 refresh_interval in get_testimonials_html
1276
-
1277
- ## 2.0.3
1278
- * Allow for 0 refresh_interval in widget
1279
-
1280
- ## 2.0.2
1281
- * BUGFIX [Warning: call_user_func_array() ??](http://wordpress.org/support/topic/plugin-testimonials-widget-warning-call_user_func_array)
1282
- * Added Testimonials_Widget_Widget::get_testimonials_scripts for use with add_filter for wp_footer
1283
-
1284
- ## 2.0.1
1285
- * Verbiage updates
1286
- * Readme.txt validation
1287
- * widget q p tag display inline
1288
- * GPL2 licensing
1289
- * Move upgrade notice text towards installation
1290
- * Reorder screenshots
1291
- * Apply 'the_content' filters directly to prevent plugin baggage
1292
- * Update screenshot-7.png
1293
-
1294
- ## 2.0.0
1295
- * Major rewrite
1296
- * Add filters for image & gravatar sizes
1297
- * Admin bar New > Testimonial
1298
- * Authors and lower can manage their own testimonials
1299
- * Auto-migration from old to new format upon install
1300
- * Public > Published
1301
- * Not public > Private
1302
- * Categories - product, project, service
1303
- * Clean up verbiage
1304
- * Cleaner widget class
1305
- * Custom columns list view
1306
- * Image
1307
- * Source
1308
- * Shortcode
1309
- * Email
1310
- * Company
1311
- * URL
1312
- * Published by
1313
- * Category
1314
- * Tags
1315
- * Date
1316
- * Custom fields metabox
1317
- * Email
1318
- * Company
1319
- * URL
1320
- * Custom post-type
1321
- * Default fields - source, email, company, URL
1322
- * Editors and higher can manage all testimonials and edit testimonial publisher
1323
- * Enable categories and tags
1324
- * Enable full shortcode options in widget
1325
- * Gravatar
1326
- * HTML content allowed
1327
- * Images
1328
- * JavaScript in footer
1329
- * Localization
1330
- * Reference shortcode column
1331
- * Reorganize widget options panel
1332
- * Rotation JavaScript in footer than body
1333
- * Shortcode options validation
1334
- * WP_Query for get_testimonials()
1335
- * Widget image on own line
1336
- * Widget options
1337
- * Title
1338
- * Category filter
1339
- * Tags filter
1340
- * Require all tags
1341
- * Advanced options
1342
- * Hide image?
1343
- * Hide source?
1344
- * Hide email?
1345
- * Hide company?
1346
- * Hide URL?
1347
- * Character limit
1348
- * IDs filter
1349
- * Limit
1350
- * Maximum Height
1351
- * Minimum Height
1352
- * ORDER BY
1353
- * ORDER BY Order
1354
- * Random order
1355
- * Rotation Speed
1356
- * Move caching to ideas
1357
- * Add theme function `testimonialswidget_widget()` doc
1358
- * Update POT
1359
- * [[testimonialswidget_widget]] shortcode
1360
- * Match [[testimonialswidget_widget]] shortcode option defaults to widget
1361
- * Update screenshots
1362
- * Readd Minimum Height - need help getting around this
1363
-
1364
- ## 0.2.13
1365
- * Clean up CSS
1366
- * Remove q & cite p wrapper
1367
-
1368
- ## 0.2.12
1369
- * the_title filter fix
1370
-
1371
- ## 0.2.11
1372
- * Enable character limit for shortcode
1373
-
1374
- ## 0.2.10
1375
- * Character limit nows forces text truncation than preventing of testimonial to show
1376
- * Add option - Limit number of testimonials to pull at a time
1377
- * Sanitize widget variables
1378
- * Fix random_order issue on testimonials widget
1379
-
1380
- ## 0.2.9
1381
- * Require Editor role for managing Testimonials
1382
-
1383
- ## 0.2.8
1384
- * CSS testimonialswidget_testimonial_list fix #2
1385
-
1386
- ## 0.2.7
1387
- * CSS testimonialswidget_testimonial_list fix
1388
-
1389
- ## 0.2.6
1390
- * CSS updates for widgets and lists
1391
-
1392
- ## 0.2.5
1393
- * Add span.testimonialswidget_join for author , join text
1394
- * Add nl2br for testimonials display on a page
1395
-
1396
- ## 0.2.4
1397
- * Shortcode added - Thank you Hal Gatewood
1398
-
1399
- ## 0.2.3
1400
- * Allow testimonials to have multiple tags
1401
- * Show only quotes with all tags
1402
-
1403
- ## 0.2.2
1404
- * Show newest testimonials first in admin list by default
1405
- * Quick locallization
1406
- * Quotes Collection recommendation
1407
-
1408
- ## 2011-10-03: Version 0.2
1409
- * Multi-widget enabled
1410
- * Testimonial, author & source text are clickable automatically
1411
- * Allow 0 refresh to make widget static
1412
- * Allow pressing return when editing testimonial to save record
1413
-
1414
- ## 2011-08-12: Version 0.1
1415
- * initial release
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/CONTRIBUTING.md DELETED
@@ -1,41 +0,0 @@
1
- # CONTRIBUTE - Testimonials Widget
2
-
3
- Community made patches, localisation, bug reports and contributions are very welcome and help make Testimonials Widget the #1 testimonials plugin for WordPress.
4
-
5
- When contributing please ensure you follow the guidelines below so that we can keep on top of things.
6
-
7
- **Please Note:** GitHub is for bug reports and contributions only - if you have a support question or a request for a customisation don't post here, go to our [Support Forum](http://wordpress.org/support/plugin/testimonials-widget) instead.
8
-
9
- For localization, please refer to [How do I change Testimonials text labels?](https://aihrus.zendesk.com/entries/23691557), though bugs with strings that can't be translated are welcome here.
10
-
11
- ## Getting Started
12
-
13
- * Submit a ticket for your issue, assuming one does not already exist.
14
- * Raise it on our [Issue Tracker](https://github.com/michael-cannon/testimonials-widget/issues)
15
- * Clearly describe the issue including steps to reproduce the bug.
16
- * Make sure you fill in the earliest version that you know has the issue as well as the version of WordPress you're using.
17
-
18
- ## Making Changes
19
-
20
- * Fork the repository on GitHub
21
- * Make the changes to your forked repository
22
- * Ensure you stick to the [WordPress Coding Standards](http://codex.wordpress.org/WordPress_Coding_Standards) and have properly documented any new functions.
23
- * When committing, reference your issue (if present) and include a note about the fix.
24
- * Push the changes to your fork and submit a pull request to the 'master' branch of the Testimonials Widget repository.
25
-
26
- ## Code Documentation
27
-
28
- * Try to ensure that every Testimonials Widget function is documented well and follows the standards set by phpDoc.
29
- * An example function, by Yoast, can be found [here](https://gist.github.com/jdevalk/5574677)
30
- * Please make sure that every function is documented so that when we update our API Documentation things don't go awry!
31
- * Finally, please use tabs and not spaces. The tab indent size should be 4 for all Testimonials Widget code.
32
-
33
- At this point you're waiting on us to merge your pull request. We'll review all pull requests, and make suggestions and changes if necessary.
34
-
35
-
36
- ## Additional Resources
37
-
38
- * [Testimonials Widget API](https://github.com/michael-cannon/testimonials-widget/blob/master/API.md)
39
- * [Testimonials Widget DEPRECATED](https://github.com/michael-cannon/testimonials-widget/blob/master/DEPRECATED.md)
40
- * [General GitHub Help](http://help.github.com/)
41
- * [GitHub Pull Request](http://help.github.com/send-pull-requests/)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/DEPRECATED.md DELETED
@@ -1,11 +0,0 @@
1
- # Deprecation Notices - Testimonials Widget
2
-
3
- ## Deprecated Shortcodes
4
-
5
- * `[testimonialswidget_list]` use `[testimonials]` instead as of 2.19.0
6
- * `[testimonialswidget_widget]` use `[testimonials_slider]` instead as of 2.19.0
7
-
8
- ## Deprecated Theme Functions
9
-
10
- * `testimonialswidget_list()` use `testimonials()` instead as of 2.19.0
11
- * `testimonialswidget_widget()` use `testimonials_slider()` instead as of 2.19.0
 
 
 
 
 
 
 
 
 
 
 
trunk/EXAMPLES.md DELETED
@@ -1,51 +0,0 @@
1
- # Shortcode Examples - Testimonials Widget
2
-
3
- ## [testimonials] - Listings with paging
4
-
5
- * List of testimonials only 200 characters long with only source shown in credit box - `[testimonialswidget_list char_limit=200 hide_title=true hide_email=true hide_url=true hide_location=true hide_company=true]`
6
- * List testimonials by post title - `[testimonials order=ASC orderby=title]`
7
- * Select testimonials tagged with either "test" or "fun", in random order, but ignore those of the excluded ids - `[testimonials tags="test,fun" random=true exclude="2,22,333"]`
8
- * Show 15 testimonials, in company order - `[testimonials meta_key=testimonials-widget-company order=asc limit=15]`
9
- * Show 3 full-length testimonials, with opening and closing quote marks removed - `[testimonials char_limit=0 target=_new limit=3 disable_quotes=true]`
10
- * Show 5 full-length testimonials, with paging - `[testimonials limit=5 paging=true char_limit=0]`
11
- * Show all testimonials on one page - `[testimonials char_limit=0 limit=-1]`
12
- * Show one random testimonial - `[testimonials limit=1 no_cache=true random=true]`
13
- * Show only these 3 testimonials - `[testimonials ids="1,11,111" paging=false]`
14
- * Show testimonial list with source and urls hidden - `[testimonials hide_source=true hide_url=true]`
15
- * Show the single testimonial of ID 123 on a page - `[testimonials ids="123" paging=false]`
16
- * Testimonial list by category - `[testimonials category="category-name"]`
17
- * Testimonial list by category and hide "No testimonials found" message - `[testimonials category=product hide_not_found=true]`
18
- * Testimonial list by category ID 123 - `[testimonials category=123]`
19
- * Testimonial list by tag, showing 5 at most - `[testimonials category=product tags=widget limit=5]`
20
-
21
- ## [testimonials_archives] - A monthly archive of your site's testimonials
22
-
23
- * Testimonial's archive as dropdown with monthly count - `[testimonials_archives dropdown=true count=true]`
24
-
25
- ## [testimonials_categories] - A list or dropdown of testimonials' categories
26
-
27
- * Testimonial's categories as hierarchical with monthly count - `[testimonials_categories count=true hierarchical=true]`
28
-
29
- ## [testimonials_recent] - Your site's most recent testimonials
30
-
31
- * The 3 most recent testimonials with dates - `[testimonials_recent number=3 show_date=true]`
32
-
33
- ## [testimonials_slider] - Displays rotating testimonials or statically
34
-
35
- * Change rotation speed to 3 seconds - `[testimonialswidget_widget refresh_interval=3]`
36
- * Show "liposuction" testimonials in oldest first sorting - `[testimonials_slider category=liposculpture order=asc]`
37
- * Show random "dreamweaver" testimonials - `[testimonials_slider category="dreamweaver" random="true"]`
38
- * Show rotating testimonials, of the product category, lowest post ids first - `[testimonials_slider category=product order=asc]`
39
- * Show rotating, random testimonials having tag "sometag" - `[testimonials_slider tags=sometag random=true]`
40
-
41
- ## [testimonials_tag_cloud] - A cloud of your most used testimonials' tags
42
-
43
- * Show testimonials post tag cloud - `[testimonials_tag_cloud]`
44
-
45
- ## [testimonials_examples] - Displays examples of commonly used testimonials' shortcodes with attributes
46
-
47
- * Show testimonials' shortcodes with attributes - `[testimonials_examples]`
48
-
49
- ## [testimonials_options] - Displays summary of testimonials' settings for use with shortcodes and theme functions
50
-
51
- * Show summary of testimonials shortcode and theme function attributes - `[testimonials_options]`
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/LICENSE DELETED
@@ -1,339 +0,0 @@
1
- GNU GENERAL PUBLIC LICENSE
2
- Version 2, June 1991
3
-
4
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
5
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
6
- Everyone is permitted to copy and distribute verbatim copies
7
- of this license document, but changing it is not allowed.
8
-
9
- Preamble
10
-
11
- The licenses for most software are designed to take away your
12
- freedom to share and change it. By contrast, the GNU General Public
13
- License is intended to guarantee your freedom to share and change free
14
- software--to make sure the software is free for all its users. This
15
- General Public License applies to most of the Free Software
16
- Foundation's software and to any other program whose authors commit to
17
- using it. (Some other Free Software Foundation software is covered by
18
- the GNU Lesser General Public License instead.) You can apply it to
19
- your programs, too.
20
-
21
- When we speak of free software, we are referring to freedom, not
22
- price. Our General Public Licenses are designed to make sure that you
23
- have the freedom to distribute copies of free software (and charge for
24
- this service if you wish), that you receive source code or can get it
25
- if you want it, that you can change the software or use pieces of it
26
- in new free programs; and that you know you can do these things.
27
-
28
- To protect your rights, we need to make restrictions that forbid
29
- anyone to deny you these rights or to ask you to surrender the rights.
30
- These restrictions translate to certain responsibilities for you if you
31
- distribute copies of the software, or if you modify it.
32
-
33
- For example, if you distribute copies of such a program, whether
34
- gratis or for a fee, you must give the recipients all the rights that
35
- you have. You must make sure that they, too, receive or can get the
36
- source code. And you must show them these terms so they know their
37
- rights.
38
-
39
- We protect your rights with two steps: (1) copyright the software, and
40
- (2) offer you this license which gives you legal permission to copy,
41
- distribute and/or modify the software.
42
-
43
- Also, for each author's protection and ours, we want to make certain
44
- that everyone understands that there is no warranty for this free
45
- software. If the software is modified by someone else and passed on, we
46
- want its recipients to know that what they have is not the original, so
47
- that any problems introduced by others will not reflect on the original
48
- authors' reputations.
49
-
50
- Finally, any free program is threatened constantly by software
51
- patents. We wish to avoid the danger that redistributors of a free
52
- program will individually obtain patent licenses, in effect making the
53
- program proprietary. To prevent this, we have made it clear that any
54
- patent must be licensed for everyone's free use or not licensed at all.
55
-
56
- The precise terms and conditions for copying, distribution and
57
- modification follow.
58
-
59
- GNU GENERAL PUBLIC LICENSE
60
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
61
-
62
- 0. This License applies to any program or other work which contains
63
- a notice placed by the copyright holder saying it may be distributed
64
- under the terms of this General Public License. The "Program", below,
65
- refers to any such program or work, and a "work based on the Program"
66
- means either the Program or any derivative work under copyright law:
67
- that is to say, a work containing the Program or a portion of it,
68
- either verbatim or with modifications and/or translated into another
69
- language. (Hereinafter, translation is included without limitation in
70
- the term "modification".) Each licensee is addressed as "you".
71
-
72
- Activities other than copying, distribution and modification are not
73
- covered by this License; they are outside its scope. The act of
74
- running the Program is not restricted, and the output from the Program
75
- is covered only if its contents constitute a work based on the
76
- Program (independent of having been made by running the Program).
77
- Whether that is true depends on what the Program does.
78
-
79
- 1. You may copy and distribute verbatim copies of the Program's
80
- source code as you receive it, in any medium, provided that you
81
- conspicuously and appropriately publish on each copy an appropriate
82
- copyright notice and disclaimer of warranty; keep intact all the
83
- notices that refer to this License and to the absence of any warranty;
84
- and give any other recipients of the Program a copy of this License
85
- along with the Program.
86
-
87
- You may charge a fee for the physical act of transferring a copy, and
88
- you may at your option offer warranty protection in exchange for a fee.
89
-
90
- 2. You may modify your copy or copies of the Program or any portion
91
- of it, thus forming a work based on the Program, and copy and
92
- distribute such modifications or work under the terms of Section 1
93
- above, provided that you also meet all of these conditions:
94
-
95
- a) You must cause the modified files to carry prominent notices
96
- stating that you changed the files and the date of any change.
97
-
98
- b) You must cause any work that you distribute or publish, that in
99
- whole or in part contains or is derived from the Program or any
100
- part thereof, to be licensed as a whole at no charge to all third
101
- parties under the terms of this License.
102
-
103
- c) If the modified program normally reads commands interactively
104
- when run, you must cause it, when started running for such
105
- interactive use in the most ordinary way, to print or display an
106
- announcement including an appropriate copyright notice and a
107
- notice that there is no warranty (or else, saying that you provide
108
- a warranty) and that users may redistribute the program under
109
- these conditions, and telling the user how to view a copy of this
110
- License. (Exception: if the Program itself is interactive but
111
- does not normally print such an announcement, your work based on
112
- the Program is not required to print an announcement.)
113
-
114
- These requirements apply to the modified work as a whole. If
115
- identifiable sections of that work are not derived from the Program,
116
- and can be reasonably considered independent and separate works in
117
- themselves, then this License, and its terms, do not apply to those
118
- sections when you distribute them as separate works. But when you
119
- distribute the same sections as part of a whole which is a work based
120
- on the Program, the distribution of the whole must be on the terms of
121
- this License, whose permissions for other licensees extend to the
122
- entire whole, and thus to each and every part regardless of who wrote it.
123
-
124
- Thus, it is not the intent of this section to claim rights or contest
125
- your rights to work written entirely by you; rather, the intent is to
126
- exercise the right to control the distribution of derivative or
127
- collective works based on the Program.
128
-
129
- In addition, mere aggregation of another work not based on the Program
130
- with the Program (or with a work based on the Program) on a volume of
131
- a storage or distribution medium does not bring the other work under
132
- the scope of this License.
133
-
134
- 3. You may copy and distribute the Program (or a work based on it,
135
- under Section 2) in object code or executable form under the terms of
136
- Sections 1 and 2 above provided that you also do one of the following:
137
-
138
- a) Accompany it with the complete corresponding machine-readable
139
- source code, which must be distributed under the terms of Sections
140
- 1 and 2 above on a medium customarily used for software interchange; or,
141
-
142
- b) Accompany it with a written offer, valid for at least three
143
- years, to give any third party, for a charge no more than your
144
- cost of physically performing source distribution, a complete
145
- machine-readable copy of the corresponding source code, to be
146
- distributed under the terms of Sections 1 and 2 above on a medium
147
- customarily used for software interchange; or,
148
-
149
- c) Accompany it with the information you received as to the offer
150
- to distribute corresponding source code. (This alternative is
151
- allowed only for noncommercial distribution and only if you
152
- received the program in object code or executable form with such
153
- an offer, in accord with Subsection b above.)
154
-
155
- The source code for a work means the preferred form of the work for
156
- making modifications to it. For an executable work, complete source
157
- code means all the source code for all modules it contains, plus any
158
- associated interface definition files, plus the scripts used to
159
- control compilation and installation of the executable. However, as a
160
- special exception, the source code distributed need not include
161
- anything that is normally distributed (in either source or binary
162
- form) with the major components (compiler, kernel, and so on) of the
163
- operating system on which the executable runs, unless that component
164
- itself accompanies the executable.
165
-
166
- If distribution of executable or object code is made by offering
167
- access to copy from a designated place, then offering equivalent
168
- access to copy the source code from the same place counts as
169
- distribution of the source code, even though third parties are not
170
- compelled to copy the source along with the object code.
171
-
172
- 4. You may not copy, modify, sublicense, or distribute the Program
173
- except as expressly provided under this License. Any attempt
174
- otherwise to copy, modify, sublicense or distribute the Program is
175
- void, and will automatically terminate your rights under this License.
176
- However, parties who have received copies, or rights, from you under
177
- this License will not have their licenses terminated so long as such
178
- parties remain in full compliance.
179
-
180
- 5. You are not required to accept this License, since you have not
181
- signed it. However, nothing else grants you permission to modify or
182
- distribute the Program or its derivative works. These actions are
183
- prohibited by law if you do not accept this License. Therefore, by
184
- modifying or distributing the Program (or any work based on the
185
- Program), you indicate your acceptance of this License to do so, and
186
- all its terms and conditions for copying, distributing or modifying
187
- the Program or works based on it.
188
-
189
- 6. Each time you redistribute the Program (or any work based on the
190
- Program), the recipient automatically receives a license from the
191
- original licensor to copy, distribute or modify the Program subject to
192
- these terms and conditions. You may not impose any further
193
- restrictions on the recipients' exercise of the rights granted herein.
194
- You are not responsible for enforcing compliance by third parties to
195
- this License.
196
-
197
- 7. If, as a consequence of a court judgment or allegation of patent
198
- infringement or for any other reason (not limited to patent issues),
199
- conditions are imposed on you (whether by court order, agreement or
200
- otherwise) that contradict the conditions of this License, they do not
201
- excuse you from the conditions of this License. If you cannot
202
- distribute so as to satisfy simultaneously your obligations under this
203
- License and any other pertinent obligations, then as a consequence you
204
- may not distribute the Program at all. For example, if a patent
205
- license would not permit royalty-free redistribution of the Program by
206
- all those who receive copies directly or indirectly through you, then
207
- the only way you could satisfy both it and this License would be to
208
- refrain entirely from distribution of the Program.
209
-
210
- If any portion of this section is held invalid or unenforceable under
211
- any particular circumstance, the balance of the section is intended to
212
- apply and the section as a whole is intended to apply in other
213
- circumstances.
214
-
215
- It is not the purpose of this section to induce you to infringe any
216
- patents or other property right claims or to contest validity of any
217
- such claims; this section has the sole purpose of protecting the
218
- integrity of the free software distribution system, which is
219
- implemented by public license practices. Many people have made
220
- generous contributions to the wide range of software distributed
221
- through that system in reliance on consistent application of that
222
- system; it is up to the author/donor to decide if he or she is willing
223
- to distribute software through any other system and a licensee cannot
224
- impose that choice.
225
-
226
- This section is intended to make thoroughly clear what is believed to
227
- be a consequence of the rest of this License.
228
-
229
- 8. If the distribution and/or use of the Program is restricted in
230
- certain countries either by patents or by copyrighted interfaces, the
231
- original copyright holder who places the Program under this License
232
- may add an explicit geographical distribution limitation excluding
233
- those countries, so that distribution is permitted only in or among
234
- countries not thus excluded. In such case, this License incorporates
235
- the limitation as if written in the body of this License.
236
-
237
- 9. The Free Software Foundation may publish revised and/or new versions
238
- of the General Public License from time to time. Such new versions will
239
- be similar in spirit to the present version, but may differ in detail to
240
- address new problems or concerns.
241
-
242
- Each version is given a distinguishing version number. If the Program
243
- specifies a version number of this License which applies to it and "any
244
- later version", you have the option of following the terms and conditions
245
- either of that version or of any later version published by the Free
246
- Software Foundation. If the Program does not specify a version number of
247
- this License, you may choose any version ever published by the Free Software
248
- Foundation.
249
-
250
- 10. If you wish to incorporate parts of the Program into other free
251
- programs whose distribution conditions are different, write to the author
252
- to ask for permission. For software which is copyrighted by the Free
253
- Software Foundation, write to the Free Software Foundation; we sometimes
254
- make exceptions for this. Our decision will be guided by the two goals
255
- of preserving the free status of all derivatives of our free software and
256
- of promoting the sharing and reuse of software generally.
257
-
258
- NO WARRANTY
259
-
260
- 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
261
- FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
262
- OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
263
- PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
264
- OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
265
- MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
266
- TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
267
- PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
268
- REPAIR OR CORRECTION.
269
-
270
- 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
271
- WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
272
- REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
273
- INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
274
- OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
275
- TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
276
- YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
277
- PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
278
- POSSIBILITY OF SUCH DAMAGES.
279
-
280
- END OF TERMS AND CONDITIONS
281
-
282
- How to Apply These Terms to Your New Programs
283
-
284
- If you develop a new program, and you want it to be of the greatest
285
- possible use to the public, the best way to achieve this is to make it
286
- free software which everyone can redistribute and change under these terms.
287
-
288
- To do so, attach the following notices to the program. It is safest
289
- to attach them to the start of each source file to most effectively
290
- convey the exclusion of warranty; and each file should have at least
291
- the "copyright" line and a pointer to where the full notice is found.
292
-
293
- <one line to give the program's name and a brief idea of what it does.>
294
- Copyright (C) <year> <name of author>
295
-
296
- This program is free software; you can redistribute it and/or modify
297
- it under the terms of the GNU General Public License as published by
298
- the Free Software Foundation; either version 2 of the License, or
299
- (at your option) any later version.
300
-
301
- This program is distributed in the hope that it will be useful,
302
- but WITHOUT ANY WARRANTY; without even the implied warranty of
303
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
304
- GNU General Public License for more details.
305
-
306
- You should have received a copy of the GNU General Public License along
307
- with this program; if not, write to the Free Software Foundation, Inc.,
308
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
309
-
310
- Also add information on how to contact you by electronic and paper mail.
311
-
312
- If the program is interactive, make it output a short notice like this
313
- when it starts in an interactive mode:
314
-
315
- Gnomovision version 69, Copyright (C) year name of author
316
- Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
317
- This is free software, and you are welcome to redistribute it
318
- under certain conditions; type `show c' for details.
319
-
320
- The hypothetical commands `show w' and `show c' should show the appropriate
321
- parts of the General Public License. Of course, the commands you use may
322
- be called something other than `show w' and `show c'; they could even be
323
- mouse-clicks or menu items--whatever suits your program.
324
-
325
- You should also get your employer (if you work as a programmer) or your
326
- school, if any, to sign a "copyright disclaimer" for the program, if
327
- necessary. Here is a sample; alter the names:
328
-
329
- Yoyodyne, Inc., hereby disclaims all copyright interest in the program
330
- `Gnomovision' (which makes passes at compilers) written by James Hacker.
331
-
332
- <signature of Ty Coon>, 1 April 1989
333
- Ty Coon, President of Vice
334
-
335
- This General Public License does not permit incorporating your program into
336
- proprietary programs. If your program is a subroutine library, you may
337
- consider it more useful to permit linking proprietary applications with the
338
- library. If this is what you want to do, use the GNU Lesser General
339
- Public License instead of this License.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/README.md DELETED
@@ -1,42 +0,0 @@
1
- # Developer Readme - Testimonials Widget
2
-
3
- [![Codeship status](https://www.codeship.io/projects/b5524630-43f6-0131-3b4d-76a8e32a74d4/status)](https://www.codeship.io/projects/10739)
4
- [![ProjectStatus](http://stillmaintained.com/michael-cannon/testimonials-widget.png)](http://stillmaintained.com/michael-cannon/testimonials-widget)
5
-
6
- ## Welcome to the Testimonials Widget Github repository
7
-
8
- Testimonials Widget plugin allows you to display random or selected portfolio, quotes, reviews, showcases, or text with images on your WordPress blog.
9
-
10
- While the documentation for the [Testimonials Widget plugin](http://wordpress.org/plugins/testimonials-widget/) can be found at WordPress.org Plugin Directory, here you can browse the source of the project, find and discuss open issues and, even [contribute yourself](https://github.com/michael-cannon/testimonials-widget/blob/master/CONTRIBUTING.md).
11
-
12
- ## Installation
13
-
14
- Here's a [guide on how to install Testimonials Widget in your WordPress site](http://wordpress.org/plugins/testimonials-widget/installation/). If you want to run the Git version though, you have two options:
15
-
16
- * You can clone the GitHub repository: https://github.com/michael-cannon/testimonials-widget.git
17
- * Download it directly as a ZIP file: https://github.com/michael-cannon/testimonials-widget/archive/master.zip
18
-
19
- This will download the latest development version of Testimonials Widget. While this version is usually stable, it is not recommended for use in a production environment.
20
-
21
- ## Bugs
22
-
23
- If you find an issue, [let us know here](https://github.com/michael-cannon/testimonials-widget/issues/new)!
24
-
25
- ## Support
26
-
27
- This is a developer's portal for Testimonials Widget and should not be used for support. Please visit the [Testimonials Widget Knowledge Base](https://aihrus.zendesk.com/categories/20104507) for frequently asked questions, offering ideas, or getting support.
28
-
29
- ## Contributions
30
-
31
- Anyone is welcome to contribute to Testimonials Widget. Please [read the guidelines](https://github.com/michael-cannon/testimonials-widget/blob/master/CONTRIBUTING.md) for contributing to this repository.
32
-
33
- There are various ways you can contribute:
34
-
35
- * [Raise an issue](https://github.com/michael-cannon/testimonials-widget/issues) on GitHub.
36
- * Fork Testimonials Widget and send a Pull Request with your bug fixes and/or new features.
37
- * [Translate Testimonials Widget into different languages](https://aihrus.zendesk.com/entries/23691557).
38
- * Provide feedback and [suggestions on enhancements](https://github.com/michael-cannon/testimonials-widget/issues?direction=desc&labels=Enhancement&page=1&sort=created&state=open).
39
-
40
- ## Thank You
41
-
42
- * Thank you [WordPress SEO by Yoast](https://github.com/jdevalk/wordpress-seo/blob/master/README.md) for this README.md and like inspirations.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/UPGRADING.md DELETED
@@ -1,159 +0,0 @@
1
- # Upgrade Notices - Testimonials Widget
2
-
3
- ## 3.0.0
4
-
5
- This is a major overhaul *without* backwards compliance of over 80 changes. Please read the [Testimonials Widget 3.0 and Testimonials Widget Premium 2.0 Upgrade Notice](https://aihrus.zendesk.com/entries/52514055) for more help.
6
-
7
- If you use custom CSS, actions, or filters to modify Testimonials Widget and Testimonials Widget Premium actions or output, this upgrade will not be compatible with those modifications until corrections are made.
8
-
9
- The changes and helpers below are intended to help you update your customizations quickly. If further help is required, please request it via commenting upon the [Testimonials Widget 3.0 and Testimonials Widget Premium 2.0 Upgrade Notice](https://aihrus.zendesk.com/entries/52514055).
10
-
11
- ### Changes
12
-
13
- * As [Internet Explorer 7.0 usage](http://www.w3schools.com/browsers/browsers_explorer.asp) is under 0.5% of Internet traffic, support for it is discontinued. Option `include_ie7_css` is removed.
14
- * Deprecated functions and API hooks of Testimonials Widget 2.19.0 and Testimonials Widget Premium 1.20.0 are removed. Read DEPRECATED.md for details.
15
- * Replace `testimonials_widget_premium_` of actions, filters, and functions with `twp_`
16
- * Replace `testimonials_widget_` of actions, filters, and functions with `tw_`
17
- * Replaced `tba_` of actions, filters, and functions with `tw_`
18
- * Replaced `tw_shortcodes` with `tw_examples`
19
- * Replaced `tw_widget_options` with `tw_slider_widget_options`
20
- * Testimonials Widget pre-2.0.0 automatic migration has been removed. Install and activate Testimonials Widget 2.19.0 before installing the latest Testimonials Widget.
21
- * Testimonials Widget pre-2.15.0 JavaScript slider code has been replaced with [bxSlider](http://bxslider.com/) and is now removed. Options `use_bxslider`, `disable_animation`, `fade_out_speed`, `fade_in_speed`, `height`, `min_height`, and `max_height` are removed.
22
-
23
- ### Helpers
24
-
25
- *The ordering of the helper code below is important to prevent corruption.*
26
-
27
- * `find . -type f \( -name "*.php" -o -name "*.txt" -o -name "*.md" \) -exec perl -pi -e "s#testimonials_widget_premium_#twp_#g" {} \;`
28
- * `find . -type f \( -name "*.php" -o -name "*.txt" -o -name "*.md" \) -exec perl -pi -e "s#testimonials_widget_#tw_#g" {} \;`
29
- * `find . -type f \( -name "*.php" -o -name "*.txt" -o -name "*.md" \) -exec perl -pi -e "s#tba_#tw_#g" {} \;`
30
- * `find . -type f \( -name "*.php" -o -name "*.txt" -o -name "*.md" \) -exec perl -pi -e "s#tw_widget_options#tw_slider_widget_options#g" {} \;`
31
- * `find . -type f \( -name "*.php" -o -name "*.txt" -o -name "*.md" \) -exec perl -pi -e "s#tw_shortcodes#tw_examples#g" {} \;`
32
-
33
- ## 2.19.9
34
-
35
- * Added `margin-bottom: 2em;` to `.testimonials-widget-testimonial.list`
36
-
37
- ## 2.19.8
38
-
39
- * Cite fields for company and location are swapped
40
-
41
- ## 2.19.6
42
-
43
- * Enable Video also means enable video embedding and display
44
-
45
- ## 2.19.0
46
-
47
- * CSS class `.title` is now `.job-title`. Thank you Mark
48
- * Please resave your WordPress Admin > Testimonials > Settings so that missing aoptions are included again.
49
- * Shortcode and theme function `testimonialswidget_list` being deprecated by `testimonials`
50
- * Shortcode and theme function `testimonialswidget_widget` being deprecated by `testimonials_slider`
51
-
52
- ## 2.18.3
53
-
54
- * CSS class `.hide` renamed `.display-none`
55
- * This is the last version supporting pre-bxSlider options
56
-
57
- ## 2.18.2
58
-
59
- * CSS class `.display-none` renamed `.hide`
60
-
61
- ## 2.18.1
62
-
63
- * CSS is back to being always loaded in the header
64
- * Removed "Use bxSlider?" and "Include IE7 CSS" from widget options
65
-
66
- ## 2.18.0
67
-
68
- * `remove_hentry` is now true by default
69
-
70
- ## 2.16.0
71
-
72
- * [Requires PHP 5.3+](https://aihrus.zendesk.com/entries/30678006)
73
-
74
- ## 2.15.0
75
-
76
- * If upgrading, bxSlider will not be enabled by default. You must enable it in your widget and global settings. CSS customizations must be reviewed to have the `.active` and `.display-none` classes removed. The main `.testimonials-widget-testimonial` class also need the `display: none;` and `clear: left;` removed.
77
-
78
- ## 2.14.0
79
-
80
- * **60 modifications** See [Changelog](https://github.com/michael-cannon/testimonials-widget/blob/master/CHANGELOG.md)
81
- * CSS wp_register_style and wp_enqueue_style slug changed from 'testimonials-widget' to 'Testimonials_Widget'
82
- * Gravatar image size now based upon Thumbnail size in Media Settings
83
- * Scripts `ksort` removed. Use `array_unshift` in your `tw_testimonials_js` filters instead.
84
- * Testimonials > Settings, General tab, option Enable Review Schema? is enabled by default.
85
-
86
- ## 2.13.6
87
-
88
- * IE 7 CSS moved to separate file. Include via Testimonials > Settings if needed
89
-
90
- ## 2.12.0
91
-
92
- * CSS and JavaScript renaming
93
- * `bottom_text` renamed to `bottom-text`
94
- * `close_quote` renamed to `close-quote`
95
- * `display_none` renamed to `display-none`
96
- * `join_location` renamed to `join-location`
97
- * `join_title` renamed to `join-title`
98
- * `open_quote` renamed to `open-quote`
99
- * `testimonialswidget_testimonial` renamed to `testimonials-widget-testimonial`
100
- * `testimonialswidget_testimonials` renamed to `testimonials-widget-testimonials`
101
-
102
- ## 2.11.3
103
-
104
- * Correct filter name `tw_next_posts_link` to `tw_next_posts_link_text`
105
-
106
- ## 2.11.0
107
-
108
- * CSS class names are simplified. For the most part, other than `testimonialswidget_testimonial` remove `testimonialswidget_` from the CSS class name in your CSS customizations.
109
- * Ex: `.testimonialswidget_join` becomes `.join`
110
- * Ex: `.testimonialswidget_author` becomes `.author`
111
- * Testimonials are now formatted using `blockquote` than `q` for HTML5 compliance. If you need `q` tag formatting, enable it at WP Admin > Testimonials > Settings, Compatibility & Reset tab
112
- * `cite` is now `div.credit`
113
-
114
- ## 2.8.0
115
-
116
- * Deprecated
117
- * `hide_author` now `hide_source`
118
- * Removed filters `tw_options_update`, `tw_options_form`
119
- * Use `tw_validate_settings` and `tw_settings` instead
120
- * Renamed variable and related class `widget_text` to `bottom_text`
121
-
122
- ## 2.7.3
123
-
124
- * Quotes are no longer handled via `q`, `p:before`, or `p:after` CSS. It's handled via `.testimonialswidget_testimonial .testimonialswidget_open_quote:before` and `.testimonialswidget_testimonial .testimonialswidget_close_quote:after`
125
- * This change was made to keep consistency in how quotes were managed and to reduce the number of exception cases. In the end, this is simpler.
126
-
127
- ## 2.7.0
128
-
129
- * Quotes with `keep_whitespace=true` aren't applied via CSS `.testimonialswidget_testimonial q` tag anymore, but `.testimonialswidget_testimonial q p:first-child:before` and `.testimonialswidget_testimonial q p:last-child:after`
130
- * Widget testimonial `p` tags are no longer CSS `display: inline`, `display: block` as expected
131
-
132
- ## 2.4.1
133
-
134
- * Paging is on by default, except for widgets
135
-
136
- ## 2.0.0
137
-
138
- * CSS
139
- * Class `testimonialswidget_company` replaces `testimonialswidget_source`
140
- * Class `testimonialswidget_source` replaces `testimonialswidget_author`
141
- * The tighten widget display up, p tags within q are displayed inline.
142
- * JavaScript
143
- * The JavaScript for rotating testimonials is moved to the footer. As such, your theme requires `wp_footer()` in the footer.
144
- * Shortcode options
145
- * `hide_source` replaced by `hide_url`
146
- * `hide_author` replaced by `hide_source`
147
- * Testimonials
148
- * Migration from the old custom table to new custom post type is automatically done. Import might take a few moments to complete.
149
- * Company, URL and email details are attempted to be identified and placed properly based upon the original author and source fields. The company is "guessed" from the `author` field when there's a ", " or " of " context. If the `source` is an email, it's saved as such. Otherwise, it's assumed to be a URL.
150
- * Public testimonials are saved as Published. Non-public testimonials are marked as Private.
151
- * Widget options
152
- * "Show author" and "Show source" options are replaced by "Hide source" and "Hide URL" respectively. There's no backwards compatibility for these changes.
153
- * Default `min-height` is now 250px than 150px.
154
-
155
- ## Version 2.0 Background
156
-
157
- Version 2.0.0 of Testimonials is a complete rewrite based upon a composite of ideas from user feedback and grokking the plugins [Imperfect Quotes](http://www.swarmstrategies.com/imperfect-quotes/), [IvyCat Ajax Testimonials](http://wordpress.org/extend/plugins/ivycat-ajax-testimonials/), [Quotes Collection](http://srinig.com/wordpress/plugins/quotes-collection/), and [TB Testimonials](http://travisballard.com/wordpress/tb-testimonials/). Thank you to these plugin developers for their efforts that have helped inspire this rewrite.
158
-
159
- Prior to version 2.0.0, this plugin was a fork of [Quotes Collection](http://srinig.com/wordpress/plugins/quotes-collection/) by [Srini G](http://wordpress.org/support/profile/SriniG) with additional contributions from [j0hnsmith](http://wordpress.org/support/profile/j0hnsmith), [ChrisCree](http://wordpress.org/support/profile/ChrisCree) and [comprock](http://wordpress.org/support/profile/comprock).
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/assets/css/images/bx_loader.gif DELETED
Binary file
trunk/assets/css/images/controls.png DELETED
Binary file
trunk/assets/css/jquery.bxslider.css DELETED
@@ -1,204 +0,0 @@
1
- /**
2
- * BxSlider v4.1.2 - Fully loaded, responsive content slider
3
- * http://bxslider.com
4
- *
5
- * Written by: Steven Wanderski, 2014
6
- * http://stevenwanderski.com
7
- * (while drinking Belgian ales and listening to jazz)
8
- *
9
- * CEO and founder of bxCreative, LTD
10
- * http://bxcreative.com
11
- */
12
-
13
-
14
- /** RESET AND LAYOUT
15
- ===================================*/
16
-
17
- .bx-wrapper {
18
- position: relative;
19
- margin: 0 auto 60px;
20
- padding: 0;
21
- *zoom: 1;
22
- }
23
-
24
- .bx-wrapper img {
25
- max-width: 100%;
26
- display: block;
27
- }
28
-
29
- /** THEME
30
- ===================================*/
31
-
32
- .bx-wrapper .bx-viewport {
33
- -moz-box-shadow: 0 0 5px #ccc;
34
- -webkit-box-shadow: 0 0 5px #ccc;
35
- box-shadow: 0 0 5px #ccc;
36
- border: 5px solid #fff;
37
- left: -5px;
38
- background: #fff;
39
-
40
- /*fix other elements on the page moving (on Chrome)*/
41
- -webkit-transform: translatez(0);
42
- -moz-transform: translatez(0);
43
- -ms-transform: translatez(0);
44
- -o-transform: translatez(0);
45
- transform: translatez(0);
46
- }
47
-
48
- .bx-wrapper .bx-pager,
49
- .bx-wrapper .bx-controls-auto {
50
- position: absolute;
51
- bottom: -30px;
52
- width: 100%;
53
- }
54
-
55
- /* LOADER */
56
-
57
- .bx-wrapper .bx-loading {
58
- min-height: 50px;
59
- background: url(images/bx_loader.gif) center center no-repeat #fff;
60
- height: 100%;
61
- width: 100%;
62
- position: absolute;
63
- top: 0;
64
- left: 0;
65
- z-index: 2000;
66
- }
67
-
68
- /* PAGER */
69
-
70
- .bx-wrapper .bx-pager {
71
- text-align: center;
72
- font-size: .85em;
73
- font-family: Arial;
74
- font-weight: bold;
75
- color: #666;
76
- padding-top: 20px;
77
- }
78
-
79
- .bx-wrapper .bx-pager .bx-pager-item,
80
- .bx-wrapper .bx-controls-auto .bx-controls-auto-item {
81
- display: inline-block;
82
- *zoom: 1;
83
- *display: inline;
84
- }
85
-
86
- .bx-wrapper .bx-pager.bx-default-pager a {
87
- background: #666;
88
- text-indent: -9999px;
89
- display: block;
90
- width: 10px;
91
- height: 10px;
92
- margin: 0 5px;
93
- outline: 0;
94
- -moz-border-radius: 5px;
95
- -webkit-border-radius: 5px;
96
- border-radius: 5px;
97
- }
98
-
99
- .bx-wrapper .bx-pager.bx-default-pager a:hover,
100
- .bx-wrapper .bx-pager.bx-default-pager a.active {
101
- background: #000;
102
- }
103
-
104
- /* DIRECTION CONTROLS (NEXT / PREV) */
105
-
106
- .bx-wrapper .bx-prev {
107
- left: 10px;
108
- background: url(images/controls.png) no-repeat 0 -32px;
109
- }
110
-
111
- .bx-wrapper .bx-next {
112
- right: 10px;
113
- background: url(images/controls.png) no-repeat -43px -32px;
114
- }
115
-
116
- .bx-wrapper .bx-prev:hover {
117
- background-position: 0 0;
118
- }
119
-
120
- .bx-wrapper .bx-next:hover {
121
- background-position: -43px 0;
122
- }
123
-
124
- .bx-wrapper .bx-controls-direction a {
125
- position: absolute;
126
- top: 50%;
127
- margin-top: -16px;
128
- outline: 0;
129
- width: 32px;
130
- height: 32px;
131
- text-indent: -9999px;
132
- z-index: 9999;
133
- }
134
-
135
- .bx-wrapper .bx-controls-direction a.disabled {
136
- display: none;
137
- }
138
-
139
- /* AUTO CONTROLS (START / STOP) */
140
-
141
- .bx-wrapper .bx-controls-auto {
142
- text-align: center;
143
- }
144
-
145
- .bx-wrapper .bx-controls-auto .bx-start {
146
- display: block;
147
- text-indent: -9999px;
148
- width: 10px;
149
- height: 11px;
150
- outline: 0;
151
- background: url(images/controls.png) -86px -11px no-repeat;
152
- margin: 0 3px;
153
- }
154
-
155
- .bx-wrapper .bx-controls-auto .bx-start:hover,
156
- .bx-wrapper .bx-controls-auto .bx-start.active {
157
- background-position: -86px 0;
158
- }
159
-
160
- .bx-wrapper .bx-controls-auto .bx-stop {
161
- display: block;
162
- text-indent: -9999px;
163
- width: 9px;
164
- height: 11px;
165
- outline: 0;
166
- background: url(images/controls.png) -86px -44px no-repeat;
167
- margin: 0 3px;
168
- }
169
-
170
- .bx-wrapper .bx-controls-auto .bx-stop:hover,
171
- .bx-wrapper .bx-controls-auto .bx-stop.active {
172
- background-position: -86px -33px;
173
- }
174
-
175
- /* PAGER WITH AUTO-CONTROLS HYBRID LAYOUT */
176
-
177
- .bx-wrapper .bx-controls.bx-has-controls-auto.bx-has-pager .bx-pager {
178
- text-align: left;
179
- width: 80%;
180
- }
181
-
182
- .bx-wrapper .bx-controls.bx-has-controls-auto.bx-has-pager .bx-controls-auto {
183
- right: 0;
184
- width: 35px;
185
- }
186
-
187
- /* IMAGE CAPTIONS */
188
-
189
- .bx-wrapper .bx-caption {
190
- position: absolute;
191
- bottom: 0;
192
- left: 0;
193
- background: #666\9;
194
- background: rgba(80, 80, 80, 0.75);
195
- width: 100%;
196
- }
197
-
198
- .bx-wrapper .bx-caption span {
199
- color: #fff;
200
- font-family: Arial;
201
- display: block;
202
- font-size: .85em;
203
- padding: 10px;
204
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/assets/css/testimonials-widget-2.14.0.css DELETED
@@ -1,120 +0,0 @@
1
- .testimonials-widget-testimonials {
2
- /* testimonials wrapper */
3
- }
4
-
5
- .testimonials-widget-testimonial {
6
- clear: left;
7
- display: none;
8
- margin: 0 0 1.4em;
9
- }
10
-
11
- .testimonials-widget-testimonials .active {
12
- /* active testimonials */
13
- display: block;
14
- }
15
-
16
- .testimonials-widget-testimonials .display-none {
17
- /* staged testimonials */
18
- display: none;
19
- }
20
-
21
- .testimonials-widget-testimonials .paging {
22
- clear: both;
23
- font-weight: 700;
24
- height: 1.4em;
25
- }
26
-
27
- .testimonials-widget-testimonials .paging.prepend {
28
- margin-bottom: 1em;
29
- }
30
-
31
- .testimonials-widget-testimonials .paging.append {
32
- margin-top: 1em;
33
- }
34
-
35
- .testimonials-widget-testimonials .alignleft {
36
- float: left;
37
- }
38
-
39
- .testimonials-widget-testimonials .alignright {
40
- float: right;
41
- }
42
-
43
- .testimonials-widget-testimonial.list,
44
- .testimonials-widget-testimonial.single {
45
- display: block;
46
- }
47
-
48
- .testimonials-widget-testimonial .image {
49
- float: left;
50
- margin-bottom: .4em;
51
- margin-right: .2em;
52
- }
53
-
54
- .widget .testimonials-widget-testimonial .image {
55
- display: block;
56
- float: none;
57
- }
58
-
59
- .testimonials-widget-testimonial q,
60
- .testimonials-widget-testimonial blockquote {
61
- /* the testimonial itself */
62
- quotes: none;
63
- }
64
-
65
- .testimonials-widget-testimonial .open-quote:before {
66
- content: '\201C';
67
- }
68
-
69
- .testimonials-widget-testimonial .close-quote:after {
70
- content: '\201D';
71
- }
72
-
73
- .testimonials-widget-testimonial cite,
74
- .testimonials-widget-testimonial div.credit {
75
- /* outer wrapper for source & company */
76
- display: block; /* To display source and company on a new line */
77
- margin-top: .2em;
78
- text-align: right;
79
- }
80
-
81
- .widget .testimonials-widget-testimonial cite,
82
- .widget .testimonials-widget-testimonial div.credit {
83
- margin-top: .8em;
84
- }
85
-
86
- .widget .testimonials-widget-testimonial .whitespace cite,
87
- .widget .whitespace cite,
88
- .widget .testimonials-widget-testimonial .whitespace div.credit,
89
- .widget .whitespace div.credit {
90
- margin-top: .2em;
91
- }
92
-
93
- .testimonials-widget-testimonial cite:before,
94
- .testimonials-widget-testimonial div.credit:before {
95
- content: "– "
96
- }
97
-
98
- .testimonials-widget-testimonial .join-title:before,
99
- .testimonials-widget-testimonial .join-location:before,
100
- .testimonials-widget-testimonial .join:before {
101
- /* join text */
102
- content: ", "
103
- }
104
-
105
- .testimonials-widget-testimonial .author,
106
- .testimonials-widget-testimonial .email,
107
- .testimonials-widget-testimonial .job-title,
108
- .testimonials-widget-testimonial .location,
109
- .testimonials-widget-testimonial .company,
110
- .testimonials-widget-testimonial .url {
111
- /* testimonial title, company and url informaiton */
112
- }
113
-
114
- .testimonials-widget-testimonial .extra {
115
- margin-top: .8em;
116
- }
117
-
118
- .testimonials-widget-testimonial .bottom_text {
119
- margin-top: 1.4em;
120
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/assets/css/testimonials-widget-ie7.css DELETED
@@ -1,15 +0,0 @@
1
- /*csslint star-property-hack: false*/
2
- .testimonials-widget-testimonial .open-quote {
3
- *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '“' );
4
- }
5
-
6
- .testimonials-widget-testimonial .close-quote {
7
- *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '”' );
8
- }
9
-
10
- .testimonials-widget-testimonial .join-title,
11
- .testimonials-widget-testimonial .join-location,
12
- .testimonials-widget-testimonial .join {
13
- /* section between source and company information */
14
- *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ', ' );
15
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/assets/css/testimonials-widget.css DELETED
@@ -1,128 +0,0 @@
1
- .testimonials-widget-testimonials {
2
- }
3
-
4
- .testimonials-widget-testimonial {
5
- }
6
-
7
- .testimonials-widget-testimonials .active {
8
- /* active testimonials */
9
- display: block;
10
- }
11
-
12
- .testimonials-widget-testimonials .display-none {
13
- /* staged testimonials */
14
- display: none;
15
- }
16
-
17
- .testimonials-widget-testimonials .paging {
18
- clear: both;
19
- font-weight: 700;
20
- height: 1.4em;
21
- }
22
-
23
- .testimonials-widget-testimonials .paging.prepend {
24
- margin-bottom: 1em;
25
- }
26
-
27
- .testimonials-widget-testimonials .paging.append {
28
- margin-top: 1em;
29
- }
30
-
31
- .testimonials-widget-testimonials .alignleft {
32
- float: left;
33
- }
34
-
35
- .testimonials-widget-testimonials .alignright {
36
- float: right;
37
- }
38
-
39
- .testimonials-widget-testimonial.list {
40
- clear: left;
41
- margin-bottom: 2em;
42
- }
43
-
44
- .testimonials-widget-testimonial.single {
45
- clear: left;
46
- }
47
-
48
- .testimonials-widget-testimonial .image {
49
- float: left;
50
- margin-bottom: .4em;
51
- margin-right: .2em;
52
- }
53
-
54
- .widget .testimonials-widget-testimonial .image {
55
- display: block;
56
- float: none;
57
- }
58
-
59
- .testimonials-widget-testimonial q,
60
- .testimonials-widget-testimonial blockquote {
61
- /* the testimonial itself */
62
- quotes: none;
63
- }
64
-
65
- .testimonials-widget-testimonial .open-quote:before {
66
- content: '\201C';
67
- }
68
-
69
- .testimonials-widget-testimonial .close-quote:after {
70
- content: '\201D';
71
- }
72
-
73
- .testimonials-widget-testimonial cite,
74
- .testimonials-widget-testimonial div.credit {
75
- /* outer wrapper for source & company */
76
- display: block; /* To display source and company on a new line */
77
- margin-top: .2em;
78
- text-align: right;
79
- }
80
-
81
- .widget .testimonials-widget-testimonial cite,
82
- .widget .testimonials-widget-testimonial div.credit {
83
- margin-top: .8em;
84
- }
85
-
86
- .widget .testimonials-widget-testimonial .whitespace cite,
87
- .widget .whitespace cite,
88
- .widget .testimonials-widget-testimonial .whitespace div.credit,
89
- .widget .whitespace div.credit {
90
- margin-top: .2em;
91
- }
92
-
93
- .testimonials-widget-testimonial cite:before,
94
- .testimonials-widget-testimonial div.credit:before {
95
- content: "– "
96
- }
97
-
98
- .testimonials-widget-testimonial .join-title:before,
99
- .testimonials-widget-testimonial .join-location:before,
100
- .testimonials-widget-testimonial .join:before {
101
- /* join text */
102
- content: ", "
103
- }
104
-
105
- .testimonials-widget-testimonial .author,
106
- .testimonials-widget-testimonial .email,
107
- .testimonials-widget-testimonial .job-title,
108
- .testimonials-widget-testimonial .location,
109
- .testimonials-widget-testimonial .company,
110
- .testimonials-widget-testimonial .url {
111
- /* testimonial title, company and url informaiton */
112
- }
113
-
114
- .testimonials-widget-testimonial .extra {
115
- margin-top: .8em;
116
- }
117
-
118
- .testimonials-widget-testimonial .bottom_text {
119
- margin-top: 1.4em;
120
- }
121
-
122
- .bx-wrapper .bx-viewport {
123
- -moz-box-shadow: none;
124
- -webkit-box-shadow: none;
125
- box-shadow: none;
126
- border: none;
127
- background: transparent !important;
128
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/assets/images/michael-cannon-red-square-300x2251.jpg DELETED
Binary file
trunk/assets/js/jquery.bxslider.js DELETED
@@ -1,1343 +0,0 @@
1
- /**
2
- * BxSlider v4.1.2 - Fully loaded, responsive content slider
3
- * http://bxslider.com
4
- *
5
- * Copyright 2014, Steven Wanderski - http://stevenwanderski.com - http://bxcreative.com
6
- * Written while drinking Belgian ales and listening to jazz
7
- *
8
- * Released under the MIT license - http://opensource.org/licenses/MIT
9
- */
10
-
11
- ;(function($){
12
-
13
- var plugin = {};
14
-
15
- var defaults = {
16
-
17
- // GENERAL
18
- mode: 'horizontal',
19
- slideSelector: '',
20
- infiniteLoop: true,
21
- hideControlOnEnd: false,
22
- speed: 500,
23
- easing: null,
24
- slideMargin: 0,
25
- startSlide: 0,
26
- randomStart: false,
27
- captions: false,
28
- ticker: false,
29
- tickerHover: false,
30
- adaptiveHeight: false,
31
- adaptiveHeightSpeed: 500,
32
- video: false,
33
- useCSS: true,
34
- preloadImages: 'visible',
35
- responsive: true,
36
- slideZIndex: 50,
37
- wrapperClass: 'bx-wrapper',
38
-
39
- // TOUCH
40
- touchEnabled: true,
41
- swipeThreshold: 50,
42
- oneToOneTouch: true,
43
- preventDefaultSwipeX: true,
44
- preventDefaultSwipeY: false,
45
-
46
- // PAGER
47
- pager: true,
48
- pagerType: 'full',
49
- pagerShortSeparator: ' / ',
50
- pagerSelector: null,
51
- buildPager: null,
52
- pagerCustom: null,
53
-
54
- // CONTROLS
55
- controls: true,
56
- nextText: 'Next',
57
- prevText: 'Prev',
58
- nextSelector: null,
59
- prevSelector: null,
60
- autoControls: false,
61
- startText: 'Start',
62
- stopText: 'Stop',
63
- autoControlsCombine: false,
64
- autoControlsSelector: null,
65
-
66
- // AUTO
67
- auto: false,
68
- pause: 4000,
69
- autoStart: true,
70
- autoDirection: 'next',
71
- autoHover: false,
72
- autoDelay: 0,
73
- autoSlideForOnePage: false,
74
-
75
- // CAROUSEL
76
- minSlides: 1,
77
- maxSlides: 1,
78
- moveSlides: 0,
79
- slideWidth: 0,
80
-
81
- // CALLBACKS
82
- onSliderLoad: function() {},
83
- onSlideBefore: function() {},
84
- onSlideAfter: function() {},
85
- onSlideNext: function() {},
86
- onSlidePrev: function() {},
87
- onSliderResize: function() {}
88
- }
89
-
90
- $.fn.bxSlider = function(options){
91
-
92
- if(this.length == 0) return this;
93
-
94
- // support mutltiple elements
95
- if(this.length > 1){
96
- this.each(function(){$(this).bxSlider(options)});
97
- return this;
98
- }
99
-
100
- // create a namespace to be used throughout the plugin
101
- var slider = {};
102
- // set a reference to our slider element
103
- var el = this;
104
- plugin.el = this;
105
-
106
- /**
107
- * Makes slideshow responsive
108
- */
109
- // first get the original window dimens (thanks alot IE)
110
- var windowWidth = $(window).width();
111
- var windowHeight = $(window).height();
112
-
113
-
114
-
115
- /**
116
- * ===================================================================================
117
- * = PRIVATE FUNCTIONS
118
- * ===================================================================================
119
- */
120
-
121
- /**
122
- * Initializes namespace settings to be used throughout plugin
123
- */
124
- var init = function(){
125
- // merge user-supplied options with the defaults
126
- slider.settings = $.extend({}, defaults, options);
127
- // parse slideWidth setting
128
- slider.settings.slideWidth = parseInt(slider.settings.slideWidth);
129
- // store the original children
130
- slider.children = el.children(slider.settings.slideSelector);
131
- // check if actual number of slides is less than minSlides / maxSlides
132
- if(slider.children.length < slider.settings.minSlides) slider.settings.minSlides = slider.children.length;
133
- if(slider.children.length < slider.settings.maxSlides) slider.settings.maxSlides = slider.children.length;
134
- // if random start, set the startSlide setting to random number
135
- if(slider.settings.randomStart) slider.settings.startSlide = Math.floor(Math.random() * slider.children.length);
136
- // store active slide information
137
- slider.active = { index: slider.settings.startSlide }
138
- // store if the slider is in carousel mode (displaying / moving multiple slides)
139
- slider.carousel = slider.settings.minSlides > 1 || slider.settings.maxSlides > 1;
140
- // if carousel, force preloadImages = 'all'
141
- if(slider.carousel) slider.settings.preloadImages = 'all';
142
- // calculate the min / max width thresholds based on min / max number of slides
143
- // used to setup and update carousel slides dimensions
144
- slider.minThreshold = (slider.settings.minSlides * slider.settings.slideWidth) + ((slider.settings.minSlides - 1) * slider.settings.slideMargin);
145
- slider.maxThreshold = (slider.settings.maxSlides * slider.settings.slideWidth) + ((slider.settings.maxSlides - 1) * slider.settings.slideMargin);
146
- // store the current state of the slider (if currently animating, working is true)
147
- slider.working = false;
148
- // initialize the controls object
149
- slider.controls = {};
150
- // initialize an auto interval
151
- slider.interval = null;
152
- // determine which property to use for transitions
153
- slider.animProp = slider.settings.mode == 'vertical' ? 'top' : 'left';
154
- // determine if hardware acceleration can be used
155
- slider.usingCSS = slider.settings.useCSS && slider.settings.mode != 'fade' && (function(){
156
- // create our test div element
157
- var div = document.createElement('div');
158
- // css transition properties
159
- var props = ['WebkitPerspective', 'MozPerspective', 'OPerspective', 'msPerspective'];
160
- // test for each property
161
- for(var i in props){
162
- if(div.style[props[i]] !== undefined){
163
- slider.cssPrefix = props[i].replace('Perspective', '').toLowerCase();
164
- slider.animProp = '-' + slider.cssPrefix + '-transform';
165
- return true;
166
- }
167
- }
168
- return false;
169
- }());
170
- // if vertical mode always make maxSlides and minSlides equal
171
- if(slider.settings.mode == 'vertical') slider.settings.maxSlides = slider.settings.minSlides;
172
- // save original style data
173
- el.data("origStyle", el.attr("style"));
174
- el.children(slider.settings.slideSelector).each(function() {
175
- $(this).data("origStyle", $(this).attr("style"));
176
- });
177
- // perform all DOM / CSS modifications
178
- setup();
179
- }
180
-
181
- /**
182
- * Performs all DOM and CSS modifications
183
- */
184
- var setup = function(){
185
- // wrap el in a wrapper
186
- el.wrap('<div class="' + slider.settings.wrapperClass + '"><div class="bx-viewport"></div></div>');
187
- // store a namspace reference to .bx-viewport
188
- slider.viewport = el.parent();
189
- // add a loading div to display while images are loading
190
- slider.loader = $('<div class="bx-loading" />');
191
- slider.viewport.prepend(slider.loader);
192
- // set el to a massive width, to hold any needed slides
193
- // also strip any margin and padding from el
194
- el.css({
195
- width: slider.settings.mode == 'horizontal' ? (slider.children.length * 100 + 215) + '%' : 'auto',
196
- position: 'relative'
197
- });
198
- // if using CSS, add the easing property
199
- if(slider.usingCSS && slider.settings.easing){
200
- el.css('-' + slider.cssPrefix + '-transition-timing-function', slider.settings.easing);
201
- // if not using CSS and no easing value was supplied, use the default JS animation easing (swing)
202
- }else if(!slider.settings.easing){
203
- slider.settings.easing = 'swing';
204
- }
205
- var slidesShowing = getNumberSlidesShowing();
206
- // make modifications to the viewport (.bx-viewport)
207
- slider.viewport.css({
208
- width: '100%',
209
- overflow: 'hidden',
210
- position: 'relative'
211
- });
212
- slider.viewport.parent().css({
213
- maxWidth: getViewportMaxWidth()
214
- });
215
- // make modification to the wrapper (.bx-wrapper)
216
- if(!slider.settings.pager) {
217
- slider.viewport.parent().css({
218
- margin: '0 auto 0px'
219
- });
220
- }
221
- // apply css to all slider children
222
- slider.children.css({
223
- 'float': slider.settings.mode == 'horizontal' ? 'left' : 'none',
224
- listStyle: 'none',
225
- position: 'relative'
226
- });
227
- // apply the calculated width after the float is applied to prevent scrollbar interference
228
- slider.children.css('width', getSlideWidth());
229
- // if slideMargin is supplied, add the css
230
- if(slider.settings.mode == 'horizontal' && slider.settings.slideMargin > 0) slider.children.css('marginRight', slider.settings.slideMargin);
231
- if(slider.settings.mode == 'vertical' && slider.settings.slideMargin > 0) slider.children.css('marginBottom', slider.settings.slideMargin);
232
- // if "fade" mode, add positioning and z-index CSS
233
- if(slider.settings.mode == 'fade'){
234
- slider.children.css({
235
- position: 'absolute',
236
- zIndex: 0,
237
- display: 'none'
238
- });
239
- // prepare the z-index on the showing element
240
- slider.children.eq(slider.settings.startSlide).css({zIndex: slider.settings.slideZIndex, display: 'block'});
241
- }
242
- // create an element to contain all slider controls (pager, start / stop, etc)
243
- slider.controls.el = $('<div class="bx-controls" />');
244
- // if captions are requested, add them
245
- if(slider.settings.captions) appendCaptions();
246
- // check if startSlide is last slide
247
- slider.active.last = slider.settings.startSlide == getPagerQty() - 1;
248
- // if video is true, set up the fitVids plugin
249
- if(slider.settings.video) el.fitVids();
250
- // set the default preload selector (visible)
251
- var preloadSelector = slider.children.eq(slider.settings.startSlide);
252
- if (slider.settings.preloadImages == "all") preloadSelector = slider.children;
253
- // only check for control addition if not in "ticker" mode
254
- if(!slider.settings.ticker){
255
- // if pager is requested, add it
256
- if(slider.settings.pager) appendPager();
257
- // if controls are requested, add them
258
- if(slider.settings.controls) appendControls();
259
- // if auto is true, and auto controls are requested, add them
260
- if(slider.settings.auto && slider.settings.autoControls) appendControlsAuto();
261
- // if any control option is requested, add the controls wrapper
262
- if(slider.settings.controls || slider.settings.autoControls || slider.settings.pager) slider.viewport.after(slider.controls.el);
263
- // if ticker mode, do not allow a pager
264
- }else{
265
- slider.settings.pager = false;
266
- }
267
- // preload all images, then perform final DOM / CSS modifications that depend on images being loaded
268
- loadElements(preloadSelector, start);
269
- }
270
-
271
- var loadElements = function(selector, callback){
272
- var total = selector.find('img, iframe').length;
273
- if (total == 0){
274
- callback();
275
- return;
276
- }
277
- var count = 0;
278
- selector.find('img, iframe').each(function(){
279
- $(this).one('load', function() {
280
- if(++count == total) callback();
281
- }).each(function() {
282
- if(this.complete) $(this).load();
283
- });
284
- });
285
- }
286
-
287
- /**
288
- * Start the slider
289
- */
290
- var start = function(){
291
- // if infinite loop, prepare additional slides
292
- if(slider.settings.infiniteLoop && slider.settings.mode != 'fade' && !slider.settings.ticker){
293
- var slice = slider.settings.mode == 'vertical' ? slider.settings.minSlides : slider.settings.maxSlides;
294
- var sliceAppend = slider.children.slice(0, slice).clone().addClass('bx-clone');
295
- var slicePrepend = slider.children.slice(-slice).clone().addClass('bx-clone');
296
- el.append(sliceAppend).prepend(slicePrepend);
297
- }
298
- // remove the loading DOM element
299
- slider.loader.remove();
300
- // set the left / top position of "el"
301
- setSlidePosition();
302
- // if "vertical" mode, always use adaptiveHeight to prevent odd behavior
303
- if (slider.settings.mode == 'vertical') slider.settings.adaptiveHeight = true;
304
- // set the viewport height
305
- slider.viewport.height(getViewportHeight());
306
- // make sure everything is positioned just right (same as a window resize)
307
- el.redrawSlider();
308
- // onSliderLoad callback
309
- slider.settings.onSliderLoad(slider.active.index);
310
- // slider has been fully initialized
311
- slider.initialized = true;
312
- // bind the resize call to the window
313
- if (slider.settings.responsive) $(window).bind('resize', resizeWindow);
314
- // if auto is true and has more than 1 page, start the show
315
- if (slider.settings.auto && slider.settings.autoStart && (getPagerQty() > 1 || slider.settings.autoSlideForOnePage)) initAuto();
316
- // if ticker is true, start the ticker
317
- if (slider.settings.ticker) initTicker();
318
- // if pager is requested, make the appropriate pager link active
319
- if (slider.settings.pager) updatePagerActive(slider.settings.startSlide);
320
- // check for any updates to the controls (like hideControlOnEnd updates)
321
- if (slider.settings.controls) updateDirectionControls();
322
- // if touchEnabled is true, setup the touch events
323
- if (slider.settings.touchEnabled && !slider.settings.ticker) initTouch();
324
- }
325
-
326
- /**
327
- * Returns the calculated height of the viewport, used to determine either adaptiveHeight or the maxHeight value
328
- */
329
- var getViewportHeight = function(){
330
- var height = 0;
331
- // first determine which children (slides) should be used in our height calculation
332
- var children = $();
333
- // if mode is not "vertical" and adaptiveHeight is false, include all children
334
- if(slider.settings.mode != 'vertical' && !slider.settings.adaptiveHeight){
335
- children = slider.children;
336
- }else{
337
- // if not carousel, return the single active child
338
- if(!slider.carousel){
339
- children = slider.children.eq(slider.active.index);
340
- // if carousel, return a slice of children
341
- }else{
342
- // get the individual slide index
343
- var currentIndex = slider.settings.moveSlides == 1 ? slider.active.index : slider.active.index * getMoveBy();
344
- // add the current slide to the children
345
- children = slider.children.eq(currentIndex);
346
- // cycle through the remaining "showing" slides
347
- for (i = 1; i <= slider.settings.maxSlides - 1; i++){
348
- // if looped back to the start
349
- if(currentIndex + i >= slider.children.length){
350
- children = children.add(slider.children.eq(i - 1));
351
- }else{
352
- children = children.add(slider.children.eq(currentIndex + i));
353
- }
354
- }
355
- }
356
- }
357
- // if "vertical" mode, calculate the sum of the heights of the children
358
- if(slider.settings.mode == 'vertical'){
359
- children.each(function(index) {
360
- height += $(this).outerHeight();
361
- });
362
- // add user-supplied margins
363
- if(slider.settings.slideMargin > 0){
364
- height += slider.settings.slideMargin * (slider.settings.minSlides - 1);
365
- }
366
- // if not "vertical" mode, calculate the max height of the children
367
- }else{
368
- height = Math.max.apply(Math, children.map(function(){
369
- return $(this).outerHeight(false);
370
- }).get());
371
- }
372
-
373
- if(slider.viewport.css('box-sizing') == 'border-box'){
374
- height += parseFloat(slider.viewport.css('padding-top')) + parseFloat(slider.viewport.css('padding-bottom')) +
375
- parseFloat(slider.viewport.css('border-top-width')) + parseFloat(slider.viewport.css('border-bottom-width'));
376
- }else if(slider.viewport.css('box-sizing') == 'padding-box'){
377
- height += parseFloat(slider.viewport.css('padding-top')) + parseFloat(slider.viewport.css('padding-bottom'));
378
- }
379
-
380
- return height;
381
- }
382
-
383
- /**
384
- * Returns the calculated width to be used for the outer wrapper / viewport
385
- */
386
- var getViewportMaxWidth = function(){
387
- var width = '100%';
388
- if(slider.settings.slideWidth > 0){
389
- if(slider.settings.mode == 'horizontal'){
390
- width = (slider.settings.maxSlides * slider.settings.slideWidth) + ((slider.settings.maxSlides - 1) * slider.settings.slideMargin);
391
- }else{
392
- width = slider.settings.slideWidth;
393
- }
394
- }
395
- return width;
396
- }
397
-
398
- /**
399
- * Returns the calculated width to be applied to each slide
400
- */
401
- var getSlideWidth = function(){
402
- // start with any user-supplied slide width
403
- var newElWidth = slider.settings.slideWidth;
404
- // get the current viewport width
405
- var wrapWidth = slider.viewport.width();
406
- // if slide width was not supplied, or is larger than the viewport use the viewport width
407
- if(slider.settings.slideWidth == 0 ||
408
- (slider.settings.slideWidth > wrapWidth && !slider.carousel) ||
409
- slider.settings.mode == 'vertical'){
410
- newElWidth = wrapWidth;
411
- // if carousel, use the thresholds to determine the width
412
- }else if(slider.settings.maxSlides > 1 && slider.settings.mode == 'horizontal'){
413
- if(wrapWidth > slider.maxThreshold){
414
- // newElWidth = (wrapWidth - (slider.settings.slideMargin * (slider.settings.maxSlides - 1))) / slider.settings.maxSlides;
415
- }else if(wrapWidth < slider.minThreshold){
416
- newElWidth = (wrapWidth - (slider.settings.slideMargin * (slider.settings.minSlides - 1))) / slider.settings.minSlides;
417
- }
418
- }
419
- return newElWidth;
420
- }
421
-
422
- /**
423
- * Returns the number of slides currently visible in the viewport (includes partially visible slides)
424
- */
425
- var getNumberSlidesShowing = function(){
426
- var slidesShowing = 1;
427
- if(slider.settings.mode == 'horizontal' && slider.settings.slideWidth > 0){
428
- // if viewport is smaller than minThreshold, return minSlides
429
- if(slider.viewport.width() < slider.minThreshold){
430
- slidesShowing = slider.settings.minSlides;
431
- // if viewport is larger than minThreshold, return maxSlides
432
- }else if(slider.viewport.width() > slider.maxThreshold){
433
- slidesShowing = slider.settings.maxSlides;
434
- // if viewport is between min / max thresholds, divide viewport width by first child width
435
- }else{
436
- var childWidth = slider.children.first().width() + slider.settings.slideMargin;
437
- slidesShowing = Math.floor((slider.viewport.width() +
438
- slider.settings.slideMargin) / childWidth);
439
- }
440
- // if "vertical" mode, slides showing will always be minSlides
441
- }else if(slider.settings.mode == 'vertical'){
442
- slidesShowing = slider.settings.minSlides;
443
- }
444
- return slidesShowing;
445
- }
446
-
447
- /**
448
- * Returns the number of pages (one full viewport of slides is one "page")
449
- */
450
- var getPagerQty = function(){
451
- var pagerQty = 0;
452
- // if moveSlides is specified by the user
453
- if(slider.settings.moveSlides > 0){
454
- if(slider.settings.infiniteLoop){
455
- pagerQty = Math.ceil(slider.children.length / getMoveBy());
456
- }else{
457
- // use a while loop to determine pages
458
- var breakPoint = 0;
459
- var counter = 0
460
- // when breakpoint goes above children length, counter is the number of pages
461
- while (breakPoint < slider.children.length){
462
- ++pagerQty;
463
- breakPoint = counter + getNumberSlidesShowing();
464
- counter += slider.settings.moveSlides <= getNumberSlidesShowing() ? slider.settings.moveSlides : getNumberSlidesShowing();
465
- }
466
- }
467
- // if moveSlides is 0 (auto) divide children length by sides showing, then round up
468
- }else{
469
- pagerQty = Math.ceil(slider.children.length / getNumberSlidesShowing());
470
- }
471
- return pagerQty;
472
- }
473
-
474
- /**
475
- * Returns the number of indivual slides by which to shift the slider
476
- */
477
- var getMoveBy = function(){
478
- // if moveSlides was set by the user and moveSlides is less than number of slides showing
479
- if(slider.settings.moveSlides > 0 && slider.settings.moveSlides <= getNumberSlidesShowing()){
480
- return slider.settings.moveSlides;
481
- }
482
- // if moveSlides is 0 (auto)
483
- return getNumberSlidesShowing();
484
- }
485
-
486
- /**
487
- * Sets the slider's (el) left or top position
488
- */
489
- var setSlidePosition = function(){
490
- // if last slide, not infinite loop, and number of children is larger than specified maxSlides
491
- if(slider.children.length > slider.settings.maxSlides && slider.active.last && !slider.settings.infiniteLoop){
492
- if (slider.settings.mode == 'horizontal'){
493
- // get the last child's position
494
- var lastChild = slider.children.last();
495
- var position = lastChild.position();
496
- // set the left position
497
- setPositionProperty(-(position.left - (slider.viewport.width() - lastChild.outerWidth())), 'reset', 0);
498
- }else if(slider.settings.mode == 'vertical'){
499
- // get the last showing index's position
500
- var lastShowingIndex = slider.children.length - slider.settings.minSlides;
501
- var position = slider.children.eq(lastShowingIndex).position();
502
- // set the top position
503
- setPositionProperty(-position.top, 'reset', 0);
504
- }
505
- // if not last slide
506
- }else{
507
- // get the position of the first showing slide
508
- var position = slider.children.eq(slider.active.index * getMoveBy()).position();
509
- // check for last slide
510
- if (slider.active.index == getPagerQty() - 1) slider.active.last = true;
511
- // set the repective position
512
- if (position != undefined){
513
- if (slider.settings.mode == 'horizontal') setPositionProperty(-position.left, 'reset', 0);
514
- else if (slider.settings.mode == 'vertical') setPositionProperty(-position.top, 'reset', 0);
515
- }
516
- }
517
- }
518
-
519
- /**
520
- * Sets the el's animating property position (which in turn will sometimes animate el).
521
- * If using CSS, sets the transform property. If not using CSS, sets the top / left property.
522
- *
523
- * @param value (int)
524
- * - the animating property's value
525
- *
526
- * @param type (string) 'slider', 'reset', 'ticker'
527
- * - the type of instance for which the function is being
528
- *
529
- * @param duration (int)
530
- * - the amount of time (in ms) the transition should occupy
531
- *
532
- * @param params (array) optional
533
- * - an optional parameter containing any variables that need to be passed in
534
- */
535
- var setPositionProperty = function(value, type, duration, params){
536
- // use CSS transform
537
- if(slider.usingCSS){
538
- // determine the translate3d value
539
- var propValue = slider.settings.mode == 'vertical' ? 'translate3d(0, ' + value + 'px, 0)' : 'translate3d(' + value + 'px, 0, 0)';
540
- // add the CSS transition-duration
541
- el.css('-' + slider.cssPrefix + '-transition-duration', duration / 1000 + 's');
542
- if(type == 'slide'){
543
- // set the property value
544
- el.css(slider.animProp, propValue);
545
- // bind a callback method - executes when CSS transition completes
546
- el.bind('transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd', function(){
547
- // unbind the callback
548
- el.unbind('transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd');
549
- updateAfterSlideTransition();
550
- });
551
- }else if(type == 'reset'){
552
- el.css(slider.animProp, propValue);
553
- }else if(type == 'ticker'){
554
- // make the transition use 'linear'
555
- el.css('-' + slider.cssPrefix + '-transition-timing-function', 'linear');
556
- el.css(slider.animProp, propValue);
557
- // bind a callback method - executes when CSS transition completes
558
- el.bind('transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd', function(){
559
- // unbind the callback
560
- el.unbind('transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd');
561
- // reset the position
562
- setPositionProperty(params['resetValue'], 'reset', 0);
563
- // start the loop again
564
- tickerLoop();
565
- });
566
- }
567
- // use JS animate
568
- }else{
569
- var animateObj = {};
570
- animateObj[slider.animProp] = value;
571
- if(type == 'slide'){
572
- el.animate(animateObj, duration, slider.settings.easing, function(){
573
- updateAfterSlideTransition();
574
- });
575
- }else if(type == 'reset'){
576
- el.css(slider.animProp, value)
577
- }else if(type == 'ticker'){
578
- el.animate(animateObj, speed, 'linear', function(){
579
- setPositionProperty(params['resetValue'], 'reset', 0);
580
- // run the recursive loop after animation
581
- tickerLoop();
582
- });
583
- }
584
- }
585
- }
586
-
587
- /**
588
- * Populates the pager with proper amount of pages
589
- */
590
- var populatePager = function(){
591
- var pagerHtml = '';
592
- var pagerQty = getPagerQty();
593
- // loop through each pager item
594
- for(var i=0; i < pagerQty; i++){
595
- var linkContent = '';
596
- // if a buildPager function is supplied, use it to get pager link value, else use index + 1
597
- if(slider.settings.buildPager && $.isFunction(slider.settings.buildPager)){
598
- linkContent = slider.settings.buildPager(i);
599
- slider.pagerEl.addClass('bx-custom-pager');
600
- }else{
601
- linkContent = i + 1;
602
- slider.pagerEl.addClass('bx-default-pager');
603
- }
604
- // var linkContent = slider.settings.buildPager && $.isFunction(slider.settings.buildPager) ? slider.settings.buildPager(i) : i + 1;
605
- // add the markup to the string
606
- pagerHtml += '<div class="bx-pager-item"><a href="" data-slide-index="' + i + '" class="bx-pager-link">' + linkContent + '</a></div>';
607
- };
608
- // populate the pager element with pager links
609
- slider.pagerEl.html(pagerHtml);
610
- }
611
-
612
- /**
613
- * Appends the pager to the controls element
614
- */
615
- var appendPager = function(){
616
- if(!slider.settings.pagerCustom){
617
- // create the pager DOM element
618
- slider.pagerEl = $('<div class="bx-pager" />');
619
- // if a pager selector was supplied, populate it with the pager
620
- if(slider.settings.pagerSelector){
621
- $(slider.settings.pagerSelector).html(slider.pagerEl);
622
- // if no pager selector was supplied, add it after the wrapper
623
- }else{
624
- slider.controls.el.addClass('bx-has-pager').append(slider.pagerEl);
625
- }
626
- // populate the pager
627
- populatePager();
628
- }else{
629
- slider.pagerEl = $(slider.settings.pagerCustom);
630
- }
631
- // assign the pager click binding
632
- slider.pagerEl.on('click', 'a', clickPagerBind);
633
- }
634
-
635
- /**
636
- * Appends prev / next controls to the controls element
637
- */
638
- var appendControls = function(){
639
- slider.controls.next = $('<a class="bx-next" href="">' + slider.settings.nextText + '</a>');
640
- slider.controls.prev = $('<a class="bx-prev" href="">' + slider.settings.prevText + '</a>');
641
- // bind click actions to the controls
642
- slider.controls.next.bind('click', clickNextBind);
643
- slider.controls.prev.bind('click', clickPrevBind);
644
- // if nextSlector was supplied, populate it
645
- if(slider.settings.nextSelector){
646
- $(slider.settings.nextSelector).append(slider.controls.next);
647
- }
648
- // if prevSlector was supplied, populate it
649
- if(slider.settings.prevSelector){
650
- $(slider.settings.prevSelector).append(slider.controls.prev);
651
- }
652
- // if no custom selectors were supplied
653
- if(!slider.settings.nextSelector && !slider.settings.prevSelector){
654
- // add the controls to the DOM
655
- slider.controls.directionEl = $('<div class="bx-controls-direction" />');
656
- // add the control elements to the directionEl
657
- slider.controls.directionEl.append(slider.controls.prev).append(slider.controls.next);
658
- // slider.viewport.append(slider.controls.directionEl);
659
- slider.controls.el.addClass('bx-has-controls-direction').append(slider.controls.directionEl);
660
- }
661
- }
662
-
663
- /**
664
- * Appends start / stop auto controls to the controls element
665
- */
666
- var appendControlsAuto = function(){
667
- slider.controls.start = $('<div class="bx-controls-auto-item"><a class="bx-start" href="">' + slider.settings.startText + '</a></div>');
668
- slider.controls.stop = $('<div class="bx-controls-auto-item"><a class="bx-stop" href="">' + slider.settings.stopText + '</a></div>');
669
- // add the controls to the DOM
670
- slider.controls.autoEl = $('<div class="bx-controls-auto" />');
671
- // bind click actions to the controls
672
- slider.controls.autoEl.on('click', '.bx-start', clickStartBind);
673
- slider.controls.autoEl.on('click', '.bx-stop', clickStopBind);
674
- // if autoControlsCombine, insert only the "start" control
675
- if(slider.settings.autoControlsCombine){
676
- slider.controls.autoEl.append(slider.controls.start);
677
- // if autoControlsCombine is false, insert both controls
678
- }else{
679
- slider.controls.autoEl.append(slider.controls.start).append(slider.controls.stop);
680
- }
681
- // if auto controls selector was supplied, populate it with the controls
682
- if(slider.settings.autoControlsSelector){
683
- $(slider.settings.autoControlsSelector).html(slider.controls.autoEl);
684
- // if auto controls selector was not supplied, add it after the wrapper
685
- }else{
686
- slider.controls.el.addClass('bx-has-controls-auto').append(slider.controls.autoEl);
687
- }
688
- // update the auto controls
689
- updateAutoControls(slider.settings.autoStart ? 'stop' : 'start');
690
- }
691
-
692
- /**
693
- * Appends image captions to the DOM
694
- */
695
- var appendCaptions = function(){
696
- // cycle through each child
697
- slider.children.each(function(index){
698
- // get the image title attribute
699
- var title = $(this).find('img:first').attr('title');
700
- // append the caption
701
- if (title != undefined && ('' + title).length) {
702
- $(this).append('<div class="bx-caption"><span>' + title + '</span></div>');
703
- }
704
- });
705
- }
706
-
707
- /**
708
- * Click next binding
709
- *
710
- * @param e (event)
711
- * - DOM event object
712
- */
713
- var clickNextBind = function(e){
714
- // if auto show is running, stop it
715
- if (slider.settings.auto) el.stopAuto();
716
- el.goToNextSlide();
717
- e.preventDefault();
718
- }
719
-
720
- /**
721
- * Click prev binding
722
- *
723
- * @param e (event)
724
- * - DOM event object
725
- */
726
- var clickPrevBind = function(e){
727
- // if auto show is running, stop it
728
- if (slider.settings.auto) el.stopAuto();
729
- el.goToPrevSlide();
730
- e.preventDefault();
731
- }
732
-
733
- /**
734
- * Click start binding
735
- *
736
- * @param e (event)
737
- * - DOM event object
738
- */
739
- var clickStartBind = function(e){
740
- el.startAuto();
741
- e.preventDefault();
742
- }
743
-
744
- /**
745
- * Click stop binding
746
- *
747
- * @param e (event)
748
- * - DOM event object
749
- */
750
- var clickStopBind = function(e){
751
- el.stopAuto();
752
- e.preventDefault();
753
- }
754
-
755
- /**
756
- * Click pager binding
757
- *
758
- * @param e (event)
759
- * - DOM event object
760
- */
761
- var clickPagerBind = function(e){
762
- // if auto show is running, stop it
763
- if (slider.settings.auto) el.stopAuto();
764
- var pagerLink = $(e.currentTarget);
765
- if(pagerLink.attr('data-slide-index') !== undefined){
766
- var pagerIndex = parseInt(pagerLink.attr('data-slide-index'));
767
- // if clicked pager link is not active, continue with the goToSlide call
768
- if(pagerIndex != slider.active.index) el.goToSlide(pagerIndex);
769
- e.preventDefault();
770
- }
771
- }
772
-
773
- /**
774
- * Updates the pager links with an active class
775
- *
776
- * @param slideIndex (int)
777
- * - index of slide to make active
778
- */
779
- var updatePagerActive = function(slideIndex){
780
- // if "short" pager type
781
- var len = slider.children.length; // nb of children
782
- if(slider.settings.pagerType == 'short'){
783
- if(slider.settings.maxSlides > 1) {
784
- len = Math.ceil(slider.children.length/slider.settings.maxSlides);
785
- }
786
- slider.pagerEl.html( (slideIndex + 1) + slider.settings.pagerShortSeparator + len);
787
- return;
788
- }
789
- // remove all pager active classes
790
- slider.pagerEl.find('a').removeClass('active');
791
- // apply the active class for all pagers
792
- slider.pagerEl.each(function(i, el) { $(el).find('a').eq(slideIndex).addClass('active'); });
793
- }
794
-
795
- /**
796
- * Performs needed actions after a slide transition
797
- */
798
- var updateAfterSlideTransition = function(){
799
- // if infinte loop is true
800
- if(slider.settings.infiniteLoop){
801
- var position = '';
802
- // first slide
803
- if(slider.active.index == 0){
804
- // set the new position
805
- position = slider.children.eq(0).position();
806
- // carousel, last slide
807
- }else if(slider.active.index == getPagerQty() - 1 && slider.carousel){
808
- position = slider.children.eq((getPagerQty() - 1) * getMoveBy()).position();
809
- // last slide
810
- }else if(slider.active.index == slider.children.length - 1){
811
- position = slider.children.eq(slider.children.length - 1).position();
812
- }
813
- if(position){
814
- if (slider.settings.mode == 'horizontal') { setPositionProperty(-position.left, 'reset', 0); }
815
- else if (slider.settings.mode == 'vertical') { setPositionProperty(-position.top, 'reset', 0); }
816
- }
817
- }
818
- // declare that the transition is complete
819
- slider.working = false;
820
- // onSlideAfter callback
821
- slider.settings.onSlideAfter(slider.children.eq(slider.active.index), slider.oldIndex, slider.active.index);
822
- }
823
-
824
- /**
825
- * Updates the auto controls state (either active, or combined switch)
826
- *
827
- * @param state (string) "start", "stop"
828
- * - the new state of the auto show
829
- */
830
- var updateAutoControls = function(state){
831
- // if autoControlsCombine is true, replace the current control with the new state
832
- if(slider.settings.autoControlsCombine){
833
- slider.controls.autoEl.html(slider.controls[state]);
834
- // if autoControlsCombine is false, apply the "active" class to the appropriate control
835
- }else{
836
- slider.controls.autoEl.find('a').removeClass('active');
837
- slider.controls.autoEl.find('a:not(.bx-' + state + ')').addClass('active');
838
- }
839
- }
840
-
841
- /**
842
- * Updates the direction controls (checks if either should be hidden)
843
- */
844
- var updateDirectionControls = function(){
845
- if(getPagerQty() == 1){
846
- slider.controls.prev.addClass('disabled');
847
- slider.controls.next.addClass('disabled');
848
- }else if(!slider.settings.infiniteLoop && slider.settings.hideControlOnEnd){
849
- // if first slide
850
- if (slider.active.index == 0){
851
- slider.controls.prev.addClass('disabled');
852
- slider.controls.next.removeClass('disabled');
853
- // if last slide
854
- }else if(slider.active.index == getPagerQty() - 1){
855
- slider.controls.next.addClass('disabled');
856
- slider.controls.prev.removeClass('disabled');
857
- // if any slide in the middle
858
- }else{
859
- slider.controls.prev.removeClass('disabled');
860
- slider.controls.next.removeClass('disabled');
861
- }
862
- }
863
- }
864
-
865
- /**
866
- * Initialzes the auto process
867
- */
868
- var initAuto = function(){
869
- // if autoDelay was supplied, launch the auto show using a setTimeout() call
870
- if(slider.settings.autoDelay > 0){
871
- var timeout = setTimeout(el.startAuto, slider.settings.autoDelay);
872
- // if autoDelay was not supplied, start the auto show normally
873
- }else{
874
- el.startAuto();
875
- }
876
- // if autoHover is requested
877
- if(slider.settings.autoHover){
878
- // on el hover
879
- el.hover(function(){
880
- // if the auto show is currently playing (has an active interval)
881
- if(slider.interval){
882
- // stop the auto show and pass true agument which will prevent control update
883
- el.stopAuto(true);
884
- // create a new autoPaused value which will be used by the relative "mouseout" event
885
- slider.autoPaused = true;
886
- }
887
- }, function(){
888
- // if the autoPaused value was created be the prior "mouseover" event
889
- if(slider.autoPaused){
890
- // start the auto show and pass true agument which will prevent control update
891
- el.startAuto(true);
892
- // reset the autoPaused value
893
- slider.autoPaused = null;
894
- }
895
- });
896
- }
897
- }
898
-
899
- /**
900
- * Initialzes the ticker process
901
- */
902
- var initTicker = function(){
903
- var startPosition = 0;
904
- // if autoDirection is "next", append a clone of the entire slider
905
- if(slider.settings.autoDirection == 'next'){
906
- el.append(slider.children.clone().addClass('bx-clone'));
907
- // if autoDirection is "prev", prepend a clone of the entire slider, and set the left position
908
- }else{
909
- el.prepend(slider.children.clone().addClass('bx-clone'));
910
- var position = slider.children.first().position();
911
- startPosition = slider.settings.mode == 'horizontal' ? -position.left : -position.top;
912
- }
913
- setPositionProperty(startPosition, 'reset', 0);
914
- // do not allow controls in ticker mode
915
- slider.settings.pager = false;
916
- slider.settings.controls = false;
917
- slider.settings.autoControls = false;
918
- // if autoHover is requested
919
- if(slider.settings.tickerHover && !slider.usingCSS){
920
- // on el hover
921
- slider.viewport.hover(function(){
922
- el.stop();
923
- }, function(){
924
- // calculate the total width of children (used to calculate the speed ratio)
925
- var totalDimens = 0;
926
- slider.children.each(function(index){
927
- totalDimens += slider.settings.mode == 'horizontal' ? $(this).outerWidth(true) : $(this).outerHeight(true);
928
- });
929
- // calculate the speed ratio (used to determine the new speed to finish the paused animation)
930
- var ratio = slider.settings.speed / totalDimens;
931
- // determine which property to use
932
- var property = slider.settings.mode == 'horizontal' ? 'left' : 'top';
933
- // calculate the new speed
934
- var newSpeed = ratio * (totalDimens - (Math.abs(parseInt(el.css(property)))));
935
- tickerLoop(newSpeed);
936
- });
937
- }
938
- // start the ticker loop
939
- tickerLoop();
940
- }
941
-
942
- /**
943
- * Runs a continuous loop, news ticker-style
944
- */
945
- var tickerLoop = function(resumeSpeed){
946
- speed = resumeSpeed ? resumeSpeed : slider.settings.speed;
947
- var position = {left: 0, top: 0};
948
- var reset = {left: 0, top: 0};
949
- // if "next" animate left position to last child, then reset left to 0
950
- if(slider.settings.autoDirection == 'next'){
951
- position = el.find('.bx-clone').first().position();
952
- // if "prev" animate left position to 0, then reset left to first non-clone child
953
- }else{
954
- reset = slider.children.first().position();
955
- }
956
- var animateProperty = slider.settings.mode == 'horizontal' ? -position.left : -position.top;
957
- var resetValue = slider.settings.mode == 'horizontal' ? -reset.left : -reset.top;
958
- var params = {resetValue: resetValue};
959
- setPositionProperty(animateProperty, 'ticker', speed, params);
960
- }
961
-
962
- /**
963
- * Initializes touch events
964
- */
965
- var initTouch = function(){
966
- // initialize object to contain all touch values
967
- slider.touch = {
968
- start: {x: 0, y: 0},
969
- end: {x: 0, y: 0}
970
- }
971
- slider.viewport.bind('touchstart', onTouchStart);
972
- }
973
-
974
- /**
975
- * Event handler for "touchstart"
976
- *
977
- * @param e (event)
978
- * - DOM event object
979
- */
980
- var onTouchStart = function(e){
981
- if(slider.working){
982
- e.preventDefault();
983
- }else{
984
- // record the original position when touch starts
985
- slider.touch.originalPos = el.position();
986
- var orig = e.originalEvent;
987
- // record the starting touch x, y coordinates
988
- slider.touch.start.x = orig.changedTouches[0].pageX;
989
- slider.touch.start.y = orig.changedTouches[0].pageY;
990
- // bind a "touchmove" event to the viewport
991
- slider.viewport.bind('touchmove', onTouchMove);
992
- // bind a "touchend" event to the viewport
993
- slider.viewport.bind('touchend', onTouchEnd);
994
- }
995
- }
996
-
997
- /**
998
- * Event handler for "touchmove"
999
- *
1000
- * @param e (event)
1001
- * - DOM event object
1002
- */
1003
- var onTouchMove = function(e){
1004
- var orig = e.originalEvent;
1005
- // if scrolling on y axis, do not prevent default
1006
- var xMovement = Math.abs(orig.changedTouches[0].pageX - slider.touch.start.x);
1007
- var yMovement = Math.abs(orig.changedTouches[0].pageY - slider.touch.start.y);
1008
- // x axis swipe
1009
- if((xMovement * 3) > yMovement && slider.settings.preventDefaultSwipeX){
1010
- e.preventDefault();
1011
- // y axis swipe
1012
- }else if((yMovement * 3) > xMovement && slider.settings.preventDefaultSwipeY){
1013
- e.preventDefault();
1014
- }
1015
- if(slider.settings.mode != 'fade' && slider.settings.oneToOneTouch){
1016
- var value = 0;
1017
- // if horizontal, drag along x axis
1018
- if(slider.settings.mode == 'horizontal'){
1019
- var change = orig.changedTouches[0].pageX - slider.touch.start.x;
1020
- value = slider.touch.originalPos.left + change;
1021
- // if vertical, drag along y axis
1022
- }else{
1023
- var change = orig.changedTouches[0].pageY - slider.touch.start.y;
1024
- value = slider.touch.originalPos.top + change;
1025
- }
1026
- setPositionProperty(value, 'reset', 0);
1027
- }
1028
- }
1029
-
1030
- /**
1031
- * Event handler for "touchend"
1032
- *
1033
- * @param e (event)
1034
- * - DOM event object
1035
- */
1036
- var onTouchEnd = function(e){
1037
- slider.viewport.unbind('touchmove', onTouchMove);
1038
- var orig = e.originalEvent;
1039
- var value = 0;
1040
- // record end x, y positions
1041
- slider.touch.end.x = orig.changedTouches[0].pageX;
1042
- slider.touch.end.y = orig.changedTouches[0].pageY;
1043
- // if fade mode, check if absolute x distance clears the threshold
1044
- if(slider.settings.mode == 'fade'){
1045
- var distance = Math.abs(slider.touch.start.x - slider.touch.end.x);
1046
- if(distance >= slider.settings.swipeThreshold){
1047
- slider.touch.start.x > slider.touch.end.x ? el.goToNextSlide() : el.goToPrevSlide();
1048
- el.stopAuto();
1049
- }
1050
- // not fade mode
1051
- }else{
1052
- var distance = 0;
1053
- // calculate distance and el's animate property
1054
- if(slider.settings.mode == 'horizontal'){
1055
- distance = slider.touch.end.x - slider.touch.start.x;
1056
- value = slider.touch.originalPos.left;
1057
- }else{
1058
- distance = slider.touch.end.y - slider.touch.start.y;
1059
- value = slider.touch.originalPos.top;
1060
- }
1061
- // if not infinite loop and first / last slide, do not attempt a slide transition
1062
- if(!slider.settings.infiniteLoop && ((slider.active.index == 0 && distance > 0) || (slider.active.last && distance < 0))){
1063
- setPositionProperty(value, 'reset', 200);
1064
- }else{
1065
- // check if distance clears threshold
1066
- if(Math.abs(distance) >= slider.settings.swipeThreshold){
1067
- distance < 0 ? el.goToNextSlide() : el.goToPrevSlide();
1068
- el.stopAuto();
1069
- }else{
1070
- // el.animate(property, 200);
1071
- setPositionProperty(value, 'reset', 200);
1072
- }
1073
- }
1074
- }
1075
- slider.viewport.unbind('touchend', onTouchEnd);
1076
- }
1077
-
1078
- /**
1079
- * Window resize event callback
1080
- */
1081
- var resizeWindow = function(e){
1082
- // don't do anything if slider isn't initialized.
1083
- if(!slider.initialized) return;
1084
- // get the new window dimens (again, thank you IE)
1085
- var windowWidthNew = $(window).width();
1086
- var windowHeightNew = $(window).height();
1087
- // make sure that it is a true window resize
1088
- // *we must check this because our dinosaur friend IE fires a window resize event when certain DOM elements
1089
- // are resized. Can you just die already?*
1090
- if(windowWidth != windowWidthNew || windowHeight != windowHeightNew){
1091
- // set the new window dimens
1092
- windowWidth = windowWidthNew;
1093
- windowHeight = windowHeightNew;
1094
- // update all dynamic elements
1095
- el.redrawSlider();
1096
- // Call user resize handler
1097
- slider.settings.onSliderResize.call(el, slider.active.index);
1098
- }
1099
- }
1100
-
1101
- /**
1102
- * ===================================================================================
1103
- * = PUBLIC FUNCTIONS
1104
- * ===================================================================================
1105
- */
1106
-
1107
- /**
1108
- * Performs slide transition to the specified slide
1109
- *
1110
- * @param slideIndex (int)
1111
- * - the destination slide's index (zero-based)
1112
- *
1113
- * @param direction (string)
1114
- * - INTERNAL USE ONLY - the direction of travel ("prev" / "next")
1115
- */
1116
- el.goToSlide = function(slideIndex, direction){
1117
- // if plugin is currently in motion, ignore request
1118
- if(slider.working || slider.active.index == slideIndex) return;
1119
- // declare that plugin is in motion
1120
- slider.working = true;
1121
- // store the old index
1122
- slider.oldIndex = slider.active.index;
1123
- // if slideIndex is less than zero, set active index to last child (this happens during infinite loop)
1124
- if(slideIndex < 0){
1125
- slider.active.index = getPagerQty() - 1;
1126
- // if slideIndex is greater than children length, set active index to 0 (this happens during infinite loop)
1127
- }else if(slideIndex >= getPagerQty()){
1128
- slider.active.index = 0;
1129
- // set active index to requested slide
1130
- }else{
1131
- slider.active.index = slideIndex;
1132
- }
1133
- // onSlideBefore, onSlideNext, onSlidePrev callbacks
1134
- slider.settings.onSlideBefore(slider.children.eq(slider.active.index), slider.oldIndex, slider.active.index);
1135
- if(direction == 'next'){
1136
- slider.settings.onSlideNext(slider.children.eq(slider.active.index), slider.oldIndex, slider.active.index);
1137
- }else if(direction == 'prev'){
1138
- slider.settings.onSlidePrev(slider.children.eq(slider.active.index), slider.oldIndex, slider.active.index);
1139
- }
1140
- // check if last slide
1141
- slider.active.last = slider.active.index >= getPagerQty() - 1;
1142
- // update the pager with active class
1143
- if(slider.settings.pager) updatePagerActive(slider.active.index);
1144
- // // check for direction control update
1145
- if(slider.settings.controls) updateDirectionControls();
1146
- // if slider is set to mode: "fade"
1147
- if(slider.settings.mode == 'fade'){
1148
- // if adaptiveHeight is true and next height is different from current height, animate to the new height
1149
- if(slider.settings.adaptiveHeight && slider.viewport.height() != getViewportHeight()){
1150
- slider.viewport.animate({height: getViewportHeight()}, slider.settings.adaptiveHeightSpeed);
1151
- }
1152
- // fade out the visible child and reset its z-index value
1153
- slider.children.filter(':visible').fadeOut(slider.settings.speed).css({zIndex: 0});
1154
- // fade in the newly requested slide
1155
- slider.children.eq(slider.active.index).css('zIndex', slider.settings.slideZIndex+1).fadeIn(slider.settings.speed, function(){
1156
- $(this).css('zIndex', slider.settings.slideZIndex);
1157
- updateAfterSlideTransition();
1158
- });
1159
- // slider mode is not "fade"
1160
- }else{
1161
- // if adaptiveHeight is true and next height is different from current height, animate to the new height
1162
- if(slider.settings.adaptiveHeight && slider.viewport.height() != getViewportHeight()){
1163
- slider.viewport.animate({height: getViewportHeight()}, slider.settings.adaptiveHeightSpeed);
1164
- }
1165
- var moveBy = 0;
1166
- var position = {left: 0, top: 0};
1167
- // if carousel and not infinite loop
1168
- if(!slider.settings.infiniteLoop && slider.carousel && slider.active.last){
1169
- if(slider.settings.mode == 'horizontal'){
1170
- // get the last child position
1171
- var lastChild = slider.children.eq(slider.children.length - 1);
1172
- position = lastChild.position();
1173
- // calculate the position of the last slide
1174
- moveBy = slider.viewport.width() - lastChild.outerWidth();
1175
- }else{
1176
- // get last showing index position
1177
- var lastShowingIndex = slider.children.length - slider.settings.minSlides;
1178
- position = slider.children.eq(lastShowingIndex).position();
1179
- }
1180
- // horizontal carousel, going previous while on first slide (infiniteLoop mode)
1181
- }else if(slider.carousel && slider.active.last && direction == 'prev'){
1182
- // get the last child position
1183
- var eq = slider.settings.moveSlides == 1 ? slider.settings.maxSlides - getMoveBy() : ((getPagerQty() - 1) * getMoveBy()) - (slider.children.length - slider.settings.maxSlides);
1184
- var lastChild = el.children('.bx-clone').eq(eq);
1185
- position = lastChild.position();
1186
- // if infinite loop and "Next" is clicked on the last slide
1187
- }else if(direction == 'next' && slider.active.index == 0){
1188
- // get the last clone position
1189
- position = el.find('> .bx-clone').eq(slider.settings.maxSlides).position();
1190
- slider.active.last = false;
1191
- // normal non-zero requests
1192
- }else if(slideIndex >= 0){
1193
- var requestEl = slideIndex * getMoveBy();
1194
- position = slider.children.eq(requestEl).position();
1195
- }
1196
-
1197
- /* If the position doesn't exist
1198
- * (e.g. if you destroy the slider on a next click),
1199
- * it doesn't throw an error.
1200
- */
1201
- if ("undefined" !== typeof(position)) {
1202
- var value = slider.settings.mode == 'horizontal' ? -(position.left - moveBy) : -position.top;
1203
- // plugin values to be animated
1204
- setPositionProperty(value, 'slide', slider.settings.speed);
1205
- }
1206
- }
1207
- }
1208
-
1209
- /**
1210
- * Transitions to the next slide in the show
1211
- */
1212
- el.goToNextSlide = function(){
1213
- // if infiniteLoop is false and last page is showing, disregard call
1214
- if (!slider.settings.infiniteLoop && slider.active.last) return;
1215
- var pagerIndex = parseInt(slider.active.index) + 1;
1216
- el.goToSlide(pagerIndex, 'next');
1217
- }
1218
-
1219
- /**
1220
- * Transitions to the prev slide in the show
1221
- */
1222
- el.goToPrevSlide = function(){
1223
- // if infiniteLoop is false and last page is showing, disregard call
1224
- if (!slider.settings.infiniteLoop && slider.active.index == 0) return;
1225
- var pagerIndex = parseInt(slider.active.index) - 1;
1226
- el.goToSlide(pagerIndex, 'prev');
1227
- }
1228
-
1229
- /**
1230
- * Starts the auto show
1231
- *
1232
- * @param preventControlUpdate (boolean)
1233
- * - if true, auto controls state will not be updated
1234
- */
1235
- el.startAuto = function(preventControlUpdate){
1236
- // if an interval already exists, disregard call
1237
- if(slider.interval) return;
1238
- // create an interval
1239
- slider.interval = setInterval(function(){
1240
- slider.settings.autoDirection == 'next' ? el.goToNextSlide() : el.goToPrevSlide();
1241
- }, slider.settings.pause);
1242
- // if auto controls are displayed and preventControlUpdate is not true
1243
- if (slider.settings.autoControls && preventControlUpdate != true) updateAutoControls('stop');
1244
- }
1245
-
1246
- /**
1247
- * Stops the auto show
1248
- *
1249
- * @param preventControlUpdate (boolean)
1250
- * - if true, auto controls state will not be updated
1251
- */
1252
- el.stopAuto = function(preventControlUpdate){
1253
- // if no interval exists, disregard call
1254
- if(!slider.interval) return;
1255
- // clear the interval
1256
- clearInterval(slider.interval);
1257
- slider.interval = null;
1258
- // if auto controls are displayed and preventControlUpdate is not true
1259
- if (slider.settings.autoControls && preventControlUpdate != true) updateAutoControls('start');
1260
- }
1261
-
1262
- /**
1263
- * Returns current slide index (zero-based)
1264
- */
1265
- el.getCurrentSlide = function(){
1266
- return slider.active.index;
1267
- }
1268
-
1269
- /**
1270
- * Returns current slide element
1271
- */
1272
- el.getCurrentSlideElement = function(){
1273
- return slider.children.eq(slider.active.index);
1274
- }
1275
-
1276
- /**
1277
- * Returns number of slides in show
1278
- */
1279
- el.getSlideCount = function(){
1280
- return slider.children.length;
1281
- }
1282
-
1283
- /**
1284
- * Update all dynamic slider elements
1285
- */
1286
- el.redrawSlider = function(){
1287
- // resize all children in ratio to new screen size
1288
- slider.children.add(el.find('.bx-clone')).width(getSlideWidth());
1289
- // adjust the height
1290
- slider.viewport.css('height', getViewportHeight());
1291
- // update the slide position
1292
- if(!slider.settings.ticker) setSlidePosition();
1293
- // if active.last was true before the screen resize, we want
1294
- // to keep it last no matter what screen size we end on
1295
- if (slider.active.last) slider.active.index = getPagerQty() - 1;
1296
- // if the active index (page) no longer exists due to the resize, simply set the index as last
1297
- if (slider.active.index >= getPagerQty()) slider.active.last = true;
1298
- // if a pager is being displayed and a custom pager is not being used, update it
1299
- if(slider.settings.pager && !slider.settings.pagerCustom){
1300
- populatePager();
1301
- updatePagerActive(slider.active.index);
1302
- }
1303
- }
1304
-
1305
- /**
1306
- * Destroy the current instance of the slider (revert everything back to original state)
1307
- */
1308
- el.destroySlider = function(){
1309
- // don't do anything if slider has already been destroyed
1310
- if(!slider.initialized) return;
1311
- slider.initialized = false;
1312
- $('.bx-clone', this).remove();
1313
- slider.children.each(function() {
1314
- $(this).data("origStyle") != undefined ? $(this).attr("style", $(this).data("origStyle")) : $(this).removeAttr('style');
1315
- });
1316
- $(this).data("origStyle") != undefined ? this.attr("style", $(this).data("origStyle")) : $(this).removeAttr('style');
1317
- $(this).unwrap().unwrap();
1318
- if(slider.controls.el) slider.controls.el.remove();
1319
- if(slider.controls.next) slider.controls.next.remove();
1320
- if(slider.controls.prev) slider.controls.prev.remove();
1321
- if(slider.pagerEl && slider.settings.controls) slider.pagerEl.remove();
1322
- $('.bx-caption', this).remove();
1323
- if(slider.controls.autoEl) slider.controls.autoEl.remove();
1324
- clearInterval(slider.interval);
1325
- if(slider.settings.responsive) $(window).unbind('resize', resizeWindow);
1326
- }
1327
-
1328
- /**
1329
- * Reload the slider (revert all DOM changes, and re-initialize)
1330
- */
1331
- el.reloadSlider = function(settings){
1332
- if (settings != undefined) options = settings;
1333
- el.destroySlider();
1334
- init();
1335
- }
1336
-
1337
- init();
1338
-
1339
- // returns the current jQuery object
1340
- return this;
1341
- }
1342
-
1343
- })(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/assets/js/jquery.bxslider.min.js DELETED
@@ -1,10 +0,0 @@
1
- /**
2
- * BxSlider v4.1.2 - Fully loaded, responsive content slider
3
- * http://bxslider.com
4
- *
5
- * Copyright 2014, Steven Wanderski - http://stevenwanderski.com - http://bxcreative.com
6
- * Written while drinking Belgian ales and listening to jazz
7
- *
8
- * Released under the MIT license - http://opensource.org/licenses/MIT
9
- */
10
- !function(t){var e={},s={mode:"horizontal",slideSelector:"",infiniteLoop:!0,hideControlOnEnd:!1,speed:500,easing:null,slideMargin:0,startSlide:0,randomStart:!1,captions:!1,ticker:!1,tickerHover:!1,adaptiveHeight:!1,adaptiveHeightSpeed:500,video:!1,useCSS:!0,preloadImages:"visible",responsive:!0,slideZIndex:50,touchEnabled:!0,swipeThreshold:50,oneToOneTouch:!0,preventDefaultSwipeX:!0,preventDefaultSwipeY:!1,pager:!0,pagerType:"full",pagerShortSeparator:" / ",pagerSelector:null,buildPager:null,pagerCustom:null,controls:!0,nextText:"Next",prevText:"Prev",nextSelector:null,prevSelector:null,autoControls:!1,startText:"Start",stopText:"Stop",autoControlsCombine:!1,autoControlsSelector:null,auto:!1,pause:4e3,autoStart:!0,autoDirection:"next",autoHover:!1,autoDelay:0,minSlides:1,maxSlides:1,moveSlides:0,slideWidth:0,onSliderLoad:function(){},onSlideBefore:function(){},onSlideAfter:function(){},onSlideNext:function(){},onSlidePrev:function(){},onSliderResize:function(){}};t.fn.bxSlider=function(n){if(0==this.length)return this;if(this.length>1)return this.each(function(){t(this).bxSlider(n)}),this;var o={},r=this;e.el=this;var a=t(window).width(),l=t(window).height(),d=function(){o.settings=t.extend({},s,n),o.settings.slideWidth=parseInt(o.settings.slideWidth),o.children=r.children(o.settings.slideSelector),o.children.length<o.settings.minSlides&&(o.settings.minSlides=o.children.length),o.children.length<o.settings.maxSlides&&(o.settings.maxSlides=o.children.length),o.settings.randomStart&&(o.settings.startSlide=Math.floor(Math.random()*o.children.length)),o.active={index:o.settings.startSlide},o.carousel=o.settings.minSlides>1||o.settings.maxSlides>1,o.carousel&&(o.settings.preloadImages="all"),o.minThreshold=o.settings.minSlides*o.settings.slideWidth+(o.settings.minSlides-1)*o.settings.slideMargin,o.maxThreshold=o.settings.maxSlides*o.settings.slideWidth+(o.settings.maxSlides-1)*o.settings.slideMargin,o.working=!1,o.controls={},o.interval=null,o.animProp="vertical"==o.settings.mode?"top":"left",o.usingCSS=o.settings.useCSS&&"fade"!=o.settings.mode&&function(){var t=document.createElement("div"),e=["WebkitPerspective","MozPerspective","OPerspective","msPerspective"];for(var i in e)if(void 0!==t.style[e[i]])return o.cssPrefix=e[i].replace("Perspective","").toLowerCase(),o.animProp="-"+o.cssPrefix+"-transform",!0;return!1}(),"vertical"==o.settings.mode&&(o.settings.maxSlides=o.settings.minSlides),r.data("origStyle",r.attr("style")),r.children(o.settings.slideSelector).each(function(){t(this).data("origStyle",t(this).attr("style"))}),c()},c=function(){r.wrap('<div class="bx-wrapper"><div class="bx-viewport"></div></div>'),o.viewport=r.parent(),o.loader=t('<div class="bx-loading" />'),o.viewport.prepend(o.loader),r.css({width:"horizontal"==o.settings.mode?100*o.children.length+215+"%":"auto",position:"relative"}),o.usingCSS&&o.settings.easing?r.css("-"+o.cssPrefix+"-transition-timing-function",o.settings.easing):o.settings.easing||(o.settings.easing="swing"),f(),o.viewport.css({width:"100%",overflow:"hidden",position:"relative"}),o.viewport.parent().css({maxWidth:p()}),o.settings.pager||o.viewport.parent().css({margin:"0 auto 0px"}),o.children.css({"float":"horizontal"==o.settings.mode?"left":"none",listStyle:"none",position:"relative"}),o.children.css("width",u()),"horizontal"==o.settings.mode&&o.settings.slideMargin>0&&o.children.css("marginRight",o.settings.slideMargin),"vertical"==o.settings.mode&&o.settings.slideMargin>0&&o.children.css("marginBottom",o.settings.slideMargin),"fade"==o.settings.mode&&(o.children.css({position:"absolute",zIndex:0,display:"none"}),o.children.eq(o.settings.startSlide).css({zIndex:o.settings.slideZIndex,display:"block"})),o.controls.el=t('<div class="bx-controls" />'),o.settings.captions&&P(),o.active.last=o.settings.startSlide==x()-1,o.settings.video&&r.fitVids();var e=o.children.eq(o.settings.startSlide);"all"==o.settings.preloadImages&&(e=o.children),o.settings.ticker?o.settings.pager=!1:(o.settings.pager&&T(),o.settings.controls&&C(),o.settings.auto&&o.settings.autoControls&&E(),(o.settings.controls||o.settings.autoControls||o.settings.pager)&&o.viewport.after(o.controls.el)),g(e,h)},g=function(e,i){var s=e.find("img, iframe").length;if(0==s)return i(),void 0;var n=0;e.find("img, iframe").each(function(){t(this).one("load",function(){++n==s&&i()}).each(function(){this.complete&&t(this).load()})})},h=function(){if(o.settings.infiniteLoop&&"fade"!=o.settings.mode&&!o.settings.ticker){var e="vertical"==o.settings.mode?o.settings.minSlides:o.settings.maxSlides,i=o.children.slice(0,e).clone().addClass("bx-clone"),s=o.children.slice(-e).clone().addClass("bx-clone");r.append(i).prepend(s)}o.loader.remove(),S(),"vertical"==o.settings.mode&&(o.settings.adaptiveHeight=!0),o.viewport.height(v()),r.redrawSlider(),o.settings.onSliderLoad(o.active.index),o.initialized=!0,o.settings.responsive&&t(window).bind("resize",Z),o.settings.auto&&o.settings.autoStart&&H(),o.settings.ticker&&L(),o.settings.pager&&q(o.settings.startSlide),o.settings.controls&&W(),o.settings.touchEnabled&&!o.settings.ticker&&O()},v=function(){var e=0,s=t();if("vertical"==o.settings.mode||o.settings.adaptiveHeight)if(o.carousel){var n=1==o.settings.moveSlides?o.active.index:o.active.index*m();for(s=o.children.eq(n),i=1;i<=o.settings.maxSlides-1;i++)s=n+i>=o.children.length?s.add(o.children.eq(i-1)):s.add(o.children.eq(n+i))}else s=o.children.eq(o.active.index);else s=o.children;return"vertical"==o.settings.mode?(s.each(function(){e+=t(this).outerHeight()}),o.settings.slideMargin>0&&(e+=o.settings.slideMargin*(o.settings.minSlides-1))):e=Math.max.apply(Math,s.map(function(){return t(this).outerHeight(!1)}).get()),e},p=function(){var t="100%";return o.settings.slideWidth>0&&(t="horizontal"==o.settings.mode?o.settings.maxSlides*o.settings.slideWidth+(o.settings.maxSlides-1)*o.settings.slideMargin:o.settings.slideWidth),t},u=function(){var t=o.settings.slideWidth,e=o.viewport.width();return 0==o.settings.slideWidth||o.settings.slideWidth>e&&!o.carousel||"vertical"==o.settings.mode?t=e:o.settings.maxSlides>1&&"horizontal"==o.settings.mode&&(e>o.maxThreshold||e<o.minThreshold&&(t=(e-o.settings.slideMargin*(o.settings.minSlides-1))/o.settings.minSlides)),t},f=function(){var t=1;if("horizontal"==o.settings.mode&&o.settings.slideWidth>0)if(o.viewport.width()<o.minThreshold)t=o.settings.minSlides;else if(o.viewport.width()>o.maxThreshold)t=o.settings.maxSlides;else{var e=o.children.first().width();t=Math.floor(o.viewport.width()/e)}else"vertical"==o.settings.mode&&(t=o.settings.minSlides);return t},x=function(){var t=0;if(o.settings.moveSlides>0)if(o.settings.infiniteLoop)t=o.children.length/m();else for(var e=0,i=0;e<o.children.length;)++t,e=i+f(),i+=o.settings.moveSlides<=f()?o.settings.moveSlides:f();else t=Math.ceil(o.children.length/f());return t},m=function(){return o.settings.moveSlides>0&&o.settings.moveSlides<=f()?o.settings.moveSlides:f()},S=function(){if(o.children.length>o.settings.maxSlides&&o.active.last&&!o.settings.infiniteLoop){if("horizontal"==o.settings.mode){var t=o.children.last(),e=t.position();b(-(e.left-(o.viewport.width()-t.width())),"reset",0)}else if("vertical"==o.settings.mode){var i=o.children.length-o.settings.minSlides,e=o.children.eq(i).position();b(-e.top,"reset",0)}}else{var e=o.children.eq(o.active.index*m()).position();o.active.index==x()-1&&(o.active.last=!0),void 0!=e&&("horizontal"==o.settings.mode?b(-e.left,"reset",0):"vertical"==o.settings.mode&&b(-e.top,"reset",0))}},b=function(t,e,i,s){if(o.usingCSS){var n="vertical"==o.settings.mode?"translate3d(0, "+t+"px, 0)":"translate3d("+t+"px, 0, 0)";r.css("-"+o.cssPrefix+"-transition-duration",i/1e3+"s"),"slide"==e?(r.css(o.animProp,n),r.bind("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd",function(){r.unbind("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd"),D()})):"reset"==e?r.css(o.animProp,n):"ticker"==e&&(r.css("-"+o.cssPrefix+"-transition-timing-function","linear"),r.css(o.animProp,n),r.bind("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd",function(){r.unbind("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd"),b(s.resetValue,"reset",0),N()}))}else{var a={};a[o.animProp]=t,"slide"==e?r.animate(a,i,o.settings.easing,function(){D()}):"reset"==e?r.css(o.animProp,t):"ticker"==e&&r.animate(a,speed,"linear",function(){b(s.resetValue,"reset",0),N()})}},w=function(){for(var e="",i=x(),s=0;i>s;s++){var n="";o.settings.buildPager&&t.isFunction(o.settings.buildPager)?(n=o.settings.buildPager(s),o.pagerEl.addClass("bx-custom-pager")):(n=s+1,o.pagerEl.addClass("bx-default-pager")),e+='<div class="bx-pager-item"><a href="" data-slide-index="'+s+'" class="bx-pager-link">'+n+"</a></div>"}o.pagerEl.html(e)},T=function(){o.settings.pagerCustom?o.pagerEl=t(o.settings.pagerCustom):(o.pagerEl=t('<div class="bx-pager" />'),o.settings.pagerSelector?t(o.settings.pagerSelector).html(o.pagerEl):o.controls.el.addClass("bx-has-pager").append(o.pagerEl),w()),o.pagerEl.on("click","a",I)},C=function(){o.controls.next=t('<a class="bx-next" href="">'+o.settings.nextText+"</a>"),o.controls.prev=t('<a class="bx-prev" href="">'+o.settings.prevText+"</a>"),o.controls.next.bind("click",y),o.controls.prev.bind("click",z),o.settings.nextSelector&&t(o.settings.nextSelector).append(o.controls.next),o.settings.prevSelector&&t(o.settings.prevSelector).append(o.controls.prev),o.settings.nextSelector||o.settings.prevSelector||(o.controls.directionEl=t('<div class="bx-controls-direction" />'),o.controls.directionEl.append(o.controls.prev).append(o.controls.next),o.controls.el.addClass("bx-has-controls-direction").append(o.controls.directionEl))},E=function(){o.controls.start=t('<div class="bx-controls-auto-item"><a class="bx-start" href="">'+o.settings.startText+"</a></div>"),o.controls.stop=t('<div class="bx-controls-auto-item"><a class="bx-stop" href="">'+o.settings.stopText+"</a></div>"),o.controls.autoEl=t('<div class="bx-controls-auto" />'),o.controls.autoEl.on("click",".bx-start",k),o.controls.autoEl.on("click",".bx-stop",M),o.settings.autoControlsCombine?o.controls.autoEl.append(o.controls.start):o.controls.autoEl.append(o.controls.start).append(o.controls.stop),o.settings.autoControlsSelector?t(o.settings.autoControlsSelector).html(o.controls.autoEl):o.controls.el.addClass("bx-has-controls-auto").append(o.controls.autoEl),A(o.settings.autoStart?"stop":"start")},P=function(){o.children.each(function(){var e=t(this).find("img:first").attr("title");void 0!=e&&(""+e).length&&t(this).append('<div class="bx-caption"><span>'+e+"</span></div>")})},y=function(t){o.settings.auto&&r.stopAuto(),r.goToNextSlide(),t.preventDefault()},z=function(t){o.settings.auto&&r.stopAuto(),r.goToPrevSlide(),t.preventDefault()},k=function(t){r.startAuto(),t.preventDefault()},M=function(t){r.stopAuto(),t.preventDefault()},I=function(e){o.settings.auto&&r.stopAuto();var i=t(e.currentTarget),s=parseInt(i.attr("data-slide-index"));s!=o.active.index&&r.goToSlide(s),e.preventDefault()},q=function(e){var i=o.children.length;return"short"==o.settings.pagerType?(o.settings.maxSlides>1&&(i=Math.ceil(o.children.length/o.settings.maxSlides)),o.pagerEl.html(e+1+o.settings.pagerShortSeparator+i),void 0):(o.pagerEl.find("a").removeClass("active"),o.pagerEl.each(function(i,s){t(s).find("a").eq(e).addClass("active")}),void 0)},D=function(){if(o.settings.infiniteLoop){var t="";0==o.active.index?t=o.children.eq(0).position():o.active.index==x()-1&&o.carousel?t=o.children.eq((x()-1)*m()).position():o.active.index==o.children.length-1&&(t=o.children.eq(o.children.length-1).position()),t&&("horizontal"==o.settings.mode?b(-t.left,"reset",0):"vertical"==o.settings.mode&&b(-t.top,"reset",0))}o.working=!1,o.settings.onSlideAfter(o.children.eq(o.active.index),o.oldIndex,o.active.index)},A=function(t){o.settings.autoControlsCombine?o.controls.autoEl.html(o.controls[t]):(o.controls.autoEl.find("a").removeClass("active"),o.controls.autoEl.find("a:not(.bx-"+t+")").addClass("active"))},W=function(){1==x()?(o.controls.prev.addClass("disabled"),o.controls.next.addClass("disabled")):!o.settings.infiniteLoop&&o.settings.hideControlOnEnd&&(0==o.active.index?(o.controls.prev.addClass("disabled"),o.controls.next.removeClass("disabled")):o.active.index==x()-1?(o.controls.next.addClass("disabled"),o.controls.prev.removeClass("disabled")):(o.controls.prev.removeClass("disabled"),o.controls.next.removeClass("disabled")))},H=function(){o.settings.autoDelay>0?setTimeout(r.startAuto,o.settings.autoDelay):r.startAuto(),o.settings.autoHover&&r.hover(function(){o.interval&&(r.stopAuto(!0),o.autoPaused=!0)},function(){o.autoPaused&&(r.startAuto(!0),o.autoPaused=null)})},L=function(){var e=0;if("next"==o.settings.autoDirection)r.append(o.children.clone().addClass("bx-clone"));else{r.prepend(o.children.clone().addClass("bx-clone"));var i=o.children.first().position();e="horizontal"==o.settings.mode?-i.left:-i.top}b(e,"reset",0),o.settings.pager=!1,o.settings.controls=!1,o.settings.autoControls=!1,o.settings.tickerHover&&!o.usingCSS&&o.viewport.hover(function(){r.stop()},function(){var e=0;o.children.each(function(){e+="horizontal"==o.settings.mode?t(this).outerWidth(!0):t(this).outerHeight(!0)});var i=o.settings.speed/e,s="horizontal"==o.settings.mode?"left":"top",n=i*(e-Math.abs(parseInt(r.css(s))));N(n)}),N()},N=function(t){speed=t?t:o.settings.speed;var e={left:0,top:0},i={left:0,top:0};"next"==o.settings.autoDirection?e=r.find(".bx-clone").first().position():i=o.children.first().position();var s="horizontal"==o.settings.mode?-e.left:-e.top,n="horizontal"==o.settings.mode?-i.left:-i.top,a={resetValue:n};b(s,"ticker",speed,a)},O=function(){o.touch={start:{x:0,y:0},end:{x:0,y:0}},o.viewport.bind("touchstart",X)},X=function(t){if(o.working)t.preventDefault();else{o.touch.originalPos=r.position();var e=t.originalEvent;o.touch.start.x=e.changedTouches[0].pageX,o.touch.start.y=e.changedTouches[0].pageY,o.viewport.bind("touchmove",Y),o.viewport.bind("touchend",V)}},Y=function(t){var e=t.originalEvent,i=Math.abs(e.changedTouches[0].pageX-o.touch.start.x),s=Math.abs(e.changedTouches[0].pageY-o.touch.start.y);if(3*i>s&&o.settings.preventDefaultSwipeX?t.preventDefault():3*s>i&&o.settings.preventDefaultSwipeY&&t.preventDefault(),"fade"!=o.settings.mode&&o.settings.oneToOneTouch){var n=0;if("horizontal"==o.settings.mode){var r=e.changedTouches[0].pageX-o.touch.start.x;n=o.touch.originalPos.left+r}else{var r=e.changedTouches[0].pageY-o.touch.start.y;n=o.touch.originalPos.top+r}b(n,"reset",0)}},V=function(t){o.viewport.unbind("touchmove",Y);var e=t.originalEvent,i=0;if(o.touch.end.x=e.changedTouches[0].pageX,o.touch.end.y=e.changedTouches[0].pageY,"fade"==o.settings.mode){var s=Math.abs(o.touch.start.x-o.touch.end.x);s>=o.settings.swipeThreshold&&(o.touch.start.x>o.touch.end.x?r.goToNextSlide():r.goToPrevSlide(),r.stopAuto())}else{var s=0;"horizontal"==o.settings.mode?(s=o.touch.end.x-o.touch.start.x,i=o.touch.originalPos.left):(s=o.touch.end.y-o.touch.start.y,i=o.touch.originalPos.top),!o.settings.infiniteLoop&&(0==o.active.index&&s>0||o.active.last&&0>s)?b(i,"reset",200):Math.abs(s)>=o.settings.swipeThreshold?(0>s?r.goToNextSlide():r.goToPrevSlide(),r.stopAuto()):b(i,"reset",200)}o.viewport.unbind("touchend",V)},Z=function(){var e=t(window).width(),i=t(window).height();(a!=e||l!=i)&&(a=e,l=i,r.redrawSlider(),o.settings.onSliderResize.call(r,o.active.index))};return r.goToSlide=function(e,i){if(!o.working&&o.active.index!=e)if(o.working=!0,o.oldIndex=o.active.index,o.active.index=0>e?x()-1:e>=x()?0:e,o.settings.onSlideBefore(o.children.eq(o.active.index),o.oldIndex,o.active.index),"next"==i?o.settings.onSlideNext(o.children.eq(o.active.index),o.oldIndex,o.active.index):"prev"==i&&o.settings.onSlidePrev(o.children.eq(o.active.index),o.oldIndex,o.active.index),o.active.last=o.active.index>=x()-1,o.settings.pager&&q(o.active.index),o.settings.controls&&W(),"fade"==o.settings.mode)o.settings.adaptiveHeight&&o.viewport.height()!=v()&&o.viewport.animate({height:v()},o.settings.adaptiveHeightSpeed),o.children.filter(":visible").fadeOut(o.settings.speed).css({zIndex:0}),o.children.eq(o.active.index).css("zIndex",o.settings.slideZIndex+1).fadeIn(o.settings.speed,function(){t(this).css("zIndex",o.settings.slideZIndex),D()});else{o.settings.adaptiveHeight&&o.viewport.height()!=v()&&o.viewport.animate({height:v()},o.settings.adaptiveHeightSpeed);var s=0,n={left:0,top:0};if(!o.settings.infiniteLoop&&o.carousel&&o.active.last)if("horizontal"==o.settings.mode){var a=o.children.eq(o.children.length-1);n=a.position(),s=o.viewport.width()-a.outerWidth()}else{var l=o.children.length-o.settings.minSlides;n=o.children.eq(l).position()}else if(o.carousel&&o.active.last&&"prev"==i){var d=1==o.settings.moveSlides?o.settings.maxSlides-m():(x()-1)*m()-(o.children.length-o.settings.maxSlides),a=r.children(".bx-clone").eq(d);n=a.position()}else if("next"==i&&0==o.active.index)n=r.find("> .bx-clone").eq(o.settings.maxSlides).position(),o.active.last=!1;else if(e>=0){var c=e*m();n=o.children.eq(c).position()}if("undefined"!=typeof n){var g="horizontal"==o.settings.mode?-(n.left-s):-n.top;b(g,"slide",o.settings.speed)}}},r.goToNextSlide=function(){if(o.settings.infiniteLoop||!o.active.last){var t=parseInt(o.active.index)+1;r.goToSlide(t,"next")}},r.goToPrevSlide=function(){if(o.settings.infiniteLoop||0!=o.active.index){var t=parseInt(o.active.index)-1;r.goToSlide(t,"prev")}},r.startAuto=function(t){o.interval||(o.interval=setInterval(function(){"next"==o.settings.autoDirection?r.goToNextSlide():r.goToPrevSlide()},o.settings.pause),o.settings.autoControls&&1!=t&&A("stop"))},r.stopAuto=function(t){o.interval&&(clearInterval(o.interval),o.interval=null,o.settings.autoControls&&1!=t&&A("start"))},r.getCurrentSlide=function(){return o.active.index},r.getCurrentSlideElement=function(){return o.children.eq(o.active.index)},r.getSlideCount=function(){return o.children.length},r.redrawSlider=function(){o.children.add(r.find(".bx-clone")).outerWidth(u()),o.viewport.css("height",v()),o.settings.ticker||S(),o.active.last&&(o.active.index=x()-1),o.active.index>=x()&&(o.active.last=!0),o.settings.pager&&!o.settings.pagerCustom&&(w(),q(o.active.index))},r.destroySlider=function(){o.initialized&&(o.initialized=!1,t(".bx-clone",this).remove(),o.children.each(function(){void 0!=t(this).data("origStyle")?t(this).attr("style",t(this).data("origStyle")):t(this).removeAttr("style")}),void 0!=t(this).data("origStyle")?this.attr("style",t(this).data("origStyle")):t(this).removeAttr("style"),t(this).unwrap().unwrap(),o.controls.el&&o.controls.el.remove(),o.controls.next&&o.controls.next.remove(),o.controls.prev&&o.controls.prev.remove(),o.pagerEl&&o.settings.controls&&o.pagerEl.remove(),t(".bx-caption",this).remove(),o.controls.autoEl&&o.controls.autoEl.remove(),clearInterval(o.interval),o.settings.responsive&&t(window).unbind("resize",Z))},r.reloadSlider=function(t){void 0!=t&&(n=t),r.destroySlider(),d()},d(),this}}(jQuery);
 
 
 
 
 
 
 
 
 
 
trunk/assets/js/jquery.easing.1.3.js DELETED
@@ -1,205 +0,0 @@
1
- /*
2
- * jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/
3
- *
4
- * Uses the built in easing capabilities added In jQuery 1.1
5
- * to offer multiple easing options
6
- *
7
- * TERMS OF USE - jQuery Easing
8
- *
9
- * Open source under the BSD License.
10
- *
11
- * Copyright © 2008 George McGinley Smith
12
- * All rights reserved.
13
- *
14
- * Redistribution and use in source and binary forms, with or without modification,
15
- * are permitted provided that the following conditions are met:
16
- *
17
- * Redistributions of source code must retain the above copyright notice, this list of
18
- * conditions and the following disclaimer.
19
- * Redistributions in binary form must reproduce the above copyright notice, this list
20
- * of conditions and the following disclaimer in the documentation and/or other materials
21
- * provided with the distribution.
22
- *
23
- * Neither the name of the author nor the names of contributors may be used to endorse
24
- * or promote products derived from this software without specific prior written permission.
25
- *
26
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
27
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
28
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
29
- * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
30
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
31
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
32
- * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
33
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
34
- * OF THE POSSIBILITY OF SUCH DAMAGE.
35
- *
36
- */
37
-
38
- // t: current time, b: begInnIng value, c: change In value, d: duration
39
- jQuery.easing['jswing'] = jQuery.easing['swing'];
40
-
41
- jQuery.extend( jQuery.easing,
42
- {
43
- def: 'easeOutQuad',
44
- swing: function (x, t, b, c, d) {
45
- //alert(jQuery.easing.default);
46
- return jQuery.easing[jQuery.easing.def](x, t, b, c, d);
47
- },
48
- easeInQuad: function (x, t, b, c, d) {
49
- return c*(t/=d)*t + b;
50
- },
51
- easeOutQuad: function (x, t, b, c, d) {
52
- return -c *(t/=d)*(t-2) + b;
53
- },
54
- easeInOutQuad: function (x, t, b, c, d) {
55
- if ((t/=d/2) < 1) return c/2*t*t + b;
56
- return -c/2 * ((--t)*(t-2) - 1) + b;
57
- },
58
- easeInCubic: function (x, t, b, c, d) {
59
- return c*(t/=d)*t*t + b;
60
- },
61
- easeOutCubic: function (x, t, b, c, d) {
62
- return c*((t=t/d-1)*t*t + 1) + b;
63
- },
64
- easeInOutCubic: function (x, t, b, c, d) {
65
- if ((t/=d/2) < 1) return c/2*t*t*t + b;
66
- return c/2*((t-=2)*t*t + 2) + b;
67
- },
68
- easeInQuart: function (x, t, b, c, d) {
69
- return c*(t/=d)*t*t*t + b;
70
- },
71
- easeOutQuart: function (x, t, b, c, d) {
72
- return -c * ((t=t/d-1)*t*t*t - 1) + b;
73
- },
74
- easeInOutQuart: function (x, t, b, c, d) {
75
- if ((t/=d/2) < 1) return c/2*t*t*t*t + b;
76
- return -c/2 * ((t-=2)*t*t*t - 2) + b;
77
- },
78
- easeInQuint: function (x, t, b, c, d) {
79
- return c*(t/=d)*t*t*t*t + b;
80
- },
81
- easeOutQuint: function (x, t, b, c, d) {
82
- return c*((t=t/d-1)*t*t*t*t + 1) + b;
83
- },
84
- easeInOutQuint: function (x, t, b, c, d) {
85
- if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b;
86
- return c/2*((t-=2)*t*t*t*t + 2) + b;
87
- },
88
- easeInSine: function (x, t, b, c, d) {
89
- return -c * Math.cos(t/d * (Math.PI/2)) + c + b;
90
- },
91
- easeOutSine: function (x, t, b, c, d) {
92
- return c * Math.sin(t/d * (Math.PI/2)) + b;
93
- },
94
- easeInOutSine: function (x, t, b, c, d) {
95
- return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b;
96
- },
97
- easeInExpo: function (x, t, b, c, d) {
98
- return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b;
99
- },
100
- easeOutExpo: function (x, t, b, c, d) {
101
- return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b;
102
- },
103
- easeInOutExpo: function (x, t, b, c, d) {
104
- if (t==0) return b;
105
- if (t==d) return b+c;
106
- if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b;
107
- return c/2 * (-Math.pow(2, -10 * --t) + 2) + b;
108
- },
109
- easeInCirc: function (x, t, b, c, d) {
110
- return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b;
111
- },
112
- easeOutCirc: function (x, t, b, c, d) {
113
- return c * Math.sqrt(1 - (t=t/d-1)*t) + b;
114
- },
115
- easeInOutCirc: function (x, t, b, c, d) {
116
- if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b;
117
- return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b;
118
- },
119
- easeInElastic: function (x, t, b, c, d) {
120
- var s=1.70158;var p=0;var a=c;
121
- if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3;
122
- if (a < Math.abs(c)) { a=c; var s=p/4; }
123
- else var s = p/(2*Math.PI) * Math.asin (c/a);
124
- return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
125
- },
126
- easeOutElastic: function (x, t, b, c, d) {
127
- var s=1.70158;var p=0;var a=c;
128
- if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3;
129
- if (a < Math.abs(c)) { a=c; var s=p/4; }
130
- else var s = p/(2*Math.PI) * Math.asin (c/a);
131
- return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b;
132
- },
133
- easeInOutElastic: function (x, t, b, c, d) {
134
- var s=1.70158;var p=0;var a=c;
135
- if (t==0) return b; if ((t/=d/2)==2) return b+c; if (!p) p=d*(.3*1.5);
136
- if (a < Math.abs(c)) { a=c; var s=p/4; }
137
- else var s = p/(2*Math.PI) * Math.asin (c/a);
138
- if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
139
- return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b;
140
- },
141
- easeInBack: function (x, t, b, c, d, s) {
142
- if (s == undefined) s = 1.70158;
143
- return c*(t/=d)*t*((s+1)*t - s) + b;
144
- },
145
- easeOutBack: function (x, t, b, c, d, s) {
146
- if (s == undefined) s = 1.70158;
147
- return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;
148
- },
149
- easeInOutBack: function (x, t, b, c, d, s) {
150
- if (s == undefined) s = 1.70158;
151
- if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;
152
- return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;
153
- },
154
- easeInBounce: function (x, t, b, c, d) {
155
- return c - jQuery.easing.easeOutBounce (x, d-t, 0, c, d) + b;
156
- },
157
- easeOutBounce: function (x, t, b, c, d) {
158
- if ((t/=d) < (1/2.75)) {
159
- return c*(7.5625*t*t) + b;
160
- } else if (t < (2/2.75)) {
161
- return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;
162
- } else if (t < (2.5/2.75)) {
163
- return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;
164
- } else {
165
- return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;
166
- }
167
- },
168
- easeInOutBounce: function (x, t, b, c, d) {
169
- if (t < d/2) return jQuery.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b;
170
- return jQuery.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b;
171
- }
172
- });
173
-
174
- /*
175
- *
176
- * TERMS OF USE - EASING EQUATIONS
177
- *
178
- * Open source under the BSD License.
179
- *
180
- * Copyright © 2001 Robert Penner
181
- * All rights reserved.
182
- *
183
- * Redistribution and use in source and binary forms, with or without modification,
184
- * are permitted provided that the following conditions are met:
185
- *
186
- * Redistributions of source code must retain the above copyright notice, this list of
187
- * conditions and the following disclaimer.
188
- * Redistributions in binary form must reproduce the above copyright notice, this list
189
- * of conditions and the following disclaimer in the documentation and/or other materials
190
- * provided with the distribution.
191
- *
192
- * Neither the name of the author nor the names of contributors may be used to endorse
193
- * or promote products derived from this software without specific prior written permission.
194
- *
195
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
196
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
197
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
198
- * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
199
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
200
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
201
- * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
202
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
203
- * OF THE POSSIBILITY OF SUCH DAMAGE.
204
- *
205
- */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/assets/js/jquery.fitvids.js DELETED
@@ -1,80 +0,0 @@
1
- /*global jQuery */
2
- /*jshint multistr:true browser:true */
3
- /*!
4
- * FitVids 1.0
5
- *
6
- * Copyright 2011, Chris Coyier - http://css-tricks.com + Dave Rupert - http://daverupert.com
7
- * Credit to Thierry Koblentz - http://www.alistapart.com/articles/creating-intrinsic-ratios-for-video/
8
- * Released under the WTFPL license - http://sam.zoy.org/wtfpl/
9
- *
10
- * Date: Thu Sept 01 18:00:00 2011 -0500
11
- */
12
-
13
- (function( $ ){
14
-
15
- "use strict";
16
-
17
- $.fn.fitVids = function( options ) {
18
- var settings = {
19
- customSelector: null
20
- };
21
-
22
- var div = document.createElement('div'),
23
- ref = document.getElementsByTagName('base')[0] || document.getElementsByTagName('script')[0];
24
-
25
- div.className = 'fit-vids-style';
26
- div.innerHTML = '&shy;<style> \
27
- .fluid-width-video-wrapper { \
28
- width: 100%; \
29
- position: relative; \
30
- padding: 0; \
31
- } \
32
- \
33
- .fluid-width-video-wrapper iframe, \
34
- .fluid-width-video-wrapper object, \
35
- .fluid-width-video-wrapper embed { \
36
- position: absolute; \
37
- top: 0; \
38
- left: 0; \
39
- width: 100%; \
40
- height: 100%; \
41
- } \
42
- </style>';
43
-
44
- ref.parentNode.insertBefore(div,ref);
45
-
46
- if ( options ) {
47
- $.extend( settings, options );
48
- }
49
-
50
- return this.each(function(){
51
- var selectors = [
52
- "iframe[src*='player.vimeo.com']",
53
- "iframe[src*='www.youtube.com']",
54
- "iframe[src*='www.kickstarter.com']",
55
- "object",
56
- "embed"
57
- ];
58
-
59
- if (settings.customSelector) {
60
- selectors.push(settings.customSelector);
61
- }
62
-
63
- var $allVideos = $(this).find(selectors.join(','));
64
-
65
- $allVideos.each(function(){
66
- var $this = $(this);
67
- if (this.tagName.toLowerCase() === 'embed' && $this.parent('object').length || $this.parent('.fluid-width-video-wrapper').length) { return; }
68
- var height = ( this.tagName.toLowerCase() === 'object' || ($this.attr('height') && !isNaN(parseInt($this.attr('height'), 10))) ) ? parseInt($this.attr('height'), 10) : $this.height(),
69
- width = !isNaN(parseInt($this.attr('width'), 10)) ? parseInt($this.attr('width'), 10) : $this.width(),
70
- aspectRatio = height / width;
71
- if(!$this.attr('id')){
72
- var videoID = 'fitvid' + Math.floor(Math.random()*999999);
73
- $this.attr('id', videoID);
74
- }
75
- $this.wrap('<div class="fluid-width-video-wrapper"></div>').parent('.fluid-width-video-wrapper').css('padding-top', (aspectRatio * 100)+"%");
76
- $this.removeAttr('height').removeAttr('width');
77
- });
78
- });
79
- };
80
- })( jQuery );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/includes/class-testimonials-widget-archives-widget.php DELETED
@@ -1,82 +0,0 @@
1
- <?php
2
- /**
3
- Testimonials Widget
4
- Copyright (C) 2014 Michael Cannon
5
-
6
- This program is free software; you can redistribute it and/or modify
7
- it under the terms of the GNU General Public License as published by
8
- the Free Software Foundation; either version 2 of the License, or
9
- (at your option) any later version.
10
-
11
- This program is distributed in the hope that it will be useful,
12
- but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
- GNU General Public License for more details.
15
-
16
- You should have received a copy of the GNU General Public License along
17
- with this program; if not, write to the Free Software Foundation, Inc.,
18
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19
- */
20
-
21
- require_once AIHR_DIR_INC . 'class-aihrus-widget.php';
22
-
23
- if ( class_exists( 'Testimonials_Widget_Archives_Widget' ) ) {
24
- return;
25
- }
26
-
27
-
28
- class Testimonials_Widget_Archives_Widget extends Aihrus_Widget {
29
- const ID = 'tw_archives_widget';
30
-
31
- public static $title;
32
-
33
-
34
- public function __construct() {
35
- $classname = __CLASS__;
36
- $description = esc_html__( 'A monthly archive of your site\'s testimonials.', 'testimonials-widget' );
37
- $id_base = self::ID;
38
- self::$title = esc_html__( 'Testimonials Archives', 'testimonials-widget' );
39
-
40
- parent::__construct( $classname, $description, $id_base, self::$title );
41
- }
42
-
43
-
44
- /**
45
- * @SuppressWarnings(PHPMD.UnusedFormalParameter)
46
- */
47
- public static function get_content( $instance = null, $widget_number = null ) {
48
- return Testimonials_Widget::testimonials_archives( $instance, $widget_number );
49
- }
50
-
51
-
52
- public static function form_parts( $instance = null, $number = null ) {
53
- $form_parts = parent::form_parts( $instance, $number );
54
-
55
- $form_parts['title']['std'] = self::$title;
56
-
57
- $form_parts['dropdown'] = array(
58
- 'title' => esc_html__( 'Display as dropdown', 'testimonials-widget' ),
59
- 'type' => 'checkbox',
60
- 'validate' => 'is_true',
61
- 'std' => 0,
62
- );
63
-
64
- $form_parts['count'] = array(
65
- 'title' => esc_html__( 'Show post counts', 'testimonials-widget' ),
66
- 'type' => 'checkbox',
67
- 'validate' => 'is_true',
68
- 'std' => 0,
69
- );
70
-
71
- foreach ( $form_parts as $id => $parts ) {
72
- $form_parts[ $id ] = wp_parse_args( $parts, self::$default );
73
- }
74
-
75
- $form_parts = apply_filters( 'tw_archives_widget_options', $form_parts );
76
-
77
- return $form_parts;
78
- }
79
- }
80
-
81
-
82
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/includes/class-testimonials-widget-categories-widget.php DELETED
@@ -1,92 +0,0 @@
1
- <?php
2
- /**
3
- Testimonials Widget
4
- Copyright (C) 2014 Michael Cannon
5
-
6
- This program is free software; you can redistribute it and/or modify
7
- it under the terms of the GNU General Public License as published by
8
- the Free Software Foundation; either version 2 of the License, or
9
- (at your option) any later version.
10
-
11
- This program is distributed in the hope that it will be useful,
12
- but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
- GNU General Public License for more details.
15
-
16
- You should have received a copy of the GNU General Public License along
17
- with this program; if not, write to the Free Software Foundation, Inc.,
18
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19
- */
20
-
21
- require_once AIHR_DIR_INC . 'class-aihrus-widget.php';
22
-
23
- if ( class_exists( 'Testimonials_Widget_Categories_Widget' ) ) {
24
- return;
25
- }
26
-
27
-
28
- class Testimonials_Widget_Categories_Widget extends Aihrus_Widget {
29
- const ID = 'tw_categories_widget';
30
-
31
- public static $title;
32
-
33
-
34
- public function __construct() {
35
- $classname = __CLASS__;
36
- $description = esc_html__( 'A list or dropdown of testimonials\' categories.', 'testimonials-widget' );
37
- $id_base = self::ID;
38
- self::$title = esc_html__( 'Testimonials Categories', 'testimonials-widget' );
39
-
40
- parent::__construct( $classname, $description, $id_base, self::$title );
41
- }
42
-
43
-
44
- /**
45
- * @SuppressWarnings(PHPMD.UnusedFormalParameter)
46
- */
47
- public static function get_content( $instance = null, $widget_number = null ) {
48
- return Testimonials_Widget::testimonials_categories( $instance, $widget_number );
49
- }
50
-
51
-
52
- /**
53
- * @SuppressWarnings(PHPMD.UnusedFormalParameter)
54
- */
55
- public static function form_parts( $instance = null, $number = null ) {
56
- $form_parts = parent::form_parts( $instance, $number );
57
-
58
- $form_parts['title']['std'] = self::$title;
59
-
60
- $form_parts['dropdown'] = array(
61
- 'title' => esc_html__( 'Display as dropdown', 'testimonials-widget' ),
62
- 'type' => 'checkbox',
63
- 'validate' => 'is_true',
64
- 'std' => 0,
65
- );
66
-
67
- $form_parts['count'] = array(
68
- 'title' => esc_html__( 'Show post counts', 'testimonials-widget' ),
69
- 'type' => 'checkbox',
70
- 'validate' => 'is_true',
71
- 'std' => 0,
72
- );
73
-
74
- $form_parts['hierarchical'] = array(
75
- 'title' => esc_html__( 'Show hierarchy', 'testimonials-widget' ),
76
- 'type' => 'checkbox',
77
- 'validate' => 'is_true',
78
- 'std' => 0,
79
- );
80
-
81
- foreach ( $form_parts as $id => $parts ) {
82
- $form_parts[ $id ] = wp_parse_args( $parts, self::$default );
83
- }
84
-
85
- $form_parts = apply_filters( 'tw_categories_widget_options', $form_parts );
86
-
87
- return $form_parts;
88
- }
89
- }
90
-
91
-
92
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/includes/class-testimonials-widget-recent-testimonials-widget.php DELETED
@@ -1,85 +0,0 @@
1
- <?php
2
- /**
3
- Testimonials Widget
4
- Copyright (C) 2014 Michael Cannon
5
-
6
- This program is free software; you can redistribute it and/or modify
7
- it under the terms of the GNU General Public License as published by
8
- the Free Software Foundation; either version 2 of the License, or
9
- (at your option) any later version.
10
-
11
- This program is distributed in the hope that it will be useful,
12
- but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
- GNU General Public License for more details.
15
-
16
- You should have received a copy of the GNU General Public License along
17
- with this program; if not, write to the Free Software Foundation, Inc.,
18
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19
- */
20
-
21
- require_once AIHR_DIR_INC . 'class-aihrus-widget.php';
22
-
23
- if ( class_exists( 'Testimonials_Widget_Recent_Testimonials_Widget' ) ) {
24
- return;
25
- }
26
-
27
-
28
- class Testimonials_Widget_Recent_Testimonials_Widget extends Aihrus_Widget {
29
- const ID = 'tw_recent_testimonials_widget';
30
-
31
- public static $title;
32
-
33
-
34
- public function __construct() {
35
- $classname = __CLASS__;
36
- $description = esc_html__( 'Your site\'s most recent testimonials.', 'testimonials-widget' );
37
- $id_base = self::ID;
38
- self::$title = esc_html__( 'Recent Testimonials', 'testimonials-widget' );
39
-
40
- parent::__construct( $classname, $description, $id_base, self::$title );
41
- }
42
-
43
-
44
- /**
45
- * @SuppressWarnings(PHPMD.UnusedFormalParameter)
46
- */
47
- public static function get_content( $instance = null, $widget_number = null ) {
48
- return Testimonials_Widget::testimonials_recent( $instance, $widget_number );
49
- }
50
-
51
-
52
- /**
53
- * @SuppressWarnings(PHPMD.UnusedFormalParameter)
54
- */
55
- public static function form_parts( $instance = null, $number = null ) {
56
- $form_parts = parent::form_parts( $instance, $number );
57
-
58
- $form_parts['title']['std'] = self::$title;
59
-
60
- $form_parts['number'] = array(
61
- 'title' => esc_html__( 'Number of testimonials to show', 'testimonials-widget' ),
62
- 'type' => 'text',
63
- 'validate' => 'intval',
64
- 'std' => 5,
65
- );
66
-
67
- $form_parts['show_date'] = array(
68
- 'title' => esc_html__( 'Display testimonial date?', 'testimonials-widget' ),
69
- 'type' => 'checkbox',
70
- 'validate' => 'is_true',
71
- 'std' => 0,
72
- );
73
-
74
- foreach ( $form_parts as $id => $parts ) {
75
- $form_parts[ $id ] = wp_parse_args( $parts, self::$default );
76
- }
77
-
78
- $form_parts = apply_filters( 'tw_recent_testimonials_widget_options', $form_parts );
79
-
80
- return $form_parts;
81
- }
82
- }
83
-
84
-
85
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/includes/class-testimonials-widget-settings.php DELETED
@@ -1,1079 +0,0 @@
1
- <?php
2
- /**
3
- Testimonials Widget
4
- Copyright (C) 2014 Michael Cannon
5
-
6
- This program is free software; you can redistribute it and/or modify
7
- it under the terms of the GNU General Public License as published by
8
- the Free Software Foundation; either version 2 of the License, or
9
- (at your option) any later version.
10
-
11
- This program is distributed in the hope that it will be useful,
12
- but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
- GNU General Public License for more details.
15
-
16
- You should have received a copy of the GNU General Public License along
17
- with this program; if not, write to the Free Software Foundation, Inc.,
18
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19
- */
20
-
21
- /**
22
- * Testimonials settings class
23
- *
24
- * Based upon http://alisothegeek.com/2011/01/wordpress-settings-api-tutorial-1/
25
- */
26
-
27
- require_once AIHR_DIR_INC . 'class-aihrus-settings.php';
28
-
29
- if ( class_exists( 'Testimonials_Widget_Settings' ) ) {
30
- return;
31
- }
32
-
33
-
34
- class Testimonials_Widget_Settings extends Aihrus_Settings {
35
- const ID = 'testimonialswidget_settings';
36
- const NAME = 'Testimonials Settings';
37
-
38
- public static $admin_page;
39
- public static $class = __CLASS__;
40
- public static $defaults = array();
41
- public static $plugin_assets;
42
- public static $plugin_url = 'http://wordpress.org/plugins/testimonials-widget/';
43
- public static $sections = array();
44
- public static $settings = array();
45
- public static $version;
46
-
47
- public static $default = array(
48
- 'backwards' => array(
49
- 'version' => null, // below this version number, use std
50
- 'std' => null,
51
- ),
52
- 'choices' => array(), // key => value
53
- 'class' => null, // warning, etc.
54
- 'desc' => null,
55
- 'id' => null,
56
- 'maxlength' => null,
57
- 'placeholder' => null,
58
- 'section' => 'general',
59
- 'show_code' => true,
60
- 'std' => null, // default key or value
61
- 'suggest' => false, // attempt for auto-suggest on inputs
62
- 'title' => null,
63
- 'type' => 'text', // textarea, checkbox, radio, select, hidden, heading, password, expand_begin, expand_end
64
- 'validate' => null, // required, term, slug, slugs, ids, order, single paramater PHP functions
65
- 'widget' => 1, // show in widget options, 0 off
66
- );
67
-
68
- public function __construct() {
69
- add_action( 'admin_init', array( __CLASS__, 'admin_init' ) );
70
- add_action( 'admin_menu', array( __CLASS__, 'admin_menu' ) );
71
- add_action( 'init', array( __CLASS__, 'init' ) );
72
- }
73
-
74
-
75
- public static function admin_init() {
76
- add_filter( 'wp_unique_post_slug_is_bad_hierarchical_slug', array( __CLASS__, 'is_bad_hierarchical_slug' ), 10, 4 );
77
- add_filter( 'wp_unique_post_slug_is_bad_flat_slug', array( __CLASS__, 'is_bad_flat_slug' ), 10, 3 );
78
-
79
- $version = tw_get_option( 'version' );
80
- self::$version = Testimonials_Widget::VERSION;
81
- self::$version = apply_filters( 'tw_version', self::$version );
82
-
83
- if ( $version != self::$version ) {
84
- self::initialize_settings();
85
- }
86
-
87
- if ( ! Testimonials_Widget::do_load() ) {
88
- return;
89
- }
90
-
91
- self::load_options();
92
- self::register_settings();
93
- }
94
-
95
-
96
- public static function admin_menu() {
97
- self::$admin_page = add_submenu_page( 'edit.php?post_type=' . Testimonials_Widget::PT, esc_html__( 'Testimonials Settings', 'testimonials-widget' ), esc_html__( 'Settings', 'testimonials-widget' ), 'manage_options', self::ID, array( __CLASS__, 'display_page' ) );
98
-
99
- add_action( 'admin_print_scripts-' . self::$admin_page, array( __CLASS__, 'scripts' ) );
100
- add_action( 'admin_print_styles-' . self::$admin_page, array( __CLASS__, 'styles' ) );
101
- add_action( 'load-' . self::$admin_page, array( __CLASS__, 'settings_add_help_tabs' ) );
102
- }
103
-
104
-
105
- public static function init() {
106
- load_plugin_textdomain( 'testimonials-widget', false, '/testimonials-widget/languages/' );
107
-
108
- self::$plugin_assets = Testimonials_Widget::$plugin_assets;
109
- }
110
-
111
-
112
- public static function sections() {
113
- self::$sections['general'] = esc_html__( 'General', 'testimonials-widget' );
114
- self::$sections['fields'] = esc_html__( 'Fields', 'testimonials-widget' );
115
- self::$sections['selection'] = esc_html__( 'Selection', 'testimonials-widget' );
116
- self::$sections['ordering'] = esc_html__( 'Ordering', 'testimonials-widget' );
117
- self::$sections['columns'] = esc_html__( 'Columns', 'testimonials-widget' );
118
- self::$sections['post_type'] = esc_html__( 'Post Type', 'testimonials-widget' );
119
- self::$sections['widget'] = esc_html__( 'Slider Widget', 'testimonials-widget' );
120
-
121
- parent::sections();
122
-
123
- self::$sections['examples'] = esc_html__( 'Shortcode Examples', 'testimonials-widget' );
124
- self::$sections['options'] = esc_html__( 'Shortcode Attributes', 'testimonials-widget' );
125
-
126
- self::$sections = apply_filters( 'tw_sections', self::$sections );
127
- }
128
-
129
-
130
- /**
131
- *
132
- *
133
- * @SuppressWarnings(PHPMD.Superglobals)
134
- */
135
- public static function settings() {
136
- // Widget
137
- self::$settings['title'] = array(
138
- 'section' => 'widget',
139
- 'title' => esc_html__( 'Title', 'testimonials-widget' ),
140
- 'std' => esc_html__( 'Testimonials', 'testimonials-widget' ),
141
- 'validate' => 'wp_kses_post',
142
- );
143
-
144
- self::$settings['title_link'] = array(
145
- 'section' => 'widget',
146
- 'title' => esc_html__( 'Title Link', 'testimonials-widget' ),
147
- 'desc' => esc_html__( 'URL, path, or post ID to link widget title to. Ex: http://example.com/stuff, /testimonials, or 123', 'testimonials-widget' ),
148
- 'validate' => 'wp_kses_data',
149
- );
150
-
151
- self::$settings['adaptive_height'] = array(
152
- 'section' => 'widget',
153
- 'title' => esc_html__( 'Adaptive Slider Height?', 'testimonials-widget' ),
154
- 'desc' => esc_html__( 'Dynamically adjust slider height based on each slide\'s height.', 'testimonials-widget' ),
155
- 'type' => 'checkbox',
156
- 'validate' => 'is_true',
157
- 'std' => 1,
158
- );
159
-
160
- self::$settings['bottom_text'] = array(
161
- 'section' => 'widget',
162
- 'title' => esc_html__( 'Bottom Text', 'testimonials-widget' ),
163
- 'desc' => esc_html__( 'Common text or HTML for bottom of testimonials.', 'testimonials-widget' ),
164
- 'type' => 'textarea',
165
- 'validate' => 'wp_kses_post',
166
- );
167
-
168
- self::$settings['char_limit'] = array(
169
- 'section' => 'widget',
170
- 'title' => esc_html__( 'Character Limit', 'testimonials-widget' ),
171
- 'desc' => esc_html__( 'Number of characters to limit non-single testimonial views to.', 'testimonials-widget' ),
172
- 'validate' => 'absint',
173
- );
174
-
175
- self::$settings['keep_whitespace'] = array(
176
- 'section' => 'widget',
177
- 'title' => esc_html__( 'Keep Whitespace?', 'testimonials-widget' ),
178
- 'desc' => esc_html__( 'Keeps testimonials looking as entered than sans auto-formatting.', 'testimonials-widget' ),
179
- 'type' => 'checkbox',
180
- 'validate' => 'is_true',
181
- );
182
-
183
- self::$settings['refresh_interval'] = array(
184
- 'section' => 'widget',
185
- 'title' => esc_html__( 'Rotation Speed', 'testimonials-widget' ),
186
- 'desc' => esc_html__( 'Number of seconds between testimonial rotations or 0 for no rotation at all refresh.', 'testimonials-widget' ),
187
- 'std' => 5,
188
- 'validate' => 'absint',
189
- );
190
-
191
- self::$settings['show_start_stop'] = array(
192
- 'section' => 'widget',
193
- 'title' => esc_html__( 'Show Play/Pause?', 'testimonials-widget' ),
194
- 'desc' => esc_html__( 'Display start and stop buttons underneath the testimonial slider.', 'testimonials-widget' ),
195
- 'type' => 'checkbox',
196
- 'validate' => 'is_true',
197
- 'std' => 1,
198
- );
199
-
200
- self::$settings['transition_mode'] = array(
201
- 'section' => 'widget',
202
- 'title' => esc_html__( 'Transition Mode?', 'testimonials-widget' ),
203
- 'desc' => esc_html__( 'Type of transition between slides.', 'testimonials-widget' ),
204
- 'type' => 'select',
205
- 'choices' => array(
206
- 'fade' => esc_html__( 'Fade', 'testimonials-widget' ),
207
- 'horizontal' => esc_html__( 'Horizontal', 'testimonials-widget' ),
208
- 'vertical' => esc_html__( 'Vertical', 'testimonials-widget' ),
209
- ),
210
- 'std' => 'fade',
211
- );
212
-
213
- self::$settings['widget_expand_all'] = array(
214
- 'section' => 'widget',
215
- 'type' => 'expand_all',
216
- );
217
-
218
- // General
219
- self::$settings['general_expand_begin'] = array(
220
- 'desc' => esc_html__( 'General Options', 'testimonials-widget' ),
221
- 'type' => 'expand_begin',
222
- );
223
-
224
- self::$settings['item_reviewed'] = array(
225
- 'title' => esc_html__( 'Default Reviewed Item?', 'testimonials-widget' ),
226
- 'desc' => esc_html__( 'Name of thing being referenced in testimonials.', 'testimonials-widget' ),
227
- 'std' => get_option( 'blogname' ),
228
- 'widget' => 0,
229
- 'validate' => 'wp_kses_post',
230
- );
231
-
232
- self::$settings['item_reviewed_url'] = array(
233
- 'title' => esc_html__( 'Default Reviewed Item URL?', 'testimonials-widget' ),
234
- 'desc' => esc_html__( 'URL of thing being referenced in testimonials.', 'testimonials-widget' ),
235
- 'std' => network_site_url(),
236
- 'validate' => 'url',
237
- 'widget' => 0,
238
- );
239
-
240
- self::$settings['disable_quotes'] = array(
241
- 'title' => esc_html__( 'Disable built-in quotes?', 'testimonials-widget' ),
242
- 'desc' => esc_html__( 'Remove open and close quote span tags surrounding testimonial content.', 'testimonials-widget' ),
243
- 'type' => 'checkbox',
244
- 'validate' => 'is_true',
245
- );
246
-
247
- self::$settings['hide_not_found'] = array(
248
- 'title' => esc_html__( 'Disable "Testimonials Not Found"?', 'testimonials-widget' ),
249
- 'desc' => esc_html__( 'Remove "Testimonials Not Found" content when no testimonials are found to be displayed.', 'testimonials-widget' ),
250
- 'type' => 'checkbox',
251
- 'validate' => 'is_true',
252
- );
253
-
254
- self::$settings['paging'] = array(
255
- 'title' => esc_html__( 'Enable Paging?', 'testimonials-widget' ),
256
- 'desc' => esc_html__( 'Show paging controls for `[testimonials]` listing.', 'testimonials-widget' ),
257
- 'type' => 'select',
258
- 'choices' => array(
259
- '' => esc_html__( 'Disable', 'testimonials-widget' ),
260
- 1 => esc_html__( 'Enable', 'testimonials-widget' ),
261
- 'before' => esc_html__( 'Before testimonials', 'testimonials-widget' ),
262
- 'after' => esc_html__( 'After testimonials', 'testimonials-widget' ),
263
- ),
264
- 'std' => 1,
265
- 'widget' => 0,
266
- );
267
-
268
- $desc = __( 'Adds HTML tag markup per the <a href="%s">Review schema</a> to testimonials. Search engines including Bing, Google, Yahoo! and Yandex rely on this markup to improve the display of search results.', 'testimonials-widget' );
269
-
270
- self::$settings['enable_schema'] = array(
271
- 'title' => esc_html__( 'Enable Review Schema?', 'testimonials-widget' ),
272
- 'desc' => sprintf( $desc, 'http://schema.org/Review' ),
273
- 'type' => 'checkbox',
274
- 'validate' => 'is_true',
275
- 'std' => 1,
276
- );
277
-
278
- self::$settings['do_shortcode'] = array(
279
- 'title' => esc_html__( 'Enable [shortcodes]?', 'testimonials-widget' ),
280
- 'desc' => esc_html__( 'If unchecked, shortcodes are stripped.', 'testimonials-widget' ),
281
- 'type' => 'checkbox',
282
- 'validate' => 'is_true',
283
- 'std' => 1,
284
- );
285
-
286
- self::$settings['enable_video'] = array(
287
- 'title' => esc_html__( 'Enable Video?', 'testimonials-widget' ),
288
- 'desc' => esc_html__( 'Only enable when displaying video content.', 'testimonials-widget' ),
289
- 'type' => 'checkbox',
290
- 'validate' => 'is_true',
291
- );
292
-
293
- self::$settings['exclude_bxslider_css'] = array(
294
- 'title' => esc_html__( 'Exclude bxSlider CSS?', 'testimonials-widget' ),
295
- 'desc' => esc_html__( 'For a bare-bones, unthemed slider.', 'testimonials-widget' ),
296
- 'type' => 'checkbox',
297
- 'validate' => 'is_true',
298
- 'widget' => 0,
299
- 'show_code' => false,
300
- );
301
-
302
- self::$settings['exclude_css'] = array(
303
- 'title' => esc_html__( 'Exclude default CSS?', 'testimonials-widget' ),
304
- 'desc' => esc_html__( 'Prevent default CSS from being loaded.', 'testimonials-widget' ),
305
- 'type' => 'checkbox',
306
- 'validate' => 'is_true',
307
- 'widget' => 0,
308
- 'show_code' => false,
309
- );
310
-
311
- self::$settings['remove_hentry'] = array(
312
- 'title' => esc_html__( 'Remove `.hentry` CSS?', 'testimonials-widget' ),
313
- 'desc' => esc_html__( 'Some themes use class `.hentry` in a manner that breaks Testimonials\' CSS.', 'testimonials-widget' ),
314
- 'type' => 'checkbox',
315
- 'validate' => 'is_true',
316
- 'std' => 1,
317
- );
318
-
319
- self::$settings['target'] = array(
320
- 'title' => esc_html__( 'URL Target', 'testimonials-widget' ),
321
- 'desc' => esc_html__( 'Add target to all URLs; leave blank if none.', 'testimonials-widget' ),
322
- 'validate' => 'term',
323
- );
324
-
325
- self::$settings['use_quote_tag'] = array(
326
- 'title' => esc_html__( 'Use `&lt;q&gt;` tag?', 'testimonials-widget' ),
327
- 'desc' => esc_html__( 'Not HTML5 compliant.', 'testimonials-widget' ),
328
- 'type' => 'checkbox',
329
- 'validate' => 'is_true',
330
- );
331
-
332
- self::$settings['general_expand_end'] = array(
333
- 'type' => 'expand_end',
334
- );
335
-
336
- // Fields
337
- self::$settings['fields_expand_begin'] = array(
338
- 'section' => 'fields',
339
- 'desc' => esc_html__( 'Field Options', 'testimonials-widget' ),
340
- 'type' => 'expand_begin',
341
- );
342
-
343
- self::$settings['hide_source'] = array(
344
- 'section' => 'fields',
345
- 'title' => esc_html__( 'Hide Author?', 'testimonials-widget' ),
346
- 'type' => 'checkbox',
347
- 'validate' => 'is_true',
348
- 'desc' => esc_html__( 'Don\'t display testimonial title in cite.', 'testimonials-widget' ),
349
- );
350
-
351
- self::$settings['hide_company'] = array(
352
- 'section' => 'fields',
353
- 'title' => esc_html__( 'Hide Company?', 'testimonials-widget' ),
354
- 'type' => 'checkbox',
355
- 'validate' => 'is_true',
356
- 'desc' => esc_html__( 'Don\'t display testimonial company in cite.', 'testimonials-widget' ),
357
- );
358
-
359
- self::$settings['hide_content'] = array(
360
- 'section' => 'fields',
361
- 'title' => esc_html__( 'Hide Content?', 'testimonials-widget' ),
362
- 'type' => 'checkbox',
363
- 'validate' => 'is_true',
364
- 'desc' => esc_html__( 'Don\'t display testimonial content in a view.', 'testimonials-widget' ),
365
- );
366
-
367
- self::$settings['hide_email'] = array(
368
- 'section' => 'fields',
369
- 'title' => esc_html__( 'Hide Email?', 'testimonials-widget' ),
370
- 'type' => 'checkbox',
371
- 'validate' => 'is_true',
372
- 'std' => 1,
373
- 'desc' => esc_html__( 'Don\'t display or link to testimonial email in cite.', 'testimonials-widget' ),
374
- );
375
-
376
- self::$settings['hide_gravatar'] = array(
377
- 'section' => 'fields',
378
- 'title' => esc_html__( 'Hide Gravatar?', 'testimonials-widget' ),
379
- 'type' => 'checkbox',
380
- 'validate' => 'is_true',
381
- 'desc' => esc_html__( 'Don\'t display Gravatar image with testimonial.', 'testimonials-widget' ),
382
- );
383
-
384
- self::$settings['hide_image'] = array(
385
- 'section' => 'fields',
386
- 'title' => esc_html__( 'Hide Image?', 'testimonials-widget' ),
387
- 'type' => 'checkbox',
388
- 'validate' => 'is_true',
389
- 'desc' => esc_html__( 'Don\'t display featured image with testimonial.', 'testimonials-widget' ),
390
- );
391
-
392
- self::$settings['hide_image_single'] = array(
393
- 'section' => 'fields',
394
- 'title' => esc_html__( 'Hide Image in Single View?', 'testimonials-widget' ),
395
- 'type' => 'checkbox',
396
- 'validate' => 'is_true',
397
- 'widget' => 0,
398
- );
399
-
400
- self::$settings['hide_title'] = array(
401
- 'section' => 'fields',
402
- 'title' => esc_html__( 'Hide Job Title?', 'testimonials-widget' ),
403
- 'type' => 'checkbox',
404
- 'validate' => 'is_true',
405
- 'desc' => esc_html__( 'Don\'t display testimonial job title in cite.', 'testimonials-widget' ),
406
- );
407
-
408
- self::$settings['hide_location'] = array(
409
- 'section' => 'fields',
410
- 'title' => esc_html__( 'Hide Location?', 'testimonials-widget' ),
411
- 'type' => 'checkbox',
412
- 'validate' => 'is_true',
413
- 'desc' => esc_html__( 'Don\'t display testimonial location in cite.', 'testimonials-widget' ),
414
- );
415
-
416
- self::$settings['hide_url'] = array(
417
- 'section' => 'fields',
418
- 'title' => esc_html__( 'Hide URL?', 'testimonials-widget' ),
419
- 'type' => 'checkbox',
420
- 'validate' => 'is_true',
421
- 'desc' => esc_html__( 'Don\'t display or link to testimonial URL in cite.', 'testimonials-widget' ),
422
- );
423
-
424
- self::$settings['fields_expand_end'] = array(
425
- 'type' => 'expand_end',
426
- );
427
-
428
- // Selection
429
- self::$settings['selection_expand_begin'] = array(
430
- 'section' => 'selection',
431
- 'desc' => esc_html__( 'Selection Options', 'testimonials-widget' ),
432
- 'type' => 'expand_begin',
433
- );
434
-
435
- self::$settings['category'] = array(
436
- 'section' => 'selection',
437
- 'title' => esc_html__( 'Category Filter', 'testimonials-widget' ),
438
- 'desc' => esc_html__( 'Comma separated category names or IDs.', 'testimonials-widget' ),
439
- 'validate' => 'terms',
440
- 'suggest' => true,
441
- );
442
-
443
- self::$settings['exclude'] = array(
444
- 'section' => 'selection',
445
- 'title' => esc_html__( 'Exclude IDs Filter', 'testimonials-widget' ),
446
- 'desc' => esc_html__( 'Comma separated testimonial IDs.', 'testimonials-widget' ),
447
- 'validate' => 'ids',
448
- );
449
-
450
- self::$settings['ids'] = array(
451
- 'section' => 'selection',
452
- 'title' => esc_html__( 'Include IDs Filter', 'testimonials-widget' ),
453
- 'desc' => esc_html__( 'Comma separated testimonial IDs.', 'testimonials-widget' ),
454
- 'validate' => 'ids',
455
- );
456
-
457
- self::$settings['limit'] = array(
458
- 'section' => 'selection',
459
- 'title' => esc_html__( 'Limit', 'testimonials-widget' ),
460
- 'desc' => esc_html__( 'Number of testimonials to select per instance.', 'testimonials-widget' ),
461
- 'std' => 10,
462
- 'validate' => 'nozero',
463
- );
464
-
465
- self::$settings['tags_all'] = array(
466
- 'section' => 'selection',
467
- 'title' => esc_html__( 'Require All Tags?', 'testimonials-widget' ),
468
- 'desc' => esc_html__( 'Select only testimonials with all of the given tags.', 'testimonials-widget' ),
469
- 'type' => 'checkbox',
470
- 'validate' => 'is_true',
471
- );
472
-
473
- self::$settings['tags'] = array(
474
- 'section' => 'selection',
475
- 'title' => esc_html__( 'Tags Filter', 'testimonials-widget' ),
476
- 'desc' => esc_html__( 'Comma separated tag names or IDs.', 'testimonials-widget' ),
477
- 'validate' => 'terms',
478
- 'suggest' => true,
479
- );
480
-
481
- self::$settings['selection_expand_end'] = array(
482
- 'section' => 'selection',
483
- 'type' => 'expand_end',
484
- );
485
-
486
- // Ordering
487
- self::$settings['ordering_expand_begin'] = array(
488
- 'section' => 'ordering',
489
- 'desc' => esc_html__( 'Ordering Options', 'testimonials-widget' ),
490
- 'type' => 'expand_begin',
491
- );
492
-
493
- self::$settings['orderby'] = array(
494
- 'section' => 'ordering',
495
- 'title' => esc_html__( 'ORDER BY', 'testimonials-widget' ),
496
- 'desc' => esc_html__( 'Used when "Random Order" is disabled.', 'testimonials-widget' ),
497
- 'type' => 'select',
498
- 'choices' => array(
499
- 'ID' => esc_html__( 'Testimonial ID', 'testimonials-widget' ),
500
- 'author' => esc_html__( 'Author', 'testimonials-widget' ),
501
- 'date' => esc_html__( 'Date', 'testimonials-widget' ),
502
- 'menu_order' => esc_html__( 'Menu Order', 'testimonials-widget' ),
503
- 'title' => esc_html__( 'Author', 'testimonials-widget' ),
504
- 'none' => esc_html__( 'No order', 'testimonials-widget' ),
505
- ),
506
- 'std' => 'ID',
507
- 'validate' => 'term',
508
- );
509
-
510
- self::$settings['meta_key'] = array(
511
- 'section' => 'ordering',
512
- 'title' => esc_html__( 'ORDER BY meta_key', 'testimonials-widget' ),
513
- 'desc' => esc_html__( 'Used when "Random Order" is disabled and sorting by a testimonials meta key is needed. Overrides ORDER BY.', 'testimonials-widget' ),
514
- 'type' => 'select',
515
- 'choices' => array(
516
- '' => esc_html__( 'None', 'testimonials-widget' ),
517
- 'testimonials-widget-title' => esc_html__( 'Job Title', 'testimonials-widget' ),
518
- 'testimonials-widget-email' => esc_html__( 'Email', 'testimonials-widget' ),
519
- 'testimonials-widget-location' => esc_html__( 'Location', 'testimonials-widget' ),
520
- 'testimonials-widget-company' => esc_html__( 'Company', 'testimonials-widget' ),
521
- 'testimonials-widget-url' => esc_html__( 'URL', 'testimonials-widget' ),
522
- ),
523
- 'validate' => 'slug',
524
- );
525
-
526
- self::$settings['order'] = array(
527
- 'section' => 'ordering',
528
- 'title' => esc_html__( 'ORDER BY Order', 'testimonials-widget' ),
529
- 'type' => 'select',
530
- 'choices' => array(
531
- 'DESC' => esc_html__( 'Descending', 'testimonials-widget' ),
532
- 'ASC' => esc_html__( 'Ascending', 'testimonials-widget' ),
533
- ),
534
- 'std' => 'DESC',
535
- 'validate' => 'order',
536
- );
537
-
538
- self::$settings['random'] = array(
539
- 'section' => 'ordering',
540
- 'title' => esc_html__( 'Random Order?', 'testimonials-widget' ),
541
- 'desc' => esc_html__( 'If checked, ignores ORDER BY, ORDER BY meta_key, and ORDER BY Order. Widgets are random by default automatically.', 'testimonials-widget' ),
542
- 'type' => 'checkbox',
543
- 'validate' => 'is_true',
544
- );
545
-
546
- self::$settings['ordering_expand_end'] = array(
547
- 'section' => 'ordering',
548
- 'type' => 'expand_end',
549
- );
550
-
551
- // Post Type
552
- self::$settings['allow_comments'] = array(
553
- 'section' => 'post_type',
554
- 'title' => esc_html__( 'Allow Comments?', 'testimonials-widget' ),
555
- 'desc' => esc_html__( 'Only affects the Testimonials post edit page. Your theme controls the front-end view.', 'testimonials-widget' ),
556
- 'type' => 'checkbox',
557
- 'validate' => 'is_true',
558
- 'widget' => 0,
559
- 'show_code' => false,
560
- );
561
-
562
- $desc = __( 'URL slug-name for <a href="%1s">testimonials archive</a> page.', 'testimonials-widget' );
563
- $has_archive = tw_get_option( 'has_archive', '' );
564
- $site_url = network_site_url( '/' . $has_archive . '/' );
565
-
566
- self::$settings['has_archive'] = array(
567
- 'section' => 'post_type',
568
- 'title' => esc_html__( 'Archive Page URL', 'testimonials-widget' ),
569
- 'desc' => sprintf( $desc, $site_url ),
570
- 'std' => 'testimonials-archive',
571
- 'validate' => 'slash_sanitize_title',
572
- 'widget' => 0,
573
- 'show_code' => false,
574
- );
575
-
576
- self::$settings['use_cpt_taxonomy'] = array(
577
- 'section' => 'post_type',
578
- 'title' => esc_html__( 'Disable Default Taxonomies?', 'testimonials-widget' ),
579
- 'type' => 'checkbox',
580
- 'validate' => 'is_true',
581
- 'desc' => esc_html__( 'If checked, use Testimonials\' own category and tag taxonomies than WordPress\' defaults.', 'testimonials-widget' ),
582
- 'widget' => 0,
583
- 'show_code' => false,
584
- );
585
-
586
- self::$settings['enable_archives'] = array(
587
- 'desc' => esc_html__( 'Include testimonials in archive and category views.', 'testimonials-widget' ),
588
- 'section' => 'post_type',
589
- 'show_code' => false,
590
- 'title' => esc_html__( 'Enable archives view?', 'testimonials-widget' ),
591
- 'type' => 'checkbox',
592
- 'validate' => 'is_true',
593
- 'widget' => 0,
594
- );
595
-
596
- $desc = esc_html__( 'URL slug-name for testimonial view pages. Shouldn\'t be the same as the Archive Page URL nor should it match a page URL slug.', 'testimonials-widget' );
597
-
598
- self::$settings['rewrite_slug'] = array(
599
- 'section' => 'post_type',
600
- 'title' => esc_html__( 'Testimonial Page URL', 'testimonials-widget' ),
601
- 'desc' => $desc,
602
- 'std' => 'testimonial',
603
- 'validate' => 'slash_sanitize_title',
604
- 'widget' => 0,
605
- 'show_code' => false,
606
- );
607
-
608
- // Columns
609
- self::$settings['columns_author'] = array(
610
- 'section' => 'columns',
611
- 'title' => esc_html__( 'Hide Author?', 'testimonials-widget', 'testimonials-widget' ),
612
- 'type' => 'checkbox',
613
- 'validate' => 'is_true',
614
- 'std' => 1,
615
- 'widget' => 0,
616
- 'show_code' => false,
617
- );
618
-
619
- self::$settings['columns_company'] = array(
620
- 'section' => 'columns',
621
- 'title' => esc_html__( 'Hide Company?', 'testimonials-widget' ),
622
- 'type' => 'checkbox',
623
- 'validate' => 'is_true',
624
- 'std' => 1,
625
- 'widget' => 0,
626
- 'show_code' => false,
627
- );
628
-
629
- self::$settings['columns_email'] = array(
630
- 'section' => 'columns',
631
- 'title' => esc_html__( 'Hide Email?', 'testimonials-widget' ),
632
- 'type' => 'checkbox',
633
- 'validate' => 'is_true',
634
- 'std' => 1,
635
- 'widget' => 0,
636
- 'show_code' => false,
637
- );
638
-
639
- self::$settings['columns_id'] = array(
640
- 'section' => 'columns',
641
- 'title' => esc_html__( 'Hide ID?', 'testimonials-widget' ),
642
- 'type' => 'checkbox',
643
- 'validate' => 'is_true',
644
- 'std' => 1,
645
- 'widget' => 0,
646
- 'show_code' => false,
647
- );
648
-
649
- self::$settings['columns_thumbnail'] = array(
650
- 'section' => 'columns',
651
- 'title' => esc_html__( 'Hide Image?', 'testimonials-widget' ),
652
- 'type' => 'checkbox',
653
- 'validate' => 'is_true',
654
- 'widget' => 0,
655
- 'show_code' => false,
656
- );
657
-
658
- self::$settings['columns_job_title'] = array(
659
- 'section' => 'columns',
660
- 'title' => esc_html__( 'Hide Job Title?', 'testimonials-widget' ),
661
- 'type' => 'checkbox',
662
- 'validate' => 'is_true',
663
- 'std' => 1,
664
- 'widget' => 0,
665
- 'show_code' => false,
666
- );
667
-
668
- self::$settings['columns_location'] = array(
669
- 'section' => 'columns',
670
- 'title' => esc_html__( 'Hide Location?', 'testimonials-widget' ),
671
- 'type' => 'checkbox',
672
- 'validate' => 'is_true',
673
- 'std' => 1,
674
- 'widget' => 0,
675
- 'show_code' => false,
676
- );
677
-
678
- self::$settings['columns_shortcode'] = array(
679
- 'section' => 'columns',
680
- 'title' => esc_html__( 'Hide Shortcode?', 'testimonials-widget' ),
681
- 'type' => 'checkbox',
682
- 'validate' => 'is_true',
683
- 'widget' => 0,
684
- 'show_code' => false,
685
- );
686
-
687
- self::$settings['columns_url'] = array(
688
- 'section' => 'columns',
689
- 'title' => esc_html__( 'Hide URL?', 'testimonials-widget' ),
690
- 'type' => 'checkbox',
691
- 'validate' => 'is_true',
692
- 'std' => 1,
693
- 'widget' => 0,
694
- 'show_code' => false,
695
- );
696
-
697
- // Reset
698
- self::$settings['reset_expand_begin'] = array(
699
- 'section' => 'reset',
700
- 'desc' => esc_html__( 'Reset', 'testimonials-widget' ),
701
- 'type' => 'expand_begin',
702
- );
703
-
704
- parent::settings();
705
-
706
- self::$settings['reset_expand_end'] = array(
707
- 'section' => 'reset',
708
- 'type' => 'expand_end',
709
- );
710
-
711
- self::$settings = apply_filters( 'tw_settings', self::$settings );
712
- foreach ( self::$settings as $id => $parts ) {
713
- self::$settings[ $id ] = wp_parse_args( $parts, self::$default );
714
- }
715
-
716
- if ( ! empty( $_REQUEST['page'] ) && 'testimonialswidget_settings' == $_REQUEST['page'] ) {
717
- // Examples
718
- self::$settings['examples'] = array(
719
- 'section' => 'examples',
720
- 'desc' => Testimonials_Widget::testimonials_examples(),
721
- 'type' => 'content',
722
- 'widget' => 0,
723
- );
724
- self::$settings['examples'] = wp_parse_args( self::$settings['examples'], self::$default );
725
-
726
- // Shortcode Attributes
727
- self::$settings['options'] = array(
728
- 'section' => 'options',
729
- 'type' => 'content',
730
- 'desc' => Testimonials_Widget::testimonials_options(),
731
- 'widget' => 0,
732
- );
733
- self::$settings['options'] = wp_parse_args( self::$settings['options'], self::$default );
734
- }
735
- }
736
-
737
-
738
- public static function get_defaults( $mode = null, $old_version = null ) {
739
- $old_version = tw_get_option( 'version' );
740
-
741
- $defaults = parent::get_defaults( $mode, $old_version );
742
- $defaults = apply_filters( 'tw_settings_defaults', $defaults );
743
-
744
- return $defaults;
745
- }
746
-
747
-
748
- public static function display_page( $disable_donate = false ) {
749
- $disable_donate = tw_get_option( 'disable_donate' );
750
-
751
- parent::display_page( $disable_donate );
752
- }
753
-
754
-
755
- /**
756
- *
757
- *
758
- * @SuppressWarnings(PHPMD.UnusedLocalVariable)
759
- */
760
- public static function display_setting( $args = array(), $do_echo = true, $input = null ) {
761
- $content = '';
762
- switch ( $args['type'] ) {
763
- default:
764
- $content = apply_filters( 'tw_display_setting', $content, $args, $input );
765
- break;
766
- }
767
-
768
- if ( empty( $content ) ) {
769
- $content = parent::display_setting( $args, false, $input );
770
- }
771
-
772
- if ( ! $do_echo ) {
773
- return $content;
774
- }
775
-
776
- echo $content;
777
- }
778
-
779
-
780
- public static function initialize_settings( $version = null ) {
781
- $version = tw_get_option( 'version', self::$version );
782
-
783
- parent::initialize_settings( $version );
784
- }
785
-
786
-
787
- /**
788
- *
789
- *
790
- * @SuppressWarnings(PHPMD.Superglobals)
791
- */
792
- public static function validate_settings( $input, $options = null, $do_errors = false ) {
793
- $validated = parent::validate_settings( $input, $options, $do_errors );
794
-
795
- if ( empty( $do_errors ) ) {
796
- $input = $validated;
797
- $errors = array();
798
- } else {
799
- $input = $validated['input'];
800
- $errors = $validated['errors'];
801
- }
802
-
803
- $defaults = self::get_defaults();
804
-
805
- if ( ! empty( $input['has_archive'] ) ) {
806
- $input['has_archive'] = self::prevent_slug_conflict( $input['has_archive'] );
807
- } else {
808
- $input['has_archive'] = $defaults['has_archive'];
809
- }
810
-
811
- if ( ! empty( $input['rewrite_slug'] ) ) {
812
- $input['rewrite_slug'] = self::prevent_slug_conflict( $input['rewrite_slug'] );
813
- } else {
814
- $input['rewrite_slug'] = $defaults['rewrite_slug'];
815
- }
816
-
817
- $flush_rewrite_rules = false;
818
- // same has_archive and rewrite_slug causes problems
819
- if ( $input['has_archive'] == $input['rewrite_slug'] ) {
820
- $input['has_archive'] = $defaults['has_archive'];
821
- $input['rewrite_slug'] = $defaults['rewrite_slug'];
822
-
823
- $flush_rewrite_rules = true;
824
- }
825
-
826
- // did URL slugs or taxonomy change?
827
- $has_archive = tw_get_option( 'has_archive' );
828
- $rewrite_slug = tw_get_option( 'rewrite_slug' );
829
- $use_cpt_taxonomy = tw_get_option( 'use_cpt_taxonomy' );
830
- if ( $has_archive != $input['has_archive'] || $rewrite_slug != $input['rewrite_slug'] || $use_cpt_taxonomy != $input['use_cpt_taxonomy'] ) {
831
- $flush_rewrite_rules = true;
832
- }
833
-
834
- if ( $flush_rewrite_rules ) {
835
- flush_rewrite_rules();
836
- }
837
-
838
- $input['version'] = self::$version;
839
- $input['donate_version'] = Testimonials_Widget::VERSION;
840
-
841
- $input = apply_filters( 'tw_validate_settings', $input, $errors );
842
- if ( empty( $do_errors ) ) {
843
- $validated = $input;
844
- } else {
845
- $validated = array(
846
- 'input' => $input,
847
- 'errors' => $errors,
848
- );
849
- }
850
-
851
- return $validated;
852
- }
853
-
854
-
855
- public static function prevent_slug_conflict( $slug ) {
856
- global $wpdb;
857
-
858
- // slugs must be unique within their own trees
859
- $check_sql = "SELECT post_name FROM $wpdb->posts WHERE post_name = %s AND post_parent = 0 LIMIT 1";
860
- $slug_check = $wpdb->get_var( $wpdb->prepare( $check_sql, $slug ) );
861
- if ( $slug_check ) {
862
- $suffix = 2;
863
- do {
864
- $alt_slug = _truncate_post_slug( $slug, 200 - ( strlen( $suffix ) + 1 ) ) . "-$suffix";
865
- $slug_check = $wpdb->get_var( $wpdb->prepare( $check_sql, $alt_slug ) );
866
- $suffix++;
867
- } while ( $slug_check );
868
-
869
- $slug = $alt_slug;
870
- }
871
-
872
- return $slug;
873
- }
874
-
875
-
876
- /**
877
- *
878
- *
879
- * @SuppressWarnings(PHPMD.LongVariable)
880
- * @SuppressWarnings(PHPMD.UnusedFormalParameter)
881
- */
882
- public static function is_bad_hierarchical_slug( $is_bad_hierarchical_slug, $slug, $post_type, $post_parent ) {
883
- // This post has no parent and is a "base" post
884
- if ( ! $post_parent && self::is_cpt_slug( $slug ) ) {
885
- return true;
886
- }
887
-
888
- return $is_bad_hierarchical_slug;
889
- }
890
-
891
-
892
- /**
893
- *
894
- *
895
- * @SuppressWarnings(PHPMD.UnusedFormalParameter)
896
- */
897
- public static function is_bad_flat_slug( $is_bad_flat_slug, $slug, $post_type ) {
898
- if ( self::is_cpt_slug( $slug ) ) {
899
- return true;
900
- }
901
-
902
- return $is_bad_flat_slug;
903
- }
904
-
905
-
906
- public static function is_cpt_slug( $slug ) {
907
- $has_archive = tw_get_option( 'has_archive' );
908
- $rewrite_slug = tw_get_option( 'rewrite_slug' );
909
-
910
- return in_array( $slug, array( $has_archive, $rewrite_slug ) );
911
- }
912
-
913
-
914
- public static function settings_add_help_tabs() {
915
- $screen = get_current_screen();
916
- if ( self::$admin_page != $screen->id ) {
917
- return;
918
- }
919
-
920
- $screen->set_help_sidebar(
921
- '<p>' .
922
- esc_html__( 'These Testimonials Settings establish the default option values for shortcodes, theme functions, and widget instances. Widgets, once created no longer inherit these global settings. Therefore, you\'ll need to update each widget with the new settings. It might be easier to delete the widget and then recreate it.', 'testimonials-widget' ) .
923
- '</p><p>' .
924
- esc_html__( 'Shortcode option names are listed below each entry.', 'testimonials-widget' ) .
925
- '</p><p>' .
926
- sprintf(
927
- __( 'View the <a href="%s">Testimonials documentation</a>.', 'testimonials-widget' ),
928
- esc_url( self::$plugin_url . '/faq/' )
929
- ) .
930
- '</p>'
931
- );
932
-
933
- $screen->add_help_tab(
934
- array(
935
- 'id' => 'tw-general',
936
- 'title' => esc_html__( 'General', 'testimonials-widget' ),
937
- 'content' => '<p>' . esc_html__( 'General options.', 'testimonials-widget' ) . '</p>'
938
- )
939
- );
940
-
941
- $screen->add_help_tab(
942
- array(
943
- 'id' => 'tw-fields',
944
- 'title' => esc_html__( 'Fields', 'testimonials-widget' ),
945
- 'content' => '<p>' . esc_html__( 'Show or hide fields.', 'testimonials-widget' ) . '</p>'
946
- )
947
- );
948
-
949
- $screen->add_help_tab(
950
- array(
951
- 'id' => 'tw-selection',
952
- 'title' => esc_html__( 'Selection', 'testimonials-widget' ),
953
- 'content' => '<p>' . esc_html__( 'Options used to select testimonials.', 'testimonials-widget' ) . '</p>'
954
- )
955
- );
956
-
957
- $screen->add_help_tab(
958
- array(
959
- 'id' => 'tw-ordering',
960
- 'title' => esc_html__( 'Ordering', 'testimonials-widget' ),
961
- 'content' => '<p>' . esc_html__( 'Options used to determine displayed testimonials ordering.', 'testimonials-widget' ) . '</p>'
962
- )
963
- );
964
-
965
- $screen->add_help_tab(
966
- array(
967
- 'id' => 'tw-columns',
968
- 'title' => esc_html__( 'Columns', 'testimonials-widget' ),
969
- 'content' => '<p>' . esc_html__( 'Allowed columns to display on edit page.', 'testimonials-widget' ) . '</p>'
970
- )
971
- );
972
-
973
- $screen->add_help_tab(
974
- array(
975
- 'id' => 'tw-post_type',
976
- 'title' => esc_html__( 'Post Type', 'testimonials-widget' ),
977
- 'content' => '<p>' . esc_html__( 'Archive and singular page URL related testimonials options.', 'testimonials-widget' ) . '</p>'
978
- )
979
- );
980
-
981
- $screen->add_help_tab(
982
- array(
983
- 'id' => 'tw-widget',
984
- 'title' => esc_html__( 'Slider Widget', 'testimonials-widget' ),
985
- 'content' => '<p>' . esc_html__( 'Options related to showing testimonials in widgets.', 'testimonials-widget' ) . '</p>'
986
- )
987
- );
988
-
989
- $screen->add_help_tab(
990
- array(
991
- 'id' => 'tw-reset',
992
- 'title' => esc_html__( 'Reset', 'testimonials-widget' ),
993
- 'content' => '<p>' . esc_html__( 'Backwards compatibility, import/export options, and reset options.', 'testimonials-widget' ) . '</p>'
994
- )
995
- );
996
-
997
- do_action( 'tw_settings_add_help_tabs', $screen );
998
- }
999
-
1000
-
1001
- public static function get_suggest( $id, $suggest_id ) {
1002
- wp_enqueue_script( 'suggest' );
1003
-
1004
- $use_cpt_taxonomy = tw_get_option( 'use_cpt_taxonomy', false );
1005
-
1006
- switch ( $id ) {
1007
- case 'category':
1008
- if ( ! $use_cpt_taxonomy ) {
1009
- $taxonomy = 'category';
1010
- } else {
1011
- $taxonomy = Testimonials_Widget::$cpt_category;
1012
- }
1013
-
1014
- break;
1015
-
1016
- case 'tags':
1017
- if ( ! $use_cpt_taxonomy ) {
1018
- $taxonomy = 'post_tag';
1019
- } else {
1020
- $taxonomy = Testimonials_Widget::$cpt_tags;
1021
- }
1022
-
1023
- break;
1024
- }
1025
-
1026
- $ajax_url = site_url() . '/wp-admin/admin-ajax.php';
1027
- $suggest_js = "suggest( '{$ajax_url}?action=ajax-tag-search&tax={$taxonomy}', { delay: 500, minchars: 2, multiple: true, multipleSep: ', ' } )";
1028
-
1029
- $scripts = <<<EOD
1030
- <script type="text/javascript">
1031
- jQuery(document).ready( function() {
1032
- jQuery( '.{$suggest_id}' ).{$suggest_js};
1033
- });
1034
- </script>
1035
- EOD;
1036
-
1037
- return $scripts;
1038
- }
1039
-
1040
-
1041
- }
1042
-
1043
-
1044
- function tw_get_options() {
1045
- $options = get_option( Testimonials_Widget_Settings::ID );
1046
-
1047
- if ( false === $options ) {
1048
- $options = Testimonials_Widget_Settings::get_defaults();
1049
- update_option( Testimonials_Widget_Settings::ID, $options );
1050
- }
1051
-
1052
- return $options;
1053
- }
1054
-
1055
-
1056
- function tw_get_option( $option, $default = null ) {
1057
- $options = get_option( Testimonials_Widget_Settings::ID, null );
1058
-
1059
- if ( isset( $options[ $option ] ) ) {
1060
- return $options[ $option ];
1061
- } else {
1062
- return $default;
1063
- }
1064
- }
1065
-
1066
-
1067
- function tw_set_option( $option, $value = null ) {
1068
- $options = get_option( Testimonials_Widget_Settings::ID );
1069
-
1070
- if ( ! is_array( $options ) ) {
1071
- $options = array();
1072
- }
1073
-
1074
- $options[ $option ] = $value;
1075
- update_option( Testimonials_Widget_Settings::ID, $options );
1076
- }
1077
-
1078
-
1079
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/includes/class-testimonials-widget-slider-widget.php DELETED
@@ -1,116 +0,0 @@
1
- <?php
2
- /**
3
- Testimonials Widget
4
- Copyright (C) 2014 Michael Cannon
5
-
6
- This program is free software; you can redistribute it and/or modify
7
- it under the terms of the GNU General Public License as published by
8
- the Free Software Foundation; either version 2 of the License, or
9
- (at your option) any later version.
10
-
11
- This program is distributed in the hope that it will be useful,
12
- but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
- GNU General Public License for more details.
15
-
16
- You should have received a copy of the GNU General Public License along
17
- with this program; if not, write to the Free Software Foundation, Inc.,
18
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19
- */
20
-
21
- require_once AIHR_DIR_INC . 'class-aihrus-widget.php';
22
-
23
- if ( class_exists( 'Testimonials_Widget_Slider_Widget' ) ) {
24
- return;
25
- }
26
-
27
-
28
- class Testimonials_Widget_Slider_Widget extends Aihrus_Widget {
29
- // should be tw_slider_widget, but for backwards compliance left alone
30
- const ID = 'testimonials_widget';
31
-
32
-
33
- public function __construct() {
34
- $classname = __CLASS__;
35
- $description = esc_html__( 'Displays rotating testimonials or statically.', 'testimonials-widget' );
36
- $id_base = self::ID;
37
- $title = esc_html__( 'Testimonials Slider', 'testimonials-widget' );
38
-
39
- parent::__construct( $classname, $description, $id_base, $title );
40
- }
41
-
42
-
43
- public static function get_testimonials_css() {
44
- Testimonials_Widget::get_testimonials_css();
45
- }
46
-
47
-
48
- public static function get_testimonials_scripts() {
49
- Testimonials_Widget::get_testimonials_scripts();
50
- }
51
-
52
-
53
- public static function get_defaults() {
54
- return Testimonials_Widget::get_defaults();
55
- }
56
-
57
-
58
- public static function get_content( $instance = null, $widget_number = null ) {
59
- return Testimonials_Widget::testimonials_slider( $instance, $widget_number );
60
- }
61
-
62
-
63
- public static function form_instance( $instance ) {
64
- $do_number = true;
65
- if ( empty( $instance ) ) {
66
- $do_number = false;
67
-
68
- $instance['char_limit'] = 500;
69
- $instance['random'] = 1;
70
- } elseif ( ! empty( $instance['resetted'] ) ) {
71
- if ( empty( $instance['char_limit'] ) ) {
72
- $instance['char_limit'] = 500;
73
- }
74
-
75
- if ( empty( $instance['random'] ) ) {
76
- $instance['random'] = 1;
77
- }
78
- }
79
-
80
- $instance['do_number'] = $do_number;
81
-
82
- return $instance;
83
- }
84
-
85
-
86
- public static function form_parts( $instance = null, $number = null ) {
87
- $form_parts = Testimonials_Widget_Settings::get_settings();
88
-
89
- if ( ! empty( $instance['do_number'] ) ) {
90
- $std = ' .' . Testimonials_Widget::ID . $number;
91
-
92
- $form_parts['css_class'] = array(
93
- 'section' => 'widget',
94
- 'type' => 'readonly',
95
- 'title' => esc_html__( 'CSS Class', 'testimonials-widget' ),
96
- 'desc' => esc_html__( 'This widget\'s unique CSS class for styling', 'testimonials-widget' ),
97
- 'std' => $std,
98
- 'widget' => 1,
99
- );
100
- }
101
-
102
- $form_parts = apply_filters( 'tw_slider_widget_options', $form_parts );
103
-
104
- return $form_parts;
105
- }
106
-
107
-
108
- public static function get_suggest( $id, $suggest_id ) {
109
- return Testimonials_Widget_Settings::get_suggest( $id, $suggest_id );
110
- }
111
-
112
-
113
- }
114
-
115
-
116
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/includes/class-testimonials-widget-tag-cloud-widget.php DELETED
@@ -1,95 +0,0 @@
1
- <?php
2
- /**
3
- Testimonials Widget
4
- Copyright (C) 2014 Michael Cannon
5
-
6
- This program is free software; you can redistribute it and/or modify
7
- it under the terms of the GNU General Public License as published by
8
- the Free Software Foundation; either version 2 of the License, or
9
- (at your option) any later version.
10
-
11
- This program is distributed in the hope that it will be useful,
12
- but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
- GNU General Public License for more details.
15
-
16
- You should have received a copy of the GNU General Public License along
17
- with this program; if not, write to the Free Software Foundation, Inc.,
18
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19
- */
20
-
21
- require_once AIHR_DIR_INC . 'class-aihrus-widget.php';
22
-
23
- if ( class_exists( 'Testimonials_Widget_Tag_Cloud_Widget' ) ) {
24
- return;
25
- }
26
-
27
-
28
- class Testimonials_Widget_Tag_Cloud_Widget extends Aihrus_Widget {
29
- const ID = 'tw_tag_cloud_widget';
30
-
31
- public static $title;
32
-
33
-
34
- public function __construct() {
35
- $classname = __CLASS__;
36
- $description = esc_html__( 'A cloud of your most used testimonials\' tags.', 'testimonials-widget' );
37
- $id_base = self::ID;
38
- self::$title = esc_html__( 'Testimonials Tag Cloud', 'testimonials-widget' );
39
-
40
- parent::__construct( $classname, $description, $id_base, self::$title );
41
- }
42
-
43
-
44
- /**
45
- * @SuppressWarnings(PHPMD.UnusedFormalParameter)
46
- */
47
- public static function get_content( $instance = null, $widget_number = null ) {
48
- return Testimonials_Widget::testimonials_tag_cloud( $instance, $widget_number );
49
- }
50
-
51
-
52
- /**
53
- * @SuppressWarnings(PHPMD.UnusedFormalParameter)
54
- */
55
- public static function form_parts( $instance = null, $number = null ) {
56
- $form_parts = parent::form_parts( $instance, $number );
57
-
58
- $form_parts['title']['std'] = self::$title;
59
-
60
- $use_cpt_taxonomy = tw_get_option( 'use_cpt_taxonomy', false );
61
- if ( ! $use_cpt_taxonomy ) {
62
- $options = array(
63
- 'category' => esc_html__( 'Category', 'testimonials-widget' ),
64
- 'post_tag' => esc_html__( 'Tags', 'testimonials-widget' ),
65
- );
66
-
67
- $std = 'post_tag';
68
- } else {
69
- $options = array(
70
- Testimonials_Widget::$cpt_category => esc_html__( 'Category', 'testimonials-widget' ),
71
- Testimonials_Widget::$cpt_tags => esc_html__( 'Tags', 'testimonials-widget' ),
72
- );
73
-
74
- $std = Testimonials_Widget::$cpt_tags;
75
- }
76
-
77
- $form_parts['taxonomy'] = array(
78
- 'title' => esc_html__( 'Taxonomy', 'testimonials-widget' ),
79
- 'type' => 'select',
80
- 'choices' => $options,
81
- 'std' => $std,
82
- );
83
-
84
- foreach ( $form_parts as $id => $parts ) {
85
- $form_parts[ $id ] = wp_parse_args( $parts, self::$default );
86
- }
87
-
88
- $form_parts = apply_filters( 'tw_tag_cloud_widget_options', $form_parts );
89
-
90
- return $form_parts;
91
- }
92
- }
93
-
94
-
95
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/includes/class-testimonials-widget-template-loader.php DELETED
@@ -1,45 +0,0 @@
1
- <?php
2
- /**
3
- Testimonials Widget
4
- Copyright (C) 2014 Michael Cannon
5
-
6
- This program is free software; you can redistribute it and/or modify
7
- it under the terms of the GNU General Public License as published by
8
- the Free Software Foundation; either version 2 of the License, or
9
- (at your option) any later version.
10
-
11
- This program is distributed in the hope that it will be useful,
12
- but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
- GNU General Public License for more details.
15
-
16
- You should have received a copy of the GNU General Public License along
17
- with this program; if not, write to the Free Software Foundation, Inc.,
18
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19
- */
20
-
21
- /**
22
- * Testimonials template loader class
23
- *
24
- * @ref https://github.com/GaryJones/Gamajo-Template-Loader
25
- */
26
-
27
- require_once TW_DIR_LIB . 'Gamajo-Template-Loader/class-gamajo-template-loader.php';
28
-
29
- if ( class_exists( 'Testimonials_Widget_Template_Loader' ) ) {
30
- return;
31
- }
32
-
33
-
34
- /**
35
- *
36
- *
37
- * @SuppressWarnings(PHPMD.LongVariable)
38
- */
39
- class Testimonials_Widget_Template_Loader extends Gamajo_Template_Loader {
40
- protected $filter_prefix = 'testimonials_widget';
41
- protected $theme_template_directory = 'testimonials-widget';
42
- protected $plugin_directory = TW_DIR;
43
- }
44
-
45
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/includes/class-testimonials-widget-widget.php DELETED
@@ -1,117 +0,0 @@
1
- <?php
2
- /*
3
- Copyright 2014 Michael Cannon (email: mc@aihr.us)
4
-
5
- This program is free software; you can redistribute it and/or modify
6
- it under the terms of the GNU General Public License, version 2, as
7
- published by the Free Software Foundation.
8
-
9
- This program is distributed in the hope that it will be useful,
10
- but WITHOUT ANY WARRANTY; without even the implied warranty of
11
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
- GNU General Public License for more details.
13
-
14
- You should have received a copy of the GNU General Public License
15
- along with this program; if not, write to the Free Software
16
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17
- */
18
-
19
- require_once AIHR_DIR_INC . 'class-aihrus-widget.php';
20
-
21
- if ( class_exists( 'Testimonials_Widget_Widget' ) )
22
- return;
23
-
24
-
25
- class Testimonials_Widget_Widget extends Aihrus_Widget {
26
- const ID = 'testimonials_widget';
27
-
28
- public function __construct( $classname = null, $description = null, $id_base = null, $title = null ) {
29
- $classname = 'Testimonials_Widget_Widget';
30
- $description = esc_html__( 'Display testimonials with multiple selection and display options', 'testimonials-widget' );
31
- $id_base = self::ID;
32
- $title = esc_html__( 'Testimonials', 'testimonials-widget' );
33
-
34
- parent::__construct( $classname, $description, $id_base, $title );
35
- }
36
-
37
-
38
- public static function get_testimonials_css() {
39
- Testimonials_Widget::get_testimonials_css();
40
- }
41
-
42
-
43
- public static function get_testimonials_scripts() {
44
- Testimonials_Widget::get_testimonials_scripts();
45
- }
46
-
47
-
48
- public static function get_defaults() {
49
- return Testimonials_Widget::get_defaults();
50
- }
51
-
52
-
53
- public static function get_content( $instance, $widget_number ) {
54
- return Testimonials_Widget::testimonials_slider( $instance, $widget_number );
55
- }
56
-
57
-
58
- public static function validate_settings( $instance ) {
59
- return Testimonials_Widget_Settings::validate_settings( $instance );
60
- }
61
-
62
-
63
- public static function form_instance( $instance ) {
64
- $do_number = true;
65
- if ( empty( $instance ) ) {
66
- $do_number = false;
67
-
68
- $instance['char_limit'] = 500;
69
- $instance['random'] = 1;
70
- $instance['enable_schema'] = 0;
71
- } elseif ( ! empty( $instance['resetted'] ) ) {
72
- if ( empty( $instance['char_limit'] ) )
73
- $instance['char_limit'] = 500;
74
-
75
- if ( empty( $instance['random'] ) )
76
- $instance['random'] = 1;
77
-
78
- $instance['enable_schema'] = 0;
79
- }
80
-
81
- $instance['do_number'] = $do_number;
82
-
83
- return $instance;
84
- }
85
-
86
-
87
- public static function form_parts( $instance, $number ) {
88
- $form_parts = Testimonials_Widget_Settings::get_settings();
89
-
90
- if ( ! empty( $instance['do_number'] ) ) {
91
- $std = ' .' . Testimonials_Widget::ID . $number;
92
-
93
- $form_parts['css_class'] = array(
94
- 'section' => 'widget',
95
- 'type' => 'readonly',
96
- 'title' => esc_html__( 'CSS Class', 'testimonials-widget' ),
97
- 'desc' => esc_html__( 'This widget\'s unique CSS class for styling', 'testimonials-widget' ),
98
- 'std' => $std,
99
- 'widget' => 1,
100
- );
101
- }
102
-
103
- $form_parts = apply_filters( 'testimonials_widget_widget_options', $form_parts );
104
-
105
- return $form_parts;
106
- }
107
-
108
-
109
- public static function get_suggest( $id, $suggest_id ) {
110
- return Testimonials_Widget_Settings::get_suggest( $id, $suggest_id );
111
- }
112
-
113
-
114
- }
115
-
116
-
117
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/includes/class-testimonials-widget.php DELETED
@@ -1,2322 +0,0 @@
1
- <?php
2
- /**
3
- Testimonials Widget
4
- Copyright (C) 2014 Michael Cannon
5
-
6
- This program is free software; you can redistribute it and/or modify
7
- it under the terms of the GNU General Public License as published by
8
- the Free Software Foundation; either version 2 of the License, or
9
- (at your option) any later version.
10
-
11
- This program is distributed in the hope that it will be useful,
12
- but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
- GNU General Public License for more details.
15
-
16
- You should have received a copy of the GNU General Public License along
17
- with this program; if not, write to the Free Software Foundation, Inc.,
18
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19
- */
20
-
21
- require_once AIHR_DIR_INC . 'class-aihrus-common.php';
22
- require_once AIHR_DIR_LIB . 'class-redrokk-metabox-class.php';
23
- require_once TW_DIR_INC . 'class-testimonials-widget-archives-widget.php';
24
- require_once TW_DIR_INC . 'class-testimonials-widget-categories-widget.php';
25
- require_once TW_DIR_INC . 'class-testimonials-widget-recent-testimonials-widget.php';
26
- require_once TW_DIR_INC . 'class-testimonials-widget-settings.php';
27
- require_once TW_DIR_INC . 'class-testimonials-widget-slider-widget.php';
28
- require_once TW_DIR_INC . 'class-testimonials-widget-tag-cloud-widget.php';
29
- require_once TW_DIR_INC . 'class-testimonials-widget-template-loader.php';
30
-
31
- if ( class_exists( 'Testimonials_Widget' ) ) {
32
- return;
33
- }
34
-
35
-
36
- class Testimonials_Widget extends Aihrus_Common {
37
- const BASE = TW_BASE;
38
- const ID = 'testimonials-widget-testimonials';
39
- const SLUG = 'tw_';
40
- const VERSION = TW_VERSION;
41
-
42
- const PT = 'testimonials-widget';
43
-
44
- public static $class = __CLASS__;
45
- public static $cpt_category;
46
- public static $cpt_tags;
47
- public static $css = array();
48
- public static $css_called = false;
49
- public static $instance_number = 0;
50
- public static $instance_widget = 0;
51
- public static $library_assets;
52
- public static $max_num_pages = 0;
53
- public static $menu_shortcodes;
54
- public static $notice_key;
55
- public static $not_found = false;
56
- public static $plugin_assets;
57
- public static $post_count = 0;
58
- public static $scripts = array();
59
- public static $scripts_called = false;
60
- public static $settings_link;
61
- public static $tag_close_quote = '<span class="close-quote"></span>';
62
- public static $tag_open_quote = '<span class="open-quote"></span>';
63
- public static $template_loader;
64
- public static $use_instance = false;
65
- public static $widget_number = 100000;
66
- public static $wp_query;
67
-
68
- public static $aggregate_count = 'reviewCount';
69
- public static $aggregate_data = array();
70
- public static $aggregate_no_item = '__NO_ITEM__';
71
- public static $aggregate_rating = 'aggregateRating';
72
- public static $aggregate_schema = 'http://schema.org/AggregateRating';
73
-
74
- public static $cw_author = 'author';
75
- public static $cw_date = 'datePublished';
76
- public static $cw_date_mod = 'dateModified';
77
- public static $cw_review = 'review';
78
- public static $cw_source_org = 'sourceOrganization';
79
-
80
- public static $org_location = 'location';
81
- public static $org_schema = 'http://schema.org/Organization';
82
-
83
- public static $person_email = 'email';
84
- public static $person_home = 'homeLocation';
85
- public static $person_job_title = 'jobTitle';
86
- public static $person_schema = 'http://schema.org/Person';
87
- public static $person_member = 'memberOf';
88
-
89
- public static $place_schema = 'http://schema.org/Place';
90
-
91
- public static $review_body = 'reviewBody';
92
- public static $review_item = 'itemReviewed';
93
- public static $review_schema = 'http://schema.org/Review';
94
-
95
- public static $schema_div_open = '<div itemscope itemtype="%1$s">';
96
- public static $schema_div_prop = '<div itemprop="%1$s" itemscope itemtype="%2$s">%3$s</div>';
97
- public static $schema_item_prop = 'itemprop="%1$s"';
98
- public static $schema_meta = '<meta itemprop="%1$s" content="%2$s" />';
99
-
100
- public static $thing_image = 'image';
101
- public static $thing_name = 'name';
102
- public static $thing_schema = 'http://schema.org/Thing';
103
- public static $thing_url = 'url';
104
-
105
-
106
- public function __construct() {
107
- parent::__construct();
108
-
109
- self::$library_assets = plugins_url( '/includes/libraries/', dirname( __FILE__ ) );
110
- self::$library_assets = self::strip_protocol( self::$library_assets );
111
-
112
- self::$plugin_assets = plugins_url( '/assets/', dirname( __FILE__ ) );
113
- self::$plugin_assets = self::strip_protocol( self::$plugin_assets );
114
-
115
- add_action( 'admin_init', array( __CLASS__, 'admin_init' ) );
116
- add_action( 'admin_menu', array( __CLASS__, 'admin_menu' ) );
117
- add_action( 'dashboard_glance_items', array( __CLASS__, 'dashboard_glance_items' ) );
118
- add_action( 'init', array( __CLASS__, 'init' ) );
119
- add_action( 'widgets_init', array( __CLASS__, 'widgets_init' ) );
120
- add_shortcode( 'testimonials', array( __CLASS__, 'testimonials' ) );
121
- add_shortcode( 'testimonialswidget_list', array( __CLASS__, 'testimonials' ) );
122
- add_shortcode( 'testimonialswidget_widget', array( __CLASS__, 'testimonials_slider' ) );
123
- add_shortcode( 'testimonials_archives', array( __CLASS__, 'testimonials_archives' ) );
124
- add_shortcode( 'testimonials_categories', array( __CLASS__, 'testimonials_categories' ) );
125
- add_shortcode( 'testimonials_examples', array( __CLASS__, 'testimonials_examples' ) );
126
- add_shortcode( 'testimonials_options', array( __CLASS__, 'testimonials_options' ) );
127
- add_shortcode( 'testimonials_recent', array( __CLASS__, 'testimonials_recent' ) );
128
- add_shortcode( 'testimonials_slider', array( __CLASS__, 'testimonials_slider' ) );
129
- add_shortcode( 'testimonials_tag_cloud', array( __CLASS__, 'testimonials_tag_cloud' ) );
130
- }
131
-
132
-
133
- public static function admin_init() {
134
- self::support_thumbnails();
135
-
136
- self::$settings_link = '<a href="' . get_admin_url() . 'edit.php?post_type=' . self::PT . '&page=' . Testimonials_Widget_Settings::ID . '">' . esc_html__( 'Settings', 'testimonials-widget' ) . '</a>';
137
-
138
- self::add_meta_box_testimonials_widget();
139
- self::update();
140
-
141
- add_action( 'manage_' . self::PT . '_posts_custom_column', array( __CLASS__, 'manage_posts_custom_column' ), 10, 2 );
142
- add_action( 'right_now_content_table_end', array( __CLASS__, 'right_now_content_table_end' ) );
143
- add_filter( 'manage_' . self::PT . '_posts_columns', array( __CLASS__, 'manage_posts_columns' ) );
144
- add_filter( 'plugin_action_links', array( __CLASS__, 'plugin_action_links' ), 10, 2 );
145
- add_filter( 'plugin_row_meta', array( __CLASS__, 'plugin_row_meta' ), 10, 2 );
146
- add_filter( 'post_updated_messages', array( __CLASS__, 'post_updated_messages' ) );
147
- add_filter( 'pre_get_posts', array( __CLASS__, 'pre_get_posts_author' ) );
148
-
149
- if ( self::do_load() ) {
150
- add_filter( 'manage_' . self::PT . '-category_custom_column', array( __CLASS__, 'category_column' ), 10, 3 );
151
- add_filter( 'manage_' . self::PT . '-post_tag_custom_column', array( __CLASS__, 'post_tag_column' ), 10, 3 );
152
- add_filter( 'manage_category_custom_column', array( __CLASS__, 'category_column' ), 10, 3 );
153
- add_filter( 'manage_edit-' . self::PT . '-category_columns', array( __CLASS__, 'category_columns' ) );
154
- add_filter( 'manage_edit-' . self::PT . '-post_tag_columns', array( __CLASS__, 'category_columns' ) );
155
- add_filter( 'manage_edit-category_columns', array( __CLASS__, 'category_columns' ) );
156
- add_filter( 'manage_edit-post_tag_columns', array( __CLASS__, 'category_columns' ) );
157
- add_filter( 'manage_post_tag_custom_column', array( __CLASS__, 'post_tag_column' ), 10, 3 );
158
- }
159
- }
160
-
161
-
162
- public static function admin_menu() {
163
- }
164
-
165
-
166
- public static function init() {
167
- add_filter( 'the_content', array( __CLASS__, 'get_single' ) );
168
- $enable_archives = tw_get_option( 'enable_archives' );
169
- if ( $enable_archives ) {
170
- add_filter( 'pre_get_posts', array( __CLASS__, 'pre_get_posts_allow_testimonials' ) );
171
- }
172
-
173
- load_plugin_textdomain( self::PT, false, 'testimonials-widget/languages' );
174
-
175
- self::$cpt_category = self::PT . '-category';
176
- self::$cpt_tags = self::PT . '-post_tag';
177
-
178
- self::init_post_type();
179
- self::styles();
180
-
181
- add_action( 'generate_rewrite_rules', array( __CLASS__, 'generate_rewrite_rules' ) );
182
- }
183
-
184
-
185
- public static function plugin_action_links( $links, $file ) {
186
- if ( self::BASE == $file ) {
187
- array_unshift( $links, self::$settings_link );
188
- }
189
-
190
- return $links;
191
- }
192
-
193
-
194
- public static function add_instance() {
195
- self::$use_instance = false;
196
- self::$instance_number++;
197
-
198
- return self::$instance_number;
199
- }
200
-
201
-
202
- public static function get_instance() {
203
- return self::$use_instance ? self::$instance_number : self::$instance_widget;
204
- }
205
-
206
-
207
- public static function set_instance( $widget_number ) {
208
- self::$use_instance = true;
209
- self::$instance_widget = $widget_number;
210
- }
211
-
212
-
213
- public static function support_thumbnails() {
214
- $feature = 'post-thumbnails';
215
- $feature_level = get_theme_support( $feature );
216
-
217
- if ( true === $feature_level ) {
218
- // already enabled for all post types
219
- return;
220
- } elseif ( false === $feature_level ) {
221
- // none allowed, only enable for our own
222
- add_theme_support( $feature, array( self::PT ) );
223
- } else {
224
- // add our own to list of supported
225
- $feature_level[0][] = self::PT;
226
- add_theme_support( $feature, $feature_level[0] );
227
- }
228
- }
229
-
230
-
231
- public static function get_single( $content ) {
232
- global $post;
233
-
234
- if ( ! is_single() || self::PT != $post->post_type ) {
235
- return $content;
236
- }
237
-
238
- $atts = self::get_defaults( true );
239
- $atts['hide_content'] = 1;
240
- $atts['ids'] = $post->ID;
241
- $atts['type'] = 'get_single';
242
-
243
- $instance = self::add_instance();
244
- $atts['widget_number'] = $instance;
245
-
246
- $testimonials = array();
247
-
248
- $text = apply_filters( 'tw_cache_get', false, $atts );
249
- if ( false === $text ) {
250
- $testimonials = self::get_testimonials( $atts );
251
- $testimonial = $testimonials[0];
252
-
253
- $details = self::get_testimonial_html( $testimonial, $atts );
254
- $details = apply_filters( 'tw_testimonial_html_single', $details, $testimonial, $atts );
255
-
256
- $content = self::do_video( $content, $atts );
257
- $content = apply_filters( 'tw_testimonial_html_single_content', $content, $testimonial, $atts );
258
-
259
- $text = $content . $details;
260
- $text = apply_filters( 'tw_cache_set', $text, $atts );
261
- }
262
-
263
- self::call_scripts_styles( $testimonials, $atts, $instance );
264
-
265
- return $text;
266
- }
267
-
268
-
269
- public static function activation() {
270
- if ( ! current_user_can( 'activate_plugins' ) ) {
271
- return;
272
- }
273
-
274
- self::init();
275
- flush_rewrite_rules();
276
- }
277
-
278
-
279
- public static function deactivation() {
280
- if ( ! current_user_can( 'activate_plugins' ) ) {
281
- return;
282
- }
283
-
284
- flush_rewrite_rules();
285
- }
286
-
287
-
288
- public static function uninstall() {
289
- if ( ! current_user_can( 'activate_plugins' ) ) {
290
- return;
291
- }
292
-
293
- global $wpdb;
294
-
295
- require_once TW_DIR_INC . 'class-testimonials-widget-settings.php';
296
-
297
- $delete_data = tw_get_option( 'delete_data', false );
298
- if ( $delete_data ) {
299
- delete_option( Testimonials_Widget_Settings::ID );
300
- $wpdb->query( 'OPTIMIZE TABLE `' . $wpdb->options . '`' );
301
-
302
- self::delete_testimonials();
303
- }
304
- }
305
-
306
-
307
- public static function delete_testimonials() {
308
- global $wpdb;
309
-
310
- $query = "SELECT ID FROM {$wpdb->posts} WHERE post_type = '" . self::PT . "'";
311
- $posts = $wpdb->get_results( $query );
312
-
313
- foreach ( $posts as $post ) {
314
- $post_id = $post->ID;
315
- self::delete_attachments( $post_id );
316
-
317
- // dels post, meta & comments
318
- // true is force delete
319
- wp_delete_post( $post_id, true );
320
- }
321
-
322
- $wpdb->query( 'OPTIMIZE TABLE `' . $wpdb->postmeta . '`' );
323
- $wpdb->query( 'OPTIMIZE TABLE `' . $wpdb->posts . '`' );
324
- }
325
-
326
-
327
- public static function delete_attachments( $post_id = false ) {
328
- global $wpdb;
329
-
330
- $post_id = $post_id ? $post_id : 0;
331
- $query = "SELECT ID FROM {$wpdb->posts} WHERE post_type = 'attachment' AND post_parent = {$post_id}";
332
- $attachments = $wpdb->get_results( $query );
333
-
334
- foreach ( $attachments as $attachment ) {
335
- // true is force delete
336
- wp_delete_attachment( $attachment->ID, true );
337
- }
338
- }
339
-
340
-
341
- public static function plugin_row_meta( $input, $file ) {
342
- if ( self::BASE != $file ) {
343
- return $input;
344
- }
345
-
346
- $disable_donate = tw_get_option( 'disable_donate' );
347
- if ( $disable_donate ) {
348
- return $input;
349
- }
350
-
351
- $links = array(
352
- self::$donate_link,
353
- );
354
-
355
- global $TW_Premium;
356
- if ( ! isset( $TW_Premium ) ) {
357
- $links[] = TW_PREMIUM_LINK;
358
- }
359
-
360
- $input = array_merge( $input, $links );
361
-
362
- return $input;
363
- }
364
-
365
-
366
- public static function notice_2_12_0() {
367
- $text = sprintf( __( 'If your Testimonials display has gone to funky town, please <a href="%s">read the FAQ</a> about possible CSS fixes.', 'testimonials-widget' ), esc_url( 'https://aihrus.zendesk.com/entries/23722573-Major-Changes-Since-2-10-0' ) );
368
-
369
- aihr_notice_updated( $text );
370
- }
371
-
372
-
373
- /**
374
- * @SuppressWarnings(PHPMD.UnusedFormalParameter)
375
- */
376
- public static function notice_donate( $disable_donate = null, $item_name = null ) {
377
- $disable_donate = tw_get_option( 'disable_donate' );
378
-
379
- parent::notice_donate( $disable_donate, TW_NAME );
380
- }
381
-
382
-
383
- public static function update() {
384
- $prior_version = tw_get_option( 'admin_notices' );
385
- if ( $prior_version ) {
386
- if ( $prior_version < '2.12.0' ) {
387
- self::set_notice( 'notice_2_12_0' );
388
- }
389
-
390
- if ( $prior_version < '2.15.0' ) {
391
- self::set_notice( 'notice_2_15_0' );
392
- }
393
-
394
- if ( $prior_version < self::VERSION ) {
395
- tw_requirements_check( true );
396
- do_action( 'tw_update' );
397
- }
398
-
399
- tw_set_option( 'admin_notices' );
400
- }
401
-
402
- // display donate on major/minor version release
403
- $donate_version = tw_get_option( 'donate_version', false );
404
- if ( ! $donate_version || ( $donate_version != self::VERSION && preg_match( '#\.0$#', self::VERSION ) ) ) {
405
- self::set_notice( 'notice_donate' );
406
- tw_set_option( 'donate_version', self::VERSION );
407
- }
408
- }
409
-
410
-
411
- public static function pre_get_posts_author( $query ) {
412
- global $user_ID;
413
-
414
- // author's and below
415
- if ( $query->is_admin ) {
416
- if ( empty( $query->is_main_query ) ) {
417
- if ( $query->is_post_type_archive( self::PT ) ) {
418
- if ( ! current_user_can( 'edit_others_posts' ) ) {
419
- $query->set( 'post_author', $user_ID );
420
- }
421
- }
422
- }
423
- }
424
-
425
- return $query;
426
- }
427
-
428
-
429
- public static function manage_posts_custom_column( $column, $post_id ) {
430
- $result = false;
431
-
432
- switch ( $column ) {
433
- case 'id':
434
- $result = $post_id;
435
- break;
436
-
437
- case 'shortcode':
438
- $result = '[testimonials ids="';
439
- $result .= $post_id;
440
- $result .= '"]';
441
- $result .= '<br />';
442
- $result .= '[testimonials_slider ids="';
443
- $result .= $post_id;
444
- $result .= '"]';
445
- break;
446
-
447
- case 'testimonials-widget-author':
448
- case 'testimonials-widget-company':
449
- case 'testimonials-widget-location':
450
- case 'testimonials-widget-title':
451
- $result = get_post_meta( $post_id, $column, true );
452
- break;
453
-
454
- case 'testimonials-widget-email':
455
- case 'testimonials-widget-url':
456
- $url = get_post_meta( $post_id, $column, true );
457
- if ( ! empty( $url ) && ! is_email( $url ) && 0 === preg_match( '#https?://#', $url ) ) {
458
- $url = 'http://' . $url;
459
- }
460
-
461
- $result = make_clickable( $url );
462
- break;
463
-
464
- case 'thumbnail':
465
- $email = get_post_meta( $post_id, 'testimonials-widget-email', true );
466
-
467
- if ( has_post_thumbnail( $post_id ) ) {
468
- $result = get_the_post_thumbnail( $post_id, 'thumbnail' );
469
- } elseif ( is_email( $email ) ) {
470
- $result = get_avatar( $email );
471
- } else {
472
- $result = false;
473
- }
474
- break;
475
-
476
- case self::$cpt_category:
477
- case self::$cpt_tags:
478
- $terms = get_the_terms( $post_id, $column );
479
- $result = '';
480
- if ( ! empty( $terms ) ) {
481
- $out = array();
482
- foreach ( $terms as $term ) {
483
- $out[] = '<a href="' . admin_url( 'edit-tags.php?action=edit&taxonomy=' . $column . '&tag_ID=' . $term->term_id . '&post_type=' . self::PT ) . '">' . $term->name . '</a>';
484
- }
485
-
486
- $result = join( ', ', $out );
487
- }
488
- break;
489
- }
490
-
491
- $result = apply_filters( 'tw_posts_custom_column', $result, $column, $post_id );
492
-
493
- if ( $result ) {
494
- echo $result;
495
- }
496
- }
497
-
498
-
499
- public static function manage_posts_columns( $columns ) {
500
- // order of keys matches column ordering
501
- $columns = array(
502
- 'cb' => '<input type="checkbox" />',
503
- 'title' => esc_html__( 'Author', 'testimonials-widget' ),
504
- 'author' => esc_html__( 'Published by', 'testimonials-widget' ),
505
- 'date' => esc_html__( 'Date', 'testimonials-widget' ),
506
- );
507
-
508
- $use_cpt_taxonomy = tw_get_option( 'use_cpt_taxonomy', false );
509
- if ( ! $use_cpt_taxonomy ) {
510
- $columns['categories'] = esc_html__( 'Category', 'testimonials-widget' );
511
- $columns['tags'] = esc_html__( 'Tags', 'testimonials-widget' );
512
- } else {
513
- $columns[ self::$cpt_category ] = esc_html__( 'Category', 'testimonials-widget' );
514
- $columns[ self::$cpt_tags ] = esc_html__( 'Tags', 'testimonials-widget' );
515
- }
516
-
517
- $show_id = tw_get_option( 'columns_id' );
518
- if ( empty( $show_id ) ) {
519
- $columns['id'] = esc_html__( 'ID', 'testimonials-widget' );
520
- }
521
-
522
- $show_thumbnail = tw_get_option( 'columns_thumbnail' );
523
- if ( empty( $show_thumbnail ) ) {
524
- $columns['thumbnail'] = esc_html__( 'Image', 'testimonials-widget' );
525
- }
526
-
527
- $show_shortcode = tw_get_option( 'columns_shortcode' );
528
- if ( empty( $show_shortcode ) ) {
529
- $columns['shortcode'] = esc_html__( 'Shortcodes', 'testimonials-widget' );
530
- }
531
-
532
- $show_author = tw_get_option( 'columns_author' );
533
- if ( empty( $show_author ) ) {
534
- $columns['testimonials-widget-author'] = esc_html__( 'Author', 'testimonials-widget' );
535
- }
536
-
537
- $show_job_title = tw_get_option( 'columns_job_title' );
538
- if ( empty( $show_job_title ) ) {
539
- $columns['testimonials-widget-title'] = esc_html__( 'Job Title', 'testimonials-widget' );
540
- }
541
-
542
- $show_location = tw_get_option( 'columns_location' );
543
- if ( empty( $show_location ) ) {
544
- $columns['testimonials-widget-location'] = esc_html__( 'Location', 'testimonials-widget' );
545
- }
546
-
547
- $show_company = tw_get_option( 'columns_company' );
548
- if ( empty( $show_company ) ) {
549
- $columns['testimonials-widget-company'] = esc_html__( 'Company', 'testimonials-widget' );
550
- }
551
-
552
- $show_email = tw_get_option( 'columns_email' );
553
- if ( empty( $show_email ) ) {
554
- $columns['testimonials-widget-email'] = esc_html__( 'Email', 'testimonials-widget' );
555
- }
556
-
557
- $show_url = tw_get_option( 'columns_url' );
558
- if ( empty( $show_url ) ) {
559
- $columns['testimonials-widget-url'] = esc_html__( 'URL', 'testimonials-widget' );
560
- }
561
-
562
- $columns = apply_filters( 'tw_columns', $columns );
563
-
564
- return $columns;
565
- }
566
-
567
-
568
- public static function init_post_type() {
569
- $labels = array(
570
- 'add_new' => esc_html__( 'Add New', 'testimonials-widget' ),
571
- 'add_new_item' => esc_html__( 'Add New Testimonial', 'testimonials-widget' ),
572
- 'edit_item' => esc_html__( 'Edit Testimonial', 'testimonials-widget' ),
573
- 'name' => esc_html__( 'Testimonials', 'testimonials-widget' ),
574
- 'new_item' => esc_html__( 'Add New Testimonial', 'testimonials-widget' ),
575
- 'not_found' => esc_html__( 'No testimonials found', 'testimonials-widget' ),
576
- 'not_found_in_trash' => esc_html__( 'No testimonials found in Trash', 'testimonials-widget' ),
577
- 'parent_item_colon' => null,
578
- 'search_items' => esc_html__( 'Search Testimonials', 'testimonials-widget' ),
579
- 'singular_name' => esc_html__( 'Testimonial', 'testimonials-widget' ),
580
- 'view_item' => esc_html__( 'View Testimonial', 'testimonials-widget' ),
581
- );
582
-
583
- $supports = array(
584
- 'title',
585
- 'editor',
586
- 'thumbnail',
587
- 'publicize',
588
- );
589
-
590
- $allow_comments = tw_get_option( 'allow_comments', false );
591
- if ( $allow_comments ) {
592
- $supports[] = 'comments';
593
- }
594
-
595
- $has_archive = tw_get_option( 'has_archive', true );
596
- $rewrite_slug = tw_get_option( 'rewrite_slug', 'testimonial' );
597
- $use_cpt_taxonomy = tw_get_option( 'use_cpt_taxonomy', false );
598
-
599
- // editor's and up
600
- if ( current_user_can( 'edit_others_posts' ) ) {
601
- $supports[] = 'author';
602
- }
603
-
604
- if ( ! $use_cpt_taxonomy ) {
605
- $do_register_taxonomy = false;
606
- $taxonomies = array(
607
- 'category',
608
- 'post_tag',
609
- );
610
- } else {
611
- $do_register_taxonomy = true;
612
- $taxonomies = array(
613
- self::$cpt_category,
614
- self::$cpt_tags,
615
- );
616
-
617
- self::register_taxonomies();
618
- }
619
-
620
- $args = array(
621
- 'label' => esc_html__( 'Testimonials', 'testimonials-widget' ),
622
- 'capability_type' => 'post',
623
- 'has_archive' => $has_archive,
624
- 'hierarchical' => false,
625
- 'labels' => $labels,
626
- 'public' => true,
627
- 'publicly_queryable' => true,
628
- 'query_var' => true,
629
- 'rewrite' => array(
630
- 'slug' => $rewrite_slug,
631
- 'with_front' => false,
632
- ),
633
- 'supports' => $supports,
634
- 'taxonomies' => $taxonomies,
635
- );
636
-
637
- $args = apply_filters( 'tw_register_post_type_args', $args );
638
- register_post_type( self::PT, $args );
639
-
640
- if ( $do_register_taxonomy ) {
641
- register_taxonomy_for_object_type( self::$cpt_category, self::PT );
642
- register_taxonomy_for_object_type( self::$cpt_tags, self::PT );
643
- }
644
- }
645
-
646
-
647
- public static function register_taxonomies() {
648
- $args = array(
649
- 'hierarchical' => true,
650
- 'show_admin_column' => true,
651
- );
652
- $args = apply_filters( 'tw_register_category_args', $args );
653
- register_taxonomy( self::$cpt_category, self::PT, $args );
654
-
655
- $args = array(
656
- 'show_admin_column' => true,
657
- 'update_count_callback' => '_update_post_term_count',
658
- );
659
- $args = apply_filters( 'tw_register_tags_args', $args );
660
- register_taxonomy( self::$cpt_tags, self::PT, $args );
661
- }
662
-
663
-
664
- public static function get_defaults( $single_view = false ) {
665
- $options = tw_get_options();
666
- if ( empty( $single_view ) ) {
667
- $defaults = apply_filters( 'tw_defaults', $options );
668
- } else {
669
- $defaults = apply_filters( 'tw_defaults_single', $options );
670
- }
671
-
672
- return $defaults;
673
- }
674
-
675
-
676
- public static function testimonials( $atts ) {
677
- $atts = wp_parse_args( $atts, self::get_defaults() );
678
- $atts = Testimonials_Widget_Settings::validate_settings( $atts );
679
-
680
- if ( get_query_var( 'paged' ) ) {
681
- $atts['paged'] = get_query_var( 'paged' );
682
- } elseif ( get_query_var( 'page' ) ) {
683
- $atts['paged'] = get_query_var( 'page' );
684
- } else {
685
- $atts['paged'] = 1;
686
- }
687
-
688
- $atts['type'] = 'testimonials';
689
-
690
- $instance = self::add_instance();
691
- $atts['widget_number'] = $instance;
692
-
693
- $testimonials = array();
694
-
695
- $content = apply_filters( 'tw_cache_get', false, $atts );
696
- if ( false === $content ) {
697
- $testimonials = self::get_testimonials( $atts );
698
- $content = self::get_testimonials_html( $testimonials, $atts );
699
- $content = apply_filters( 'tw_cache_set', $content, $atts );
700
- }
701
-
702
- self::call_scripts_styles( $testimonials, $atts, $instance );
703
-
704
- return $content;
705
- }
706
-
707
-
708
- public static function testimonials_slider( $atts, $widget_number = null ) {
709
- if ( empty( $widget_number ) ) {
710
- $widget_number = self::$widget_number++;
711
-
712
- if ( ! isset( $atts['random'] ) ) {
713
- $atts['random'] = 1;
714
- }
715
- }
716
-
717
- $atts = wp_parse_args( $atts, self::get_defaults() );
718
- $atts = Testimonials_Widget_Settings::validate_settings( $atts );
719
-
720
- $atts['paging'] = false;
721
- $atts['type'] = 'testimonials_slider';
722
-
723
- self::set_instance( $widget_number );
724
- $atts['widget_number'] = $widget_number;
725
-
726
- $testimonials = array();
727
-
728
- $content = apply_filters( 'tw_cache_get', false, $atts );
729
- if ( false === $content ) {
730
- $testimonials = self::get_testimonials( $atts );
731
- $content = self::get_testimonials_html( $testimonials, $atts, false, $widget_number );
732
- $content = apply_filters( 'tw_cache_set', $content, $atts );
733
- }
734
-
735
- self::call_scripts_styles( $testimonials, $atts, $widget_number );
736
-
737
- return $content;
738
- }
739
-
740
-
741
- public static function scripts( $atts ) {
742
- if ( is_admin() ) {
743
- return;
744
- }
745
-
746
- wp_enqueue_script( 'jquery' );
747
-
748
- $enable_video = $atts['enable_video'];
749
- if ( $enable_video ) {
750
- wp_register_script( 'jquery.fitvids', self::$library_assets . 'bxslider-4/plugins/jquery.fitvids.js', array( 'jquery' ), '1.0', true );
751
- wp_enqueue_script( 'jquery.fitvids' );
752
- }
753
-
754
- wp_register_script( 'jquery.bxslider', self::$library_assets . 'bxslider-4/jquery.bxslider.js', array( 'jquery' ), '4.1.2', true );
755
- wp_enqueue_script( 'jquery.bxslider' );
756
-
757
- do_action( 'tw_scripts', $atts );
758
- }
759
-
760
-
761
- public static function styles() {
762
- if ( is_admin() ) {
763
- return;
764
- }
765
-
766
- $exclude_bxslider_css = tw_get_option( 'exclude_bxslider_css' );
767
- if ( empty( $exclude_bxslider_css ) ) {
768
- wp_register_style( 'jquery.bxslider', self::$library_assets . 'bxslider-4/jquery.bxslider.css' );
769
- wp_enqueue_style( 'jquery.bxslider' );
770
- }
771
-
772
- wp_register_style( __CLASS__, self::$plugin_assets . 'css/testimonials-widget.css' );
773
-
774
- $exclude_css = tw_get_option( 'exclude_css' );
775
- if ( empty( $exclude_css ) ) {
776
- wp_enqueue_style( __CLASS__ );
777
- }
778
-
779
- do_action( 'tw_styles' );
780
- }
781
-
782
-
783
- public static function get_testimonials_html_css( $atts, $widget_number = null ) {
784
- $css = array();
785
- $css = apply_filters( 'tw_testimonials_css', $css, $atts, $widget_number );
786
-
787
- return $css;
788
- }
789
-
790
-
791
- public static function get_testimonials_html_js( $testimonials, $atts, $widget_number = null ) {
792
- $not_found = self::get_not_found();
793
- if ( $not_found ) {
794
- return;
795
- }
796
-
797
- $scripts = array();
798
- $scripts_internal = array();
799
-
800
- $id = self::ID;
801
- $id_base = $id . $widget_number;
802
-
803
- switch ( $atts['type'] ) {
804
- case 'testimonials_slider':
805
- $javascript = '';
806
- if ( 1 < count( $testimonials ) ) {
807
- $refresh_interval = $atts['refresh_interval'];
808
-
809
- $javascript .= '<script type="text/javascript">' . "\n";
810
-
811
- $adaptive_height = $atts['adaptive_height'] ? 'true' : 'false';
812
- $enable_video = $atts['enable_video'];
813
- $show_start_stop = $atts['show_start_stop'];
814
- $transition_mode = $atts['transition_mode'];
815
-
816
- $auto = $refresh_interval ? 'true' : 'false';
817
- $pager = ! $refresh_interval ? 'pager: true' : 'pager: false';
818
- $pause = $refresh_interval * 1000;
819
- $video = $enable_video ? "video: true,\nuseCSS: false" : 'video: false';
820
-
821
- $autoControls = $show_start_stop ? 'autoControls: true,' : '';
822
-
823
- $slider_var = self::SLUG . $widget_number;
824
- $javascript .= <<<EOF
825
- var {$slider_var} = null;
826
-
827
- jQuery(document).ready(function() {
828
- {$slider_var} = jQuery('.{$id_base}').bxSlider({
829
- adaptiveHeight: {$adaptive_height},
830
- auto: {$auto},
831
- {$autoControls}
832
- autoHover: true,
833
- controls: false,
834
- mode: '{$transition_mode}',
835
- {$pager},
836
- pause: {$pause},
837
- {$video},
838
- slideMargin: 2
839
- });
840
- });
841
- EOF;
842
-
843
- $javascript .= "\n" . '</script>';
844
- $scripts[ $id_base ] = $javascript;
845
- }
846
- break;
847
- }
848
-
849
- $scripts = apply_filters( 'tw_testimonials_js', $scripts, $testimonials, $atts, $widget_number );
850
- $scripts_internal = apply_filters( 'tw_testimonials_js_internal', $scripts_internal, $testimonials, $atts, $widget_number );
851
- $internal_scripts = implode( "\n", $scripts_internal );
852
- $scripts = str_replace( '{INTERNAL_SCRIPTS}', $internal_scripts, $scripts );
853
-
854
- return $scripts;
855
- }
856
-
857
-
858
- public static function get_testimonials_html( $testimonials, $atts, $is_list = true, $widget_number = null ) {
859
- global $tw_template_args;
860
-
861
- $tw_template_args = compact( 'testimonials', 'atts', 'is_list', 'widget_number' );
862
-
863
- $div_open = self::get_template_part( 'testimonials', 'open' );
864
-
865
- $paging = Testimonials_Widget_Settings::is_true( $atts['paging'] );
866
- $pre_paging = '';
867
- if ( $paging || 'before' === strtolower( $atts['paging'] ) ) {
868
- $pre_paging = self::get_testimonials_paging( $atts );
869
- }
870
-
871
- if ( empty( $testimonials ) && ! $atts['hide_not_found'] ) {
872
- $testimonials = array(
873
- array( 'testimonial_content' => esc_html__( 'No testimonials found', 'testimonials-widget' ) ),
874
- );
875
-
876
- self::set_not_found( true );
877
- } else {
878
- self::set_not_found();
879
- }
880
-
881
- $is_first = true;
882
- $testimonial_content = '';
883
- foreach ( $testimonials as $testimonial ) {
884
- $content = self::get_testimonial_html( $testimonial, $atts, $is_list, $is_first, $widget_number );
885
- $content = apply_filters( 'tw_testimonial_html', $content, $testimonial, $atts, $is_list, $is_first, $widget_number );
886
-
887
- $testimonial_content .= $content;
888
-
889
- $is_first = false;
890
- }
891
-
892
- $post_paging = '';
893
- if ( $paging || 'after' === strtolower( $atts['paging'] ) ) {
894
- $post_paging = self::get_testimonials_paging( $atts, false );
895
- }
896
-
897
- $div_close = self::get_template_part( 'testimonials', 'close' );
898
-
899
- $html = $div_open
900
- . $pre_paging
901
- . $testimonial_content
902
- . $post_paging
903
- . $div_close;
904
-
905
- $html = apply_filters( 'tw_get_testimonials_html', $html, $testimonials, $atts, $is_list, $widget_number, $div_open, $pre_paging, $testimonial_content, $post_paging, $div_close );
906
-
907
- return $html;
908
- }
909
-
910
-
911
- public static function get_testimonial_html( $testimonial, $atts, $is_list = true, $is_first = false, $widget_number = null ) {
912
- global $tw_template_args;
913
-
914
- $tw_template_args = compact( 'testimonial', 'atts', 'is_list', 'is_first', 'widget_number' );
915
-
916
- $div_open = self::get_template_part( 'testimonial', 'open' );
917
-
918
- $image = '';
919
- if ( ! $atts['hide_image'] && ! empty( $testimonial['testimonial_image'] ) ) {
920
- if ( ! ( $atts['hide_image_single'] && 'get_single' == $atts['type'] ) ) {
921
- $image = self::get_template_part( 'testimonial', 'image' );
922
- }
923
- }
924
-
925
- $content = self::get_template_part( 'testimonial', 'content' );
926
- if ( $atts['target'] ) {
927
- $content = links_add_target( $content, $atts['target'] );
928
- }
929
-
930
- $cite = '';
931
- if ( 1 < count( $testimonial ) ) {
932
- $cite = self::get_template_part( 'testimonial', 'cite' );
933
- }
934
-
935
- $extra = '';
936
- if ( ! empty( $testimonial['testimonial_extra'] ) ) {
937
- $extra = self::get_template_part( 'testimonial', 'extra' );
938
- }
939
-
940
- $bottom_text = '';
941
- if ( ! empty( $atts['bottom_text'] ) && 'false' != $atts['bottom_text'] ) {
942
- $bottom_text = self::get_template_part( 'testimonial', 'bottom' );
943
- }
944
-
945
- $schema = '';
946
- if ( $atts['enable_schema'] ) {
947
- $schema = self::get_schema( $testimonial, $atts );
948
- $schema .= "\n";
949
- }
950
-
951
- $div_close = self::get_template_part( 'testimonial', 'close' );
952
- $div_close = $schema . $div_close;
953
-
954
- $html = $div_open
955
- . $image
956
- . $content
957
- . $cite
958
- . $extra
959
- . $bottom_text
960
- . $div_close;
961
-
962
- $html = apply_filters( 'tw_get_testimonial_html', $html, $testimonial, $atts, $is_list, $is_first, $widget_number, $div_open, $image, $content, $cite, $extra, $bottom_text, $div_close );
963
-
964
- // not done sooner as tag_close_quote is used Testimonials Widget Premium
965
- if ( $atts['disable_quotes'] ) {
966
- $html = str_replace( self::$tag_open_quote, '', $html );
967
- $html = str_replace( self::$tag_close_quote, '', $html );
968
- }
969
-
970
- return $html;
971
- }
972
-
973
-
974
- // Original PHP code as myTruncate2 by Chirp Internet: www.chirp.com.au
975
- public static function testimonials_truncate( $string, $char_limit = false, $pad = '…', $force_pad = false ) {
976
- if ( empty( $force_pad ) ) {
977
- if ( ! $char_limit ) {
978
- return $string;
979
- }
980
-
981
- // return with no change if string is shorter than $char_limit
982
- if ( strlen( $string ) <= $char_limit ) {
983
- return $string;
984
- }
985
- }
986
-
987
- if ( $char_limit ) {
988
- return self::truncate( $string, $char_limit, $pad, $force_pad );
989
- }
990
-
991
- return $string . $pad;
992
- }
993
-
994
-
995
- /**
996
- * @SuppressWarnings(PHPMD.Superglobals)
997
- */
998
- public static function format_content( $content, $widget_number, $atts ) {
999
- if ( empty ( $content ) ) {
1000
- return $content;
1001
- }
1002
-
1003
- $keep_whitespace = $atts['keep_whitespace'];
1004
- $do_shortcode = $atts['do_shortcode'];
1005
-
1006
- $content = self::do_video( $content, $atts );
1007
-
1008
- // wrap our own quote class around the content before any formatting happens
1009
- $temp_content = self::$tag_open_quote;
1010
- $temp_content .= trim( $content );
1011
- $temp_content .= self::$tag_close_quote;
1012
-
1013
- $content = $temp_content;
1014
-
1015
- $content = wptexturize( $content );
1016
- $content = convert_smilies( $content );
1017
- $content = convert_chars( $content );
1018
- if ( is_null( $widget_number ) || $keep_whitespace ) {
1019
- $content = wpautop( $content );
1020
- }
1021
-
1022
- $content = shortcode_unautop( $content );
1023
- $content = str_replace( ']]>', ']]&gt;', $content );
1024
- if ( $do_shortcode ) {
1025
- $content = do_shortcode( $content );
1026
- } else {
1027
- $content = strip_shortcodes( $content );
1028
- }
1029
-
1030
- return $content;
1031
- }
1032
-
1033
-
1034
- /**
1035
- * @SuppressWarnings(PHPMD.UnusedFormalParameter)
1036
- */
1037
- public static function get_testimonials_paging( $atts, $prepend = true ) {
1038
- global $tw_template_args;
1039
-
1040
- $tw_template_args = compact( 'atts', 'prepend' );
1041
-
1042
- $html = self::get_template_part( 'testimonials', 'paging' );
1043
-
1044
- return $html;
1045
- }
1046
-
1047
-
1048
- public static function get_testimonials_css() {
1049
- if ( empty( self::$css_called ) ) {
1050
- foreach ( self::$css as $css ) {
1051
- echo $css;
1052
- }
1053
-
1054
- self::$css_called = true;
1055
- }
1056
- }
1057
-
1058
-
1059
- public static function get_testimonials_scripts() {
1060
- if ( empty( self::$scripts_called ) ) {
1061
- foreach ( self::$scripts as $script ) {
1062
- echo $script;
1063
- }
1064
-
1065
- self::$scripts_called = true;
1066
- }
1067
- }
1068
-
1069
-
1070
- /**
1071
- *
1072
- *
1073
- * @SuppressWarnings(PHPMD.UnusedLocalVariable)
1074
- */
1075
- public static function get_query_args( $atts ) {
1076
- extract( $atts );
1077
-
1078
- if ( has_filter( 'posts_orderby', 'CPTOrderPosts' ) ) {
1079
- remove_filter( 'posts_orderby', 'CPTOrderPosts', 99, 2 );
1080
- }
1081
-
1082
- if ( empty( $fields ) ) {
1083
- $fields = false;
1084
- }
1085
-
1086
- if ( $random ) {
1087
- $orderby = 'rand';
1088
- $order = false;
1089
- }
1090
-
1091
- $args = array(
1092
- 'fields' => $fields,
1093
- 'orderby' => $orderby,
1094
- 'post_status' => array(
1095
- 'publish',
1096
- 'private',
1097
- ),
1098
- 'post_type' => self::PT,
1099
- 'posts_per_page' => $limit,
1100
- );
1101
-
1102
- if ( is_single() ) {
1103
- $args['post_status'][] = 'pending';
1104
- $args['post_status'][] = 'draft';
1105
- }
1106
-
1107
- if ( $paging && ! empty( $atts['paged'] ) && is_singular() ) {
1108
- $args['paged'] = $atts['paged'];
1109
- }
1110
-
1111
- if ( ! $random && $meta_key ) {
1112
- $args['meta_key'] = $meta_key;
1113
- $args['orderby'] = 'meta_value';
1114
- }
1115
-
1116
- if ( $order ) {
1117
- $args['order'] = $order;
1118
- }
1119
-
1120
- if ( $ids ) {
1121
- $ids = explode( ',', $ids );
1122
-
1123
- $args['post__in'] = $ids;
1124
-
1125
- if ( 'none' == $args['orderby'] ) {
1126
- add_filter( 'posts_results', array( __CLASS__, 'posts_results_sort_none' ), 10, 2 );
1127
- }
1128
- }
1129
-
1130
- if ( $exclude ) {
1131
- $exclude = explode( ',', $exclude );
1132
- $args['post__not_in'] = $exclude;
1133
- }
1134
-
1135
- $use_cpt_taxonomy = tw_get_option( 'use_cpt_taxonomy', false );
1136
- if ( ! $use_cpt_taxonomy ) {
1137
- if ( $category ) {
1138
- if ( ! preg_match( '#^\d+$#', $category ) ) {
1139
- $args['category_name'] = $category;
1140
- } else {
1141
- $args['cat'] = $category;
1142
- }
1143
- }
1144
-
1145
- if ( $tags ) {
1146
- $tags = explode( ',', $tags );
1147
- foreach ( $tags as $tag ) {
1148
- if ( ! preg_match( '#^\d+$#', $tag ) ) {
1149
- if ( $tags_all ) {
1150
- if ( ! is_array( $args['tag_slug__and'] ) ) {
1151
- $args['tag_slug__and'] = array();
1152
- }
1153
-
1154
- $args['tag_slug__and'][] = $tag;
1155
- }
1156
- else {
1157
- if ( ! is_array( $args['tag_slug__in'] ) ) {
1158
- $args['tag_slug__in'] = array();
1159
- }
1160
-
1161
- $args['tag_slug__in'][] = $tag;
1162
- }
1163
- } else {
1164
- if ( $tags_all ) {
1165
- if ( ! is_array( $args['tag__and'] ) ) {
1166
- $args['tag__and'] = array();
1167
- }
1168
-
1169
- $args['tag__and'][] = $tag;
1170
- }
1171
- else {
1172
- if ( ! is_array( $args['tag__in'] ) ) {
1173
- $args['tag__in'] = array();
1174
- }
1175
-
1176
- $args['tag__in'][] = $tag;
1177
- }
1178
- }
1179
- }
1180
- }
1181
- } else {
1182
- if ( ! is_array( $args['tax_query'] ) ) {
1183
- $args['tax_query'] = array();
1184
- }
1185
-
1186
- if ( $category ) {
1187
- if ( ! preg_match( '#^\d+$#', $category ) ) {
1188
- $args['tax_query'][] = array(
1189
- 'taxonomy' => self::$cpt_category,
1190
- 'terms' => array( $category ),
1191
- 'field' => 'slug',
1192
- );
1193
- } else {
1194
- $args['tax_query'][] = array(
1195
- 'taxonomy' => self::$cpt_category,
1196
- 'terms' => array( $category ),
1197
- 'field' => 'id',
1198
- );
1199
- }
1200
- }
1201
-
1202
- if ( $tags ) {
1203
- if ( $tags_all ) {
1204
- $args['tax_query'] = array(
1205
- 'relation' => 'AND',
1206
- );
1207
- }
1208
-
1209
- $tags = explode( ',', $tags );
1210
- foreach ( $tags as $term ) {
1211
- if ( ! preg_match( '#^\d+$#', $term ) ) {
1212
- $args['tax_query'][] = array(
1213
- 'taxonomy' => self::$cpt_tags,
1214
- 'terms' => array( $term ),
1215
- 'field' => 'slug',
1216
- );
1217
- } else {
1218
- $args['tax_query'][] = array(
1219
- 'taxonomy' => self::$cpt_tags,
1220
- 'terms' => array( $term ),
1221
- 'field' => 'id',
1222
- );
1223
- }
1224
- }
1225
- }
1226
- }
1227
-
1228
- $args = apply_filters( 'tw_query_args', $args, $atts );
1229
-
1230
- return $args;
1231
- }
1232
-
1233
-
1234
- /**
1235
- *
1236
- *
1237
- * @SuppressWarnings(PHPMD.LongVariable)
1238
- */
1239
- public static function get_testimonials( $atts ) {
1240
- $hide_gravatar = $atts['hide_gravatar'];
1241
-
1242
- $args = self::get_query_args( $atts );
1243
- $args['query'] = true;
1244
-
1245
- $testimonials = apply_filters( 'tw_cache_get', false, $args );
1246
- if ( false === $testimonials ) {
1247
- $testimonials = new WP_Query( $args );
1248
- $testimonials = apply_filters( 'tw_cache_set', $testimonials, $args );
1249
- }
1250
-
1251
- if ( has_filter( 'posts_results', array( __CLASS__, 'posts_results_sort_none' ) ) ) {
1252
- remove_filter( 'posts_results', array( __CLASS__, 'posts_results_sort_none' ) );
1253
- }
1254
-
1255
- self::$max_num_pages = $testimonials->max_num_pages;
1256
- self::$post_count = $testimonials->post_count;
1257
- self::$wp_query = $testimonials;
1258
-
1259
- wp_reset_postdata();
1260
-
1261
- $image_size = apply_filters( 'tw_image_size', 'thumbnail' );
1262
- if ( ! is_array( $image_size ) ) {
1263
- global $_wp_additional_image_sizes;
1264
- if ( ! empty( $_wp_additional_image_sizes[ $image_size ] ) ) {
1265
- $gravatar_size = $_wp_additional_image_sizes[ $image_size ]['width'];
1266
- } else {
1267
- $gravatar_size = get_option( $image_size . '_size_w' );
1268
- }
1269
-
1270
- $gravatar_size = apply_filters( 'tw_gravatar_size', $gravatar_size );
1271
- } else {
1272
- $gravatar_size = apply_filters( 'tw_gravatar_size', $image_size );
1273
- }
1274
-
1275
- $testimonial_data = array();
1276
-
1277
- if ( empty( self::$post_count ) ) {
1278
- return $testimonial_data;
1279
- }
1280
-
1281
- foreach ( $testimonials->posts as $row ) {
1282
- $post_id = $row->ID;
1283
- $email = get_post_meta( $post_id, 'testimonials-widget-email', true );
1284
-
1285
- if ( has_post_thumbnail( $post_id ) ) {
1286
- $image = get_the_post_thumbnail( $post_id, $image_size );
1287
- } elseif ( ! $hide_gravatar && is_email( $email ) ) {
1288
- $image = get_avatar( $email, $gravatar_size );
1289
-
1290
- self::make_gravatar_featured( $post_id, $email );
1291
- } else {
1292
- $image = false;
1293
- }
1294
-
1295
- $image = self::strip_protocol( $image );
1296
-
1297
- $url = get_post_meta( $post_id, 'testimonials-widget-url', true );
1298
- if ( ! empty( $url ) && 0 === preg_match( '#https?://#', $url ) ) {
1299
- $url = 'http://' . $url;
1300
- }
1301
-
1302
- $data = array(
1303
- 'post_id' => $post_id,
1304
- 'testimonial_author' => get_post_meta( $post_id, 'testimonials-widget-author', true ),
1305
- 'testimonial_company' => get_post_meta( $post_id, 'testimonials-widget-company', true ),
1306
- 'testimonial_content' => $row->post_content,
1307
- 'testimonial_email' => $email,
1308
- 'testimonial_extra' => '',
1309
- 'testimonial_image' => $image,
1310
- 'testimonial_location' => get_post_meta( $post_id, 'testimonials-widget-location', true ),
1311
- 'testimonial_source' => $row->post_title,
1312
- 'testimonial_title' => get_post_meta( $post_id, 'testimonials-widget-title', true ),
1313
- 'testimonial_url' => $url,
1314
- );
1315
-
1316
- $testimonial_data[] = $data;
1317
- }
1318
-
1319
- $testimonial_data = apply_filters( 'tw_data', $testimonial_data, $atts );
1320
-
1321
- return $testimonial_data;
1322
- }
1323
-
1324
-
1325
- public static function posts_results_sort_none( $posts, $query ) {
1326
- $order = $query->query_vars['post__in'];
1327
- if ( empty( $order ) ) {
1328
- return $posts;
1329
- }
1330
-
1331
- $posts_none_sorted = array();
1332
- // put posts in same orders as post__in
1333
- foreach ( $order as $id ) {
1334
- foreach ( $posts as $key => $post ) {
1335
- if ( $id == $post->ID ) {
1336
- $posts_none_sorted[] = $post;
1337
- unset( $posts[ $key ] );
1338
- }
1339
- }
1340
- }
1341
-
1342
- return $posts_none_sorted;
1343
- }
1344
-
1345
-
1346
- public static function widgets_init() {
1347
- register_widget( 'Testimonials_Widget_Archives_Widget' );
1348
- register_widget( 'Testimonials_Widget_Categories_Widget' );
1349
- register_widget( 'Testimonials_Widget_Recent_Testimonials_Widget' );
1350
- register_widget( 'Testimonials_Widget_Slider_Widget' );
1351
- register_widget( 'Testimonials_Widget_Tag_Cloud_Widget' );
1352
- }
1353
-
1354
-
1355
- /**
1356
- *
1357
- *
1358
- * @SuppressWarnings(PHPMD.UnusedLocalVariable)
1359
- */
1360
- public static function add_meta_box_testimonials_widget() {
1361
- $fields = array(
1362
- array(
1363
- 'name' => esc_html__( 'Author', 'testimonials-widget' ),
1364
- 'id' => 'testimonials-widget-author',
1365
- 'type' => 'text',
1366
- 'desc' => esc_html__( 'Use when the testimonial title is not the authors\' name.', 'testimonials-widget' ),
1367
- ),
1368
- array(
1369
- 'name' => esc_html__( 'Job Title', 'testimonials-widget' ),
1370
- 'id' => 'testimonials-widget-title',
1371
- 'type' => 'text',
1372
- 'desc' => '',
1373
- ),
1374
- array(
1375
- 'name' => esc_html__( 'Location', 'testimonials-widget' ),
1376
- 'id' => 'testimonials-widget-location',
1377
- 'type' => 'text',
1378
- 'desc' => '',
1379
- ),
1380
- array(
1381
- 'name' => esc_html__( 'Company', 'testimonials-widget' ),
1382
- 'id' => 'testimonials-widget-company',
1383
- 'type' => 'text',
1384
- 'desc' => '',
1385
- ),
1386
- array(
1387
- 'name' => esc_html__( 'Email', 'testimonials-widget' ),
1388
- 'id' => 'testimonials-widget-email',
1389
- 'type' => 'text',
1390
- 'desc' => esc_html__( 'If an email is provided, but not an image, a Gravatar icon will be attempted to be loaded.', 'testimonials-widget' ),
1391
- ),
1392
- array(
1393
- 'name' => esc_html__( 'URL', 'testimonials-widget' ),
1394
- 'id' => 'testimonials-widget-url',
1395
- 'type' => 'text',
1396
- 'desc' => '',
1397
- ),
1398
- );
1399
-
1400
- $fields = apply_filters( 'tw_meta_box', $fields );
1401
-
1402
- $meta_box = redrokk_metabox_class::getInstance(
1403
- self::ID,
1404
- array(
1405
- 'title' => esc_html__( 'Testimonial Data', 'testimonials-widget' ),
1406
- 'description' => '',
1407
- '_object_types' => 'testimonials-widget',
1408
- 'priority' => 'high',
1409
- '_fields' => $fields,
1410
- )
1411
- );
1412
- }
1413
-
1414
-
1415
- /**
1416
- * Update messages for custom post type
1417
- *
1418
- * Original author: Travis Ballard http://www.travisballard.com
1419
- *
1420
- * @SuppressWarnings(PHPMD.Superglobals)
1421
- * @param mixed $m
1422
- * @return mixed $m
1423
- */
1424
- public static function post_updated_messages( $m ) {
1425
- global $post;
1426
-
1427
- $m[ self::PT ] = array(
1428
- 0 => '', // Unused. Messages start at index 1.
1429
- 1 => sprintf( __( 'Testimonial updated. <a href="%s">View testimonial</a>', 'testimonials-widget' ), esc_url( get_permalink( $post->ID ) ) ),
1430
- 2 => esc_html__( 'Custom field updated.', 'testimonials-widget' ),
1431
- 3 => esc_html__( 'Custom field deleted.', 'testimonials-widget' ),
1432
- 4 => esc_html__( 'Testimonial updated.', 'testimonials-widget' ),
1433
- /* translators: %s: date and time of the revision */
1434
- 5 => isset( $_GET['revision'] ) ? sprintf( esc_html__( 'Testimonial restored to revision from %s', 'testimonials-widget' ), wp_post_revision_title( (int) $_GET['revision'], false ) ) : false,
1435
- 6 => sprintf( __( 'Testimonial published. <a href="%s">View testimonial</a>', 'testimonials-widget' ), esc_url( get_permalink( $post->ID ) ) ),
1436
- 7 => esc_html__( 'Testimonial saved.', 'testimonials-widget' ),
1437
- 8 => sprintf( __( 'Testimonial submitted. <a target="_blank" href="%s">Preview testimonial</a>', 'testimonials-widget' ), esc_url( add_query_arg( 'preview', 'true', get_permalink( $post->ID ) ) ) ),
1438
- 9 => sprintf( __( 'Testimonial scheduled for: <strong>%1$s</strong>. <a target="_blank" href="%2$s">Preview testimonial</a>', 'testimonials-widget' ), date_i18n( 'M j, Y @ G:i', strtotime( $post->post_date ) ), esc_url( get_permalink( $post->ID ) ) ),
1439
- 10 => sprintf( __( 'Testimonial draft updated. <a target="_blank" href="%s">Preview testimonial</a>', 'testimonials-widget' ), esc_url( add_query_arg( 'preview', 'true', get_permalink( $post->ID ) ) ) )
1440
- );
1441
-
1442
- return $m;
1443
- }
1444
-
1445
-
1446
- public static function right_now_content_table_end() {
1447
- $content = '
1448
- <tr>
1449
- <td class="first b b-%1$s">%4$s%2$s%5$s</td>
1450
- <td class="t %1$s">%4$s%3$s%5$s</td>
1451
- </tr>';
1452
- $posts = wp_count_posts( self::PT );
1453
- $count = $posts->publish;
1454
- $name = _n( 'Testimonial', 'Testimonials', $count, 'testimonials-widget' );
1455
- $count_f = number_format_i18n( $count );
1456
- $a_open = '<a href="edit.php?post_type=' . self::PT . '">';
1457
- $a_close = '</a>';
1458
-
1459
- if ( current_user_can( 'edit_others_posts' ) ) {
1460
- $result = sprintf( $content, self::PT, $count_f, $name, $a_open, $a_close );
1461
- } else {
1462
- $result = sprintf( $content, self::PT, $count_f, $name, '', '' );
1463
- }
1464
-
1465
- echo $result;
1466
- }
1467
-
1468
-
1469
- /**
1470
- *
1471
- *
1472
- * @SuppressWarnings(PHPMD.UnusedLocalVariable)
1473
- */
1474
- public static function get_schema( $testimonial, $atts ) {
1475
- foreach ( $testimonial as $key => $value ) {
1476
- if ( 'testimonial_image' != $key ) {
1477
- $testimonial[ $key ] = self::clean_string( $value );
1478
- }
1479
- }
1480
-
1481
- extract( $testimonial );
1482
-
1483
- $do_company = ! $atts['hide_company'] && ! empty( $testimonial_company );
1484
- $do_content = ! empty( $testimonial['testimonial_content'] );
1485
- $do_email = ! $atts['hide_email'] && ! empty( $testimonial_email ) && is_email( $testimonial_email );
1486
- $do_image = ! $atts['hide_image'] && ! empty( $testimonial_image );
1487
- $do_location = ! $atts['hide_location'] && ! empty( $testimonial_location );
1488
- $do_source = ! $atts['hide_source'] && ! empty( $testimonial_source );
1489
- $do_title = ! $atts['hide_title'] && ! empty( $testimonial_title );
1490
- $do_url = ! $atts['hide_url'] && ! empty( $testimonial_url );
1491
-
1492
- $item_reviewed = self::clean_string( $atts['item_reviewed'] );
1493
- $item_reviewed_url = self::clean_string( $atts['item_reviewed_url'] );
1494
-
1495
- $schema = sprintf( self::$schema_div_open, self::$review_schema );
1496
- $schema .= "\n";
1497
-
1498
- $author_meta = array();
1499
- $item_meta = array();
1500
- $location_meta = array();
1501
- $org_meta = array();
1502
- $review_meta = array();
1503
-
1504
- if ( ! empty( $testimonial_author ) ) {
1505
- $author_meta[ self::$thing_name ] = $testimonial_author;
1506
- }
1507
-
1508
- if ( $do_source ) {
1509
- if ( empty( $testimonial_author ) ) {
1510
- $author_meta[ self::$thing_name ] = $testimonial_source;
1511
- } else {
1512
- $review_meta[ self::$thing_name ] = $testimonial_source;
1513
- }
1514
- }
1515
-
1516
- if ( $do_title ) {
1517
- $author_meta[ self::$person_job_title ] = $testimonial_title;
1518
- }
1519
-
1520
- if ( $do_email ) {
1521
- $author_meta[ self::$person_email ] = $testimonial_email;
1522
- }
1523
-
1524
- if ( ! $do_company ) {
1525
- if ( $do_url ) {
1526
- $author_meta[ self::$thing_url ] = $testimonial_url;
1527
- }
1528
- } else {
1529
- if ( $do_url ) {
1530
- $org_meta[ self::$thing_url ] = $testimonial_url;
1531
- }
1532
-
1533
- $org_meta[ self::$thing_name ] = $testimonial_company;
1534
- }
1535
-
1536
- if ( $do_location ) {
1537
- $location_meta[ self::$thing_name ] = $testimonial_location;
1538
-
1539
- if ( ! $do_company ) {
1540
- $author_meta[ self::$person_home ] = array( self::$place_schema, $location_meta );
1541
- } else {
1542
- $org_meta[ self::$org_location ] = array( self::$place_schema, $location_meta );
1543
- }
1544
- }
1545
-
1546
- if ( ! empty( $author_meta ) && ! empty( $org_meta ) ) {
1547
- $author_meta[ self::$person_member ] = array( self::$org_schema, $org_meta );
1548
- } elseif ( ! empty( $org_meta ) ) {
1549
- $author_meta[ self::$cw_source_org ] = array( self::$org_schema, $org_meta );
1550
- }
1551
-
1552
- $author_meta = apply_filters( 'tw_schema_author', $author_meta, $testimonial, $atts );
1553
- $author = self::create_schema_div_prop( self::$cw_author, self::$person_schema, $author_meta );
1554
- $schema .= $author;
1555
- $schema .= "\n";
1556
-
1557
- $post = get_post( $testimonial['post_id'] );
1558
- $the_date = mysql2date( 'Y-m-d', $post->post_date );
1559
- $the_date_mod = mysql2date( 'Y-m-d', $post->post_modified );
1560
-
1561
- $review_name_length = apply_filters( 'tw_review_name_length', 156 );
1562
-
1563
- if ( $do_content ) {
1564
- $review_meta[ self::$review_body ] = $testimonial['testimonial_content'];
1565
- }
1566
-
1567
- $review_meta[ self::$cw_date ] = $the_date;
1568
- $review_meta[ self::$cw_date_mod ] = $the_date_mod;
1569
- $review_meta[ self::$thing_url ] = post_permalink( $post->ID );
1570
- if ( empty( $review_meta[ self::$thing_name ] ) ) {
1571
- $review_meta[ self::$thing_name ] = self::testimonials_truncate( $testimonial_content, $review_name_length );
1572
- }
1573
-
1574
- if ( $do_image ) {
1575
- $src = self::get_image_src( $testimonial_image );
1576
-
1577
- $review_meta[ self::$thing_image ] = $src;
1578
- }
1579
-
1580
- $aggregate_meta = array(
1581
- self::$aggregate_count => self::get_aggregate_count( $testimonial ),
1582
- );
1583
-
1584
- $review_meta[ self::$aggregate_rating ] = array( self::$aggregate_schema, $aggregate_meta );
1585
-
1586
- $review_meta = apply_filters( 'tw_schema_review', $review_meta, $testimonial, $atts );
1587
- $review = self::create_schema_meta( $review_meta );
1588
- $schema .= $review;
1589
- $schema .= "\n";
1590
-
1591
- $item_meta[ self::$thing_name ] = $item_reviewed;
1592
- $item_meta[ self::$thing_url ] = $item_reviewed_url;
1593
-
1594
- $item_meta = apply_filters( 'tw_schema_item', $item_meta, $testimonial, $atts );
1595
- $item = self::create_schema_div_prop( self::$review_item, self::$thing_schema, $item_meta );
1596
- $schema .= $item;
1597
- $schema .= "\n";
1598
-
1599
- $schema .= '</div>';
1600
- $schema .= "\n";
1601
-
1602
- $schema = apply_filters( 'tw_schema', $schema, $testimonial, $atts );
1603
-
1604
- return $schema;
1605
- }
1606
-
1607
-
1608
- public static function create_schema_meta( $meta_data ) {
1609
- $meta = '';
1610
-
1611
- if ( empty( $meta_data ) ) {
1612
- return $meta;
1613
- }
1614
-
1615
- foreach ( $meta_data as $key => $value ) {
1616
- if ( is_array( $value ) ) {
1617
- $meta .= self::create_schema_div_prop( $key, $value[0], $value[1] );
1618
- } else {
1619
- $meta .= sprintf( self::$schema_meta, $key, $value );
1620
- }
1621
-
1622
- $meta .= "\n";
1623
- }
1624
-
1625
- return $meta;
1626
- }
1627
-
1628
-
1629
- public static function create_schema_div_prop( $property_name, $schema_name, $meta_data ) {
1630
- $meta = '';
1631
- $schema = '';
1632
-
1633
- if ( empty( $meta_data ) ) {
1634
- return $schema;
1635
- }
1636
-
1637
- if ( is_array( $meta_data ) ) {
1638
- foreach ( $meta_data as $key => $value ) {
1639
- if ( is_array( $value ) ) {
1640
- $meta .= self::create_schema_div_prop( $key, $value[0], $value[1] );
1641
- } else {
1642
- $meta .= sprintf( self::$schema_meta, $key, $value );
1643
- }
1644
-
1645
- $meta .= "\n";
1646
- }
1647
-
1648
- $schema = sprintf( self::$schema_div_prop, $property_name, $schema_name, $meta );
1649
- } else {
1650
- $schema = sprintf( self::$schema_div_prop, $property_name, $schema_name, $meta_data );
1651
- }
1652
-
1653
- return $schema;
1654
- }
1655
-
1656
-
1657
- public static function generate_css( $atts, $widget_number = null ) {
1658
- $atts['subtype'] = 'css';
1659
-
1660
- $css = apply_filters( 'tw_cache_get', false, $atts );
1661
- if ( false === $css ) {
1662
- $css = self::get_testimonials_html_css( $atts, $widget_number );
1663
- $css = apply_filters( 'tw_cache_set', $css, $atts );
1664
- }
1665
-
1666
- if ( ! empty( $css ) ) {
1667
- self::$css = array_merge( $css, self::$css );
1668
- add_action( 'wp_footer', array( __CLASS__, 'get_testimonials_css' ), 20 );
1669
- }
1670
- }
1671
-
1672
-
1673
- public static function generate_js( $testimonials, $atts, $widget_number = null ) {
1674
- $atts['subtype'] = 'js';
1675
-
1676
- $js = apply_filters( 'tw_cache_get', false, $atts );
1677
- if ( false === $js ) {
1678
- $js = self::get_testimonials_html_js( $testimonials, $atts, $widget_number );
1679
- $js = apply_filters( 'tw_cache_set', $js, $atts );
1680
- }
1681
-
1682
- if ( ! empty( $js ) ) {
1683
- self::$scripts = array_merge( $js, self::$scripts );
1684
- add_action( 'wp_footer', array( __CLASS__, 'get_testimonials_scripts' ), 20 );
1685
- }
1686
- }
1687
-
1688
-
1689
- public static function call_scripts_styles( $testimonials, $atts, $widget_number = null ) {
1690
- if ( is_null( $widget_number ) ) {
1691
- $widget_number = self::get_instance();
1692
- }
1693
-
1694
- self::scripts( $atts );
1695
-
1696
- self::generate_css( $atts );
1697
- self::generate_js( $testimonials, $atts, $widget_number );
1698
- }
1699
-
1700
-
1701
- public static function make_gravatar_featured( $post_id, $email ) {
1702
- $size = get_option( 'large_size_w' );
1703
- $image = get_avatar( $email, $size );
1704
- $src = self::get_image_src( $image, false );
1705
- $file = sanitize_title( $email ) . '.jpeg';
1706
-
1707
- self::add_media( $post_id, $src, $file );
1708
- }
1709
-
1710
-
1711
- public static function notice_2_15_0() {
1712
- $text = sprintf( __( 'If your Testimonials display has gone to funky town, please <a href="%s">read the FAQ</a> about possible fixes.', 'testimonials-widget' ), esc_url( 'https://aihrus.zendesk.com/entries/28402246-Major-Change-for-2-15-0' ) );
1713
-
1714
- aihr_notice_updated( $text );
1715
- }
1716
-
1717
-
1718
- public static function set_not_found( $not_found = false ) {
1719
- self::$not_found = $not_found;
1720
- }
1721
-
1722
-
1723
- public static function get_not_found() {
1724
- return self::$not_found;
1725
- }
1726
-
1727
-
1728
- public static function version_check() {
1729
- $valid_version = true;
1730
- if ( ! $valid_version ) {
1731
- $deactivate_reason = esc_html__( 'Failed version check', 'testimonials-widget' );
1732
- aihr_deactivate_plugin( self::BASE, TW_NAME, $deactivate_reason );
1733
- self::check_notices();
1734
- }
1735
-
1736
- return $valid_version;
1737
- }
1738
-
1739
-
1740
- /**
1741
- *
1742
- *
1743
- * @SuppressWarnings(PHPMD.Superglobals)
1744
- */
1745
- public static function do_load() {
1746
- $do_load = false;
1747
- if ( ! empty( $GLOBALS['pagenow'] ) && in_array( $GLOBALS['pagenow'], array( 'options.php', 'widgets.php' ) ) ) {
1748
- $do_load = true;
1749
- } elseif ( ! empty( $_REQUEST['post_type'] ) && self::PT == $_REQUEST['post_type'] ) {
1750
- if ( ! empty( $GLOBALS['pagenow'] ) && in_array( $GLOBALS['pagenow'], array( 'edit.php', 'edit-tags.php' ) ) ) {
1751
- $do_load = true;
1752
- } elseif ( ! empty( $_REQUEST['option_page'] ) && Testimonials_Widget_Settings::ID == $_REQUEST['option_page'] ) {
1753
- $do_load = true;
1754
- }
1755
- }
1756
-
1757
- return $do_load;
1758
- }
1759
-
1760
-
1761
- public static function category_columns( $columns ) {
1762
- $columns['shortcode'] = esc_html__( 'Shortcode', 'testimonials-widget' );
1763
-
1764
- return $columns;
1765
- }
1766
-
1767
-
1768
- public static function category_column( $result, $column_name, $term_id, $category = true ) {
1769
- $attribute = $category ? 'category' : 'tags';
1770
-
1771
- $use_cpt_taxonomy = tw_get_option( 'use_cpt_taxonomy', false );
1772
- if ( ! $use_cpt_taxonomy ) {
1773
- if ( $category ) {
1774
- $term = get_term( $term_id, 'category' );
1775
- } else {
1776
- $term = get_term( $term_id, 'post_tag' );
1777
- }
1778
- } else {
1779
- if ( $category ) {
1780
- $term = get_term( $term_id, self::$cpt_category );
1781
- } else {
1782
- $term = get_term( $term_id, self::$cpt_tags );
1783
- }
1784
- }
1785
-
1786
- switch ( $column_name ) {
1787
- case 'shortcode':
1788
- $result = '[testimonials ' . $attribute . '="' .$term->slug . '"]';
1789
- $result .= '<br />';
1790
- $result .= '[testimonials_slider ' . $attribute . '="' .$term->slug . '"]';
1791
- break;
1792
- }
1793
-
1794
- return $result;
1795
- }
1796
-
1797
-
1798
- public static function post_tag_column( $result, $column_name, $term_id ) {
1799
- return self::category_column( $result, $column_name, $term_id, false );
1800
- }
1801
-
1802
-
1803
- public static function dashboard_glance_items( $array ) {
1804
- if ( ! current_user_can( 'edit_others_posts' ) ) {
1805
- return $array;
1806
- }
1807
-
1808
- $count = apply_filters( 'tw_cache_get', false, 'dashboard_count' );
1809
- if ( false === $count ) {
1810
- $posts = wp_count_posts( self::PT );
1811
- $count = $posts->publish;
1812
- $count = apply_filters( 'tw_cache_set', $count, 'dashboard_count' );
1813
- }
1814
-
1815
- if ( $count ) {
1816
- $content = '%1$s%2$s %3$s%4$s';
1817
- $name = _n( 'Testimonial', 'Testimonials', $count, 'testimonials-widget-premium', 'testimonials-widget' );
1818
- $count_f = number_format_i18n( $count );
1819
- $a_open = '<a href="edit.php?post_type=' . self::PT . '">';
1820
- $a_close = '</a>';
1821
-
1822
- $array[] = sprintf( $content, $a_open, $count_f, $name, $a_close );
1823
- }
1824
-
1825
- return $array;
1826
- }
1827
-
1828
-
1829
- /**
1830
- * @SuppressWarnings(PHPMD.Superglobals)
1831
- */
1832
- public static function do_video( $content, $atts ) {
1833
- $enable_video = $atts['enable_video'];
1834
- if ( $enable_video && ! empty( $GLOBALS['wp_embed'] ) ) {
1835
- $content = $GLOBALS['wp_embed']->autoembed( $content );
1836
- $content = $GLOBALS['wp_embed']->run_shortcode( $content );
1837
- }
1838
-
1839
- return $content;
1840
- }
1841
-
1842
-
1843
- public static function get_template_part( $slug, $name = null ) {
1844
- if ( is_null( self::$template_loader ) ) {
1845
- self::$template_loader = new Testimonials_Widget_Template_Loader();
1846
- }
1847
-
1848
- ob_start();
1849
- self::$template_loader->get_template_part( $slug, $name );
1850
- $content = ob_get_clean();
1851
-
1852
- return $content;
1853
- }
1854
-
1855
-
1856
- public static function pre_get_posts_allow_testimonials( $query ) {
1857
- if ( $query->is_admin ) {
1858
- return $query;
1859
- } elseif ( ( $query->is_main_query() || is_feed() )
1860
- && ! is_page()
1861
- && ( ( ! empty( $query->query_vars['post_type'] ) && 'post' == $query->query_vars['post_type'] )
1862
- || is_archive() )
1863
- ) {
1864
- $query->set( 'post_type', array( 'post', self::PT ) );
1865
- }
1866
-
1867
- return $query;
1868
- }
1869
-
1870
-
1871
- public static function testimonials_archives( $atts, $widget_number = null ) {
1872
- $atts = wp_parse_args( $atts, Testimonials_Widget_Archives_Widget::get_defaults() );
1873
- $atts = Testimonials_Widget_Archives_Widget::validate_settings( $atts );
1874
-
1875
- $atts['type'] = 'testimonials_archives';
1876
-
1877
- $instance = ! empty( $widget_number ) ? $widget_number : self::add_instance();
1878
- $atts['widget_number'] = $instance;
1879
-
1880
- $content = apply_filters( 'tw_cache_get', false, $atts );
1881
- if ( false === $content ) {
1882
- $content = self::get_archives_html( $atts );
1883
- $content = apply_filters( 'tw_cache_set', $content, $atts );
1884
- }
1885
-
1886
- self::call_scripts_styles( array(), $atts, $instance );
1887
-
1888
- return $content;
1889
- }
1890
-
1891
-
1892
- /**
1893
- * @SuppressWarnings(PHPMD.UnusedFormalParameter)
1894
- */
1895
- public static function get_archives_html( $atts ) {
1896
- global $tw_template_args;
1897
-
1898
- $tw_template_args = compact( 'atts' );
1899
-
1900
- $content = self::get_template_part( 'testimonials', 'archives' );
1901
-
1902
- return $content;
1903
- }
1904
-
1905
-
1906
- public static function get_archives_link( $link_html ) {
1907
- $home_url = home_url();
1908
- $slug = Aihrus_Common::get_archive_slug( self::PT );
1909
- $link_html = str_replace( $home_url, $home_url . '/' . $slug, $link_html );
1910
-
1911
- return $link_html;
1912
- }
1913
-
1914
-
1915
- public static function generate_rewrite_rules( $wp_rewrite ) {
1916
- $rules = Aihrus_Common::rewrite_rules_date_archives( self::PT, $wp_rewrite );
1917
- $wp_rewrite->rules = $rules + $wp_rewrite->rules;
1918
-
1919
- return $wp_rewrite;
1920
- }
1921
-
1922
-
1923
- /**
1924
- * @SuppressWarnings(PHPMD.UnusedFormalParameter)
1925
- */
1926
- public static function getarchives_where( $where, $args ) {
1927
- return "WHERE post_type = '" . Testimonials_Widget::PT . "' AND post_status = 'publish'";
1928
- }
1929
-
1930
-
1931
- public static function testimonials_categories( $atts, $widget_number = null ) {
1932
- $atts = wp_parse_args( $atts, Testimonials_Widget_Categories_Widget::get_defaults() );
1933
- $atts = Testimonials_Widget_Categories_Widget::validate_settings( $atts );
1934
-
1935
- $atts['type'] = 'testimonials_categories';
1936
-
1937
- $instance = ! empty( $widget_number ) ? $widget_number : self::add_instance();
1938
- $atts['widget_number'] = $instance;
1939
-
1940
- $content = apply_filters( 'tw_cache_get', false, $atts );
1941
- if ( false === $content ) {
1942
- $content = self::get_categories_html( $atts );
1943
- $content = apply_filters( 'tw_cache_set', $content, $atts );
1944
- }
1945
-
1946
- self::call_scripts_styles( array(), $atts, $instance );
1947
-
1948
- return $content;
1949
- }
1950
-
1951
-
1952
- /**
1953
- * @SuppressWarnings(PHPMD.UnusedFormalParameter)
1954
- */
1955
- public static function get_categories_html( $atts ) {
1956
- global $tw_template_args;
1957
-
1958
- $tw_template_args = compact( 'atts' );
1959
-
1960
- $content = self::get_template_part( 'testimonials', 'categories' );
1961
-
1962
- return $content;
1963
- }
1964
-
1965
-
1966
- public static function testimonials_recent( $atts, $widget_number = null ) {
1967
- $atts = wp_parse_args( $atts, Testimonials_Widget_Recent_Testimonials_Widget::get_defaults() );
1968
- $atts = Testimonials_Widget_Recent_Testimonials_Widget::validate_settings( $atts );
1969
-
1970
- $atts['type'] = 'testimonials_recent';
1971
-
1972
- $instance = ! empty( $widget_number ) ? $widget_number : self::add_instance();
1973
- $atts['widget_number'] = $instance;
1974
-
1975
- $content = apply_filters( 'tw_cache_get', false, $atts );
1976
- if ( false === $content ) {
1977
- $content = self::get_recent_html( $atts );
1978
- $content = apply_filters( 'tw_cache_set', $content, $atts );
1979
- }
1980
-
1981
- self::call_scripts_styles( array(), $atts, $instance );
1982
-
1983
- return $content;
1984
- }
1985
-
1986
-
1987
- /**
1988
- * @SuppressWarnings(PHPMD.UnusedFormalParameter)
1989
- */
1990
- public static function get_recent_html( $atts ) {
1991
- global $tw_template_args;
1992
-
1993
- $tw_template_args = compact( 'atts' );
1994
-
1995
- $content = self::get_template_part( 'testimonials', 'recent' );
1996
-
1997
- return $content;
1998
- }
1999
-
2000
-
2001
- public static function testimonials_tag_cloud( $atts, $widget_number = null ) {
2002
- $atts = wp_parse_args( $atts, Testimonials_Widget_Tag_Cloud_Widget::get_defaults() );
2003
- $atts = Testimonials_Widget_Tag_Cloud_Widget::validate_settings( $atts );
2004
-
2005
- $atts['type'] = 'testimonials_tag_cloud';
2006
-
2007
- $instance = ! empty( $widget_number ) ? $widget_number : self::add_instance();
2008
- $atts['widget_number'] = $instance;
2009
-
2010
- $content = apply_filters( 'tw_cache_get', false, $atts );
2011
- if ( false === $content ) {
2012
- $content = self::get_tag_cloud_html( $atts );
2013
- $content = apply_filters( 'tw_cache_set', $content, $atts );
2014
- }
2015
-
2016
- self::call_scripts_styles( array(), $atts, $instance );
2017
-
2018
- return $content;
2019
- }
2020
-
2021
-
2022
- /**
2023
- * @SuppressWarnings(PHPMD.UnusedFormalParameter)
2024
- */
2025
- public static function get_tag_cloud_html( $atts ) {
2026
- global $tw_template_args;
2027
-
2028
- $tw_template_args = compact( 'atts' );
2029
-
2030
- $content = self::get_template_part( 'testimonials', 'tag-cloud' );
2031
-
2032
- return $content;
2033
- }
2034
-
2035
-
2036
- public static function get_aggregate_count( $testimonial ) {
2037
- $testimonial_item = ! empty( $testimonial['testimonial_item'] ) ? $testimonial['testimonial_item'] : self::$aggregate_no_item;
2038
- if ( ! isset( self::$aggregate_data[ $testimonial_item ]['count'] ) ) {
2039
- // @codingStandardsIgnoreStart
2040
- $query_args = array(
2041
- 'post_type' => Testimonials_Widget::PT,
2042
- 'meta_query' => array(
2043
- 'relation' => 'AND',
2044
- array(
2045
- 'key' => 'testimonials-widget-item',
2046
- 'value' => $testimonial_item,
2047
- 'compare' => 'LIKE',
2048
- ),
2049
- ),
2050
- );
2051
- // @codingStandardsIgnoreEnd
2052
-
2053
- $count = 0;
2054
- $query = new WP_Query( $query_args );
2055
- while ( $query->have_posts() ) {
2056
- $query->the_post();
2057
- $count++;
2058
- }
2059
-
2060
- self::$aggregate_data[ $testimonial_item ]['count'] = $count;
2061
- }
2062
-
2063
- return self::$aggregate_data[ $testimonial_item ]['count'];
2064
- }
2065
-
2066
-
2067
- /**
2068
- * @SuppressWarnings(PHPMD.UnusedFormalParameter)
2069
- */
2070
- public static function testimonials_examples( $atts = null ) {
2071
- $atts = wp_parse_args( $atts, self::get_defaults() );
2072
-
2073
- $atts['type'] = 'testimonials_examples';
2074
-
2075
- $content = apply_filters( 'tw_cache_get', false, $atts );
2076
- if ( false === $content ) {
2077
- $content = self::get_testimonials_examples( $atts );
2078
- $content = apply_filters( 'tw_cache_set', $content, $atts );
2079
- }
2080
-
2081
- self::call_scripts_styles( array(), $atts );
2082
-
2083
- return $content;
2084
- }
2085
-
2086
-
2087
- /**
2088
- * @SuppressWarnings(PHPMD.UnusedFormalParameter)
2089
- */
2090
- public static function get_testimonials_examples( $atts = null ) {
2091
- $examples_file = TW_DIR . 'EXAMPLES.md';
2092
- $examples_html = self::markdown2html( $examples_file );
2093
- $examples_html = apply_filters( 'tw_examples_html', $examples_html );
2094
- $examples_html = str_replace( '[[', '[', $examples_html );
2095
- $examples_html = str_replace( ']]', ']', $examples_html );
2096
-
2097
- return $examples_html;
2098
- }
2099
-
2100
-
2101
- /**
2102
- * @SuppressWarnings(PHPMD.UnusedFormalParameter)
2103
- */
2104
- public static function testimonials_options( $atts = null ) {
2105
- $atts = wp_parse_args( $atts, self::get_defaults() );
2106
-
2107
- $atts['type'] = 'testimonials_options';
2108
-
2109
- $content = apply_filters( 'tw_cache_get', false, $atts );
2110
- if ( false === $content ) {
2111
- $content = self::get_testimonials_options( $atts );
2112
- $content = apply_filters( 'tw_cache_set', $content, $atts );
2113
- }
2114
-
2115
- self::call_scripts_styles( array(), $atts );
2116
-
2117
- return $content;
2118
- }
2119
-
2120
-
2121
- /**
2122
- * @SuppressWarnings(PHPMD.UnusedFormalParameter)
2123
- */
2124
- public static function get_testimonials_options( $atts = null ) {
2125
- $sections = Testimonials_Widget_Settings::get_sections();
2126
- $settings = Testimonials_Widget_Settings::get_settings();
2127
-
2128
- $ignored_types = array( 'expand_begin', 'expand_end', 'expand_all', 'content', );
2129
-
2130
- $do_continue = false;
2131
- $do_used_with = false;
2132
-
2133
- $first_dl = true;
2134
- $open_dl = false;
2135
- $html = '';
2136
- foreach ( $settings as $setting => $parts ) {
2137
- if ( in_array( $parts['type'], $ignored_types ) ) {
2138
- continue;
2139
- }
2140
-
2141
- if ( empty( $parts['show_code'] ) ) {
2142
- continue;
2143
- }
2144
-
2145
- // section header
2146
- if ( ! empty( $sections[ $parts['section'] ] ) ) {
2147
- if ( ! $first_dl ) {
2148
- $html .= '</dl>';
2149
-
2150
- $open_dl = false;
2151
- }
2152
-
2153
- $html .= '<h2>' . $sections[ $parts['section'] ] . '</h2>';
2154
-
2155
- unset( $sections[ $parts['section'] ] );
2156
-
2157
- $do_used_with = true;
2158
- }
2159
-
2160
- if ( 'heading' == $parts['type'] ) {
2161
- if ( $open_dl ) {
2162
- $html .= '</dl>';
2163
-
2164
- $open_dl = false;
2165
- }
2166
-
2167
- $html .= '<h2>' . $parts['desc'] . '</h2>';
2168
-
2169
- $do_continue = true;
2170
- $do_used_with = true;
2171
- }
2172
-
2173
- if ( $do_used_with ) {
2174
- $used_with_codes = self::get_used_with_codes( $parts );
2175
- if ( ! empty( $used_with_codes ) ) {
2176
- $used_with_codes = implode( '</code>, <code>', $used_with_codes );
2177
-
2178
- $html .= '<p>' . esc_html__( 'Used with: ', 'testimonials-widget' );
2179
- $html .= '<code>' . $used_with_codes . '</code>';
2180
- $html .= '</p>';
2181
- }
2182
-
2183
- $do_used_with = false;
2184
- }
2185
-
2186
- if ( $do_continue ) {
2187
- $do_continue = false;
2188
-
2189
- continue;
2190
- }
2191
-
2192
- if ( empty( $open_dl ) ) {
2193
- $html .= '<dl>';
2194
-
2195
- $first_dl = false;
2196
- $open_dl = true;
2197
- }
2198
-
2199
- // option name
2200
- $html .= '<dt>' . $parts['title'] . '</dt>';
2201
-
2202
- // description
2203
- if ( ! empty( $parts['desc'] ) ) {
2204
- $html .= '<dd>' . $parts['desc'] . '</dd>';
2205
- }
2206
-
2207
- // validation helpers
2208
- $validate = self::define_options_validate( $parts );
2209
- if ( ! empty( $validate ) ) {
2210
- $html .= '<dd>' . $validate . '</dd>';
2211
- }
2212
-
2213
- $choices = self::define_options_choices( $parts );
2214
- if ( ! empty( $choices ) ) {
2215
- $html .= '<dd>' . esc_html__( 'Options: ', 'testimonials-widget' ) . '<code>' . $choices . '</code></dd>';
2216
- }
2217
-
2218
- $value = self::define_options_value( $setting, $parts );
2219
- if ( ! empty( $value ) ) {
2220
- $html .= '<dd>' . esc_html__( 'Usage: ', 'testimonials-widget' ) . '<code>' . $setting . '="' . $value . '"</code></dd>';
2221
- }
2222
- }
2223
-
2224
- // remaining widgets
2225
- $widgets = array(
2226
- 'Testimonials_Widget_Archives_Widget' => 'testimonials_archives',
2227
- 'Testimonials_Widget_Categories_Widget' => 'testimonials_categories',
2228
- 'Testimonials_Widget_Recent_Testimonials_Widget' => 'testimonials_recent',
2229
- 'Testimonials_Widget_Tag_Cloud_Widget' => 'testimonials_tag_cloud',
2230
- );
2231
-
2232
- $widgets = apply_filters( 'tw_options_widgets', $widgets );
2233
-
2234
- foreach ( $widgets as $widget => $shortcode ) {
2235
- $form_parts = $widget::form_parts();
2236
-
2237
- // section header
2238
- $html .= '</dl>';
2239
- $html .= '<h2>' . $widget::$title . '</h2>';
2240
-
2241
- $used_with_codes = array(
2242
- '[' . $shortcode . ']',
2243
- '' . $shortcode . '()',
2244
- );
2245
-
2246
- $used_with_codes = apply_filters( 'tw_used_with_codes_widgets', $used_with_codes, $widget, $shortcode );
2247
-
2248
- if ( ! empty( $used_with_codes ) ) {
2249
- $used_with_codes = implode( '</code>, <code>', $used_with_codes );
2250
-
2251
- $html .= '<p>' . esc_html__( 'Used with: ', 'testimonials-widget' );
2252
- $html .= '<code>' . $used_with_codes . '</code>';
2253
- $html .= '</p>';
2254
- }
2255
-
2256
- $html .= '<dl>';
2257
-
2258
- foreach ( $form_parts as $setting => $parts ) {
2259
- if ( in_array( $parts['type'], $ignored_types ) ) {
2260
- continue;
2261
- }
2262
-
2263
- // option name
2264
- $html .= '<dt>' . $parts['title'] . '</dt>';
2265
-
2266
- // description
2267
- if ( ! empty( $parts['desc'] ) ) {
2268
- $html .= '<dd>' . $parts['desc'] . '</dd>';
2269
- }
2270
-
2271
- // validation helpers
2272
- $validate = self::define_options_validate( $parts );
2273
- if ( ! empty( $validate ) ) {
2274
- $html .= '<dd>' . $validate . '</dd>';
2275
- }
2276
-
2277
- $choices = self::define_options_choices( $parts );
2278
- if ( ! empty( $choices ) ) {
2279
- $html .= '<dd>' . esc_html__( 'Options: ', 'testimonials-widget' ) . '<code>' . $choices . '</code></dd>';
2280
- }
2281
-
2282
- $value = self::define_options_value( $setting, $parts );
2283
- if ( ! empty( $value ) ) {
2284
- $html .= '<dd>' . esc_html__( 'Usage: ', 'testimonials-widget' ) . '<code>' . $setting . '="' . $value . '"</code></dd>';
2285
- }
2286
- }
2287
-
2288
- if ( $open_dl ) {
2289
- $html .= '</dl>';
2290
- }
2291
- }
2292
-
2293
- if ( $open_dl ) {
2294
- $html .= '</dl>';
2295
- }
2296
-
2297
- $html = links_add_target( $html, '_tw' );
2298
- $html = apply_filters( 'tw_options_html', $html );
2299
-
2300
- return $html;
2301
- }
2302
-
2303
-
2304
- public static function get_used_with_codes( $parts ) {
2305
- $used_with_codes = array(
2306
- '[testimonials_slider]',
2307
- 'testimonials_slider()',
2308
- );
2309
-
2310
- if ( 'widget' != $parts['section'] ) {
2311
- $used_with_codes[] = '[testimonials]';
2312
- $used_with_codes[] = 'testimonials()';
2313
- }
2314
-
2315
- $used_with_codes = apply_filters( 'tw_used_with_codes', $used_with_codes, $parts );
2316
-
2317
- return $used_with_codes;
2318
- }
2319
-
2320
- }
2321
-
2322
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/includes/libraries/Gamajo-Template-Loader/LICENSE DELETED
@@ -1,339 +0,0 @@
1
- GNU GENERAL PUBLIC LICENSE
2
- Version 2, June 1991
3
-
4
- Copyright (C) 1989, 1991 Free Software Foundation, Inc., <http://fsf.org/>
5
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
6
- Everyone is permitted to copy and distribute verbatim copies
7
- of this license document, but changing it is not allowed.
8
-
9
- Preamble
10
-
11
- The licenses for most software are designed to take away your
12
- freedom to share and change it. By contrast, the GNU General Public
13
- License is intended to guarantee your freedom to share and change free
14
- software--to make sure the software is free for all its users. This
15
- General Public License applies to most of the Free Software
16
- Foundation's software and to any other program whose authors commit to
17
- using it. (Some other Free Software Foundation software is covered by
18
- the GNU Lesser General Public License instead.) You can apply it to
19
- your programs, too.
20
-
21
- When we speak of free software, we are referring to freedom, not
22
- price. Our General Public Licenses are designed to make sure that you
23
- have the freedom to distribute copies of free software (and charge for
24
- this service if you wish), that you receive source code or can get it
25
- if you want it, that you can change the software or use pieces of it
26
- in new free programs; and that you know you can do these things.
27
-
28
- To protect your rights, we need to make restrictions that forbid
29
- anyone to deny you these rights or to ask you to surrender the rights.
30
- These restrictions translate to certain responsibilities for you if you
31
- distribute copies of the software, or if you modify it.
32
-
33
- For example, if you distribute copies of such a program, whether
34
- gratis or for a fee, you must give the recipients all the rights that
35
- you have. You must make sure that they, too, receive or can get the
36
- source code. And you must show them these terms so they know their
37
- rights.
38
-
39
- We protect your rights with two steps: (1) copyright the software, and
40
- (2) offer you this license which gives you legal permission to copy,
41
- distribute and/or modify the software.
42
-
43
- Also, for each author's protection and ours, we want to make certain
44
- that everyone understands that there is no warranty for this free
45
- software. If the software is modified by someone else and passed on, we
46
- want its recipients to know that what they have is not the original, so
47
- that any problems introduced by others will not reflect on the original
48
- authors' reputations.
49
-
50
- Finally, any free program is threatened constantly by software
51
- patents. We wish to avoid the danger that redistributors of a free
52
- program will individually obtain patent licenses, in effect making the
53
- program proprietary. To prevent this, we have made it clear that any
54
- patent must be licensed for everyone's free use or not licensed at all.
55
-
56
- The precise terms and conditions for copying, distribution and
57
- modification follow.
58
-
59
- GNU GENERAL PUBLIC LICENSE
60
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
61
-
62
- 0. This License applies to any program or other work which contains
63
- a notice placed by the copyright holder saying it may be distributed
64
- under the terms of this General Public License. The "Program", below,
65
- refers to any such program or work, and a "work based on the Program"
66
- means either the Program or any derivative work under copyright law:
67
- that is to say, a work containing the Program or a portion of it,
68
- either verbatim or with modifications and/or translated into another
69
- language. (Hereinafter, translation is included without limitation in
70
- the term "modification".) Each licensee is addressed as "you".
71
-
72
- Activities other than copying, distribution and modification are not
73
- covered by this License; they are outside its scope. The act of
74
- running the Program is not restricted, and the output from the Program
75
- is covered only if its contents constitute a work based on the
76
- Program (independent of having been made by running the Program).
77
- Whether that is true depends on what the Program does.
78
-
79
- 1. You may copy and distribute verbatim copies of the Program's
80
- source code as you receive it, in any medium, provided that you
81
- conspicuously and appropriately publish on each copy an appropriate
82
- copyright notice and disclaimer of warranty; keep intact all the
83
- notices that refer to this License and to the absence of any warranty;
84
- and give any other recipients of the Program a copy of this License
85
- along with the Program.
86
-
87
- You may charge a fee for the physical act of transferring a copy, and
88
- you may at your option offer warranty protection in exchange for a fee.
89
-
90
- 2. You may modify your copy or copies of the Program or any portion
91
- of it, thus forming a work based on the Program, and copy and
92
- distribute such modifications or work under the terms of Section 1
93
- above, provided that you also meet all of these conditions:
94
-
95
- a) You must cause the modified files to carry prominent notices
96
- stating that you changed the files and the date of any change.
97
-
98
- b) You must cause any work that you distribute or publish, that in
99
- whole or in part contains or is derived from the Program or any
100
- part thereof, to be licensed as a whole at no charge to all third
101
- parties under the terms of this License.
102
-
103
- c) If the modified program normally reads commands interactively
104
- when run, you must cause it, when started running for such
105
- interactive use in the most ordinary way, to print or display an
106
- announcement including an appropriate copyright notice and a
107
- notice that there is no warranty (or else, saying that you provide
108
- a warranty) and that users may redistribute the program under
109
- these conditions, and telling the user how to view a copy of this
110
- License. (Exception: if the Program itself is interactive but
111
- does not normally print such an announcement, your work based on
112
- the Program is not required to print an announcement.)
113
-
114
- These requirements apply to the modified work as a whole. If
115
- identifiable sections of that work are not derived from the Program,
116
- and can be reasonably considered independent and separate works in
117
- themselves, then this License, and its terms, do not apply to those
118
- sections when you distribute them as separate works. But when you
119
- distribute the same sections as part of a whole which is a work based
120
- on the Program, the distribution of the whole must be on the terms of
121
- this License, whose permissions for other licensees extend to the
122
- entire whole, and thus to each and every part regardless of who wrote it.
123
-
124
- Thus, it is not the intent of this section to claim rights or contest
125
- your rights to work written entirely by you; rather, the intent is to
126
- exercise the right to control the distribution of derivative or
127
- collective works based on the Program.
128
-
129
- In addition, mere aggregation of another work not based on the Program
130
- with the Program (or with a work based on the Program) on a volume of
131
- a storage or distribution medium does not bring the other work under
132
- the scope of this License.
133
-
134
- 3. You may copy and distribute the Program (or a work based on it,
135
- under Section 2) in object code or executable form under the terms of
136
- Sections 1 and 2 above provided that you also do one of the following:
137
-
138
- a) Accompany it with the complete corresponding machine-readable
139
- source code, which must be distributed under the terms of Sections
140
- 1 and 2 above on a medium customarily used for software interchange; or,
141
-
142
- b) Accompany it with a written offer, valid for at least three
143
- years, to give any third party, for a charge no more than your
144
- cost of physically performing source distribution, a complete
145
- machine-readable copy of the corresponding source code, to be
146
- distributed under the terms of Sections 1 and 2 above on a medium
147
- customarily used for software interchange; or,
148
-
149
- c) Accompany it with the information you received as to the offer
150
- to distribute corresponding source code. (This alternative is
151
- allowed only for noncommercial distribution and only if you
152
- received the program in object code or executable form with such
153
- an offer, in accord with Subsection b above.)
154
-
155
- The source code for a work means the preferred form of the work for
156
- making modifications to it. For an executable work, complete source
157
- code means all the source code for all modules it contains, plus any
158
- associated interface definition files, plus the scripts used to
159
- control compilation and installation of the executable. However, as a
160
- special exception, the source code distributed need not include
161
- anything that is normally distributed (in either source or binary
162
- form) with the major components (compiler, kernel, and so on) of the
163
- operating system on which the executable runs, unless that component
164
- itself accompanies the executable.
165
-
166
- If distribution of executable or object code is made by offering
167
- access to copy from a designated place, then offering equivalent
168
- access to copy the source code from the same place counts as
169
- distribution of the source code, even though third parties are not
170
- compelled to copy the source along with the object code.
171
-
172
- 4. You may not copy, modify, sublicense, or distribute the Program
173
- except as expressly provided under this License. Any attempt
174
- otherwise to copy, modify, sublicense or distribute the Program is
175
- void, and will automatically terminate your rights under this License.
176
- However, parties who have received copies, or rights, from you under
177
- this License will not have their licenses terminated so long as such
178
- parties remain in full compliance.
179
-
180
- 5. You are not required to accept this License, since you have not
181
- signed it. However, nothing else grants you permission to modify or
182
- distribute the Program or its derivative works. These actions are
183
- prohibited by law if you do not accept this License. Therefore, by
184
- modifying or distributing the Program (or any work based on the
185
- Program), you indicate your acceptance of this License to do so, and
186
- all its terms and conditions for copying, distributing or modifying
187
- the Program or works based on it.
188
-
189
- 6. Each time you redistribute the Program (or any work based on the
190
- Program), the recipient automatically receives a license from the
191
- original licensor to copy, distribute or modify the Program subject to
192
- these terms and conditions. You may not impose any further
193
- restrictions on the recipients' exercise of the rights granted herein.
194
- You are not responsible for enforcing compliance by third parties to
195
- this License.
196
-
197
- 7. If, as a consequence of a court judgment or allegation of patent
198
- infringement or for any other reason (not limited to patent issues),
199
- conditions are imposed on you (whether by court order, agreement or
200
- otherwise) that contradict the conditions of this License, they do not
201
- excuse you from the conditions of this License. If you cannot
202
- distribute so as to satisfy simultaneously your obligations under this
203
- License and any other pertinent obligations, then as a consequence you
204
- may not distribute the Program at all. For example, if a patent
205
- license would not permit royalty-free redistribution of the Program by
206
- all those who receive copies directly or indirectly through you, then
207
- the only way you could satisfy both it and this License would be to
208
- refrain entirely from distribution of the Program.
209
-
210
- If any portion of this section is held invalid or unenforceable under
211
- any particular circumstance, the balance of the section is intended to
212
- apply and the section as a whole is intended to apply in other
213
- circumstances.
214
-
215
- It is not the purpose of this section to induce you to infringe any
216
- patents or other property right claims or to contest validity of any
217
- such claims; this section has the sole purpose of protecting the
218
- integrity of the free software distribution system, which is
219
- implemented by public license practices. Many people have made
220
- generous contributions to the wide range of software distributed
221
- through that system in reliance on consistent application of that
222
- system; it is up to the author/donor to decide if he or she is willing
223
- to distribute software through any other system and a licensee cannot
224
- impose that choice.
225
-
226
- This section is intended to make thoroughly clear what is believed to
227
- be a consequence of the rest of this License.
228
-
229
- 8. If the distribution and/or use of the Program is restricted in
230
- certain countries either by patents or by copyrighted interfaces, the
231
- original copyright holder who places the Program under this License
232
- may add an explicit geographical distribution limitation excluding
233
- those countries, so that distribution is permitted only in or among
234
- countries not thus excluded. In such case, this License incorporates
235
- the limitation as if written in the body of this License.
236
-
237
- 9. The Free Software Foundation may publish revised and/or new versions
238
- of the General Public License from time to time. Such new versions will
239
- be similar in spirit to the present version, but may differ in detail to
240
- address new problems or concerns.
241
-
242
- Each version is given a distinguishing version number. If the Program
243
- specifies a version number of this License which applies to it and "any
244
- later version", you have the option of following the terms and conditions
245
- either of that version or of any later version published by the Free
246
- Software Foundation. If the Program does not specify a version number of
247
- this License, you may choose any version ever published by the Free Software
248
- Foundation.
249
-
250
- 10. If you wish to incorporate parts of the Program into other free
251
- programs whose distribution conditions are different, write to the author
252
- to ask for permission. For software which is copyrighted by the Free
253
- Software Foundation, write to the Free Software Foundation; we sometimes
254
- make exceptions for this. Our decision will be guided by the two goals
255
- of preserving the free status of all derivatives of our free software and
256
- of promoting the sharing and reuse of software generally.
257
-
258
- NO WARRANTY
259
-
260
- 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
261
- FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
262
- OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
263
- PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
264
- OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
265
- MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
266
- TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
267
- PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
268
- REPAIR OR CORRECTION.
269
-
270
- 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
271
- WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
272
- REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
273
- INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
274
- OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
275
- TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
276
- YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
277
- PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
278
- POSSIBILITY OF SUCH DAMAGES.
279
-
280
- END OF TERMS AND CONDITIONS
281
-
282
- How to Apply These Terms to Your New Programs
283
-
284
- If you develop a new program, and you want it to be of the greatest
285
- possible use to the public, the best way to achieve this is to make it
286
- free software which everyone can redistribute and change under these terms.
287
-
288
- To do so, attach the following notices to the program. It is safest
289
- to attach them to the start of each source file to most effectively
290
- convey the exclusion of warranty; and each file should have at least
291
- the "copyright" line and a pointer to where the full notice is found.
292
-
293
- {description}
294
- Copyright (C) {year} {fullname}
295
-
296
- This program is free software; you can redistribute it and/or modify
297
- it under the terms of the GNU General Public License as published by
298
- the Free Software Foundation; either version 2 of the License, or
299
- (at your option) any later version.
300
-
301
- This program is distributed in the hope that it will be useful,
302
- but WITHOUT ANY WARRANTY; without even the implied warranty of
303
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
304
- GNU General Public License for more details.
305
-
306
- You should have received a copy of the GNU General Public License along
307
- with this program; if not, write to the Free Software Foundation, Inc.,
308
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
309
-
310
- Also add information on how to contact you by electronic and paper mail.
311
-
312
- If the program is interactive, make it output a short notice like this
313
- when it starts in an interactive mode:
314
-
315
- Gnomovision version 69, Copyright (C) year name of author
316
- Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
317
- This is free software, and you are welcome to redistribute it
318
- under certain conditions; type `show c' for details.
319
-
320
- The hypothetical commands `show w' and `show c' should show the appropriate
321
- parts of the General Public License. Of course, the commands you use may
322
- be called something other than `show w' and `show c'; they could even be
323
- mouse-clicks or menu items--whatever suits your program.
324
-
325
- You should also get your employer (if you work as a programmer) or your
326
- school, if any, to sign a "copyright disclaimer" for the program, if
327
- necessary. Here is a sample; alter the names:
328
-
329
- Yoyodyne, Inc., hereby disclaims all copyright interest in the program
330
- `Gnomovision' (which makes passes at compilers) written by James Hacker.
331
-
332
- {signature of Ty Coon}, 1 April 1989
333
- Ty Coon, President of Vice
334
-
335
- This General Public License does not permit incorporating your program into
336
- proprietary programs. If your program is a subroutine library, you may
337
- consider it more useful to permit linking proprietary applications with the
338
- library. If this is what you want to do, use the GNU Lesser General
339
- Public License instead of this License.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/includes/libraries/Gamajo-Template-Loader/README.md DELETED
@@ -1,60 +0,0 @@
1
- # Gamajo Template Loader
2
-
3
- A class to copy into your WordPress plugin, to allow loading template parts with fallback through the child theme > parent theme > plugin.
4
-
5
- ## Description
6
-
7
- Easy Digital Downloads, WooCommerce, and Events Calendar plugins, amongst others, allow you to add files to your theme to override the default templates that come with the plugin. As a developer, adding this convenience in to your own plugin can be a little tricky.
8
-
9
- The `get_template_part()` function in WordPress was never really designed with plugins in mind, since it relies on `locate_template()` which only checks child and parent themes. So we can add in a final fallback that uses the templates in the plugin, we have to use a custom `locate_template()` function, and a custom `get_template_part()` function. The solution here just wraps them up as a class for convenience.
10
-
11
- ## Installation
12
-
13
- This isn't a WordPress plugin on its own, so the usual instructions don't apply. Instead:
14
-
15
- 1. Copy [`class-gamajo-template-loader.php`](class-gamajo-template-loader.php) into your plugin. It can be into a file in the plugin root, or better, an `includes` directory.
16
- 2. Create a new file, such as `class-your-plugin-template-loader.php`, in the same directory.
17
- 3. Create a class in that file that extends `Gamajo_Tech_Loader`. You can copy the [meal planner](class-meal-planner-template-loader.php) example class as a starting point if it helps.
18
- 4. Override the class properties to suit your plugin. You could also override the `get_templates_dir()` method if it isn't right for you.
19
- 5. You can now instantiate your custom template loader class, and use it to call the `get_template_part()` method. This could be within a shortcode callback, or something you want theme developers to include in their files.
20
- 6. Optionally, you can wrap the reference to the object in a functions e.g.
21
-
22
- ~~~
23
- // Template loader instantiated elsewhere, such as the main plugin file
24
- $meal_planner_template_loader = new Meal_Planner_Template_Loader;
25
-
26
- // ...
27
-
28
- // This function can live wherever is suitable in your plugin
29
- function meal_planner_get_template_part( $slug, $name = null, $load = true ) {
30
- global $meal_planner_template_loader;
31
- $meal_planner_template_loader->get_template_part( $slug, $name, $load );
32
- }
33
- ~~~
34
- 7. An example using the helper function (or class method) would be:
35
-
36
- ~~~
37
- add_filter( 'the_content', 'meal_planner_single_recipe_content' );
38
- function meal_planner_single_recipe_content( $content ) {
39
- if ( ! function_exists( 'meal_planner_get_template_part' ) ) {
40
- return $content;
41
- }
42
- meal_planner_get_template_part( 'recipe', 'ingredients' );
43
- meal_planner_get_template_part( 'recipe', 'instructions' );
44
- }
45
- ~~~
46
- This will try to load up `wp-content/themes/my-theme/meal-planner/recipe-ingredients.php`, or `wp-content/themes/my-theme/meal-planner/recipe.php`, then fallback to `wp-content/plugins/meal-planner/templates/recipe-ingredients.php` or `wp-content/plugins/meal-planner/templates/recipe.php`.
47
-
48
- ## Usage Example
49
-
50
- The [Cue](https://github.com/AudioTheme/cue) plugin from [AudioTheme](http://audiotheme.com/) uses this class. Starting at [https://github.com/AudioTheme/cue/tree/develop/includes](https://github.com/AudioTheme/cue/tree/develop/includes), it has this class in the vendor directory, then the required subclass of my class in the `class-cue-template-loader.php` file, which sets a few basic properties. It also has a template in [https://github.com/AudioTheme/cue/tree/develop/templates](https://github.com/AudioTheme/cue/tree/develop/templates).
51
-
52
- If you wanted the playlist to have different markup for your theme, you'd copy `templates/playlist.php` to `wp-content/themes/{your-active-theme}/cue/playlist.php` and do whatever changes you wanted. WordPress will look for that file first, before then checking a parent theme location (if your active theme is a child theme), before falling back to the default template that comes with the Cue plugin.
53
-
54
- ## Contributions
55
- Contributions are welcome - fork, fix and send pull requests against the `develop` branch please.
56
-
57
- ## Credits
58
-
59
- Built by [Gary Jones](https://twitter.com/GaryJ)
60
- Copyright 2013 [Gamajo Tech](http://gamajo.com/)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/includes/libraries/Gamajo-Template-Loader/class-gamajo-template-loader.php DELETED
@@ -1,222 +0,0 @@
1
- <?php
2
- /**
3
- * Template Loader for Plugins.
4
- *
5
- * @package Gamajo_Template_Loader
6
- * @author Gary Jones
7
- * @link http://github.com/GaryJones/Gamajo-Template-Loader
8
- * @copyright 2013 Gary Jones
9
- * @license GPL-2.0+
10
- * @version 1.1.0
11
- */
12
-
13
- if ( ! class_exists( 'Gamajo_Template_Loader' ) ) {
14
- /**
15
- * Template loader.
16
- *
17
- * Originally based on functions in Easy Digital Downloads (thanks Pippin!).
18
- *
19
- * When using in a plugin, create a new class that extends this one and just overrides the properties.
20
- *
21
- * @package Gamajo_Template_Loader
22
- * @author Gary Jones
23
- */
24
- class Gamajo_Template_Loader {
25
- /**
26
- * Prefix for filter names.
27
- *
28
- * @since 1.0.0
29
- *
30
- * @type string
31
- */
32
- protected $filter_prefix = 'your_plugin';
33
-
34
- /**
35
- * Directory name where custom templates for this plugin should be found in the theme.
36
- *
37
- * @since 1.0.0
38
- *
39
- * @type string
40
- */
41
- protected $theme_template_directory = 'your-plugin'; // or 'your-plugin-templates' etc.
42
-
43
- /**
44
- * Reference to the root directory path of this plugin.
45
- *
46
- * Can either be a defined constant, or a relative reference from where the subclass lives.
47
- *
48
- * @since 1.0.0
49
- *
50
- * @type string
51
- */
52
- protected $plugin_directory = YOUR_PLUGIN_DIR; // or plugin_dir_path( dirname( __FILE__ ) ); etc.
53
-
54
- /**
55
- * Directory name where templates are found in this plugin.
56
- *
57
- * Can either be a defined constant, or a relative reference from where the subclass lives.
58
- *
59
- * @since 1.1.0
60
- *
61
- * @type string
62
- */
63
- protected $plugin_template_directory = 'templates'; // or includes/templates, etc.
64
-
65
- /**
66
- * Retrieve a template part.
67
- *
68
- * @since 1.0.0
69
- *
70
- * @uses Gamajo_Template_Loader::get_template_possble_parts() Create file names of templates.
71
- * @uses Gamajo_Template_Loader::locate_template() Retrieve the name of the highest priority template
72
- * file that exists.
73
- *
74
- * @param string $slug
75
- * @param string $name Optional. Default null.
76
- * @param bool $load Optional. Default true.
77
- *
78
- * @return string
79
- */
80
- public function get_template_part( $slug, $name = null, $load = true ) {
81
- // Execute code for this part
82
- do_action( 'get_template_part_' . $slug, $slug, $name );
83
-
84
- // Get files names of templates, for given slug and name.
85
- $templates = $this->get_template_file_names( $slug, $name );
86
-
87
- // Return the part that is found
88
- return $this->locate_template( $templates, $load, false );
89
- }
90
-
91
- /**
92
- * Given a slug and optional name, create the file names of templates.
93
- *
94
- * @since 1.0.0
95
- *
96
- * @param string $slug
97
- * @param string $name
98
- *
99
- * @return array
100
- */
101
- protected function get_template_file_names( $slug, $name ) {
102
- $templates = array();
103
- if ( isset( $name ) ) {
104
- $templates[] = $slug . '-' . $name . '.php';
105
- }
106
- $templates[] = $slug . '.php';
107
-
108
- /**
109
- * Allow template choices to be filtered.
110
- *
111
- * The resulting array should be in the order of most specific first, to least specific last.
112
- * e.g. 0 => recipe-instructions.php, 1 => recipe.php
113
- *
114
- * @since 1.0.0
115
- *
116
- * @param array $templates Names of template files that should be looked for, for given slug and name.
117
- * @param string $slug Template slug.
118
- * @param string $name Template name.
119
- */
120
- return apply_filters( $this->filter_prefix . '_get_template_part', $templates, $slug, $name );
121
- }
122
-
123
- /**
124
- * Retrieve the name of the highest priority template file that exists.
125
- *
126
- * Searches in the STYLESHEETPATH before TEMPLATEPATH so that themes which
127
- * inherit from a parent theme can just overload one file. If the template is
128
- * not found in either of those, it looks in the theme-compat folder last.
129
- *
130
- * @since 1.0.0
131
- *
132
- * @uses Gamajo_Tech_Loader::get_template_paths() Return a list of paths to check for template locations.
133
- *
134
- * @param string|array $template_names Template file(s) to search for, in order.
135
- * @param bool $load If true the template file will be loaded if it is found.
136
- * @param bool $require_once Whether to require_once or require. Default true.
137
- * Has no effect if $load is false.
138
- *
139
- * @return string The template filename if one is located.
140
- */
141
- public function locate_template( $template_names, $load = false, $require_once = true ) {
142
- // No file found yet
143
- $located = false;
144
-
145
- // Remove empty entries
146
- $template_names = array_filter( (array) $template_names );
147
- $template_paths = $this->get_template_paths();
148
-
149
- // Try to find a template file
150
- foreach ( $template_names as $template_name ) {
151
- // Trim off any slashes from the template name
152
- $template_name = ltrim( $template_name, '/' );
153
-
154
- // Try locating this template file by looping through the template paths
155
- foreach ( $template_paths as $template_path ) {
156
- if ( file_exists( $template_path . $template_name ) ) {
157
- $located = $template_path . $template_name;
158
- break 2;
159
- }
160
- }
161
- }
162
-
163
- if ( $load && $located ) {
164
- load_template( $located, $require_once );
165
- }
166
-
167
- return $located;
168
- }
169
-
170
- /**
171
- * Return a list of paths to check for template locations.
172
- *
173
- * Default is to check in a child theme (if relevant) before a parent theme, so that themes which inherit from a
174
- * parent theme can just overload one file. If the template is not found in either of those, it looks in the
175
- * theme-compat folder last.
176
- *
177
- * @since 1.0.0
178
- *
179
- * @return mixed|void
180
- */
181
- protected function get_template_paths() {
182
- $theme_directory = trailingslashit( $this->theme_template_directory );
183
-
184
- $file_paths = array(
185
- 10 => trailingslashit( get_template_directory() ) . $theme_directory,
186
- 100 => $this->get_templates_dir(),
187
- );
188
-
189
- // Only add this conditionally, so non-child themes don't redundantly check active theme twice.
190
- if ( is_child_theme() ) {
191
- $file_paths[1] = trailingslashit( get_stylesheet_directory() ) . $theme_directory;
192
- }
193
-
194
- /**
195
- * Allow ordered list of template paths to be amended.
196
- *
197
- * @since 1.0.0
198
- *
199
- * @param array $var Default is directory in child theme at index 1, parent theme at 10, and plugin at 100.
200
- */
201
- $file_paths = apply_filters( $this->filter_prefix . '_template_paths', $file_paths );
202
-
203
- // sort the file paths based on priority
204
- ksort( $file_paths, SORT_NUMERIC );
205
-
206
- return array_map( 'trailingslashit', $file_paths );
207
- }
208
-
209
- /**
210
- * Return the path to the templates directory in this plugin.
211
- *
212
- * May be overridden in subclass.
213
- *
214
- * @since 1.0.0
215
- *
216
- * @return string
217
- */
218
- protected function get_templates_dir() {
219
- return trailingslashit( $this->plugin_directory ) . $this->plugin_template_directory;
220
- }
221
- }
222
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/includes/libraries/Gamajo-Template-Loader/class-meal-planner-template-loader.php DELETED
@@ -1,58 +0,0 @@
1
- <?php
2
- /**
3
- * Meal Planner
4
- *
5
- * @package Meal_Planner
6
- * @author Gary Jones
7
- * @link http://example.com/meal-planner
8
- * @copyright 2013 Gary Jones
9
- * @license GPL-2.0+
10
- */
11
-
12
- if( ! class_exists( 'Gamajo_Template_Loader' ) ) {
13
- require plugin_dir_path( __FILE__ ) . 'class-gamajo-template-loader.php';
14
- }
15
-
16
- /**
17
- * Template loader for Meal Planner.
18
- *
19
- * Only need to specify class properties here.
20
- *
21
- * @package Meal_Planner
22
- * @author Gary Jones
23
- */
24
- class Meal_Planner_Template_Loader extends Gamajo_Template_Loader {
25
-
26
- /**
27
- * Prefix for filter names.
28
- *
29
- * @since 1.0.0
30
- * @type string
31
- */
32
- protected $filter_prefix = 'meal_planner';
33
-
34
- /**
35
- * Directory name where custom templates for this plugin should be found in the theme.
36
- *
37
- * @since 1.0.0
38
- * @type string
39
- */
40
- protected $theme_template_directory = 'meal-planner';
41
-
42
- /**
43
- * Reference to the root directory path of this plugin.
44
- *
45
- * Can either be a defined constant, or a relative reference from where the subclass lives.
46
- *
47
- * In this case, `MEAL_PLANNER_PLUGIN_DIR` would be defined in the root plugin file as:
48
- *
49
- * ~~~
50
- * define( 'MEAL_PLANNER_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
51
- * ~~~
52
- *
53
- * @since 1.0.0
54
- * @type string
55
- */
56
- protected $plugin_directory = MEAL_PLANNER_PLUGIN_DIR;
57
-
58
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/includes/libraries/Gamajo-Template-Loader/composer.json DELETED
@@ -1,24 +0,0 @@
1
- {
2
- "name" : "gamajo/template-loader",
3
- "description": "A class for your WordPress plugin, to allow loading template parts with fallback through the child theme > parent theme > plugin",
4
- "keywords" : ["wordpress", "templates"],
5
- "homepage" : "http://github.com/GaryJones/Gamajo-Template-Loader",
6
- "license" : "GPL-2.0+",
7
- "authors" : [
8
- {
9
- "name" : "Gary Jones",
10
- "email" : "gamajo@gamajo.com",
11
- "homepage": "http://gamajo.com",
12
- "role" : "Developer"
13
- }
14
- ],
15
- "support" : {
16
- "issues": "https://github.com/GaryJones/Gamajo-Template-Loader/issues"
17
- },
18
- "require" : {
19
- "php": ">=5.2.4"
20
- },
21
- "autoload" : {
22
- "classmap": ["class-gamajo-template-loader.php"]
23
- }
24
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/includes/libraries/aihrus-framework/CHANGELOG.md DELETED
@@ -1,141 +0,0 @@
1
- # CHANGELOG - Aihrus Framework
2
-
3
- ## master
4
-
5
- ## 1.1.5
6
- * Abstract do_validate_settings for easier reuse
7
- * Add 'content' option to settings display
8
- * Add CPT date archives helper
9
- * Add markdown2html helper
10
- * Add suggest ability to text filed
11
- * Add widget's form_parts method
12
- * Auto-detect file_get_contents or curl availability
13
- * Coding standards update
14
- * Don't shortcode attribute for reset options
15
- * Move get_suggest to widget abstract class from interface
16
- * On aihr_notice_error usage, push to server error log
17
- * Remove interface class usage
18
- * RESOLVE #4 Enable std default for metabox class
19
- * RESOLVE #5 Check for file_get_contents and curl_init before file grabbing
20
- * RESOLVE Add widget option defaults
21
- * RESOLVE form_parts not allowing no arguments
22
- * RESOLVE michael-cannon/testimonials-widget#6 On widget options, switch labels expand/collapse when using them
23
- * RESOLVE michael-cannon/testimonials-widget#78 Show revert link in deactivation admin notice
24
- * RESOLVE Move form_instance to abstract class Aihrus_Widget
25
- * RESOLVE Move get_suggest to abstract class Aihrus_Widget
26
- * RESOLVE Remove tw- reference
27
- * RESOLVE Space missing before Collapse
28
- * RESOLVE Use widget args than globals
29
- * Revise widget class for easier reuse
30
- * Update licensing GPL 2.0
31
- * Use parsedown for Markdown to HTML conversion
32
-
33
- ## 1.1.4
34
- * Carry over core baseline methods
35
-
36
- ## 1.1.3
37
- * Add check_user_role method
38
- * RESOLVE michael-cannon/testimonials-widget#85 New testimonial rating field is blank
39
- * RESOLVE Undefined index notice
40
-
41
- ## 1.1.2
42
- * Add licensing status notices
43
- * Code formatting
44
- * Don't remove license from settings
45
- * RESOLVE Undefined index
46
- * Restore default wp_remote_get timeout
47
- * Return if library class exists already
48
- * Update settings page detection
49
-
50
- ## 1.1.1
51
- * Remove unused `widget_options`
52
- * RESOLVE michael-cannon/testimonials-widget#65 Widget blank options aren't saving correctly
53
-
54
- ## 1.1.0
55
- * Abstract deactivate_plugins actual to aihr_deactivate_plugin_do
56
- * Add class redrokk_metabox_class
57
- * Add class wp_custom_post_status
58
- * Add date, time, and datetime types to redrokk_metabox_class
59
- * Add rich_editor type
60
- * Add validate_email
61
- * Consolidate deactivate_plugins activity into aihr_deactivate_plugin
62
- * Don't esc_attr rich editor value
63
- * Limit wp_custom_post_status to post type
64
- * Move classes/interfaces to includes
65
- * Register `jquery-style`
66
- * Rename requirements.php to aihrus-framework.php
67
- * RESOLVE michael-cannon/testimonials-widget#63 Unable to activate premium license
68
- * RESOLVE michael-cannon/testimonials-widget#65 Widget blank options aren't saving correctly
69
- * RESOLVE michael-cannon/testimonials-widget#76 Undefined index: hide_image_single
70
- * RESOLVE redrokk_metabox_class prepare warning
71
- * Revise get_styles handling
72
- * Set AIHR_DIR* helpers
73
- * Set defaults for validators
74
- * Set premium license key for 2 years though it expires at 1
75
- * Update copyright year
76
-
77
- ## 1.0.3
78
- * RESOLVE Fatal error: Call to undefined function add_settings_error() in class-aihrus-settings.php on line 559
79
- * RESOLVE Featured image via Gravatar not saving correctly
80
- * Revise data deletion description - Thank you Mark
81
-
82
- ## 1.0.2
83
- * Add phpunit.xml
84
- * Add `slash_sanitize_title` verification helper
85
- * Coding standards
86
- * Display "Settings saved."
87
- * Move ci to tests
88
- * Remove Travis configuration
89
- * RESOLVE michael-cannon/testimonials-widget#48 Activation on WP 3.6 not working
90
- * RESOLVE michael-cannon/wootheme-testimonials-to-testimonials#2 No settings saved notice upon saving settings
91
- * Update usage instructions
92
- * Use $plugin_assets than $plugin_path
93
-
94
- ## 1.0.1
95
- * Add strip_protocol
96
- * Add valid_hash check
97
- * Move relicensing to plugin level
98
-
99
- ## 1.0.0
100
- * Enable aihr_check_aihrus_framework
101
-
102
- ## 0.0.0
103
- * Abstract notice helper methods as functions
104
- * Add TODO
105
- * Add `add_media` post attachment helper
106
- * Add `clean_string` trim, strip_shortcodes, and strip_tags a string
107
- * Add `create_link( $link )`
108
- * Add `create_nonce( $action )`
109
- * Add `file_get_contents_curl`
110
- * Add `get_image_src`
111
- * Add `is_true`, terms, url validate cases
112
- * Add `truncate`
113
- * Add `verify_nonce( $nonce, $action )`
114
- * Add abstract class Aihrus_Settings
115
- * Add abstract class Aihrus_Widget
116
- * Add aihr_notice_license
117
- * Add name filed to aihr_check_php
118
- * Add requirements helper
119
- * Add shortcode id helpers
120
- * Allow reset_defaults in widget
121
- * BUGFIX Method version not static
122
- * BUGFIX Widget title is same as link
123
- * CLOSES #2 Disable purchase premium links if premium is active
124
- * Check for PHP 5.3
125
- * Convert TODO to https://github.com/michael-cannon/aihrus-framework/issues
126
- * Display option values as is
127
- * Encase pronouns in double-quotes
128
- * RESOLVES #1 PHP Version checking
129
- * RESOLVES #3 Add WordPress version check
130
- * Remove unused methods
131
- * Rename $options[$id] to $field_value
132
- * Rename no_code to show_code
133
- * Revise create_link parameters
134
- * Settings link with null post_type
135
- * Switch from require_once to require file inclusion
136
- * Use `aihr_` as function prefix
137
- * Widget title uses create_link
138
- * static::ITEM_NAME to static::NAME
139
-
140
- ## 0.0.0
141
- * Initial code release
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/includes/libraries/aihrus-framework/LICENSE DELETED
@@ -1,339 +0,0 @@
1
- GNU GENERAL PUBLIC LICENSE
2
- Version 2, June 1991
3
-
4
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
5
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
6
- Everyone is permitted to copy and distribute verbatim copies
7
- of this license document, but changing it is not allowed.
8
-
9
- Preamble
10
-
11
- The licenses for most software are designed to take away your
12
- freedom to share and change it. By contrast, the GNU General Public
13
- License is intended to guarantee your freedom to share and change free
14
- software--to make sure the software is free for all its users. This
15
- General Public License applies to most of the Free Software
16
- Foundation's software and to any other program whose authors commit to
17
- using it. (Some other Free Software Foundation software is covered by
18
- the GNU Lesser General Public License instead.) You can apply it to
19
- your programs, too.
20
-
21
- When we speak of free software, we are referring to freedom, not
22
- price. Our General Public Licenses are designed to make sure that you
23
- have the freedom to distribute copies of free software (and charge for
24
- this service if you wish), that you receive source code or can get it
25
- if you want it, that you can change the software or use pieces of it
26
- in new free programs; and that you know you can do these things.
27
-
28
- To protect your rights, we need to make restrictions that forbid
29
- anyone to deny you these rights or to ask you to surrender the rights.
30
- These restrictions translate to certain responsibilities for you if you
31
- distribute copies of the software, or if you modify it.
32
-
33
- For example, if you distribute copies of such a program, whether
34
- gratis or for a fee, you must give the recipients all the rights that
35
- you have. You must make sure that they, too, receive or can get the
36
- source code. And you must show them these terms so they know their
37
- rights.
38
-
39
- We protect your rights with two steps: (1) copyright the software, and
40
- (2) offer you this license which gives you legal permission to copy,
41
- distribute and/or modify the software.
42
-
43
- Also, for each author's protection and ours, we want to make certain
44
- that everyone understands that there is no warranty for this free
45
- software. If the software is modified by someone else and passed on, we
46
- want its recipients to know that what they have is not the original, so
47
- that any problems introduced by others will not reflect on the original
48
- authors' reputations.
49
-
50
- Finally, any free program is threatened constantly by software
51
- patents. We wish to avoid the danger that redistributors of a free
52
- program will individually obtain patent licenses, in effect making the
53
- program proprietary. To prevent this, we have made it clear that any
54
- patent must be licensed for everyone's free use or not licensed at all.
55
-
56
- The precise terms and conditions for copying, distribution and
57
- modification follow.
58
-
59
- GNU GENERAL PUBLIC LICENSE
60
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
61
-
62
- 0. This License applies to any program or other work which contains
63
- a notice placed by the copyright holder saying it may be distributed
64
- under the terms of this General Public License. The "Program", below,
65
- refers to any such program or work, and a "work based on the Program"
66
- means either the Program or any derivative work under copyright law:
67
- that is to say, a work containing the Program or a portion of it,
68
- either verbatim or with modifications and/or translated into another
69
- language. (Hereinafter, translation is included without limitation in
70
- the term "modification".) Each licensee is addressed as "you".
71
-
72
- Activities other than copying, distribution and modification are not
73
- covered by this License; they are outside its scope. The act of
74
- running the Program is not restricted, and the output from the Program
75
- is covered only if its contents constitute a work based on the
76
- Program (independent of having been made by running the Program).
77
- Whether that is true depends on what the Program does.
78
-
79
- 1. You may copy and distribute verbatim copies of the Program's
80
- source code as you receive it, in any medium, provided that you
81
- conspicuously and appropriately publish on each copy an appropriate
82
- copyright notice and disclaimer of warranty; keep intact all the
83
- notices that refer to this License and to the absence of any warranty;
84
- and give any other recipients of the Program a copy of this License
85
- along with the Program.
86
-
87
- You may charge a fee for the physical act of transferring a copy, and
88
- you may at your option offer warranty protection in exchange for a fee.
89
-
90
- 2. You may modify your copy or copies of the Program or any portion
91
- of it, thus forming a work based on the Program, and copy and
92
- distribute such modifications or work under the terms of Section 1
93
- above, provided that you also meet all of these conditions:
94
-
95
- a) You must cause the modified files to carry prominent notices
96
- stating that you changed the files and the date of any change.
97
-
98
- b) You must cause any work that you distribute or publish, that in
99
- whole or in part contains or is derived from the Program or any
100
- part thereof, to be licensed as a whole at no charge to all third
101
- parties under the terms of this License.
102
-
103
- c) If the modified program normally reads commands interactively
104
- when run, you must cause it, when started running for such
105
- interactive use in the most ordinary way, to print or display an
106
- announcement including an appropriate copyright notice and a
107
- notice that there is no warranty (or else, saying that you provide
108
- a warranty) and that users may redistribute the program under
109
- these conditions, and telling the user how to view a copy of this
110
- License. (Exception: if the Program itself is interactive but
111
- does not normally print such an announcement, your work based on
112
- the Program is not required to print an announcement.)
113
-
114
- These requirements apply to the modified work as a whole. If
115
- identifiable sections of that work are not derived from the Program,
116
- and can be reasonably considered independent and separate works in
117
- themselves, then this License, and its terms, do not apply to those
118
- sections when you distribute them as separate works. But when you
119
- distribute the same sections as part of a whole which is a work based
120
- on the Program, the distribution of the whole must be on the terms of
121
- this License, whose permissions for other licensees extend to the
122
- entire whole, and thus to each and every part regardless of who wrote it.
123
-
124
- Thus, it is not the intent of this section to claim rights or contest
125
- your rights to work written entirely by you; rather, the intent is to
126
- exercise the right to control the distribution of derivative or
127
- collective works based on the Program.
128
-
129
- In addition, mere aggregation of another work not based on the Program
130
- with the Program (or with a work based on the Program) on a volume of
131
- a storage or distribution medium does not bring the other work under
132
- the scope of this License.
133
-
134
- 3. You may copy and distribute the Program (or a work based on it,
135
- under Section 2) in object code or executable form under the terms of
136
- Sections 1 and 2 above provided that you also do one of the following:
137
-
138
- a) Accompany it with the complete corresponding machine-readable
139
- source code, which must be distributed under the terms of Sections
140
- 1 and 2 above on a medium customarily used for software interchange; or,
141
-
142
- b) Accompany it with a written offer, valid for at least three
143
- years, to give any third party, for a charge no more than your
144
- cost of physically performing source distribution, a complete
145
- machine-readable copy of the corresponding source code, to be
146
- distributed under the terms of Sections 1 and 2 above on a medium
147
- customarily used for software interchange; or,
148
-
149
- c) Accompany it with the information you received as to the offer
150
- to distribute corresponding source code. (This alternative is
151
- allowed only for noncommercial distribution and only if you
152
- received the program in object code or executable form with such
153
- an offer, in accord with Subsection b above.)
154
-
155
- The source code for a work means the preferred form of the work for
156
- making modifications to it. For an executable work, complete source
157
- code means all the source code for all modules it contains, plus any
158
- associated interface definition files, plus the scripts used to
159
- control compilation and installation of the executable. However, as a
160
- special exception, the source code distributed need not include
161
- anything that is normally distributed (in either source or binary
162
- form) with the major components (compiler, kernel, and so on) of the
163
- operating system on which the executable runs, unless that component
164
- itself accompanies the executable.
165
-
166
- If distribution of executable or object code is made by offering
167
- access to copy from a designated place, then offering equivalent
168
- access to copy the source code from the same place counts as
169
- distribution of the source code, even though third parties are not
170
- compelled to copy the source along with the object code.
171
-
172
- 4. You may not copy, modify, sublicense, or distribute the Program
173
- except as expressly provided under this License. Any attempt
174
- otherwise to copy, modify, sublicense or distribute the Program is
175
- void, and will automatically terminate your rights under this License.
176
- However, parties who have received copies, or rights, from you under
177
- this License will not have their licenses terminated so long as such
178
- parties remain in full compliance.
179
-
180
- 5. You are not required to accept this License, since you have not
181
- signed it. However, nothing else grants you permission to modify or
182
- distribute the Program or its derivative works. These actions are
183
- prohibited by law if you do not accept this License. Therefore, by
184
- modifying or distributing the Program (or any work based on the
185
- Program), you indicate your acceptance of this License to do so, and
186
- all its terms and conditions for copying, distributing or modifying
187
- the Program or works based on it.
188
-
189
- 6. Each time you redistribute the Program (or any work based on the
190
- Program), the recipient automatically receives a license from the
191
- original licensor to copy, distribute or modify the Program subject to
192
- these terms and conditions. You may not impose any further
193
- restrictions on the recipients' exercise of the rights granted herein.
194
- You are not responsible for enforcing compliance by third parties to
195
- this License.
196
-
197
- 7. If, as a consequence of a court judgment or allegation of patent
198
- infringement or for any other reason (not limited to patent issues),
199
- conditions are imposed on you (whether by court order, agreement or
200
- otherwise) that contradict the conditions of this License, they do not
201
- excuse you from the conditions of this License. If you cannot
202
- distribute so as to satisfy simultaneously your obligations under this
203
- License and any other pertinent obligations, then as a consequence you
204
- may not distribute the Program at all. For example, if a patent
205
- license would not permit royalty-free redistribution of the Program by
206
- all those who receive copies directly or indirectly through you, then
207
- the only way you could satisfy both it and this License would be to
208
- refrain entirely from distribution of the Program.
209
-
210
- If any portion of this section is held invalid or unenforceable under
211
- any particular circumstance, the balance of the section is intended to
212
- apply and the section as a whole is intended to apply in other
213
- circumstances.
214
-
215
- It is not the purpose of this section to induce you to infringe any
216
- patents or other property right claims or to contest validity of any
217
- such claims; this section has the sole purpose of protecting the
218
- integrity of the free software distribution system, which is
219
- implemented by public license practices. Many people have made
220
- generous contributions to the wide range of software distributed
221
- through that system in reliance on consistent application of that
222
- system; it is up to the author/donor to decide if he or she is willing
223
- to distribute software through any other system and a licensee cannot
224
- impose that choice.
225
-
226
- This section is intended to make thoroughly clear what is believed to
227
- be a consequence of the rest of this License.
228
-
229
- 8. If the distribution and/or use of the Program is restricted in
230
- certain countries either by patents or by copyrighted interfaces, the
231
- original copyright holder who places the Program under this License
232
- may add an explicit geographical distribution limitation excluding
233
- those countries, so that distribution is permitted only in or among
234
- countries not thus excluded. In such case, this License incorporates
235
- the limitation as if written in the body of this License.
236
-
237
- 9. The Free Software Foundation may publish revised and/or new versions
238
- of the General Public License from time to time. Such new versions will
239
- be similar in spirit to the present version, but may differ in detail to
240
- address new problems or concerns.
241
-
242
- Each version is given a distinguishing version number. If the Program
243
- specifies a version number of this License which applies to it and "any
244
- later version", you have the option of following the terms and conditions
245
- either of that version or of any later version published by the Free
246
- Software Foundation. If the Program does not specify a version number of
247
- this License, you may choose any version ever published by the Free Software
248
- Foundation.
249
-
250
- 10. If you wish to incorporate parts of the Program into other free
251
- programs whose distribution conditions are different, write to the author
252
- to ask for permission. For software which is copyrighted by the Free
253
- Software Foundation, write to the Free Software Foundation; we sometimes
254
- make exceptions for this. Our decision will be guided by the two goals
255
- of preserving the free status of all derivatives of our free software and
256
- of promoting the sharing and reuse of software generally.
257
-
258
- NO WARRANTY
259
-
260
- 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
261
- FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
262
- OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
263
- PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
264
- OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
265
- MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
266
- TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
267
- PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
268
- REPAIR OR CORRECTION.
269
-
270
- 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
271
- WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
272
- REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
273
- INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
274
- OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
275
- TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
276
- YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
277
- PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
278
- POSSIBILITY OF SUCH DAMAGES.
279
-
280
- END OF TERMS AND CONDITIONS
281
-
282
- How to Apply These Terms to Your New Programs
283
-
284
- If you develop a new program, and you want it to be of the greatest
285
- possible use to the public, the best way to achieve this is to make it
286
- free software which everyone can redistribute and change under these terms.
287
-
288
- To do so, attach the following notices to the program. It is safest
289
- to attach them to the start of each source file to most effectively
290
- convey the exclusion of warranty; and each file should have at least
291
- the "copyright" line and a pointer to where the full notice is found.
292
-
293
- <one line to give the program's name and a brief idea of what it does.>
294
- Copyright (C) <year> <name of author>
295
-
296
- This program is free software; you can redistribute it and/or modify
297
- it under the terms of the GNU General Public License as published by
298
- the Free Software Foundation; either version 2 of the License, or
299
- (at your option) any later version.
300
-
301
- This program is distributed in the hope that it will be useful,
302
- but WITHOUT ANY WARRANTY; without even the implied warranty of
303
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
304
- GNU General Public License for more details.
305
-
306
- You should have received a copy of the GNU General Public License along
307
- with this program; if not, write to the Free Software Foundation, Inc.,
308
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
309
-
310
- Also add information on how to contact you by electronic and paper mail.
311
-
312
- If the program is interactive, make it output a short notice like this
313
- when it starts in an interactive mode:
314
-
315
- Gnomovision version 69, Copyright (C) year name of author
316
- Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
317
- This is free software, and you are welcome to redistribute it
318
- under certain conditions; type `show c' for details.
319
-
320
- The hypothetical commands `show w' and `show c' should show the appropriate
321
- parts of the General Public License. Of course, the commands you use may
322
- be called something other than `show w' and `show c'; they could even be
323
- mouse-clicks or menu items--whatever suits your program.
324
-
325
- You should also get your employer (if you work as a programmer) or your
326
- school, if any, to sign a "copyright disclaimer" for the program, if
327
- necessary. Here is a sample; alter the names:
328
-
329
- Yoyodyne, Inc., hereby disclaims all copyright interest in the program
330
- `Gnomovision' (which makes passes at compilers) written by James Hacker.
331
-
332
- <signature of Ty Coon>, 1 April 1989
333
- Ty Coon, President of Vice
334
-
335
- This General Public License does not permit incorporating your program into
336
- proprietary programs. If your program is a subroutine library, you may
337
- consider it more useful to permit linking proprietary applications with the
338
- library. If this is what you want to do, use the GNU Lesser General
339
- Public License instead of this License.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/includes/libraries/aihrus-framework/README.md DELETED
@@ -1,74 +0,0 @@
1
- # Aihrus Framework
2
-
3
- A helper library for WordPress plugins by Aihrus.
4
-
5
- ## Features
6
-
7
- * Content truncation helper methods
8
- * Donation links
9
- * Image source and media attachment helper methods
10
- * Licensing
11
- * Link creation helper methods
12
- * Nonce helper methods
13
- * Notifications
14
- * Validation helper methods
15
-
16
- ## Usage
17
-
18
- * Change to plugin directory that's a Git clone
19
- * Load and link the external library
20
-
21
- ```
22
- git remote add aihrus https://github.com/michael-cannon/aihrus-framework.git
23
- git subtree add -P include/libraries/aihrus-framework aihrus master
24
- git commit -a -m "Readd aihrus framework"
25
- git push origin master
26
- ```
27
-
28
- * Link plugin to libary
29
-
30
- ```
31
- require WPS_DIR_LIB . '/aihrus-framework/class-aihrus-common.php';
32
- ```
33
-
34
- * Extend plugin class to library
35
-
36
- ```
37
- class Wordpress_Starter extends Aihrus_Common {
38
- ```
39
-
40
- * Add class static members
41
-
42
- ```
43
- public static $class = __CLASS__;
44
- public static $notice_key;
45
- ```
46
-
47
- * Set notices…
48
-
49
- ```
50
-
51
- if ( $bad_version )
52
- add_action( 'admin_notices', 'wps_notice_aihrus' );
53
-
54
- function wps_notice_aihrus() {
55
- $help_url = esc_url( 'https://aihrus.zendesk.com/entries/35689458' );
56
- $help_link = sprintf( __( '<a href="%1$s">Update plugins</a>. <a href="%2$s">More information</a>.' ), self_admin_url( 'update-core.php' ), $help_url );
57
-
58
- $text = sprintf( esc_html__( 'Plugin "%1$s" has been deactivated as it requires a current Aihrus Framework. Once corrected, "%1$s" can be activated. %2$s' ), WPS_NAME, $help_link );
59
-
60
- aihr_notice_error( $text );
61
- }
62
- ```
63
-
64
- * Update the external library
65
-
66
- ```
67
- git subtree pull -P include/libraries/aihrus-framework aihrus master
68
- ```
69
-
70
- * Update the plugin repository
71
-
72
- ```
73
- git push origin master
74
- ```
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/includes/libraries/aihrus-framework/aihrus-framework.php DELETED
@@ -1,367 +0,0 @@
1
- <?php
2
- /**
3
- Aihrus Framework
4
- Copyright (C) 2014 Michael Cannon
5
-
6
- This program is free software; you can redistribute it and/or modify
7
- it under the terms of the GNU General Public License as published by
8
- the Free Software Foundation; either version 2 of the License, or
9
- (at your option) any later version.
10
-
11
- This program is distributed in the hope that it will be useful,
12
- but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
- GNU General Public License for more details.
15
-
16
- You should have received a copy of the GNU General Public License along
17
- with this program; if not, write to the Free Software Foundation, Inc.,
18
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19
- */
20
-
21
- if ( ! defined( 'AIHR_BASE' ) ) {
22
- define( 'AIHR_BASE', __FILE__ );
23
- }
24
-
25
- if ( ! defined( 'AIHR_DIR' ) ) {
26
- define( 'AIHR_DIR', plugin_dir_path( __FILE__ ) );
27
- }
28
-
29
- if ( ! defined( 'AIHR_DIR_INC' ) ) {
30
- define( 'AIHR_DIR_INC', AIHR_DIR . 'includes/' );
31
- }
32
-
33
- if ( ! defined( 'AIHR_DIR_LIB' ) ) {
34
- define( 'AIHR_DIR_LIB', AIHR_DIR_INC . 'libraries/' );
35
- }
36
-
37
- if ( ! defined( 'AIHR_VERSION' ) ) {
38
- define( 'AIHR_VERSION', '1.1.5' );
39
- }
40
-
41
- require_once ABSPATH . 'wp-admin/includes/plugin.php';
42
-
43
-
44
- if ( ! function_exists( 'aihr_check_aihrus_framework' ) ) {
45
- function aihr_check_aihrus_framework( $file = null, $name = null, $aihr_min = '1.0.0' ) {
46
- if ( is_null( $file ) ) {
47
- aihr_notice_error( __( '`aihr_check_aihrus_framework` requires $file argument' ) );
48
-
49
- return false;
50
- }
51
-
52
- if ( ! defined( 'AIHR_VERSION' ) ) {
53
- $check_okay = false;
54
- } else {
55
- $check_okay = version_compare( AIHR_VERSION, $aihr_min, '>=' );
56
- }
57
-
58
- $file = plugin_basename( $file );
59
- if ( ! $check_okay && __FILE__ != $file ) {
60
- if ( ! defined( 'AIHR_VERSION_FILE' ) ) {
61
- define( 'AIHR_VERSION_FILE', $file );
62
- }
63
-
64
- if ( ! is_null( $name ) && ! defined( 'AIHR_VERSION_NAME' ) ) {
65
- define( 'AIHR_VERSION_NAME', $name );
66
- }
67
-
68
- if ( ! defined( 'AIHR_VERSION_MIN' ) ) {
69
- define( 'AIHR_VERSION_MIN', $aihr_min );
70
- }
71
-
72
- add_action( 'admin_notices', 'aihr_notice_aihrus_framework' );
73
- }
74
-
75
- return $check_okay;
76
- }
77
- }
78
-
79
- if ( ! function_exists( 'aihr_notice_aihrus_framework' ) ) {
80
- function aihr_notice_aihrus_framework() {
81
- if ( defined( 'AIHR_VERSION_NAME' ) ) {
82
- $name = AIHR_VERSION_NAME;
83
- } else {
84
- $name = basename( dirname( AIHR_VERSION_FILE ) );
85
- $name = str_replace( '-', ' ', $name );
86
- $name = ucwords( $name );
87
- }
88
-
89
- $help_url = esc_url( 'https://aihrus.zendesk.com/entries/35689458' );
90
- $help_link = sprintf( __( '<a href="%1$s">Update plugins</a>. <a href="%2$s">More information</a>.' ), self_admin_url( 'update-core.php' ), $help_url );
91
-
92
- $note = '';
93
- if ( defined( 'AIHR_BASE' ) ) {
94
- $plugin = plugin_basename( AIHR_BASE );
95
- $plugin = explode( '/', $plugin );
96
-
97
- $plugin_name = $plugin[0];
98
- $plugin_name = str_replace( '-', ' ', $plugin_name );
99
- $plugin_name = ucwords( $plugin_name );
100
-
101
- $note = sprintf( esc_html__( 'Plugin "%1$s" is causing the out of date issue.' ), $plugin_name );
102
- }
103
-
104
- $aihr_version = defined( 'AIHR_VERSION' ) ? AIHR_VERSION : '0.0.0';
105
-
106
- $text = sprintf( esc_html__( 'Plugin "%1$s" has been deactivated as it requires Aihrus Framework %2$s or newer. You\'re running Aihrus Framework %4$s. Once corrected, "%1$s" can be activated. %5$s %3$s' ), $name, AIHR_VERSION_MIN, $help_link, $aihr_version, $note );
107
-
108
- aihr_notice_error( $text );
109
- }
110
- }
111
-
112
- if ( ! function_exists( 'aihr_check_php' ) ) {
113
- function aihr_check_php( $file = null, $name = null, $php_min = '5.3.0' ) {
114
- if ( is_null( $file ) ) {
115
- aihr_notice_error( __( '`aihr_check_php` requires $file argument' ) );
116
-
117
- return false;
118
- }
119
-
120
- $check_okay = version_compare( PHP_VERSION, $php_min, '>=' );
121
- $file = plugin_basename( $file );
122
- if ( ! $check_okay && __FILE__ != $file ) {
123
- if ( ! defined( 'AIHR_PHP_VERSION_FILE' ) ) {
124
- define( 'AIHR_PHP_VERSION_FILE', $file );
125
- }
126
-
127
- if ( ! is_null( $name ) && ! defined( 'AIHR_PHP_VERSION_NAME' ) ) {
128
- define( 'AIHR_PHP_VERSION_NAME', $name );
129
- }
130
-
131
- if ( ! defined( 'AIHR_PHP_VERSION_MIN' ) ) {
132
- define( 'AIHR_PHP_VERSION_MIN', $php_min );
133
- }
134
-
135
- add_action( 'admin_notices', 'aihr_notice_php' );
136
- }
137
-
138
- return $check_okay;
139
- }
140
- }
141
-
142
- if ( ! function_exists( 'aihr_notice_php' ) ) {
143
- function aihr_notice_php() {
144
- if ( defined( 'AIHR_PHP_VERSION_NAME' ) ) {
145
- $name = AIHR_PHP_VERSION_NAME;
146
- } else {
147
- $name = basename( dirname( AIHR_PHP_VERSION_FILE ) );
148
- $name = str_replace( '-', ' ', $name );
149
- $name = ucwords( $name );
150
- }
151
-
152
- $help_url = esc_url( 'https://aihrus.zendesk.com/entries/30678006' );
153
-
154
- $text = sprintf( __( 'Plugin "%1$s" has been deactivated as it requires PHP %2$s or newer. You\'re running PHP %4$s. Once corrected, "%1$s" can be activated. <a href="%3$s">More information</a>.' ), $name, AIHR_PHP_VERSION_MIN, $help_url, PHP_VERSION );
155
-
156
- aihr_notice_error( $text );
157
- }
158
- }
159
-
160
- if ( ! function_exists( 'aihr_check_wp' ) ) {
161
- function aihr_check_wp( $file = null, $name = null, $wp_min = '3.6' ) {
162
- if ( is_null( $file ) ) {
163
- aihr_notice_error( __( '`aihr_check_wp` requires $file argument' ) );
164
-
165
- return false;
166
- }
167
-
168
- global $wp_version;
169
-
170
- $check_okay = version_compare( $wp_version, $wp_min, '>=' );
171
- $file = plugin_basename( $file );
172
- if ( ! $check_okay && __FILE__ != $file ) {
173
- if ( ! defined( 'AIHR_WP_VERSION_FILE' ) ) {
174
- define( 'AIHR_WP_VERSION_FILE', $file );
175
- }
176
-
177
- if ( ! is_null( $name ) && ! defined( 'AIHR_WP_VERSION_NAME' ) ) {
178
- define( 'AIHR_WP_VERSION_NAME', $name );
179
- }
180
-
181
- if ( ! defined( 'AIHR_WP_VERSION_MIN' ) ) {
182
- define( 'AIHR_WP_VERSION_MIN', $wp_min );
183
- }
184
-
185
- add_action( 'admin_notices', 'aihr_notice_wp' );
186
- }
187
-
188
- return $check_okay;
189
- }
190
- }
191
-
192
- if ( ! function_exists( 'aihr_notice_wp' ) ) {
193
- function aihr_notice_wp() {
194
- global $wp_version;
195
-
196
- if ( defined( 'AIHR_WP_VERSION_NAME' ) ) {
197
- $name = AIHR_WP_VERSION_NAME;
198
- } else {
199
- $name = basename( dirname( AIHR_WP_VERSION_FILE ) );
200
- $name = str_replace( '-', ' ', $name );
201
- $name = ucwords( $name );
202
- }
203
-
204
- $help_url = network_admin_url( 'update-core.php' );
205
-
206
- $text = sprintf( __( 'Plugin "%1$s" has been deactivated as it requires WordPress %2$s or newer. You\'re running WordPress %4$s. Once corrected, "%1$s" can be activated. <a href="%3$s">Update WordPress</a>.' ), $name, AIHR_WP_VERSION_MIN, $help_url, $wp_version );
207
-
208
- aihr_notice_error( $text );
209
- }
210
- }
211
-
212
- if ( ! function_exists( 'aihr_notice_error' ) ) {
213
- function aihr_notice_error( $text ) {
214
- aihr_notice_updated( $text, 'error' );
215
- error_log( $text );
216
- }
217
- }
218
-
219
- if ( ! function_exists( 'aihr_notice_updated' ) ) {
220
- function aihr_notice_updated( $text, $class = 'updated' ) {
221
- if ( 'updated' == $class ) {
222
- $class .= ' fade';
223
- }
224
-
225
- $content = '';
226
- $content .= '<div class="' . $class . '"><p>';
227
- $content .= $text;
228
- $content .= '</p></div>';
229
-
230
- echo $content;
231
- }
232
- }
233
-
234
- if ( ! function_exists( 'aihr_notice_version' ) ) {
235
- function aihr_notice_version( $required_base, $required_name, $required_slug, $required_version, $item_name ) {
236
- $is_active = is_plugin_active( $required_base );
237
- if ( $is_active ) {
238
- $link = sprintf( __( '<a href="%1$s">update to</a>' ), self_admin_url( 'update-core.php' ) );
239
- } else {
240
- $plugins = get_plugins();
241
- if ( empty( $plugins[ $required_base ] ) ) {
242
- $install = esc_url( wp_nonce_url( self_admin_url( 'update.php?action=install-plugin&plugin=' . $required_slug ), 'install-plugin_' . $required_slug ) );
243
- $link = sprintf( __( '<a href="%1$s">install</a>' ), $install );
244
- } else {
245
- $activate = esc_url( wp_nonce_url( admin_url( 'plugins.php?action=activate&plugin=' . $required_base ), 'activate-plugin_' . $required_base ) );
246
- $link = sprintf( __( '<a href="%1$s">activate</a>' ), $activate );
247
- }
248
- }
249
-
250
- $text = sprintf( __( 'Plugin "%3$s" has been deactivated. Please %1$s "%4$s" version %2$s or newer before activating "%3$s".' ), $link, $required_version, $item_name, $required_name );
251
-
252
- aihr_notice_error( $text );
253
- }
254
- }
255
-
256
- if ( ! function_exists( 'aihr_notice_license' ) ) {
257
- function aihr_notice_license( $post_type, $settings_id, $free_name, $purchase_url, $item_name, $product_id = null, $license = null ) {
258
- if ( empty( $post_type ) ) {
259
- $link = get_admin_url() . 'options-general.php?page=' . $settings_id;
260
- } else {
261
- $link = get_admin_url() . 'edit.php?post_type=' . $post_type . '&page=' . $settings_id;
262
- }
263
-
264
- $text = __( '<a href="%1$s">%2$s &gt; Settings</a>, <em>Premium</em> tab, <em>License Key</em>' );
265
-
266
- $settings_link = sprintf( $text, $link, $free_name );
267
-
268
- $link = esc_url( 'https://aihrus.zendesk.com/entries/28745227' );
269
- $text = __( '<a href="%s">Where\'s my license key?</a>' );
270
-
271
- $faq_link = sprintf( $text, $link );
272
-
273
- $link = esc_url( $purchase_url );
274
- $text = __( '<a href="%1$s">Purchase</a>' );
275
-
276
- $buy_link = sprintf( $text, $link, $item_name );
277
-
278
- $renew_link = '';
279
- if ( ! empty( $license ) ) {
280
- $link = parse_url( $purchase_url );
281
- $link = $link['host'];
282
- $text = __( '%1$s/checkout/?edd_license_key=%2$s&download_id=%3$s' );
283
- $renew_url = sprintf( $text, $link, $license, $product_id );
284
-
285
- $link = esc_url( $renew_url );
286
- $text = __( '<a href="%1$s">Renew</a> or ' );
287
-
288
- $renew_link = sprintf( $text, $link, $item_name );
289
- }
290
-
291
- $text = sprintf( __( 'Plugin "%1$s" requires license activation for software updates and support. Please activate the license via %2$s. See %3$s for help. Alternately, %5$s%4$s a %1$s license.' ), $item_name, $settings_link, $faq_link, $buy_link, $renew_link );
292
- $text = links_add_target( $text, '_blank' );
293
-
294
- aihr_notice_error( $text );
295
- }
296
- }
297
-
298
- if ( ! function_exists( 'aihr_deactivate_plugin' ) ) {
299
- function aihr_deactivate_plugin( $file = null, $name = null, $reason = '' ) {
300
- if ( is_null( $file ) ) {
301
- aihr_notice_error( __( '`aihr_deactivate_plugin` requires $file argument' ) );
302
-
303
- return false;
304
- }
305
-
306
- if ( is_null( $name ) && empty( $reason ) ) {
307
- aihr_deactivate_plugin_do( $file );
308
- return false;
309
- }
310
-
311
- if ( ! defined( 'AIHR_DEACTIVATE_REASON' ) ) {
312
- define( 'AIHR_DEACTIVATE_REASON', $reason );
313
- }
314
-
315
- if ( ! defined( 'AIHR_DEACTIVATE_FILE' ) ) {
316
- define( 'AIHR_DEACTIVATE_FILE', $file );
317
- }
318
-
319
- if ( ! is_null( $name ) && ! defined( 'AIHR_DEACTIVATE_NAME' ) ) {
320
- define( 'AIHR_DEACTIVATE_NAME', $name );
321
- }
322
-
323
- add_action( 'admin_notices', 'aihr_notice_deactivate' );
324
- }
325
- }
326
-
327
- if ( ! function_exists( 'aihr_notice_deactivate' ) ) {
328
- function aihr_notice_deactivate() {
329
- if ( defined( 'AIHR_DEACTIVATE_NAME' ) ) {
330
- $name = AIHR_DEACTIVATE_NAME;
331
- } else {
332
- $name = basename( dirname( AIHR_DEACTIVATE_FILE ) );
333
- $name = str_replace( '-', ' ', $name );
334
- $name = ucwords( $name );
335
- }
336
-
337
- if ( defined( 'AIHR_DEACTIVATE_REASON' ) ) {
338
- $reason = AIHR_DEACTIVATE_REASON;
339
- } else {
340
- $reason = esc_html__( 'Unknown' );
341
- }
342
-
343
- $file = AIHR_DEACTIVATE_FILE;
344
- $plugin_slug = dirname( plugin_basename( $file ) );
345
- $url = 'https://wordpress.org/plugins/' . $plugin_slug . '/developers/';
346
-
347
- $text = sprintf( __( 'Plugin "%1$s" has been deactivated due to "%2$s". Once corrected, "%1$s" can be activated.</p><p>If you want to revert "%1$s", look for <a href="%3$s">older versions on WordPress</a> or <a href="mailto:support@aihr.us?subject=Old+Plugin+Version+Request">email Aihrus support</a> if this is a premium plugin.' ), $name, $reason, $url );
348
-
349
- aihr_notice_error( $text );
350
-
351
- aihr_deactivate_plugin_do( $file );
352
- }
353
- }
354
-
355
- if ( ! function_exists( 'aihr_deactivate_plugin_do' ) ) {
356
- function aihr_deactivate_plugin_do( $file = null ) {
357
- if ( is_null( $file ) ) {
358
- aihr_notice_error( __( '`aihr_deactivate_plugin_do` requires $file argument' ) );
359
-
360
- return false;
361
- }
362
-
363
- deactivate_plugins( $file );
364
- }
365
- }
366
-
367
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/includes/libraries/aihrus-framework/class-aihrus-common.php DELETED
@@ -1,462 +0,0 @@
1
- <?php
2
- /*
3
- Copyright 2014 Michael Cannon (email: mc@aihr.us)
4
-
5
- This program is free software; you can redistribute it and/or modify
6
- it under the terms of the GNU General Public License, version 2, as
7
- published by the Free Software Foundation.
8
-
9
- This program is distributed in the hope that it will be useful,
10
- but WITHOUT ANY WARRANTY; without even the implied warranty of
11
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
- GNU General Public License for more details.
13
-
14
- You should have received a copy of the GNU General Public License
15
- along with this program; if not, write to the Free Software
16
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17
- */
18
-
19
- if ( class_exists( 'Aihrus_Common' ) )
20
- return;
21
-
22
- require_once 'interface-aihrus-common.php';
23
-
24
-
25
- abstract class Aihrus_Common implements Aihrus_Common_Interface {
26
- public static $donate_button;
27
- public static $donate_link;
28
-
29
-
30
- public function __construct() {
31
- self::set_notice_key();
32
-
33
- self::$donate_button = <<<EOD
34
- <form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
35
- <input type="hidden" name="cmd" value="_s-xclick">
36
- <input type="hidden" name="hosted_button_id" value="WM4F995W9LHXE">
37
- <input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donate_SM.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
38
- <img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1">
39
- </form>
40
- EOD;
41
-
42
- self::$donate_link = '<a href="http://aihr.us/about-aihrus/donate/"><img src="https://www.paypalobjects.com/en_US/i/btn/btn_donate_SM.gif" border="0" alt="PayPal - The safer, easier way to pay online!" /></a>';
43
-
44
- add_action( 'admin_init', array( static::$class, 'check_notices' ), 9999 );
45
- }
46
-
47
-
48
- public static function set_notice( $notice_name, $frequency_limit = false ) {
49
- $notice_key = self::get_notice_key();
50
-
51
- $frequency_limit = intval( $frequency_limit );
52
- if ( ! empty( $frequency_limit ) ) {
53
- $fl_key = $notice_key . '_' . $notice_name;
54
- $proceed = get_transient( $fl_key );
55
- if ( false === $proceed ) {
56
- delete_transient( $fl_key );
57
- set_transient( $fl_key, time(), $frequency_limit );
58
- } else {
59
- return;
60
- }
61
- }
62
-
63
- $notices = get_transient( $notice_key );
64
- if ( false === $notices )
65
- $notices = array();
66
-
67
- $notices[] = $notice_name;
68
-
69
- self::delete_notices();
70
- set_transient( $notice_key, $notices, HOUR_IN_SECONDS );
71
- }
72
-
73
-
74
- public static function delete_notices() {
75
- $notice_key = self::get_notice_key();
76
-
77
- delete_transient( $notice_key );
78
- }
79
-
80
-
81
- public static function check_notices() {
82
- $notice_key = self::get_notice_key();
83
-
84
- $notices = get_transient( $notice_key );
85
- if ( false === $notices )
86
- return;
87
-
88
- $notices = array_unique( $notices );
89
- foreach ( $notices as $notice ) {
90
- if ( function_exists( $notice ) ) {
91
- add_action( 'admin_notices', $notice );
92
- } elseif ( is_array( $notice ) ) {
93
- add_action( 'admin_notices', $notice );
94
- } else {
95
- add_action( 'admin_notices', array( static::$class, $notice ) );
96
- }
97
- }
98
-
99
- self::delete_notices();
100
- }
101
-
102
-
103
- public static function get_notice_key() {
104
- if ( is_null( static::$notice_key ) )
105
- self::set_notice_key();
106
-
107
- return static::$notice_key;
108
- }
109
-
110
-
111
- public static function set_notice_key() {
112
- static::$notice_key = static::SLUG . 'notices';
113
- }
114
-
115
-
116
- public static function version( $version ) {
117
- $version .= '-' . static::ID . '-' . static::VERSION;
118
-
119
- return $version;
120
- }
121
-
122
-
123
- /**
124
- * flatten an arbitrarily deep multidimensional array
125
- * into a list of its scalar values
126
- * (may be inefficient for large structures)
127
- * (will infinite recurse on self-referential structures)
128
- * (could be extended to handle objects)
129
- *
130
- * @ref http://in1.php.net/manual/en/function.array-values.php#41967
131
- */
132
-
133
-
134
- public static function array_values_recursive( $ary ) {
135
- $lst = array();
136
- foreach ( array_keys( $ary ) as $k ) {
137
- $v = $ary[$k];
138
- if ( is_scalar( $v ) ) {
139
- $lst[] = $v;
140
- } elseif ( is_array( $v ) ) {
141
- $lst = array_merge(
142
- $lst,
143
- self::array_values_recursive( $v )
144
- );
145
- }
146
- }
147
-
148
- return $lst;
149
- }
150
-
151
-
152
- public static function notice_donate( $disable_donate = null, $item_name = null ) {
153
- if ( $disable_donate )
154
- return;
155
-
156
- $text = sprintf( esc_html__( 'Please donate $5 towards ongoing free support and development of the "%1$s" plugin. %2$s' ), $item_name, self::$donate_button );
157
-
158
- aihr_notice_updated( $text );
159
- }
160
-
161
-
162
- public static function get_scripts() {
163
- if ( static::$scripts_called )
164
- return;
165
-
166
- foreach ( static::$scripts as $script )
167
- echo $script;
168
-
169
- static::$scripts_called = true;
170
- }
171
-
172
-
173
- public static function get_styles() {
174
- if ( static::$styles_called )
175
- return;
176
-
177
- foreach ( static::$styles as $style )
178
- echo $style;
179
-
180
- static::$styles_called = true;
181
- }
182
-
183
-
184
- public static function create_nonce( $action ) {
185
- $nonce = uniqid();
186
- $uid = get_current_user_id();
187
- $check = $uid . $action;
188
- set_transient( $nonce, $check, HOUR_IN_SECONDS );
189
-
190
- return $nonce;
191
- }
192
-
193
-
194
- public static function verify_nonce( $nonce, $action ) {
195
- $active = get_transient( $nonce );
196
- $uid = get_current_user_id();
197
- $check = $uid . $action;
198
- $valid = false;
199
-
200
- if ( $active == $check ) {
201
- delete_transient( $nonce );
202
- $valid = true;
203
- }
204
-
205
- return $valid;
206
- }
207
-
208
-
209
- /**
210
- * If incoming link is empty, then get_site_url() is used instead.
211
- */
212
- public static function create_link( $link, $title = null, $target = null, $return_as_tag = true ) {
213
- if ( empty( $link ) )
214
- $link = get_site_url();
215
-
216
- if ( preg_match( '#^\d+$#', $link ) ) {
217
- $permalink = get_permalink( $link );
218
- $tag_title = get_the_title( $link );
219
- if ( empty( $title ) )
220
- $title = $tag_title;
221
-
222
- $tag = '<a href="';
223
- $tag .= $permalink;
224
- $tag .= '" title="';
225
- $tag .= $tag_title;
226
- $tag .= '">';
227
- $tag .= $title;
228
- $tag .= '</a>';
229
- } else {
230
- $orig_link = empty( $title ) ? $link : $title;
231
- $do_http = true;
232
-
233
- if ( 0 === strpos( $link, '/' ) )
234
- $do_http = false;
235
-
236
- if ( $do_http && 0 === preg_match( '#https?://#', $link ) )
237
- $link = 'http://' . $link;
238
-
239
- $permalink = $link;
240
-
241
- $tag = '<a href="';
242
- $tag .= $permalink;
243
- $tag .= '">';
244
- $tag .= $orig_link;
245
- $tag .= '</a>';
246
- }
247
-
248
- if ( ! empty( $target ) && is_string( $target ) )
249
- $tag = links_add_target( $tag, $target );
250
-
251
- if ( $return_as_tag )
252
- return $tag;
253
- else
254
- return array(
255
- 'link' => $permalink,
256
- 'tag' => $tag,
257
- );
258
- }
259
-
260
-
261
- public static function add_media( $post_id, $media_src, $media_name = null, $featured_image = true ) {
262
- require_once ABSPATH . 'wp-admin/includes/image.php';
263
-
264
- if ( empty( $media_name ) )
265
- $media_name = basename( $media_src );
266
-
267
- $wp_filetype = wp_check_filetype( $media_name, null );
268
- $attachment = array(
269
- 'post_mime_type' => $wp_filetype['type'],
270
- 'post_status' => 'inherit',
271
- 'post_title' => $media_name,
272
- );
273
-
274
- $file_move = wp_upload_bits( $media_name, null, self::file_get_contents_curl( $media_src ) );
275
- $file_name = $file_move['file'];
276
-
277
- $image_id = wp_insert_attachment( $attachment, $file_name, $post_id );
278
- $metadata = wp_generate_attachment_metadata( $image_id, $file_name );
279
- wp_update_attachment_metadata( $image_id, $metadata );
280
-
281
- if ( $featured_image )
282
- update_post_meta( $post_id, '_thumbnail_id', $image_id );
283
-
284
- return $image_id;
285
- }
286
-
287
-
288
- /**
289
- * Thank you Tobylewis
290
- *
291
- * file_get_contents support on some shared systems is turned off
292
- *
293
- * @ref http://wordpress.org/support/topic/plugin-flickr-shortcode-importer-file_get_contents-with-url-isp-does-not-support?replies=2#post-2878241
294
- */
295
- public static function file_get_contents_curl( $url ) {
296
- $ch = curl_init();
297
-
298
- curl_setopt( $ch, CURLOPT_AUTOREFERER, true );
299
- curl_setopt( $ch, CURLOPT_HEADER, 0 );
300
- curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );
301
- curl_setopt( $ch, CURLOPT_URL, $url );
302
- curl_setopt( $ch, CURLOPT_FOLLOWLOCATION, true );
303
-
304
- $data = curl_exec( $ch );
305
- curl_close( $ch );
306
-
307
- return $data;
308
- }
309
-
310
-
311
- public static function get_image_src( $image, $strip_protocol = true ) {
312
- $doc = new DOMDocument();
313
- $doc->loadHTML( $image );
314
- $xpath = new DOMXPath( $doc );
315
- $src = $xpath->evaluate( 'string(//img/@src)' );
316
-
317
- if ( $strip_protocol )
318
- $src = self::strip_protocol( $src );
319
-
320
- return $src;
321
- }
322
-
323
-
324
- public static function clean_string( $string ) {
325
- if ( ! is_string( $string ) )
326
- return $string;
327
-
328
- return trim( strip_shortcodes( strip_tags( $string ) ) );
329
- }
330
-
331
-
332
- /**
333
- * Truncate HTML, close opened tags. UTF-8 aware, and aware of unpaired tags
334
- * (which don't need a matching closing tag)
335
- *
336
- * @param string $html
337
- * @param int $max_length Maximum length of the characters of the string
338
- * @param string $indicator Suffix to use if string was truncated.
339
- * @param boolean $force_indicator Suffix to use if string was truncated.
340
- * @return string
341
- *
342
- * @ref http://pastie.org/3084080
343
- */
344
- public static function truncate( $html, $max_length, $indicator = '&hellip;', $force_indicator = false ) {
345
- $output_length = 0; // number of counted characters stored so far in $output
346
- $position = 0; // character offset within input string after last tag/entity
347
- $tag_stack = array(); // stack of tags we've encountered but not closed
348
- $output = '';
349
- $truncated = false;
350
-
351
- /**
352
- * these tags don't have matching closing elements, in HTML (in XHTML they
353
- * theoretically need a closing /> )
354
- *
355
- * @see http://www.netstrider.com/tutorials/HTMLRef/a_d.html
356
- * @see http://www.w3schools.com/tags/default.asp
357
- * @see http://stackoverflow.com/questions/3741896/what-do-you-call-tags-that-need-no-ending-tag
358
- */
359
- $unpaired_tags = array(
360
- 'doctype',
361
- '!doctype',
362
- 'area',
363
- 'base',
364
- 'basefont',
365
- 'bgsound',
366
- 'br',
367
- 'col',
368
- 'embed',
369
- 'frame',
370
- 'hr',
371
- 'img',
372
- 'input',
373
- 'link',
374
- 'meta',
375
- 'param',
376
- 'sound',
377
- 'spacer',
378
- 'wbr',
379
- );
380
-
381
- $func_strcut = function_exists( 'mb_strcut' ) ? 'mb_strcut' : 'substr';
382
- $func_strlen = function_exists( 'mb_strlen' ) ? 'mb_strlen' : 'strlen';
383
-
384
- // loop through, splitting at HTML entities or tags
385
- while ( $output_length < $max_length && preg_match( '{</?([a-z]+)[^>]*>|&#?[a-zA-Z0-9]+;}', $html, $match, PREG_OFFSET_CAPTURE, $position ) ) {
386
- list( $tag, $tag_position ) = $match[0];
387
-
388
- // get text leading up to the tag, and store it – up to max_length
389
- $text = $func_strcut( $html, $position, $tag_position - $position );
390
- if ( $output_length + $func_strlen( $text ) > $max_length ) {
391
- $output .= $func_strcut( $text, 0, $max_length - $output_length );
392
- $truncated = true;
393
- $output_length = $max_length;
394
- break;
395
- }
396
-
397
- // store everything, it wasn't too long
398
- $output .= $text;
399
- $output_length += $func_strlen( $text );
400
-
401
- if ( $tag[0] == '&' ) {
402
- // Handle HTML entity by copying straight through
403
- $output .= $tag;
404
- $output_length++; // only counted as one character
405
- } else {
406
- // Handle HTML tag
407
- $tag_inner = $match[1][0];
408
- if ( $tag[1] == '/' ) {
409
- // This is a closing tag.
410
- $output .= $tag;
411
- // If input tags aren't balanced, we leave the popped tag
412
- // on the stack so hopefully we're not introducing more
413
- // problems.
414
-
415
- if ( end( $tag_stack ) == $tag_inner )
416
- array_pop( $tag_stack );
417
- } elseif ( $tag[$func_strlen( $tag ) - 2] == '/' || in_array( strtolower( $tag_inner ), $unpaired_tags ) ) {
418
- // Self-closing or unpaired tag
419
- $output .= $tag;
420
- } else {
421
- // Opening tag.
422
- $output .= $tag;
423
- $tag_stack[] = $tag_inner; // push tag onto the stack
424
- }
425
- }
426
-
427
- // Continue after the tag we just found
428
- $position = $tag_position + $func_strlen( $tag );
429
- }
430
-
431
- // Print any remaining text after the last tag, if there's room
432
-
433
- if ( $output_length < $max_length && $position < $func_strlen( $html ) )
434
- $output .= $func_strcut( $html, $position, $max_length - $output_length );
435
-
436
- $truncated = $func_strlen( $html ) - $position > $max_length - $output_length;
437
-
438
- // add terminator if it was truncated in loop or just above here
439
- if ( $truncated || $force_indicator )
440
- $output .= $indicator;
441
-
442
- // Close any open tags
443
- while ( ! empty( $tag_stack ) )
444
- $output .= '</'.array_pop( $tag_stack ).'>';
445
-
446
- return $output;
447
- }
448
-
449
-
450
- public static function strip_protocol( $link ) {
451
- if ( ! empty( $link ) ) {
452
- $link = preg_replace( '#https?:#', '', $link );
453
- }
454
-
455
- return $link;
456
- }
457
-
458
-
459
- }
460
-
461
-
462
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/includes/libraries/aihrus-framework/class-aihrus-licensing.php DELETED
@@ -1,188 +0,0 @@
1
- <?php
2
- /*
3
- Copyright 2014 Michael Cannon (email: mc@aihr.us)
4
-
5
- This program is free software; you can redistribute it and/or modify
6
- it under the terms of the GNU General Public License, version 2, as
7
- published by the Free Software Foundation.
8
-
9
- This program is distributed in the hope that it will be useful,
10
- but WITHOUT ANY WARRANTY; without even the implied warranty of
11
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
- GNU General Public License for more details.
13
-
14
- You should have received a copy of the GNU General Public License
15
- along with this program; if not, write to the Free Software
16
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17
- */
18
-
19
- if ( class_exists( 'Aihrus_Licensing' ) )
20
- return;
21
-
22
- require_once 'interface-aihrus-licensing.php';
23
-
24
-
25
- abstract class Aihrus_Licensing implements Aihrus_Licensing_Interface {
26
- public $author;
27
- public $item_name;
28
- public $slug;
29
- public $store_url;
30
-
31
-
32
- public function __construct( $slug, $item_name, $author = 'Michael Cannon', $store_url = 'http://aihr.us' ) {
33
- $this->author = $author;
34
- $this->item_name = urlencode( $item_name );
35
- $this->slug = $slug;
36
- $this->store_url = $store_url;
37
- }
38
-
39
-
40
- public function license_key() {
41
- $key = $this->slug . 'license_key';
42
-
43
- return $key;
44
- }
45
-
46
-
47
- public function get_license() {
48
- $key = $this->license_key();
49
- $license = get_transient( $key );
50
-
51
- return $license;
52
- }
53
-
54
-
55
- public function update_license( $value = null ) {
56
- $license = $this->get_license();
57
- if ( $license === $value )
58
- return $value;
59
-
60
- if ( $this->valid_hash( $value ) ) {
61
- $this->set_license( $value );
62
- $value = $this->activate_license();
63
- $this->set_license( $value );
64
-
65
- return $value;
66
- } else {
67
- $this->deactivate_license();
68
- $this->delete_license();
69
-
70
- return '';
71
- }
72
- }
73
-
74
-
75
- public function set_license( $value = null ) {
76
- $key = $this->license_key();
77
-
78
- delete_transient( $key );
79
-
80
- if ( ! is_null( $value ) )
81
- set_transient( $key, $value, WEEK_IN_SECONDS );
82
- }
83
-
84
-
85
- public function valid_license() {
86
- $license = $this->get_license();
87
- if ( $this->valid_hash( $license ) )
88
- return true;
89
- else
90
- return false;
91
- }
92
-
93
-
94
- public function get_api_call( $action ) {
95
- $license = $this->get_license();
96
- $api_params = array(
97
- 'edd_action' => $action,
98
- 'item_name' => $this->item_name,
99
- 'license' => $license,
100
- );
101
-
102
- $api_call = add_query_arg(
103
- $api_params,
104
- $this->store_url
105
- );
106
-
107
- return $api_call;
108
- }
109
-
110
-
111
- public function get_remote_get( $api_call ) {
112
- $response = wp_remote_get(
113
- $api_call,
114
- array(
115
- 'timeout' => 10,
116
- 'sslverify' => false,
117
- )
118
- );
119
-
120
- return $response;
121
- }
122
-
123
-
124
- public function activate_license() {
125
- $license_data = $this->get_license_data( 'activate_license' );
126
- if ( false !== $license_data ) {
127
- if ( 'valid' == $license_data->license ) {
128
- $license = $this->get_license();
129
-
130
- return $license;
131
- }
132
-
133
- return $license_data->license;
134
- }
135
-
136
- return false;
137
- }
138
-
139
-
140
- public function get_license_data( $action = 'check_license' ) {
141
- $api_call = $this->get_api_call( $action );
142
- $response = $this->get_remote_get( $api_call );
143
- if ( is_wp_error( $response ) )
144
- return false;
145
-
146
- $license_data = json_decode( wp_remote_retrieve_body( $response ) );
147
-
148
- return $license_data;
149
- }
150
-
151
-
152
- public function deactivate_license() {
153
- $license_data = $this->get_license_data( 'deactivate_license' );
154
- if ( false !== $license_data ) {
155
- if ( 'deactivated' == $license_data->license )
156
- return true;
157
-
158
- return $license_data->license;
159
- }
160
-
161
- return false;
162
- }
163
-
164
-
165
- public function delete_license() {
166
- $this->set_license();
167
- }
168
-
169
-
170
- public function license_notice() {
171
- $result = '<p><em>' . esc_html( 'Premium features require licensing to function.' ) . '</em></p>';
172
-
173
- return $result;
174
- }
175
-
176
-
177
- public function valid_hash( $value = null ) {
178
- if ( is_string( $value ) && preg_match( '#^[0-9a-f]{32}$#i', $value ) )
179
- return true;
180
-
181
- return false;
182
- }
183
-
184
-
185
- }
186
-
187
-
188
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/includes/libraries/aihrus-framework/class-aihrus-settings.php DELETED
@@ -1,757 +0,0 @@
1
- <?php
2
- /*
3
- Copyright 2014 Michael Cannon (email: mc@aihr.us)
4
-
5
- This program is free software; you can redistribute it and/or modify
6
- it under the terms of the GNU General Public License, version 2, as
7
- published by the Free Software Foundation.
8
-
9
- This program is distributed in the hope that it will be useful,
10
- but WITHOUT ANY WARRANTY; without even the implied warranty of
11
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
- GNU General Public License for more details.
13
-
14
- You should have received a copy of the GNU General Public License
15
- along with this program; if not, write to the Free Software
16
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17
- */
18
-
19
- /**
20
- * Aihrus Framework settings helper class
21
- *
22
- * Based upon http://alisothegeek.com/2011/01/wordpress-settings-api-tutorial-1/
23
- */
24
-
25
- require_once ABSPATH . 'wp-admin/includes/template.php';
26
-
27
- if ( class_exists( 'Aihrus_Settings' ) )
28
- return;
29
-
30
-
31
- abstract class Aihrus_Settings {
32
- public static $default = array(
33
- 'backwards' => array(
34
- 'version' => null, // below this version number, use std
35
- 'std' => null,
36
- ),
37
- 'choices' => array(), // key => value
38
- 'class' => null, // warning, etc.
39
- 'desc' => null,
40
- 'id' => null,
41
- 'section' => 'general',
42
- 'show_code' => false,
43
- 'std' => null, // default key or value
44
- 'suggest' => false, // attempt for auto-suggest on inputs
45
- 'title' => null,
46
- 'type' => 'text', // textarea, checkbox, radio, select, hidden, heading, password, expand_begin, expand_end
47
- 'validate' => null, // required, term, slug, slugs, ids, order, single paramater PHP functions
48
- 'widget' => 1, // show in widget options, 0 off
49
- );
50
-
51
-
52
- public function __construct() {}
53
-
54
-
55
- public static function load_options() {
56
- static::sections();
57
- static::settings();
58
- }
59
-
60
-
61
- public static function sections() {
62
- static::$sections['reset'] = esc_html__( 'Reset' );
63
- static::$sections['about'] = esc_html__( 'About' );
64
- }
65
-
66
-
67
- /**
68
- *
69
- *
70
- * @SuppressWarnings(PHPMD.Superglobals)
71
- */
72
- public static function settings() {
73
- // Reset section defaults
74
- $options = get_option( static::ID );
75
- if ( ! empty( $options ) ) {
76
- $serialized_options = serialize( $options );
77
- $_SESSION['export'] = $serialized_options;
78
-
79
- static::$settings['export'] = array(
80
- 'section' => 'reset',
81
- 'title' => esc_html__( 'Export Settings' ),
82
- 'type' => 'readonly',
83
- 'desc' => esc_html__( 'These are your current settings in a serialized format. Copy the contents to make a backup of your settings.' ),
84
- 'std' => $serialized_options,
85
- 'widget' => 0,
86
- );
87
- }
88
-
89
- static::$settings['import'] = array(
90
- 'section' => 'reset',
91
- 'title' => esc_html__( 'Import Settings' ),
92
- 'type' => 'textarea',
93
- 'desc' => esc_html__( 'Paste new serialized settings here to overwrite your current configuration.' ),
94
- 'widget' => 0,
95
- );
96
-
97
- $desc = esc_html__( 'Delete all %s data and options from database on plugin deletion. Even if this option isn\'t checked, WordPress will still give a data deletion warning.' );
98
-
99
- static::$settings['delete_data'] = array(
100
- 'section' => 'reset',
101
- 'title' => esc_html__( 'Remove Plugin Data on Deletion?' ),
102
- 'type' => 'checkbox',
103
- 'class' => 'warning',
104
- 'desc' => sprintf( $desc, static::NAME ),
105
- 'widget' => 0,
106
- );
107
-
108
- static::$settings['reset_defaults'] = array(
109
- 'section' => 'reset',
110
- 'title' => esc_html__( 'Reset to Defaults?' ),
111
- 'type' => 'checkbox',
112
- 'class' => 'warning',
113
- 'desc' => esc_html__( 'Check this box to reset options to their defaults' ),
114
- );
115
- }
116
-
117
-
118
- public static function get_defaults( $mode = null, $old_version = null ) {
119
- if ( empty( static::$defaults ) )
120
- static::settings();
121
-
122
- $do_backwards = false;
123
- if ( 'backwards' == $mode ) {
124
- if ( ! empty( $old_version ) )
125
- $do_backwards = true;
126
- }
127
-
128
- foreach ( static::$settings as $id => $parts ) {
129
- $std = isset( $parts['std'] ) ? $parts['std'] : '';
130
- if ( $do_backwards ) {
131
- $version = ! empty( $parts['backwards']['version'] ) ? $parts['backwards']['version'] : false;
132
- if ( ! empty( $version ) ) {
133
- if ( $old_version < $version )
134
- $std = $parts['backwards']['std'];
135
- }
136
- }
137
-
138
- static::$defaults[ $id ] = $std;
139
- }
140
-
141
- return static::$defaults;
142
- }
143
-
144
-
145
- public static function get_settings() {
146
- if ( empty( static::$settings ) )
147
- static::settings();
148
-
149
- return static::$settings;
150
- }
151
-
152
-
153
- public static function initialize_settings( $version = null ) {
154
- $defaults = static::get_defaults( 'backwards' );
155
- $current = get_option( static::ID );
156
- $current = wp_parse_args( $current, $defaults );
157
-
158
- $current['admin_notices'] = $version;
159
- $current['version'] = static::$version;
160
-
161
- update_option( static::ID, $current );
162
- }
163
-
164
-
165
- /**
166
- *
167
- *
168
- * @SuppressWarnings(PHPMD.UnusedLocalVariable)
169
- */
170
- public static function create_setting( $args = array() ) {
171
- extract( $args );
172
-
173
- if ( preg_match( '#(_expand_begin|_expand_end)#', $id ) )
174
- return;
175
-
176
- $field_args = array(
177
- 'choices' => $choices,
178
- 'class' => $class,
179
- 'desc' => $desc,
180
- 'id' => $id,
181
- 'label_for' => $id,
182
- 'show_code' => $show_code,
183
- 'std' => $std,
184
- 'suggest' => $suggest,
185
- 'type' => $type,
186
- );
187
-
188
- static::$defaults[$id] = $std;
189
-
190
- add_settings_field( $id, $title, array( static::$class, 'display_setting' ), static::ID, $section, $field_args );
191
- }
192
-
193
-
194
- public static function section_scripts() {
195
- echo '
196
- <script type="text/javascript">
197
- jQuery(document).ready(function($) {
198
- $( "#' . static::ID . '" ).tabs();
199
- // This will make the "warning" checkbox class really stand out when checked.
200
- $(".warning").change(function() {
201
- if ($(this).is(":checked"))
202
- $(this).parent().css("background", "#c00").css("color", "#fff").css("fontWeight", "bold");
203
- else
204
- $(this).parent().css("background", "inherit").css("color", "inherit").css("fontWeight", "inherit");
205
- });
206
- });
207
- </script>
208
- ';
209
- }
210
-
211
-
212
- public static function do_settings_sections( $page ) {
213
- global $wp_settings_sections, $wp_settings_fields;
214
-
215
- if ( ! isset( $wp_settings_sections ) || ! isset( $wp_settings_sections[$page] ) )
216
- return;
217
-
218
- foreach ( (array) $wp_settings_sections[$page] as $section ) {
219
- if ( $section['callback'] )
220
- call_user_func( $section['callback'], $section );
221
-
222
- if ( ! isset( $wp_settings_fields ) || ! isset( $wp_settings_fields[$page] ) || ! isset( $wp_settings_fields[$page][$section['id']] ) )
223
- continue;
224
-
225
- echo '<table id=' . $section['id'] . ' class="form-table">';
226
- do_settings_fields( $page, $section['id'] );
227
- echo '</table>';
228
- }
229
- }
230
-
231
-
232
- public static function display_section() {}
233
-
234
-
235
- public static function display_about() {
236
- $name = str_replace( ' Settings', '', static::NAME );
237
- $text = __( '<img class="alignright size-medium" src="%1$simages/michael-cannon-red-square-300x2251.jpg" alt="Michael in Red Square, Moscow, Russia" width="300" height="225" /><a href="%2$s">%3$s</a> is by <a href="%4$s">Michael Cannon</a>. He\'s <a href="%5$s">Peichi’s</a> smiling man, an adventurous <a href="%6$s" target="_blank">water-rat</a>, <a href="%7$s">chief people officer</a>, <a href="%8$s">cyclist</a>, <a href="%9$s">full stack developer</a>, <a href="%10$s">poet</a>, <a href="%11$s">WWOOF’er</a> and <a href="%12$s">world traveler</a>.' );
238
-
239
- echo '<div id="about" style="width: 70%; min-height: 225px;"><p>';
240
- echo sprintf(
241
- $text,
242
- static::$plugin_assets,
243
- esc_url( static::$plugin_url ),
244
- $name,
245
- esc_url( 'http://aihr.us/resume/' ),
246
- esc_url( 'http://peimic.com/t/peichi-liu/' ),
247
- esc_url( 'http://www.chinesehoroscope.org/chinese_zodiac/rat/' ),
248
- esc_url( 'http://axelerant.com/who-we-are' ),
249
- esc_url( 'http://peimic.com/c/biking/' ),
250
- esc_url( 'http://aihr.us/about-aihrus/' ),
251
- esc_url( 'http://peimic.com/t/poetry/' ),
252
- esc_url( 'http://peimic.com/t/WWOOF/' ),
253
- esc_url( 'http://peimic.com/c/travel/' )
254
- );
255
- echo '</p></div>';
256
- }
257
-
258
-
259
- public static function display_page( $disable_donate = false ) {
260
- echo '<div class="wrap">
261
- <div class="icon32" id="icon-options-general"></div>
262
- <h2>' . static::NAME . '</h2>';
263
-
264
- echo '<form action="options.php" method="post">';
265
-
266
- settings_errors( static::ID );
267
- settings_fields( static::ID );
268
-
269
- echo '<div id="' . static::ID . '">
270
- <ul>';
271
-
272
- foreach ( static::$sections as $section_slug => $section )
273
- echo '<li><a href="#' . $section_slug . '">' . $section . '</a></li>';
274
-
275
- echo '</ul>';
276
-
277
- self::do_settings_sections( static::ID );
278
-
279
- echo '
280
- <p class="submit"><input name="Submit" type="submit" class="button-primary" value="' . esc_html__( 'Save Changes' ) . '" /></p>
281
- </form>
282
- </div>
283
- ';
284
-
285
- if ( ! $disable_donate ) {
286
- echo '<p>' .
287
- sprintf(
288
- __( 'If you like this plugin, please <a href="%1$s" title="Donate for Good Karma"><img src="%2$s" border="0" alt="Donate for Good Karma" /></a> or <a href="%3$s" title="purchase premium WordPress plugins from Aihrus ">purchase the Premium version</a> to help fund further development and <a href="%4$s" title="Support forums">support</a>.' ),
289
- esc_url( 'http://aihr.us/about-aihrus/donate/' ),
290
- esc_url( 'https://www.paypalobjects.com/en_US/i/btn/btn_donate_SM.gif' ),
291
- esc_url( 'http://aihr.us/store/' ),
292
- esc_url( 'https://aihrus.zendesk.com/home' )
293
- ) .
294
- '</p>';
295
- }
296
-
297
- echo '<p class="copyright">' .
298
- sprintf(
299
- __( 'Copyright &copy;%1$s <a href="%2$s">Aihrus</a>.' ),
300
- date( 'Y' ),
301
- esc_url( 'http://aihr.us' )
302
- ) .
303
- '</p>';
304
-
305
- echo '</div>';
306
-
307
- add_action( 'admin_footer', array( static::$class, 'section_scripts' ) );
308
- }
309
-
310
-
311
- public static function display_setting( $args = array(), $do_echo = true, $input = null ) {
312
- $content = '';
313
-
314
- extract( $args );
315
-
316
- if ( is_null( $input ) )
317
- $options = get_option( static::ID );
318
- else {
319
- $options = array();
320
- $options[$id] = $input;
321
- }
322
-
323
- if ( ! isset( $options[$id] ) && $type != 'checkbox' )
324
- $options[$id] = $std;
325
- elseif ( ! isset( $options[$id] ) )
326
- $options[$id] = 0;
327
-
328
- $field_class = '';
329
- if ( ! empty( $class ) )
330
- $field_class = ' ' . $class;
331
-
332
- // desc isn't escaped because it's might contain allowed html
333
- $choices = array_map( 'esc_attr', $choices );
334
- $field_class = esc_attr( $field_class );
335
- $id = esc_attr( $id );
336
- $field_value = esc_attr( $options[$id] );
337
- $std = esc_attr( $std );
338
-
339
- switch ( $type ) {
340
- case 'checkbox':
341
- $content .= '<input class="checkbox' . $field_class . '" type="checkbox" id="' . $id . '" name="' . static::ID . '[' . $id . ']" value="1" ' . checked( $field_value, 1, false ) . ' /> ';
342
-
343
- if ( ! empty( $desc ) )
344
- $content .= '<label for="' . $id . '"><span class="description">' . $desc . '</span></label>';
345
-
346
- if ( $show_code )
347
- $content .= '<br /><code>' . $id . '</code>';
348
- break;
349
-
350
- case 'file':
351
- $content .= '<input class="regular-text' . $field_class . '" type="file" id="' . $id . '" name="' . static::ID . '[' . $id . ']" />';
352
-
353
- if ( ! empty( $desc ) )
354
- $content .= '<br /><span class="description">' . $desc . '</span>';
355
-
356
- break;
357
-
358
- case 'heading':
359
- $content .= '</td></tr><tr valign="top"><td colspan="2"><h4>' . $desc . '</h4>';
360
- break;
361
-
362
- case 'hidden':
363
- $content .= '<input type="hidden" id="' . $id . '" name="' . static::ID . '[' . $id . ']" value="' . $field_value . '" />';
364
-
365
- break;
366
-
367
- case 'password':
368
- $content .= '<input class="regular-text' . $field_class . '" type="password" id="' . $id . '" name="' . static::ID . '[' . $id . ']" value="' . $field_value . '" />';
369
-
370
- if ( ! empty( $desc ) )
371
- $content .= '<br /><span class="description">' . $desc . '</span>';
372
-
373
- break;
374
-
375
- case 'radio':
376
- $i = 1;
377
- $count_choices = count( $choices );
378
- foreach ( $choices as $value => $label ) {
379
- $content .= '<input class="radio' . $field_class . '" type="radio" name="' . static::ID . '[' . $id . ']" id="' . $id . $i . '" value="' . $value . '" ' . checked( $field_value, $value, false ) . '> <label for="' . $id . $i . '">' . $label . '</label>';
380
-
381
- if ( $i < $count_choices )
382
- $content .= '<br />';
383
-
384
- $i++;
385
- }
386
-
387
- if ( ! empty( $desc ) )
388
- $content .= '<br /><span class="description">' . $desc . '</span>';
389
-
390
- if ( $show_code )
391
- $content .= '<br /><code>' . $id . '</code>';
392
- break;
393
-
394
- case 'readonly':
395
- $content .= '<input class="regular-text' . $field_class . '" type="text" id="' . $id . '" name="' . static::ID . '[' . $id . ']" value="' . $field_value . '" readonly="readonly" />';
396
-
397
- if ( ! empty( $desc ) )
398
- $content .= '<br /><span class="description">' . $desc . '</span>';
399
-
400
- break;
401
-
402
- case 'select':
403
- $content .= '<select class="select' . $field_class . '" id="' . $id . '" name="' . static::ID . '[' . $id . ']">';
404
-
405
- foreach ( $choices as $value => $label )
406
- $content .= '<option value="' . $value . '"' . selected( $field_value, $value, false ) . '>' . $label . '</option>';
407
-
408
- $content .= '</select>';
409
-
410
- if ( ! empty( $desc ) )
411
- $content .= '<br /><span class="description">' . $desc . '</span>';
412
-
413
- if ( $show_code )
414
- $content .= '<br /><code>' . $id . '</code>';
415
- break;
416
-
417
- case 'text':
418
- $content .= '<input class="regular-text' . $field_class . '" type="text" id="' . $id . '" name="' . static::ID . '[' . $id . ']" placeholder="' . $std . '" value="' . $field_value . '" />';
419
-
420
- if ( ! empty( $desc ) )
421
- $content .= '<br /><span class="description">' . $desc . '</span>';
422
-
423
- if ( $show_code )
424
- $content .= '<br /><code>' . $id . '</code>';
425
- break;
426
-
427
- case 'textarea':
428
- $content .= '<textarea class="' . $field_class . '" id="' . $id . '" name="' . static::ID . '[' . $id . ']" placeholder="' . $std . '" rows="5" cols="30">' . $field_value . '</textarea>';
429
-
430
- if ( ! empty( $desc ) )
431
- $content .= '<br /><span class="description">' . $desc . '</span>';
432
-
433
- if ( $show_code )
434
- $content .= '<br /><code>' . $id . '</code>';
435
- break;
436
-
437
- default:
438
- break;
439
- }
440
-
441
- if ( ! $do_echo )
442
- return $content;
443
-
444
- echo $content;
445
- }
446
-
447
-
448
- public static function register_settings() {
449
- register_setting( static::ID, static::ID, array( static::$class, 'validate_settings' ) );
450
-
451
- foreach ( static::$sections as $slug => $title ) {
452
- if ( $slug == 'about' )
453
- add_settings_section( $slug, $title, array( static::$class, 'display_about' ), static::ID );
454
- else
455
- add_settings_section( $slug, $title, array( static::$class, 'display_section' ), static::ID );
456
- }
457
-
458
- foreach ( static::$settings as $id => $setting ) {
459
- $setting['id'] = $id;
460
- static::create_setting( $setting );
461
- }
462
- }
463
-
464
-
465
- public static function scripts() {
466
- wp_enqueue_script( 'jquery-ui-tabs' );
467
- }
468
-
469
-
470
- public static function styles() {
471
- wp_register_style( 'jquery-style', '//ajax.googleapis.com/ajax/libs/jqueryui/1.8.2/themes/smoothness/jquery-ui.css' );
472
- wp_enqueue_style( 'jquery-style' );
473
- }
474
-
475
-
476
- /**
477
- *
478
- *
479
- * @SuppressWarnings(PHPMD.Superglobals)
480
- */
481
- public static function validate_settings( $input, $options = null, $do_errors = false ) {
482
- $errors = array();
483
-
484
- $null_options = false;
485
- if ( is_null( $options ) ) {
486
- $null_options = true;
487
-
488
- $defaults = static::get_defaults();
489
- $options = self::get_settings();
490
-
491
- if ( is_admin() ) {
492
- if ( ! empty( $input['reset_defaults'] ) ) {
493
- foreach ( $defaults as $id => $std )
494
- $input[$id] = $std;
495
-
496
- unset( $input['reset_defaults'] );
497
-
498
- $input['resetted'] = true;
499
- }
500
-
501
- if ( ! empty( $input['import'] ) && $_SESSION['export'] != $input['import'] ) {
502
- $import = $input['import'];
503
- $unserialized = unserialize( $import );
504
- if ( is_array( $unserialized ) ) {
505
- foreach ( $unserialized as $id => $std )
506
- $input[$id] = $std;
507
- }
508
- }
509
- }
510
- }
511
-
512
- foreach ( $options as $id => $parts ) {
513
- $default = $parts['std'];
514
- $type = $parts['type'];
515
- $validations = ! empty( $parts['validate'] ) ? $parts['validate'] : array();
516
- if ( ! empty( $validations ) )
517
- $validations = explode( ',', $validations );
518
-
519
- if ( ! isset( $input[ $id ] ) ) {
520
- if ( 'checkbox' != $type ) {
521
- $input[ $id ] = $default;
522
- } else {
523
- if ( empty( $parts['widget'] ) ) {
524
- continue;
525
- } else {
526
- $input[ $id ] = 0;
527
- }
528
- }
529
- }
530
-
531
- if ( $default == $input[ $id ] && ! in_array( 'required', $validations ) )
532
- continue;
533
-
534
- if ( 'checkbox' == $type ) {
535
- if ( self::is_true( $input[ $id ] ) )
536
- $input[ $id ] = 1;
537
- else
538
- $input[ $id ] = 0;
539
- } elseif ( in_array( $type, array( 'radio', 'select' ) ) ) {
540
- // single choices only
541
- $keys = array_keys( $parts['choices'] );
542
-
543
- if ( ! in_array( $input[ $id ], $keys ) ) {
544
- if ( self::is_true( $input[ $id ] ) )
545
- $input[ $id ] = 1;
546
- else
547
- $input[ $id ] = 0;
548
- }
549
- }
550
-
551
- if ( ! empty( $validations ) ) {
552
- foreach ( $validations as $validate )
553
- self::validators( $validate, $id, $input, $default, $errors );
554
- }
555
- }
556
-
557
- unset( $input['export'] );
558
- unset( $input['import'] );
559
-
560
- $hide_update_notice = false;
561
- if ( isset( static::$hide_update_notice ) && ! empty( static::$hide_update_notice ) ) {
562
- $hide_update_notice = true;
563
- }
564
-
565
- if ( $null_options && empty( $errors ) && ! $hide_update_notice ) {
566
- add_settings_error( static::ID, 'settings_updated', esc_html__( 'Settings saved.' ), 'updated' );
567
- set_transient( 'settings_errors', get_settings_errors(), 30 );
568
- }
569
-
570
- if ( empty( $do_errors ) ) {
571
- $validated = $input;
572
- } else {
573
- $validated = array(
574
- 'input' => $input,
575
- 'errors' => $errors,
576
- );
577
- }
578
-
579
- return $validated;
580
- }
581
-
582
-
583
- public static function validators( $validate, $id, &$input, $default, &$errors ) {
584
- switch ( $validate ) {
585
- case 'absint':
586
- case 'intval':
587
- if ( '' !== $input[ $id ] )
588
- $input[ $id ] = $validate( $input[ $id ] );
589
- else
590
- $input[ $id ] = $default;
591
- break;
592
-
593
- case 'ids':
594
- $input[ $id ] = self::validate_ids( $input[ $id ], $default );
595
- break;
596
-
597
- case 'is_true':
598
- $input[ $id ] = self::is_true( $input[ $id ] );
599
- break;
600
-
601
- case 'min1':
602
- $input[ $id ] = intval( $input[ $id ] );
603
- if ( 0 >= $input[ $id ] )
604
- $input[ $id ] = $default;
605
- break;
606
-
607
- case 'nozero':
608
- $input[ $id ] = intval( $input[ $id ] );
609
- if ( 0 === $input[ $id ] )
610
- $input[ $id ] = $default;
611
- break;
612
-
613
- case 'order':
614
- $input[ $id ] = self::validate_order( $input[ $id ], $default );
615
- break;
616
-
617
- case 'required':
618
- if ( empty( $input[ $id ] ) )
619
- $errors[ $id ] = esc_html__( 'Required' );
620
- break;
621
-
622
- case 'slash_sanitize_title':
623
- $temp = explode( '/', $input[ $id ] );
624
- $temp = array_map( 'sanitize_title', $temp );
625
- $temp = implode( '/', $temp );
626
-
627
- $input[ $id ] = $temp;
628
- break;
629
-
630
- case 'slug':
631
- $input[ $id ] = self::validate_slug( $input[ $id ], $default );
632
- $input[ $id ] = strtolower( $input[ $id ] );
633
- break;
634
-
635
- case 'slugs':
636
- $input[ $id ] = self::validate_slugs( $input[ $id ], $default );
637
- $input[ $id ] = strtolower( $input[ $id ] );
638
- break;
639
-
640
- case 'term':
641
- $input[ $id ] = self::validate_term( $input[ $id ], $default );
642
- $input[ $id ] = strtolower( $input[ $id ] );
643
- break;
644
-
645
- case 'terms':
646
- $input[ $id ] = self::validate_terms( $input[ $id ], $default );
647
- break;
648
-
649
- case 'trim':
650
- $options = explode( "\n", $input[ $id ] );
651
- foreach ( $options as $key => $value )
652
- $options[ $key ] = trim( $value );
653
-
654
- $input[ $id ] = implode( "\n", $options );
655
- break;
656
-
657
- case 'url':
658
- $input[ $id ] = self::validate_url( $input[ $id ], $default );
659
- break;
660
-
661
- default:
662
- $input[ $id ] = $validate( $input[ $id ] );
663
- break;
664
- }
665
- }
666
-
667
-
668
- public static function validate_ids( $input, $default ) {
669
- if ( preg_match( '#^\d+(,\s?\d+)*$#', $input ) )
670
- return preg_replace( '#\s#', '', $input );
671
-
672
- return $default;
673
- }
674
-
675
-
676
- public static function validate_order( $input, $default ) {
677
- if ( preg_match( '#^desc|asc$#i', $input ) )
678
- return $input;
679
-
680
- return $default;
681
- }
682
-
683
-
684
- public static function validate_slugs( $input, $default ) {
685
- if ( preg_match( '#^[\w-]+(,\s?[\w-]+)*$#', $input ) )
686
- return preg_replace( '#\s#', '', $input );
687
-
688
- return $default;
689
- }
690
-
691
-
692
- public static function validate_slug( $input, $default ) {
693
- if ( preg_match( '#^[\w-]+$#', $input ) )
694
- return $input;
695
-
696
- return $default;
697
- }
698
-
699
-
700
- public static function validate_term( $input, $default ) {
701
- if ( preg_match( '#^\w+$#', $input ) )
702
- return $input;
703
-
704
- return $default;
705
- }
706
-
707
-
708
- /**
709
- * Let values like true, 'true', 1, 'on', and 'yes' to be true. Else, false
710
- */
711
- public static function is_true( $value = null, $return_boolean = true ) {
712
- if ( true === $value || 'true' == strtolower( $value ) || 1 == $value || 'on' == strtolower( $value ) || 'yes' == strtolower( $value ) ) {
713
- if ( $return_boolean )
714
- return true;
715
- else
716
- return 1;
717
- } else {
718
- if ( $return_boolean )
719
- return false;
720
- else
721
- return 0;
722
- }
723
- }
724
-
725
-
726
- public static function validate_terms( $input, $default ) {
727
- if ( preg_match( '#^(([\w- ]+)(,\s?)?)+$#', $input ) )
728
- return preg_replace( '#,\s*$#', '', $input );
729
-
730
- return $default;
731
- }
732
-
733
-
734
- public static function validate_url( $input, $default ) {
735
- if ( filter_var( $input, FILTER_VALIDATE_URL ) )
736
- return $input;
737
-
738
- return $default;
739
- }
740
-
741
-
742
- public static function get_scripts() {
743
- foreach ( static::$scripts as $script )
744
- echo $script;
745
- }
746
-
747
-
748
- public static function get_styles() {
749
- foreach ( static::$styles as $style )
750
- echo $style;
751
- }
752
-
753
-
754
- }
755
-
756
-
757
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/includes/libraries/aihrus-framework/class-aihrus-widget.php DELETED
@@ -1,252 +0,0 @@
1
- <?php
2
- /*
3
- Copyright 2014 Michael Cannon (email: mc@aihr.us)
4
-
5
- This program is free software; you can redistribute it and/or modify
6
- it under the terms of the GNU General Public License, version 2, as
7
- published by the Free Software Foundation.
8
-
9
- This program is distributed in the hope that it will be useful,
10
- but WITHOUT ANY WARRANTY; without even the implied warranty of
11
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
- GNU General Public License for more details.
13
-
14
- You should have received a copy of the GNU General Public License
15
- along with this program; if not, write to the Free Software
16
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17
- */
18
-
19
- if ( class_exists( 'Aihrus_Widget' ) )
20
- return;
21
-
22
- require_once 'interface-aihrus-widget.php';
23
-
24
-
25
- abstract class Aihrus_Widget extends WP_Widget implements Aihrus_Widget_Interface {
26
- public static $suggest_id = 0;
27
-
28
-
29
- public function __construct( $classname, $description, $id_base, $title ) {
30
- // Widget settings
31
- $widget_ops = array(
32
- 'classname' => $classname,
33
- 'description' => $description,
34
- );
35
-
36
- // Widget control settings
37
- $control_ops = array(
38
- 'id_base' => $id_base,
39
- );
40
-
41
- // Create the widget
42
- $this->WP_Widget(
43
- static::ID,
44
- $title,
45
- $widget_ops,
46
- $control_ops
47
- );
48
- }
49
-
50
-
51
- public function widget( $args, $instance ) {
52
- global $before_widget, $before_title, $after_title, $after_widget;
53
-
54
- $args = wp_parse_args( $args, static::get_defaults() );
55
- extract( $args );
56
-
57
- // Our variables from the widget settings
58
- $title = apply_filters( 'widget_title', $instance['title'], null );
59
- $content = static::get_content( $instance, $this->number );
60
-
61
- // Before widget (defined by themes)
62
- echo $before_widget;
63
-
64
- if ( ! empty( $instance['title_link'] ) ) {
65
- $target = ! empty( $instance['target'] ) ? $instance['target'] : null;
66
- $title = Aihrus_Common::create_link( $instance['title_link'], $title, $target );
67
- }
68
-
69
- // Display the widget title if one was input (before and after defined by themes)
70
- if ( ! empty( $title ) )
71
- echo $before_title . $title . $after_title;
72
-
73
- // Display Widget
74
- echo $content;
75
-
76
- // After widget (defined by themes)
77
- echo $after_widget;
78
- }
79
-
80
-
81
- /**
82
- *
83
- *
84
- * @SuppressWarnings(PHPMD.UnusedFormalParameter)
85
- */
86
-
87
-
88
- public function update( $new_instance, $old_instance ) {
89
- $instance = static::validate_settings( $new_instance );
90
-
91
- return $instance;
92
- }
93
-
94
-
95
- public function form( $instance ) {
96
- $instance = static::form_instance( $instance );
97
- $defaults = static::get_defaults();
98
- $instance = wp_parse_args( $instance, $defaults );
99
-
100
- $form_parts = static::form_parts( $instance, $this->number );
101
- foreach ( $form_parts as $key => $part ) {
102
- $part[ 'id' ] = $key;
103
- $this->display_setting( $part, $instance );
104
- }
105
- }
106
-
107
-
108
- public static function widget_options( $options ) {
109
- foreach ( $options as $id => $parts ) {
110
- // remove non-widget parts
111
- if ( empty( $parts['widget'] ) )
112
- unset( $options[ $id ] );
113
- }
114
-
115
- return $options;
116
- }
117
-
118
-
119
- /**
120
- *
121
- *
122
- * @SuppressWarnings(PHPMD.UnusedLocalVariable)
123
- */
124
- public function display_setting( $args = array(), $options ) {
125
- extract( $args );
126
-
127
- $do_return = false;
128
- switch ( $type ) {
129
- case 'heading':
130
- if ( ! empty( $desc ) )
131
- echo '<h3>' . $desc . '</h3>';
132
-
133
- $do_return = true;
134
- break;
135
-
136
- case 'expand_all':
137
- if ( ! empty( $desc ) )
138
- echo '<h3>' . $desc . '</h3>';
139
-
140
- echo '<a id="' . $this->get_field_id( $id ) . '" style="cursor:pointer;" onclick="jQuery( \'.tw-collapsible-control\' ) . slideToggle(); jQuery( \'.tw-collapsible\' ) . slideToggle();">' . esc_html__( 'Expand/Collapse All Options' ) . ' &raquo;</a>';
141
-
142
- $do_return = true;
143
- break;
144
-
145
- case 'expand_begin':
146
- if ( ! empty( $desc ) )
147
- echo '<h3>' . $desc . '</h3>';
148
-
149
- echo '<a id="' . $this->get_field_id( $id ) . '" style="cursor:pointer;" onclick="jQuery( \'div#' . $this->get_field_id( $id ) . '\' ) . slideToggle();" class="tw-collapsible-control">' . esc_html__( 'Expand/Collapse' ) . ' &raquo;</a>';
150
- echo '<div id="' . $this->get_field_id( $id ) . '" style="display:none" class="tw-collapsible">';
151
-
152
- $do_return = true;
153
- break;
154
-
155
- case 'expand_end':
156
- echo '</div>';
157
-
158
- $do_return = true;
159
- break;
160
-
161
- default:
162
- break;
163
- }
164
-
165
- if ( $do_return )
166
- return;
167
-
168
- if ( ! isset( $options[$id] ) && $type != 'checkbox' )
169
- $options[$id] = $std;
170
- elseif ( ! isset( $options[$id] ) )
171
- $options[$id] = 0;
172
-
173
- $field_class = '';
174
- if ( ! empty( $class ) )
175
- $field_class = ' ' . $class;
176
-
177
- echo '<p>';
178
-
179
- switch ( $type ) {
180
- case 'checkbox':
181
- echo '<input class="checkbox' . $field_class . '" type="checkbox" id="' . $this->get_field_id( $id ) . '" name="' . $this->get_field_name( $id ) . '" value="1" ' . checked( $options[$id], 1, false ) . ' /> ';
182
-
183
- echo '<label for="' . $this->get_field_id( $id ) . '">' . $title . '</label>';
184
- break;
185
-
186
- case 'select':
187
- echo '<label for="' . $this->get_field_id( $id ) . '">' . $title . '</label>';
188
- echo '<select id="' . $this->get_field_id( $id ) . '"class="select' . $field_class . '" name="' . $this->get_field_name( $id ) . '">';
189
-
190
- foreach ( $choices as $value => $label )
191
- echo '<option value="' . esc_attr( $value ) . '"' . selected( $options[$id], $value, false ) . '>' . $label . '</option>';
192
-
193
- echo '</select>';
194
- break;
195
-
196
- case 'radio':
197
- $i = 0;
198
- $count_options = count( $options ) - 1;
199
-
200
- foreach ( $choices as $value => $label ) {
201
- echo '<input class="radio' . $field_class . '" type="radio" name="' . $this->get_field_name( $id ) . '" id="' . $this->get_field_name( $id . $i ) . '" value="' . esc_attr( $value ) . '" ' . checked( $options[$id], $value, false ) . '> <label for="' . $this->get_field_name( $id . $i ) . '">' . $label . '</label>';
202
- if ( $i < $count_options )
203
- echo '<br />';
204
- $i++;
205
- }
206
-
207
- echo '<label for="' . $this->get_field_id( $id ) . '">' . $title . '</label>';
208
- break;
209
-
210
- case 'textarea':
211
- echo '<label for="' . $this->get_field_id( $id ) . '">' . $title . '</label>';
212
-
213
- echo '<textarea class="widefat' . $field_class . '" id="' . $this->get_field_id( $id ) . '" name="' . $this->get_field_name( $id ) . '" placeholder="' . $std . '" rows="5" cols="30">' . wp_htmledit_pre( $options[$id] ) . '</textarea>';
214
- break;
215
-
216
- case 'password':
217
- echo '<label for="' . $this->get_field_id( $id ) . '">' . $title . '</label>';
218
-
219
- echo '<input class="widefat' . $field_class . '" type="password" id="' . $this->get_field_id( $id ) . '" name="' . $this->get_field_name( $id ) . '" value="' . esc_attr( $options[$id] ) . '" />';
220
- break;
221
-
222
- case 'readonly':
223
- echo '<label for="' . $this->get_field_id( $id ) . '">' . $title . '</label>';
224
-
225
- echo '<input class="widefat' . $field_class . '" type="text" id="' . $this->get_field_id( $id ) . '" name="' . $this->get_field_name( $id ) . '" value="' . esc_attr( $options[$id] ) . '" readonly="readonly" />';
226
- break;
227
-
228
- case 'text':
229
- echo '<label for="' . $this->get_field_id( $id ) . '">' . $title . '</label>';
230
-
231
- $suggest_id = 'suggest_' . self::$suggest_id++;
232
- echo '<input class="widefat' . $field_class . ' ' . $suggest_id . '" type="text" id="' . $this->get_field_id( $id ) . '" name="' . $this->get_field_name( $id ) . '" placeholder="' . $std . '" value="' . esc_attr( $options[$id] ) . '" />';
233
-
234
- if ( $suggest )
235
- echo static::get_suggest( $id, $suggest_id );
236
- break;
237
-
238
- default:
239
- break;
240
- }
241
-
242
- if ( ! empty( $desc ) )
243
- echo '<br /><span class="setting-description"><small>' . $desc . '</small></span>';
244
-
245
- echo '</p>';
246
- }
247
-
248
-
249
- }
250
-
251
-
252
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/includes/libraries/aihrus-framework/includes/class-aihrus-common.php DELETED
@@ -1,780 +0,0 @@
1
- <?php
2
- /**
3
- * Aihrus Framework
4
- * Copyright (C) 2014 Michael Cannon
5
- * This program is free software; you can redistribute it and/or modify
6
- * it under the terms of the GNU General Public License as published by
7
- * the Free Software Foundation; either version 2 of the License, or
8
- * (at your option) any later version.
9
- * This program is distributed in the hope that it will be useful,
10
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
11
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
- * GNU General Public License for more details.
13
- * You should have received a copy of the GNU General Public License along
14
- * with this program; if not, write to the Free Software Foundation, Inc.,
15
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
16
- */
17
-
18
-
19
- if ( class_exists( 'Aihrus_Common' ) ) {
20
- return;
21
- }
22
-
23
-
24
- abstract class Aihrus_Common {
25
- public static $donate_button;
26
- public static $donate_link;
27
- public static $markdown_helper;
28
- public static $value_check;
29
-
30
-
31
- public function __construct() {
32
- self::set_notice_key();
33
-
34
- self::$donate_button = <<<EOD
35
- <form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
36
- <input type="hidden" name="cmd" value="_s-xclick">
37
- <input type="hidden" name="hosted_button_id" value="WM4F995W9LHXE">
38
- <input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donate_SM.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
39
- <img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1">
40
- </form>
41
- EOD;
42
-
43
- self::$donate_link = '<a href="http://aihr.us/about-aihrus/donate/"><img src="https://www.paypalobjects.com/en_US/i/btn/btn_donate_SM.gif" border="0" alt="PayPal - The safer, easier way to pay online!" /></a>';
44
-
45
- add_action( 'admin_init', array( static::$class, 'check_notices' ), 9999 );
46
- }
47
-
48
-
49
- public static function set_notice( $notice_name, $frequency_limit = false ) {
50
- $notice_key = self::get_notice_key();
51
-
52
- $frequency_limit = intval( $frequency_limit );
53
- if ( ! empty( $frequency_limit ) ) {
54
- $fl_key = $notice_key . '_' . $notice_name;
55
- $proceed = get_transient( $fl_key );
56
- if ( false === $proceed ) {
57
- delete_transient( $fl_key );
58
- set_transient( $fl_key, time(), $frequency_limit );
59
- } else {
60
- return;
61
- }
62
- }
63
-
64
- $notices = get_transient( $notice_key );
65
- if ( false === $notices ) {
66
- $notices = array();
67
- }
68
-
69
- $notices[] = $notice_name;
70
-
71
- self::delete_notices();
72
- set_transient( $notice_key, $notices, HOUR_IN_SECONDS );
73
- }
74
-
75
-
76
- public static function delete_notices() {
77
- $notice_key = self::get_notice_key();
78
-
79
- delete_transient( $notice_key );
80
- }
81
-
82
-
83
- public static function check_notices() {
84
- $notice_key = self::get_notice_key();
85
-
86
- $notices = get_transient( $notice_key );
87
- if ( false === $notices ) {
88
- return;
89
- }
90
-
91
- $notices = array_unique( $notices );
92
- foreach ( $notices as $notice ) {
93
- if ( function_exists( $notice ) ) {
94
- add_action( 'admin_notices', $notice );
95
- } elseif ( is_array( $notice ) ) {
96
- add_action( 'admin_notices', $notice );
97
- } else {
98
- add_action( 'admin_notices', array( static::$class, $notice ) );
99
- }
100
- }
101
-
102
- self::delete_notices();
103
- }
104
-
105
-
106
- public static function get_notice_key() {
107
- if ( is_null( static::$notice_key ) ) {
108
- self::set_notice_key();
109
- }
110
-
111
- return static::$notice_key;
112
- }
113
-
114
-
115
- public static function set_notice_key() {
116
- static::$notice_key = static::SLUG . 'notices';
117
- }
118
-
119
-
120
- public static function version( $version ) {
121
- $version .= '-' . static::ID . '-' . static::VERSION;
122
-
123
- return $version;
124
- }
125
-
126
-
127
- /**
128
- * flatten an arbitrarily deep multidimensional array
129
- * into a list of its scalar values
130
- * (may be inefficient for large structures)
131
- * (will infinite recurse on self-referential structures)
132
- * (could be extended to handle objects)
133
- *
134
- * @ref http://in1.php.net/manual/en/function.array-values.php#41967
135
- */
136
- public static function array_values_recursive( $ary ) {
137
- $lst = array();
138
- foreach ( array_keys( $ary ) as $k ) {
139
- $v = $ary[ $k ];
140
- if ( is_scalar( $v ) ) {
141
- $lst[] = $v;
142
- } elseif ( is_array( $v ) ) {
143
- $lst = array_merge(
144
- $lst,
145
- self::array_values_recursive( $v )
146
- );
147
- }
148
- }
149
-
150
- return $lst;
151
- }
152
-
153
-
154
- public static function notice_donate( $disable_donate = null, $item_name = null ) {
155
- if ( $disable_donate ) {
156
- return;
157
- }
158
-
159
- $text = sprintf( esc_html__( 'Please donate $5 towards ongoing free support and development of the "%1$s" plugin. %2$s' ), $item_name, self::$donate_button );
160
-
161
- aihr_notice_updated( $text );
162
- }
163
-
164
-
165
- public static function get_scripts() {
166
- if ( static::$scripts_called ) {
167
- return;
168
- }
169
-
170
- foreach ( static::$scripts as $script ) {
171
- echo $script;
172
- }
173
-
174
- static::$scripts_called = true;
175
- }
176
-
177
-
178
- public static function get_styles() {
179
- if ( empty( self::$styles ) ) {
180
- return;
181
- }
182
-
183
- if ( empty( self::$styles_called ) ) {
184
- echo '<style>';
185
-
186
- foreach ( self::$styles as $style ) {
187
- echo $style;
188
- }
189
-
190
- echo '</style>';
191
-
192
- self::$styles_called = true;
193
- }
194
- }
195
-
196
-
197
- public static function create_nonce( $action ) {
198
- $nonce = uniqid();
199
- $uid = get_current_user_id();
200
- $check = $uid . $action;
201
- set_transient( $nonce, $check, HOUR_IN_SECONDS );
202
-
203
- return $nonce;
204
- }
205
-
206
-
207
- public static function verify_nonce( $nonce, $action ) {
208
- $active = get_transient( $nonce );
209
- $uid = get_current_user_id();
210
- $check = $uid . $action;
211
- $valid = false;
212
-
213
- if ( $active == $check ) {
214
- delete_transient( $nonce );
215
- $valid = true;
216
- }
217
-
218
- return $valid;
219
- }
220
-
221
-
222
- /**
223
- * If incoming link is empty, then get_site_url() is used instead.
224
- */
225
- public static function create_link( $link, $title = null, $target = null, $return_as_tag = true ) {
226
- if ( empty( $link ) ) {
227
- $link = get_site_url();
228
- }
229
-
230
- if ( preg_match( '#^\d+$#', $link ) ) {
231
- $permalink = get_permalink( $link );
232
- $tag_title = get_the_title( $link );
233
- if ( empty( $title ) ) {
234
- $title = $tag_title;
235
- }
236
-
237
- $tag = '<a href="';
238
- $tag .= $permalink;
239
- $tag .= '" title="';
240
- $tag .= $tag_title;
241
- $tag .= '">';
242
- $tag .= $title;
243
- $tag .= '</a>';
244
- } else {
245
- $orig_link = empty( $title ) ? $link : $title;
246
- $do_http = true;
247
-
248
- if ( 0 === strpos( $link, '/' ) ) {
249
- $do_http = false;
250
- }
251
-
252
- if ( $do_http && 0 === preg_match( '#https?://#', $link ) ) {
253
- $link = 'http://' . $link;
254
- }
255
-
256
- $permalink = $link;
257
-
258
- $tag = '<a href="';
259
- $tag .= $permalink;
260
- $tag .= '">';
261
- $tag .= $orig_link;
262
- $tag .= '</a>';
263
- }
264
-
265
- if ( ! empty( $target ) && is_string( $target ) ) {
266
- $tag = links_add_target( $tag, $target );
267
- }
268
-
269
- if ( $return_as_tag ) {
270
- return $tag;
271
- } else {
272
- return array(
273
- 'link' => $permalink,
274
- 'tag' => $tag,
275
- );
276
- }
277
- }
278
-
279
-
280
- public static function add_media( $post_id, $media_src, $media_name = null, $featured_image = true ) {
281
- require_once ABSPATH . 'wp-admin/includes/image.php';
282
-
283
- if ( empty( $media_name ) ) {
284
- $media_name = basename( $media_src );
285
- }
286
-
287
- $wp_filetype = wp_check_filetype( $media_name, null );
288
- $attachment = array(
289
- 'post_mime_type' => $wp_filetype['type'],
290
- 'post_status' => 'inherit',
291
- 'post_title' => $media_name,
292
- );
293
-
294
- $file_contents = self::file_get_contents( $media_src );
295
- $file_move = wp_upload_bits( $media_name, null, $file_contents );
296
- $file_name = $file_move['file'];
297
-
298
- $image_id = wp_insert_attachment( $attachment, $file_name, $post_id );
299
- $metadata = wp_generate_attachment_metadata( $image_id, $file_name );
300
- wp_update_attachment_metadata( $image_id, $metadata );
301
-
302
- if ( $featured_image ) {
303
- update_post_meta( $post_id, '_thumbnail_id', $image_id );
304
- }
305
-
306
- return $image_id;
307
- }
308
-
309
-
310
- /**
311
- * Thank you Tobylewis
312
- *
313
- * @ref http://wordpress.org/support/topic/plugin-flickr-shortcode-importer-file_get_contents-with-url-isp-does-not-support?replies=2#post-2878241
314
- */
315
- public static function file_get_contents_curl( $url ) {
316
- $ch = curl_init();
317
-
318
- curl_setopt( $ch, CURLOPT_AUTOREFERER, true );
319
- curl_setopt( $ch, CURLOPT_HEADER, 0 );
320
- curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );
321
- curl_setopt( $ch, CURLOPT_URL, $url );
322
- curl_setopt( $ch, CURLOPT_FOLLOWLOCATION, true );
323
-
324
- $data = curl_exec( $ch );
325
- curl_close( $ch );
326
-
327
- return $data;
328
- }
329
-
330
-
331
- /**
332
- * file_get_contents support on some shared systems is turned off
333
- */
334
- public static function file_get_contents( $url ) {
335
- if ( function_exists( 'file_get_contents' ) ) {
336
- return file_get_contents( $url );
337
- } elseif ( function_exists( 'curl_init' ) ) {
338
- return self::file_get_contents_curl( $url );
339
- } else {
340
- $text = esc_html__( 'cURL is not installed and file_get_contents is not accessible. Unable to retrieve URL %1$s.' );
341
- $error = sprintf( $text, $url );
342
-
343
- aihr_notice_error( $error );
344
-
345
- return;
346
- }
347
- }
348
-
349
-
350
- public static function get_image_src( $image, $strip_protocol = true ) {
351
- $doc = new DOMDocument();
352
- $doc->loadHTML( $image );
353
- $xpath = new DOMXPath( $doc );
354
- $src = $xpath->evaluate( 'string(//img/@src)' );
355
-
356
- if ( $strip_protocol ) {
357
- $src = self::strip_protocol( $src );
358
- }
359
-
360
- return $src;
361
- }
362
-
363
-
364
- public static function clean_string( $string ) {
365
- if ( ! is_string( $string ) ) {
366
- return $string;
367
- }
368
-
369
- return trim( strip_shortcodes( strip_tags( $string ) ) );
370
- }
371
-
372
-
373
- /**
374
- * Truncate HTML, close opened tags. UTF-8 aware, and aware of unpaired tags
375
- * (which don't need a matching closing tag)
376
- *
377
- * @param string $html
378
- * @param int $max_length Maximum length of the characters of the string
379
- * @param string $indicator Suffix to use if string was truncated.
380
- * @param boolean $force_indicator Suffix to use if string was truncated.
381
- * @return string
382
- *
383
- * @ref http://pastie.org/3084080
384
- */
385
- public static function truncate( $html, $max_length, $indicator = '&hellip;', $force_indicator = false ) {
386
- $output_length = 0; // number of counted characters stored so far in $output
387
- $position = 0; // character offset within input string after last tag/entity
388
- $tag_stack = array(); // stack of tags we've encountered but not closed
389
- $output = '';
390
- $truncated = false;
391
-
392
- /**
393
- * these tags don't have matching closing elements, in HTML (in XHTML they
394
- * theoretically need a closing /> )
395
- *
396
- * @see http://www.netstrider.com/tutorials/HTMLRef/a_d.html
397
- * @see http://www.w3schools.com/tags/default.asp
398
- * @see http://stackoverflow.com/questions/3741896/what-do-you-call-tags-that-need-no-ending-tag
399
- */
400
- $unpaired_tags = array(
401
- 'doctype',
402
- '!doctype',
403
- 'area',
404
- 'base',
405
- 'basefont',
406
- 'bgsound',
407
- 'br',
408
- 'col',
409
- 'embed',
410
- 'frame',
411
- 'hr',
412
- 'img',
413
- 'input',
414
- 'link',
415
- 'meta',
416
- 'param',
417
- 'sound',
418
- 'spacer',
419
- 'wbr',
420
- );
421
-
422
- $func_strcut = function_exists( 'mb_strcut' ) ? 'mb_strcut' : 'substr';
423
- $func_strlen = function_exists( 'mb_strlen' ) ? 'mb_strlen' : 'strlen';
424
-
425
- // loop through, splitting at HTML entities or tags
426
- while ( $output_length < $max_length && preg_match( '{</?([a-z]+)[^>]*>|&#?[a-zA-Z0-9]+;}', $html, $match, PREG_OFFSET_CAPTURE, $position ) ) {
427
- list( $tag, $tag_position ) = $match[0];
428
-
429
- // get text leading up to the tag, and store it – up to max_length
430
- $text = $func_strcut( $html, $position, $tag_position - $position );
431
- if ( $output_length + $func_strlen( $text ) > $max_length ) {
432
- $output .= $func_strcut( $text, 0, $max_length - $output_length );
433
- $truncated = true;
434
- $output_length = $max_length;
435
- break;
436
- }
437
-
438
- // store everything, it wasn't too long
439
- $output .= $text;
440
- $output_length += $func_strlen( $text );
441
-
442
- if ( $tag[0] == '&' ) {
443
- // Handle HTML entity by copying straight through
444
- $output .= $tag;
445
- $output_length++; // only counted as one character
446
- } else {
447
- // Handle HTML tag
448
- $tag_inner = $match[1][0];
449
- if ( $tag[1] == '/' ) {
450
- // This is a closing tag.
451
- $output .= $tag;
452
- // If input tags aren't balanced, we leave the popped tag
453
- // on the stack so hopefully we're not introducing more
454
- // problems.
455
-
456
- if ( end( $tag_stack ) == $tag_inner ) {
457
- array_pop( $tag_stack );
458
- }
459
- } elseif ( $tag[ $func_strlen( $tag ) - 2 ] == '/' || in_array( strtolower( $tag_inner ), $unpaired_tags ) ) {
460
- // Self-closing or unpaired tag
461
- $output .= $tag;
462
- } else {
463
- // Opening tag.
464
- $output .= $tag;
465
- $tag_stack[] = $tag_inner; // push tag onto the stack
466
- }
467
- }
468
-
469
- // Continue after the tag we just found
470
- $position = $tag_position + $func_strlen( $tag );
471
- }
472
-
473
- // Print any remaining text after the last tag, if there's room
474
-
475
- if ( $output_length < $max_length && $position < $func_strlen( $html ) ) {
476
- $output .= $func_strcut( $html, $position, $max_length - $output_length );
477
- }
478
-
479
- $truncated = $func_strlen( $html ) - $position > $max_length - $output_length;
480
-
481
- // add terminator if it was truncated in loop or just above here
482
- if ( $truncated || $force_indicator ) {
483
- $output .= $indicator;
484
- }
485
-
486
- // Close any open tags
487
- while ( ! empty( $tag_stack ) ) {
488
- $output .= '</'.array_pop( $tag_stack ).'>';
489
- }
490
-
491
- return $output;
492
- }
493
-
494
-
495
- public static function strip_protocol( $link ) {
496
- if ( ! empty( $link ) ) {
497
- $link = preg_replace( '#https?:#', '', $link );
498
- }
499
-
500
- return $link;
501
- }
502
-
503
-
504
- /**
505
- *
506
- *
507
- * @ref http://wpbandit.com/code/check-a-users-role-in-wordpress/
508
- */
509
- public static function check_user_role( $roles = array(), $user_id = null ) {
510
- // Get user by ID, else get current user
511
- if ( $user_id ) {
512
- $user = get_userdata( $user_id );
513
- } else {
514
- $user = wp_get_current_user();
515
- }
516
-
517
- // No user found, return
518
- if ( empty( $user ) ) {
519
- return false;
520
- }
521
-
522
- // Append administrator to roles, if necessary
523
- if ( ! in_array( 'administrator', $roles ) ) {
524
- $roles[] = 'administrator';
525
- }
526
-
527
- // Loop through user roles
528
- foreach ( $user->roles as $role ) {
529
- // Does user have role
530
- if ( in_array( $role, $roles ) ) {
531
- return true;
532
- }
533
- }
534
-
535
- // User not in roles
536
- return false;
537
- }
538
-
539
-
540
- public static function activation() {
541
- if ( ! current_user_can( 'activate_plugins' ) ) {
542
- return;
543
- }
544
- }
545
-
546
-
547
- public static function deactivation() {
548
- if ( ! current_user_can( 'activate_plugins' ) ) {
549
- return;
550
- }
551
- }
552
-
553
-
554
- public static function uninstall() {
555
- if ( ! current_user_can( 'activate_plugins' ) ) {
556
- return;
557
- }
558
- }
559
-
560
-
561
- public static function version_check() {
562
- $good_version = true;
563
-
564
- return $good_version;
565
- }
566
-
567
-
568
- public static function get_archive_slug( $cpt ) {
569
- $post_type = get_post_type_object( $cpt );
570
- $archive_slug = $post_type->has_archive;
571
- if ( $archive_slug === true ) {
572
- $archive_slug = $post_type->name;
573
- }
574
-
575
- return $archive_slug;
576
- }
577
-
578
-
579
- /**
580
- * Generate date archive rewrite rules for a given custom post type
581
- *
582
- * @param string $cpt slug of the custom post type
583
- * @return rules returns a set of rewrite rules for Wordpress to handle
584
- */
585
- public static function rewrite_rules_date_archives( $cpt, $wp_rewrite ) {
586
- $rules = array();
587
- $slug_archive = self::get_archive_slug( $cpt );
588
- if ( $slug_archive === false ) {
589
- return $rules;
590
- }
591
-
592
- $dates = array(
593
- array(
594
- 'rule' => '([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})',
595
- 'vars' => array( 'year', 'monthnum', 'day' ) ),
596
- array(
597
- 'rule' => '([0-9]{4})/([0-9]{1,2})',
598
- 'vars' => array( 'year', 'monthnum' ) ),
599
- array(
600
- 'rule' => '([0-9]{4})',
601
- 'vars' => array( 'year' ) ),
602
- );
603
-
604
- foreach ( $dates as $data ) {
605
- $query = 'index.php?post_type=' . $cpt;
606
- $rule = $slug_archive . '/' . $data['rule'];
607
-
608
- $i = 1;
609
- foreach ( $data['vars'] as $var ) {
610
- $query .= '&' . $var . '=' . $wp_rewrite->preg_index( $i );
611
- $i++;
612
- }
613
-
614
- $rules[ $rule . '/?$' ] = $query;
615
- $rules[ $rule . '/feed/(feed|rdf|rss|rss2|atom)/?$' ] = $query . '&feed=' . $wp_rewrite->preg_index( $i );
616
- $rules[ $rule . '/(feed|rdf|rss|rss2|atom)/?$' ] = $query . '&feed=' . $wp_rewrite->preg_index( $i );
617
- $rules[ $rule . '/page/([0-9]{1,})/?$' ] = $query . '&paged=' . $wp_rewrite->preg_index( $i );
618
- }
619
-
620
- return $rules;
621
- }
622
-
623
-
624
- public static function markdown2html( $markdown ) {
625
- require_once AIHR_DIR_LIB . 'parsedown/Parsedown.php';
626
-
627
- if ( is_null( self::$markdown_helper ) ) {
628
- self::$markdown_helper = new Parsedown();
629
- }
630
-
631
- if ( is_readable( $markdown ) ) {
632
- $markdown = self::file_get_contents( $markdown );
633
- } else {
634
- return;
635
- }
636
-
637
- $html = self::$markdown_helper->text( $markdown );
638
-
639
- return $html;
640
- }
641
-
642
-
643
- public static function rewrite_rules_feed( $wp_rewrite ) {
644
- $rules = array(
645
- 'feed/(.+)' => 'index.php?feed=' . $wp_rewrite->preg_index( 1 ),
646
- '(.+).xml' => 'index.php?feed=' . $wp_rewrite->preg_index( 1 ),
647
- );
648
-
649
- return $rules;
650
- }
651
-
652
-
653
- public static function define_options_validate( $parts ) {
654
- $validate = '';
655
- if ( empty( $parts['validate'] ) ) {
656
- return $validate;
657
- }
658
-
659
- $validation_info = array(
660
- 'absint' => __( '<a href="http://codex.wordpress.org/Function_Reference/absint">absint</a>.' ),
661
- 'ids' => __( 'Digit-only characters to make a multiple or single entries. Regex <code>#^\d+(,\s?\d+)*$#</code>.' ),
662
- 'intval' => __( '<a href="php.net/manual/en/function.intval.php">intval</a>.' ),
663
- 'is_true' => __( 'Values like true, \'true\', 1, \'on\', and \'yes\' are <strong>true</strong>; otherwise <strong>false</strong>.' ),
664
- 'min1' => __( 'An <a href="php.net/manual/en/function.intval.php">intval</a> greater than zero.' ),
665
- 'nozero' => __( 'A non-zero <a href="php.net/manual/en/function.intval.php">intval</a>.' ),
666
- 'order' => __( 'SQL ordering "ASC" or "DESC". Regex <code>#^desc|asc$#i</code>.' ),
667
- 'slash_sanitize_title' => __( '<a href="http://codex.wordpress.org/Function_Reference/sanitize_title">sanitize_title</a>.' ),
668
- 'slug' => __( 'Word-only characters including a hyphen to make a single term. Regex <code>#^[\w-]+$#</code>.' ),
669
- 'term' => __( 'Word-only characters to make a single term. Regex <code>#^\w+$#</code>.' ),
670
- 'terms' => __( 'Word-only characters including hyphens and spaces to make a multiple or single terms. Regex <code>#^(([\w- ]+)(,\s?)?)+$#</code>.' ),
671
- 'twp_update_license' => esc_html__( 'Current license.' ),
672
- 'url' => __( '<a href="http://php.net/manual/en/filter.filters.validate.php">filter_var( $url, FILTER_VALIDATE_URL )</a>.' ),
673
- 'wp_kses_data' => __( '<a href="http://codex.wordpress.org/Function_Reference/wp_kses_data">wp_kses_data</a>.' ),
674
- 'wp_kses_post' => __( '<a href="http://codex.wordpress.org/Function_Reference/wp_kses_post">wp_kses_post</a>.' ),
675
- );
676
-
677
- $validations = ! empty( $parts['validate'] ) ? $parts['validate'] : array();
678
- if ( ! empty( $validations ) ) {
679
- $validate = esc_html__( 'Validatation: ' );
680
-
681
- $validates = array();
682
- $validations = explode( ',', $validations );
683
- foreach ( $validations as $validation ) {
684
- if ( ! empty( $validation_info[ $validation ] ) ) {
685
- $validates[] = $validation_info[ $validation ];
686
- } else {
687
- $validates[] = 'TBD ' . $validation;
688
- }
689
-
690
- self::$value_check = $validation;
691
- }
692
-
693
- $validate .= implode( ', ', $validates );
694
- }
695
-
696
- return $validate;
697
- }
698
-
699
-
700
- public static function define_options_choices( $parts ) {
701
- $choices = '';
702
- if ( empty( $parts['choices'] ) ) {
703
- return $choices;
704
- }
705
-
706
- $choices = $parts['choices'];
707
- $choices = array_keys( $parts['choices'] );
708
- if ( '' == $choices[0] ) {
709
- $choices[0] = 'false';
710
- }
711
-
712
- $choices = implode( ', ', $choices );
713
-
714
- return $choices;
715
- }
716
-
717
-
718
- public static function define_options_value( $setting, $parts ) {
719
- $value = $parts['std'];
720
-
721
- switch ( $parts['type'] ) {
722
- case 'checkbox':
723
- if ( Aihrus_Settings::is_false( $value ) ) {
724
- $value = 'false';
725
- } elseif ( Aihrus_Settings::is_true( $value ) ) {
726
- $value = 'true';
727
- } elseif ( empty( $value ) ) {
728
- $value = esc_html__( 'TBD empty ' ) . $parts['type'];
729
- }
730
- break;
731
-
732
- case 'select':
733
- if ( empty( $value ) ) {
734
- $value = esc_html__( 'Pick an option' );
735
- }
736
- break;
737
-
738
- case 'text':
739
- case 'textarea':
740
- if ( empty( $value ) ) {
741
- if ( 'absint' == self::$value_check ) {
742
- $value = 10;
743
- } elseif ( 'ids' == self::$value_check ) {
744
- $value = '3,1,2';
745
- } elseif ( 'intval' == self::$value_check ) {
746
- $value = 10;
747
- } elseif ( 'min1' == self::$value_check ) {
748
- $value = 5;
749
- } elseif ( 'nozero' == self::$value_check ) {
750
- $value = 10;
751
- } elseif ( 'slug' == self::$value_check ) {
752
- $value = 'slug-name';
753
- } elseif ( 'term' == self::$value_check ) {
754
- $value = 'termname';
755
- } elseif ( 'terms' == self::$value_check ) {
756
- if ( preg_match( '#category|categories#i', $setting ) ) {
757
- $value = esc_html__( 'Category A, Another category, 123' );
758
- } else {
759
- $value = esc_html__( 'Tag A, Another tag, 123' );
760
- }
761
- } else {
762
- $value = esc_html__( 'You decide…' );
763
- }
764
- }
765
- break;
766
-
767
- default:
768
- break;
769
- }
770
-
771
- self::$value_check = null;
772
-
773
- return $value;
774
- }
775
-
776
-
777
- }
778
-
779
-
780
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/includes/libraries/aihrus-framework/includes/class-aihrus-licensing.php DELETED
@@ -1,221 +0,0 @@
1
- <?php
2
- /**
3
- Aihrus Framework
4
- Copyright (C) 2014 Michael Cannon
5
-
6
- This program is free software; you can redistribute it and/or modify
7
- it under the terms of the GNU General Public License as published by
8
- the Free Software Foundation; either version 2 of the License, or
9
- (at your option) any later version.
10
-
11
- This program is distributed in the hope that it will be useful,
12
- but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
- GNU General Public License for more details.
15
-
16
- You should have received a copy of the GNU General Public License along
17
- with this program; if not, write to the Free Software Foundation, Inc.,
18
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19
- */
20
-
21
- if ( class_exists( 'Aihrus_Licensing' ) ) {
22
- return;
23
- }
24
-
25
-
26
- abstract class Aihrus_Licensing {
27
- public $author;
28
- public $item_name;
29
- public $item_name_encoded;
30
- public $slug;
31
- public $store_url;
32
-
33
- public static $settings_saved = false;
34
-
35
-
36
- public function __construct( $slug, $item_name, $author = 'Michael Cannon', $store_url = 'http://aihr.us' ) {
37
- $this->author = $author;
38
- $this->item_name_encoded = urlencode( $item_name );
39
- $this->item_name = $item_name;
40
- $this->slug = $slug;
41
- $this->store_url = $store_url;
42
- }
43
-
44
-
45
- public function license_key() {
46
- $key = $this->slug . 'license_key';
47
-
48
- return $key;
49
- }
50
-
51
-
52
- public function get_license() {
53
- $key = $this->license_key();
54
- $license = get_transient( $key );
55
-
56
- return $license;
57
- }
58
-
59
-
60
- public function update_license( $value = null ) {
61
- $license = $this->get_license();
62
- if ( $license === $value ) {
63
- return $value;
64
- }
65
-
66
- $deactivate_license = false;
67
- if ( $this->valid_hash( $value ) ) {
68
- $this->set_license( $value );
69
- $value = $this->activate_license();
70
- $this->set_license( $value );
71
- } else {
72
- $this->deactivate_license();
73
- $this->delete_license();
74
-
75
- $deactivate_license = true;
76
- $value = '';
77
- }
78
-
79
- if ( $this->valid_license() ) {
80
- $text = esc_html__( '%s license saved.' );
81
- $text = sprintf( $text, $this->item_name );
82
- add_settings_error( static::$settings_id, 'license_saved', $text, 'updated' );
83
- } elseif ( empty( $deactivate_license ) ) {
84
- $text = esc_html__( '%s license not saved.' );
85
- $text = sprintf( $text, $this->item_name );
86
- add_settings_error( static::$settings_id, 'license_not_saved', $text, 'error' );
87
- }
88
-
89
- if ( empty( self::$settings_saved ) ) {
90
- self::$settings_saved = true;
91
- set_transient( 'settings_errors', get_settings_errors(), 30 );
92
- }
93
-
94
- return $value;
95
- }
96
-
97
-
98
- public function set_license( $value = null ) {
99
- $key = $this->license_key();
100
- delete_transient( $key );
101
-
102
- if ( ! is_null( $value ) ) {
103
- set_transient( $key, $value, YEAR_IN_SECONDS );
104
- }
105
- }
106
-
107
-
108
- public function valid_license() {
109
- $license = $this->get_license();
110
- if ( $this->valid_hash( $license ) ) {
111
- return true;
112
- } else {
113
- return false;
114
- }
115
- }
116
-
117
-
118
- public function get_api_call( $action ) {
119
- $license = $this->get_license();
120
- $api_params = array(
121
- 'edd_action' => $action,
122
- 'item_name' => $this->item_name_encoded,
123
- 'license' => $license,
124
- );
125
-
126
- $api_call = add_query_arg(
127
- $api_params,
128
- $this->store_url
129
- );
130
-
131
- return $api_call;
132
- }
133
-
134
-
135
- public function get_remote_get( $api_call ) {
136
- $response = wp_remote_get(
137
- $api_call,
138
- array(
139
- 'sslverify' => false,
140
- )
141
- );
142
-
143
- return $response;
144
- }
145
-
146
-
147
- public function activate_license() {
148
- $license_data = $this->get_license_data( 'activate_license' );
149
- if ( false !== $license_data ) {
150
- if ( 'valid' == $license_data->license ) {
151
- $license = $this->get_license();
152
-
153
- return $license;
154
- }
155
-
156
- return $license_data->license;
157
- }
158
-
159
- return false;
160
- }
161
-
162
-
163
- public function get_license_data( $action = 'check_license' ) {
164
- $api_call = $this->get_api_call( $action );
165
- $response = $this->get_remote_get( $api_call );
166
- if ( is_wp_error( $response ) ) {
167
- return false;
168
- }
169
-
170
- $license_data = json_decode( wp_remote_retrieve_body( $response ) );
171
-
172
- return $license_data;
173
- }
174
-
175
-
176
- public function deactivate_license() {
177
- $license_data = $this->get_license_data( 'deactivate_license' );
178
- if ( false !== $license_data ) {
179
- if ( 'deactivated' == $license_data->license ) {
180
- $text = esc_html__( '%s license deactivated.' );
181
- $text = sprintf( $text, $this->item_name );
182
- add_settings_error( static::$settings_id, 'license_deactivated', $text, 'updated' );
183
-
184
- return true;
185
- }
186
-
187
- return $license_data->license;
188
- }
189
-
190
- return false;
191
- }
192
-
193
-
194
- public function delete_license() {
195
- $this->set_license();
196
- }
197
-
198
-
199
- public function license_notice() {
200
- $result = '<p><em>' . esc_html( 'Premium features require licensing to function.' ) . '</em></p>';
201
-
202
- return $result;
203
- }
204
-
205
-
206
- public function valid_hash( $value = null ) {
207
- if ( is_string( $value ) && preg_match( '#^[0-9a-f]{32}$#i', $value ) ) {
208
- return true;
209
- }
210
-
211
- return false;
212
- }
213
-
214
-
215
- public static function settings( $settings ) {
216
- return $settings;
217
- }
218
- }
219
-
220
-
221
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/includes/libraries/aihrus-framework/includes/class-aihrus-settings.php DELETED
@@ -1,903 +0,0 @@
1
- <?php
2
- /**
3
- * Aihrus Framework
4
- * Copyright (C) 2014 Michael Cannon
5
- * This program is free software; you can redistribute it and/or modify
6
- * it under the terms of the GNU General Public License as published by
7
- * the Free Software Foundation; either version 2 of the License, or
8
- * (at your option) any later version.
9
- * This program is distributed in the hope that it will be useful,
10
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
11
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
- * GNU General Public License for more details.
13
- * You should have received a copy of the GNU General Public License along
14
- * with this program; if not, write to the Free Software Foundation, Inc.,
15
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
16
- */
17
-
18
-
19
- /**
20
- * Aihrus Framework settings helper class
21
- *
22
- * Based upon http://alisothegeek.com/2011/01/wordpress-settings-api-tutorial-1/
23
- */
24
- require_once ABSPATH . 'wp-admin/includes/template.php';
25
-
26
- if ( class_exists( 'Aihrus_Settings' ) ) {
27
- return;
28
- }
29
-
30
-
31
- abstract class Aihrus_Settings {
32
- public static $default = array(
33
- 'backwards' => array(
34
- 'version' => null, // below this version number, use std
35
- 'std' => null,
36
- ),
37
- 'choices' => array(), // key => value
38
- 'class' => null, // warning, etc.
39
- 'desc' => null,
40
- 'id' => null,
41
- 'section' => 'general',
42
- 'show_code' => false,
43
- 'std' => null, // default key or value
44
- 'suggest' => false, // attempt for auto-suggest on inputs
45
- 'title' => null,
46
- 'type' => 'text', // textarea, checkbox, radio, select, hidden, heading, password, expand_begin, expand_end
47
- 'validate' => null, // required, term, slug, slugs, ids, order, single paramater PHP functions
48
- 'widget' => 1, // show in widget options, 0 off
49
- );
50
-
51
- private static $settings_saved = false;
52
-
53
- public static $suggest_id = 0;
54
-
55
- public function __construct() {}
56
-
57
-
58
- public static function load_options() {
59
- static::sections();
60
- static::settings();
61
- }
62
-
63
-
64
- public static function sections() {
65
- static::$sections['reset'] = esc_html__( 'Reset' );
66
- static::$sections['about'] = esc_html__( 'About' );
67
- }
68
-
69
-
70
- /**
71
- *
72
- *
73
- * @SuppressWarnings(PHPMD.Superglobals)
74
- */
75
- public static function settings() {
76
- // Reset section defaults
77
- $options = get_option( static::ID );
78
- if ( ! empty( $options ) ) {
79
- $serialized_options = serialize( $options );
80
- $_SESSION['export'] = $serialized_options;
81
-
82
- static::$settings['export'] = array(
83
- 'section' => 'reset',
84
- 'title' => esc_html__( 'Export Settings' ),
85
- 'type' => 'readonly',
86
- 'desc' => esc_html__( 'These are your current settings in a serialized format. Copy the contents to make a backup of your settings.' ),
87
- 'std' => $serialized_options,
88
- 'widget' => 0,
89
- 'show_code' => false,
90
- );
91
- }
92
-
93
- static::$settings['import'] = array(
94
- 'section' => 'reset',
95
- 'title' => esc_html__( 'Import Settings' ),
96
- 'type' => 'textarea',
97
- 'desc' => esc_html__( 'Paste new serialized settings here to overwrite your current configuration.' ),
98
- 'widget' => 0,
99
- 'show_code' => false,
100
- );
101
-
102
- $desc = esc_html__( 'Delete all %s data and options from database on plugin deletion. Even if this option isn\'t checked, WordPress will still give a data deletion warning.' );
103
-
104
- static::$settings['delete_data'] = array(
105
- 'section' => 'reset',
106
- 'title' => esc_html__( 'Remove Plugin Data on Deletion?' ),
107
- 'type' => 'checkbox',
108
- 'class' => 'warning',
109
- 'desc' => sprintf( $desc, static::NAME ),
110
- 'widget' => 0,
111
- 'show_code' => false,
112
- );
113
-
114
- static::$settings['reset_defaults'] = array(
115
- 'section' => 'reset',
116
- 'title' => esc_html__( 'Reset to Defaults?' ),
117
- 'type' => 'checkbox',
118
- 'class' => 'warning',
119
- 'desc' => esc_html__( 'Check this box to reset options to their defaults.' ),
120
- 'show_code' => false,
121
- );
122
- }
123
-
124
-
125
- public static function get_defaults( $mode = null, $old_version = null ) {
126
- if ( empty( static::$defaults ) ) {
127
- static::settings();
128
- }
129
-
130
- $do_backwards = false;
131
- if ( 'backwards' == $mode ) {
132
- if ( ! empty( $old_version ) ) {
133
- $do_backwards = true;
134
- }
135
- }
136
-
137
- foreach ( static::$settings as $id => $parts ) {
138
- $std = isset( $parts['std'] ) ? $parts['std'] : '';
139
- if ( $do_backwards ) {
140
- $version = ! empty( $parts['backwards']['version'] ) ? $parts['backwards']['version'] : false;
141
- if ( ! empty( $version ) ) {
142
- if ( $old_version < $version ) {
143
- $std = $parts['backwards']['std'];
144
- }
145
- }
146
- }
147
-
148
- static::$defaults[ $id ] = $std;
149
- }
150
-
151
- return static::$defaults;
152
- }
153
-
154
-
155
- public static function get_settings() {
156
- if ( empty( static::$settings ) ) {
157
- static::settings();
158
- }
159
-
160
- return static::$settings;
161
- }
162
-
163
-
164
- public static function initialize_settings( $version = null ) {
165
- $defaults = static::get_defaults( 'backwards' );
166
- $current = get_option( static::ID );
167
- $current = wp_parse_args( $current, $defaults );
168
-
169
- $current['admin_notices'] = $version;
170
- $current['version'] = static::$version;
171
-
172
- update_option( static::ID, $current );
173
- }
174
-
175
-
176
- /**
177
- *
178
- *
179
- * @SuppressWarnings(PHPMD.UnusedLocalVariable)
180
- */
181
- public static function create_setting( $args = array() ) {
182
- extract( $args );
183
-
184
- if ( preg_match( '#(_expand_begin|_expand_end)#', $id ) ) {
185
- return;
186
- }
187
-
188
- $field_args = array(
189
- 'choices' => $choices,
190
- 'class' => $class,
191
- 'desc' => $desc,
192
- 'id' => $id,
193
- 'label_for' => $id,
194
- 'show_code' => $show_code,
195
- 'std' => $std,
196
- 'suggest' => $suggest,
197
- 'type' => $type,
198
- );
199
-
200
- static::$defaults[ $id ] = $std;
201
-
202
- add_settings_field( $id, $title, array( static::$class, 'display_setting' ), static::ID, $section, $field_args );
203
- }
204
-
205
-
206
- public static function section_scripts() {
207
- echo '
208
- <script type="text/javascript">
209
- jQuery(document).ready(function($) {
210
- $( "#' . static::ID . '" ).tabs();
211
- // This will make the "warning" checkbox class really stand out when checked.
212
- $(".warning").change(function() {
213
- if ($(this).is(":checked"))
214
- $(this).parent().css("background", "#c00").css("color", "#fff").css("fontWeight", "bold");
215
- else
216
- $(this).parent().css("background", "inherit").css("color", "inherit").css("fontWeight", "inherit");
217
- });
218
- });
219
- </script>
220
- ';
221
- }
222
-
223
-
224
- public static function do_settings_sections( $page ) {
225
- global $wp_settings_sections, $wp_settings_fields;
226
-
227
- if ( ! isset( $wp_settings_sections ) || ! isset( $wp_settings_sections[ $page ] ) ) {
228
- return;
229
- }
230
-
231
- foreach ( (array) $wp_settings_sections[ $page ] as $section ) {
232
- if ( $section['callback'] ) {
233
- call_user_func( $section['callback'], $section );
234
- }
235
-
236
- if ( ! isset( $wp_settings_fields ) || ! isset( $wp_settings_fields[ $page ] ) || ! isset( $wp_settings_fields[ $page ][ $section['id'] ] ) ) {
237
- continue;
238
- }
239
-
240
- echo '<table id=' . $section['id'] . ' class="form-table">';
241
- do_settings_fields( $page, $section['id'] );
242
- echo '</table>';
243
- }
244
- }
245
-
246
-
247
- public static function display_section() {}
248
-
249
-
250
- public static function display_about() {
251
- $name = str_replace( ' Settings', '', static::NAME );
252
- $text = __( '<img class="alignright size-medium" src="%1$simages/michael-cannon-red-square-300x2251.jpg" alt="Michael in Red Square, Moscow, Russia" width="300" height="225" /><a href="%2$s">%3$s</a> is by <a href="%4$s">Michael Cannon</a>. He\'s <a href="%5$s">Peichi’s</a> smiling man, an adventurous <a href="%6$s" target="_blank">water-rat</a>, <a href="%7$s">chief people officer</a>, <a href="%8$s">cyclist</a>, <a href="%9$s">full stack developer</a>, <a href="%10$s">poet</a>, <a href="%11$s">WWOOF’er</a> and <a href="%12$s">world traveler</a>.' );
253
-
254
- echo '<div id="about" style="width: 70%; min-height: 225px;"><p>';
255
- echo sprintf(
256
- $text,
257
- static::$plugin_assets,
258
- esc_url( static::$plugin_url ),
259
- $name,
260
- esc_url( 'http://aihr.us/resume/' ),
261
- esc_url( 'http://peimic.com/t/peichi-liu/' ),
262
- esc_url( 'http://www.chinesehoroscope.org/chinese_zodiac/rat/' ),
263
- esc_url( 'http://axelerant.com/who-we-are' ),
264
- esc_url( 'http://peimic.com/c/biking/' ),
265
- esc_url( 'http://aihr.us/about-aihrus/' ),
266
- esc_url( 'http://peimic.com/t/poetry/' ),
267
- esc_url( 'http://peimic.com/t/WWOOF/' ),
268
- esc_url( 'http://peimic.com/c/travel/' )
269
- );
270
- echo '</p></div>';
271
- }
272
-
273
-
274
- public static function display_page( $disable_donate = false ) {
275
- echo '<div class="wrap">
276
- <div class="icon32" id="icon-options-general"></div>
277
- <h2>' . static::NAME . '</h2>';
278
-
279
- echo '<form action="options.php" method="post">';
280
-
281
- settings_errors( static::ID );
282
- settings_fields( static::ID );
283
-
284
- echo '<div id="' . static::ID . '">
285
- <ul>';
286
-
287
- foreach ( static::$sections as $section_slug => $section ) {
288
- echo '<li><a href="#' . $section_slug . '">' . $section . '</a></li>';
289
- }
290
-
291
- echo '</ul>';
292
-
293
- self::do_settings_sections( static::ID );
294
-
295
- echo '
296
- <p class="submit"><input name="Submit" type="submit" class="button-primary" value="' . esc_html__( 'Save Changes' ) . '" /></p>
297
- </form>
298
- </div>
299
- ';
300
-
301
- if ( ! $disable_donate ) {
302
- echo '<p>' .
303
- sprintf(
304
- __( 'If you like this plugin, please <a href="%1$s" title="Donate for Good Karma"><img src="%2$s" border="0" alt="Donate for Good Karma" /></a> or <a href="%3$s" title="purchase premium WordPress plugins from Aihrus ">purchase the Premium version</a> to help fund further development and <a href="%4$s" title="Support forums">support</a>.' ),
305
- esc_url( 'http://aihr.us/about-aihrus/donate/' ),
306
- esc_url( 'https://www.paypalobjects.com/en_US/i/btn/btn_donate_SM.gif' ),
307
- esc_url( 'http://aihr.us/store/' ),
308
- esc_url( 'https://aihrus.zendesk.com/home' )
309
- ) .
310
- '</p>';
311
- }
312
-
313
- echo '<p class="copyright">' .
314
- sprintf(
315
- __( 'Copyright &copy;%1$s <a href="%2$s">Aihrus</a>.' ),
316
- date( 'Y' ),
317
- esc_url( 'http://aihr.us' )
318
- ) .
319
- '</p>';
320
-
321
- echo '</div>';
322
-
323
- add_action( 'admin_footer', array( static::$class, 'section_scripts' ) );
324
- }
325
-
326
-
327
- /**
328
- *
329
- *
330
- * @SuppressWarnings(PHPMD.UnusedLocalVariable)
331
- */
332
- public static function display_setting( $args = array(), $do_echo = true, $input = null ) {
333
- $content = '';
334
-
335
- extract( $args );
336
-
337
- $maxlength = ! empty( $maxlength ) ? 'maxlength="' . $maxlength . '"' : null;
338
- $placeholder = ! empty( $placeholder ) ? $placeholder : $std;
339
-
340
- if ( is_null( $input ) ) {
341
- $options = get_option( static::ID );
342
- } else {
343
- $options = array();
344
- $options[ $id ] = $input;
345
- }
346
-
347
- if ( ! isset( $options[ $id ] ) && $type != 'checkbox' ) {
348
- $options[ $id ] = $std;
349
- } elseif ( ! isset( $options[ $id ] ) ) {
350
- $options[ $id ] = 0;
351
- }
352
-
353
- $field_class = '';
354
- if ( ! empty( $class ) ) {
355
- $field_class = ' ' . $class;
356
- }
357
-
358
- // desc isn't escaped because it's might contain allowed html
359
- $choices = array_map( 'esc_attr', $choices );
360
- $field_class = esc_attr( $field_class );
361
- $id = esc_attr( $id );
362
- $field_value = esc_attr( $options[ $id ] );
363
- $std = esc_attr( $std );
364
-
365
- switch ( $type ) {
366
- case 'checkbox':
367
- $content .= '<input class="checkbox' . $field_class . '" type="checkbox" id="' . $id . '" name="' . static::ID . '[' . $id . ']" value="1" ' . checked( $field_value, 1, false ) . ' /> ';
368
-
369
- if ( ! empty( $desc ) ) {
370
- $content .= '<label for="' . $id . '"><span class="description">' . $desc . '</span></label>';
371
- }
372
- break;
373
-
374
- case 'file':
375
- $content .= '<input class="regular-text' . $field_class . '" type="file" id="' . $id . '" name="' . static::ID . '[' . $id . ']" />';
376
-
377
- if ( ! empty( $desc ) ) {
378
- $content .= '<br /><span class="description">' . $desc . '</span>';
379
- }
380
-
381
- break;
382
-
383
- case 'heading':
384
- $content .= '</td></tr><tr valign="top"><td colspan="2"><h3>' . $desc . '</h3>';
385
- break;
386
-
387
- case 'hidden':
388
- $content .= '<input type="hidden" id="' . $id . '" name="' . static::ID . '[' . $id . ']" value="' . $field_value . '" />';
389
-
390
- break;
391
-
392
- case 'password':
393
- $content .= '<input class="regular-text' . $field_class . '" type="password" id="' . $id . '" name="' . static::ID . '[' . $id . ']" value="' . $field_value . '" />';
394
-
395
- if ( ! empty( $desc ) ) {
396
- $content .= '<br /><span class="description">' . $desc . '</span>';
397
- }
398
-
399
- break;
400
-
401
- case 'radio':
402
- $i = 1;
403
- $count_choices = count( $choices );
404
- foreach ( $choices as $value => $label ) {
405
- $content .= '<input class="radio' . $field_class . '" type="radio" name="' . static::ID . '[' . $id . ']" id="' . $id . $i . '" value="' . $value . '" ' . checked( $field_value, $value, false ) . '> <label for="' . $id . $i . '">' . $label . '</label>';
406
-
407
- if ( $i < $count_choices ) {
408
- $content .= '<br />';
409
- }
410
-
411
- $i++;
412
- }
413
-
414
- if ( ! empty( $desc ) ) {
415
- $content .= '<br /><span class="description">' . $desc . '</span>';
416
- }
417
- break;
418
-
419
- case 'readonly':
420
- $content .= '<input class="regular-text' . $field_class . '" type="text" id="' . $id . '" name="' . static::ID . '[' . $id . ']" value="' . $field_value . '" readonly="readonly" />';
421
-
422
- if ( ! empty( $desc ) ) {
423
- $content .= '<br /><span class="description">' . $desc . '</span>';
424
- }
425
- break;
426
-
427
- case 'rich_editor':
428
- $field_value = $options[ $id ];
429
-
430
- ob_start();
431
- wp_editor( $field_value, static::ID . '[' . $id . ']', array( 'textarea_name' => static::ID . '[' . $id . ']' ) );
432
- $content = ob_get_clean();
433
-
434
- if ( ! empty( $desc ) ) {
435
- $content .= '<br /><span class="description">' . $desc . '</span>';
436
- }
437
- break;
438
-
439
- case 'select':
440
- $content .= '<select class="select' . $field_class . '" id="' . $id . '" name="' . static::ID . '[' . $id . ']">';
441
-
442
- foreach ( $choices as $value => $label ) {
443
- $content .= '<option value="' . $value . '"' . selected( $field_value, $value, false ) . '>' . $label . '</option>';
444
- }
445
-
446
- $content .= '</select>';
447
-
448
- if ( ! empty( $desc ) ) {
449
- $content .= '<br /><span class="description">' . $desc . '</span>';
450
- }
451
- break;
452
-
453
- case 'text':
454
- $suggest_id = 'suggest_' . self::$suggest_id++;
455
- $content .= '<input class="regular-text' . $field_class . ' ' . $suggest_id . '" type="text" id="' . $id . '" name="' . static::ID . '[' . $id . ']" placeholder="' . $placeholder . '" value="' . $field_value . '" ' . $maxlength . ' />';
456
-
457
- if ( ! empty( $suggest ) ) {
458
- $content .= static::get_suggest( $id, $suggest_id );
459
- }
460
-
461
- if ( ! empty( $desc ) ) {
462
- $content .= '<br /><span class="description">' . $desc . '</span>';
463
- }
464
- break;
465
-
466
- case 'textarea':
467
- $content .= '<textarea class="' . $field_class . '" id="' . $id . '" name="' . static::ID . '[' . $id . ']" placeholder="' . $placeholder . '" ' . $maxlength . ' rows="5" cols="30">' . $field_value . '</textarea>';
468
-
469
- if ( ! empty( $desc ) ) {
470
- $content .= '<br /><span class="description">' . $desc . '</span>';
471
- }
472
- break;
473
-
474
- case 'content':
475
- $content .= $desc . '</td></tr>';
476
- break;
477
-
478
- default:
479
- break;
480
- }
481
-
482
- if ( ! $do_echo ) {
483
- return $content;
484
- }
485
-
486
- echo $content;
487
- }
488
-
489
-
490
- public static function register_settings() {
491
- register_setting( static::ID, static::ID, array( static::$class, 'validate_settings' ) );
492
-
493
- foreach ( static::$sections as $slug => $title ) {
494
- if ( $slug == 'about' ) {
495
- add_settings_section( $slug, $title, array( static::$class, 'display_about' ), static::ID );
496
- } else {
497
- add_settings_section( $slug, $title, array( static::$class, 'display_section' ), static::ID );
498
- }
499
- }
500
-
501
- foreach ( static::$settings as $id => $setting ) {
502
- $setting['id'] = $id;
503
- static::create_setting( $setting );
504
- }
505
- }
506
-
507
-
508
- public static function scripts() {
509
- wp_enqueue_script( 'jquery-ui-tabs' );
510
- }
511
-
512
-
513
- public static function styles() {
514
- wp_register_style( 'jquery-style', '//ajax.googleapis.com/ajax/libs/jqueryui/1.8.2/themes/smoothness/jquery-ui.css' );
515
- wp_enqueue_style( 'jquery-style' );
516
- }
517
-
518
-
519
- /**
520
- *
521
- *
522
- * @SuppressWarnings(PHPMD.Superglobals)
523
- */
524
- public static function validate_settings( $input, $options = null, $do_errors = false ) {
525
- $null_options = false;
526
- if ( is_null( $options ) ) {
527
- $null_options = true;
528
-
529
- $defaults = static::get_defaults();
530
- $options = self::get_settings();
531
-
532
- if ( is_admin() ) {
533
- if ( ! empty( $input['reset_defaults'] ) ) {
534
- foreach ( $defaults as $id => $std ) {
535
- $input[ $id ] = $std;
536
- }
537
-
538
- unset( $input['reset_defaults'] );
539
-
540
- $input['resetted'] = true;
541
- }
542
-
543
- if ( ! empty( $input['import'] ) && $_SESSION['export'] != $input['import'] ) {
544
- $import = $input['import'];
545
- $unserialized = unserialize( $import );
546
- if ( is_array( $unserialized ) ) {
547
- foreach ( $unserialized as $id => $std ) {
548
- $input[ $id ] = $std;
549
- }
550
- }
551
- }
552
- }
553
- }
554
-
555
- return self::do_validate_settings( $input, $options, $do_errors, $null_options );
556
- }
557
-
558
-
559
- /**
560
- *
561
- *
562
- * @SuppressWarnings(PHPMD.Superglobals)
563
- */
564
- public static function do_validate_settings( $input, $options = null, $do_errors = false, $null_options = true ) {
565
- $errors = array();
566
-
567
- foreach ( $options as $id => $parts ) {
568
- $default = $parts['std'];
569
- $type = $parts['type'];
570
- $validations = ! empty( $parts['validate'] ) ? $parts['validate'] : array();
571
- if ( ! empty( $validations ) ) {
572
- $validations = explode( ',', $validations );
573
- }
574
-
575
- if ( ! isset( $input[ $id ] ) ) {
576
- if ( 'checkbox' != $type ) {
577
- $input[ $id ] = $default;
578
- } else {
579
- $input[ $id ] = 0;
580
- }
581
- }
582
-
583
- if ( $default == $input[ $id ] && ! in_array( 'required', $validations ) ) {
584
- continue;
585
- }
586
-
587
- if ( 'checkbox' == $type ) {
588
- if ( self::is_true( $input[ $id ] ) ) {
589
- $input[ $id ] = 1;
590
- } else {
591
- $input[ $id ] = 0;
592
- }
593
- } elseif ( in_array( $type, array( 'radio', 'select' ) ) ) {
594
- // single choices only
595
- $keys = array_keys( $parts['choices'] );
596
-
597
- if ( ! in_array( $input[ $id ], $keys ) ) {
598
- if ( self::is_true( $input[ $id ] ) ) {
599
- $input[ $id ] = 1;
600
- } else {
601
- $input[ $id ] = 0;
602
- }
603
- }
604
- }
605
-
606
- if ( ! empty( $validations ) ) {
607
- foreach ( $validations as $validate ) {
608
- self::validators( $validate, $id, $input, $default, $errors );
609
- }
610
- }
611
- }
612
-
613
- unset( $input['export'] );
614
- unset( $input['import'] );
615
-
616
- $hide_update_notice = false;
617
- if ( isset( static::$hide_update_notice ) && ! empty( static::$hide_update_notice ) ) {
618
- $hide_update_notice = true;
619
- }
620
-
621
- if ( $null_options && empty( $errors ) && ! $hide_update_notice && ! empty( $_REQUEST['option_page'] ) ) {
622
- add_settings_error( static::ID, 'settings_updated', esc_html__( 'Settings saved.' ), 'updated' );
623
-
624
- if ( empty( self::$settings_saved ) ) {
625
- self::$settings_saved = true;
626
- set_transient( 'settings_errors', get_settings_errors(), 30 );
627
- }
628
- }
629
-
630
- if ( empty( $do_errors ) ) {
631
- $validated = $input;
632
- } else {
633
- $validated = array(
634
- 'input' => $input,
635
- 'errors' => $errors,
636
- );
637
- }
638
-
639
- return $validated;
640
- }
641
-
642
-
643
- public static function validators( $validate, $id, &$input, $default, &$errors ) {
644
- switch ( $validate ) {
645
- case 'absint':
646
- case 'intval':
647
- if ( '' !== $input[ $id ] ) {
648
- $input[ $id ] = $validate( $input[ $id ] );
649
- } else {
650
- $input[ $id ] = $default;
651
- }
652
- break;
653
-
654
- case 'email':
655
- $input[ $id ] = self::validate_email( $input[ $id ], $default );
656
- break;
657
-
658
- case 'ids':
659
- $input[ $id ] = self::validate_ids( $input[ $id ], $default );
660
- break;
661
-
662
- case 'is_true':
663
- $input[ $id ] = self::is_true( $input[ $id ] );
664
- break;
665
-
666
- case 'min1':
667
- $input[ $id ] = intval( $input[ $id ] );
668
- if ( 0 >= $input[ $id ] ) {
669
- $input[ $id ] = $default;
670
- }
671
- break;
672
-
673
- case 'nozero':
674
- $input[ $id ] = intval( $input[ $id ] );
675
- if ( 0 === $input[ $id ] ) {
676
- $input[ $id ] = $default;
677
- }
678
- break;
679
-
680
- case 'order':
681
- $input[ $id ] = self::validate_order( $input[ $id ], $default );
682
- break;
683
-
684
- case 'required':
685
- if ( empty( $input[ $id ] ) ) {
686
- $errors[ $id ] = esc_html__( 'Required' );
687
- }
688
- break;
689
-
690
- case 'slash_sanitize_title':
691
- $temp = explode( '/', $input[ $id ] );
692
- $temp = array_map( 'sanitize_title', $temp );
693
- $temp = implode( '/', $temp );
694
-
695
- $input[ $id ] = $temp;
696
- break;
697
-
698
- case 'slug':
699
- $input[ $id ] = self::validate_slug( $input[ $id ], $default );
700
- $input[ $id ] = strtolower( $input[ $id ] );
701
- break;
702
-
703
- case 'slugs':
704
- $input[ $id ] = self::validate_slugs( $input[ $id ], $default );
705
- $input[ $id ] = strtolower( $input[ $id ] );
706
- break;
707
-
708
- case 'term':
709
- $input[ $id ] = self::validate_term( $input[ $id ], $default );
710
- $input[ $id ] = strtolower( $input[ $id ] );
711
- break;
712
-
713
- case 'terms':
714
- $input[ $id ] = self::validate_terms( $input[ $id ], $default );
715
- break;
716
-
717
- case 'trim':
718
- $options = explode( "\n", $input[ $id ] );
719
- foreach ( $options as $key => $value ) {
720
- $options[ $key ] = trim( $value );
721
- }
722
-
723
- $input[ $id ] = implode( "\n", $options );
724
- break;
725
-
726
- case 'url':
727
- $input[ $id ] = self::validate_url( $input[ $id ], $default );
728
- break;
729
-
730
- default:
731
- $input[ $id ] = $validate( $input[ $id ] );
732
- break;
733
- }
734
- }
735
-
736
-
737
- public static function validate_ids( $input, $default = false ) {
738
- if ( preg_match( '#^\d+(,\s?\d+)*$#', $input ) ) {
739
- return preg_replace( '#\s#', '', $input );
740
- }
741
-
742
- return $default;
743
- }
744
-
745
-
746
- public static function validate_order( $input, $default = false ) {
747
- if ( preg_match( '#^desc|asc$#i', $input ) ) {
748
- return $input;
749
- }
750
-
751
- return $default;
752
- }
753
-
754
-
755
- public static function validate_slugs( $input, $default = false ) {
756
- if ( preg_match( '#^[\w-]+(,\s?[\w-]+)*$#', $input ) ) {
757
- return preg_replace( '#\s#', '', $input );
758
- }
759
-
760
- return $default;
761
- }
762
-
763
-
764
- public static function validate_slug( $input, $default = false ) {
765
- if ( preg_match( '#^[\w-]+$#', $input ) ) {
766
- return $input;
767
- }
768
-
769
- return $default;
770
- }
771
-
772
-
773
- public static function validate_term( $input, $default = false ) {
774
- if ( preg_match( '#^\w+$#', $input ) ) {
775
- return $input;
776
- }
777
-
778
- return $default;
779
- }
780
-
781
-
782
- /**
783
- * Let values like true, 'true', 1, 'on', and 'yes' to be true. Else, false
784
- */
785
- public static function is_true( $value = null, $return_boolean = true ) {
786
- if ( true === $value || 'true' == strtolower( $value ) || 1 == $value || 'on' == strtolower( $value ) || 'yes' == strtolower( $value ) ) {
787
- if ( $return_boolean ) {
788
- return true;
789
- } else {
790
- return 1;
791
- }
792
- } else {
793
- if ( $return_boolean ) {
794
- return false;
795
- } else {
796
- return 0;
797
- }
798
- }
799
- }
800
-
801
-
802
- public static function validate_email( $input, $default = false ) {
803
- if ( filter_var( $input, FILTER_VALIDATE_EMAIL ) ) {
804
- return $input;
805
- }
806
-
807
- return $default;
808
- }
809
-
810
-
811
- public static function validate_terms( $input, $default = false ) {
812
- if ( preg_match( '#^(([\w- ]+)(,\s?)?)+$#', $input ) ) {
813
- return preg_replace( '#,\s*$#', '', $input );
814
- }
815
-
816
- return $default;
817
- }
818
-
819
-
820
- public static function validate_url( $input, $default = false ) {
821
- if ( filter_var( $input, FILTER_VALIDATE_URL ) ) {
822
- return $input;
823
- }
824
-
825
- return $default;
826
- }
827
-
828
-
829
- public static function get_scripts() {
830
- foreach ( static::$scripts as $script ) {
831
- echo $script;
832
- }
833
- }
834
-
835
-
836
- public static function get_styles() {
837
- foreach ( static::$styles as $style ) {
838
- echo $style;
839
- }
840
- }
841
-
842
-
843
- /**
844
- * Let values like false, 'false', 0, 'off', and 'no' to be true. Else, false
845
- */
846
- public static function is_false( $value = null, $return_boolean = false ) {
847
- if ( false === $value || 'false' == strtolower( $value ) || 0 == $value || 'off' == strtolower( $value ) || 'no' == strtolower( $value ) ) {
848
- if ( $return_boolean ) {
849
- return true;
850
- } else {
851
- return 1;
852
- }
853
- } else {
854
- if ( $return_boolean ) {
855
- return false;
856
- } else {
857
- return 0;
858
- }
859
- }
860
- }
861
-
862
-
863
- public static function get_suggest( $id, $suggest_id ) {
864
- wp_enqueue_script( 'suggest' );
865
-
866
- switch ( $id ) {
867
- case 'category':
868
- $taxonomy = 'category';
869
- break;
870
-
871
- case 'tags':
872
- $taxonomy = 'post_tag';
873
- break;
874
- }
875
-
876
- $ajax_url = site_url() . '/wp-admin/admin-ajax.php';
877
- $suggest_js = "suggest( '{$ajax_url}?action=ajax-tag-search&tax={$taxonomy}', { delay: 500, minchars: 2, multiple: true, multipleSep: ', ' } )";
878
-
879
- $scripts = <<<EOD
880
- <script type="text/javascript">
881
- jQuery(document).ready( function() {
882
- jQuery( '.{$suggest_id}' ).{$suggest_js};
883
- });
884
- </script>
885
- EOD;
886
-
887
- return $scripts;
888
- }
889
-
890
-
891
- public static function get_sections() {
892
- if ( empty( static::$sections ) ) {
893
- static::sections();
894
- }
895
-
896
- return static::$sections;
897
- }
898
-
899
-
900
- }
901
-
902
-
903
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/includes/libraries/aihrus-framework/includes/class-aihrus-widget.php DELETED
@@ -1,363 +0,0 @@
1
- <?php
2
- /**
3
- * Aihrus Framework
4
- * Copyright (C) 2014 Michael Cannon
5
- * This program is free software; you can redistribute it and/or modify
6
- * it under the terms of the GNU General Public License as published by
7
- * the Free Software Foundation; either version 2 of the License, or
8
- * (at your option) any later version.
9
- * This program is distributed in the hope that it will be useful,
10
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
11
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
- * GNU General Public License for more details.
13
- * You should have received a copy of the GNU General Public License along
14
- * with this program; if not, write to the Free Software Foundation, Inc.,
15
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
16
- */
17
-
18
-
19
- if ( class_exists( 'Aihrus_Widget' ) ) {
20
- return;
21
- }
22
-
23
-
24
- abstract class Aihrus_Widget extends WP_Widget {
25
- public static $default = array(
26
- 'choices' => array(), // key => value
27
- 'class' => null, // warning, etc.
28
- 'desc' => null,
29
- 'id' => null,
30
- 'std' => null, // default key or value
31
- 'suggest' => false, // attempt for auto-suggest on inputs
32
- 'title' => null,
33
- 'type' => 'text', // textarea, checkbox, radio, select, hidden, heading, password, expand_begin, expand_end
34
- 'validate' => null, // required, term, slug, slugs, ids, order, single paramater PHP functions
35
- 'widget' => 1,
36
- );
37
-
38
- public static $settings_saved = false;
39
- public static $suggest_id = 0;
40
-
41
-
42
- public function __construct( $classname, $description, $id_base, $title ) {
43
- // Widget settings
44
- $widget_ops = array(
45
- 'classname' => $classname,
46
- 'description' => $description,
47
- );
48
-
49
- // Widget control settings
50
- $control_ops = array(
51
- 'id_base' => $id_base,
52
- );
53
-
54
- // Create the widget
55
- $this->WP_Widget(
56
- static::ID,
57
- $title,
58
- $widget_ops,
59
- $control_ops
60
- );
61
- }
62
-
63
-
64
- public function widget( $args, $instance ) {
65
- $args = wp_parse_args( $args, static::get_defaults() );
66
- extract( $args );
67
-
68
- // Before widget (defined by themes)
69
- echo $args['before_widget'];
70
-
71
- $title = apply_filters( 'widget_title', $instance['title'], null );
72
- if ( ! empty( $instance['title_link'] ) ) {
73
- $target = ! empty( $instance['target'] ) ? $instance['target'] : null;
74
- $title = Aihrus_Common::create_link( $instance['title_link'], $title, $target );
75
- }
76
-
77
- if ( ! empty( $title ) ) {
78
- echo $args['before_title'] . $title . $args['after_title'];
79
- }
80
-
81
- $content = static::get_content( $instance, $this->number );
82
- echo $content;
83
-
84
- // After widget (defined by themes)
85
- echo $args['after_widget'];
86
- }
87
-
88
-
89
- /**
90
- *
91
- *
92
- * @SuppressWarnings(PHPMD.UnusedFormalParameter)
93
- */
94
- public function update( $new_instance, $old_instance ) {
95
- $instance = static::validate_settings( $new_instance );
96
-
97
- return $instance;
98
- }
99
-
100
-
101
- public static function validate_settings( $input, $options = null, $do_errors = false ) {
102
- $null_options = false;
103
- if ( is_null( $options ) ) {
104
- $null_options = true;
105
-
106
- $defaults = static::get_defaults();
107
- $options = static::form_parts();
108
-
109
- if ( is_admin() ) {
110
- if ( ! empty( $input['reset_defaults'] ) ) {
111
- foreach ( $defaults as $id => $std ) {
112
- $input[ $id ] = $std;
113
- }
114
-
115
- unset( $input['reset_defaults'] );
116
-
117
- $input['resetted'] = true;
118
- }
119
- }
120
- }
121
-
122
- return Aihrus_Settings::do_validate_settings( $input, $options, $do_errors );
123
- }
124
-
125
-
126
- public function form( $instance ) {
127
- $instance = static::form_instance( $instance );
128
- $defaults = static::get_defaults();
129
- $instance = wp_parse_args( $instance, $defaults );
130
-
131
- $form_parts = static::form_parts( $instance, $this->number );
132
- foreach ( $form_parts as $key => $part ) {
133
- $part['id'] = $key;
134
- $this->display_setting( $part, $instance );
135
- }
136
- }
137
-
138
-
139
- /**
140
- *
141
- *
142
- * @SuppressWarnings(PHPMD.UnusedLocalVariable)
143
- */
144
- public function display_setting( $args = array(), $options ) {
145
- extract( $args );
146
-
147
- if ( empty( $widget ) ) {
148
- echo '<div style="display:none;">';
149
- }
150
-
151
- $do_return = false;
152
- switch ( $type ) {
153
- case 'heading':
154
- if ( ! empty( $desc ) ) {
155
- echo '<h3>' . $desc . '</h3>';
156
- }
157
-
158
- $do_return = true;
159
- break;
160
-
161
- case 'expand_all':
162
- if ( ! empty( $desc ) ) {
163
- echo '<h3>' . $desc . '</h3>';
164
- }
165
-
166
- echo '<a id="' . $this->get_field_id( $id ) . '-expand" style="cursor:pointer;" onclick="jQuery( \'.af-collapsible-control\' ).slideToggle(); jQuery( \'.af-collapsible\' ).slideToggle(); jQuery( this ).hide(); jQuery( \'#' . $this->get_field_id( $id ) . '-collapse\' ).show();">&raquo; ' . esc_html__( 'Expand All Options' ) . '</a>';
167
- echo '<a id="' . $this->get_field_id( $id ) . '-collapse" style="cursor:pointer; display: none;" onclick="jQuery( \'.af-collapsible-control\' ).slideToggle(); jQuery( \'.af-collapsible\' ).slideToggle(); jQuery( this ).hide(); jQuery( \'#' . $this->get_field_id( $id ) . '-expand\' ).show();">&laquo; ' . esc_html__( 'Collapse All Options' ) . '</a>';
168
-
169
- $do_return = true;
170
- break;
171
-
172
- case 'expand_begin':
173
- if ( ! empty( $desc ) ) {
174
- echo '<h3>' . $desc . '</h3>';
175
- }
176
-
177
- echo '<span class="af-collapsible-control">';
178
- echo '<a id="' . $this->get_field_id( $id ) . '-expand" style="cursor:pointer;" onclick="jQuery( \'div#' . $this->get_field_id( $id ) . '\' ).slideToggle(); jQuery( this ).hide(); jQuery( \'#' . $this->get_field_id( $id ) . '-collapse\' ).show();">&raquo; ' . esc_html__( 'Expand' ) . '</a>';
179
- echo '<a id="' . $this->get_field_id( $id ) . '-collapse" style="cursor:pointer; display: none;" onclick="jQuery( \'div#' . $this->get_field_id( $id ) . '\' ).slideToggle(); jQuery( this ).hide(); jQuery( \'#' . $this->get_field_id( $id ) . '-expand\' ).show();">&laquo; ' . esc_html__( 'Collapse' ) . '</a>';
180
- echo '</span>';
181
- echo '<div id="' . $this->get_field_id( $id ) . '" style="display:none" class="af-collapsible">';
182
-
183
- $do_return = true;
184
- break;
185
-
186
- case 'expand_end':
187
- echo '</div>';
188
-
189
- $do_return = true;
190
- break;
191
-
192
- default:
193
- break;
194
- }
195
-
196
- if ( $do_return ) {
197
- if ( empty( $widget ) ) {
198
- echo '</div>';
199
- }
200
-
201
- return;
202
- }
203
-
204
- if ( ! isset( $options[ $id ] ) && $type != 'checkbox' ) {
205
- $options[ $id ] = $std;
206
- } elseif ( ! isset( $options[ $id ] ) ) {
207
- $options[ $id ] = 0;
208
- }
209
-
210
- $field_class = '';
211
- if ( ! empty( $class ) ) {
212
- $field_class = ' ' . $class;
213
- }
214
-
215
- echo '<p>';
216
-
217
- switch ( $type ) {
218
- case 'checkbox':
219
- echo '<input class="checkbox' . $field_class . '" type="checkbox" id="' . $this->get_field_id( $id ) . '" name="' . $this->get_field_name( $id ) . '" value="1" ' . checked( $options[ $id ], 1, false ) . ' /> ';
220
-
221
- echo '<label for="' . $this->get_field_id( $id ) . '">' . $title . '</label>';
222
- break;
223
-
224
- case 'select':
225
- echo '<label for="' . $this->get_field_id( $id ) . '">' . $title . '</label>';
226
- echo '<select id="' . $this->get_field_id( $id ) . '"class="select' . $field_class . '" name="' . $this->get_field_name( $id ) . '">';
227
-
228
- foreach ( $choices as $value => $label ) {
229
- echo '<option value="' . esc_attr( $value ) . '"' . selected( $options[ $id ], $value, false ) . '>' . $label . '</option>';
230
- }
231
-
232
- echo '</select>';
233
- break;
234
-
235
- case 'radio':
236
- $i = 0;
237
- $count_options = count( $options ) - 1;
238
-
239
- foreach ( $choices as $value => $label ) {
240
- echo '<input class="radio' . $field_class . '" type="radio" name="' . $this->get_field_name( $id ) . '" id="' . $this->get_field_name( $id . $i ) . '" value="' . esc_attr( $value ) . '" ' . checked( $options[ $id ], $value, false ) . '> <label for="' . $this->get_field_name( $id . $i ) . '">' . $label . '</label>';
241
- if ( $i < $count_options ) {
242
- echo '<br />';
243
- }
244
-
245
- $i++;
246
- }
247
-
248
- echo '<label for="' . $this->get_field_id( $id ) . '">' . $title . '</label>';
249
- break;
250
-
251
- case 'textarea':
252
- echo '<label for="' . $this->get_field_id( $id ) . '">' . $title . '</label>';
253
-
254
- echo '<textarea class="widefat' . $field_class . '" id="' . $this->get_field_id( $id ) . '" name="' . $this->get_field_name( $id ) . '" placeholder="' . $std . '" rows="5" cols="30">' . wp_htmledit_pre( $options[ $id ] ) . '</textarea>';
255
- break;
256
-
257
- case 'password':
258
- echo '<label for="' . $this->get_field_id( $id ) . '">' . $title . '</label>';
259
-
260
- echo '<input class="widefat' . $field_class . '" type="password" id="' . $this->get_field_id( $id ) . '" name="' . $this->get_field_name( $id ) . '" value="' . esc_attr( $options[ $id ] ) . '" />';
261
- break;
262
-
263
- case 'readonly':
264
- echo '<label for="' . $this->get_field_id( $id ) . '">' . $title . '</label>';
265
-
266
- echo '<input class="widefat' . $field_class . '" type="text" id="' . $this->get_field_id( $id ) . '" name="' . $this->get_field_name( $id ) . '" value="' . esc_attr( $options[ $id ] ) . '" readonly="readonly" />';
267
- break;
268
-
269
- case 'text':
270
- echo '<label for="' . $this->get_field_id( $id ) . '">' . $title . '</label>';
271
-
272
- $suggest_id = 'suggest_' . self::$suggest_id++;
273
- echo '<input class="widefat' . $field_class . ' ' . $suggest_id . '" type="text" id="' . $this->get_field_id( $id ) . '" name="' . $this->get_field_name( $id ) . '" placeholder="' . $std . '" value="' . esc_attr( $options[ $id ] ) . '" />';
274
-
275
- if ( $suggest ) {
276
- echo static::get_suggest( $id, $suggest_id );
277
- }
278
- break;
279
-
280
- default:
281
- break;
282
- }
283
-
284
- if ( ! empty( $desc ) ) {
285
- echo '<br /><span class="setting-description"><small>' . $desc . '</small></span>';
286
- }
287
-
288
- echo '</p>';
289
-
290
- if ( empty( $widget ) ) {
291
- echo '</div>';
292
- }
293
- }
294
-
295
-
296
- /**
297
- *
298
- *
299
- * @SuppressWarnings(PHPMD.UnusedFormalParameter)
300
- */
301
- public static function get_suggest( $id, $suggest_id ) {
302
- return;
303
- }
304
-
305
-
306
- public static function form_instance( $instance ) {
307
- if ( empty( $instance ) ) {
308
- $instance = static::get_defaults();
309
- } elseif ( ! empty( $instance['resetted'] ) ) {
310
- $instance = static::get_defaults();
311
- }
312
-
313
- return $instance;
314
- }
315
-
316
-
317
- public static function get_defaults() {
318
- $defaults = array();
319
- $options = static::form_parts();
320
- foreach ( $options as $option => $value ) {
321
- $defaults[ $option ] = $value['std'];
322
- }
323
-
324
- return $defaults;
325
- }
326
-
327
-
328
- /**
329
- *
330
- *
331
- * @SuppressWarnings(PHPMD.UnusedFormalParameter)
332
- */
333
- public static function form_parts( $instance = null, $number = null ) {
334
- $form_parts = array(
335
- 'title' => array(
336
- 'title' => esc_html__( 'Title' ),
337
- 'validate' => 'wp_kses_post',
338
- ),
339
- 'title_link' => array(
340
- 'title' => esc_html__( 'Title Link' ),
341
- 'desc' => esc_html__( 'URL, path, or post ID to link widget title to. Ex: http://example.com/stuff, /testimonials, or 123' ),
342
- 'validate' => 'wp_kses_data',
343
- ),
344
- );
345
-
346
- return $form_parts;
347
- }
348
-
349
-
350
- /**
351
- *
352
- *
353
- * @SuppressWarnings(PHPMD.UnusedFormalParameter)
354
- */
355
- public static function get_content( $instance = null, $widget_number = null ) {
356
- return;
357
- }
358
-
359
-
360
- }
361
-
362
-
363
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/includes/libraries/aihrus-framework/includes/interface-aihrus-common.php DELETED
@@ -1,27 +0,0 @@
1
- <?php
2
- /*
3
- Copyright 2014 Michael Cannon (email: mc@aihr.us)
4
-
5
- This program is free software; you can redistribute it and/or modify
6
- it under the terms of the GNU General Public License, version 2, as
7
- published by the Free Software Foundation.
8
-
9
- This program is distributed in the hope that it will be useful,
10
- but WITHOUT ANY WARRANTY; without even the implied warranty of
11
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
- GNU General Public License for more details.
13
-
14
- You should have received a copy of the GNU General Public License
15
- along with this program; if not, write to the Free Software
16
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17
- */
18
-
19
- if ( class_exists( 'Aihrus_Common_Interface' ) )
20
- return;
21
-
22
-
23
- interface Aihrus_Common_Interface {
24
- }
25
-
26
-
27
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/includes/libraries/aihrus-framework/includes/interface-aihrus-licensing.php DELETED
@@ -1,28 +0,0 @@
1
- <?php
2
- /*
3
- Copyright 2014 Michael Cannon (email: mc@aihr.us)
4
-
5
- This program is free software; you can redistribute it and/or modify
6
- it under the terms of the GNU General Public License, version 2, as
7
- published by the Free Software Foundation.
8
-
9
- This program is distributed in the hope that it will be useful,
10
- but WITHOUT ANY WARRANTY; without even the implied warranty of
11
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
- GNU General Public License for more details.
13
-
14
- You should have received a copy of the GNU General Public License
15
- along with this program; if not, write to the Free Software
16
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17
- */
18
-
19
- if ( class_exists( 'Aihrus_Licensing_Interface' ) )
20
- return;
21
-
22
-
23
- interface Aihrus_Licensing_Interface {
24
- public function settings( $settings );
25
- }
26
-
27
-
28
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/includes/libraries/aihrus-framework/includes/interface-aihrus-widget.php DELETED
@@ -1,33 +0,0 @@
1
- <?php
2
- /*
3
- Copyright 2014 Michael Cannon (email: mc@aihr.us)
4
-
5
- This program is free software; you can redistribute it and/or modify
6
- it under the terms of the GNU General Public License, version 2, as
7
- published by the Free Software Foundation.
8
-
9
- This program is distributed in the hope that it will be useful,
10
- but WITHOUT ANY WARRANTY; without even the implied warranty of
11
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
- GNU General Public License for more details.
13
-
14
- You should have received a copy of the GNU General Public License
15
- along with this program; if not, write to the Free Software
16
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17
- */
18
-
19
- if ( class_exists( 'Aihrus_Widget_Interface' ) )
20
- return;
21
-
22
-
23
- interface Aihrus_Widget_Interface {
24
- public static function form_instance( $instance );
25
- public static function form_parts( $instance, $number );
26
- public static function get_content( $instance, $widget_number );
27
- public static function get_defaults();
28
- public static function get_suggest( $id, $suggest_id );
29
- public static function validate_settings( $instance );
30
- }
31
-
32
-
33
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/includes/libraries/aihrus-framework/includes/libraries/class-redrokk-metabox-class.php DELETED
@@ -1,1471 +0,0 @@
1
- <?php
2
- /**
3
- *
4
- *
5
- * @Author Anonymous
6
- * @link http://www.redrokk.com
7
- * @Package Wordpress
8
- * @SubPackage RedRokk Library
9
- *
10
- * @version 2.0
11
- */
12
-
13
-
14
- //security
15
- defined( 'ABSPATH' ) or die( 'You\'re not supposed to be here.' );
16
-
17
- /**
18
- *
19
- *
20
- * @author Anonymous
21
- * @example
22
- * $gallery = redrokk_metabox_class::getInstance('gallery');
23
- */
24
- if ( !class_exists( 'redrokk_metabox_class' ) ):
25
- class redrokk_metabox_class {
26
-
27
- /**
28
- * HTML 'id' attribute of the edit screen section
29
- *
30
- * @var string
31
- */
32
- var $_id;
33
-
34
- /**
35
- * Save the form fields here that will be displayed to the user
36
- *
37
- * @var array
38
- */
39
- var $_fields;
40
-
41
- /**
42
- * Title of the edit screen section, visible to user
43
- * Default: None
44
- *
45
- * @var string
46
- */
47
- var $title;
48
-
49
- /**
50
- * Function that prints out the HTML for the edit screen section. Pass
51
- * function name as a string. Within a class, you can instead pass an
52
- * array to call one of the class's methods. See the second example under
53
- * Example below.
54
- * Default: None
55
- *
56
- * @var callback
57
- */
58
- var $callback = null;
59
-
60
- /**
61
- * The part of the page where the edit screen section should be shown
62
- * ('normal', 'advanced', or 'side'). (Note that 'side' doesn't exist before 2.7)
63
- * Default: 'advanced'
64
- *
65
- * @var string
66
- */
67
- var $context = 'normal';
68
-
69
- /**
70
- * The priority within the context where the boxes should show
71
- * ('high', 'core', 'default' or 'low')
72
- * Default: 'default'
73
- *
74
- * @var string
75
- */
76
- var $priority = 'default';
77
-
78
- /**
79
- * Arguments to pass into your callback function. The callback will receive the
80
- * $post object and whatever parameters are passed through this variable.
81
- * Default: null
82
- *
83
- * @var array
84
- */
85
- var $callback_args;
86
-
87
- /**
88
- * Prebuilt metaboxes can be activated by using this type
89
- * Default: default
90
- *
91
- * (options:)
92
- * default
93
- * images
94
- *
95
- * @var string
96
- */
97
- var $_type;
98
-
99
- /**
100
- *
101
- *
102
- * @var unknown_type
103
- */
104
- var $_category_name;
105
-
106
- /**
107
- * The type of Write screen on which to show the edit screen section
108
- * ('post', 'page', 'link', or 'custom_post_type' where custom_post_type
109
- * is the custom post type slug)
110
- * Default: None
111
- *
112
- * @var array
113
- */
114
- var $_object_types = array();
115
-
116
- /**
117
- * Whether or not to make the fields available as wp-options
118
- *
119
- * @var bool
120
- */
121
- var $_isAdminPage = false;
122
-
123
-
124
- /**
125
- * Constructor.
126
- *
127
- */
128
- function __construct( $options = array() ) {
129
- //initializing
130
- $this->setProperties( $options );
131
- $this->setOptionHooks();
132
-
133
- if ( !$this->callback ) {
134
- $this->callback = array( $this, 'show' );
135
- }
136
- if ( !$this->title ) {
137
- $this->title = ucfirst( $this->_id );
138
- }
139
-
140
- //registering this metabox
141
- add_action( 'add_meta_boxes', array( $this, '_register' ) );
142
-
143
- // backwards compatible (before WP 3.0)
144
- // add_action( 'admin_init', array($this, '_register'), 1 );
145
-
146
- add_action( 'save_post', array( $this, '_save' ) );
147
- add_filter( 'wp_redirect', array( $this, '_redirectIntervention' ), 40, 1 );
148
- }
149
-
150
-
151
- /**
152
- * Method properly inturprets the given parameter and sets it accordingly
153
- *
154
- * @param string|object $value
155
- */
156
- function setObjectTypes( $value ) {
157
- if ( is_a( $value, 'redrokk_post_class' ) ) {
158
- $value = $value->_post_type;
159
- }
160
- if ( is_a( $value, 'redrokk_admin_class' ) ) {
161
- $value = $value->id;
162
- $this->_isAdminPage = $value;
163
- }
164
- if ( is_array( $value ) ) {
165
- foreach ( $value as $v )
166
- $this->_object_types[] = $v;
167
- return $this;
168
- }
169
-
170
- $this->_object_types[] = $value;
171
- return $this;
172
- }
173
-
174
-
175
- /**
176
- * Method is designed to return the currently visible post type
177
- */
178
- function getCurrentPostType() {
179
- $post_type = false;
180
- if ( isset( $_REQUEST['post_type'] ) ) {
181
- $post_type = $_REQUEST['post_type'];
182
- }
183
- elseif ( isset( $_REQUEST['post'] ) ) {
184
- $post = get_post( $_REQUEST['post'] );
185
- $post_type = $post->post_type;
186
- }
187
- elseif ( isset( $_REQUEST['page'] ) ) {
188
- $post_type = $_REQUEST['page'];
189
- }
190
-
191
- return $post_type;
192
- }
193
-
194
-
195
- /**
196
- * Method properly prepares the metabox type by binding the necessary hooks
197
- *
198
- * @param mixed $value
199
- */
200
- function settype( $value = 'default' ) {
201
- $this->_type = $value;
202
-
203
- switch ( $this->_type ) {
204
- default:
205
- case 'default':
206
- add_action( 'metabox-show-'.$this->_id, array( $this, '_renderForm' ), 20, 1 );
207
- add_action( 'metabox-save-'.$this->_id, array( $this, 'saveAsPostMeta' ), 10, 2 );
208
- break;
209
- case 'image':
210
- case 'images':
211
- $this->_fields = array(
212
- array(
213
- 'name' => 'New Image',
214
- 'type' => 'title',
215
- ),
216
- array(
217
- 'name' => 'Image Title',
218
- 'id' => $this->_id.'_post_title',
219
- 'type' => 'text',
220
- ),
221
- array(
222
- 'name' => 'Description',
223
- 'id' => $this->_id.'_post_content',
224
- 'type' => 'textarea',
225
- ),
226
- array(
227
- 'name' => 'Image File',
228
- 'id' => $this->_id.'_image',
229
- 'type' => 'image',
230
- ),
231
- array(
232
- 'name' => 'Save Image',
233
- 'type' => 'submit',
234
- ),
235
- );
236
- add_action( 'metabox-show-'.$this->_id, array( $this, '_renderListImageAttachments' ), 20, 1 );
237
- add_action( 'metabox-show-'.$this->_id, array( $this, '_renderForm' ), 20, 1 );
238
- add_action( 'metabox-save-'.$this->_id, array( $this, 'saveAsAttachment' ), 1, 2 );
239
- break;
240
- case 'video':
241
- case 'videos':
242
- $this->_fields = array(
243
- array(
244
- 'name' => 'New Video',
245
- 'type' => 'title',
246
- ),
247
- array(
248
- 'name' => 'Video Title',
249
- 'id' => $this->_id.'_post_title',
250
- 'type' => 'text',
251
- ),
252
- array(
253
- 'name' => 'Description',
254
- 'id' => $this->_id.'_post_content',
255
- 'type' => 'textarea',
256
- ),
257
- array(
258
- 'name' => 'Video File',
259
- 'id' => $this->_id.'_image',
260
- 'type' => 'image',
261
- ),
262
- array(
263
- 'name' => 'Video Link',
264
- 'id' => $this->_id.'_link',
265
- 'type' => 'text',
266
- ),
267
- array(
268
- 'name' => '_videocat',
269
- 'id' => $this->_id.'_videocat',
270
- 'std'=> $this->getCategory(),
271
- 'type' => 'hidden',
272
- ),
273
- array(
274
- 'name' => '_metaid',
275
- 'id' => $this->_id.'_metaid',
276
- 'type' => 'hidden',
277
- ),
278
- array(
279
- 'name' => 'Save Video',
280
- 'type' => 'submit',
281
- ),
282
- );
283
- add_action( 'metabox-show-'.$this->_id, array( $this, '_renderListAttachments' ), 20, 1 );
284
- add_action( 'metabox-show-'.$this->_id, array( $this, '_renderListVideoAttachments' ), 20, 1 );
285
- add_action( 'metabox-show-'.$this->_id, array( $this, '_renderForm' ), 20, 1 );
286
- add_action( 'metabox-save-'.$this->_id, array( $this, 'saveAsPostMeta' ), 1, 2 );
287
- break;
288
- }
289
- }
290
-
291
-
292
- /**
293
- * Returns the category to use
294
- */
295
- function getCategory() {
296
- return isset( $this->_category_name )
297
- ? $this->_category_name
298
- : '_videocat';
299
- }
300
-
301
-
302
- /**
303
- * Method will save the posted content as an image attachment
304
- *
305
- */
306
- function saveAsAttachment( $source, $post_id ) {
307
- if ( empty( $_FILES ) || !isset( $_REQUEST[$this->_id.'files'] ) ) return $source;
308
-
309
- // initializing
310
- $property = $_REQUEST[$this->_id.'files'];
311
- $post_data = array();
312
-
313
- if ( isset( $source[$this->_id.'_post_title'] ) && $source[$this->_id.'_post_title'] ) {
314
- $post_data['post_title'] = $source[$this->_id.'_post_title'];
315
- }
316
-
317
- if ( isset( $source[$this->_id.'_post_content'] ) && $source[$this->_id.'_post_content'] ) {
318
- $post_data['post_content'] = $source[$this->_id.'_post_content'];
319
- }
320
-
321
- $id = media_handle_upload( $property, $post_id, $post_data );
322
- $source[$property] = $id;
323
-
324
- $type = 'post';
325
- if ( $this->getCurrentPostType() ) {
326
- $type = $this->getCurrentPostType();
327
- }
328
-
329
- //saving the attachment ID to the taxonomy
330
- if ( !in_array( $type, get_post_types( array( 'public' => false ) ) ) ) {
331
- $old = get_metadata( $type, $post_id, $property, true );
332
- if ( $id && $id != $old ) {
333
- wp_delete_attachment( $old, true );
334
- update_metadata( $type, $post_id, $property, $id );
335
- }
336
- }
337
-
338
- foreach ( (array)$source as $property => $new ) {
339
- //skip everything but the specially prefixed
340
- if ( strpos( $property, $this->_id ) !== 0 ) continue;
341
- if ( in_array( $property, array(
342
- $this->_id.'_post_title',
343
- $this->_id.'_post_content',
344
- ) ) ) continue;
345
-
346
- $old = get_metadata( $type, $id, $property, true );
347
- if ( $new && $new != $old ) {
348
- update_metadata( $type, $id, $property, $new );
349
- }
350
- elseif ( !$new ) {
351
- delete_metadata( $type, $id, $property, $old );
352
- }
353
- }
354
-
355
- return $source;
356
- }
357
-
358
-
359
- /**
360
- * Method saves the data provided as post meta values
361
- *
362
- * @param array $source
363
- * @param integer $post_id
364
- */
365
- function saveAsPostMeta( $source, $post_id ) {
366
- $type = 'post';
367
- if ( !$this->getCurrentPostType() ) {
368
- $type = $this->_table;
369
- }
370
-
371
- //save as a file
372
- //if there's no FILES then we save as a meta
373
- $source = $this->saveAsAttachment( $source, $post_id );
374
-
375
- //get the ID of this meta set
376
- $id = false;
377
- if ( isset( $source[$this->_id.'_metaid'] ) && $source[$this->_id.'_metaid'] ) {
378
- $id = $source[$this->_id.'_metaid'];
379
- }
380
-
381
- // if this is a built in metabox
382
- if ( $this->_type != 'default'
383
- && ( !isset( $source[$this->_id.'_image'] ) || !$source[$this->_id.'_image'] ) )
384
- return false;
385
-
386
- // Saving only the specially prefixed items
387
- foreach ( (array)$source as $property => $new ) {
388
- //skip everything but the specially prefixed
389
- if ( strpos( $property, $this->_id ) !== 0 ) continue;
390
-
391
- //each meta set has it's own ID
392
- $property = str_replace( $this->_id, $this->_category_name.'_'.$id, $property );
393
-
394
- $old = get_metadata( $type, $post_id, $property, true );
395
- if ( $new && $new != $old ) {
396
- update_metadata( $type, $post_id, $property, $new );
397
- }
398
- elseif ( !$new ) {
399
- delete_metadata( $type, $post_id, $property, $old );
400
- }
401
- }
402
-
403
- // maybe there's a last id
404
- if ( !$id ) {
405
- if ( !$id = get_metadata( $type, $post_id, '_metaidlast', true ) ) {
406
- $id = 0;
407
- }
408
- $id++;
409
- update_metadata( $type, $post_id, '_metaidlast', $id );
410
- }
411
-
412
- // saving all of the standard items
413
- foreach ( (array)$source as $property => $new ) {
414
- //skip special properties that are prefixed with the id
415
- if ( strpos( $property, $this->_id ) === 0 ) continue;
416
-
417
- $old = get_metadata( $type, $post_id, $property, true );
418
- update_metadata( $type, $post_id, $property, $new );
419
-
420
- // if ($new && $new != $old) {
421
- // update_metadata($type, $post_id, $property, $new);
422
- // }
423
- // elseif (!$new) {
424
- // delete_metadata($type, $post_id, $property, $old);
425
- // }
426
-
427
- }
428
-
429
- return true;
430
- }
431
-
432
-
433
- /**
434
- * Do something with the data entered
435
- *
436
- * @param integer $post_id
437
- */
438
- function _save( $post_id ) {
439
- //initializing
440
- $post = get_post( $post_id );
441
-
442
- // verify if this is an auto save routine.
443
- // If it is our form has not been submitted, so we dont want to do anything
444
- if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE )
445
- return;
446
-
447
- // verify this came from the our screen and with proper authorization,
448
- // because save_post can be triggered at other times
449
- if ( !isset( $_REQUEST[ get_class().$this->_id ] ) )
450
- return;
451
-
452
- if ( !wp_verify_nonce( $_REQUEST[ get_class().$this->_id ], plugin_basename( __FILE__ ) ) )
453
- return;
454
-
455
- // this metabox is to be displayed for a certain object type only
456
- if ( !in_array( $post->post_type, $this->_object_types ) )
457
- return;
458
-
459
- // Check permissions
460
- if ( 'page' == $post->post_type ) {
461
- if ( !current_user_can( 'edit_page', $post->ID ) )
462
- return;
463
- }
464
- else {
465
- if ( !current_user_can( 'edit_post', $post->ID ) )
466
- return;
467
- }
468
-
469
- //saving the request data
470
- if ( !$this->_type ) $this->setType();
471
- do_action( 'metabox-save-'.$this->_id, $this->getRequestPostMetas(), $post->ID, $this );
472
- return true;
473
- }
474
-
475
-
476
- /**
477
- * Method returns the post meta
478
- *
479
- */
480
- function getRequestPostMetas() {
481
- $ignores = array( 'post_title', 'post_name', 'post_content', 'post_excerpt', 'post',
482
- 'post_status', 'post_type', 'post_author', 'ping_status', 'post_parent', 'message',
483
- 'post_category', 'comment_status', 'menu_order', 'to_ping', 'pinged', 'post_password',
484
- 'guid', 'post_content_filtered', 'import_id', 'post_date', 'post_date_gmt', 'tags_input',
485
- 'action' );
486
-
487
- $fields = array();
488
- foreach ( (array)$this->_fields as $field ) {
489
- if ( !array_key_exists( 'id', $field ) ) continue;
490
- $fields[] = $field['id'];
491
- }
492
-
493
- $requests = $_REQUEST;
494
- foreach ( (array)$requests as $k => $request ) {
495
- if ( ( !empty( $fields ) && !in_array( $k, $fields ) )
496
- || ( in_array( $k, $ignores ) || strpos( $k, 'nounce' ) !== false ) ) {
497
- unset( $requests[$k] );
498
- }
499
- }
500
-
501
- return apply_filters( 'metabox-requests-'.$this->_id, $requests );
502
- }
503
-
504
-
505
- /**
506
- * Display the inner contents of the metabox
507
- *
508
- * @param object $post
509
- */
510
- function show( $post ) {
511
- // Use nonce for verification
512
- wp_nonce_field( plugin_basename( __FILE__ ), get_class().$this->_id );
513
- do_action( 'metabox-show-'.$this->_id, $this->_fields, $this );
514
- }
515
-
516
-
517
- /**
518
- * Method displays a list of attached images
519
- *
520
- */
521
- function _renderListImageAttachments() {
522
- global $post, $current_screen;
523
- $images = get_children( "post_parent=$post->ID&post_type=attachment&post_mime_type=image" );
524
-
525
- // no images to render
526
- if ( empty( $images ) ) {
527
- ?><p>No images have been saved.</p><?php
528
-
529
- // rendering the images
530
- } else {
531
-
532
- ?>
533
- <table class="wp-list-table form-table widefat" style="border:none;">
534
- <?php foreach ( (array)$images as $post_id => $image ): ?>
535
- <?php $image_attributes = wp_get_attachment_image_src( $image->ID, 'thumbnail' ); ?>
536
- <tbody id="the-list">
537
- <tr>
538
- <th scope="row" style="width: 140px">
539
- <div style="padding:10px;background:whiteSmoke;">
540
- <img src="<?php echo wp_get_attachment_thumb_url( $image->ID ); ?>" /></div>
541
- </th>
542
- <td>
543
- <b><?php echo $image->post_title; ?></b>
544
- <p><?php echo get_the_content( $image->ID ); ?></p>
545
-
546
- <div class="row-actions">
547
- <span class="inline">
548
- <a href="<?php echo wp_nonce_url(
549
- "media.php?attachment_id=$image->ID"
550
- ."&action=edit&_redirect="
551
- .urlencode( $this->_currentPageURL() )
552
- ); ?>">
553
- Edit</a> |
554
- </span>
555
- <span class="trash">
556
- <a class="submitdelete"
557
- onclick="return showNotice.warn();"
558
- href="<?php echo wp_nonce_url(
559
- "post.php?action=delete&_redirect="
560
- .urlencode( $this->_currentPageURL() )
561
- ."&amp;post=$image->ID",
562
- 'delete-attachment_' . $image->ID ); ?>">
563
- Delete Permanently</a> |
564
- </span>
565
- <span class="inline">
566
- <a target="_blank"
567
- href="<?php echo get_attachment_link( $image->ID ); ?>">
568
- View</a>
569
- </span>
570
- </div>
571
- </td>
572
- </tr>
573
- </tbody>
574
- <?php endforeach; ?>
575
- </table>
576
- <?php
577
- }
578
- return;
579
- }
580
-
581
-
582
- /**
583
- * Return a clean list of meta listings created by this system
584
- *
585
- * @param string $category
586
- * $param object $post
587
- */
588
- public static function getMetaListings( $category, $post = null ) {
589
- // initializing
590
- if ( $post === NULL ) {
591
- global $post;
592
- }
593
- $custom = get_post_custom( $post->ID );
594
- $return = array();
595
-
596
- //looping all values to build our return array
597
- foreach ( (array)$custom as $property => $value ) {
598
- $parts = explode( '_', $property );
599
- if ( !isset( $parts[0] ) || !isset( $parts[1] ) || !isset( $parts[2] ) ) continue;
600
- if ( $parts[0] != $category ) continue;
601
-
602
- $pro = str_replace( $parts[0].'_'.$parts[1].'_', '', $property );
603
- $return[$parts[1]][$pro] = $value;
604
- }
605
-
606
- return $return;
607
- }
608
-
609
-
610
- /**
611
- * Function removes a specific category meta
612
- *
613
- * @param string $category
614
- * $param string $meta_id
615
- * $param object $post
616
- */
617
- public static function deleteMetaListing( $category, $meta_id, $post = null ) {
618
- // initializing
619
- if ( $post === NULL ) {
620
- global $post;
621
- }
622
- $listings = redrokk_metabox_class::getMetaListings( $category, $post );
623
- if ( !isset( $listings[$meta_id] ) ) return false;
624
-
625
- $type = 'post';
626
-
627
- foreach ( (array)$listings[$meta_id] as $property => $value ) {
628
- $pro = $category.'_'.$meta_id.'_'.$property;
629
- delete_metadata( $type, $post->ID, $pro, $value[0] );
630
- }
631
- return true;
632
- }
633
-
634
-
635
- /**
636
- * Method displays a list of meta attachments
637
- *
638
- */
639
- function _renderListAttachments() {
640
- global $post;
641
-
642
- //delete action prior to pulling new listings
643
- if ( isset( $_REQUEST['redrokkdelete'] ) && $_REQUEST['redrokkdelete'] ) {
644
- redrokk_metabox_class::deleteMetaListing( $this->_category_name, $_REQUEST['redrokkdelete'], $post );
645
- }
646
-
647
- //pull new listings
648
- $metaListings = redrokk_metabox_class::getMetaListings( $this->_category_name, $post );
649
-
650
- if ( !empty( $metaListings ) ) {
651
- ?>
652
- <table class="wp-list-table form-table widefat" style="border:none;">
653
- <tbody id="the-list">
654
- <?php foreach ( (array)$metaListings as $meta_id => $video ): ?>
655
- <?php $video = apply_filters( 'redrokk_metabox_class::_renderListAttachments', $video, $meta_id );?>
656
-
657
- <tr id="<?php echo $this->_category_name; ?>_<?php echo $meta_id; ?>">
658
- <th scope="row" style="width: 140px">
659
- <div style="padding:10px;background:whiteSmoke;">
660
- <?php if ( isset( $video['link'] ) ) echo apply_filters( 'the_content', $video['link'][0] ); ?>
661
- </div>
662
- </th>
663
- <td>
664
- <b><?php if ( isset( $video['post_title'] ) ) echo $video['post_title'][0]; ?></b>
665
- <p><?php if ( isset( $video['post_content'] ) ) echo $video['post_content'][0]; ?></p>
666
-
667
- <div class="row-actions">
668
- <span class="inline">
669
- <a href="#" id="edit_<?php echo $this->_category_name; ?>_<?php echo $meta_id; ?>">
670
- Edit</a> |
671
- </span>
672
- <span class="trash">
673
- <a class="submitdelete"
674
- onclick="return showNotice.warn();"
675
- href="<?php echo site_url( "wp-admin/post.php?post={$post->ID}"
676
- ."&action=edit"
677
- ."&redrokkdelete=$meta_id"
678
- ); ?>">
679
- Delete Permanently</a>
680
- </span>
681
- </div>
682
- <script>
683
- jQuery('#edit_<?php echo $this->_category_name; ?>_<?php echo $meta_id; ?>').click(function(){
684
- var data = {
685
- <?php
686
- $data = array();
687
-
688
- //making sure all fields will be cleared
689
- foreach ( (array)$this->_fields as $field ) {
690
- if ( !isset( $field['id'] ) || !isset( $field['type'] ) ) continue;
691
- if ( !in_array( $field['type'], array( 'text', 'file', 'image', 'textarea', 'hidden' ) ) )
692
- continue;
693
-
694
- $id = str_replace( $this->_id.'_', '', $field['id'] );
695
- $data[$id] = "'$id':''";
696
- }
697
-
698
- //adding our values to the array
699
- foreach ( (array)$video as $vp => $vv ) {
700
- if ( isset( $vv[0] ) ) $vv = $vv[0];
701
- $data[$vp] = "'$vp':'$vv'";
702
- }
703
-
704
- //adding the meta ID to the array
705
- $data[$id] = "'metaid':'$meta_id'";
706
-
707
- echo implode( ',', $data );
708
- ?>
709
- };
710
-
711
- jQuery.each(data, function(key, value){
712
- jQuery('#<?php echo $this->_id; ?>_'+key).val( value );
713
- });
714
- return false;
715
- });
716
- </script>
717
- </td>
718
- <?php do_action( 'redrokk_metabox_class::_renderListAttachments::rows', $video, $meta_id, $this ); ?>
719
- </tr>
720
- <?php endforeach; ?>
721
- </tbody>
722
- </table>
723
- <?php
724
- }
725
-
726
- }
727
-
728
-
729
- /**
730
- * Method displays a list of attached videos
731
- *
732
- */
733
- function _renderListVideoAttachments() {
734
- global $post;
735
-
736
- //pull new listings
737
- $videos = get_children( "post_parent=$post->ID&post_type=attachment&post_mime_type=video/mp4" );
738
-
739
- // no images to render
740
- if ( !empty( $videos ) ) {
741
- ?>
742
- <table class="wp-list-table form-table widefat" style="border:none;">
743
- <tbody id="the-list">
744
- <?php foreach ( (array)$videos as $post_id => $video ): ?>
745
- <?php $image_attributes = wp_get_attachment_link( $video->ID ); ?>
746
- <tr>
747
- <th scope="row" style="width: 140px">
748
- <div style="padding:10px;background:whiteSmoke;">
749
- <?php echo $image_attributes; ?>
750
- </div>
751
- </th>
752
- <td>
753
- <b><?php echo $video->post_title; ?></b>
754
- <p><?php echo get_the_content( $video->ID ); ?></p>
755
-
756
- <div class="row-actions">
757
- <span class="inline">
758
- <a href="<?php echo wp_nonce_url(
759
- "media.php?attachment_id=$meta_id"
760
- ."&action=edit&_redirect="
761
- .urlencode( $this->_currentPageURL() )
762
- ); ?>">
763
- Edit</a> |
764
- </span>
765
- <span class="trash">
766
- <a class="submitdelete"
767
- onclick="return showNotice.warn();"
768
- href="<?php echo wp_nonce_url(
769
- "post.php?action=delete&_redirect="
770
- .urlencode( $this->_currentPageURL() )
771
- ."&amp;post=$video->ID",
772
- 'delete-attachment_' . $video->ID ); ?>">
773
- Delete Permanently</a>
774
- </span>
775
- </div>
776
- </td>
777
- </tr>
778
- <?php endforeach; ?>
779
- </tbody>
780
- </table>
781
- <?php
782
- }
783
- }
784
-
785
-
786
- /**
787
- * Method renders the form from any source
788
- *
789
- * @param array $fields
790
- */
791
- function _renderForm( $fields = array() ) {
792
- //initializing
793
- global $post;
794
- $defaults = array(
795
- 'name' => '',
796
- 'desc' => '',
797
- 'id' => '',
798
- 'type' => 'text',
799
- 'options' => array(),
800
- 'std' => '',
801
- 'value' => '',
802
- 'class' => '',
803
- 'multiple' => '',
804
- 'args' => array(
805
- 'hide_empty' => 0,
806
- 'name' => 'element_name',
807
- 'hierarchical' => true
808
- ),
809
- 'attributes' => ''
810
- );
811
-
812
- // no fields to render
813
- if ( empty( $fields ) ) {
814
- ?>
815
- <p>No form fields have been defined. Use <pre>
816
- $metabox->set('_fields', array(
817
- array(
818
- 'name' => 'Title',
819
- 'type' => 'title',
820
- ),
821
- array(
822
- 'name' => 'Title',
823
- 'desc' => '',
824
- 'id' => 'title',
825
- 'type' => 'text',
826
- 'std' => ''
827
- ),
828
- array(
829
- 'name' => 'image',
830
- 'desc' => '',
831
- 'id' => 'imagefile',
832
- 'type' => 'image',
833
- 'std' => ''
834
- ),
835
- array(
836
- 'name' => 'Textarea',
837
- 'desc' => 'Enter big text here',
838
- 'id' => 'textarea_id',
839
- 'type' => 'textarea',
840
- 'std' => 'Default value 2'
841
- ),
842
- array(
843
- 'name' => 'Select box',
844
- 'id' => 'select_id',
845
- 'type' => 'select',
846
- 'options'=> array(
847
- 'value1' => 'Value 1',
848
- 'value2' => 'Value 2',
849
- 'value3' => 'Value 3',
850
- 'value4' => 'Value 4',
851
- )
852
- ),
853
- array(
854
- 'name' => 'Radio',
855
- 'id' => 'radio_id',
856
- 'type' => 'radio',
857
- 'value' => 'test',
858
- 'desc' => 'Check this box if you want its value saved',
859
- ),
860
- array(
861
- 'name' => '',
862
- 'id' => 'radio_id',
863
- 'type' => 'radio',
864
- 'value' => 'test2',
865
- 'desc' => 'Check this box if you want its value saved',
866
- ),
867
- array(
868
- 'name' => 'Checkbox',
869
- 'id' => 'checkbox_id',
870
- 'type' => 'checkbox',
871
- 'desc' => 'Check this box if you want its value saved',
872
- ),
873
- ));</pre>
874
- </p>
875
- <?php
876
-
877
- // rendering the fields
878
- } else {
879
- ?>
880
- <table class="form-table">
881
- <?php
882
- // do_action("{$this->_class}_before");
883
- $custom = get_post_custom( $this->_id );
884
-
885
- foreach ( (array)$fields as $field ):
886
- $field = wp_parse_args( $field, $defaults );
887
- $field['args'] = wp_parse_args( $field['args'], $defaults['args'] );
888
-
889
- extract( $field );
890
- $field['args']['name'] = $element_name = $id;
891
-
892
- // grabbing the meta value
893
- if ( array_key_exists( $id, $custom ) ) {
894
- if ( isset( $custom[$id][0] ) )
895
- $meta = esc_attr( $custom[$id][0] );
896
- else
897
- $meta = esc_attr( $custom[$id] );
898
- } else {
899
- $meta = $std;
900
- }
901
-
902
- $id = sanitize_title( $id );
903
-
904
- if ( array_key_exists( 'deleteattachment', $_GET )
905
- && $id == $_GET['fileproperty']
906
- && $meta == $_GET['deleteattachment'] ) {
907
- wp_delete_attachment( $_GET['deleteattachment'], $force_delete = true );
908
- update_post_meta( $post->ID, $id, '' );
909
- }
910
- ?>
911
- <?php switch ( $type ) { default: ?>
912
- <?php if ( is_callable( $type ) && function_exists( $type ) ) : ?>
913
- <?php if ( ! isset( $custom[ $id ] ) ) $custom[ $id ] = null; ?>
914
- <tr>
915
- <th scope="row" style="width: 140px">
916
- <label for="<?php echo $id; ?>"><?php echo $name; ?></label>
917
- </th>
918
- <td>
919
- <?php call_user_func( $type, $args, $field, $custom[ $id ] ); ?>
920
- <span class="description"><?php echo $desc; ?></span>
921
- </td>
922
- </tr>
923
- <?php break; endif; ?>
924
- <?php case 'text': ?>
925
- <tr>
926
- <th scope="row" style="width: 140px">
927
- <label for="<?php echo $id; ?>"><?php echo $name; ?></label>
928
- </th>
929
- <td>
930
- <input <?php echo $attributes ?>
931
- id="<?php echo $id; ?>"
932
- value="<?php echo $meta; ?>"
933
- type="<?php echo $type; ?>"
934
- name="<?php echo $id; ?>"
935
- class="text large-text <?php echo $class; ?>" />
936
- <span class="description"><?php echo $desc; ?></span>
937
- </td>
938
- </tr>
939
- <?php break; ?>
940
- <?php case 'submit': ?>
941
- <?php case 'button': ?>
942
- <tr>
943
- <td colspan="2">
944
- <input <?php echo $attributes ?>
945
- id="<?php echo $id; ?>"
946
- value="<?php echo $name; ?>"
947
- type="submit"
948
- name="submit"
949
- class="button-primary <?php echo $class; ?>" />
950
- <span class="description"><?php echo $desc; ?></span>
951
- </td>
952
- </tr>
953
- <?php break; ?>
954
- <?php case 'file': ?>
955
- <?php case 'image': ?>
956
- <tr>
957
- <th scope="row" style="width: 140px">
958
- <label for="<?php echo $id; ?>"><?php echo $name; ?></label>
959
- </th>
960
- <td>
961
- <?php if ( $meta && wp_get_attachment_url( $meta ) ): ?>
962
- <?php echo wp_get_attachment_image( $meta ); ?>
963
- <span><a href="<?php echo add_query_arg( 'fileproperty', $id, add_query_arg( 'deleteattachment', $meta, $this->_currentPageURL() ) ); ?>">Delete Image</a></span>
964
- <?php else: ?>
965
- <input type="hidden" name="<?php echo $this->_id; ?>files" value="<?php echo $id; ?>" />
966
- <!-- first hidden input forces this item to be submitted when it is not checked -->
967
- <input <?php echo $attributes ?>
968
- id="<?php echo $id; ?>"
969
- type="file"
970
- name="<?php echo $id; ?>"
971
- onChange="jQuery(this).closest('form').attr('enctype', 'multipart/form-data');"
972
- class="<?php echo $class; ?>" />
973
- <?php endif; ?>
974
- <span class="description"><?php echo $desc; ?></span>
975
- </td>
976
- </tr>
977
- <?php break; ?>
978
- <?php case 'title': ?>
979
- <tr>
980
- <th colspan="2" scope="row">
981
- <h3 <?php echo $attributes ?> style="border: 1px solid #ddd;
982
- padding: 10px;
983
- background: #eee;
984
- border-radius: 2px;
985
- color: #666;
986
- margin: 0;"><?php echo $name; ?>
987
- </h3>
988
- </th>
989
- </tr>
990
- <?php break; ?>
991
- <?php case 'checkbox': ?>
992
- <tr>
993
- <th scope="row" style="width: 140px">
994
- <label for="<?php echo $id; ?>"><?php echo $name; ?></label>
995
- </th>
996
- <td>
997
- <input type="hidden" name="<?php echo $id; ?>" value="" />
998
- <!-- first hidden input forces this item to be submitted when it is not checked -->
999
-
1000
- <?php foreach ( (array)$options as $_value => $_name ): ?>
1001
- <input value="<?php echo $_value; ?>" type="checkbox" <?php echo $attributes ?>
1002
- name="<?php echo $element_name; ?>" id="<?php echo $id; ?>"
1003
- <?php echo $meta == $_value? 'checked="checked"' :''; ?>
1004
- class="<?php echo $class; ?>" />
1005
- <?php echo $_name; ?>
1006
- <?php endforeach; ?>
1007
- <span class="description"><?php echo $desc; ?></span>
1008
- </td>
1009
- </tr>
1010
- <?php break; ?>
1011
- <?php case 'radio': ?>
1012
- <tr>
1013
- <th scope="row" style="width: 140px">
1014
- <label for="<?php echo $id; ?>"><?php echo $name; ?></label>
1015
- </th>
1016
- <td>
1017
- <?php foreach ( (array)$options as $_value => $_name ): ?>
1018
- <input name="<?php echo $element_name; ?>" id="<?php echo $id; ?>"
1019
- value="<?php echo $_value; ?>" type="<?php echo $type; ?>"
1020
- <?php echo $meta == $_value?'checked="checked"' :''; ?>
1021
- <?php echo $attributes ?> class="<?php echo $class; ?>" />
1022
- <?php echo $_name; ?>
1023
- <?php endforeach; ?>
1024
- <span class="description"><?php echo $desc; ?></span>
1025
- </td>
1026
- </tr>
1027
- <?php break; ?>
1028
- <?php case 'textarea': ?>
1029
- <tr>
1030
- <th scope="row" style="width: 140px">
1031
- <label for="<?php echo $id; ?>"><?php echo $name; ?></label>
1032
- </th>
1033
- <td>
1034
- <textarea <?php echo $attributes ?>
1035
- id="<?php echo $id; ?>"
1036
- name="<?php echo $id; ?>"
1037
- class="large-text <?php echo $class; ?>"
1038
- ><?php echo $meta; ?></textarea>
1039
- <span class="description"><?php echo $desc; ?></span>
1040
- </td>
1041
- </tr>
1042
- <?php break; ?>
1043
- <?php case 'wpeditor': ?>
1044
- <tr>
1045
- <th scope="row" style="width: 140px">
1046
- <label for="<?php echo $id; ?>"><?php echo $name; ?></label>
1047
- </th>
1048
- <td>
1049
- <?php wp_editor( $meta, $id, $settings = array() ); ?>
1050
- <span class="description"><?php echo $desc; ?></span>
1051
- </td>
1052
- </tr>
1053
- <?php break; ?>
1054
- <?php case 'select_capabilities': ?>
1055
- <?php $options = $type=='select_capabilities' ?$this->get_options_capabilities()+$options :$options; ?>
1056
-
1057
- <?php case 'select_roles': ?>
1058
- <?php $options = $type=='select_roles' ?$this->get_options_roles()+$options :$options; ?>
1059
-
1060
- <?php case 'select_menu': ?>
1061
- <?php $options = $type=='select_menu' ?$this->get_options_menus()+$options :$options; ?>
1062
-
1063
- <?php case 'select_pages': ?>
1064
- <?php $options = $type=='select_pages' ?$this->get_options_pages()+$options :$options; ?>
1065
-
1066
- <?php case 'select_users': ?>
1067
- <?php $options = $type=='select_users' ?$this->get_options_users()+$options :$options; ?>
1068
-
1069
- <?php case 'select_categories': ?>
1070
- <?php case 'select': ?>
1071
- <tr>
1072
- <th scope="row" style="width: 140px">
1073
- <label for="<?php echo $id; ?>"><?php echo $name; ?></label>
1074
- </th>
1075
- <td>
1076
- <?php if ( $type == 'select_categories' ): ?>
1077
- <?php wp_dropdown_categories( $args ); ?>
1078
-
1079
- <?php else: ?>
1080
-
1081
- <select <?php echo $attributes ?>
1082
- id="<?php echo $id; ?>"
1083
- name="<?php echo $id; ?>"
1084
- class="<?php echo $class; ?>"
1085
- <?php echo $multiple ?"MULTIPLE SIZE='$multiple'" :''; ?>
1086
- ><?php foreach ( (array)$options as $_value => $_name ): ?>
1087
-
1088
- <option
1089
- value="<?php echo $_value; ?>"
1090
- <?php echo $meta == $_value ?' selected="selected"' :''; ?>
1091
- ><?php echo $_name; ?></option>
1092
-
1093
- <?php endforeach; ?></select>
1094
- <?php endif; ?>
1095
- <span class="description"><?php echo $desc; ?></span>
1096
- </td>
1097
- </tr>
1098
- <?php break; ?>
1099
- <?php case 'hidden': ?>
1100
- <tr>
1101
- <td colspan="2">
1102
- <input <?php echo $attributes ?>
1103
- id="<?php echo $id; ?>"
1104
- value="<?php echo $meta ?$meta :$std; ?>"
1105
- type="<?php echo $type; ?>"
1106
- name="<?php echo $id; ?>"
1107
- style="visibility:hidden;" />
1108
- </td>
1109
- </tr>
1110
- <?php break; ?>
1111
- <?php case 'custom': ?>
1112
- <tr>
1113
- <td colspan="2">
1114
- <?php echo $desc.$std; ?>
1115
- </td>
1116
- </tr>
1117
- <?php case 'date': ?>
1118
- <tr>
1119
- <th scope="row" style="width: 140px">
1120
- <label for="<?php echo $id; ?>"><?php echo $name; ?></label>
1121
- </th>
1122
- <td>
1123
- <?php echo mysql2date( get_option( 'date_format' ), $meta ); ?>
1124
- <span class="description"><?php echo $desc; ?></span>
1125
- </td>
1126
- </tr>
1127
- <?php break; ?>
1128
- <?php case 'time': ?>
1129
- <tr>
1130
- <th scope="row" style="width: 140px">
1131
- <label for="<?php echo $id; ?>"><?php echo $name; ?></label>
1132
- </th>
1133
- <td>
1134
- <?php echo mysql2date( get_option( 'time_format' ), $meta ); ?>
1135
- <span class="description"><?php echo $desc; ?></span>
1136
- </td>
1137
- </tr>
1138
- <?php break; ?>
1139
- <?php case 'datetime': ?>
1140
- <tr>
1141
- <th scope="row" style="width: 140px">
1142
- <label for="<?php echo $id; ?>"><?php echo $name; ?></label>
1143
- </th>
1144
- <td>
1145
- <?php echo mysql2date( get_option( 'date_format' ), $meta ); ?>
1146
- <?php echo mysql2date( get_option( 'time_format' ), $meta ); ?>
1147
- <span class="description"><?php echo $desc; ?></span>
1148
- </td>
1149
- </tr>
1150
- <?php break; ?>
1151
- <?php } ?>
1152
- <?php endforeach; ?>
1153
- </table>
1154
- <?php
1155
- }
1156
- return $this;
1157
- }
1158
-
1159
-
1160
- /**
1161
- * Returns an options list of menus
1162
- */
1163
- function get_options_pages() {
1164
- // initializing
1165
- $options = array( '0'=>' -- ' );
1166
- $pages = get_pages( array( 'post_type' => 'page', 'post_status' => 'publish' ) );
1167
-
1168
- foreach ( $pages as $page ) {
1169
- $options[$page->ID] = $page->post_title;
1170
- }
1171
-
1172
- return $options;
1173
- }
1174
-
1175
-
1176
- /**
1177
- * Returns an options list of menus
1178
- */
1179
- function get_options_menus() {
1180
- // initializing
1181
- $options = array( '0'=>' -- ' );
1182
- $menus = get_terms( 'nav_menu', array(
1183
- 'hide_empty' => 0
1184
- ) );
1185
-
1186
- foreach ( $menus as $menu ) {
1187
- $options[$menu->slug] = $menu->name;
1188
- }
1189
-
1190
- return $options;
1191
- }
1192
-
1193
-
1194
- /**
1195
- * Returns an options list of users
1196
- */
1197
- function get_options_users() {
1198
- // initializing
1199
- global $wpdb;
1200
-
1201
- $options = array( '0'=>' -- ' );
1202
- $query = $wpdb->prepare( "SELECT $wpdb->users.ID, $wpdb->users.display_name FROM $wpdb->users", null );
1203
- $results = $wpdb->get_results( $query );
1204
-
1205
- foreach ( (array)$results as $result ) {
1206
- $options[$result->ID] = $result->display_name;
1207
- }
1208
-
1209
- return $options;
1210
- }
1211
-
1212
-
1213
- /**
1214
- * Returns an options list of capabilities
1215
- */
1216
- function get_options_capabilities() {
1217
- // initializing
1218
- global $wpdb;
1219
-
1220
- $options = array();
1221
- $roles = get_option( $wpdb->prefix . 'user_roles' );
1222
-
1223
- foreach ( (array)$roles as $role ) {
1224
- if ( !isset( $role['capabilities'] ) ) continue;
1225
- foreach ( (array)$role['capabilities'] as $cap => $v ) {
1226
- $options[$role['name']."::$cap"] = $role['name']."::$cap";
1227
- }
1228
- }
1229
-
1230
- return $options;
1231
- }
1232
-
1233
-
1234
- /**
1235
- * Returns an options list of roles
1236
- */
1237
- function get_options_roles() {
1238
- // initializing
1239
- global $wpdb;
1240
-
1241
- $options = array(
1242
- 'read' => 'Public'
1243
- );
1244
- $roles = get_option( $wpdb->prefix . 'user_roles' );
1245
-
1246
- foreach ( (array)$roles as $role ) {
1247
- $options[strtolower( $role['name'] )] = $role['name'];
1248
- }
1249
-
1250
- return $options;
1251
- }
1252
-
1253
-
1254
- /**
1255
- * Adds a box to the main column on the Post and Page edit screens
1256
- *
1257
- */
1258
- function _register() {
1259
- // this metabox is to be displayed for a certain object type only
1260
- if ( !empty( $this->_object_types ) && !in_array( $this->getCurrentPostType(), $this->_object_types ) )
1261
- return;
1262
-
1263
- if ( !$this->callback_args ) {
1264
- $this->callback_args = $this;
1265
- }
1266
-
1267
- // if the user has not already set the type of this metabox,
1268
- // then we need to do that now
1269
- if ( !$this->_type ) {
1270
- $this->setType();
1271
- }
1272
-
1273
- add_meta_box(
1274
- $this->_id,
1275
- $this->title,
1276
- $this->callback,
1277
- $this->getCurrentPostType(),
1278
- $this->context,
1279
- $this->priority,
1280
- $this->callback_args
1281
- );
1282
- }
1283
-
1284
-
1285
- /**
1286
- * Method set's the hooks for the options creted by this metabox
1287
- *
1288
- */
1289
- function setOptionHooks() {
1290
- foreach ( (array)$this->_fields as $field ) {
1291
- if ( !isset( $field['id'] ) ) continue;
1292
-
1293
- //creating the callback for the admin page
1294
- $function = create_function( '$default', '
1295
- return redrokk_admin_class::getInstance("'.$this->_isAdminPage.'")
1296
- ->getOption("'.$field['id'].'", $default, true);
1297
- ' );
1298
- add_filter( "pre_option_{$field['id']}", $function, 20, 2 );
1299
- }
1300
- }
1301
-
1302
-
1303
- /**
1304
- * Method redirects the user if we have added a request redirect
1305
- * in the url
1306
- *
1307
- * @param string $location
1308
- */
1309
- function _redirectIntervention( $location ) {
1310
- if ( isset( $_GET['_redirect'] ) ) {
1311
- $location = urldecode( $_GET['_redirect'] );
1312
- }
1313
- return $location;
1314
- }
1315
-
1316
-
1317
- /**
1318
- * Get the current page url
1319
- */
1320
- function _currentPageURL() {
1321
- $pageURL = 'http';
1322
- if ( isset( $_SERVER["HTTPS"] ) && $_SERVER["HTTPS"] == "on" ) {$pageURL .= "s";}
1323
- $pageURL .= "://";
1324
- if ( $_SERVER["SERVER_PORT"] != "80" ) {
1325
- $pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
1326
- } else {
1327
- $pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
1328
- }
1329
- return $pageURL;
1330
- }
1331
-
1332
-
1333
- /**
1334
- * Method to bind an associative array or object to the JTable instance.This
1335
- * method only binds properties that are publicly accessible and optionally
1336
- * takes an array of properties to ignore when binding.
1337
- *
1338
- * @param mixed $src An associative array or object to bind to the JTable instance.
1339
- * @param mixed $ignore An optional array or space separated list of properties to ignore while binding.
1340
- *
1341
- * @return boolean True on success.
1342
- *
1343
- * @link http://docs.joomla.org/JTable/bind
1344
- * @since 11.1
1345
- */
1346
- public function bind( $src, $ignore = array() ) {
1347
- // If the source value is not an array or object return false.
1348
- if ( !is_object( $src ) && !is_array( $src ) ) {
1349
- trigger_error( 'Bind failed as the provided source is not an array.' );
1350
- return false;
1351
- }
1352
-
1353
- // If the source value is an object, get its accessible properties.
1354
- if ( is_object( $src ) ) {
1355
- $src = get_object_vars( $src );
1356
- }
1357
-
1358
- // If the ignore value is a string, explode it over spaces.
1359
- if ( !is_array( $ignore ) ) {
1360
- $ignore = explode( ' ', $ignore );
1361
- }
1362
-
1363
- // Bind the source value, excluding the ignored fields.
1364
- foreach ( $this->getProperties() as $k => $v ) {
1365
- // Only process fields not in the ignore array.
1366
- if ( !in_array( $k, $ignore ) ) {
1367
- if ( isset( $src[$k] ) ) {
1368
- $this->$k = $src[$k];
1369
- }
1370
- }
1371
- }
1372
-
1373
- return true;
1374
- }
1375
-
1376
-
1377
- /**
1378
- * Set the object properties based on a named array/hash.
1379
- *
1380
- * @param mixed $properties Either an associative array or another object.
1381
- *
1382
- * @return boolean
1383
- *
1384
- * @since 11.1
1385
- *
1386
- * @see set()
1387
- */
1388
- public function setProperties( $properties ) {
1389
- if ( is_array( $properties ) || is_object( $properties ) ) {
1390
- foreach ( (array) $properties as $k => $v ) {
1391
- // Use the set function which might be overridden.
1392
- $this->set( $k, $v );
1393
- }
1394
- return true;
1395
- }
1396
-
1397
- return false;
1398
- }
1399
-
1400
-
1401
- /**
1402
- * Modifies a property of the object, creating it if it does not already exist.
1403
- *
1404
- * @param string $property The name of the property.
1405
- * @param mixed $value The value of the property to set.
1406
- *
1407
- * @return mixed Previous value of the property.
1408
- *
1409
- * @since 11.1
1410
- */
1411
- public function set( $property, $value = null ) {
1412
- $_property = 'set'.str_replace( ' ', '', ucwords( str_replace( '_', ' ', $property ) ) );
1413
- if ( method_exists( $this, $_property ) ) {
1414
- return $this->$_property( $value );
1415
- }
1416
-
1417
- $previous = isset( $this->$property ) ? $this->$property : null;
1418
- $this->$property = $value;
1419
- return $previous;
1420
- }
1421
-
1422
-
1423
- /**
1424
- * Returns an associative array of object properties.
1425
- *
1426
- * @param boolean $public If true, returns only the public properties.
1427
- *
1428
- * @return array
1429
- *
1430
- * @see get()
1431
- */
1432
- public function getProperties( $public = true ) {
1433
- $vars = get_object_vars( $this );
1434
- if ( $public ) {
1435
- foreach ( $vars as $key => $value ) {
1436
- if ( '_' == substr( $key, 0, 1 ) ) {
1437
- unset( $vars[$key] );
1438
- }
1439
- }
1440
- }
1441
-
1442
- return $vars;
1443
- }
1444
-
1445
-
1446
- /**
1447
- * contains the current instance of this class
1448
- *
1449
- * @var object
1450
- */
1451
- static $_instances = null;
1452
-
1453
- /**
1454
- * Method is called when we need to instantiate this class
1455
- *
1456
- * @param array $options
1457
- */
1458
- public static function getInstance( $_id, $options = array() ) {
1459
- if ( !isset( self::$_instances[$_id] ) ) {
1460
- $options['_id'] = $_id;
1461
- $class = get_class();
1462
- self::$_instances[$_id] = new $class( $options );
1463
- }
1464
- return self::$_instances[$_id];
1465
- }
1466
-
1467
-
1468
- }
1469
-
1470
-
1471
- endif;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/LICENSE.txt DELETED
@@ -1,20 +0,0 @@
1
- The MIT License (MIT)
2
-
3
- Copyright (c) 2013 Emanuil Rusev, erusev.com
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy of
6
- this software and associated documentation files (the "Software"), to deal in
7
- the Software without restriction, including without limitation the rights to
8
- use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9
- the Software, and to permit persons to whom the Software is furnished to do so,
10
- subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17
- FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18
- COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19
- IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20
- CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/Parsedown.php DELETED
@@ -1,1402 +0,0 @@
1
- <?php
2
-
3
- #
4
- #
5
- # Parsedown
6
- # http://parsedown.org
7
- #
8
- # (c) Emanuil Rusev
9
- # http://erusev.com
10
- #
11
- # For the full license information, view the LICENSE file that was distributed
12
- # with this source code.
13
- #
14
- #
15
-
16
- class Parsedown
17
- {
18
- #
19
- # Philosophy
20
-
21
- # Parsedown recognises that the Markdown syntax is optimised for humans so
22
- # it tries to read like one. It goes through text line by line. It looks at
23
- # how lines start to identify blocks. It looks for special characters to
24
- # identify inline elements.
25
-
26
- #
27
- # ~
28
-
29
- function text($text)
30
- {
31
- # make sure no definitions are set
32
- $this->Definitions = array();
33
-
34
- # standardize line breaks
35
- $text = str_replace("\r\n", "\n", $text);
36
- $text = str_replace("\r", "\n", $text);
37
-
38
- # replace tabs with spaces
39
- $text = str_replace("\t", ' ', $text);
40
-
41
- # remove surrounding line breaks
42
- $text = trim($text, "\n");
43
-
44
- # split text into lines
45
- $lines = explode("\n", $text);
46
-
47
- # iterate through lines to identify blocks
48
- $markup = $this->lines($lines);
49
-
50
- # trim line breaks
51
- $markup = trim($markup, "\n");
52
-
53
- return $markup;
54
- }
55
-
56
- #
57
- # Setters
58
- #
59
-
60
- private $breaksEnabled;
61
-
62
- function setBreaksEnabled($breaksEnabled)
63
- {
64
- $this->breaksEnabled = $breaksEnabled;
65
-
66
- return $this;
67
- }
68
-
69
- #
70
- # Lines
71
- #
72
-
73
- protected $BlockTypes = array(
74
- '#' => array('Atx'),
75
- '*' => array('Rule', 'List'),
76
- '+' => array('List'),
77
- '-' => array('Setext', 'Table', 'Rule', 'List'),
78
- '0' => array('List'),
79
- '1' => array('List'),
80
- '2' => array('List'),
81
- '3' => array('List'),
82
- '4' => array('List'),
83
- '5' => array('List'),
84
- '6' => array('List'),
85
- '7' => array('List'),
86
- '8' => array('List'),
87
- '9' => array('List'),
88
- ':' => array('Table'),
89
- '<' => array('Comment', 'Markup'),
90
- '=' => array('Setext'),
91
- '>' => array('Quote'),
92
- '_' => array('Rule'),
93
- '`' => array('FencedCode'),
94
- '|' => array('Table'),
95
- '~' => array('FencedCode'),
96
- );
97
-
98
- # ~
99
-
100
- protected $DefinitionTypes = array(
101
- '[' => array('Reference'),
102
- );
103
-
104
- # ~
105
-
106
- protected $unmarkedBlockTypes = array(
107
- 'CodeBlock',
108
- );
109
-
110
- #
111
- # Blocks
112
- #
113
-
114
- private function lines(array $lines)
115
- {
116
- $CurrentBlock = null;
117
-
118
- foreach ($lines as $line)
119
- {
120
- if (chop($line) === '')
121
- {
122
- if (isset($CurrentBlock))
123
- {
124
- $CurrentBlock['interrupted'] = true;
125
- }
126
-
127
- continue;
128
- }
129
-
130
- $indent = 0;
131
-
132
- while (isset($line[$indent]) and $line[$indent] === ' ')
133
- {
134
- $indent ++;
135
- }
136
-
137
- $text = $indent > 0 ? substr($line, $indent) : $line;
138
-
139
- # ~
140
-
141
- $Line = array('body' => $line, 'indent' => $indent, 'text' => $text);
142
-
143
- # ~
144
-
145
- if (isset($CurrentBlock['incomplete']))
146
- {
147
- $Block = $this->{'addTo'.$CurrentBlock['type']}($Line, $CurrentBlock);
148
-
149
- if (isset($Block))
150
- {
151
- $CurrentBlock = $Block;
152
-
153
- continue;
154
- }
155
- else
156
- {
157
- if (method_exists($this, 'complete'.$CurrentBlock['type']))
158
- {
159
- $CurrentBlock = $this->{'complete'.$CurrentBlock['type']}($CurrentBlock);
160
- }
161
-
162
- unset($CurrentBlock['incomplete']);
163
- }
164
- }
165
-
166
- # ~
167
-
168
- $marker = $text[0];
169
-
170
- if (isset($this->DefinitionTypes[$marker]))
171
- {
172
- foreach ($this->DefinitionTypes[$marker] as $definitionType)
173
- {
174
- $Definition = $this->{'identify'.$definitionType}($Line, $CurrentBlock);
175
-
176
- if (isset($Definition))
177
- {
178
- $this->Definitions[$definitionType][$Definition['id']] = $Definition['data'];
179
-
180
- continue 2;
181
- }
182
- }
183
- }
184
-
185
- # ~
186
-
187
- $blockTypes = $this->unmarkedBlockTypes;
188
-
189
- if (isset($this->BlockTypes[$marker]))
190
- {
191
- foreach ($this->BlockTypes[$marker] as $blockType)
192
- {
193
- $blockTypes []= $blockType;
194
- }
195
- }
196
-
197
- #
198
- # ~
199
-
200
- foreach ($blockTypes as $blockType)
201
- {
202
- $Block = $this->{'identify'.$blockType}($Line, $CurrentBlock);
203
-
204
- if (isset($Block))
205
- {
206
- $Block['type'] = $blockType;
207
-
208
- if ( ! isset($Block['identified']))
209
- {
210
- $Elements []= $CurrentBlock['element'];
211
-
212
- $Block['identified'] = true;
213
- }
214
-
215
- if (method_exists($this, 'addTo'.$blockType))
216
- {
217
- $Block['incomplete'] = true;
218
- }
219
-
220
- $CurrentBlock = $Block;
221
-
222
- continue 2;
223
- }
224
- }
225
-
226
- # ~
227
-
228
- if (isset($CurrentBlock) and ! isset($CurrentBlock['type']) and ! isset($CurrentBlock['interrupted']))
229
- {
230
- $CurrentBlock['element']['text'] .= "\n".$text;
231
- }
232
- else
233
- {
234
- $Elements []= $CurrentBlock['element'];
235
-
236
- $CurrentBlock = $this->buildParagraph($Line);
237
-
238
- $CurrentBlock['identified'] = true;
239
- }
240
- }
241
-
242
- # ~
243
-
244
- if (isset($CurrentBlock['incomplete']) and method_exists($this, 'complete'.$CurrentBlock['type']))
245
- {
246
- $CurrentBlock = $this->{'complete'.$CurrentBlock['type']}($CurrentBlock);
247
- }
248
-
249
- # ~
250
-
251
- $Elements []= $CurrentBlock['element'];
252
-
253
- unset($Elements[0]);
254
-
255
- # ~
256
-
257
- $markup = $this->elements($Elements);
258
-
259
- # ~
260
-
261
- return $markup;
262
- }
263
-
264
- #
265
- # Atx
266
-
267
- protected function identifyAtx($Line)
268
- {
269
- if (isset($Line['text'][1]))
270
- {
271
- $level = 1;
272
-
273
- while (isset($Line['text'][$level]) and $Line['text'][$level] === '#')
274
- {
275
- $level ++;
276
- }
277
-
278
- $text = trim($Line['text'], '# ');
279
-
280
- $Block = array(
281
- 'element' => array(
282
- 'name' => 'h' . min(6, $level),
283
- 'text' => $text,
284
- 'handler' => 'line',
285
- ),
286
- );
287
-
288
- return $Block;
289
- }
290
- }
291
-
292
- #
293
- # Code
294
-
295
- protected function identifyCodeBlock($Line)
296
- {
297
- if ($Line['indent'] >= 4)
298
- {
299
- $text = substr($Line['body'], 4);
300
-
301
- $Block = array(
302
- 'element' => array(
303
- 'name' => 'pre',
304
- 'handler' => 'element',
305
- 'text' => array(
306
- 'name' => 'code',
307
- 'text' => $text,
308
- ),
309
- ),
310
- );
311
-
312
- return $Block;
313
- }
314
- }
315
-
316
- protected function addToCodeBlock($Line, $Block)
317
- {
318
- if ($Line['indent'] >= 4)
319
- {
320
- if (isset($Block['interrupted']))
321
- {
322
- $Block['element']['text']['text'] .= "\n";
323
-
324
- unset($Block['interrupted']);
325
- }
326
-
327
- $Block['element']['text']['text'] .= "\n";
328
-
329
- $text = substr($Line['body'], 4);
330
-
331
- $Block['element']['text']['text'] .= $text;
332
-
333
- return $Block;
334
- }
335
- }
336
-
337
- protected function completeCodeBlock($Block)
338
- {
339
- $text = $Block['element']['text']['text'];
340
-
341
- $text = htmlspecialchars($text, ENT_NOQUOTES, 'UTF-8');
342
-
343
- $Block['element']['text']['text'] = $text;
344
-
345
- return $Block;
346
- }
347
-
348
- #
349
- # Comment
350
-
351
- protected function identifyComment($Line)
352
- {
353
- if (isset($Line['text'][3]) and $Line['text'][3] === '-' and $Line['text'][2] === '-' and $Line['text'][1] === '!')
354
- {
355
- $Block = array(
356
- 'element' => $Line['body'],
357
- );
358
-
359
- if (preg_match('/-->$/', $Line['text']))
360
- {
361
- $Block['closed'] = true;
362
- }
363
-
364
- return $Block;
365
- }
366
- }
367
-
368
- protected function addToComment($Line, array $Block)
369
- {
370
- if (isset($Block['closed']))
371
- {
372
- return;
373
- }
374
-
375
- $Block['element'] .= "\n" . $Line['body'];
376
-
377
- if (preg_match('/-->$/', $Line['text']))
378
- {
379
- $Block['closed'] = true;
380
- }
381
-
382
- return $Block;
383
- }
384
-
385
- #
386
- # Fenced Code
387
-
388
- protected function identifyFencedCode($Line)
389
- {
390
- if (preg_match('/^(['.$Line['text'][0].']{3,})[ ]*([\w-]+)?[ ]*$/', $Line['text'], $matches))
391
- {
392
- $Element = array(
393
- 'name' => 'code',
394
- 'text' => '',
395
- );
396
-
397
- if (isset($matches[2]))
398
- {
399
- $class = 'language-'.$matches[2];
400
-
401
- $Element['attributes'] = array(
402
- 'class' => $class,
403
- );
404
- }
405
-
406
- $Block = array(
407
- 'char' => $Line['text'][0],
408
- 'element' => array(
409
- 'name' => 'pre',
410
- 'handler' => 'element',
411
- 'text' => $Element,
412
- ),
413
- );
414
-
415
- return $Block;
416
- }
417
- }
418
-
419
- protected function addToFencedCode($Line, $Block)
420
- {
421
- if (isset($Block['complete']))
422
- {
423
- return;
424
- }
425
-
426
- if (isset($Block['interrupted']))
427
- {
428
- $Block['element']['text']['text'] .= "\n";
429
-
430
- unset($Block['interrupted']);
431
- }
432
-
433
- if (preg_match('/^'.$Block['char'].'{3,}[ ]*$/', $Line['text']))
434
- {
435
- $Block['element']['text']['text'] = substr($Block['element']['text']['text'], 1);
436
-
437
- $Block['complete'] = true;
438
-
439
- return $Block;
440
- }
441
-
442
- $Block['element']['text']['text'] .= "\n".$Line['body'];;
443
-
444
- return $Block;
445
- }
446
-
447
- protected function completeFencedCode($Block)
448
- {
449
- $text = $Block['element']['text']['text'];
450
-
451
- $text = htmlspecialchars($text, ENT_NOQUOTES, 'UTF-8');
452
-
453
- $Block['element']['text']['text'] = $text;
454
-
455
- return $Block;
456
- }
457
-
458
- #
459
- # List
460
-
461
- protected function identifyList($Line)
462
- {
463
- list($name, $pattern) = $Line['text'][0] <= '-' ? array('ul', '[*+-]') : array('ol', '[0-9]+[.]');
464
-
465
- if (preg_match('/^('.$pattern.'[ ]+)(.*)/', $Line['text'], $matches))
466
- {
467
- $Block = array(
468
- 'indent' => $Line['indent'],
469
- 'pattern' => $pattern,
470
- 'element' => array(
471
- 'name' => $name,
472
- 'handler' => 'elements',
473
- ),
474
- );
475
-
476
- $Block['li'] = array(
477
- 'name' => 'li',
478
- 'handler' => 'li',
479
- 'text' => array(
480
- $matches[2],
481
- ),
482
- );
483
-
484
- $Block['element']['text'] []= & $Block['li'];
485
-
486
- return $Block;
487
- }
488
- }
489
-
490
- protected function addToList($Line, array $Block)
491
- {
492
- if ($Block['indent'] === $Line['indent'] and preg_match('/^'.$Block['pattern'].'[ ]+(.*)/', $Line['text'], $matches))
493
- {
494
- if (isset($Block['interrupted']))
495
- {
496
- $Block['li']['text'] []= '';
497
-
498
- unset($Block['interrupted']);
499
- }
500
-
501
- unset($Block['li']);
502
-
503
- $Block['li'] = array(
504
- 'name' => 'li',
505
- 'handler' => 'li',
506
- 'text' => array(
507
- $matches[1],
508
- ),
509
- );
510
-
511
- $Block['element']['text'] []= & $Block['li'];
512
-
513
- return $Block;
514
- }
515
-
516
- if ( ! isset($Block['interrupted']))
517
- {
518
- $text = preg_replace('/^[ ]{0,4}/', '', $Line['body']);
519
-
520
- $Block['li']['text'] []= $text;
521
-
522
- return $Block;
523
- }
524
-
525
- if ($Line['indent'] > 0)
526
- {
527
- $Block['li']['text'] []= '';
528
-
529
- $text = preg_replace('/^[ ]{0,4}/', '', $Line['body']);
530
-
531
- $Block['li']['text'] []= $text;
532
-
533
- unset($Block['interrupted']);
534
-
535
- return $Block;
536
- }
537
- }
538
-
539
- #
540
- # Quote
541
-
542
- protected function identifyQuote($Line)
543
- {
544
- if (preg_match('/^>[ ]?(.*)/', $Line['text'], $matches))
545
- {
546
- $Block = array(
547
- 'element' => array(
548
- 'name' => 'blockquote',
549
- 'handler' => 'lines',
550
- 'text' => (array) $matches[1],
551
- ),
552
- );
553
-
554
- return $Block;
555
- }
556
- }
557
-
558
- protected function addToQuote($Line, array $Block)
559
- {
560
- if ($Line['text'][0] === '>' and preg_match('/^>[ ]?(.*)/', $Line['text'], $matches))
561
- {
562
- if (isset($Block['interrupted']))
563
- {
564
- $Block['element']['text'] []= '';
565
-
566
- unset($Block['interrupted']);
567
- }
568
-
569
- $Block['element']['text'] []= $matches[1];
570
-
571
- return $Block;
572
- }
573
-
574
- if ( ! isset($Block['interrupted']))
575
- {
576
- $Block['element']['text'] []= $Line['text'];
577
-
578
- return $Block;
579
- }
580
- }
581
-
582
- #
583
- # Rule
584
-
585
- protected function identifyRule($Line)
586
- {
587
- if (preg_match('/^(['.$Line['text'][0].'])([ ]{0,2}\1){2,}[ ]*$/', $Line['text']))
588
- {
589
- $Block = array(
590
- 'element' => array(
591
- 'name' => 'hr'
592
- ),
593
- );
594
-
595
- return $Block;
596
- }
597
- }
598
-
599
- #
600
- # Setext
601
-
602
- protected function identifySetext($Line, array $Block = null)
603
- {
604
- if ( ! isset($Block) or isset($Block['type']) or isset($Block['interrupted']))
605
- {
606
- return;
607
- }
608
-
609
- if (chop($Line['text'], $Line['text'][0]) === '')
610
- {
611
- $Block['element']['name'] = $Line['text'][0] === '=' ? 'h1' : 'h2';
612
-
613
- return $Block;
614
- }
615
- }
616
-
617
- #
618
- # Markup
619
-
620
- protected function identifyMarkup($Line)
621
- {
622
- if (preg_match('/^<(\w[\w\d]*)(?:[ ][^>]*)?(\/?)[ ]*>/', $Line['text'], $matches))
623
- {
624
- if (in_array($matches[1], $this->textLevelElements))
625
- {
626
- return;
627
- }
628
-
629
- $Block = array(
630
- 'element' => $Line['body'],
631
- );
632
-
633
- if ($matches[2] or $matches[1] === 'hr' or preg_match('/<\/'.$matches[1].'>[ ]*$/', $Line['text']))
634
- {
635
- $Block['closed'] = true;
636
- }
637
- else
638
- {
639
- $Block['depth'] = 0;
640
- $Block['name'] = $matches[1];
641
- }
642
-
643
- return $Block;
644
- }
645
- }
646
-
647
- protected function addToMarkup($Line, array $Block)
648
- {
649
- if (isset($Block['closed']))
650
- {
651
- return;
652
- }
653
-
654
- if (preg_match('/<'.$Block['name'].'([ ][^\/]+)?>/', $Line['text'])) # opening tag
655
- {
656
- $Block['depth'] ++;
657
- }
658
-
659
- if (stripos($Line['text'], '</'.$Block['name'].'>') !== false) # closing tag
660
- {
661
- if ($Block['depth'] > 0)
662
- {
663
- $Block['depth'] --;
664
- }
665
- else
666
- {
667
- $Block['closed'] = true;
668
- }
669
- }
670
-
671
- $Block['element'] .= "\n".$Line['body'];
672
-
673
- return $Block;
674
- }
675
-
676
- #
677
- # Table
678
-
679
- protected function identifyTable($Line, array $Block = null)
680
- {
681
- if ( ! isset($Block) or isset($Block['type']) or isset($Block['interrupted']))
682
- {
683
- return;
684
- }
685
-
686
- if (strpos($Block['element']['text'], '|') !== false and chop($Line['text'], ' -:|') === '')
687
- {
688
- $alignments = array();
689
-
690
- $divider = $Line['text'];
691
-
692
- $divider = trim($divider);
693
- $divider = trim($divider, '|');
694
-
695
- $dividerCells = explode('|', $divider);
696
-
697
- foreach ($dividerCells as $dividerCell)
698
- {
699
- $dividerCell = trim($dividerCell);
700
-
701
- if ($dividerCell === '')
702
- {
703
- continue;
704
- }
705
-
706
- $alignment = null;
707
-
708
- if ($dividerCell[0] === ':')
709
- {
710
- $alignment = 'left';
711
- }
712
-
713
- if (substr($dividerCell, -1) === ':')
714
- {
715
- $alignment = $alignment === 'left' ? 'center' : 'right';
716
- }
717
-
718
- $alignments []= $alignment;
719
- }
720
-
721
- # ~
722
-
723
- $HeaderElements = array();
724
-
725
- $header = $Block['element']['text'];
726
-
727
- $header = trim($header);
728
- $header = trim($header, '|');
729
-
730
- $headerCells = explode('|', $header);
731
-
732
- foreach ($headerCells as $index => $headerCell)
733
- {
734
- $headerCell = trim($headerCell);
735
-
736
- $HeaderElement = array(
737
- 'name' => 'th',
738
- 'text' => $headerCell,
739
- 'handler' => 'line',
740
- );
741
-
742
- if (isset($alignments[$index]))
743
- {
744
- $alignment = $alignments[$index];
745
-
746
- $HeaderElement['attributes'] = array(
747
- 'align' => $alignment,
748
- );
749
- }
750
-
751
- $HeaderElements []= $HeaderElement;
752
- }
753
-
754
- # ~
755
-
756
- $Block = array(
757
- 'alignments' => $alignments,
758
- 'identified' => true,
759
- 'element' => array(
760
- 'name' => 'table',
761
- 'handler' => 'elements',
762
- ),
763
- );
764
-
765
- $Block['element']['text'] []= array(
766
- 'name' => 'thead',
767
- 'handler' => 'elements',
768
- );
769
-
770
- $Block['element']['text'] []= array(
771
- 'name' => 'tbody',
772
- 'handler' => 'elements',
773
- 'text' => array(),
774
- );
775
-
776
- $Block['element']['text'][0]['text'] []= array(
777
- 'name' => 'tr',
778
- 'handler' => 'elements',
779
- 'text' => $HeaderElements,
780
- );
781
-
782
- return $Block;
783
- }
784
- }
785
-
786
- protected function addToTable($Line, array $Block)
787
- {
788
- if ($Line['text'][0] === '|' or strpos($Line['text'], '|'))
789
- {
790
- $Elements = array();
791
-
792
- $row = $Line['text'];
793
-
794
- $row = trim($row);
795
- $row = trim($row, '|');
796
-
797
- $cells = explode('|', $row);
798
-
799
- foreach ($cells as $index => $cell)
800
- {
801
- $cell = trim($cell);
802
-
803
- $Element = array(
804
- 'name' => 'td',
805
- 'handler' => 'line',
806
- 'text' => $cell,
807
- );
808
-
809
- if (isset($Block['alignments'][$index]))
810
- {
811
- $Element['attributes'] = array(
812
- 'align' => $Block['alignments'][$index],
813
- );
814
- }
815
-
816
- $Elements []= $Element;
817
- }
818
-
819
- $Element = array(
820
- 'name' => 'tr',
821
- 'handler' => 'elements',
822
- 'text' => $Elements,
823
- );
824
-
825
- $Block['element']['text'][1]['text'] []= $Element;
826
-
827
- return $Block;
828
- }
829
- }
830
-
831
- #
832
- # Definitions
833
- #
834
-
835
- protected function identifyReference($Line)
836
- {
837
- if (preg_match('/^\[(.+?)\]:[ ]*<?(\S+?)>?(?:[ ]+["\'(](.+)["\')])?[ ]*$/', $Line['text'], $matches))
838
- {
839
- $Definition = array(
840
- 'id' => strtolower($matches[1]),
841
- 'data' => array(
842
- 'url' => $matches[2],
843
- ),
844
- );
845
-
846
- if (isset($matches[3]))
847
- {
848
- $Definition['data']['title'] = $matches[3];
849
- }
850
-
851
- return $Definition;
852
- }
853
- }
854
-
855
- #
856
- # ~
857
- #
858
-
859
- protected function buildParagraph($Line)
860
- {
861
- $Block = array(
862
- 'element' => array(
863
- 'name' => 'p',
864
- 'text' => $Line['text'],
865
- 'handler' => 'line',
866
- ),
867
- );
868
-
869
- return $Block;
870
- }
871
-
872
- #
873
- # ~
874
- #
875
-
876
- protected function element(array $Element)
877
- {
878
- $markup = '<'.$Element['name'];
879
-
880
- if (isset($Element['attributes']))
881
- {
882
- foreach ($Element['attributes'] as $name => $value)
883
- {
884
- $markup .= ' '.$name.'="'.$value.'"';
885
- }
886
- }
887
-
888
- if (isset($Element['text']))
889
- {
890
- $markup .= '>';
891
-
892
- if (isset($Element['handler']))
893
- {
894
- $markup .= $this->$Element['handler']($Element['text']);
895
- }
896
- else
897
- {
898
- $markup .= $Element['text'];
899
- }
900
-
901
- $markup .= '</'.$Element['name'].'>';
902
- }
903
- else
904
- {
905
- $markup .= ' />';
906
- }
907
-
908
- return $markup;
909
- }
910
-
911
- protected function elements(array $Elements)
912
- {
913
- $markup = '';
914
-
915
- foreach ($Elements as $Element)
916
- {
917
- if ($Element === null)
918
- {
919
- continue;
920
- }
921
-
922
- $markup .= "\n";
923
-
924
- if (is_string($Element)) # because of Markup
925
- {
926
- $markup .= $Element;
927
-
928
- continue;
929
- }
930
-
931
- $markup .= $this->element($Element);
932
- }
933
-
934
- $markup .= "\n";
935
-
936
- return $markup;
937
- }
938
-
939
- #
940
- # Spans
941
- #
942
-
943
- protected $SpanTypes = array(
944
- '!' => array('Link'), # ?
945
- '&' => array('Ampersand'),
946
- '*' => array('Emphasis'),
947
- '/' => array('Url'),
948
- '<' => array('UrlTag', 'EmailTag', 'Tag', 'LessThan'),
949
- '[' => array('Link'),
950
- '_' => array('Emphasis'),
951
- '`' => array('InlineCode'),
952
- '~' => array('Strikethrough'),
953
- '\\' => array('EscapeSequence'),
954
- );
955
-
956
- # ~
957
-
958
- protected $spanMarkerList = '*_!&[</`~\\';
959
-
960
- #
961
- # ~
962
- #
963
-
964
- public function line($text)
965
- {
966
- $markup = '';
967
-
968
- $remainder = $text;
969
-
970
- $markerPosition = 0;
971
-
972
- while ($excerpt = strpbrk($remainder, $this->spanMarkerList))
973
- {
974
- $marker = $excerpt[0];
975
-
976
- $markerPosition += strpos($remainder, $marker);
977
-
978
- $Excerpt = array('text' => $excerpt, 'context' => $text);
979
-
980
- foreach ($this->SpanTypes[$marker] as $spanType)
981
- {
982
- $handler = 'identify'.$spanType;
983
-
984
- $Span = $this->$handler($Excerpt);
985
-
986
- if ( ! isset($Span))
987
- {
988
- continue;
989
- }
990
-
991
- # The identified span can be ahead of the marker.
992
-
993
- if (isset($Span['position']) and $Span['position'] > $markerPosition)
994
- {
995
- continue;
996
- }
997
-
998
- # Spans that start at the position of their marker don't have to set a position.
999
-
1000
- if ( ! isset($Span['position']))
1001
- {
1002
- $Span['position'] = $markerPosition;
1003
- }
1004
-
1005
- $plainText = substr($text, 0, $Span['position']);
1006
-
1007
- $markup .= $this->readPlainText($plainText);
1008
-
1009
- $markup .= isset($Span['markup']) ? $Span['markup'] : $this->element($Span['element']);
1010
-
1011
- $text = substr($text, $Span['position'] + $Span['extent']);
1012
-
1013
- $remainder = $text;
1014
-
1015
- $markerPosition = 0;
1016
-
1017
- continue 2;
1018
- }
1019
-
1020
- $remainder = substr($excerpt, 1);
1021
-
1022
- $markerPosition ++;
1023
- }
1024
-
1025
- $markup .= $this->readPlainText($text);
1026
-
1027
- return $markup;
1028
- }
1029
-
1030
- #
1031
- # ~
1032
- #
1033
-
1034
- protected function identifyUrl($Excerpt)
1035
- {
1036
- if ( ! isset($Excerpt['text'][1]) or $Excerpt['text'][1] !== '/')
1037
- {
1038
- return;
1039
- }
1040
-
1041
- if (preg_match('/\bhttps?:[\/]{2}[^\s<]+\b\/*/ui', $Excerpt['context'], $matches, PREG_OFFSET_CAPTURE))
1042
- {
1043
- $url = str_replace(array('&', '<'), array('&amp;', '&lt;'), $matches[0][0]);
1044
-
1045
- return array(
1046
- 'extent' => strlen($matches[0][0]),
1047
- 'position' => $matches[0][1],
1048
- 'element' => array(
1049
- 'name' => 'a',
1050
- 'text' => $url,
1051
- 'attributes' => array(
1052
- 'href' => $url,
1053
- ),
1054
- ),
1055
- );
1056
- }
1057
- }
1058
-
1059
- protected function identifyAmpersand($Excerpt)
1060
- {
1061
- if ( ! preg_match('/^&#?\w+;/', $Excerpt['text']))
1062
- {
1063
- return array(
1064
- 'markup' => '&amp;',
1065
- 'extent' => 1,
1066
- );
1067
- }
1068
- }
1069
-
1070
- protected function identifyStrikethrough($Excerpt)
1071
- {
1072
- if ( ! isset($Excerpt['text'][1]))
1073
- {
1074
- return;
1075
- }
1076
-
1077
- if ($Excerpt['text'][1] === '~' and preg_match('/^~~(?=\S)(.+?)(?<=\S)~~/', $Excerpt['text'], $matches))
1078
- {
1079
- return array(
1080
- 'extent' => strlen($matches[0]),
1081
- 'element' => array(
1082
- 'name' => 'del',
1083
- 'text' => $matches[1],
1084
- 'handler' => 'line',
1085
- ),
1086
- );
1087
- }
1088
- }
1089
-
1090
- protected function identifyEscapeSequence($Excerpt)
1091
- {
1092
- if (isset($Excerpt['text'][1]) and in_array($Excerpt['text'][1], $this->specialCharacters))
1093
- {
1094
- return array(
1095
- 'markup' => $Excerpt['text'][1],
1096
- 'extent' => 2,
1097
- );
1098
- }
1099
- }
1100
-
1101
- protected function identifyLessThan()
1102
- {
1103
- return array(
1104
- 'markup' => '&lt;',
1105
- 'extent' => 1,
1106
- );
1107
- }
1108
-
1109
- protected function identifyUrlTag($Excerpt)
1110
- {
1111
- if (strpos($Excerpt['text'], '>') !== false and preg_match('/^<(https?:[\/]{2}[^\s]+?)>/i', $Excerpt['text'], $matches))
1112
- {
1113
- $url = str_replace(array('&', '<'), array('&amp;', '&lt;'), $matches[1]);
1114
-
1115
- return array(
1116
- 'extent' => strlen($matches[0]),
1117
- 'element' => array(
1118
- 'name' => 'a',
1119
- 'text' => $url,
1120
- 'attributes' => array(
1121
- 'href' => $url,
1122
- ),
1123
- ),
1124
- );
1125
- }
1126
- }
1127
-
1128
- protected function identifyEmailTag($Excerpt)
1129
- {
1130
- if (strpos($Excerpt['text'], '>') !== false and preg_match('/^<(\S+?@\S+?)>/', $Excerpt['text'], $matches))
1131
- {
1132
- return array(
1133
- 'extent' => strlen($matches[0]),
1134
- 'element' => array(
1135
- 'name' => 'a',
1136
- 'text' => $matches[1],
1137
- 'attributes' => array(
1138
- 'href' => 'mailto:'.$matches[1],
1139
- ),
1140
- ),
1141
- );
1142
- }
1143
- }
1144
-
1145
- protected function identifyTag($Excerpt)
1146
- {
1147
- if (strpos($Excerpt['text'], '>') !== false and preg_match('/^<\/?\w.*?>/', $Excerpt['text'], $matches))
1148
- {
1149
- return array(
1150
- 'markup' => $matches[0],
1151
- 'extent' => strlen($matches[0]),
1152
- );
1153
- }
1154
- }
1155
-
1156
- protected function identifyInlineCode($Excerpt)
1157
- {
1158
- $marker = $Excerpt['text'][0];
1159
-
1160
- if (preg_match('/^('.$marker.'+)[ ]*(.+?)[ ]*(?<!'.$marker.')\1(?!'.$marker.')/', $Excerpt['text'], $matches))
1161
- {
1162
- $text = $matches[2];
1163
- $text = htmlspecialchars($text, ENT_NOQUOTES, 'UTF-8');
1164
-
1165
- return array(
1166
- 'extent' => strlen($matches[0]),
1167
- 'element' => array(
1168
- 'name' => 'code',
1169
- 'text' => $text,
1170
- ),
1171
- );
1172
- }
1173
- }
1174
-
1175
- protected function identifyLink($Excerpt)
1176
- {
1177
- $extent = $Excerpt['text'][0] === '!' ? 1 : 0;
1178
-
1179
- if (strpos($Excerpt['text'], ']') and preg_match('/\[((?:[^][]|(?R))*)\]/', $Excerpt['text'], $matches))
1180
- {
1181
- $Link = array('text' => $matches[1], 'label' => strtolower($matches[1]));
1182
-
1183
- $extent += strlen($matches[0]);
1184
-
1185
- $substring = substr($Excerpt['text'], $extent);
1186
-
1187
- if (preg_match('/^\s*\[([^][]+)\]/', $substring, $matches))
1188
- {
1189
- $Link['label'] = strtolower($matches[1]);
1190
-
1191
- if (isset($this->Definitions['Reference'][$Link['label']]))
1192
- {
1193
- $Link += $this->Definitions['Reference'][$Link['label']];
1194
-
1195
- $extent += strlen($matches[0]);
1196
- }
1197
- else
1198
- {
1199
- return;
1200
- }
1201
- }
1202
- elseif (isset($this->Definitions['Reference'][$Link['label']]))
1203
- {
1204
- $Link += $this->Definitions['Reference'][$Link['label']];
1205
-
1206
- if (preg_match('/^[ ]*\[\]/', $substring, $matches))
1207
- {
1208
- $extent += strlen($matches[0]);
1209
- }
1210
- }
1211
- elseif (preg_match('/^\([ ]*(.*?)(?:[ ]+[\'"](.+?)[\'"])?[ ]*\)/', $substring, $matches))
1212
- {
1213
- $Link['url'] = $matches[1];
1214
-
1215
- if (isset($matches[2]))
1216
- {
1217
- $Link['title'] = $matches[2];
1218
- }
1219
-
1220
- $extent += strlen($matches[0]);
1221
- }
1222
- else
1223
- {
1224
- return;
1225
- }
1226
- }
1227
- else
1228
- {
1229
- return;
1230
- }
1231
-
1232
- $url = str_replace(array('&', '<'), array('&amp;', '&lt;'), $Link['url']);
1233
-
1234
- if ($Excerpt['text'][0] === '!')
1235
- {
1236
- $Element = array(
1237
- 'name' => 'img',
1238
- 'attributes' => array(
1239
- 'alt' => $Link['text'],
1240
- 'src' => $url,
1241
- ),
1242
- );
1243
- }
1244
- else
1245
- {
1246
- $Element = array(
1247
- 'name' => 'a',
1248
- 'handler' => 'line',
1249
- 'text' => $Link['text'],
1250
- 'attributes' => array(
1251
- 'href' => $url,
1252
- ),
1253
- );
1254
- }
1255
-
1256
- if (isset($Link['title']))
1257
- {
1258
- $Element['attributes']['title'] = $Link['title'];
1259
- }
1260
-
1261
- return array(
1262
- 'extent' => $extent,
1263
- 'element' => $Element,
1264
- );
1265
- }
1266
-
1267
- protected function identifyEmphasis($Excerpt)
1268
- {
1269
- if ( ! isset($Excerpt['text'][1]))
1270
- {
1271
- return;
1272
- }
1273
-
1274
- $marker = $Excerpt['text'][0];
1275
-
1276
- if ($Excerpt['text'][1] === $marker and preg_match($this->StrongRegex[$marker], $Excerpt['text'], $matches))
1277
- {
1278
- $emphasis = 'strong';
1279
- }
1280
- elseif (preg_match($this->EmRegex[$marker], $Excerpt['text'], $matches))
1281
- {
1282
- $emphasis = 'em';
1283
- }
1284
- else
1285
- {
1286
- return;
1287
- }
1288
-
1289
- return array(
1290
- 'extent' => strlen($matches[0]),
1291
- 'element' => array(
1292
- 'name' => $emphasis,
1293
- 'handler' => 'line',
1294
- 'text' => $matches[1],
1295
- ),
1296
- );
1297
- }
1298
-
1299
- #
1300
- # ~
1301
-
1302
- protected function readPlainText($text)
1303
- {
1304
- $breakMarker = $this->breaksEnabled ? "\n" : " \n";
1305
-
1306
- $text = str_replace($breakMarker, "<br />\n", $text);
1307
-
1308
- return $text;
1309
- }
1310
-
1311
- #
1312
- # ~
1313
- #
1314
-
1315
- protected function li($lines)
1316
- {
1317
- $markup = $this->lines($lines);
1318
-
1319
- $trimmedMarkup = trim($markup);
1320
-
1321
- if ( ! in_array('', $lines) and substr($trimmedMarkup, 0, 3) === '<p>')
1322
- {
1323
- $markup = $trimmedMarkup;
1324
- $markup = substr($markup, 3);
1325
-
1326
- $position = strpos($markup, "</p>");
1327
-
1328
- $markup = substr_replace($markup, '', $position, 4);
1329
- }
1330
-
1331
- return $markup;
1332
- }
1333
-
1334
- #
1335
- # Multiton
1336
- #
1337
-
1338
- static function instance($name = 'default')
1339
- {
1340
- if (isset(self::$instances[$name]))
1341
- {
1342
- return self::$instances[$name];
1343
- }
1344
-
1345
- $instance = new self();
1346
-
1347
- self::$instances[$name] = $instance;
1348
-
1349
- return $instance;
1350
- }
1351
-
1352
- private static $instances = array();
1353
-
1354
- #
1355
- # Deprecated Methods
1356
- #
1357
-
1358
- /**
1359
- * @deprecated in favor of "text"
1360
- */
1361
- function parse($text)
1362
- {
1363
- $markup = $this->text($text);
1364
-
1365
- return $markup;
1366
- }
1367
-
1368
- #
1369
- # Fields
1370
- #
1371
-
1372
- protected $Definitions;
1373
-
1374
- #
1375
- # Read-only
1376
-
1377
- protected $specialCharacters = array(
1378
- '\\', '`', '*', '_', '{', '}', '[', ']', '(', ')', '>', '#', '+', '-', '.', '!',
1379
- );
1380
-
1381
- protected $StrongRegex = array(
1382
- '*' => '/^[*]{2}((?:[^*]|[*][^*]*[*])+?)[*]{2}(?![*])/s',
1383
- '_' => '/^__((?:[^_]|_[^_]*_)+?)__(?!_)/us',
1384
- );
1385
-
1386
- protected $EmRegex = array(
1387
- '*' => '/^[*]((?:[^*]|[*][*][^*]+?[*][*])+?)[*](?![*])/s',
1388
- '_' => '/^_((?:[^_]|__[^_]*__)+?)_(?!_)\b/us',
1389
- );
1390
-
1391
- protected $textLevelElements = array(
1392
- 'a', 'br', 'bdo', 'abbr', 'blink', 'nextid', 'acronym', 'basefont',
1393
- 'b', 'em', 'big', 'cite', 'small', 'spacer', 'listing',
1394
- 'i', 'rp', 'del', 'code', 'strike', 'marquee',
1395
- 'q', 'rt', 'ins', 'font', 'strong',
1396
- 's', 'tt', 'sub', 'mark',
1397
- 'u', 'xm', 'sup', 'nobr',
1398
- 'var', 'ruby',
1399
- 'wbr', 'span',
1400
- 'time',
1401
- );
1402
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/README.md DELETED
@@ -1,43 +0,0 @@
1
- ## Parsedown
2
-
3
- Better [Markdown](http://en.wikipedia.org/wiki/Markdown) parser for PHP.
4
-
5
- [[ demo ]](http://parsedown.org/demo)
6
-
7
- ### Features
8
-
9
- * [Fast](http://parsedown.org/speed)
10
- * [Consistent](http://parsedown.org/consistency)
11
- * [GitHub Flavored](https://help.github.com/articles/github-flavored-markdown)
12
- * [Tested](http://parsedown.org/tests/) in PHP 5.2, 5.3, 5.4, 5.5, 5.6 and [hhvm](http://www.hhvm.com/)
13
- * Extensible
14
- * [Markdown Extra extension](https://github.com/erusev/parsedown-extra) <sup>new</sup>
15
- * [JavaScript port](https://github.com/hkdobrev/parsedown.js) under development <sup>new</sup>
16
-
17
- ### Installation
18
-
19
- Include `Parsedown.php` or install [the composer package](https://packagist.org/packages/erusev/parsedown).
20
-
21
- ### Example
22
-
23
- ``` php
24
- $Parsedown = new Parsedown();
25
-
26
- echo $Parsedown->text('Hello _Parsedown_!'); # prints: <p>Hello <em>Parsedown</em>!</p>
27
- ```
28
-
29
- More examples in [the wiki](https://github.com/erusev/parsedown/wiki/Usage) and in [this video tutorial](http://youtu.be/wYZBY8DEikI).
30
-
31
- ### Questions
32
-
33
- **How does Parsedown work?**<br/>
34
- Parsedown recognises that the Markdown syntax is optimised for humans so it tries to read like one. It goes through text line by line. It looks at how lines start to identify blocks. It looks for special characters to identify inline elements.
35
-
36
- **Why doesn’t Parsedown use namespaces?**<br/>
37
- Using namespaces would mean dropping support for PHP 5.2. We believe that since Parsedown is a single class with an uncommon name, making this trade wouldn't be worth it.
38
-
39
- **Is Parsedown compliant with CommonMark?**<br/>
40
- We are [working on it](https://github.com/erusev/parsedown/tree/commonmark).
41
-
42
- **Who uses Parsedown?**<br/>
43
- [phpDocumentor](http://www.phpdoc.org/), [Bolt CMS](http://bolt.cm/), [RaspberryPi.org](http://www.raspberrypi.org/) and [more](https://www.versioneye.com/php/erusev:parsedown/references).
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/composer.json DELETED
@@ -1,18 +0,0 @@
1
- {
2
- "name": "erusev/parsedown",
3
- "description": "Parser for Markdown.",
4
- "keywords": ["markdown", "parser"],
5
- "homepage": "http://parsedown.org",
6
- "type": "library",
7
- "license": "MIT",
8
- "authors": [
9
- {
10
- "name": "Emanuil Rusev",
11
- "email": "hello@erusev.com",
12
- "homepage": "http://erusev.com"
13
- }
14
- ],
15
- "autoload": {
16
- "psr-0": {"Parsedown": ""}
17
- }
18
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/phpunit.xml.dist DELETED
@@ -1,8 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <phpunit bootstrap="test/bootstrap.php" colors="true">
3
- <testsuites>
4
- <testsuite>
5
- <file>test/Test.php</file>
6
- </testsuite>
7
- </testsuites>
8
- </phpunit>
 
 
 
 
 
 
 
 
trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/Test.php DELETED
@@ -1,65 +0,0 @@
1
- <?php
2
-
3
- class Test extends PHPUnit_Framework_TestCase
4
- {
5
- public function __construct($name = null, array $data = array(), $dataName = '')
6
- {
7
- $this->dataDir = dirname(__FILE__).'/data/';
8
-
9
- parent::__construct($name, $data, $dataName);
10
- }
11
-
12
- private $dataDir;
13
-
14
- /**
15
- * @dataProvider data
16
- */
17
- function test_($filename)
18
- {
19
- $markdown = file_get_contents($this->dataDir . $filename . '.md');
20
-
21
- $expectedMarkup = file_get_contents($this->dataDir . $filename . '.html');
22
-
23
- $expectedMarkup = str_replace("\r\n", "\n", $expectedMarkup);
24
- $expectedMarkup = str_replace("\r", "\n", $expectedMarkup);
25
-
26
- $actualMarkup = Parsedown::instance()->text($markdown);
27
-
28
- $this->assertEquals($expectedMarkup, $actualMarkup);
29
- }
30
-
31
- function data()
32
- {
33
- $data = array();
34
-
35
- $Folder = new DirectoryIterator($this->dataDir);
36
-
37
- foreach ($Folder as $File)
38
- {
39
- /** @var $File DirectoryIterator */
40
-
41
- if ( ! $File->isFile())
42
- {
43
- continue;
44
- }
45
-
46
- $filename = $File->getFilename();
47
-
48
- $extension = pathinfo($filename, PATHINFO_EXTENSION);
49
-
50
- if ($extension !== 'md')
51
- {
52
- continue;
53
- }
54
-
55
- $basename = $File->getBasename('.md');
56
-
57
- if (file_exists($this->dataDir . $basename . '.html'))
58
- {
59
- $data []= array($basename);
60
- }
61
- }
62
-
63
- return $data;
64
- }
65
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/bootstrap.php DELETED
@@ -1,3 +0,0 @@
1
- <?php
2
-
3
- include 'Parsedown.php';
 
 
 
trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/HTML_Comment.html DELETED
@@ -1,5 +0,0 @@
1
- <!-- single line -->
2
- <p>paragraph</p>
3
- <!--
4
- multiline -->
5
- <p>paragraph</p>
 
 
 
 
 
trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/HTML_Comment.md DELETED
@@ -1,8 +0,0 @@
1
- <!-- single line -->
2
-
3
- paragraph
4
-
5
- <!--
6
- multiline -->
7
-
8
- paragraph
 
 
 
 
 
 
 
 
trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/aesthetic_table.html DELETED
@@ -1,18 +0,0 @@
1
- <table>
2
- <thead>
3
- <tr>
4
- <th>header 1</th>
5
- <th>header 2</th>
6
- </tr>
7
- </thead>
8
- <tbody>
9
- <tr>
10
- <td>cell 1.1</td>
11
- <td>cell 1.2</td>
12
- </tr>
13
- <tr>
14
- <td>cell 2.1</td>
15
- <td>cell 2.2</td>
16
- </tr>
17
- </tbody>
18
- </table>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/aesthetic_table.md DELETED
@@ -1,4 +0,0 @@
1
- | header 1 | header 2 |
2
- | -------- | -------- |
3
- | cell 1.1 | cell 1.2 |
4
- | cell 2.1 | cell 2.2 |
 
 
 
 
trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/aligned_table.html DELETED
@@ -1,21 +0,0 @@
1
- <table>
2
- <thead>
3
- <tr>
4
- <th align="left">header 1</th>
5
- <th align="center">header 2</th>
6
- <th align="right">header 2</th>
7
- </tr>
8
- </thead>
9
- <tbody>
10
- <tr>
11
- <td align="left">cell 1.1</td>
12
- <td align="center">cell 1.2</td>
13
- <td align="right">cell 1.3</td>
14
- </tr>
15
- <tr>
16
- <td align="left">cell 2.1</td>
17
- <td align="center">cell 2.2</td>
18
- <td align="right">cell 2.3</td>
19
- </tr>
20
- </tbody>
21
- </table>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/aligned_table.md DELETED
@@ -1,4 +0,0 @@
1
- | header 1 | header 2 | header 2 |
2
- | :------- | :------: | -------: |
3
- | cell 1.1 | cell 1.2 | cell 1.3 |
4
- | cell 2.1 | cell 2.2 | cell 2.3 |
 
 
 
 
trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/atx_heading.html DELETED
@@ -1,9 +0,0 @@
1
- <h1>h1</h1>
2
- <h2>h2</h2>
3
- <h3>h3</h3>
4
- <h4>h4</h4>
5
- <h5>h5</h5>
6
- <h6>h6</h6>
7
- <h6>h6</h6>
8
- <h1>closed h1</h1>
9
- <p>#</p>
 
 
 
 
 
 
 
 
 
trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/atx_heading.md DELETED
@@ -1,17 +0,0 @@
1
- # h1
2
-
3
- ## h2
4
-
5
- ### h3
6
-
7
- #### h4
8
-
9
- ##### h5
10
-
11
- ###### h6
12
-
13
- ####### h6
14
-
15
- # closed h1 #
16
-
17
- #
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/automatic_link.html DELETED
@@ -1 +0,0 @@
1
- <p><a href="http://example.com">http://example.com</a></p>
 
trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/automatic_link.md DELETED
@@ -1 +0,0 @@
1
- <http://example.com>
 
trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/block-level_html.html DELETED
@@ -1,13 +0,0 @@
1
- <div>_content_</div>
2
- <p>sparse:</p>
3
- <div>
4
- <div class="inner">
5
- _content_
6
- </div>
7
- </div>
8
- <p>paragraph</p>
9
- <style type="text/css">
10
- p {
11
- color: red;
12
- }
13
- </style>
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/block-level_html.md DELETED
@@ -1,17 +0,0 @@
1
- <div>_content_</div>
2
-
3
- sparse:
4
-
5
- <div>
6
- <div class="inner">
7
- _content_
8
- </div>
9
- </div>
10
-
11
- paragraph
12
-
13
- <style type="text/css">
14
- p {
15
- color: red;
16
- }
17
- </style>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/code_block.html DELETED
@@ -1,8 +0,0 @@
1
- <pre><code>&lt;?php
2
-
3
- $message = 'Hello World!';
4
- echo $message;</code></pre>
5
- <hr />
6
- <pre><code>&gt; not a quote
7
- - not a list item
8
- [not a reference]: http://foo.com</code></pre>
 
 
 
 
 
 
 
 
trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/code_block.md DELETED
@@ -1,10 +0,0 @@
1
- <?php
2
-
3
- $message = 'Hello World!';
4
- echo $message;
5
-
6
- ---
7
-
8
- > not a quote
9
- - not a list item
10
- [not a reference]: http://foo.com
 
 
 
 
 
 
 
 
 
 
trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/code_span.html DELETED
@@ -1,6 +0,0 @@
1
- <p>a <code>code span</code></p>
2
- <p><code>this is also a codespan</code> trailing text</p>
3
- <p><code>and look at this one!</code></p>
4
- <p>single backtick in a code span: <code>`</code></p>
5
- <p>backtick-delimited string in a code span: <code>`foo`</code></p>
6
- <p><code>sth `` sth</code></p>
 
 
 
 
 
 
trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/code_span.md DELETED
@@ -1,11 +0,0 @@
1
- a `code span`
2
-
3
- `this is also a codespan` trailing text
4
-
5
- `and look at this one!`
6
-
7
- single backtick in a code span: `` ` ``
8
-
9
- backtick-delimited string in a code span: `` `foo` ``
10
-
11
- `sth `` sth`
 
 
 
 
 
 
 
 
 
 
 
trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/compound_blockquote.html DELETED
@@ -1,9 +0,0 @@
1
- <blockquote>
2
- <h2>header</h2>
3
- <p>paragraph</p>
4
- <ul>
5
- <li>li</li>
6
- </ul>
7
- <hr />
8
- <p>paragraph</p>
9
- </blockquote>
 
 
 
 
 
 
 
 
 
trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/compound_blockquote.md DELETED
@@ -1,10 +0,0 @@
1
- > header
2
- > ------
3
- >
4
- > paragraph
5
- >
6
- > - li
7
- >
8
- > ---
9
- >
10
- > paragraph
 
 
 
 
 
 
 
 
 
 
trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/compound_emphasis.html DELETED
@@ -1,2 +0,0 @@
1
- <p><em><code>code</code></em> <strong><code>code</code></strong></p>
2
- <p><em><code>code</code><strong><code>code</code></strong><code>code</code></em></p>
 
 
trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/compound_emphasis.md DELETED
@@ -1,4 +0,0 @@
1
- _`code`_ __`code`__
2
-
3
- *`code`**`code`**`code`*
4
-
 
 
 
 
trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/compound_list.html DELETED
@@ -1,12 +0,0 @@
1
- <ul>
2
- <li>
3
- <p>paragraph</p>
4
- <p>paragraph</p>
5
- </li>
6
- <li>
7
- <p>paragraph</p>
8
- <blockquote>
9
- <p>quote</p>
10
- </blockquote>
11
- </li>
12
- </ul>
 
 
 
 
 
 
 
 
 
 
 
 
trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/compound_list.md DELETED
@@ -1,7 +0,0 @@
1
- - paragraph
2
-
3
- paragraph
4
-
5
- - paragraph
6
-
7
- > quote
 
 
 
 
 
 
 
trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/deeply_nested_list.html DELETED
@@ -1,12 +0,0 @@
1
- <ul>
2
- <li>li
3
- <ul>
4
- <li>li
5
- <ul>
6
- <li>li</li>
7
- <li>li</li>
8
- </ul></li>
9
- <li>li</li>
10
- </ul></li>
11
- <li>li</li>
12
- </ul>
 
 
 
 
 
 
 
 
 
 
 
 
trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/deeply_nested_list.md DELETED
@@ -1,6 +0,0 @@
1
- - li
2
- - li
3
- - li
4
- - li
5
- - li
6
- - li
 
 
 
 
 
 
trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/em_strong.html DELETED
@@ -1,8 +0,0 @@
1
- <p><strong><em>em strong</em></strong></p>
2
- <p><strong><em>em strong</em> strong</strong></p>
3
- <p><strong>strong <em>em strong</em></strong></p>
4
- <p><strong>strong <em>em strong</em> strong</strong></p>
5
- <p><strong><em>em strong</em></strong></p>
6
- <p><strong><em>em strong</em> strong</strong></p>
7
- <p><strong>strong <em>em strong</em></strong></p>
8
- <p><strong>strong <em>em strong</em> strong</strong></p>
 
 
 
 
 
 
 
 
trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/em_strong.md DELETED
@@ -1,15 +0,0 @@
1
- ___em strong___
2
-
3
- ___em strong_ strong__
4
-
5
- __strong _em strong___
6
-
7
- __strong _em strong_ strong__
8
-
9
- ***em strong***
10
-
11
- ***em strong* strong**
12
-
13
- **strong *em strong***
14
-
15
- **strong *em strong* strong**
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/email.html DELETED
@@ -1 +0,0 @@
1
- <p>my email is <a href="mailto:me@example.com">me@example.com</a></p>
 
trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/email.md DELETED
@@ -1 +0,0 @@
1
- my email is <me@example.com>
 
trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/emphasis.html DELETED
@@ -1,8 +0,0 @@
1
- <p><em>underscore</em>, <em>asterisk</em>, <em>one two</em>, <em>three four</em>, <em>a</em>, <em>b</em></p>
2
- <p><strong>strong</strong> and <em>em</em> and <strong>strong</strong> and <em>em</em></p>
3
- <p><em>line
4
- line
5
- line</em></p>
6
- <p>this_is_not_an_emphasis</p>
7
- <p>an empty emphasis __ ** is not an emphasis</p>
8
- <p>*mixed *<em>double and</em> single asterisk** spans</p>
 
 
 
 
 
 
 
 
trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/emphasis.md DELETED
@@ -1,13 +0,0 @@
1
- _underscore_, *asterisk*, _one two_, *three four*, _a_, *b*
2
-
3
- **strong** and *em* and **strong** and *em*
4
-
5
- _line
6
- line
7
- line_
8
-
9
- this_is_not_an_emphasis
10
-
11
- an empty emphasis __ ** is not an emphasis
12
-
13
- *mixed **double and* single asterisk** spans
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/escaping.html DELETED
@@ -1,4 +0,0 @@
1
- <p>escaped *emphasis*.</p>
2
- <p><code>escaped \*emphasis\* in a code span</code></p>
3
- <pre><code>escaped \*emphasis\* in a code block</code></pre>
4
- <p>\ ` * _ { } [ ] ( ) > # + - . !</p>
 
 
 
 
trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/escaping.md DELETED
@@ -1,7 +0,0 @@
1
- escaped \*emphasis\*.
2
-
3
- `escaped \*emphasis\* in a code span`
4
-
5
- escaped \*emphasis\* in a code block
6
-
7
- \\ \` \* \_ \{ \} \[ \] \( \) \> \# \+ \- \. \!
 
 
 
 
 
 
 
trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/fenced_code_block.html DELETED
@@ -1,6 +0,0 @@
1
- <pre><code>&lt;?php
2
-
3
- $message = 'fenced code block';
4
- echo $message;</code></pre>
5
- <pre><code>tilde</code></pre>
6
- <pre><code class="language-php">echo 'language identifier';</code></pre>
 
 
 
 
 
 
trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/fenced_code_block.md DELETED
@@ -1,14 +0,0 @@
1
- ```
2
- <?php
3
-
4
- $message = 'fenced code block';
5
- echo $message;
6
- ```
7
-
8
- ~~~
9
- tilde
10
- ~~~
11
-
12
- ```php
13
- echo 'language identifier';
14
- ```
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/horizontal_rule.html DELETED
@@ -1,5 +0,0 @@
1
- <hr />
2
- <hr />
3
- <hr />
4
- <hr />
5
- <hr />
 
 
 
 
 
trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/horizontal_rule.md DELETED
@@ -1,9 +0,0 @@
1
- ---
2
-
3
- - - -
4
-
5
- - - -
6
-
7
- ***
8
-
9
- ___
 
 
 
 
 
 
 
 
 
trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/html_entity.html DELETED
@@ -1 +0,0 @@
1
- <p>&amp; &copy; &#123;</p>
 
trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/html_entity.md DELETED
@@ -1 +0,0 @@
1
- &amp; &copy; &#123;
 
trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/image_reference.html DELETED
@@ -1 +0,0 @@
1
- <p><img alt="Markdown Logo" src="/md.png" /></p>
 
trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/image_reference.md DELETED
@@ -1,3 +0,0 @@
1
- ![Markdown Logo][image]
2
-
3
- [image]: /md.png
 
 
 
trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/image_title.html DELETED
@@ -1 +0,0 @@
1
- <p><img alt="alt" src="/md.png" title="title" /></p>
 
trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/image_title.md DELETED
@@ -1 +0,0 @@
1
- ![alt](/md.png "title")
 
trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/implicit_reference.html DELETED
@@ -1,4 +0,0 @@
1
- <p>an <a href="http://example.com">implicit</a> reference link</p>
2
- <p>an <a href="http://example.com">implicit</a> reference link with an empty link definition</p>
3
- <p>an <a href="http://example.com">implicit</a> reference link followed by <a href="http://cnn.com">another</a></p>
4
- <p>an <a href="http://example.com" title="Example">explicit</a> reference link with a title</p>
 
 
 
 
trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/implicit_reference.md DELETED
@@ -1,13 +0,0 @@
1
- an [implicit] reference link
2
-
3
- [implicit]: http://example.com
4
-
5
- an [implicit][] reference link with an empty link definition
6
-
7
- an [implicit][] reference link followed by [another][]
8
-
9
- [another]: http://cnn.com
10
-
11
- an [explicit][example] reference link with a title
12
-
13
- [example]: http://example.com "Example"
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/inline_link.html DELETED
@@ -1,4 +0,0 @@
1
- <p><a href="http://example.com">link</a> and <a href="/tests/">another link</a></p>
2
- <p><a href="http://example.com"><code>link</code></a></p>
3
- <p><a href="http://example.com"><img alt="MD Logo" src="http://parsedown.org/md.png" /></a></p>
4
- <p><a href="http://example.com"><img alt="MD Logo" src="http://parsedown.org/md.png" /> and text</a></p>
 
 
 
 
trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/inline_link.md DELETED
@@ -1,7 +0,0 @@
1
- [link](http://example.com) and [another link](/tests/)
2
-
3
- [`link`](http://example.com)
4
-
5
- [![MD Logo](http://parsedown.org/md.png)](http://example.com)
6
-
7
- [![MD Logo](http://parsedown.org/md.png) and text](http://example.com)
 
 
 
 
 
 
 
trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/inline_link_title.html DELETED
@@ -1 +0,0 @@
1
- <p><a href="http://example.com" title="Title">single quotes</a> and <a href="http://example.com" title="Title">double quotes</a></p>
 
trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/inline_link_title.md DELETED
@@ -1 +0,0 @@
1
- [single quotes](http://example.com 'Title') and [double quotes](http://example.com "Title")
 
trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/inline_title.html DELETED
@@ -1 +0,0 @@
1
- <p><a href="http://example.com" title="Example">single quotes</a> and <a href="http://example.com" title="Example">double quotes</a></p>
 
trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/inline_title.md DELETED
@@ -1 +0,0 @@
1
- [single quotes](http://example.com 'Example') and [double quotes](http://example.com "Example")
 
trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/lazy_blockquote.html DELETED
@@ -1,6 +0,0 @@
1
- <blockquote>
2
- <p>quote
3
- the rest of it</p>
4
- <p>another paragraph
5
- the rest of it</p>
6
- </blockquote>
 
 
 
 
 
 
trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/lazy_blockquote.md DELETED
@@ -1,5 +0,0 @@
1
- > quote
2
- the rest of it
3
-
4
- > another paragraph
5
- the rest of it
 
 
 
 
 
trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/lazy_list.html DELETED
@@ -1,4 +0,0 @@
1
- <ul>
2
- <li>li
3
- the rest of it</li>
4
- </ul>
 
 
 
 
trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/lazy_list.md DELETED
@@ -1,2 +0,0 @@
1
- - li
2
- the rest of it
 
 
trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/line_break.html DELETED
@@ -1,2 +0,0 @@
1
- <p>line<br />
2
- line</p>
 
 
trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/line_break.md DELETED
@@ -1,2 +0,0 @@
1
- line
2
- line
 
 
trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/multiline_list_paragraph.html DELETED
@@ -1,7 +0,0 @@
1
- <ul>
2
- <li>
3
- <p>li</p>
4
- <p>line
5
- line</p>
6
- </li>
7
- </ul>
 
 
 
 
 
 
 
trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/multiline_list_paragraph.md DELETED
@@ -1,4 +0,0 @@
1
- - li
2
-
3
- line
4
- line
 
 
 
 
trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/nested_block-level_html.html DELETED
@@ -1,10 +0,0 @@
1
- <div>
2
- _parent_
3
- <div>
4
- _child_
5
- </div>
6
- <pre>
7
- _adopted child_
8
- </pre>
9
- </div>
10
- <p><em>outside</em></p>
 
 
 
 
 
 
 
 
 
 
trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/nested_block-level_html.md DELETED
@@ -1,11 +0,0 @@
1
- <div>
2
- _parent_
3
- <div>
4
- _child_
5
- </div>
6
- <pre>
7
- _adopted child_
8
- </pre>
9
- </div>
10
-
11
- _outside_
 
 
 
 
 
 
 
 
 
 
 
trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/ordered_list.html DELETED
@@ -1,13 +0,0 @@
1
- <ol>
2
- <li>one</li>
3
- <li>two</li>
4
- </ol>
5
- <p>repeating numbers:</p>
6
- <ol>
7
- <li>one</li>
8
- <li>two</li>
9
- </ol>
10
- <p>large numbers:</p>
11
- <ol>
12
- <li>one</li>
13
- </ol>
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/ordered_list.md DELETED
@@ -1,11 +0,0 @@
1
- 1. one
2
- 2. two
3
-
4
- repeating numbers:
5
-
6
- 1. one
7
- 1. two
8
-
9
- large numbers:
10
-
11
- 123. one
 
 
 
 
 
 
 
 
 
 
 
trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/paragraph_list.html DELETED
@@ -1,12 +0,0 @@
1
- <p>paragraph</p>
2
- <ul>
3
- <li>li</li>
4
- <li>li</li>
5
- </ul>
6
- <p>paragraph</p>
7
- <ul>
8
- <li>
9
- <p>li</p>
10
- </li>
11
- <li>li</li>
12
- </ul>
 
 
 
 
 
 
 
 
 
 
 
 
trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/paragraph_list.md DELETED
@@ -1,9 +0,0 @@
1
- paragraph
2
- - li
3
- - li
4
-
5
- paragraph
6
-
7
- * li
8
-
9
- * li
 
 
 
 
 
 
 
 
 
trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/reference_title.html DELETED
@@ -1,2 +0,0 @@
1
- <p><a href="http://example.com" title="example title">double quotes</a> and <a href="http://example.com" title="example title">single quotes</a> and <a href="http://example.com" title="example title">parentheses</a></p>
2
- <p>[invalid title]: <a href="http://example.com">http://example.com</a> example title</p>
 
 
trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/reference_title.md DELETED
@@ -1,6 +0,0 @@
1
- [double quotes] and [single quotes] and [parentheses]
2
-
3
- [double quotes]: http://example.com "example title"
4
- [single quotes]: http://example.com 'example title'
5
- [parentheses]: http://example.com (example title)
6
- [invalid title]: http://example.com example title
 
 
 
 
 
 
trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/self-closing_html.html DELETED
@@ -1,12 +0,0 @@
1
- <hr>
2
- <p>paragraph</p>
3
- <hr/>
4
- <p>paragraph</p>
5
- <hr />
6
- <p>paragraph</p>
7
- <hr class="foo" id="bar" />
8
- <p>paragraph</p>
9
- <hr class="foo" id="bar"/>
10
- <p>paragraph</p>
11
- <hr class="foo" id="bar" >
12
- <p>paragraph</p>
 
 
 
 
 
 
 
 
 
 
 
 
trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/self-closing_html.md DELETED
@@ -1,12 +0,0 @@
1
- <hr>
2
- paragraph
3
- <hr/>
4
- paragraph
5
- <hr />
6
- paragraph
7
- <hr class="foo" id="bar" />
8
- paragraph
9
- <hr class="foo" id="bar"/>
10
- paragraph
11
- <hr class="foo" id="bar" >
12
- paragraph
 
 
 
 
 
 
 
 
 
 
 
 
trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/separated_nested_list.html DELETED
@@ -1,9 +0,0 @@
1
- <ul>
2
- <li>
3
- <p>li</p>
4
- <ul>
5
- <li>li</li>
6
- <li>li</li>
7
- </ul>
8
- </li>
9
- </ul>
 
 
 
 
 
 
 
 
 
trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/separated_nested_list.md DELETED
@@ -1,4 +0,0 @@
1
- - li
2
-
3
- - li
4
- - li
 
 
 
 
trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/setext_header.html DELETED
@@ -1,5 +0,0 @@
1
- <h1>h1</h1>
2
- <h2>h2</h2>
3
- <h2>single character</h2>
4
- <p>not a header</p>
5
- <hr />
 
 
 
 
 
trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/setext_header.md DELETED
@@ -1,12 +0,0 @@
1
- h1
2
- ==
3
-
4
- h2
5
- --
6
-
7
- single character
8
- -
9
-
10
- not a header
11
-
12
- ------------
 
 
 
 
 
 
 
 
 
 
 
 
trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/simple_blockquote.html DELETED
@@ -1,11 +0,0 @@
1
- <blockquote>
2
- <p>quote</p>
3
- </blockquote>
4
- <p>indented:</p>
5
- <blockquote>
6
- <p>quote</p>
7
- </blockquote>
8
- <p>no space after <code>&gt;</code>:</p>
9
- <blockquote>
10
- <p>quote</p>
11
- </blockquote>
 
 
 
 
 
 
 
 
 
 
 
trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/simple_blockquote.md DELETED
@@ -1,7 +0,0 @@
1
- > quote
2
-
3
- indented:
4
- > quote
5
-
6
- no space after `>`:
7
- >quote
 
 
 
 
 
 
 
trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/simple_table.html DELETED
@@ -1,37 +0,0 @@
1
- <table>
2
- <thead>
3
- <tr>
4
- <th>header 1</th>
5
- <th>header 2</th>
6
- </tr>
7
- </thead>
8
- <tbody>
9
- <tr>
10
- <td>cell 1.1</td>
11
- <td>cell 1.2</td>
12
- </tr>
13
- <tr>
14
- <td>cell 2.1</td>
15
- <td>cell 2.2</td>
16
- </tr>
17
- </tbody>
18
- </table>
19
- <hr />
20
- <table>
21
- <thead>
22
- <tr>
23
- <th align="left">header 1</th>
24
- <th>header 2</th>
25
- </tr>
26
- </thead>
27
- <tbody>
28
- <tr>
29
- <td align="left">cell 1.1</td>
30
- <td>cell 1.2</td>
31
- </tr>
32
- <tr>
33
- <td align="left">cell 2.1</td>
34
- <td>cell 2.2</td>
35
- </tr>
36
- </tbody>
37
- </table>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/simple_table.md DELETED
@@ -1,11 +0,0 @@
1
- header 1 | header 2
2
- -------- | --------
3
- cell 1.1 | cell 1.2
4
- cell 2.1 | cell 2.2
5
-
6
- ---
7
-
8
- header 1 | header 2
9
- :------- | --------
10
- cell 1.1 | cell 1.2
11
- cell 2.1 | cell 2.2
 
 
 
 
 
 
 
 
 
 
 
trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/span-level_html.html DELETED
@@ -1,5 +0,0 @@
1
- <p>an <b>important</b> <a href=''>link</a></p>
2
- <p>broken<br/>
3
- line</p>
4
- <p><b>inline tag</b> at the beginning</p>
5
- <p><span><a href="http://example.com">http://example.com</a></span></p>
 
 
 
 
 
trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/span-level_html.md DELETED
@@ -1,8 +0,0 @@
1
- an <b>important</b> <a href=''>link</a>
2
-
3
- broken<br/>
4
- line
5
-
6
- <b>inline tag</b> at the beginning
7
-
8
- <span>http://example.com</span>
 
 
 
 
 
 
 
 
trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/sparse_dense_list.html DELETED
@@ -1,7 +0,0 @@
1
- <ul>
2
- <li>
3
- <p>li</p>
4
- </li>
5
- <li>li</li>
6
- <li>li</li>
7
- </ul>
 
 
 
 
 
 
 
trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/sparse_dense_list.md DELETED
@@ -1,4 +0,0 @@
1
- - li
2
-
3
- - li
4
- - li
 
 
 
 
trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/sparse_list.html DELETED
@@ -1,15 +0,0 @@
1
- <ul>
2
- <li>
3
- <p>li</p>
4
- </li>
5
- <li>li</li>
6
- </ul>
7
- <hr />
8
- <ul>
9
- <li>
10
- <p>li</p>
11
- <ul>
12
- <li>indented li</li>
13
- </ul>
14
- </li>
15
- </ul>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/sparse_list.md DELETED
@@ -1,9 +0,0 @@
1
- - li
2
-
3
- - li
4
-
5
- ---
6
-
7
- - li
8
-
9
- - indented li
 
 
 
 
 
 
 
 
 
trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/special_characters.html DELETED
@@ -1,6 +0,0 @@
1
- <p>AT&amp;T has an ampersand in their name</p>
2
- <p>this &amp; that</p>
3
- <p>4 &lt; 5 and 6 > 5</p>
4
- <p><a href="http://example.com/autolink?a=1&amp;b=2">http://example.com/autolink?a=1&amp;b=2</a></p>
5
- <p><a href="/script?a=1&amp;b=2">inline link</a></p>
6
- <p><a href="http://example.com/?a=1&amp;b=2">reference link</a></p>
 
 
 
 
 
 
trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/special_characters.md DELETED
@@ -1,13 +0,0 @@
1
- AT&T has an ampersand in their name
2
-
3
- this & that
4
-
5
- 4 < 5 and 6 > 5
6
-
7
- <http://example.com/autolink?a=1&b=2>
8
-
9
- [inline link](/script?a=1&b=2)
10
-
11
- [reference link][1]
12
-
13
- [1]: http://example.com/?a=1&b=2
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/strikethrough.html DELETED
@@ -1,3 +0,0 @@
1
- <p><del>strikethrough</del></p>
2
- <p>here's <del>one</del> followed by <del>another one</del></p>
3
- <p>~~ this ~~ is not one neither is ~this~</p>
 
 
 
trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/strikethrough.md DELETED
@@ -1,5 +0,0 @@
1
- ~~strikethrough~~
2
-
3
- here's ~~one~~ followed by ~~another one~~
4
-
5
- ~~ this ~~ is not one neither is ~this~
 
 
 
 
 
trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/strong_em.html DELETED
@@ -1,6 +0,0 @@
1
- <p><em>em <strong>strong em</strong></em></p>
2
- <p><em><strong>strong em</strong> em</em></p>
3
- <p><em>em <strong>strong em</strong> em</em></p>
4
- <p><em>em <strong>strong em</strong></em></p>
5
- <p><em><strong>strong em</strong> em</em></p>
6
- <p><em>em <strong>strong em</strong> em</em></p>
 
 
 
 
 
 
trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/strong_em.md DELETED
@@ -1,11 +0,0 @@
1
- *em **strong em***
2
-
3
- ***strong em** em*
4
-
5
- *em **strong em** em*
6
-
7
- _em __strong em___
8
-
9
- ___strong em__ em_
10
-
11
- _em __strong em__ em_
 
 
 
 
 
 
 
 
 
 
 
trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/tab-indented_code_block.html DELETED
@@ -1,6 +0,0 @@
1
- <pre><code>&lt;?php
2
-
3
- $message = 'Hello World!';
4
- echo $message;
5
-
6
- echo "following a blank line";</code></pre>
 
 
 
 
 
 
trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/tab-indented_code_block.md DELETED
@@ -1,6 +0,0 @@
1
- <?php
2
-
3
- $message = 'Hello World!';
4
- echo $message;
5
-
6
- echo "following a blank line";
 
 
 
 
 
 
trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/table_inline_markdown.html DELETED
@@ -1,18 +0,0 @@
1
- <table>
2
- <thead>
3
- <tr>
4
- <th><em>header</em> 1</th>
5
- <th>header 2</th>
6
- </tr>
7
- </thead>
8
- <tbody>
9
- <tr>
10
- <td><em>cell</em> 1.1</td>
11
- <td><del>cell</del> 1.2</td>
12
- </tr>
13
- <tr>
14
- <td><code>cell</code> 2.1</td>
15
- <td>cell 2.2</td>
16
- </tr>
17
- </tbody>
18
- </table>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/table_inline_markdown.md DELETED
@@ -1,4 +0,0 @@
1
- | _header_ 1 | header 2 |
2
- | ------------ | ------------ |
3
- | _cell_ 1.1 | ~~cell~~ 1.2 |
4
- | `cell` 2.1 | cell 2.2 |
 
 
 
 
trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/text_reference.html DELETED
@@ -1,8 +0,0 @@
1
- <p><a href="http://example.com">reference link</a></p>
2
- <p><a href="http://example.com">one</a> with a semantic name</p>
3
- <p>[one][404] with no definition</p>
4
- <p><a href="http://example.com">multiline
5
- one</a> defined on 2 lines</p>
6
- <p><a href="http://example.com">one</a> with a mixed case label and an upper case definition</p>
7
- <p><a href="http://example.com">one</a> with the a label on the next line</p>
8
- <p><a href="http://example.com"><code>link</code></a></p>
 
 
 
 
 
 
 
 
trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/text_reference.md DELETED
@@ -1,21 +0,0 @@
1
- [reference link][1]
2
-
3
- [1]: http://example.com
4
-
5
- [one][website] with a semantic name
6
-
7
- [website]: http://example.com
8
-
9
- [one][404] with no definition
10
-
11
- [multiline
12
- one][website] defined on 2 lines
13
-
14
- [one][Label] with a mixed case label and an upper case definition
15
-
16
- [LABEL]: http://example.com
17
-
18
- [one]
19
- [1] with the a label on the next line
20
-
21
- [`link`][website]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/unordered_list.html DELETED
@@ -1,10 +0,0 @@
1
- <ul>
2
- <li>li</li>
3
- <li>li</li>
4
- </ul>
5
- <p>mixed markers:</p>
6
- <ul>
7
- <li>li</li>
8
- <li>li</li>
9
- <li>li</li>
10
- </ul>
 
 
 
 
 
 
 
 
 
 
trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/unordered_list.md DELETED
@@ -1,8 +0,0 @@
1
- - li
2
- - li
3
-
4
- mixed markers:
5
-
6
- * li
7
- + li
8
- - li
 
 
 
 
 
 
 
 
trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/untidy_table.html DELETED
@@ -1,18 +0,0 @@
1
- <table>
2
- <thead>
3
- <tr>
4
- <th>header 1</th>
5
- <th>header 2</th>
6
- </tr>
7
- </thead>
8
- <tbody>
9
- <tr>
10
- <td>cell 1.1</td>
11
- <td>cell 1.2</td>
12
- </tr>
13
- <tr>
14
- <td>cell 2.1</td>
15
- <td>cell 2.2</td>
16
- </tr>
17
- </tbody>
18
- </table>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/untidy_table.md DELETED
@@ -1,4 +0,0 @@
1
- | header 1 | header 2 |
2
- | ------------- | ----------- |
3
- | cell 1.1 | cell 1.2 |
4
- | cell 2.1 | cell 2.2 |
 
 
 
 
trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/url_autolinking.html DELETED
@@ -1,3 +0,0 @@
1
- <p>an autolink <a href="http://example.com">http://example.com</a></p>
2
- <p>inside of brackets [<a href="http://example.com">http://example.com</a>], inside of braces {<a href="http://example.com">http://example.com</a>}, inside of parentheses (<a href="http://example.com">http://example.com</a>)</p>
3
- <p>trailing slash <a href="http://example.com/">http://example.com/</a> and <a href="http://example.com/path/">http://example.com/path/</a></p>
 
 
 
trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/url_autolinking.md DELETED
@@ -1,5 +0,0 @@
1
- an autolink http://example.com
2
-
3
- inside of brackets [http://example.com], inside of braces {http://example.com}, inside of parentheses (http://example.com)
4
-
5
- trailing slash http://example.com/ and http://example.com/path/
 
 
 
 
 
trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/whitespace.html DELETED
@@ -1 +0,0 @@
1
- <pre><code>code</code></pre>
 
trunk/includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/whitespace.md DELETED
@@ -1,5 +0,0 @@
1
-
2
-
3
- code
4
-
5
-
 
 
 
 
 
trunk/includes/libraries/aihrus-framework/includes/libraries/wp_custom_post_status.php DELETED
@@ -1,234 +0,0 @@
1
- <?php
2
- if ( class_exists ( 'wp_custom_post_status' ) ) {
3
- return;
4
- }
5
-
6
- // No, Thanks. Direct file access forbidden.
7
- ! defined( 'ABSPATH' ) AND exit;
8
- /*
9
- Plugin Name: Custom Post Status
10
- Plugin URI: http://
11
- Description: Adds a custom post status for posts, pages or custom post types
12
- Author: Franz Josef Kaiser
13
- Version: 2012-06-14.1426
14
- Author URI: http://unserkaiser.com/
15
- License: MIT
16
- */
17
-
18
-
19
-
20
- class wp_custom_post_status
21
- {
22
- /**
23
- * Name of the post status
24
- * Must be lower case
25
- *
26
- * @access protected
27
- * @var string
28
- */
29
- public $post_status;
30
-
31
-
32
- /**
33
- * Post type (slug) where the post status should appear
34
- *
35
- * @access protected
36
- * @var string/array
37
- */
38
- public $post_type = array( 'post', 'page' );
39
-
40
-
41
- /**
42
- * Custom Args for the post status
43
- *
44
- * @access protected
45
- * @var string
46
- */
47
- public $args;
48
-
49
-
50
- /**
51
- * Track jQuery firing
52
- *
53
- * @access protected
54
- * @var boolean
55
- */
56
- private static $jquery_ran = false;
57
-
58
-
59
- /**
60
- * Construct
61
- * @return void
62
- */
63
- public function __construct()
64
- {
65
- #echo '<pre>'; print_r( $this ); echo '</pre>';
66
- // We need to have at least a post status name
67
- if ( ! isset( $this->post_status ) )
68
- return;
69
-
70
- add_action( 'init', array( $this, 'add_post_status' ), 0 );
71
-
72
- foreach ( array( 'post', 'post-new' ) as $hook )
73
- add_action( "admin_footer-{$hook}.php", array( $this,'extend_submitdiv_post_status' ) );
74
- }
75
-
76
-
77
- /**
78
- * Add a new post status of "Unavailable"
79
- *
80
- * @return void
81
- */
82
- public function add_post_status()
83
- {
84
- $defaults = array(
85
- 'label_count' => false
86
- // defaults to FALSE
87
- ,'hierarchical' => false
88
- // defaults to FALSE
89
- ,'public' => true
90
- // If NULL, then inherits "public"
91
- ,'publicly_queryable' => null
92
-
93
- // most important switch
94
- ,'internal' => false
95
- // If NULL, inherits from "internal"
96
- ,'exclude_from_search' => null
97
- // If NULL, inherits from "internal"
98
- ,'show_in_admin_all_list' => null
99
- // If NULL, inherits from "internal"
100
- ,'show_in_admin_status_list' => null
101
-
102
- // If NULL, will be set to FALSE
103
- ,'protected' => null
104
- // If NULL, will be set to FALSE
105
- ,'private' => null
106
- // not set by the core function - defaults to NULL
107
- ,'show_in_admin_all' => null
108
- // defaults to "post"
109
- ,'capability_type' => 'post'
110
- ,'single_view_cap' => null
111
- // @internal use only - don't touch
112
- ,'_builtin' => false
113
- ,'_edit_link' => 'post.php?post=%d'
114
- );
115
-
116
- // if FALSE, will take the 1st fn arg
117
- $defaults['label'] = __(
118
- ucwords( str_replace(
119
- array( '_', '-' )
120
- ,array( ' ', ' ' )
121
- ,$this->post_status
122
- ) )
123
- ,'cps_textdomain'
124
- );
125
-
126
- // Care about counters:
127
- // If FALSE, will be set to array( $args->label, $args->label ), which is not desired
128
- $defaults['label_count'] = _n_noop(
129
- "{$defaults['label']} <span class='count'>(%s)</span>"
130
- ,"{$defaults['label']} <span class='count'>(%s)</span>"
131
- ,'cps_textdomain'
132
- );
133
-
134
- // Register the status: Merge Args with defaults
135
- register_post_status(
136
- $this->post_status
137
- ,wp_parse_args(
138
- $this->args
139
- ,$defaults
140
- )
141
- );
142
- }
143
-
144
-
145
- /**
146
- * Adds post status to the "submitdiv" Meta Box and post type WP List Table screens
147
- *
148
- * @return void
149
- */
150
- public function extend_submitdiv_post_status()
151
- {
152
- if ( self::$jquery_ran )
153
- return;
154
- else
155
- self::$jquery_ran = true;
156
-
157
- // Abort if we're on the wrong post type, but only if we got a restriction
158
- if ( empty( $this->post_type ) )
159
- return;
160
-
161
- global $post_type;
162
- if ( is_array( $this->post_type ) )
163
- {
164
- if ( in_array( $post_type, $this->post_type ) )
165
- return;
166
- }
167
- elseif ( $this->post_type !== $post_type )
168
- {
169
- return;
170
- }
171
-
172
- // Our post status and post type objects
173
- global $wp_post_statuses, $post;
174
-
175
- // Get all non-builtin post status and add them as <option>
176
- $options = $display = '';
177
- foreach ( $wp_post_statuses as $status )
178
- {
179
- if ( ! empty( $status->internal ) )
180
- continue;
181
-
182
- if ( ! empty( $status->private ) )
183
- continue;
184
-
185
- if ( ! empty( $status->protected ) )
186
- continue;
187
-
188
- if ( empty( $status->_builtin ) )
189
- {
190
- if ( ! empty( $status->label_count['domain'] ) && 'cps_textdomain' != $status->label_count['domain'] )
191
- continue;
192
-
193
- }
194
-
195
- // Match against the current posts status
196
- $selected = selected( $post->post_status, $status->name, false );
197
-
198
- // If we one of our custom post status is selected, remember it
199
- $selected AND $display = $status->label;
200
-
201
- // Build the options
202
- $options .= "<option{$selected} value='{$status->name}'>{$status->label}</option>";
203
-
204
- }
205
- ?>
206
- <script type="text/javascript">
207
- jQuery( document ).ready( function($)
208
- {
209
- var appended = false;
210
-
211
- <?php
212
- // Add the selected post status label to the "Status: [Name] (Edit)"
213
- if ( ! empty( $display ) ) :
214
- ?>
215
- $( '#post-status-display' ).html( '<?php echo $display; ?>' )
216
- <?php
217
- endif;
218
-
219
- // Add the options to the <select> element
220
- ?>
221
- $( '.edit-post-status' ).on( 'click', function()
222
- {
223
- if ( !appended )
224
- {
225
- var select = $( '#post-status-select' ).find( 'select' );
226
- $( select ).append( "<?php echo $options; ?>" );
227
- appended = true;
228
- }
229
- } );
230
- } );
231
- </script>
232
- <?php
233
- }
234
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/includes/libraries/aihrus-framework/interface-aihrus-common.php DELETED
@@ -1,27 +0,0 @@
1
- <?php
2
- /*
3
- Copyright 2014 Michael Cannon (email: mc@aihr.us)
4
-
5
- This program is free software; you can redistribute it and/or modify
6
- it under the terms of the GNU General Public License, version 2, as
7
- published by the Free Software Foundation.
8
-
9
- This program is distributed in the hope that it will be useful,
10
- but WITHOUT ANY WARRANTY; without even the implied warranty of
11
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
- GNU General Public License for more details.
13
-
14
- You should have received a copy of the GNU General Public License
15
- along with this program; if not, write to the Free Software
16
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17
- */
18
-
19
- if ( class_exists( 'Aihrus_Common_Interface' ) )
20
- return;
21
-
22
-
23
- interface Aihrus_Common_Interface {
24
- }
25
-
26
-
27
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/includes/libraries/aihrus-framework/interface-aihrus-licensing.php DELETED
@@ -1,28 +0,0 @@
1
- <?php
2
- /*
3
- Copyright 2014 Michael Cannon (email: mc@aihr.us)
4
-
5
- This program is free software; you can redistribute it and/or modify
6
- it under the terms of the GNU General Public License, version 2, as
7
- published by the Free Software Foundation.
8
-
9
- This program is distributed in the hope that it will be useful,
10
- but WITHOUT ANY WARRANTY; without even the implied warranty of
11
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
- GNU General Public License for more details.
13
-
14
- You should have received a copy of the GNU General Public License
15
- along with this program; if not, write to the Free Software
16
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17
- */
18
-
19
- if ( class_exists( 'Aihrus_Licensing_Interface' ) )
20
- return;
21
-
22
-
23
- interface Aihrus_Licensing_Interface {
24
- public function settings( $settings );
25
- }
26
-
27
-
28
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/includes/libraries/aihrus-framework/interface-aihrus-widget.php DELETED
@@ -1,33 +0,0 @@
1
- <?php
2
- /*
3
- Copyright 2014 Michael Cannon (email: mc@aihr.us)
4
-
5
- This program is free software; you can redistribute it and/or modify
6
- it under the terms of the GNU General Public License, version 2, as
7
- published by the Free Software Foundation.
8
-
9
- This program is distributed in the hope that it will be useful,
10
- but WITHOUT ANY WARRANTY; without even the implied warranty of
11
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
- GNU General Public License for more details.
13
-
14
- You should have received a copy of the GNU General Public License
15
- along with this program; if not, write to the Free Software
16
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17
- */
18
-
19
- if ( class_exists( 'Aihrus_Widget_Interface' ) )
20
- return;
21
-
22
-
23
- interface Aihrus_Widget_Interface {
24
- public static function form_instance( $instance );
25
- public static function form_parts( $instance, $number );
26
- public static function get_content( $instance, $widget_number );
27
- public static function get_defaults();
28
- public static function get_suggest( $id, $suggest_id );
29
- public static function validate_settings( $instance );
30
- }
31
-
32
-
33
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/includes/libraries/aihrus-framework/requirements.php DELETED
@@ -1,270 +0,0 @@
1
- <?php
2
- /*
3
- Copyright 2014 Michael Cannon (email: mc@aihr.us)
4
-
5
- This program is free software; you can redistribute it and/or modify
6
- it under the terms of the GNU General Public License, version 2, as
7
- published by the Free Software Foundation.
8
-
9
- This program is distributed in the hope that it will be useful,
10
- but WITHOUT ANY WARRANTY; without even the implied warranty of
11
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
- GNU General Public License for more details.
13
-
14
- You should have received a copy of the GNU General Public License
15
- along with this program; if not, write to the Free Software
16
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17
- */
18
-
19
- if ( ! defined( 'AIHR_BASE' ) )
20
- define( 'AIHR_BASE', __FILE__ );
21
-
22
- if ( ! defined( 'AIHR_VERSION' ) )
23
- define( 'AIHR_VERSION', '1.0.4RC2' );
24
-
25
- require_once ABSPATH . 'wp-admin/includes/plugin.php';
26
-
27
- if ( ! function_exists( 'aihr_check_aihrus_framework' ) ) {
28
- function aihr_check_aihrus_framework( $file = null, $name = null, $aihr_min = '1.0.0' ) {
29
- if ( is_null( $file ) ) {
30
- aihr_notice_error( __( '`aihr_check_aihrus_framework` requires $file argument' ) );
31
-
32
- return false;
33
- }
34
-
35
- if ( ! defined( 'AIHR_VERSION' ) ) {
36
- $check_okay = false;
37
- } else {
38
- $check_okay = version_compare( AIHR_VERSION, $aihr_min, '>=' );
39
- }
40
-
41
- $file = plugin_basename( $file );
42
- if ( ! $check_okay && __FILE__ != $file ) {
43
- deactivate_plugins( $file );
44
-
45
- if ( ! defined( 'AIHR_VERSION_FILE' ) ) {
46
- define( 'AIHR_VERSION_FILE', $file );
47
- }
48
-
49
- if ( ! is_null( $name ) && ! defined( 'AIHR_VERSION_NAME' ) ) {
50
- define( 'AIHR_VERSION_NAME', $name );
51
- }
52
-
53
- if ( ! defined( 'AIHR_VERSION_MIN' ) ) {
54
- define( 'AIHR_VERSION_MIN', $aihr_min );
55
- }
56
-
57
- add_action( 'admin_notices', 'aihr_notice_aihrus_framework' );
58
- }
59
-
60
- return $check_okay;
61
- }
62
- }
63
-
64
- if ( ! function_exists( 'aihr_notice_aihrus_framework' ) ) {
65
- function aihr_notice_aihrus_framework() {
66
- if ( defined( 'AIHR_VERSION_NAME' ) ) {
67
- $name = AIHR_VERSION_NAME;
68
- } else {
69
- $name = basename( dirname( AIHR_VERSION_FILE ) );
70
- $name = str_replace( '-', ' ', $name );
71
- $name = ucwords( $name );
72
- }
73
-
74
- $help_url = esc_url( 'https://aihrus.zendesk.com/entries/35689458' );
75
- $help_link = sprintf( __( '<a href="%1$s">Update plugins</a>. <a href="%2$s">More information</a>.' ), self_admin_url( 'update-core.php' ), $help_url );
76
-
77
- $note = '';
78
- if ( defined( 'AIHR_BASE' ) ) {
79
- $plugin = plugin_basename( AIHR_BASE );
80
- $plugin = explode( '/', $plugin );
81
-
82
- $plugin_name = $plugin[0];
83
- $plugin_name = str_replace( '-', ' ', $plugin_name );
84
- $plugin_name = ucwords( $plugin_name );
85
-
86
- $note = sprintf( esc_html__( 'Plugin "%1$s" is causing the out of date issue.' ), $plugin_name );
87
- }
88
-
89
- $aihr_version = defined( 'AIHR_VERSION' ) ? AIHR_VERSION : '0.0.0';
90
-
91
- $text = sprintf( esc_html__( 'Plugin "%1$s" has been deactivated as it requires Aihrus Framework %2$s or newer. You\'re running Aihrus Framework %4$s. Once corrected, "%1$s" can be activated. %5$s %3$s' ), $name, AIHR_VERSION_MIN, $help_link, $aihr_version, $note );
92
-
93
- aihr_notice_error( $text );
94
- }
95
- }
96
-
97
- if ( ! function_exists( 'aihr_check_php' ) ) {
98
- function aihr_check_php( $file = null, $name = null, $php_min = '5.3.0' ) {
99
- if ( is_null( $file ) ) {
100
- aihr_notice_error( __( '`aihr_check_php` requires $file argument' ) );
101
-
102
- return false;
103
- }
104
-
105
- $check_okay = version_compare( PHP_VERSION, $php_min, '>=' );
106
- $file = plugin_basename( $file );
107
- if ( ! $check_okay && __FILE__ != $file ) {
108
- deactivate_plugins( $file );
109
-
110
- if ( ! defined( 'AIHR_PHP_VERSION_FILE' ) ) {
111
- define( 'AIHR_PHP_VERSION_FILE', $file );
112
- }
113
-
114
- if ( ! is_null( $name ) && ! defined( 'AIHR_PHP_VERSION_NAME' ) ) {
115
- define( 'AIHR_PHP_VERSION_NAME', $name );
116
- }
117
-
118
- if ( ! defined( 'AIHR_PHP_VERSION_MIN' ) ) {
119
- define( 'AIHR_PHP_VERSION_MIN', $php_min );
120
- }
121
-
122
- add_action( 'admin_notices', 'aihr_notice_php' );
123
- }
124
-
125
- return $check_okay;
126
- }
127
- }
128
-
129
- if ( ! function_exists( 'aihr_notice_php' ) ) {
130
- function aihr_notice_php() {
131
- if ( defined( 'AIHR_PHP_VERSION_NAME' ) ) {
132
- $name = AIHR_PHP_VERSION_NAME;
133
- } else {
134
- $name = basename( dirname( AIHR_PHP_VERSION_FILE ) );
135
- $name = str_replace( '-', ' ', $name );
136
- $name = ucwords( $name );
137
- }
138
-
139
- $help_url = esc_url( 'https://aihrus.zendesk.com/entries/30678006' );
140
-
141
- $text = sprintf( __( 'Plugin "%1$s" has been deactivated as it requires PHP %2$s or newer. You\'re running PHP %4$s. Once corrected, "%1$s" can be activated. <a href="%3$s">More information</a>.' ), $name, AIHR_PHP_VERSION_MIN, $help_url, PHP_VERSION );
142
-
143
- aihr_notice_error( $text );
144
- }
145
- }
146
-
147
- if ( ! function_exists( 'aihr_check_wp' ) ) {
148
- function aihr_check_wp( $file = null, $name = null, $wp_min = '3.6' ) {
149
- if ( is_null( $file ) ) {
150
- aihr_notice_error( __( '`aihr_check_wp` requires $file argument' ) );
151
-
152
- return false;
153
- }
154
-
155
- global $wp_version;
156
-
157
- $check_okay = version_compare( $wp_version, $wp_min, '>=' );
158
- $file = plugin_basename( $file );
159
- if ( ! $check_okay && __FILE__ != $file ) {
160
- deactivate_plugins( $file );
161
-
162
- if ( ! defined( 'AIHR_WP_VERSION_FILE' ) ) {
163
- define( 'AIHR_WP_VERSION_FILE', $file );
164
- }
165
-
166
- if ( ! is_null( $name ) && ! defined( 'AIHR_WP_VERSION_NAME' ) ) {
167
- define( 'AIHR_WP_VERSION_NAME', $name );
168
- }
169
-
170
- if ( ! defined( 'AIHR_WP_VERSION_MIN' ) ) {
171
- define( 'AIHR_WP_VERSION_MIN', $wp_min );
172
- }
173
-
174
- add_action( 'admin_notices', 'aihr_notice_wp' );
175
- }
176
-
177
- return $check_okay;
178
- }
179
- }
180
-
181
- if ( ! function_exists( 'aihr_notice_wp' ) ) {
182
- function aihr_notice_wp() {
183
- global $wp_version;
184
-
185
- if ( defined( 'AIHR_WP_VERSION_NAME' ) ) {
186
- $name = AIHR_WP_VERSION_NAME;
187
- } else {
188
- $name = basename( dirname( AIHR_WP_VERSION_FILE ) );
189
- $name = str_replace( '-', ' ', $name );
190
- $name = ucwords( $name );
191
- }
192
-
193
- $help_url = network_admin_url( 'update-core.php' );
194
-
195
- $text = sprintf( __( 'Plugin "%1$s" has been deactivated as it requires WordPress %2$s or newer. You\'re running WordPress %4$s. Once corrected, "%1$s" can be activated. <a href="%3$s">Update WordPress</a>.' ), $name, AIHR_WP_VERSION_MIN, $help_url, $wp_version );
196
-
197
- aihr_notice_error( $text );
198
- }
199
- }
200
-
201
- if ( ! function_exists( 'aihr_notice_error' ) ) {
202
- function aihr_notice_error( $text ) {
203
- aihr_notice_updated( $text, 'error' );
204
- }
205
- }
206
-
207
- if ( ! function_exists( 'aihr_notice_updated' ) ) {
208
- function aihr_notice_updated( $text, $class = 'updated' ) {
209
- if ( 'updated' == $class )
210
- $class .= ' fade';
211
-
212
- $content = '';
213
- $content .= '<div class="' . $class . '"><p>';
214
- $content .= $text;
215
- $content .= '</p></div>';
216
-
217
- echo $content;
218
- }
219
- }
220
-
221
- if ( ! function_exists( 'aihr_notice_version' ) ) {
222
- function aihr_notice_version( $required_base, $required_name, $required_slug, $required_version, $item_name ) {
223
- $is_active = is_plugin_active( $required_base );
224
- if ( $is_active )
225
- $link = sprintf( __( '<a href="%1$s">update to</a>' ), self_admin_url( 'update-core.php' ) );
226
- else {
227
- $plugins = get_plugins();
228
- if ( empty( $plugins[ $required_base ] ) ) {
229
- $install = esc_url( wp_nonce_url( self_admin_url( 'update.php?action=install-plugin&plugin=' . $required_slug ), 'install-plugin_' . $required_slug ) );
230
- $link = sprintf( __( '<a href="%1$s">install</a>' ), $install );
231
- } else {
232
- $activate = esc_url( wp_nonce_url( admin_url( 'plugins.php?action=activate&plugin=' . $required_base ), 'activate-plugin_' . $required_base ) );
233
- $link = sprintf( __( '<a href="%1$s">activate</a>' ), $activate );
234
- }
235
- }
236
-
237
- $text = sprintf( __( 'Plugin "%3$s" has been deactivated. Please %1$s "%4$s" version %2$s or newer before activating "%3$s".' ), $link, $required_version, $item_name, $required_name );
238
-
239
- aihr_notice_error( $text );
240
- }
241
- }
242
-
243
- if ( ! function_exists( 'aihr_notice_license' ) ) {
244
- function aihr_notice_license( $post_type, $settings_id, $free_name, $purchase_url, $item_name ) {
245
- if ( empty( $post_type ) )
246
- $link = get_admin_url() . 'options-general.php?page=' . $settings_id;
247
- else
248
- $link = get_admin_url() . 'edit.php?post_type=' . $post_type . '&page=' . $settings_id;
249
-
250
- $text = __( '<a href="%1$s">%2$s &gt; Settings</a>, <em>Premium</em> tab, <em>License Key</em> entry' );
251
-
252
- $settings_link = sprintf( $text, $link, $free_name );
253
-
254
- $link = esc_url( 'https://aihrus.zendesk.com/entries/28745227' );
255
- $text = __( '<a href="%s">Where\'s my license key?</a>' );
256
-
257
- $faq_link = sprintf( $text, $link );
258
-
259
- $link = esc_url( $purchase_url );
260
- $text = __( '<a href="%1$s">%2$s</a>' );
261
-
262
- $buy_link = sprintf( $text, $link, $item_name );
263
-
264
- $text = sprintf( __( 'Plugin "%1$s" requires license activation before updating will work. Please activate the license key through %2$s. No license key? See "%3$s" or purchase "%4$s".' ), $item_name, $settings_link, $faq_link, $buy_link );
265
-
266
- aihr_notice_error( $text );
267
- }
268
- }
269
-
270
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/includes/libraries/bxslider-4/bower.json DELETED
@@ -1,25 +0,0 @@
1
- {
2
- "name": "bxslider-4",
3
- "version": "4.1.2",
4
- "homepage": "http://bxslider.com",
5
- "license": "MIT",
6
- "main": [
7
- "jquery.bxslider.js",
8
- "jquery.bxslider.css",
9
- "images/bx_loader.gif",
10
- "images/controls.png"
11
- ],
12
- "keywords": [
13
- "bxslider",
14
- "javascript",
15
- "jquery",
16
- "library"
17
- ],
18
- "ignore": [
19
- "**/.*",
20
- "*.md"
21
- ],
22
- "dependencies": {
23
- "jquery": ">=1.6"
24
- }
25
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/includes/libraries/bxslider-4/images/bx_loader.gif DELETED
Binary file
trunk/includes/libraries/bxslider-4/images/controls.png DELETED
Binary file
trunk/includes/libraries/bxslider-4/jquery.bxslider.css DELETED
@@ -1,204 +0,0 @@
1
- /**
2
- * BxSlider v4.1.2 - Fully loaded, responsive content slider
3
- * http://bxslider.com
4
- *
5
- * Written by: Steven Wanderski, 2014
6
- * http://stevenwanderski.com
7
- * (while drinking Belgian ales and listening to jazz)
8
- *
9
- * CEO and founder of bxCreative, LTD
10
- * http://bxcreative.com
11
- */
12
-
13
-
14
- /** RESET AND LAYOUT
15
- ===================================*/
16
-
17
- .bx-wrapper {
18
- position: relative;
19
- margin: 0 auto 60px;
20
- padding: 0;
21
- *zoom: 1;
22
- }
23
-
24
- .bx-wrapper img {
25
- max-width: 100%;
26
- display: block;
27
- }
28
-
29
- /** THEME
30
- ===================================*/
31
-
32
- .bx-wrapper .bx-viewport {
33
- -moz-box-shadow: 0 0 5px #ccc;
34
- -webkit-box-shadow: 0 0 5px #ccc;
35
- box-shadow: 0 0 5px #ccc;
36
- border: 5px solid #fff;
37
- left: -5px;
38
- background: #fff;
39
-
40
- /*fix other elements on the page moving (on Chrome)*/
41
- -webkit-transform: translatez(0);
42
- -moz-transform: translatez(0);
43
- -ms-transform: translatez(0);
44
- -o-transform: translatez(0);
45
- transform: translatez(0);
46
- }
47
-
48
- .bx-wrapper .bx-pager,
49
- .bx-wrapper .bx-controls-auto {
50
- position: absolute;
51
- bottom: -30px;
52
- width: 100%;
53
- }
54
-
55
- /* LOADER */
56
-
57
- .bx-wrapper .bx-loading {
58
- min-height: 50px;
59
- background: url(images/bx_loader.gif) center center no-repeat #fff;
60
- height: 100%;
61
- width: 100%;
62
- position: absolute;
63
- top: 0;
64
- left: 0;
65
- z-index: 2000;
66
- }
67
-
68
- /* PAGER */
69
-
70
- .bx-wrapper .bx-pager {
71
- text-align: center;
72
- font-size: .85em;
73
- font-family: Arial;
74
- font-weight: bold;
75
- color: #666;
76
- padding-top: 20px;
77
- }
78
-
79
- .bx-wrapper .bx-pager .bx-pager-item,
80
- .bx-wrapper .bx-controls-auto .bx-controls-auto-item {
81
- display: inline-block;
82
- *zoom: 1;
83
- *display: inline;
84
- }
85
-
86
- .bx-wrapper .bx-pager.bx-default-pager a {
87
- background: #666;
88
- text-indent: -9999px;
89
- display: block;
90
- width: 10px;
91
- height: 10px;
92
- margin: 0 5px;
93
- outline: 0;
94
- -moz-border-radius: 5px;
95
- -webkit-border-radius: 5px;
96
- border-radius: 5px;
97
- }
98
-
99
- .bx-wrapper .bx-pager.bx-default-pager a:hover,
100
- .bx-wrapper .bx-pager.bx-default-pager a.active {
101
- background: #000;
102
- }
103
-
104
- /* DIRECTION CONTROLS (NEXT / PREV) */
105
-
106
- .bx-wrapper .bx-prev {
107
- left: 10px;
108
- background: url(images/controls.png) no-repeat 0 -32px;
109
- }
110
-
111
- .bx-wrapper .bx-next {
112
- right: 10px;
113
- background: url(images/controls.png) no-repeat -43px -32px;
114
- }
115
-
116
- .bx-wrapper .bx-prev:hover {
117
- background-position: 0 0;
118
- }
119
-
120
- .bx-wrapper .bx-next:hover {
121
- background-position: -43px 0;
122
- }
123
-
124
- .bx-wrapper .bx-controls-direction a {
125
- position: absolute;
126
- top: 50%;
127
- margin-top: -16px;
128
- outline: 0;
129
- width: 32px;
130
- height: 32px;
131
- text-indent: -9999px;
132
- z-index: 9999;
133
- }
134
-
135
- .bx-wrapper .bx-controls-direction a.disabled {
136
- display: none;
137
- }
138
-
139
- /* AUTO CONTROLS (START / STOP) */
140
-
141
- .bx-wrapper .bx-controls-auto {
142
- text-align: center;
143
- }
144
-
145
- .bx-wrapper .bx-controls-auto .bx-start {
146
- display: block;
147
- text-indent: -9999px;
148
- width: 10px;
149
- height: 11px;
150
- outline: 0;
151
- background: url(images/controls.png) -86px -11px no-repeat;
152
- margin: 0 3px;
153
- }
154
-
155
- .bx-wrapper .bx-controls-auto .bx-start:hover,
156
- .bx-wrapper .bx-controls-auto .bx-start.active {
157
- background-position: -86px 0;
158
- }
159
-
160
- .bx-wrapper .bx-controls-auto .bx-stop {
161
- display: block;
162
- text-indent: -9999px;
163
- width: 9px;
164
- height: 11px;
165
- outline: 0;
166
- background: url(images/controls.png) -86px -44px no-repeat;
167
- margin: 0 3px;
168
- }
169
-
170
- .bx-wrapper .bx-controls-auto .bx-stop:hover,
171
- .bx-wrapper .bx-controls-auto .bx-stop.active {
172
- background-position: -86px -33px;
173
- }
174
-
175
- /* PAGER WITH AUTO-CONTROLS HYBRID LAYOUT */
176
-
177
- .bx-wrapper .bx-controls.bx-has-controls-auto.bx-has-pager .bx-pager {
178
- text-align: left;
179
- width: 80%;
180
- }
181
-
182
- .bx-wrapper .bx-controls.bx-has-controls-auto.bx-has-pager .bx-controls-auto {
183
- right: 0;
184
- width: 35px;
185
- }
186
-
187
- /* IMAGE CAPTIONS */
188
-
189
- .bx-wrapper .bx-caption {
190
- position: absolute;
191
- bottom: 0;
192
- left: 0;
193
- background: #666\9;
194
- background: rgba(80, 80, 80, 0.75);
195
- width: 100%;
196
- }
197
-
198
- .bx-wrapper .bx-caption span {
199
- color: #fff;
200
- font-family: Arial;
201
- display: block;
202
- font-size: .85em;
203
- padding: 10px;
204
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/includes/libraries/bxslider-4/jquery.bxslider.js DELETED
@@ -1,1343 +0,0 @@
1
- /**
2
- * BxSlider v4.1.2 - Fully loaded, responsive content slider
3
- * http://bxslider.com
4
- *
5
- * Copyright 2014, Steven Wanderski - http://stevenwanderski.com - http://bxcreative.com
6
- * Written while drinking Belgian ales and listening to jazz
7
- *
8
- * Released under the MIT license - http://opensource.org/licenses/MIT
9
- */
10
-
11
- ;(function($){
12
-
13
- var plugin = {};
14
-
15
- var defaults = {
16
-
17
- // GENERAL
18
- mode: 'horizontal',
19
- slideSelector: '',
20
- infiniteLoop: true,
21
- hideControlOnEnd: false,
22
- speed: 500,
23
- easing: null,
24
- slideMargin: 0,
25
- startSlide: 0,
26
- randomStart: false,
27
- captions: false,
28
- ticker: false,
29
- tickerHover: false,
30
- adaptiveHeight: false,
31
- adaptiveHeightSpeed: 500,
32
- video: false,
33
- useCSS: true,
34
- preloadImages: 'visible',
35
- responsive: true,
36
- slideZIndex: 50,
37
- wrapperClass: 'bx-wrapper',
38
-
39
- // TOUCH
40
- touchEnabled: true,
41
- swipeThreshold: 50,
42
- oneToOneTouch: true,
43
- preventDefaultSwipeX: true,
44
- preventDefaultSwipeY: false,
45
-
46
- // PAGER
47
- pager: true,
48
- pagerType: 'full',
49
- pagerShortSeparator: ' / ',
50
- pagerSelector: null,
51
- buildPager: null,
52
- pagerCustom: null,
53
-
54
- // CONTROLS
55
- controls: true,
56
- nextText: 'Next',
57
- prevText: 'Prev',
58
- nextSelector: null,
59
- prevSelector: null,
60
- autoControls: false,
61
- startText: 'Start',
62
- stopText: 'Stop',
63
- autoControlsCombine: false,
64
- autoControlsSelector: null,
65
-
66
- // AUTO
67
- auto: false,
68
- pause: 4000,
69
- autoStart: true,
70
- autoDirection: 'next',
71
- autoHover: false,
72
- autoDelay: 0,
73
- autoSlideForOnePage: false,
74
-
75
- // CAROUSEL
76
- minSlides: 1,
77
- maxSlides: 1,
78
- moveSlides: 0,
79
- slideWidth: 0,
80
-
81
- // CALLBACKS
82
- onSliderLoad: function() {},
83
- onSlideBefore: function() {},
84
- onSlideAfter: function() {},
85
- onSlideNext: function() {},
86
- onSlidePrev: function() {},
87
- onSliderResize: function() {}
88
- }
89
-
90
- $.fn.bxSlider = function(options){
91
-
92
- if(this.length == 0) return this;
93
-
94
- // support mutltiple elements
95
- if(this.length > 1){
96
- this.each(function(){$(this).bxSlider(options)});
97
- return this;
98
- }
99
-
100
- // create a namespace to be used throughout the plugin
101
- var slider = {};
102
- // set a reference to our slider element
103
- var el = this;
104
- plugin.el = this;
105
-
106
- /**
107
- * Makes slideshow responsive
108
- */
109
- // first get the original window dimens (thanks alot IE)
110
- var windowWidth = $(window).width();
111
- var windowHeight = $(window).height();
112
-
113
-
114
-
115
- /**
116
- * ===================================================================================
117
- * = PRIVATE FUNCTIONS
118
- * ===================================================================================
119
- */
120
-
121
- /**
122
- * Initializes namespace settings to be used throughout plugin
123
- */
124
- var init = function(){
125
- // merge user-supplied options with the defaults
126
- slider.settings = $.extend({}, defaults, options);
127
- // parse slideWidth setting
128
- slider.settings.slideWidth = parseInt(slider.settings.slideWidth);
129
- // store the original children
130
- slider.children = el.children(slider.settings.slideSelector);
131
- // check if actual number of slides is less than minSlides / maxSlides
132
- if(slider.children.length < slider.settings.minSlides) slider.settings.minSlides = slider.children.length;
133
- if(slider.children.length < slider.settings.maxSlides) slider.settings.maxSlides = slider.children.length;
134
- // if random start, set the startSlide setting to random number
135
- if(slider.settings.randomStart) slider.settings.startSlide = Math.floor(Math.random() * slider.children.length);
136
- // store active slide information
137
- slider.active = { index: slider.settings.startSlide }
138
- // store if the slider is in carousel mode (displaying / moving multiple slides)
139
- slider.carousel = slider.settings.minSlides > 1 || slider.settings.maxSlides > 1;
140
- // if carousel, force preloadImages = 'all'
141
- if(slider.carousel) slider.settings.preloadImages = 'all';
142
- // calculate the min / max width thresholds based on min / max number of slides
143
- // used to setup and update carousel slides dimensions
144
- slider.minThreshold = (slider.settings.minSlides * slider.settings.slideWidth) + ((slider.settings.minSlides - 1) * slider.settings.slideMargin);
145
- slider.maxThreshold = (slider.settings.maxSlides * slider.settings.slideWidth) + ((slider.settings.maxSlides - 1) * slider.settings.slideMargin);
146
- // store the current state of the slider (if currently animating, working is true)
147
- slider.working = false;
148
- // initialize the controls object
149
- slider.controls = {};
150
- // initialize an auto interval
151
- slider.interval = null;
152
- // determine which property to use for transitions
153
- slider.animProp = slider.settings.mode == 'vertical' ? 'top' : 'left';
154
- // determine if hardware acceleration can be used
155
- slider.usingCSS = slider.settings.useCSS && slider.settings.mode != 'fade' && (function(){
156
- // create our test div element
157
- var div = document.createElement('div');
158
- // css transition properties
159
- var props = ['WebkitPerspective', 'MozPerspective', 'OPerspective', 'msPerspective'];
160
- // test for each property
161
- for(var i in props){
162
- if(div.style[props[i]] !== undefined){
163
- slider.cssPrefix = props[i].replace('Perspective', '').toLowerCase();
164
- slider.animProp = '-' + slider.cssPrefix + '-transform';
165
- return true;
166
- }
167
- }
168
- return false;
169
- }());
170
- // if vertical mode always make maxSlides and minSlides equal
171
- if(slider.settings.mode == 'vertical') slider.settings.maxSlides = slider.settings.minSlides;
172
- // save original style data
173
- el.data("origStyle", el.attr("style"));
174
- el.children(slider.settings.slideSelector).each(function() {
175
- $(this).data("origStyle", $(this).attr("style"));
176
- });
177
- // perform all DOM / CSS modifications
178
- setup();
179
- }
180
-
181
- /**
182
- * Performs all DOM and CSS modifications
183
- */
184
- var setup = function(){
185
- // wrap el in a wrapper
186
- el.wrap('<div class="' + slider.settings.wrapperClass + '"><div class="bx-viewport"></div></div>');
187
- // store a namspace reference to .bx-viewport
188
- slider.viewport = el.parent();
189
- // add a loading div to display while images are loading
190
- slider.loader = $('<div class="bx-loading" />');
191
- slider.viewport.prepend(slider.loader);
192
- // set el to a massive width, to hold any needed slides
193
- // also strip any margin and padding from el
194
- el.css({
195
- width: slider.settings.mode == 'horizontal' ? (slider.children.length * 100 + 215) + '%' : 'auto',
196
- position: 'relative'
197
- });
198
- // if using CSS, add the easing property
199
- if(slider.usingCSS && slider.settings.easing){
200
- el.css('-' + slider.cssPrefix + '-transition-timing-function', slider.settings.easing);
201
- // if not using CSS and no easing value was supplied, use the default JS animation easing (swing)
202
- }else if(!slider.settings.easing){
203
- slider.settings.easing = 'swing';
204
- }
205
- var slidesShowing = getNumberSlidesShowing();
206
- // make modifications to the viewport (.bx-viewport)
207
- slider.viewport.css({
208
- width: '100%',
209
- overflow: 'hidden',
210
- position: 'relative'
211
- });
212
- slider.viewport.parent().css({
213
- maxWidth: getViewportMaxWidth()
214
- });
215
- // make modification to the wrapper (.bx-wrapper)
216
- if(!slider.settings.pager) {
217
- slider.viewport.parent().css({
218
- margin: '0 auto 0px'
219
- });
220
- }
221
- // apply css to all slider children
222
- slider.children.css({
223
- 'float': slider.settings.mode == 'horizontal' ? 'left' : 'none',
224
- listStyle: 'none',
225
- position: 'relative'
226
- });
227
- // apply the calculated width after the float is applied to prevent scrollbar interference
228
- slider.children.css('width', getSlideWidth());
229
- // if slideMargin is supplied, add the css
230
- if(slider.settings.mode == 'horizontal' && slider.settings.slideMargin > 0) slider.children.css('marginRight', slider.settings.slideMargin);
231
- if(slider.settings.mode == 'vertical' && slider.settings.slideMargin > 0) slider.children.css('marginBottom', slider.settings.slideMargin);
232
- // if "fade" mode, add positioning and z-index CSS
233
- if(slider.settings.mode == 'fade'){
234
- slider.children.css({
235
- position: 'absolute',
236
- zIndex: 0,
237
- display: 'none'
238
- });
239
- // prepare the z-index on the showing element
240
- slider.children.eq(slider.settings.startSlide).css({zIndex: slider.settings.slideZIndex, display: 'block'});
241
- }
242
- // create an element to contain all slider controls (pager, start / stop, etc)
243
- slider.controls.el = $('<div class="bx-controls" />');
244
- // if captions are requested, add them
245
- if(slider.settings.captions) appendCaptions();
246
- // check if startSlide is last slide
247
- slider.active.last = slider.settings.startSlide == getPagerQty() - 1;
248
- // if video is true, set up the fitVids plugin
249
- if(slider.settings.video) el.fitVids();
250
- // set the default preload selector (visible)
251
- var preloadSelector = slider.children.eq(slider.settings.startSlide);
252
- if (slider.settings.preloadImages == "all") preloadSelector = slider.children;
253
- // only check for control addition if not in "ticker" mode
254
- if(!slider.settings.ticker){
255
- // if pager is requested, add it
256
- if(slider.settings.pager) appendPager();
257
- // if controls are requested, add them
258
- if(slider.settings.controls) appendControls();
259
- // if auto is true, and auto controls are requested, add them
260
- if(slider.settings.auto && slider.settings.autoControls) appendControlsAuto();
261
- // if any control option is requested, add the controls wrapper
262
- if(slider.settings.controls || slider.settings.autoControls || slider.settings.pager) slider.viewport.after(slider.controls.el);
263
- // if ticker mode, do not allow a pager
264
- }else{
265
- slider.settings.pager = false;
266
- }
267
- // preload all images, then perform final DOM / CSS modifications that depend on images being loaded
268
- loadElements(preloadSelector, start);
269
- }
270
-
271
- var loadElements = function(selector, callback){
272
- var total = selector.find('img, iframe').length;
273
- if (total == 0){
274
- callback();
275
- return;
276
- }
277
- var count = 0;
278
- selector.find('img, iframe').each(function(){
279
- $(this).one('load', function() {
280
- if(++count == total) callback();
281
- }).each(function() {
282
- if(this.complete) $(this).load();
283
- });
284
- });
285
- }
286
-
287
- /**
288
- * Start the slider
289
- */
290
- var start = function(){
291
- // if infinite loop, prepare additional slides
292
- if(slider.settings.infiniteLoop && slider.settings.mode != 'fade' && !slider.settings.ticker){
293
- var slice = slider.settings.mode == 'vertical' ? slider.settings.minSlides : slider.settings.maxSlides;
294
- var sliceAppend = slider.children.slice(0, slice).clone().addClass('bx-clone');
295
- var slicePrepend = slider.children.slice(-slice).clone().addClass('bx-clone');
296
- el.append(sliceAppend).prepend(slicePrepend);
297
- }
298
- // remove the loading DOM element
299
- slider.loader.remove();
300
- // set the left / top position of "el"
301
- setSlidePosition();
302
- // if "vertical" mode, always use adaptiveHeight to prevent odd behavior
303
- if (slider.settings.mode == 'vertical') slider.settings.adaptiveHeight = true;
304
- // set the viewport height
305
- slider.viewport.height(getViewportHeight());
306
- // make sure everything is positioned just right (same as a window resize)
307
- el.redrawSlider();
308
- // onSliderLoad callback
309
- slider.settings.onSliderLoad(slider.active.index);
310
- // slider has been fully initialized
311
- slider.initialized = true;
312
- // bind the resize call to the window
313
- if (slider.settings.responsive) $(window).bind('resize', resizeWindow);
314
- // if auto is true and has more than 1 page, start the show
315
- if (slider.settings.auto && slider.settings.autoStart && (getPagerQty() > 1 || slider.settings.autoSlideForOnePage)) initAuto();
316
- // if ticker is true, start the ticker
317
- if (slider.settings.ticker) initTicker();
318
- // if pager is requested, make the appropriate pager link active
319
- if (slider.settings.pager) updatePagerActive(slider.settings.startSlide);
320
- // check for any updates to the controls (like hideControlOnEnd updates)
321
- if (slider.settings.controls) updateDirectionControls();
322
- // if touchEnabled is true, setup the touch events
323
- if (slider.settings.touchEnabled && !slider.settings.ticker) initTouch();
324
- }
325
-
326
- /**
327
- * Returns the calculated height of the viewport, used to determine either adaptiveHeight or the maxHeight value
328
- */
329
- var getViewportHeight = function(){
330
- var height = 0;
331
- // first determine which children (slides) should be used in our height calculation
332
- var children = $();
333
- // if mode is not "vertical" and adaptiveHeight is false, include all children
334
- if(slider.settings.mode != 'vertical' && !slider.settings.adaptiveHeight){
335
- children = slider.children;
336
- }else{
337
- // if not carousel, return the single active child
338
- if(!slider.carousel){
339
- children = slider.children.eq(slider.active.index);
340
- // if carousel, return a slice of children
341
- }else{
342
- // get the individual slide index
343
- var currentIndex = slider.settings.moveSlides == 1 ? slider.active.index : slider.active.index * getMoveBy();
344
- // add the current slide to the children
345
- children = slider.children.eq(currentIndex);
346
- // cycle through the remaining "showing" slides
347
- for (i = 1; i <= slider.settings.maxSlides - 1; i++){
348
- // if looped back to the start
349
- if(currentIndex + i >= slider.children.length){
350
- children = children.add(slider.children.eq(i - 1));
351
- }else{
352
- children = children.add(slider.children.eq(currentIndex + i));
353
- }
354
- }
355
- }
356
- }
357
- // if "vertical" mode, calculate the sum of the heights of the children
358
- if(slider.settings.mode == 'vertical'){
359
- children.each(function(index) {
360
- height += $(this).outerHeight();
361
- });
362
- // add user-supplied margins
363
- if(slider.settings.slideMargin > 0){
364
- height += slider.settings.slideMargin * (slider.settings.minSlides - 1);
365
- }
366
- // if not "vertical" mode, calculate the max height of the children
367
- }else{
368
- height = Math.max.apply(Math, children.map(function(){
369
- return $(this).outerHeight(false);
370
- }).get());
371
- }
372
-
373
- if(slider.viewport.css('box-sizing') == 'border-box'){
374
- height += parseFloat(slider.viewport.css('padding-top')) + parseFloat(slider.viewport.css('padding-bottom')) +
375
- parseFloat(slider.viewport.css('border-top-width')) + parseFloat(slider.viewport.css('border-bottom-width'));
376
- }else if(slider.viewport.css('box-sizing') == 'padding-box'){
377
- height += parseFloat(slider.viewport.css('padding-top')) + parseFloat(slider.viewport.css('padding-bottom'));
378
- }
379
-
380
- return height;
381
- }
382
-
383
- /**
384
- * Returns the calculated width to be used for the outer wrapper / viewport
385
- */
386
- var getViewportMaxWidth = function(){
387
- var width = '100%';
388
- if(slider.settings.slideWidth > 0){
389
- if(slider.settings.mode == 'horizontal'){
390
- width = (slider.settings.maxSlides * slider.settings.slideWidth) + ((slider.settings.maxSlides - 1) * slider.settings.slideMargin);
391
- }else{
392
- width = slider.settings.slideWidth;
393
- }
394
- }
395
- return width;
396
- }
397
-
398
- /**
399
- * Returns the calculated width to be applied to each slide
400
- */
401
- var getSlideWidth = function(){
402
- // start with any user-supplied slide width
403
- var newElWidth = slider.settings.slideWidth;
404
- // get the current viewport width
405
- var wrapWidth = slider.viewport.width();
406
- // if slide width was not supplied, or is larger than the viewport use the viewport width
407
- if(slider.settings.slideWidth == 0 ||
408
- (slider.settings.slideWidth > wrapWidth && !slider.carousel) ||
409
- slider.settings.mode == 'vertical'){
410
- newElWidth = wrapWidth;
411
- // if carousel, use the thresholds to determine the width
412
- }else if(slider.settings.maxSlides > 1 && slider.settings.mode == 'horizontal'){
413
- if(wrapWidth > slider.maxThreshold){
414
- // newElWidth = (wrapWidth - (slider.settings.slideMargin * (slider.settings.maxSlides - 1))) / slider.settings.maxSlides;
415
- }else if(wrapWidth < slider.minThreshold){
416
- newElWidth = (wrapWidth - (slider.settings.slideMargin * (slider.settings.minSlides - 1))) / slider.settings.minSlides;
417
- }
418
- }
419
- return newElWidth;
420
- }
421
-
422
- /**
423
- * Returns the number of slides currently visible in the viewport (includes partially visible slides)
424
- */
425
- var getNumberSlidesShowing = function(){
426
- var slidesShowing = 1;
427
- if(slider.settings.mode == 'horizontal' && slider.settings.slideWidth > 0){
428
- // if viewport is smaller than minThreshold, return minSlides
429
- if(slider.viewport.width() < slider.minThreshold){
430
- slidesShowing = slider.settings.minSlides;
431
- // if viewport is larger than minThreshold, return maxSlides
432
- }else if(slider.viewport.width() > slider.maxThreshold){
433
- slidesShowing = slider.settings.maxSlides;
434
- // if viewport is between min / max thresholds, divide viewport width by first child width
435
- }else{
436
- var childWidth = slider.children.first().width() + slider.settings.slideMargin;
437
- slidesShowing = Math.floor((slider.viewport.width() +
438
- slider.settings.slideMargin) / childWidth);
439
- }
440
- // if "vertical" mode, slides showing will always be minSlides
441
- }else if(slider.settings.mode == 'vertical'){
442
- slidesShowing = slider.settings.minSlides;
443
- }
444
- return slidesShowing;
445
- }
446
-
447
- /**
448
- * Returns the number of pages (one full viewport of slides is one "page")
449
- */
450
- var getPagerQty = function(){
451
- var pagerQty = 0;
452
- // if moveSlides is specified by the user
453
- if(slider.settings.moveSlides > 0){
454
- if(slider.settings.infiniteLoop){
455
- pagerQty = Math.ceil(slider.children.length / getMoveBy());
456
- }else{
457
- // use a while loop to determine pages
458
- var breakPoint = 0;
459
- var counter = 0
460
- // when breakpoint goes above children length, counter is the number of pages
461
- while (breakPoint < slider.children.length){
462
- ++pagerQty;
463
- breakPoint = counter + getNumberSlidesShowing();
464
- counter += slider.settings.moveSlides <= getNumberSlidesShowing() ? slider.settings.moveSlides : getNumberSlidesShowing();
465
- }
466
- }
467
- // if moveSlides is 0 (auto) divide children length by sides showing, then round up
468
- }else{
469
- pagerQty = Math.ceil(slider.children.length / getNumberSlidesShowing());
470
- }
471
- return pagerQty;
472
- }
473
-
474
- /**
475
- * Returns the number of indivual slides by which to shift the slider
476
- */
477
- var getMoveBy = function(){
478
- // if moveSlides was set by the user and moveSlides is less than number of slides showing
479
- if(slider.settings.moveSlides > 0 && slider.settings.moveSlides <= getNumberSlidesShowing()){
480
- return slider.settings.moveSlides;
481
- }
482
- // if moveSlides is 0 (auto)
483
- return getNumberSlidesShowing();
484
- }
485
-
486
- /**
487
- * Sets the slider's (el) left or top position
488
- */
489
- var setSlidePosition = function(){
490
- // if last slide, not infinite loop, and number of children is larger than specified maxSlides
491
- if(slider.children.length > slider.settings.maxSlides && slider.active.last && !slider.settings.infiniteLoop){
492
- if (slider.settings.mode == 'horizontal'){
493
- // get the last child's position
494
- var lastChild = slider.children.last();
495
- var position = lastChild.position();
496
- // set the left position
497
- setPositionProperty(-(position.left - (slider.viewport.width() - lastChild.outerWidth())), 'reset', 0);
498
- }else if(slider.settings.mode == 'vertical'){
499
- // get the last showing index's position
500
- var lastShowingIndex = slider.children.length - slider.settings.minSlides;
501
- var position = slider.children.eq(lastShowingIndex).position();
502
- // set the top position
503
- setPositionProperty(-position.top, 'reset', 0);
504
- }
505
- // if not last slide
506
- }else{
507
- // get the position of the first showing slide
508
- var position = slider.children.eq(slider.active.index * getMoveBy()).position();
509
- // check for last slide
510
- if (slider.active.index == getPagerQty() - 1) slider.active.last = true;
511
- // set the repective position
512
- if (position != undefined){
513
- if (slider.settings.mode == 'horizontal') setPositionProperty(-position.left, 'reset', 0);
514
- else if (slider.settings.mode == 'vertical') setPositionProperty(-position.top, 'reset', 0);
515
- }
516
- }
517
- }
518
-
519
- /**
520
- * Sets the el's animating property position (which in turn will sometimes animate el).
521
- * If using CSS, sets the transform property. If not using CSS, sets the top / left property.
522
- *
523
- * @param value (int)
524
- * - the animating property's value
525
- *
526
- * @param type (string) 'slider', 'reset', 'ticker'
527
- * - the type of instance for which the function is being
528
- *
529
- * @param duration (int)
530
- * - the amount of time (in ms) the transition should occupy
531
- *
532
- * @param params (array) optional
533
- * - an optional parameter containing any variables that need to be passed in
534
- */
535
- var setPositionProperty = function(value, type, duration, params){
536
- // use CSS transform
537
- if(slider.usingCSS){
538
- // determine the translate3d value
539
- var propValue = slider.settings.mode == 'vertical' ? 'translate3d(0, ' + value + 'px, 0)' : 'translate3d(' + value + 'px, 0, 0)';
540
- // add the CSS transition-duration
541
- el.css('-' + slider.cssPrefix + '-transition-duration', duration / 1000 + 's');
542
- if(type == 'slide'){
543
- // set the property value
544
- el.css(slider.animProp, propValue);
545
- // bind a callback method - executes when CSS transition completes
546
- el.bind('transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd', function(){
547
- // unbind the callback
548
- el.unbind('transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd');
549
- updateAfterSlideTransition();
550
- });
551
- }else if(type == 'reset'){
552
- el.css(slider.animProp, propValue);
553
- }else if(type == 'ticker'){
554
- // make the transition use 'linear'
555
- el.css('-' + slider.cssPrefix + '-transition-timing-function', 'linear');
556
- el.css(slider.animProp, propValue);
557
- // bind a callback method - executes when CSS transition completes
558
- el.bind('transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd', function(){
559
- // unbind the callback
560
- el.unbind('transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd');
561
- // reset the position
562
- setPositionProperty(params['resetValue'], 'reset', 0);
563
- // start the loop again
564
- tickerLoop();
565
- });
566
- }
567
- // use JS animate
568
- }else{
569
- var animateObj = {};
570
- animateObj[slider.animProp] = value;
571
- if(type == 'slide'){
572
- el.animate(animateObj, duration, slider.settings.easing, function(){
573
- updateAfterSlideTransition();
574
- });
575
- }else if(type == 'reset'){
576
- el.css(slider.animProp, value)
577
- }else if(type == 'ticker'){
578
- el.animate(animateObj, speed, 'linear', function(){
579
- setPositionProperty(params['resetValue'], 'reset', 0);
580
- // run the recursive loop after animation
581
- tickerLoop();
582
- });
583
- }
584
- }
585
- }
586
-
587
- /**
588
- * Populates the pager with proper amount of pages
589
- */
590
- var populatePager = function(){
591
- var pagerHtml = '';
592
- var pagerQty = getPagerQty();
593
- // loop through each pager item
594
- for(var i=0; i < pagerQty; i++){
595
- var linkContent = '';
596
- // if a buildPager function is supplied, use it to get pager link value, else use index + 1
597
- if(slider.settings.buildPager && $.isFunction(slider.settings.buildPager)){
598
- linkContent = slider.settings.buildPager(i);
599
- slider.pagerEl.addClass('bx-custom-pager');
600
- }else{
601
- linkContent = i + 1;
602
- slider.pagerEl.addClass('bx-default-pager');
603
- }
604
- // var linkContent = slider.settings.buildPager && $.isFunction(slider.settings.buildPager) ? slider.settings.buildPager(i) : i + 1;
605
- // add the markup to the string
606
- pagerHtml += '<div class="bx-pager-item"><a href="" data-slide-index="' + i + '" class="bx-pager-link">' + linkContent + '</a></div>';
607
- };
608
- // populate the pager element with pager links
609
- slider.pagerEl.html(pagerHtml);
610
- }
611
-
612
- /**
613
- * Appends the pager to the controls element
614
- */
615
- var appendPager = function(){
616
- if(!slider.settings.pagerCustom){
617
- // create the pager DOM element
618
- slider.pagerEl = $('<div class="bx-pager" />');
619
- // if a pager selector was supplied, populate it with the pager
620
- if(slider.settings.pagerSelector){
621
- $(slider.settings.pagerSelector).html(slider.pagerEl);
622
- // if no pager selector was supplied, add it after the wrapper
623
- }else{
624
- slider.controls.el.addClass('bx-has-pager').append(slider.pagerEl);
625
- }
626
- // populate the pager
627
- populatePager();
628
- }else{
629
- slider.pagerEl = $(slider.settings.pagerCustom);
630
- }
631
- // assign the pager click binding
632
- slider.pagerEl.on('click', 'a', clickPagerBind);
633
- }
634
-
635
- /**
636
- * Appends prev / next controls to the controls element
637
- */
638
- var appendControls = function(){
639
- slider.controls.next = $('<a class="bx-next" href="">' + slider.settings.nextText + '</a>');
640
- slider.controls.prev = $('<a class="bx-prev" href="">' + slider.settings.prevText + '</a>');
641
- // bind click actions to the controls
642
- slider.controls.next.bind('click', clickNextBind);
643
- slider.controls.prev.bind('click', clickPrevBind);
644
- // if nextSlector was supplied, populate it
645
- if(slider.settings.nextSelector){
646
- $(slider.settings.nextSelector).append(slider.controls.next);
647
- }
648
- // if prevSlector was supplied, populate it
649
- if(slider.settings.prevSelector){
650
- $(slider.settings.prevSelector).append(slider.controls.prev);
651
- }
652
- // if no custom selectors were supplied
653
- if(!slider.settings.nextSelector && !slider.settings.prevSelector){
654
- // add the controls to the DOM
655
- slider.controls.directionEl = $('<div class="bx-controls-direction" />');
656
- // add the control elements to the directionEl
657
- slider.controls.directionEl.append(slider.controls.prev).append(slider.controls.next);
658
- // slider.viewport.append(slider.controls.directionEl);
659
- slider.controls.el.addClass('bx-has-controls-direction').append(slider.controls.directionEl);
660
- }
661
- }
662
-
663
- /**
664
- * Appends start / stop auto controls to the controls element
665
- */
666
- var appendControlsAuto = function(){
667
- slider.controls.start = $('<div class="bx-controls-auto-item"><a class="bx-start" href="">' + slider.settings.startText + '</a></div>');
668
- slider.controls.stop = $('<div class="bx-controls-auto-item"><a class="bx-stop" href="">' + slider.settings.stopText + '</a></div>');
669
- // add the controls to the DOM
670
- slider.controls.autoEl = $('<div class="bx-controls-auto" />');
671
- // bind click actions to the controls
672
- slider.controls.autoEl.on('click', '.bx-start', clickStartBind);
673
- slider.controls.autoEl.on('click', '.bx-stop', clickStopBind);
674
- // if autoControlsCombine, insert only the "start" control
675
- if(slider.settings.autoControlsCombine){
676
- slider.controls.autoEl.append(slider.controls.start);
677
- // if autoControlsCombine is false, insert both controls
678
- }else{
679
- slider.controls.autoEl.append(slider.controls.start).append(slider.controls.stop);
680
- }
681
- // if auto controls selector was supplied, populate it with the controls
682
- if(slider.settings.autoControlsSelector){
683
- $(slider.settings.autoControlsSelector).html(slider.controls.autoEl);
684
- // if auto controls selector was not supplied, add it after the wrapper
685
- }else{
686
- slider.controls.el.addClass('bx-has-controls-auto').append(slider.controls.autoEl);
687
- }
688
- // update the auto controls
689
- updateAutoControls(slider.settings.autoStart ? 'stop' : 'start');
690
- }
691
-
692
- /**
693
- * Appends image captions to the DOM
694
- */
695
- var appendCaptions = function(){
696
- // cycle through each child
697
- slider.children.each(function(index){
698
- // get the image title attribute
699
- var title = $(this).find('img:first').attr('title');
700
- // append the caption
701
- if (title != undefined && ('' + title).length) {
702
- $(this).append('<div class="bx-caption"><span>' + title + '</span></div>');
703
- }
704
- });
705
- }
706
-
707
- /**
708
- * Click next binding
709
- *
710
- * @param e (event)
711
- * - DOM event object
712
- */
713
- var clickNextBind = function(e){
714
- // if auto show is running, stop it
715
- if (slider.settings.auto) el.stopAuto();
716
- el.goToNextSlide();
717
- e.preventDefault();
718
- }
719
-
720
- /**
721
- * Click prev binding
722
- *
723
- * @param e (event)
724
- * - DOM event object
725
- */
726
- var clickPrevBind = function(e){
727
- // if auto show is running, stop it
728
- if (slider.settings.auto) el.stopAuto();
729
- el.goToPrevSlide();
730
- e.preventDefault();
731
- }
732
-
733
- /**
734
- * Click start binding
735
- *
736
- * @param e (event)
737
- * - DOM event object
738
- */
739
- var clickStartBind = function(e){
740
- el.startAuto();
741
- e.preventDefault();
742
- }
743
-
744
- /**
745
- * Click stop binding
746
- *
747
- * @param e (event)
748
- * - DOM event object
749
- */
750
- var clickStopBind = function(e){
751
- el.stopAuto();
752
- e.preventDefault();
753
- }
754
-
755
- /**
756
- * Click pager binding
757
- *
758
- * @param e (event)
759
- * - DOM event object
760
- */
761
- var clickPagerBind = function(e){
762
- // if auto show is running, stop it
763
- if (slider.settings.auto) el.stopAuto();
764
- var pagerLink = $(e.currentTarget);
765
- if(pagerLink.attr('data-slide-index') !== undefined){
766
- var pagerIndex = parseInt(pagerLink.attr('data-slide-index'));
767
- // if clicked pager link is not active, continue with the goToSlide call
768
- if(pagerIndex != slider.active.index) el.goToSlide(pagerIndex);
769
- e.preventDefault();
770
- }
771
- }
772
-
773
- /**
774
- * Updates the pager links with an active class
775
- *
776
- * @param slideIndex (int)
777
- * - index of slide to make active
778
- */
779
- var updatePagerActive = function(slideIndex){
780
- // if "short" pager type
781
- var len = slider.children.length; // nb of children
782
- if(slider.settings.pagerType == 'short'){
783
- if(slider.settings.maxSlides > 1) {
784
- len = Math.ceil(slider.children.length/slider.settings.maxSlides);
785
- }
786
- slider.pagerEl.html( (slideIndex + 1) + slider.settings.pagerShortSeparator + len);
787
- return;
788
- }
789
- // remove all pager active classes
790
- slider.pagerEl.find('a').removeClass('active');
791
- // apply the active class for all pagers
792
- slider.pagerEl.each(function(i, el) { $(el).find('a').eq(slideIndex).addClass('active'); });
793
- }
794
-
795
- /**
796
- * Performs needed actions after a slide transition
797
- */
798
- var updateAfterSlideTransition = function(){
799
- // if infinte loop is true
800
- if(slider.settings.infiniteLoop){
801
- var position = '';
802
- // first slide
803
- if(slider.active.index == 0){
804
- // set the new position
805
- position = slider.children.eq(0).position();
806
- // carousel, last slide
807
- }else if(slider.active.index == getPagerQty() - 1 && slider.carousel){
808
- position = slider.children.eq((getPagerQty() - 1) * getMoveBy()).position();
809
- // last slide
810
- }else if(slider.active.index == slider.children.length - 1){
811
- position = slider.children.eq(slider.children.length - 1).position();
812
- }
813
- if(position){
814
- if (slider.settings.mode == 'horizontal') { setPositionProperty(-position.left, 'reset', 0); }
815
- else if (slider.settings.mode == 'vertical') { setPositionProperty(-position.top, 'reset', 0); }
816
- }
817
- }
818
- // declare that the transition is complete
819
- slider.working = false;
820
- // onSlideAfter callback
821
- slider.settings.onSlideAfter(slider.children.eq(slider.active.index), slider.oldIndex, slider.active.index);
822
- }
823
-
824
- /**
825
- * Updates the auto controls state (either active, or combined switch)
826
- *
827
- * @param state (string) "start", "stop"
828
- * - the new state of the auto show
829
- */
830
- var updateAutoControls = function(state){
831
- // if autoControlsCombine is true, replace the current control with the new state
832
- if(slider.settings.autoControlsCombine){
833
- slider.controls.autoEl.html(slider.controls[state]);
834
- // if autoControlsCombine is false, apply the "active" class to the appropriate control
835
- }else{
836
- slider.controls.autoEl.find('a').removeClass('active');
837
- slider.controls.autoEl.find('a:not(.bx-' + state + ')').addClass('active');
838
- }
839
- }
840
-
841
- /**
842
- * Updates the direction controls (checks if either should be hidden)
843
- */
844
- var updateDirectionControls = function(){
845
- if(getPagerQty() == 1){
846
- slider.controls.prev.addClass('disabled');
847
- slider.controls.next.addClass('disabled');
848
- }else if(!slider.settings.infiniteLoop && slider.settings.hideControlOnEnd){
849
- // if first slide
850
- if (slider.active.index == 0){
851
- slider.controls.prev.addClass('disabled');
852
- slider.controls.next.removeClass('disabled');
853
- // if last slide
854
- }else if(slider.active.index == getPagerQty() - 1){
855
- slider.controls.next.addClass('disabled');
856
- slider.controls.prev.removeClass('disabled');
857
- // if any slide in the middle
858
- }else{
859
- slider.controls.prev.removeClass('disabled');
860
- slider.controls.next.removeClass('disabled');
861
- }
862
- }
863
- }
864
-
865
- /**
866
- * Initialzes the auto process
867
- */
868
- var initAuto = function(){
869
- // if autoDelay was supplied, launch the auto show using a setTimeout() call
870
- if(slider.settings.autoDelay > 0){
871
- var timeout = setTimeout(el.startAuto, slider.settings.autoDelay);
872
- // if autoDelay was not supplied, start the auto show normally
873
- }else{
874
- el.startAuto();
875
- }
876
- // if autoHover is requested
877
- if(slider.settings.autoHover){
878
- // on el hover
879
- el.hover(function(){
880
- // if the auto show is currently playing (has an active interval)
881
- if(slider.interval){
882
- // stop the auto show and pass true agument which will prevent control update
883
- el.stopAuto(true);
884
- // create a new autoPaused value which will be used by the relative "mouseout" event
885
- slider.autoPaused = true;
886
- }
887
- }, function(){
888
- // if the autoPaused value was created be the prior "mouseover" event
889
- if(slider.autoPaused){
890
- // start the auto show and pass true agument which will prevent control update
891
- el.startAuto(true);
892
- // reset the autoPaused value
893
- slider.autoPaused = null;
894
- }
895
- });
896
- }
897
- }
898
-
899
- /**
900
- * Initialzes the ticker process
901
- */
902
- var initTicker = function(){
903
- var startPosition = 0;
904
- // if autoDirection is "next", append a clone of the entire slider
905
- if(slider.settings.autoDirection == 'next'){
906
- el.append(slider.children.clone().addClass('bx-clone'));
907
- // if autoDirection is "prev", prepend a clone of the entire slider, and set the left position
908
- }else{
909
- el.prepend(slider.children.clone().addClass('bx-clone'));
910
- var position = slider.children.first().position();
911
- startPosition = slider.settings.mode == 'horizontal' ? -position.left : -position.top;
912
- }
913
- setPositionProperty(startPosition, 'reset', 0);
914
- // do not allow controls in ticker mode
915
- slider.settings.pager = false;
916
- slider.settings.controls = false;
917
- slider.settings.autoControls = false;
918
- // if autoHover is requested
919
- if(slider.settings.tickerHover && !slider.usingCSS){
920
- // on el hover
921
- slider.viewport.hover(function(){
922
- el.stop();
923
- }, function(){
924
- // calculate the total width of children (used to calculate the speed ratio)
925
- var totalDimens = 0;
926
- slider.children.each(function(index){
927
- totalDimens += slider.settings.mode == 'horizontal' ? $(this).outerWidth(true) : $(this).outerHeight(true);
928
- });
929
- // calculate the speed ratio (used to determine the new speed to finish the paused animation)
930
- var ratio = slider.settings.speed / totalDimens;
931
- // determine which property to use
932
- var property = slider.settings.mode == 'horizontal' ? 'left' : 'top';
933
- // calculate the new speed
934
- var newSpeed = ratio * (totalDimens - (Math.abs(parseInt(el.css(property)))));
935
- tickerLoop(newSpeed);
936
- });
937
- }
938
- // start the ticker loop
939
- tickerLoop();
940
- }
941
-
942
- /**
943
- * Runs a continuous loop, news ticker-style
944
- */
945
- var tickerLoop = function(resumeSpeed){
946
- speed = resumeSpeed ? resumeSpeed : slider.settings.speed;
947
- var position = {left: 0, top: 0};
948
- var reset = {left: 0, top: 0};
949
- // if "next" animate left position to last child, then reset left to 0
950
- if(slider.settings.autoDirection == 'next'){
951
- position = el.find('.bx-clone').first().position();
952
- // if "prev" animate left position to 0, then reset left to first non-clone child
953
- }else{
954
- reset = slider.children.first().position();
955
- }
956
- var animateProperty = slider.settings.mode == 'horizontal' ? -position.left : -position.top;
957
- var resetValue = slider.settings.mode == 'horizontal' ? -reset.left : -reset.top;
958
- var params = {resetValue: resetValue};
959
- setPositionProperty(animateProperty, 'ticker', speed, params);
960
- }
961
-
962
- /**
963
- * Initializes touch events
964
- */
965
- var initTouch = function(){
966
- // initialize object to contain all touch values
967
- slider.touch = {
968
- start: {x: 0, y: 0},
969
- end: {x: 0, y: 0}
970
- }
971
- slider.viewport.bind('touchstart', onTouchStart);
972
- }
973
-
974
- /**
975
- * Event handler for "touchstart"
976
- *
977
- * @param e (event)
978
- * - DOM event object
979
- */
980
- var onTouchStart = function(e){
981
- if(slider.working){
982
- e.preventDefault();
983
- }else{
984
- // record the original position when touch starts
985
- slider.touch.originalPos = el.position();
986
- var orig = e.originalEvent;
987
- // record the starting touch x, y coordinates
988
- slider.touch.start.x = orig.changedTouches[0].pageX;
989
- slider.touch.start.y = orig.changedTouches[0].pageY;
990
- // bind a "touchmove" event to the viewport
991
- slider.viewport.bind('touchmove', onTouchMove);
992
- // bind a "touchend" event to the viewport
993
- slider.viewport.bind('touchend', onTouchEnd);
994
- }
995
- }
996
-
997
- /**
998
- * Event handler for "touchmove"
999
- *
1000
- * @param e (event)
1001
- * - DOM event object
1002
- */
1003
- var onTouchMove = function(e){
1004
- var orig = e.originalEvent;
1005
- // if scrolling on y axis, do not prevent default
1006
- var xMovement = Math.abs(orig.changedTouches[0].pageX - slider.touch.start.x);
1007
- var yMovement = Math.abs(orig.changedTouches[0].pageY - slider.touch.start.y);
1008
- // x axis swipe
1009
- if((xMovement * 3) > yMovement && slider.settings.preventDefaultSwipeX){
1010
- e.preventDefault();
1011
- // y axis swipe
1012
- }else if((yMovement * 3) > xMovement && slider.settings.preventDefaultSwipeY){
1013
- e.preventDefault();
1014
- }
1015
- if(slider.settings.mode != 'fade' && slider.settings.oneToOneTouch){
1016
- var value = 0;
1017
- // if horizontal, drag along x axis
1018
- if(slider.settings.mode == 'horizontal'){
1019
- var change = orig.changedTouches[0].pageX - slider.touch.start.x;
1020
- value = slider.touch.originalPos.left + change;
1021
- // if vertical, drag along y axis
1022
- }else{
1023
- var change = orig.changedTouches[0].pageY - slider.touch.start.y;
1024
- value = slider.touch.originalPos.top + change;
1025
- }
1026
- setPositionProperty(value, 'reset', 0);
1027
- }
1028
- }
1029
-
1030
- /**
1031
- * Event handler for "touchend"
1032
- *
1033
- * @param e (event)
1034
- * - DOM event object
1035
- */
1036
- var onTouchEnd = function(e){
1037
- slider.viewport.unbind('touchmove', onTouchMove);
1038
- var orig = e.originalEvent;
1039
- var value = 0;
1040
- // record end x, y positions
1041
- slider.touch.end.x = orig.changedTouches[0].pageX;
1042
- slider.touch.end.y = orig.changedTouches[0].pageY;
1043
- // if fade mode, check if absolute x distance clears the threshold
1044
- if(slider.settings.mode == 'fade'){
1045
- var distance = Math.abs(slider.touch.start.x - slider.touch.end.x);
1046
- if(distance >= slider.settings.swipeThreshold){
1047
- slider.touch.start.x > slider.touch.end.x ? el.goToNextSlide() : el.goToPrevSlide();
1048
- el.stopAuto();
1049
- }
1050
- // not fade mode
1051
- }else{
1052
- var distance = 0;
1053
- // calculate distance and el's animate property
1054
- if(slider.settings.mode == 'horizontal'){
1055
- distance = slider.touch.end.x - slider.touch.start.x;
1056
- value = slider.touch.originalPos.left;
1057
- }else{
1058
- distance = slider.touch.end.y - slider.touch.start.y;
1059
- value = slider.touch.originalPos.top;
1060
- }
1061
- // if not infinite loop and first / last slide, do not attempt a slide transition
1062
- if(!slider.settings.infiniteLoop && ((slider.active.index == 0 && distance > 0) || (slider.active.last && distance < 0))){
1063
- setPositionProperty(value, 'reset', 200);
1064
- }else{
1065
- // check if distance clears threshold
1066
- if(Math.abs(distance) >= slider.settings.swipeThreshold){
1067
- distance < 0 ? el.goToNextSlide() : el.goToPrevSlide();
1068
- el.stopAuto();
1069
- }else{
1070
- // el.animate(property, 200);
1071
- setPositionProperty(value, 'reset', 200);
1072
- }
1073
- }
1074
- }
1075
- slider.viewport.unbind('touchend', onTouchEnd);
1076
- }
1077
-
1078
- /**
1079
- * Window resize event callback
1080
- */
1081
- var resizeWindow = function(e){
1082
- // don't do anything if slider isn't initialized.
1083
- if(!slider.initialized) return;
1084
- // get the new window dimens (again, thank you IE)
1085
- var windowWidthNew = $(window).width();
1086
- var windowHeightNew = $(window).height();
1087
- // make sure that it is a true window resize
1088
- // *we must check this because our dinosaur friend IE fires a window resize event when certain DOM elements
1089
- // are resized. Can you just die already?*
1090
- if(windowWidth != windowWidthNew || windowHeight != windowHeightNew){
1091
- // set the new window dimens
1092
- windowWidth = windowWidthNew;
1093
- windowHeight = windowHeightNew;
1094
- // update all dynamic elements
1095
- el.redrawSlider();
1096
- // Call user resize handler
1097
- slider.settings.onSliderResize.call(el, slider.active.index);
1098
- }
1099
- }
1100
-
1101
- /**
1102
- * ===================================================================================
1103
- * = PUBLIC FUNCTIONS
1104
- * ===================================================================================
1105
- */
1106
-
1107
- /**
1108
- * Performs slide transition to the specified slide
1109
- *
1110
- * @param slideIndex (int)
1111
- * - the destination slide's index (zero-based)
1112
- *
1113
- * @param direction (string)
1114
- * - INTERNAL USE ONLY - the direction of travel ("prev" / "next")
1115
- */
1116
- el.goToSlide = function(slideIndex, direction){
1117
- // if plugin is currently in motion, ignore request
1118
- if(slider.working || slider.active.index == slideIndex) return;
1119
- // declare that plugin is in motion
1120
- slider.working = true;
1121
- // store the old index
1122
- slider.oldIndex = slider.active.index;
1123
- // if slideIndex is less than zero, set active index to last child (this happens during infinite loop)
1124
- if(slideIndex < 0){
1125
- slider.active.index = getPagerQty() - 1;
1126
- // if slideIndex is greater than children length, set active index to 0 (this happens during infinite loop)
1127
- }else if(slideIndex >= getPagerQty()){
1128
- slider.active.index = 0;
1129
- // set active index to requested slide
1130
- }else{
1131
- slider.active.index = slideIndex;
1132
- }
1133
- // onSlideBefore, onSlideNext, onSlidePrev callbacks
1134
- slider.settings.onSlideBefore(slider.children.eq(slider.active.index), slider.oldIndex, slider.active.index);
1135
- if(direction == 'next'){
1136
- slider.settings.onSlideNext(slider.children.eq(slider.active.index), slider.oldIndex, slider.active.index);
1137
- }else if(direction == 'prev'){
1138
- slider.settings.onSlidePrev(slider.children.eq(slider.active.index), slider.oldIndex, slider.active.index);
1139
- }
1140
- // check if last slide
1141
- slider.active.last = slider.active.index >= getPagerQty() - 1;
1142
- // update the pager with active class
1143
- if(slider.settings.pager) updatePagerActive(slider.active.index);
1144
- // // check for direction control update
1145
- if(slider.settings.controls) updateDirectionControls();
1146
- // if slider is set to mode: "fade"
1147
- if(slider.settings.mode == 'fade'){
1148
- // if adaptiveHeight is true and next height is different from current height, animate to the new height
1149
- if(slider.settings.adaptiveHeight && slider.viewport.height() != getViewportHeight()){
1150
- slider.viewport.animate({height: getViewportHeight()}, slider.settings.adaptiveHeightSpeed);
1151
- }
1152
- // fade out the visible child and reset its z-index value
1153
- slider.children.filter(':visible').fadeOut(slider.settings.speed).css({zIndex: 0});
1154
- // fade in the newly requested slide
1155
- slider.children.eq(slider.active.index).css('zIndex', slider.settings.slideZIndex+1).fadeIn(slider.settings.speed, function(){
1156
- $(this).css('zIndex', slider.settings.slideZIndex);
1157
- updateAfterSlideTransition();
1158
- });
1159
- // slider mode is not "fade"
1160
- }else{
1161
- // if adaptiveHeight is true and next height is different from current height, animate to the new height
1162
- if(slider.settings.adaptiveHeight && slider.viewport.height() != getViewportHeight()){
1163
- slider.viewport.animate({height: getViewportHeight()}, slider.settings.adaptiveHeightSpeed);
1164
- }
1165
- var moveBy = 0;
1166
- var position = {left: 0, top: 0};
1167
- // if carousel and not infinite loop
1168
- if(!slider.settings.infiniteLoop && slider.carousel && slider.active.last){
1169
- if(slider.settings.mode == 'horizontal'){
1170
- // get the last child position
1171
- var lastChild = slider.children.eq(slider.children.length - 1);
1172
- position = lastChild.position();
1173
- // calculate the position of the last slide
1174
- moveBy = slider.viewport.width() - lastChild.outerWidth();
1175
- }else{
1176
- // get last showing index position
1177
- var lastShowingIndex = slider.children.length - slider.settings.minSlides;
1178
- position = slider.children.eq(lastShowingIndex).position();
1179
- }
1180
- // horizontal carousel, going previous while on first slide (infiniteLoop mode)
1181
- }else if(slider.carousel && slider.active.last && direction == 'prev'){
1182
- // get the last child position
1183
- var eq = slider.settings.moveSlides == 1 ? slider.settings.maxSlides - getMoveBy() : ((getPagerQty() - 1) * getMoveBy()) - (slider.children.length - slider.settings.maxSlides);
1184
- var lastChild = el.children('.bx-clone').eq(eq);
1185
- position = lastChild.position();
1186
- // if infinite loop and "Next" is clicked on the last slide
1187
- }else if(direction == 'next' && slider.active.index == 0){
1188
- // get the last clone position
1189
- position = el.find('> .bx-clone').eq(slider.settings.maxSlides).position();
1190
- slider.active.last = false;
1191
- // normal non-zero requests
1192
- }else if(slideIndex >= 0){
1193
- var requestEl = slideIndex * getMoveBy();
1194
- position = slider.children.eq(requestEl).position();
1195
- }
1196
-
1197
- /* If the position doesn't exist
1198
- * (e.g. if you destroy the slider on a next click),
1199
- * it doesn't throw an error.
1200
- */
1201
- if ("undefined" !== typeof(position)) {
1202
- var value = slider.settings.mode == 'horizontal' ? -(position.left - moveBy) : -position.top;
1203
- // plugin values to be animated
1204
- setPositionProperty(value, 'slide', slider.settings.speed);
1205
- }
1206
- }
1207
- }
1208
-
1209
- /**
1210
- * Transitions to the next slide in the show
1211
- */
1212
- el.goToNextSlide = function(){
1213
- // if infiniteLoop is false and last page is showing, disregard call
1214
- if (!slider.settings.infiniteLoop && slider.active.last) return;
1215
- var pagerIndex = parseInt(slider.active.index) + 1;
1216
- el.goToSlide(pagerIndex, 'next');
1217
- }
1218
-
1219
- /**
1220
- * Transitions to the prev slide in the show
1221
- */
1222
- el.goToPrevSlide = function(){
1223
- // if infiniteLoop is false and last page is showing, disregard call
1224
- if (!slider.settings.infiniteLoop && slider.active.index == 0) return;
1225
- var pagerIndex = parseInt(slider.active.index) - 1;
1226
- el.goToSlide(pagerIndex, 'prev');
1227
- }
1228
-
1229
- /**
1230
- * Starts the auto show
1231
- *
1232
- * @param preventControlUpdate (boolean)
1233
- * - if true, auto controls state will not be updated
1234
- */
1235
- el.startAuto = function(preventControlUpdate){
1236
- // if an interval already exists, disregard call
1237
- if(slider.interval) return;
1238
- // create an interval
1239
- slider.interval = setInterval(function(){
1240
- slider.settings.autoDirection == 'next' ? el.goToNextSlide() : el.goToPrevSlide();
1241
- }, slider.settings.pause);
1242
- // if auto controls are displayed and preventControlUpdate is not true
1243
- if (slider.settings.autoControls && preventControlUpdate != true) updateAutoControls('stop');
1244
- }
1245
-
1246
- /**
1247
- * Stops the auto show
1248
- *
1249
- * @param preventControlUpdate (boolean)
1250
- * - if true, auto controls state will not be updated
1251
- */
1252
- el.stopAuto = function(preventControlUpdate){
1253
- // if no interval exists, disregard call
1254
- if(!slider.interval) return;
1255
- // clear the interval
1256
- clearInterval(slider.interval);
1257
- slider.interval = null;
1258
- // if auto controls are displayed and preventControlUpdate is not true
1259
- if (slider.settings.autoControls && preventControlUpdate != true) updateAutoControls('start');
1260
- }
1261
-
1262
- /**
1263
- * Returns current slide index (zero-based)
1264
- */
1265
- el.getCurrentSlide = function(){
1266
- return slider.active.index;
1267
- }
1268
-
1269
- /**
1270
- * Returns current slide element
1271
- */
1272
- el.getCurrentSlideElement = function(){
1273
- return slider.children.eq(slider.active.index);
1274
- }
1275
-
1276
- /**
1277
- * Returns number of slides in show
1278
- */
1279
- el.getSlideCount = function(){
1280
- return slider.children.length;
1281
- }
1282
-
1283
- /**
1284
- * Update all dynamic slider elements
1285
- */
1286
- el.redrawSlider = function(){
1287
- // resize all children in ratio to new screen size
1288
- slider.children.add(el.find('.bx-clone')).width(getSlideWidth());
1289
- // adjust the height
1290
- slider.viewport.css('height', getViewportHeight());
1291
- // update the slide position
1292
- if(!slider.settings.ticker) setSlidePosition();
1293
- // if active.last was true before the screen resize, we want
1294
- // to keep it last no matter what screen size we end on
1295
- if (slider.active.last) slider.active.index = getPagerQty() - 1;
1296
- // if the active index (page) no longer exists due to the resize, simply set the index as last
1297
- if (slider.active.index >= getPagerQty()) slider.active.last = true;
1298
- // if a pager is being displayed and a custom pager is not being used, update it
1299
- if(slider.settings.pager && !slider.settings.pagerCustom){
1300
- populatePager();
1301
- updatePagerActive(slider.active.index);
1302
- }
1303
- }
1304
-
1305
- /**
1306
- * Destroy the current instance of the slider (revert everything back to original state)
1307
- */
1308
- el.destroySlider = function(){
1309
- // don't do anything if slider has already been destroyed
1310
- if(!slider.initialized) return;
1311
- slider.initialized = false;
1312
- $('.bx-clone', this).remove();
1313
- slider.children.each(function() {
1314
- $(this).data("origStyle") != undefined ? $(this).attr("style", $(this).data("origStyle")) : $(this).removeAttr('style');
1315
- });
1316
- $(this).data("origStyle") != undefined ? this.attr("style", $(this).data("origStyle")) : $(this).removeAttr('style');
1317
- $(this).unwrap().unwrap();
1318
- if(slider.controls.el) slider.controls.el.remove();
1319
- if(slider.controls.next) slider.controls.next.remove();
1320
- if(slider.controls.prev) slider.controls.prev.remove();
1321
- if(slider.pagerEl && slider.settings.controls) slider.pagerEl.remove();
1322
- $('.bx-caption', this).remove();
1323
- if(slider.controls.autoEl) slider.controls.autoEl.remove();
1324
- clearInterval(slider.interval);
1325
- if(slider.settings.responsive) $(window).unbind('resize', resizeWindow);
1326
- }
1327
-
1328
- /**
1329
- * Reload the slider (revert all DOM changes, and re-initialize)
1330
- */
1331
- el.reloadSlider = function(settings){
1332
- if (settings != undefined) options = settings;
1333
- el.destroySlider();
1334
- init();
1335
- }
1336
-
1337
- init();
1338
-
1339
- // returns the current jQuery object
1340
- return this;
1341
- }
1342
-
1343
- })(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/includes/libraries/bxslider-4/jquery.bxslider.min.js DELETED
@@ -1,10 +0,0 @@
1
- /**
2
- * BxSlider v4.1.2 - Fully loaded, responsive content slider
3
- * http://bxslider.com
4
- *
5
- * Copyright 2014, Steven Wanderski - http://stevenwanderski.com - http://bxcreative.com
6
- * Written while drinking Belgian ales and listening to jazz
7
- *
8
- * Released under the MIT license - http://opensource.org/licenses/MIT
9
- */
10
- !function(t){var e={},s={mode:"horizontal",slideSelector:"",infiniteLoop:!0,hideControlOnEnd:!1,speed:500,easing:null,slideMargin:0,startSlide:0,randomStart:!1,captions:!1,ticker:!1,tickerHover:!1,adaptiveHeight:!1,adaptiveHeightSpeed:500,video:!1,useCSS:!0,preloadImages:"visible",responsive:!0,slideZIndex:50,touchEnabled:!0,swipeThreshold:50,oneToOneTouch:!0,preventDefaultSwipeX:!0,preventDefaultSwipeY:!1,pager:!0,pagerType:"full",pagerShortSeparator:" / ",pagerSelector:null,buildPager:null,pagerCustom:null,controls:!0,nextText:"Next",prevText:"Prev",nextSelector:null,prevSelector:null,autoControls:!1,startText:"Start",stopText:"Stop",autoControlsCombine:!1,autoControlsSelector:null,auto:!1,pause:4e3,autoStart:!0,autoDirection:"next",autoHover:!1,autoDelay:0,minSlides:1,maxSlides:1,moveSlides:0,slideWidth:0,onSliderLoad:function(){},onSlideBefore:function(){},onSlideAfter:function(){},onSlideNext:function(){},onSlidePrev:function(){},onSliderResize:function(){}};t.fn.bxSlider=function(n){if(0==this.length)return this;if(this.length>1)return this.each(function(){t(this).bxSlider(n)}),this;var o={},r=this;e.el=this;var a=t(window).width(),l=t(window).height(),d=function(){o.settings=t.extend({},s,n),o.settings.slideWidth=parseInt(o.settings.slideWidth),o.children=r.children(o.settings.slideSelector),o.children.length<o.settings.minSlides&&(o.settings.minSlides=o.children.length),o.children.length<o.settings.maxSlides&&(o.settings.maxSlides=o.children.length),o.settings.randomStart&&(o.settings.startSlide=Math.floor(Math.random()*o.children.length)),o.active={index:o.settings.startSlide},o.carousel=o.settings.minSlides>1||o.settings.maxSlides>1,o.carousel&&(o.settings.preloadImages="all"),o.minThreshold=o.settings.minSlides*o.settings.slideWidth+(o.settings.minSlides-1)*o.settings.slideMargin,o.maxThreshold=o.settings.maxSlides*o.settings.slideWidth+(o.settings.maxSlides-1)*o.settings.slideMargin,o.working=!1,o.controls={},o.interval=null,o.animProp="vertical"==o.settings.mode?"top":"left",o.usingCSS=o.settings.useCSS&&"fade"!=o.settings.mode&&function(){var t=document.createElement("div"),e=["WebkitPerspective","MozPerspective","OPerspective","msPerspective"];for(var i in e)if(void 0!==t.style[e[i]])return o.cssPrefix=e[i].replace("Perspective","").toLowerCase(),o.animProp="-"+o.cssPrefix+"-transform",!0;return!1}(),"vertical"==o.settings.mode&&(o.settings.maxSlides=o.settings.minSlides),r.data("origStyle",r.attr("style")),r.children(o.settings.slideSelector).each(function(){t(this).data("origStyle",t(this).attr("style"))}),c()},c=function(){r.wrap('<div class="bx-wrapper"><div class="bx-viewport"></div></div>'),o.viewport=r.parent(),o.loader=t('<div class="bx-loading" />'),o.viewport.prepend(o.loader),r.css({width:"horizontal"==o.settings.mode?100*o.children.length+215+"%":"auto",position:"relative"}),o.usingCSS&&o.settings.easing?r.css("-"+o.cssPrefix+"-transition-timing-function",o.settings.easing):o.settings.easing||(o.settings.easing="swing"),f(),o.viewport.css({width:"100%",overflow:"hidden",position:"relative"}),o.viewport.parent().css({maxWidth:p()}),o.settings.pager||o.viewport.parent().css({margin:"0 auto 0px"}),o.children.css({"float":"horizontal"==o.settings.mode?"left":"none",listStyle:"none",position:"relative"}),o.children.css("width",u()),"horizontal"==o.settings.mode&&o.settings.slideMargin>0&&o.children.css("marginRight",o.settings.slideMargin),"vertical"==o.settings.mode&&o.settings.slideMargin>0&&o.children.css("marginBottom",o.settings.slideMargin),"fade"==o.settings.mode&&(o.children.css({position:"absolute",zIndex:0,display:"none"}),o.children.eq(o.settings.startSlide).css({zIndex:o.settings.slideZIndex,display:"block"})),o.controls.el=t('<div class="bx-controls" />'),o.settings.captions&&P(),o.active.last=o.settings.startSlide==x()-1,o.settings.video&&r.fitVids();var e=o.children.eq(o.settings.startSlide);"all"==o.settings.preloadImages&&(e=o.children),o.settings.ticker?o.settings.pager=!1:(o.settings.pager&&T(),o.settings.controls&&C(),o.settings.auto&&o.settings.autoControls&&E(),(o.settings.controls||o.settings.autoControls||o.settings.pager)&&o.viewport.after(o.controls.el)),g(e,h)},g=function(e,i){var s=e.find("img, iframe").length;if(0==s)return i(),void 0;var n=0;e.find("img, iframe").each(function(){t(this).one("load",function(){++n==s&&i()}).each(function(){this.complete&&t(this).load()})})},h=function(){if(o.settings.infiniteLoop&&"fade"!=o.settings.mode&&!o.settings.ticker){var e="vertical"==o.settings.mode?o.settings.minSlides:o.settings.maxSlides,i=o.children.slice(0,e).clone().addClass("bx-clone"),s=o.children.slice(-e).clone().addClass("bx-clone");r.append(i).prepend(s)}o.loader.remove(),S(),"vertical"==o.settings.mode&&(o.settings.adaptiveHeight=!0),o.viewport.height(v()),r.redrawSlider(),o.settings.onSliderLoad(o.active.index),o.initialized=!0,o.settings.responsive&&t(window).bind("resize",Z),o.settings.auto&&o.settings.autoStart&&H(),o.settings.ticker&&L(),o.settings.pager&&q(o.settings.startSlide),o.settings.controls&&W(),o.settings.touchEnabled&&!o.settings.ticker&&O()},v=function(){var e=0,s=t();if("vertical"==o.settings.mode||o.settings.adaptiveHeight)if(o.carousel){var n=1==o.settings.moveSlides?o.active.index:o.active.index*m();for(s=o.children.eq(n),i=1;i<=o.settings.maxSlides-1;i++)s=n+i>=o.children.length?s.add(o.children.eq(i-1)):s.add(o.children.eq(n+i))}else s=o.children.eq(o.active.index);else s=o.children;return"vertical"==o.settings.mode?(s.each(function(){e+=t(this).outerHeight()}),o.settings.slideMargin>0&&(e+=o.settings.slideMargin*(o.settings.minSlides-1))):e=Math.max.apply(Math,s.map(function(){return t(this).outerHeight(!1)}).get()),e},p=function(){var t="100%";return o.settings.slideWidth>0&&(t="horizontal"==o.settings.mode?o.settings.maxSlides*o.settings.slideWidth+(o.settings.maxSlides-1)*o.settings.slideMargin:o.settings.slideWidth),t},u=function(){var t=o.settings.slideWidth,e=o.viewport.width();return 0==o.settings.slideWidth||o.settings.slideWidth>e&&!o.carousel||"vertical"==o.settings.mode?t=e:o.settings.maxSlides>1&&"horizontal"==o.settings.mode&&(e>o.maxThreshold||e<o.minThreshold&&(t=(e-o.settings.slideMargin*(o.settings.minSlides-1))/o.settings.minSlides)),t},f=function(){var t=1;if("horizontal"==o.settings.mode&&o.settings.slideWidth>0)if(o.viewport.width()<o.minThreshold)t=o.settings.minSlides;else if(o.viewport.width()>o.maxThreshold)t=o.settings.maxSlides;else{var e=o.children.first().width();t=Math.floor(o.viewport.width()/e)}else"vertical"==o.settings.mode&&(t=o.settings.minSlides);return t},x=function(){var t=0;if(o.settings.moveSlides>0)if(o.settings.infiniteLoop)t=o.children.length/m();else for(var e=0,i=0;e<o.children.length;)++t,e=i+f(),i+=o.settings.moveSlides<=f()?o.settings.moveSlides:f();else t=Math.ceil(o.children.length/f());return t},m=function(){return o.settings.moveSlides>0&&o.settings.moveSlides<=f()?o.settings.moveSlides:f()},S=function(){if(o.children.length>o.settings.maxSlides&&o.active.last&&!o.settings.infiniteLoop){if("horizontal"==o.settings.mode){var t=o.children.last(),e=t.position();b(-(e.left-(o.viewport.width()-t.width())),"reset",0)}else if("vertical"==o.settings.mode){var i=o.children.length-o.settings.minSlides,e=o.children.eq(i).position();b(-e.top,"reset",0)}}else{var e=o.children.eq(o.active.index*m()).position();o.active.index==x()-1&&(o.active.last=!0),void 0!=e&&("horizontal"==o.settings.mode?b(-e.left,"reset",0):"vertical"==o.settings.mode&&b(-e.top,"reset",0))}},b=function(t,e,i,s){if(o.usingCSS){var n="vertical"==o.settings.mode?"translate3d(0, "+t+"px, 0)":"translate3d("+t+"px, 0, 0)";r.css("-"+o.cssPrefix+"-transition-duration",i/1e3+"s"),"slide"==e?(r.css(o.animProp,n),r.bind("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd",function(){r.unbind("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd"),D()})):"reset"==e?r.css(o.animProp,n):"ticker"==e&&(r.css("-"+o.cssPrefix+"-transition-timing-function","linear"),r.css(o.animProp,n),r.bind("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd",function(){r.unbind("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd"),b(s.resetValue,"reset",0),N()}))}else{var a={};a[o.animProp]=t,"slide"==e?r.animate(a,i,o.settings.easing,function(){D()}):"reset"==e?r.css(o.animProp,t):"ticker"==e&&r.animate(a,speed,"linear",function(){b(s.resetValue,"reset",0),N()})}},w=function(){for(var e="",i=x(),s=0;i>s;s++){var n="";o.settings.buildPager&&t.isFunction(o.settings.buildPager)?(n=o.settings.buildPager(s),o.pagerEl.addClass("bx-custom-pager")):(n=s+1,o.pagerEl.addClass("bx-default-pager")),e+='<div class="bx-pager-item"><a href="" data-slide-index="'+s+'" class="bx-pager-link">'+n+"</a></div>"}o.pagerEl.html(e)},T=function(){o.settings.pagerCustom?o.pagerEl=t(o.settings.pagerCustom):(o.pagerEl=t('<div class="bx-pager" />'),o.settings.pagerSelector?t(o.settings.pagerSelector).html(o.pagerEl):o.controls.el.addClass("bx-has-pager").append(o.pagerEl),w()),o.pagerEl.on("click","a",I)},C=function(){o.controls.next=t('<a class="bx-next" href="">'+o.settings.nextText+"</a>"),o.controls.prev=t('<a class="bx-prev" href="">'+o.settings.prevText+"</a>"),o.controls.next.bind("click",y),o.controls.prev.bind("click",z),o.settings.nextSelector&&t(o.settings.nextSelector).append(o.controls.next),o.settings.prevSelector&&t(o.settings.prevSelector).append(o.controls.prev),o.settings.nextSelector||o.settings.prevSelector||(o.controls.directionEl=t('<div class="bx-controls-direction" />'),o.controls.directionEl.append(o.controls.prev).append(o.controls.next),o.controls.el.addClass("bx-has-controls-direction").append(o.controls.directionEl))},E=function(){o.controls.start=t('<div class="bx-controls-auto-item"><a class="bx-start" href="">'+o.settings.startText+"</a></div>"),o.controls.stop=t('<div class="bx-controls-auto-item"><a class="bx-stop" href="">'+o.settings.stopText+"</a></div>"),o.controls.autoEl=t('<div class="bx-controls-auto" />'),o.controls.autoEl.on("click",".bx-start",k),o.controls.autoEl.on("click",".bx-stop",M),o.settings.autoControlsCombine?o.controls.autoEl.append(o.controls.start):o.controls.autoEl.append(o.controls.start).append(o.controls.stop),o.settings.autoControlsSelector?t(o.settings.autoControlsSelector).html(o.controls.autoEl):o.controls.el.addClass("bx-has-controls-auto").append(o.controls.autoEl),A(o.settings.autoStart?"stop":"start")},P=function(){o.children.each(function(){var e=t(this).find("img:first").attr("title");void 0!=e&&(""+e).length&&t(this).append('<div class="bx-caption"><span>'+e+"</span></div>")})},y=function(t){o.settings.auto&&r.stopAuto(),r.goToNextSlide(),t.preventDefault()},z=function(t){o.settings.auto&&r.stopAuto(),r.goToPrevSlide(),t.preventDefault()},k=function(t){r.startAuto(),t.preventDefault()},M=function(t){r.stopAuto(),t.preventDefault()},I=function(e){o.settings.auto&&r.stopAuto();var i=t(e.currentTarget),s=parseInt(i.attr("data-slide-index"));s!=o.active.index&&r.goToSlide(s),e.preventDefault()},q=function(e){var i=o.children.length;return"short"==o.settings.pagerType?(o.settings.maxSlides>1&&(i=Math.ceil(o.children.length/o.settings.maxSlides)),o.pagerEl.html(e+1+o.settings.pagerShortSeparator+i),void 0):(o.pagerEl.find("a").removeClass("active"),o.pagerEl.each(function(i,s){t(s).find("a").eq(e).addClass("active")}),void 0)},D=function(){if(o.settings.infiniteLoop){var t="";0==o.active.index?t=o.children.eq(0).position():o.active.index==x()-1&&o.carousel?t=o.children.eq((x()-1)*m()).position():o.active.index==o.children.length-1&&(t=o.children.eq(o.children.length-1).position()),t&&("horizontal"==o.settings.mode?b(-t.left,"reset",0):"vertical"==o.settings.mode&&b(-t.top,"reset",0))}o.working=!1,o.settings.onSlideAfter(o.children.eq(o.active.index),o.oldIndex,o.active.index)},A=function(t){o.settings.autoControlsCombine?o.controls.autoEl.html(o.controls[t]):(o.controls.autoEl.find("a").removeClass("active"),o.controls.autoEl.find("a:not(.bx-"+t+")").addClass("active"))},W=function(){1==x()?(o.controls.prev.addClass("disabled"),o.controls.next.addClass("disabled")):!o.settings.infiniteLoop&&o.settings.hideControlOnEnd&&(0==o.active.index?(o.controls.prev.addClass("disabled"),o.controls.next.removeClass("disabled")):o.active.index==x()-1?(o.controls.next.addClass("disabled"),o.controls.prev.removeClass("disabled")):(o.controls.prev.removeClass("disabled"),o.controls.next.removeClass("disabled")))},H=function(){o.settings.autoDelay>0?setTimeout(r.startAuto,o.settings.autoDelay):r.startAuto(),o.settings.autoHover&&r.hover(function(){o.interval&&(r.stopAuto(!0),o.autoPaused=!0)},function(){o.autoPaused&&(r.startAuto(!0),o.autoPaused=null)})},L=function(){var e=0;if("next"==o.settings.autoDirection)r.append(o.children.clone().addClass("bx-clone"));else{r.prepend(o.children.clone().addClass("bx-clone"));var i=o.children.first().position();e="horizontal"==o.settings.mode?-i.left:-i.top}b(e,"reset",0),o.settings.pager=!1,o.settings.controls=!1,o.settings.autoControls=!1,o.settings.tickerHover&&!o.usingCSS&&o.viewport.hover(function(){r.stop()},function(){var e=0;o.children.each(function(){e+="horizontal"==o.settings.mode?t(this).outerWidth(!0):t(this).outerHeight(!0)});var i=o.settings.speed/e,s="horizontal"==o.settings.mode?"left":"top",n=i*(e-Math.abs(parseInt(r.css(s))));N(n)}),N()},N=function(t){speed=t?t:o.settings.speed;var e={left:0,top:0},i={left:0,top:0};"next"==o.settings.autoDirection?e=r.find(".bx-clone").first().position():i=o.children.first().position();var s="horizontal"==o.settings.mode?-e.left:-e.top,n="horizontal"==o.settings.mode?-i.left:-i.top,a={resetValue:n};b(s,"ticker",speed,a)},O=function(){o.touch={start:{x:0,y:0},end:{x:0,y:0}},o.viewport.bind("touchstart",X)},X=function(t){if(o.working)t.preventDefault();else{o.touch.originalPos=r.position();var e=t.originalEvent;o.touch.start.x=e.changedTouches[0].pageX,o.touch.start.y=e.changedTouches[0].pageY,o.viewport.bind("touchmove",Y),o.viewport.bind("touchend",V)}},Y=function(t){var e=t.originalEvent,i=Math.abs(e.changedTouches[0].pageX-o.touch.start.x),s=Math.abs(e.changedTouches[0].pageY-o.touch.start.y);if(3*i>s&&o.settings.preventDefaultSwipeX?t.preventDefault():3*s>i&&o.settings.preventDefaultSwipeY&&t.preventDefault(),"fade"!=o.settings.mode&&o.settings.oneToOneTouch){var n=0;if("horizontal"==o.settings.mode){var r=e.changedTouches[0].pageX-o.touch.start.x;n=o.touch.originalPos.left+r}else{var r=e.changedTouches[0].pageY-o.touch.start.y;n=o.touch.originalPos.top+r}b(n,"reset",0)}},V=function(t){o.viewport.unbind("touchmove",Y);var e=t.originalEvent,i=0;if(o.touch.end.x=e.changedTouches[0].pageX,o.touch.end.y=e.changedTouches[0].pageY,"fade"==o.settings.mode){var s=Math.abs(o.touch.start.x-o.touch.end.x);s>=o.settings.swipeThreshold&&(o.touch.start.x>o.touch.end.x?r.goToNextSlide():r.goToPrevSlide(),r.stopAuto())}else{var s=0;"horizontal"==o.settings.mode?(s=o.touch.end.x-o.touch.start.x,i=o.touch.originalPos.left):(s=o.touch.end.y-o.touch.start.y,i=o.touch.originalPos.top),!o.settings.infiniteLoop&&(0==o.active.index&&s>0||o.active.last&&0>s)?b(i,"reset",200):Math.abs(s)>=o.settings.swipeThreshold?(0>s?r.goToNextSlide():r.goToPrevSlide(),r.stopAuto()):b(i,"reset",200)}o.viewport.unbind("touchend",V)},Z=function(){var e=t(window).width(),i=t(window).height();(a!=e||l!=i)&&(a=e,l=i,r.redrawSlider(),o.settings.onSliderResize.call(r,o.active.index))};return r.goToSlide=function(e,i){if(!o.working&&o.active.index!=e)if(o.working=!0,o.oldIndex=o.active.index,o.active.index=0>e?x()-1:e>=x()?0:e,o.settings.onSlideBefore(o.children.eq(o.active.index),o.oldIndex,o.active.index),"next"==i?o.settings.onSlideNext(o.children.eq(o.active.index),o.oldIndex,o.active.index):"prev"==i&&o.settings.onSlidePrev(o.children.eq(o.active.index),o.oldIndex,o.active.index),o.active.last=o.active.index>=x()-1,o.settings.pager&&q(o.active.index),o.settings.controls&&W(),"fade"==o.settings.mode)o.settings.adaptiveHeight&&o.viewport.height()!=v()&&o.viewport.animate({height:v()},o.settings.adaptiveHeightSpeed),o.children.filter(":visible").fadeOut(o.settings.speed).css({zIndex:0}),o.children.eq(o.active.index).css("zIndex",o.settings.slideZIndex+1).fadeIn(o.settings.speed,function(){t(this).css("zIndex",o.settings.slideZIndex),D()});else{o.settings.adaptiveHeight&&o.viewport.height()!=v()&&o.viewport.animate({height:v()},o.settings.adaptiveHeightSpeed);var s=0,n={left:0,top:0};if(!o.settings.infiniteLoop&&o.carousel&&o.active.last)if("horizontal"==o.settings.mode){var a=o.children.eq(o.children.length-1);n=a.position(),s=o.viewport.width()-a.outerWidth()}else{var l=o.children.length-o.settings.minSlides;n=o.children.eq(l).position()}else if(o.carousel&&o.active.last&&"prev"==i){var d=1==o.settings.moveSlides?o.settings.maxSlides-m():(x()-1)*m()-(o.children.length-o.settings.maxSlides),a=r.children(".bx-clone").eq(d);n=a.position()}else if("next"==i&&0==o.active.index)n=r.find("> .bx-clone").eq(o.settings.maxSlides).position(),o.active.last=!1;else if(e>=0){var c=e*m();n=o.children.eq(c).position()}if("undefined"!=typeof n){var g="horizontal"==o.settings.mode?-(n.left-s):-n.top;b(g,"slide",o.settings.speed)}}},r.goToNextSlide=function(){if(o.settings.infiniteLoop||!o.active.last){var t=parseInt(o.active.index)+1;r.goToSlide(t,"next")}},r.goToPrevSlide=function(){if(o.settings.infiniteLoop||0!=o.active.index){var t=parseInt(o.active.index)-1;r.goToSlide(t,"prev")}},r.startAuto=function(t){o.interval||(o.interval=setInterval(function(){"next"==o.settings.autoDirection?r.goToNextSlide():r.goToPrevSlide()},o.settings.pause),o.settings.autoControls&&1!=t&&A("stop"))},r.stopAuto=function(t){o.interval&&(clearInterval(o.interval),o.interval=null,o.settings.autoControls&&1!=t&&A("start"))},r.getCurrentSlide=function(){return o.active.index},r.getCurrentSlideElement=function(){return o.children.eq(o.active.index)},r.getSlideCount=function(){return o.children.length},r.redrawSlider=function(){o.children.add(r.find(".bx-clone")).outerWidth(u()),o.viewport.css("height",v()),o.settings.ticker||S(),o.active.last&&(o.active.index=x()-1),o.active.index>=x()&&(o.active.last=!0),o.settings.pager&&!o.settings.pagerCustom&&(w(),q(o.active.index))},r.destroySlider=function(){o.initialized&&(o.initialized=!1,t(".bx-clone",this).remove(),o.children.each(function(){void 0!=t(this).data("origStyle")?t(this).attr("style",t(this).data("origStyle")):t(this).removeAttr("style")}),void 0!=t(this).data("origStyle")?this.attr("style",t(this).data("origStyle")):t(this).removeAttr("style"),t(this).unwrap().unwrap(),o.controls.el&&o.controls.el.remove(),o.controls.next&&o.controls.next.remove(),o.controls.prev&&o.controls.prev.remove(),o.pagerEl&&o.settings.controls&&o.pagerEl.remove(),t(".bx-caption",this).remove(),o.controls.autoEl&&o.controls.autoEl.remove(),clearInterval(o.interval),o.settings.responsive&&t(window).unbind("resize",Z))},r.reloadSlider=function(t){void 0!=t&&(n=t),r.destroySlider(),d()},d(),this}}(jQuery);
 
 
 
 
 
 
 
 
 
 
trunk/includes/libraries/bxslider-4/plugins/jquery.easing.1.3.js DELETED
@@ -1,205 +0,0 @@
1
- /*
2
- * jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/
3
- *
4
- * Uses the built in easing capabilities added In jQuery 1.1
5
- * to offer multiple easing options
6
- *
7
- * TERMS OF USE - jQuery Easing
8
- *
9
- * Open source under the BSD License.
10
- *
11
- * Copyright © 2008 George McGinley Smith
12
- * All rights reserved.
13
- *
14
- * Redistribution and use in source and binary forms, with or without modification,
15
- * are permitted provided that the following conditions are met:
16
- *
17
- * Redistributions of source code must retain the above copyright notice, this list of
18
- * conditions and the following disclaimer.
19
- * Redistributions in binary form must reproduce the above copyright notice, this list
20
- * of conditions and the following disclaimer in the documentation and/or other materials
21
- * provided with the distribution.
22
- *
23
- * Neither the name of the author nor the names of contributors may be used to endorse
24
- * or promote products derived from this software without specific prior written permission.
25
- *
26
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
27
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
28
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
29
- * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
30
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
31
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
32
- * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
33
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
34
- * OF THE POSSIBILITY OF SUCH DAMAGE.
35
- *
36
- */
37
-
38
- // t: current time, b: begInnIng value, c: change In value, d: duration
39
- jQuery.easing['jswing'] = jQuery.easing['swing'];
40
-
41
- jQuery.extend( jQuery.easing,
42
- {
43
- def: 'easeOutQuad',
44
- swing: function (x, t, b, c, d) {
45
- //alert(jQuery.easing.default);
46
- return jQuery.easing[jQuery.easing.def](x, t, b, c, d);
47
- },
48
- easeInQuad: function (x, t, b, c, d) {
49
- return c*(t/=d)*t + b;
50
- },
51
- easeOutQuad: function (x, t, b, c, d) {
52
- return -c *(t/=d)*(t-2) + b;
53
- },
54
- easeInOutQuad: function (x, t, b, c, d) {
55
- if ((t/=d/2) < 1) return c/2*t*t + b;
56
- return -c/2 * ((--t)*(t-2) - 1) + b;
57
- },
58
- easeInCubic: function (x, t, b, c, d) {
59
- return c*(t/=d)*t*t + b;
60
- },
61
- easeOutCubic: function (x, t, b, c, d) {
62
- return c*((t=t/d-1)*t*t + 1) + b;
63
- },
64
- easeInOutCubic: function (x, t, b, c, d) {
65
- if ((t/=d/2) < 1) return c/2*t*t*t + b;
66
- return c/2*((t-=2)*t*t + 2) + b;
67
- },
68
- easeInQuart: function (x, t, b, c, d) {
69
- return c*(t/=d)*t*t*t + b;
70
- },
71
- easeOutQuart: function (x, t, b, c, d) {
72
- return -c * ((t=t/d-1)*t*t*t - 1) + b;
73
- },
74
- easeInOutQuart: function (x, t, b, c, d) {
75
- if ((t/=d/2) < 1) return c/2*t*t*t*t + b;
76
- return -c/2 * ((t-=2)*t*t*t - 2) + b;
77
- },
78
- easeInQuint: function (x, t, b, c, d) {
79
- return c*(t/=d)*t*t*t*t + b;
80
- },
81
- easeOutQuint: function (x, t, b, c, d) {
82
- return c*((t=t/d-1)*t*t*t*t + 1) + b;
83
- },
84
- easeInOutQuint: function (x, t, b, c, d) {
85
- if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b;
86
- return c/2*((t-=2)*t*t*t*t + 2) + b;
87
- },
88
- easeInSine: function (x, t, b, c, d) {
89
- return -c * Math.cos(t/d * (Math.PI/2)) + c + b;
90
- },
91
- easeOutSine: function (x, t, b, c, d) {
92
- return c * Math.sin(t/d * (Math.PI/2)) + b;
93
- },
94
- easeInOutSine: function (x, t, b, c, d) {
95
- return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b;
96
- },
97
- easeInExpo: function (x, t, b, c, d) {
98
- return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b;
99
- },
100
- easeOutExpo: function (x, t, b, c, d) {
101
- return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b;
102
- },
103
- easeInOutExpo: function (x, t, b, c, d) {
104
- if (t==0) return b;
105
- if (t==d) return b+c;
106
- if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b;
107
- return c/2 * (-Math.pow(2, -10 * --t) + 2) + b;
108
- },
109
- easeInCirc: function (x, t, b, c, d) {
110
- return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b;
111
- },
112
- easeOutCirc: function (x, t, b, c, d) {
113
- return c * Math.sqrt(1 - (t=t/d-1)*t) + b;
114
- },
115
- easeInOutCirc: function (x, t, b, c, d) {
116
- if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b;
117
- return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b;
118
- },
119
- easeInElastic: function (x, t, b, c, d) {
120
- var s=1.70158;var p=0;var a=c;
121
- if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3;
122
- if (a < Math.abs(c)) { a=c; var s=p/4; }
123
- else var s = p/(2*Math.PI) * Math.asin (c/a);
124
- return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
125
- },
126
- easeOutElastic: function (x, t, b, c, d) {
127
- var s=1.70158;var p=0;var a=c;
128
- if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3;
129
- if (a < Math.abs(c)) { a=c; var s=p/4; }
130
- else var s = p/(2*Math.PI) * Math.asin (c/a);
131
- return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b;
132
- },
133
- easeInOutElastic: function (x, t, b, c, d) {
134
- var s=1.70158;var p=0;var a=c;
135
- if (t==0) return b; if ((t/=d/2)==2) return b+c; if (!p) p=d*(.3*1.5);
136
- if (a < Math.abs(c)) { a=c; var s=p/4; }
137
- else var s = p/(2*Math.PI) * Math.asin (c/a);
138
- if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
139
- return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b;
140
- },
141
- easeInBack: function (x, t, b, c, d, s) {
142
- if (s == undefined) s = 1.70158;
143
- return c*(t/=d)*t*((s+1)*t - s) + b;
144
- },
145
- easeOutBack: function (x, t, b, c, d, s) {
146
- if (s == undefined) s = 1.70158;
147
- return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;
148
- },
149
- easeInOutBack: function (x, t, b, c, d, s) {
150
- if (s == undefined) s = 1.70158;
151
- if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;
152
- return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;
153
- },
154
- easeInBounce: function (x, t, b, c, d) {
155
- return c - jQuery.easing.easeOutBounce (x, d-t, 0, c, d) + b;
156
- },
157
- easeOutBounce: function (x, t, b, c, d) {
158
- if ((t/=d) < (1/2.75)) {
159
- return c*(7.5625*t*t) + b;
160
- } else if (t < (2/2.75)) {
161
- return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;
162
- } else if (t < (2.5/2.75)) {
163
- return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;
164
- } else {
165
- return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;
166
- }
167
- },
168
- easeInOutBounce: function (x, t, b, c, d) {
169
- if (t < d/2) return jQuery.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b;
170
- return jQuery.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b;
171
- }
172
- });
173
-
174
- /*
175
- *
176
- * TERMS OF USE - EASING EQUATIONS
177
- *
178
- * Open source under the BSD License.
179
- *
180
- * Copyright © 2001 Robert Penner
181
- * All rights reserved.
182
- *
183
- * Redistribution and use in source and binary forms, with or without modification,
184
- * are permitted provided that the following conditions are met:
185
- *
186
- * Redistributions of source code must retain the above copyright notice, this list of
187
- * conditions and the following disclaimer.
188
- * Redistributions in binary form must reproduce the above copyright notice, this list
189
- * of conditions and the following disclaimer in the documentation and/or other materials
190
- * provided with the distribution.
191
- *
192
- * Neither the name of the author nor the names of contributors may be used to endorse
193
- * or promote products derived from this software without specific prior written permission.
194
- *
195
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
196
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
197
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
198
- * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
199
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
200
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
201
- * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
202
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
203
- * OF THE POSSIBILITY OF SUCH DAMAGE.
204
- *
205
- */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/includes/libraries/bxslider-4/plugins/jquery.fitvids.js DELETED
@@ -1,80 +0,0 @@
1
- /*global jQuery */
2
- /*jshint multistr:true browser:true */
3
- /*!
4
- * FitVids 1.0
5
- *
6
- * Copyright 2011, Chris Coyier - http://css-tricks.com + Dave Rupert - http://daverupert.com
7
- * Credit to Thierry Koblentz - http://www.alistapart.com/articles/creating-intrinsic-ratios-for-video/
8
- * Released under the WTFPL license - http://sam.zoy.org/wtfpl/
9
- *
10
- * Date: Thu Sept 01 18:00:00 2011 -0500
11
- */
12
-
13
- (function( $ ){
14
-
15
- "use strict";
16
-
17
- $.fn.fitVids = function( options ) {
18
- var settings = {
19
- customSelector: null
20
- };
21
-
22
- var div = document.createElement('div'),
23
- ref = document.getElementsByTagName('base')[0] || document.getElementsByTagName('script')[0];
24
-
25
- div.className = 'fit-vids-style';
26
- div.innerHTML = '&shy;<style> \
27
- .fluid-width-video-wrapper { \
28
- width: 100%; \
29
- position: relative; \
30
- padding: 0; \
31
- } \
32
- \
33
- .fluid-width-video-wrapper iframe, \
34
- .fluid-width-video-wrapper object, \
35
- .fluid-width-video-wrapper embed { \
36
- position: absolute; \
37
- top: 0; \
38
- left: 0; \
39
- width: 100%; \
40
- height: 100%; \
41
- } \
42
- </style>';
43
-
44
- ref.parentNode.insertBefore(div,ref);
45
-
46
- if ( options ) {
47
- $.extend( settings, options );
48
- }
49
-
50
- return this.each(function(){
51
- var selectors = [
52
- "iframe[src*='player.vimeo.com']",
53
- "iframe[src*='www.youtube.com']",
54
- "iframe[src*='www.kickstarter.com']",
55
- "object",
56
- "embed"
57
- ];
58
-
59
- if (settings.customSelector) {
60
- selectors.push(settings.customSelector);
61
- }
62
-
63
- var $allVideos = $(this).find(selectors.join(','));
64
-
65
- $allVideos.each(function(){
66
- var $this = $(this);
67
- if (this.tagName.toLowerCase() === 'embed' && $this.parent('object').length || $this.parent('.fluid-width-video-wrapper').length) { return; }
68
- var height = ( this.tagName.toLowerCase() === 'object' || ($this.attr('height') && !isNaN(parseInt($this.attr('height'), 10))) ) ? parseInt($this.attr('height'), 10) : $this.height(),
69
- width = !isNaN(parseInt($this.attr('width'), 10)) ? parseInt($this.attr('width'), 10) : $this.width(),
70
- aspectRatio = height / width;
71
- if(!$this.attr('id')){
72
- var videoID = 'fitvid' + Math.floor(Math.random()*999999);
73
- $this.attr('id', videoID);
74
- }
75
- $this.wrap('<div class="fluid-width-video-wrapper"></div>').parent('.fluid-width-video-wrapper').css('padding-top', (aspectRatio * 100)+"%");
76
- $this.removeAttr('height').removeAttr('width');
77
- });
78
- });
79
- };
80
- })( jQuery );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/includes/libraries/bxslider-4/readme.md DELETED
@@ -1,578 +0,0 @@
1
- #bxSlider 4.1.2
2
- ##The fully-loaded, responsive jQuery content slider
3
-
4
- ###Why should I use this slider?
5
- * Fully responsive - will adapt to any device
6
- * Horizontal, vertical, and fade modes
7
- * Slides can contain images, video, or HTML content
8
- * Full callback API and public methods
9
- * Small file size, fully themed, simple to implement
10
- * Browser support: Firefox, Chrome, Safari, iOS, Android, IE7+
11
- * Tons of configuration options
12
-
13
- For complete documentation, tons of examples, and a good time, visit:
14
-
15
- [http://bxslider.com](http://bxslider.com)
16
-
17
- Written by: Steven Wanderski - [http://stevenwanderski.com](http://stevenwanderski.com)
18
-
19
- ###License
20
- Released under the MIT license - http://opensource.org/licenses/MIT
21
-
22
- Let's get on with it!
23
-
24
- ##Installation
25
-
26
- ###Step 1: Link required files
27
-
28
- First and most important, the jQuery library needs to be included (no need to download - link directly from Google). Next, download the package from this site and link the bxSlider CSS file (for the theme) and the bxSlider Javascript file.
29
-
30
- ```html
31
- <!-- jQuery library (served from Google) -->
32
- <script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
33
- <!-- bxSlider Javascript file -->
34
- <script src="/js/jquery.bxslider.min.js"></script>
35
- <!-- bxSlider CSS file -->
36
- <link href="/lib/jquery.bxslider.css" rel="stylesheet" />
37
- ```
38
-
39
- ###Step 2: Create HTML markup
40
-
41
- Create a `<ul class="bxslider">` element, with a `<li>` for each slide. Slides can contain images, video, or any other HTML content!
42
-
43
- ```html
44
- <ul class="bxslider">
45
- <li><img src="/images/pic1.jpg" /></li>
46
- <li><img src="/images/pic2.jpg" /></li>
47
- <li><img src="/images/pic3.jpg" /></li>
48
- <li><img src="/images/pic4.jpg" /></li>
49
- </ul>
50
- ```
51
-
52
- ###Step 3: Call the bxSlider
53
-
54
- Call .bxslider() on `<ul class="bxslider">`. Note that the call must be made inside of a $(document).ready() call, or the plugin will not work!
55
-
56
- ```javascript
57
- $(document).ready(function(){
58
- $('.bxslider').bxSlider();
59
- });
60
- ```
61
-
62
- ##Configuration options
63
-
64
- ###General
65
-
66
- **mode**
67
- Type of transition between slides
68
- ```
69
- default: 'horizontal'
70
- options: 'horizontal', 'vertical', 'fade'
71
- ```
72
-
73
- **speed**
74
- Slide transition duration (in ms)
75
- ```
76
- default: 500
77
- options: integer
78
- ```
79
-
80
- **slideMargin**
81
- Margin between each slide
82
- ```
83
- default: 0
84
- options: integer
85
- ```
86
-
87
- **startSlide**
88
- Starting slide index (zero-based)
89
- ```
90
- default: 0
91
- options: integer
92
- ```
93
-
94
- **randomStart**
95
- Start slider on a random slide
96
- ```
97
- default: false
98
- options: boolean (true / false)
99
- ```
100
-
101
- **slideSelector**
102
- Element to use as slides (ex. <code>'div.slide'</code>).<br />Note: by default, bxSlider will use all immediate children of the slider element
103
- ```
104
- default: ''
105
- options: jQuery selector
106
- ```
107
-
108
- **infiniteLoop**
109
- If <code>true</code>, clicking "Next" while on the last slide will transition to the first slide and vice-versa
110
- ```
111
- default: true
112
- options: boolean (true / false)
113
- ```
114
-
115
- **hideControlOnEnd**
116
- If <code>true</code>, "Prev" and "Next" controls will receive a class <code>disabled</code> when slide is the first or the last<br/>Note: Only used when <code>infiniteLoop: false</code>
117
- ```
118
- default: false
119
- options: boolean (true / false)
120
- ```
121
-
122
- **easing**
123
- The type of "easing" to use during transitions. If using CSS transitions, include a value for the <code>transition-timing-function</code> property. If not using CSS transitions, you may include <code>plugins/jquery.easing.1.3.js</code> for many options.<br />See <a href="http://gsgd.co.uk/sandbox/jquery/easing/" target="_blank">http://gsgd.co.uk/sandbox/jquery/easing/</a> for more info.
124
- ```
125
- default: null
126
- options: if using CSS: 'linear', 'ease', 'ease-in', 'ease-out', 'ease-in-out', 'cubic-bezier(n,n,n,n)'. If not using CSS: 'swing', 'linear' (see the above file for more options)
127
- ```
128
-
129
- **captions**
130
- Include image captions. Captions are derived from the image's <code>title</code> attribute
131
- ```
132
- default: false
133
- options: boolean (true / false)
134
- ```
135
-
136
- **ticker**
137
- Use slider in ticker mode (similar to a news ticker)
138
- ```
139
- default: false
140
- options: boolean (true / false)
141
- ```
142
-
143
- **tickerHover**
144
- Ticker will pause when mouse hovers over slider. Note: this functionality does NOT work if using CSS transitions!
145
- ```
146
- default: false
147
- options: boolean (true / false)
148
- ```
149
-
150
- **adaptiveHeight**
151
- Dynamically adjust slider height based on each slide's height
152
- ```
153
- default: false
154
- options: boolean (true / false)
155
- ```
156
-
157
- **adaptiveHeightSpeed**
158
- Slide height transition duration (in ms). Note: only used if <code>adaptiveHeight: true</code>
159
- ```
160
- default: 500
161
- options: integer
162
- ```
163
-
164
- **video**
165
- If any slides contain video, set this to <code>true</code>. Also, include <code>plugins/jquery.fitvids.js</code><br />See <a href="http://fitvidsjs.com/" target="_blank">http://fitvidsjs.com/</a> for more info
166
- ```
167
- default: false
168
- options: boolean (true / false)
169
- ```
170
-
171
- **responsive**
172
- Enable or disable auto resize of the slider. Useful if you need to use fixed width sliders.
173
- ```
174
- default: true
175
- options: boolean (true /false)
176
- ```
177
-
178
- **useCSS**
179
- If true, CSS transitions will be used for horizontal and vertical slide animations (this uses native hardware acceleration). If false, jQuery animate() will be used.
180
- ```
181
- default: true
182
- options: boolean (true / false)
183
- ```
184
-
185
- **preloadImages**
186
- If 'all', preloads all images before starting the slider. If 'visible', preloads only images in the initially visible slides before starting the slider (tip: use 'visible' if all slides are identical dimensions)
187
- ```
188
- default: 'visible'
189
- options: 'all', 'visible'
190
- ```
191
-
192
- **touchEnabled**
193
- If <code>true</code>, slider will allow touch swipe transitions
194
- ```
195
- default: true
196
- options: boolean (true / false)
197
- ```
198
-
199
- **swipeThreshold**
200
- Amount of pixels a touch swipe needs to exceed in order to execute a slide transition. Note: only used if <code>touchEnabled: true</code>
201
- ```
202
- default: 50
203
- options: integer
204
- ```
205
-
206
- **oneToOneTouch**
207
- If <code>true</code>, non-fade slides follow the finger as it swipes
208
- ```
209
- default: true
210
- options: boolean (true / false)
211
- ```
212
-
213
- **preventDefaultSwipeX**
214
- If <code>true</code>, touch screen will not move along the x-axis as the finger swipes
215
- ```
216
- default: true
217
- options: boolean (true / false)
218
- ```
219
-
220
- **preventDefaultSwipeY**
221
- If <code>true</code>, touch screen will not move along the y-axis as the finger swipes
222
- ```
223
- default: false
224
- options: boolean (true / false)
225
- ```
226
-
227
- **wrapperClass**
228
- Class to wrap the slider in. Change to prevent from using default bxSlider styles.
229
- ```
230
- default: 'bx-wrapper'
231
- options: string
232
- ```
233
-
234
- ###Pager
235
-
236
- **pager**
237
- If <code>true</code>, a pager will be added
238
- ```
239
- default: true
240
- options: boolean (true / false)
241
- ```
242
-
243
- **pagerType**
244
- If <code>'full'</code>, a pager link will be generated for each slide. If <code>'short'</code>, a x / y pager will be used (ex. 1 / 5)
245
- ```
246
- default: 'full'
247
- options: 'full', 'short'
248
- ```
249
-
250
- **pagerShortSeparator**
251
- If <code>pagerType: 'short'</code>, pager will use this value as the separating character
252
- ```
253
- default: ' / '
254
- options: string
255
- ```
256
-
257
- **pagerSelector**
258
- Element used to populate the populate the pager. By default, the pager is appended to the bx-viewport
259
- ```
260
- default: ''
261
- options: jQuery selector
262
- ```
263
-
264
- **pagerCustom**
265
- Parent element to be used as the pager. Parent element must contain a <code>&lt;a data-slide-index="x"&gt;</code> element for each slide. See example <a href="/examples/thumbnail-method-1">here</a>. Not for use with dynamic carousels.
266
- ```
267
- default: null
268
- options: jQuery selector
269
- ```
270
-
271
- **buildPager**
272
- If supplied, function is called on every slide element, and the returned value is used as the pager item markup.<br />See <a href="http://bxslider.com/examples">examples</a> for detailed implementation
273
- ```
274
- default: null
275
- options: function(slideIndex)
276
- ```
277
-
278
- ###Controls
279
-
280
- **controls**
281
- If <code>true</code>, "Next" / "Prev" controls will be added
282
- ```
283
- default: true
284
- options: boolean (true / false)
285
- ```
286
-
287
- **nextText**
288
- Text to be used for the "Next" control
289
- ```
290
- default: 'Next'
291
- options: string
292
- ```
293
-
294
- **prevText**
295
- Text to be used for the "Prev" control
296
- ```
297
- default: 'Prev'
298
- options: string
299
- ```
300
-
301
- **nextSelector**
302
- Element used to populate the "Next" control
303
- ```
304
- default: null
305
- options: jQuery selector
306
- ```
307
-
308
- **prevSelector**
309
- Element used to populate the "Prev" control
310
- ```
311
- default: null
312
- options: jQuery selector
313
- ```
314
-
315
- **autoControls**
316
- If <code>true</code>, "Start" / "Stop" controls will be added
317
- ```
318
- default: false
319
- options: boolean (true / false)
320
- ```
321
-
322
- **startText**
323
- Text to be used for the "Start" control
324
- ```
325
- default: 'Start'
326
- options: string
327
- ```
328
-
329
- **stopText**
330
- Text to be used for the "Stop" control
331
- ```
332
- default: 'Stop'
333
- options: string
334
- ```
335
-
336
- **autoControlsCombine**
337
- When slideshow is playing only "Stop" control is displayed and vice-versa
338
- ```
339
- default: false
340
- options: boolean (true / false)
341
- ```
342
-
343
- **autoControlsSelector**
344
- Element used to populate the auto controls
345
- ```
346
- default: null
347
- options: jQuery selector
348
- ```
349
-
350
- ###Auto
351
-
352
- **auto**
353
- Slides will automatically transition
354
- ```
355
- default: false
356
- options: boolean (true / false)
357
- ```
358
-
359
- **pause**
360
- The amount of time (in ms) between each auto transition
361
- ```
362
- default: 4000
363
- options: integer
364
- ```
365
-
366
- **autoStart**
367
- Auto show starts playing on load. If <code>false</code>, slideshow will start when the "Start" control is clicked
368
- ```
369
- default: true
370
- options: boolean (true / false)
371
- ```
372
-
373
- **autoDirection**
374
- The direction of auto show slide transitions
375
- ```
376
- default: 'next'
377
- options: 'next', 'prev'
378
- ```
379
-
380
- **autoHover**
381
- Auto show will pause when mouse hovers over slider
382
- ```
383
- default: false
384
- options: boolean (true / false)
385
- ```
386
-
387
- **autoDelay**
388
- Time (in ms) auto show should wait before starting
389
- ```
390
- default: 0
391
- options: integer
392
- ```
393
-
394
- ###Carousel
395
-
396
- **minSlides**
397
- The minimum number of slides to be shown. Slides will be sized down if carousel becomes smaller than the original size.
398
- ```
399
- default: 1
400
- options: integer
401
- ```
402
-
403
- **maxSlides**
404
- The maximum number of slides to be shown. Slides will be sized up if carousel becomes larger than the original size.
405
- ```
406
- default: 1
407
- options: integer
408
- ```
409
-
410
- **moveSlides**
411
- The number of slides to move on transition. This value must be <code>>= minSlides</code>, and <code><= maxSlides</code>. If zero (default), the number of fully-visible slides will be used.
412
- ```
413
- default: 0
414
- options: integer
415
- ```
416
-
417
- **slideWidth**
418
- The width of each slide. This setting is required for all horizontal carousels!
419
- ```
420
- default: 0
421
- options: integer
422
- ```
423
-
424
- ###Callbacks
425
-
426
- **onSliderLoad**
427
- Executes immediately after the slider is fully loaded
428
- ```
429
- default: function(){}
430
- options: function(currentIndex){ // your code here }
431
- arguments:
432
- currentIndex: element index of the current slide
433
- ```
434
-
435
- **onSliderResize**
436
- Executes immediately after the slider is resized
437
- ```
438
- default: function(){}
439
- options: function(currentIndex){ // your code here }
440
- arguments:
441
- currentIndex: element index of the current slide
442
- ```
443
-
444
- **onSlideBefore**
445
- Executes immediately before each slide transition.
446
- ```
447
- default: function(){}
448
- options: function($slideElement, oldIndex, newIndex){ // your code here }
449
- arguments:
450
- $slideElement: jQuery element of the destination element
451
- oldIndex: element index of the previous slide (before the transition)
452
- newIndex: element index of the destination slide (after the transition)
453
- ```
454
-
455
- **onSlideAfter**
456
- Executes immediately after each slide transition. Function argument is the current slide element (when transition completes).
457
- ```
458
- default: function(){}
459
- options: function($slideElement, oldIndex, newIndex){ // your code here }
460
- arguments:
461
- $slideElement: jQuery element of the destination element
462
- oldIndex: element index of the previous slide (before the transition)
463
- newIndex: element index of the destination slide (after the transition)
464
- ```
465
-
466
- **onSlideNext**
467
- Executes immediately before each "Next" slide transition. Function argument is the target (next) slide element.
468
- ```
469
- default: function(){}
470
- options: function($slideElement, oldIndex, newIndex){ // your code here }
471
- arguments:
472
- $slideElement: jQuery element of the destination element
473
- oldIndex: element index of the previous slide (before the transition)
474
- newIndex: element index of the destination slide (after the transition)
475
- ```
476
-
477
- **onSlidePrev**
478
- Executes immediately before each "Prev" slide transition. Function argument is the target (prev) slide element.
479
- ```
480
- default: function(){}
481
- options: function($slideElement, oldIndex, newIndex){ // your code here }
482
- arguments:
483
- $slideElement: jQuery element of the destination element
484
- oldIndex: element index of the previous slide (before the transition)
485
- newIndex: element index of the destination slide (after the transition)
486
- ```
487
-
488
- ###Public methods
489
-
490
- **goToSlide**
491
- Performs a slide transition to the supplied slide index (zero-based)
492
- ```
493
- example:
494
- slider = $('.bxslider').bxSlider();
495
- slider.goToSlide(3);
496
- ```
497
-
498
- **goToNextSlide**
499
- Performs a "Next" slide transition
500
- ```
501
- example:
502
- slider = $('.bxslider').bxSlider();
503
- slider.goToNextSlide();
504
- ```
505
-
506
- **goToPrevSlide**
507
- Performs a "Prev" slide transition
508
- ```
509
- example:
510
- slider = $('.bxslider').bxSlider();
511
- slider.goToPrevSlide();
512
- ```
513
-
514
- **startAuto**
515
- Starts the auto show. Provide an argument <code>false</code> to prevent the auto controls from being updated.
516
- ```
517
- example:
518
- slider = $('.bxslider').bxSlider();
519
- slider.startAuto();
520
- ```
521
-
522
- **stopAuto**
523
- Stops the auto show. Provide an argument <code>false</code> to prevent the auto controls from being updated.
524
- ```
525
- example:
526
- slider = $('.bxslider').bxSlider();
527
- slider.stopAuto();
528
- ```
529
-
530
- **getCurrentSlide**
531
- Returns the current active slide
532
- ```
533
- example:
534
- slider = $('.bxslider').bxSlider();
535
- var current = slider.getCurrentSlide();
536
- ```
537
-
538
- **getSlideCount**
539
- Returns the total number of slides in the slider
540
- ```
541
- example:
542
- slider = $('.bxslider').bxSlider();
543
- var slideQty = slider.getSlideCount();
544
- ```
545
-
546
- **reloadSlider**
547
- Reload the slider. Useful when adding slides on the fly. Accepts an optional settings object. <a href="/examples/reload-slider-settings">See here for an example.</a>
548
- ```
549
- example:
550
- slider = $('.bxslider').bxSlider();
551
- slider.reloadSlider();
552
- ```
553
-
554
- **destroySlider**
555
- Destroy the slider. This reverts all slider elements back to their original state (before calling the slider).
556
- ```
557
- example:
558
- slider = $('.bxslider').bxSlider();
559
- slider.destroySlider();
560
- ```
561
-
562
- ## Changelog
563
-
564
- ### Version 4.1.2
565
- * Added `bower.json` configuration file. Manage bxSlider as a dependency using [bower](http://bower.io/).
566
-
567
- ### Version 4.1.1
568
- * Removed imagesLoaded library and added iframe preloading support
569
- * Added responsive option - setting to false will prevent $(window).resize binding
570
-
571
- ### Version 4.1
572
- * Carousel mode (minSlides / maxSlides) was re-written to be more intuitive.
573
- * SlideWidth now acts as it should (slides respect the width value).
574
- * SlideWidth now properly parsed: accepts string ("600px") or integer (600).
575
- * Slider now only needs to load visible slides (by default) in order to initialize which results in much faster loading. A "preloadImages" setting allows for configuration.
576
-
577
-
578
- Long live Zep.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/includes/libraries/class-redrokk-metabox-class.php DELETED
@@ -1,1436 +0,0 @@
1
- <?php
2
- /**
3
- *
4
- *
5
- * @Author Anonymous
6
- * @link http://www.redrokk.com
7
- * @Package Wordpress
8
- * @SubPackage RedRokk Library
9
- *
10
- * @version 2.0
11
- */
12
-
13
-
14
- //security
15
- defined( 'ABSPATH' ) or die( 'You\'re not supposed to be here.' );
16
-
17
- /**
18
- *
19
- *
20
- * @author Anonymous
21
- * @example
22
- * $gallery = redrokk_metabox_class::getInstance('gallery');
23
- */
24
- if ( !class_exists( 'redrokk_metabox_class' ) ):
25
- class redrokk_metabox_class {
26
-
27
- /**
28
- * HTML 'id' attribute of the edit screen section
29
- *
30
- * @var string
31
- */
32
- var $_id;
33
-
34
- /**
35
- * Save the form fields here that will be displayed to the user
36
- *
37
- * @var array
38
- */
39
- var $_fields;
40
-
41
- /**
42
- * Title of the edit screen section, visible to user
43
- * Default: None
44
- *
45
- * @var string
46
- */
47
- var $title;
48
-
49
- /**
50
- * Function that prints out the HTML for the edit screen section. Pass
51
- * function name as a string. Within a class, you can instead pass an
52
- * array to call one of the class's methods. See the second example under
53
- * Example below.
54
- * Default: None
55
- *
56
- * @var callback
57
- */
58
- var $callback = null;
59
-
60
- /**
61
- * The part of the page where the edit screen section should be shown
62
- * ('normal', 'advanced', or 'side'). (Note that 'side' doesn't exist before 2.7)
63
- * Default: 'advanced'
64
- *
65
- * @var string
66
- */
67
- var $context = 'normal';
68
-
69
- /**
70
- * The priority within the context where the boxes should show
71
- * ('high', 'core', 'default' or 'low')
72
- * Default: 'default'
73
- *
74
- * @var string
75
- */
76
- var $priority = 'default';
77
-
78
- /**
79
- * Arguments to pass into your callback function. The callback will receive the
80
- * $post object and whatever parameters are passed through this variable.
81
- * Default: null
82
- *
83
- * @var array
84
- */
85
- var $callback_args;
86
-
87
- /**
88
- * Prebuilt metaboxes can be activated by using this type
89
- * Default: default
90
- *
91
- * (options:)
92
- * default
93
- * images
94
- *
95
- * @var string
96
- */
97
- var $_type;
98
-
99
- /**
100
- *
101
- *
102
- * @var unknown_type
103
- */
104
- var $_category_name;
105
-
106
- /**
107
- * The type of Write screen on which to show the edit screen section
108
- * ('post', 'page', 'link', or 'custom_post_type' where custom_post_type
109
- * is the custom post type slug)
110
- * Default: None
111
- *
112
- * @var array
113
- */
114
- var $_object_types = array();
115
-
116
- /**
117
- * Whether or not to make the fields available as wp-options
118
- *
119
- * @var bool
120
- */
121
- var $_isAdminPage = false;
122
-
123
-
124
- /**
125
- * Constructor.
126
- *
127
- */
128
- function __construct( $options = array() ) {
129
- //initializing
130
- $this->setProperties( $options );
131
- $this->setOptionHooks();
132
-
133
- if ( !$this->callback ) {
134
- $this->callback = array( $this, 'show' );
135
- }
136
- if ( !$this->title ) {
137
- $this->title = ucfirst( $this->_id );
138
- }
139
-
140
- //registering this metabox
141
- add_action( 'add_meta_boxes', array( $this, '_register' ) );
142
-
143
- // backwards compatible (before WP 3.0)
144
- // add_action( 'admin_init', array($this, '_register'), 1 );
145
-
146
- add_action( 'save_post', array( $this, '_save' ) );
147
- add_filter( 'wp_redirect', array( $this, '_redirectIntervention' ), 40, 1 );
148
- }
149
-
150
-
151
- /**
152
- * Method properly inturprets the given parameter and sets it accordingly
153
- *
154
- * @param string|object $value
155
- */
156
- function setObjectTypes( $value ) {
157
- if ( is_a( $value, 'redrokk_post_class' ) ) {
158
- $value = $value->_post_type;
159
- }
160
- if ( is_a( $value, 'redrokk_admin_class' ) ) {
161
- $value = $value->id;
162
- $this->_isAdminPage = $value;
163
- }
164
- if ( is_array( $value ) ) {
165
- foreach ( $value as $v )
166
- $this->_object_types[] = $v;
167
- return $this;
168
- }
169
-
170
- $this->_object_types[] = $value;
171
- return $this;
172
- }
173
-
174
-
175
- /**
176
- * Method is designed to return the currently visible post type
177
- */
178
- function getCurrentPostType() {
179
- $post_type = false;
180
- if ( isset( $_REQUEST['post_type'] ) ) {
181
- $post_type = $_REQUEST['post_type'];
182
- }
183
- elseif ( isset( $_REQUEST['post'] ) ) {
184
- $post = get_post( $_REQUEST['post'] );
185
- $post_type = $post->post_type;
186
- }
187
- elseif ( isset( $_REQUEST['page'] ) ) {
188
- $post_type = $_REQUEST['page'];
189
- }
190
-
191
- return $post_type;
192
- }
193
-
194
-
195
- /**
196
- * Method properly prepares the metabox type by binding the necessary hooks
197
- *
198
- * @param mixed $value
199
- */
200
- function settype( $value = 'default' ) {
201
- $this->_type = $value;
202
-
203
- switch ( $this->_type ) {
204
- default:
205
- case 'default':
206
- add_action( 'metabox-show-'.$this->_id, array( $this, '_renderForm' ), 20, 1 );
207
- add_action( 'metabox-save-'.$this->_id, array( $this, 'saveAsPostMeta' ), 10, 2 );
208
- break;
209
- case 'image':
210
- case 'images':
211
- $this->_fields = array(
212
- array(
213
- 'name' => 'New Image',
214
- 'type' => 'title',
215
- ),
216
- array(
217
- 'name' => 'Image Title',
218
- 'id' => $this->_id.'_post_title',
219
- 'type' => 'text',
220
- ),
221
- array(
222
- 'name' => 'Description',
223
- 'id' => $this->_id.'_post_content',
224
- 'type' => 'textarea',
225
- ),
226
- array(
227
- 'name' => 'Image File',
228
- 'id' => $this->_id.'_image',
229
- 'type' => 'image',
230
- ),
231
- array(
232
- 'name' => 'Save Image',
233
- 'type' => 'submit',
234
- ),
235
- );
236
- add_action( 'metabox-show-'.$this->_id, array( $this, '_renderListImageAttachments' ), 20, 1 );
237
- add_action( 'metabox-show-'.$this->_id, array( $this, '_renderForm' ), 20, 1 );
238
- add_action( 'metabox-save-'.$this->_id, array( $this, 'saveAsAttachment' ), 1, 2 );
239
- break;
240
- case 'video':
241
- case 'videos':
242
- $this->_fields = array(
243
- array(
244
- 'name' => 'New Video',
245
- 'type' => 'title',
246
- ),
247
- array(
248
- 'name' => 'Video Title',
249
- 'id' => $this->_id.'_post_title',
250
- 'type' => 'text',
251
- ),
252
- array(
253
- 'name' => 'Description',
254
- 'id' => $this->_id.'_post_content',
255
- 'type' => 'textarea',
256
- ),
257
- array(
258
- 'name' => 'Video File',
259
- 'id' => $this->_id.'_image',
260
- 'type' => 'image',
261
- ),
262
- array(
263
- 'name' => 'Video Link',
264
- 'id' => $this->_id.'_link',
265
- 'type' => 'text',
266
- ),
267
- array(
268
- 'name' => '_videocat',
269
- 'id' => $this->_id.'_videocat',
270
- 'default'=>$this->getCategory(),
271
- 'type' => 'hidden',
272
- ),
273
- array(
274
- 'name' => '_metaid',
275
- 'id' => $this->_id.'_metaid',
276
- 'type' => 'hidden',
277
- ),
278
- array(
279
- 'name' => 'Save Video',
280
- 'type' => 'submit',
281
- ),
282
- );
283
- add_action( 'metabox-show-'.$this->_id, array( $this, '_renderListAttachments' ), 20, 1 );
284
- add_action( 'metabox-show-'.$this->_id, array( $this, '_renderListVideoAttachments' ), 20, 1 );
285
- add_action( 'metabox-show-'.$this->_id, array( $this, '_renderForm' ), 20, 1 );
286
- add_action( 'metabox-save-'.$this->_id, array( $this, 'saveAsPostMeta' ), 1, 2 );
287
- break;
288
- }
289
- }
290
-
291
-
292
- /**
293
- * Returns the category to use
294
- */
295
- function getCategory() {
296
- return isset( $this->_category_name )
297
- ? $this->_category_name
298
- : '_videocat';
299
- }
300
-
301
-
302
- /**
303
- * Method will save the posted content as an image attachment
304
- *
305
- */
306
- function saveAsAttachment( $source, $post_id ) {
307
- if ( empty( $_FILES ) || !isset( $_REQUEST[$this->_id.'files'] ) ) return $source;
308
-
309
- // initializing
310
- $property = $_REQUEST[$this->_id.'files'];
311
- $post_data = array();
312
-
313
- if ( isset( $source[$this->_id.'_post_title'] ) && $source[$this->_id.'_post_title'] ) {
314
- $post_data['post_title'] = $source[$this->_id.'_post_title'];
315
- }
316
-
317
- if ( isset( $source[$this->_id.'_post_content'] ) && $source[$this->_id.'_post_content'] ) {
318
- $post_data['post_content'] = $source[$this->_id.'_post_content'];
319
- }
320
-
321
- $id = media_handle_upload( $property, $post_id, $post_data );
322
- $source[$property] = $id;
323
-
324
- $type = 'post';
325
- if ( $this->getCurrentPostType() ) {
326
- $type = $this->getCurrentPostType();
327
- }
328
-
329
- //saving the attachment ID to the taxonomy
330
- if ( !in_array( $type, get_post_types( array( 'public' => false ) ) ) ) {
331
- $old = get_metadata( $type, $post_id, $property, true );
332
- if ( $id && $id != $old ) {
333
- wp_delete_attachment( $old, true );
334
- update_metadata( $type, $post_id, $property, $id );
335
- }
336
- }
337
-
338
- foreach ( (array)$source as $property => $new ) {
339
- //skip everything but the specially prefixed
340
- if ( strpos( $property, $this->_id ) !== 0 ) continue;
341
- if ( in_array( $property, array(
342
- $this->_id.'_post_title',
343
- $this->_id.'_post_content',
344
- ) ) ) continue;
345
-
346
- $old = get_metadata( $type, $id, $property, true );
347
- if ( $new && $new != $old ) {
348
- update_metadata( $type, $id, $property, $new );
349
- }
350
- elseif ( !$new ) {
351
- delete_metadata( $type, $id, $property, $old );
352
- }
353
- }
354
-
355
- return $source;
356
- }
357
-
358
-
359
- /**
360
- * Method saves the data provided as post meta values
361
- *
362
- * @param array $source
363
- * @param integer $post_id
364
- */
365
- function saveAsPostMeta( $source, $post_id ) {
366
- $type = 'post';
367
- if ( !$this->getCurrentPostType() ) {
368
- $type = $this->_table;
369
- }
370
-
371
- //save as a file
372
- //if there's no FILES then we save as a meta
373
- $source = $this->saveAsAttachment( $source, $post_id );
374
-
375
- //get the ID of this meta set
376
- $id = false;
377
- if ( isset( $source[$this->_id.'_metaid'] ) && $source[$this->_id.'_metaid'] ) {
378
- $id = $source[$this->_id.'_metaid'];
379
- }
380
-
381
- // if this is a built in metabox
382
- if ( $this->_type != 'default'
383
- && ( !isset( $source[$this->_id.'_image'] ) || !$source[$this->_id.'_image'] ) )
384
- return false;
385
-
386
- // Saving only the specially prefixed items
387
- foreach ( (array)$source as $property => $new ) {
388
- //skip everything but the specially prefixed
389
- if ( strpos( $property, $this->_id ) !== 0 ) continue;
390
-
391
- //each meta set has it's own ID
392
- $property = str_replace( $this->_id, $this->_category_name.'_'.$id, $property );
393
-
394
- $old = get_metadata( $type, $post_id, $property, true );
395
- if ( $new && $new != $old ) {
396
- update_metadata( $type, $post_id, $property, $new );
397
- }
398
- elseif ( !$new ) {
399
- delete_metadata( $type, $post_id, $property, $old );
400
- }
401
- }
402
-
403
- // maybe there's a last id
404
- if ( !$id ) {
405
- if ( !$id = get_metadata( $type, $post_id, '_metaidlast', true ) ) {
406
- $id = 0;
407
- }
408
- $id++;
409
- update_metadata( $type, $post_id, '_metaidlast', $id );
410
- }
411
-
412
- // saving all of the standard items
413
- foreach ( (array)$source as $property => $new ) {
414
- //skip special properties that are prefixed with the id
415
- if ( strpos( $property, $this->_id ) === 0 ) continue;
416
-
417
- $old = get_metadata( $type, $post_id, $property, true );
418
- update_metadata( $type, $post_id, $property, $new );
419
-
420
- // if ($new && $new != $old) {
421
- // update_metadata($type, $post_id, $property, $new);
422
- // }
423
- // elseif (!$new) {
424
- // delete_metadata($type, $post_id, $property, $old);
425
- // }
426
-
427
- }
428
-
429
- return true;
430
- }
431
-
432
-
433
- /**
434
- * Do something with the data entered
435
- *
436
- * @param integer $post_id
437
- */
438
- function _save( $post_id ) {
439
- //initializing
440
- $post = get_post( $post_id );
441
-
442
- // verify if this is an auto save routine.
443
- // If it is our form has not been submitted, so we dont want to do anything
444
- if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE )
445
- return;
446
-
447
- // verify this came from the our screen and with proper authorization,
448
- // because save_post can be triggered at other times
449
- if ( !isset( $_REQUEST[ get_class().$this->_id ] ) )
450
- return;
451
-
452
- if ( !wp_verify_nonce( $_REQUEST[ get_class().$this->_id ], plugin_basename( __FILE__ ) ) )
453
- return;
454
-
455
- // this metabox is to be displayed for a certain object type only
456
- if ( !in_array( $post->post_type, $this->_object_types ) )
457
- return;
458
-
459
- // Check permissions
460
- if ( 'page' == $post->post_type ) {
461
- if ( !current_user_can( 'edit_page', $post->ID ) )
462
- return;
463
- }
464
- else {
465
- if ( !current_user_can( 'edit_post', $post->ID ) )
466
- return;
467
- }
468
-
469
- //saving the request data
470
- if ( !$this->_type ) $this->setType();
471
- do_action( 'metabox-save-'.$this->_id, $this->getRequestPostMetas(), $post->ID, $this );
472
- return true;
473
- }
474
-
475
-
476
- /**
477
- * Method returns the post meta
478
- *
479
- */
480
- function getRequestPostMetas() {
481
- $ignores = array( 'post_title', 'post_name', 'post_content', 'post_excerpt', 'post',
482
- 'post_status', 'post_type', 'post_author', 'ping_status', 'post_parent', 'message',
483
- 'post_category', 'comment_status', 'menu_order', 'to_ping', 'pinged', 'post_password',
484
- 'guid', 'post_content_filtered', 'import_id', 'post_date', 'post_date_gmt', 'tags_input',
485
- 'action' );
486
-
487
- $fields = array();
488
- foreach ( (array)$this->_fields as $field ) {
489
- if ( !array_key_exists( 'id', $field ) ) continue;
490
- $fields[] = $field['id'];
491
- }
492
-
493
- $requests = $_REQUEST;
494
- foreach ( (array)$requests as $k => $request ) {
495
- if ( ( !empty( $fields ) && !in_array( $k, $fields ) )
496
- || ( in_array( $k, $ignores ) || strpos( $k, 'nounce' ) !== false ) ) {
497
- unset( $requests[$k] );
498
- }
499
- }
500
-
501
- return apply_filters( 'metabox-requests-'.$this->_id, $requests );
502
- }
503
-
504
-
505
- /**
506
- * Display the inner contents of the metabox
507
- *
508
- * @param object $post
509
- */
510
- function show( $post ) {
511
- // Use nonce for verification
512
- wp_nonce_field( plugin_basename( __FILE__ ), get_class().$this->_id );
513
- do_action( 'metabox-show-'.$this->_id, $this->_fields, $this );
514
- }
515
-
516
-
517
- /**
518
- * Method displays a list of attached images
519
- *
520
- */
521
- function _renderListImageAttachments() {
522
- global $post, $current_screen;
523
- $images = get_children( "post_parent=$post->ID&post_type=attachment&post_mime_type=image" );
524
-
525
- // no images to render
526
- if ( empty( $images ) ) {
527
- ?><p>No images have been saved.</p><?php
528
-
529
- // rendering the images
530
- } else {
531
-
532
- ?>
533
- <table class="wp-list-table form-table widefat" style="border:none;">
534
- <?php foreach ( (array)$images as $post_id => $image ): ?>
535
- <?php $image_attributes = wp_get_attachment_image_src( $image->ID, 'thumbnail' ); ?>
536
- <tbody id="the-list">
537
- <tr>
538
- <th scope="row" style="width: 140px">
539
- <div style="padding:10px;background:whiteSmoke;">
540
- <img src="<?php echo wp_get_attachment_thumb_url( $image->ID ); ?>" /></div>
541
- </th>
542
- <td>
543
- <b><?php echo $image->post_title; ?></b>
544
- <p><?php echo get_the_content( $image->ID ); ?></p>
545
-
546
- <div class="row-actions">
547
- <span class="inline">
548
- <a href="<?php echo wp_nonce_url(
549
- "media.php?attachment_id=$image->ID"
550
- ."&action=edit&_redirect="
551
- .urlencode( $this->_currentPageURL() )
552
- ); ?>">
553
- Edit</a> |
554
- </span>
555
- <span class="trash">
556
- <a class="submitdelete"
557
- onclick="return showNotice.warn();"
558
- href="<?php echo wp_nonce_url(
559
- "post.php?action=delete&_redirect="
560
- .urlencode( $this->_currentPageURL() )
561
- ."&amp;post=$image->ID",
562
- 'delete-attachment_' . $image->ID ); ?>">
563
- Delete Permanently</a> |
564
- </span>
565
- <span class="inline">
566
- <a target="_blank"
567
- href="<?php echo get_attachment_link( $image->ID ); ?>">
568
- View</a>
569
- </span>
570
- </div>
571
- </td>
572
- </tr>
573
- </tbody>
574
- <?php endforeach; ?>
575
- </table>
576
- <?php
577
- }
578
- return;
579
- }
580
-
581
-
582
- /**
583
- * Return a clean list of meta listings created by this system
584
- *
585
- * @param string $category
586
- * $param object $post
587
- */
588
- public static function getMetaListings( $category, $post = null ) {
589
- // initializing
590
- if ( $post === NULL ) {
591
- global $post;
592
- }
593
- $custom = get_post_custom( $post->ID );
594
- $return = array();
595
-
596
- //looping all values to build our return array
597
- foreach ( (array)$custom as $property => $value ) {
598
- $parts = explode( '_', $property );
599
- if ( !isset( $parts[0] ) || !isset( $parts[1] ) || !isset( $parts[2] ) ) continue;
600
- if ( $parts[0] != $category ) continue;
601
-
602
- $pro = str_replace( $parts[0].'_'.$parts[1].'_', '', $property );
603
- $return[$parts[1]][$pro] = $value;
604
- }
605
-
606
- return $return;
607
- }
608
-
609
-
610
- /**
611
- * Function removes a specific category meta
612
- *
613
- * @param string $category
614
- * $param string $meta_id
615
- * $param object $post
616
- */
617
- public static function deleteMetaListing( $category, $meta_id, $post = null ) {
618
- // initializing
619
- if ( $post === NULL ) {
620
- global $post;
621
- }
622
- $listings = redrokk_metabox_class::getMetaListings( $category, $post );
623
- if ( !isset( $listings[$meta_id] ) ) return false;
624
-
625
- $type = 'post';
626
-
627
- foreach ( (array)$listings[$meta_id] as $property => $value ) {
628
- $pro = $category.'_'.$meta_id.'_'.$property;
629
- delete_metadata( $type, $post->ID, $pro, $value[0] );
630
- }
631
- return true;
632
- }
633
-
634
-
635
- /**
636
- * Method displays a list of meta attachments
637
- *
638
- */
639
- function _renderListAttachments() {
640
- global $post;
641
-
642
- //delete action prior to pulling new listings
643
- if ( isset( $_REQUEST['redrokkdelete'] ) && $_REQUEST['redrokkdelete'] ) {
644
- redrokk_metabox_class::deleteMetaListing( $this->_category_name, $_REQUEST['redrokkdelete'], $post );
645
- }
646
-
647
- //pull new listings
648
- $metaListings = redrokk_metabox_class::getMetaListings( $this->_category_name, $post );
649
-
650
- if ( !empty( $metaListings ) ) {
651
- ?>
652
- <table class="wp-list-table form-table widefat" style="border:none;">
653
- <tbody id="the-list">
654
- <?php foreach ( (array)$metaListings as $meta_id => $video ): ?>
655
- <?php $video = apply_filters( 'redrokk_metabox_class::_renderListAttachments', $video, $meta_id );?>
656
-
657
- <tr id="<?php echo $this->_category_name; ?>_<?php echo $meta_id; ?>">
658
- <th scope="row" style="width: 140px">
659
- <div style="padding:10px;background:whiteSmoke;">
660
- <?php if ( isset( $video['link'] ) ) echo apply_filters( 'the_content', $video['link'][0] ); ?>
661
- </div>
662
- </th>
663
- <td>
664
- <b><?php if ( isset( $video['post_title'] ) ) echo $video['post_title'][0]; ?></b>
665
- <p><?php if ( isset( $video['post_content'] ) ) echo $video['post_content'][0]; ?></p>
666
-
667
- <div class="row-actions">
668
- <span class="inline">
669
- <a href="#" id="edit_<?php echo $this->_category_name; ?>_<?php echo $meta_id; ?>">
670
- Edit</a> |
671
- </span>
672
- <span class="trash">
673
- <a class="submitdelete"
674
- onclick="return showNotice.warn();"
675
- href="<?php echo site_url( "wp-admin/post.php?post={$post->ID}"
676
- ."&action=edit"
677
- ."&redrokkdelete=$meta_id"
678
- ); ?>">
679
- Delete Permanently</a>
680
- </span>
681
- </div>
682
- <script>
683
- jQuery('#edit_<?php echo $this->_category_name; ?>_<?php echo $meta_id; ?>').click(function(){
684
- var data = {
685
- <?php
686
- $data = array();
687
-
688
- //making sure all fields will be cleared
689
- foreach ( (array)$this->_fields as $field ) {
690
- if ( !isset( $field['id'] ) || !isset( $field['type'] ) ) continue;
691
- if ( !in_array( $field['type'], array( 'text', 'file', 'image', 'textarea', 'hidden' ) ) )
692
- continue;
693
-
694
- $id = str_replace( $this->_id.'_', '', $field['id'] );
695
- $data[$id] = "'$id':''";
696
- }
697
-
698
- //adding our values to the array
699
- foreach ( (array)$video as $vp => $vv ) {
700
- if ( isset( $vv[0] ) ) $vv = $vv[0];
701
- $data[$vp] = "'$vp':'$vv'";
702
- }
703
-
704
- //adding the meta ID to the array
705
- $data[$id] = "'metaid':'$meta_id'";
706
-
707
- echo implode( ',', $data );
708
- ?>
709
- };
710
-
711
- jQuery.each(data, function(key, value){
712
- jQuery('#<?php echo $this->_id; ?>_'+key).val( value );
713
- });
714
- return false;
715
- });
716
- </script>
717
- </td>
718
- <?php do_action( 'redrokk_metabox_class::_renderListAttachments::rows', $video, $meta_id, $this ); ?>
719
- </tr>
720
- <?php endforeach; ?>
721
- </tbody>
722
- </table>
723
- <?php
724
- }
725
-
726
- }
727
-
728
-
729
- /**
730
- * Method displays a list of attached videos
731
- *
732
- */
733
- function _renderListVideoAttachments() {
734
- global $post;
735
-
736
- //pull new listings
737
- $videos = get_children( "post_parent=$post->ID&post_type=attachment&post_mime_type=video/mp4" );
738
-
739
- // no images to render
740
- if ( !empty( $videos ) ) {
741
- ?>
742
- <table class="wp-list-table form-table widefat" style="border:none;">
743
- <tbody id="the-list">
744
- <?php foreach ( (array)$videos as $post_id => $video ): ?>
745
- <?php $image_attributes = wp_get_attachment_link( $video->ID ); ?>
746
- <tr>
747
- <th scope="row" style="width: 140px">
748
- <div style="padding:10px;background:whiteSmoke;">
749
- <?php echo $image_attributes; ?>
750
- </div>
751
- </th>
752
- <td>
753
- <b><?php echo $video->post_title; ?></b>
754
- <p><?php echo get_the_content( $video->ID ); ?></p>
755
-
756
- <div class="row-actions">
757
- <span class="inline">
758
- <a href="<?php echo wp_nonce_url(
759
- "media.php?attachment_id=$meta_id"
760
- ."&action=edit&_redirect="
761
- .urlencode( $this->_currentPageURL() )
762
- ); ?>">
763
- Edit</a> |
764
- </span>
765
- <span class="trash">
766
- <a class="submitdelete"
767
- onclick="return showNotice.warn();"
768
- href="<?php echo wp_nonce_url(
769
- "post.php?action=delete&_redirect="
770
- .urlencode( $this->_currentPageURL() )
771
- ."&amp;post=$video->ID",
772
- 'delete-attachment_' . $video->ID ); ?>">
773
- Delete Permanently</a>
774
- </span>
775
- </div>
776
- </td>
777
- </tr>
778
- <?php endforeach; ?>
779
- </tbody>
780
- </table>
781
- <?php
782
- }
783
- }
784
-
785
-
786
- /**
787
- * Method renders the form from any source
788
- *
789
- * @param array $fields
790
- */
791
- function _renderForm( $fields = array() ) {
792
- //initializing
793
- global $post;
794
- $defaults = array(
795
- 'name' => '',
796
- 'desc' => '',
797
- 'id' => '',
798
- 'type' => 'text',
799
- 'options' => array(),
800
- 'default' => '',
801
- 'value' => '',
802
- 'class' => '',
803
- 'multiple' => '',
804
- 'args' => array(
805
- 'hide_empty' => 0,
806
- 'name' => 'element_name',
807
- 'hierarchical' => true
808
- ),
809
- 'attributes' => ''
810
- );
811
-
812
- // no fields to render
813
- if ( empty( $fields ) ) {
814
- ?>
815
- <p>No form fields have been defined. Use <pre>
816
- $metabox->set('_fields', array(
817
- array(
818
- 'name' => 'Title',
819
- 'type' => 'title',
820
- ),
821
- array(
822
- 'name' => 'Title',
823
- 'desc' => '',
824
- 'id' => 'title',
825
- 'type' => 'text',
826
- 'std' => ''
827
- ),
828
- array(
829
- 'name' => 'image',
830
- 'desc' => '',
831
- 'id' => 'imagefile',
832
- 'type' => 'image',
833
- 'std' => ''
834
- ),
835
- array(
836
- 'name' => 'Textarea',
837
- 'desc' => 'Enter big text here',
838
- 'id' => 'textarea_id',
839
- 'type' => 'textarea',
840
- 'std' => 'Default value 2'
841
- ),
842
- array(
843
- 'name' => 'Select box',
844
- 'id' => 'select_id',
845
- 'type' => 'select',
846
- 'options'=> array(
847
- 'value1' => 'Value 1',
848
- 'value2' => 'Value 2',
849
- 'value3' => 'Value 3',
850
- 'value4' => 'Value 4',
851
- )
852
- ),
853
- array(
854
- 'name' => 'Radio',
855
- 'id' => 'radio_id',
856
- 'type' => 'radio',
857
- 'value' => 'test',
858
- 'desc' => 'Check this box if you want its value saved',
859
- ),
860
- array(
861
- 'name' => '',
862
- 'id' => 'radio_id',
863
- 'type' => 'radio',
864
- 'value' => 'test2',
865
- 'desc' => 'Check this box if you want its value saved',
866
- ),
867
- array(
868
- 'name' => 'Checkbox',
869
- 'id' => 'checkbox_id',
870
- 'type' => 'checkbox',
871
- 'desc' => 'Check this box if you want its value saved',
872
- ),
873
- ));</pre>
874
- </p>
875
- <?php
876
-
877
- // rendering the fields
878
- } else {
879
- ?>
880
- <table class="form-table">
881
- <?php
882
- // do_action("{$this->_class}_before");
883
- $custom = get_post_custom( $this->_id );
884
-
885
- foreach ( (array)$fields as $field ):
886
- $field = wp_parse_args( $field, $defaults );
887
- $field['args'] = wp_parse_args( $field['args'], $defaults['args'] );
888
-
889
- extract( $field );
890
- $field['args']['name'] = $element_name = $id;
891
-
892
- // grabbing the meta value
893
- if ( array_key_exists( $id, $custom ) ) {
894
- if ( isset( $custom[$id][0] ) )
895
- $meta = esc_attr( $custom[$id][0] );
896
- else
897
- $meta = esc_attr( $custom[$id] );
898
- } else {
899
- $meta = $default;
900
- }
901
-
902
- $id = sanitize_title( $id );
903
-
904
- if ( array_key_exists( 'deleteattachment', $_GET )
905
- && $id == $_GET['fileproperty']
906
- && $meta == $_GET['deleteattachment'] ) {
907
- wp_delete_attachment( $_GET['deleteattachment'], $force_delete = true );
908
- update_post_meta( $post->ID, $id, '' );
909
- }
910
- ?>
911
- <?php switch ( $type ) { default: ?>
912
- <?php if ( is_callable( $type ) && function_exists( $type ) ) : ?>
913
- <tr>
914
- <th scope="row" style="width: 140px">
915
- <label for="<?php echo $id; ?>"><?php echo $name; ?></label>
916
- </th>
917
- <td>
918
- <?php call_user_func( $type, $args ); ?>
919
- <span class="description"><?php echo $desc; ?></span>
920
- </td>
921
- </tr>
922
- <?php break; endif; ?>
923
- <?php case 'text': ?>
924
- <tr>
925
- <th scope="row" style="width: 140px">
926
- <label for="<?php echo $id; ?>"><?php echo $name; ?></label>
927
- </th>
928
- <td>
929
- <input <?php echo $attributes ?>
930
- id="<?php echo $id; ?>"
931
- value="<?php echo $meta; ?>"
932
- type="<?php echo $type; ?>"
933
- name="<?php echo $id; ?>"
934
- class="text large-text <?php echo $class; ?>" />
935
- <span class="description"><?php echo $desc; ?></span>
936
- </td>
937
- </tr>
938
- <?php break; ?>
939
- <?php case 'submit': ?>
940
- <?php case 'button': ?>
941
- <tr>
942
- <td colspan="2">
943
- <input <?php echo $attributes ?>
944
- id="<?php echo $id; ?>"
945
- value="<?php echo $name; ?>"
946
- type="submit"
947
- name="submit"
948
- class="button-primary <?php echo $class; ?>" />
949
- <span class="description"><?php echo $desc; ?></span>
950
- </td>
951
- </tr>
952
- <?php break; ?>
953
- <?php case 'file': ?>
954
- <?php case 'image': ?>
955
- <tr>
956
- <th scope="row" style="width: 140px">
957
- <label for="<?php echo $id; ?>"><?php echo $name; ?></label>
958
- </th>
959
- <td>
960
- <?php if ( $meta && wp_get_attachment_url( $meta ) ): ?>
961
- <?php echo wp_get_attachment_image( $meta ); ?>
962
- <span><a href="<?php echo add_query_arg( 'fileproperty', $id, add_query_arg( 'deleteattachment', $meta, $this->_currentPageURL() ) ); ?>">Delete Image</a></span>
963
- <?php else: ?>
964
- <input type="hidden" name="<?php echo $this->_id; ?>files" value="<?php echo $id; ?>" />
965
- <!-- first hidden input forces this item to be submitted when it is not checked -->
966
- <input <?php echo $attributes ?>
967
- id="<?php echo $id; ?>"
968
- type="file"
969
- name="<?php echo $id; ?>"
970
- onChange="jQuery(this).closest('form').attr('enctype', 'multipart/form-data');"
971
- class="<?php echo $class; ?>" />
972
- <?php endif; ?>
973
- <span class="description"><?php echo $desc; ?></span>
974
- </td>
975
- </tr>
976
- <?php break; ?>
977
- <?php case 'title': ?>
978
- <tr>
979
- <th colspan="2" scope="row">
980
- <h3 <?php echo $attributes ?> style="border: 1px solid #ddd;
981
- padding: 10px;
982
- background: #eee;
983
- border-radius: 2px;
984
- color: #666;
985
- margin: 0;"><?php echo $name; ?>
986
- </h3>
987
- </th>
988
- </tr>
989
- <?php break; ?>
990
- <?php case 'checkbox': ?>
991
- <tr>
992
- <th scope="row" style="width: 140px">
993
- <label for="<?php echo $id; ?>"><?php echo $name; ?></label>
994
- </th>
995
- <td>
996
- <input type="hidden" name="<?php echo $id; ?>" value="" />
997
- <!-- first hidden input forces this item to be submitted when it is not checked -->
998
-
999
- <?php foreach ( (array)$options as $_value => $_name ): ?>
1000
- <input value="<?php echo $_value; ?>" type="checkbox" <?php echo $attributes ?>
1001
- name="<?php echo $element_name; ?>" id="<?php echo $id; ?>"
1002
- <?php echo $meta == $_value? 'checked="checked"' :''; ?>
1003
- class="<?php echo $class; ?>" />
1004
- <?php echo $_name; ?>
1005
- <?php endforeach; ?>
1006
- <span class="description"><?php echo $desc; ?></span>
1007
- </td>
1008
- </tr>
1009
- <?php break; ?>
1010
- <?php case 'radio': ?>
1011
- <tr>
1012
- <th scope="row" style="width: 140px">
1013
- <label for="<?php echo $id; ?>"><?php echo $name; ?></label>
1014
- </th>
1015
- <td>
1016
- <?php foreach ( (array)$options as $_value => $_name ): ?>
1017
- <input name="<?php echo $element_name; ?>" id="<?php echo $id; ?>"
1018
- value="<?php echo $_value; ?>" type="<?php echo $type; ?>"
1019
- <?php echo $meta == $_value?'checked="checked"' :''; ?>
1020
- <?php echo $attributes ?> class="<?php echo $class; ?>" />
1021
- <?php echo $_name; ?>
1022
- <?php endforeach; ?>
1023
- <span class="description"><?php echo $desc; ?></span>
1024
- </td>
1025
- </tr>
1026
- <?php break; ?>
1027
- <?php case 'textarea': ?>
1028
- <tr>
1029
- <th scope="row" style="width: 140px">
1030
- <label for="<?php echo $id; ?>"><?php echo $name; ?></label>
1031
- </th>
1032
- <td>
1033
- <textarea <?php echo $attributes ?>
1034
- id="<?php echo $id; ?>"
1035
- name="<?php echo $id; ?>"
1036
- class="large-text <?php echo $class; ?>"
1037
- ><?php echo $meta; ?></textarea>
1038
- <span class="description"><?php echo $desc; ?></span>
1039
- </td>
1040
- </tr>
1041
- <?php break; ?>
1042
- <?php case 'wpeditor': ?>
1043
- <tr>
1044
- <th scope="row" style="width: 140px">
1045
- <label for="<?php echo $id; ?>"><?php echo $name; ?></label>
1046
- </th>
1047
- <td>
1048
- <?php wp_editor( $meta, $id, $settings = array() ); ?>
1049
- <span class="description"><?php echo $desc; ?></span>
1050
- </td>
1051
- </tr>
1052
- <?php break; ?>
1053
- <?php case 'select_capabilities': ?>
1054
- <?php $options = $type=='select_capabilities' ?$this->get_options_capabilities()+$options :$options; ?>
1055
-
1056
- <?php case 'select_roles': ?>
1057
- <?php $options = $type=='select_roles' ?$this->get_options_roles()+$options :$options; ?>
1058
-
1059
- <?php case 'select_menu': ?>
1060
- <?php $options = $type=='select_menu' ?$this->get_options_menus()+$options :$options; ?>
1061
-
1062
- <?php case 'select_pages': ?>
1063
- <?php $options = $type=='select_pages' ?$this->get_options_pages()+$options :$options; ?>
1064
-
1065
- <?php case 'select_users': ?>
1066
- <?php $options = $type=='select_users' ?$this->get_options_users()+$options :$options; ?>
1067
-
1068
- <?php case 'select_categories': ?>
1069
- <?php case 'select': ?>
1070
- <tr>
1071
- <th scope="row" style="width: 140px">
1072
- <label for="<?php echo $id; ?>"><?php echo $name; ?></label>
1073
- </th>
1074
- <td>
1075
- <?php if ( $type == 'select_categories' ): ?>
1076
- <?php wp_dropdown_categories( $args ); ?>
1077
-
1078
- <?php else: ?>
1079
-
1080
- <select <?php echo $attributes ?>
1081
- id="<?php echo $id; ?>"
1082
- name="<?php echo $id; ?>"
1083
- class="<?php echo $class; ?>"
1084
- <?php echo $multiple ?"MULTIPLE SIZE='$multiple'" :''; ?>
1085
- ><?php foreach ( (array)$options as $_value => $_name ): ?>
1086
-
1087
- <option
1088
- value="<?php echo $_value; ?>"
1089
- <?php echo $meta == $_value ?' selected="selected"' :''; ?>
1090
- ><?php echo $_name; ?></option>
1091
-
1092
- <?php endforeach; ?></select>
1093
- <?php endif; ?>
1094
- <span class="description"><?php echo $desc; ?></span>
1095
- </td>
1096
- </tr>
1097
- <?php break; ?>
1098
- <?php case 'hidden': ?>
1099
- <tr>
1100
- <td colspan="2">
1101
- <input <?php echo $attributes ?>
1102
- id="<?php echo $id; ?>"
1103
- value="<?php echo $meta ?$meta :$default; ?>"
1104
- type="<?php echo $type; ?>"
1105
- name="<?php echo $id; ?>"
1106
- style="visibility:hidden;" />
1107
- </td>
1108
- </tr>
1109
- <?php break; ?>
1110
- <?php case 'custom': ?>
1111
- <tr>
1112
- <td colspan="2">
1113
- <?php echo $desc.$default; ?>
1114
- </td>
1115
- </tr>
1116
- <?php } ?>
1117
- <?php endforeach; ?>
1118
- </table>
1119
- <?php
1120
- }
1121
- return $this;
1122
- }
1123
-
1124
-
1125
- /**
1126
- * Returns an options list of menus
1127
- */
1128
- function get_options_pages() {
1129
- // initializing
1130
- $options = array( '0'=>' -- ' );
1131
- $pages = get_pages( array( 'post_type' => 'page', 'post_status' => 'publish' ) );
1132
-
1133
- foreach ( $pages as $page ) {
1134
- $options[$page->ID] = $page->post_title;
1135
- }
1136
-
1137
- return $options;
1138
- }
1139
-
1140
-
1141
- /**
1142
- * Returns an options list of menus
1143
- */
1144
- function get_options_menus() {
1145
- // initializing
1146
- $options = array( '0'=>' -- ' );
1147
- $menus = get_terms( 'nav_menu', array(
1148
- 'hide_empty' => 0
1149
- ) );
1150
-
1151
- foreach ( $menus as $menu ) {
1152
- $options[$menu->slug] = $menu->name;
1153
- }
1154
-
1155
- return $options;
1156
- }
1157
-
1158
-
1159
- /**
1160
- * Returns an options list of users
1161
- */
1162
- function get_options_users() {
1163
- // initializing
1164
- global $wpdb;
1165
-
1166
- $options = array( '0'=>' -- ' );
1167
- $query = $wpdb->prepare( "SELECT $wpdb->users.ID, $wpdb->users.display_name FROM $wpdb->users" );
1168
- $results = $wpdb->get_results( $query );
1169
-
1170
- foreach ( (array)$results as $result ) {
1171
- $options[$result->ID] = $result->display_name;
1172
- }
1173
-
1174
- return $options;
1175
- }
1176
-
1177
-
1178
- /**
1179
- * Returns an options list of capabilities
1180
- */
1181
- function get_options_capabilities() {
1182
- // initializing
1183
- global $wpdb;
1184
-
1185
- $options = array();
1186
- $roles = get_option( $wpdb->prefix . 'user_roles' );
1187
-
1188
- foreach ( (array)$roles as $role ) {
1189
- if ( !isset( $role['capabilities'] ) ) continue;
1190
- foreach ( (array)$role['capabilities'] as $cap => $v ) {
1191
- $options[$role['name']."::$cap"] = $role['name']."::$cap";
1192
- }
1193
- }
1194
-
1195
- return $options;
1196
- }
1197
-
1198
-
1199
- /**
1200
- * Returns an options list of roles
1201
- */
1202
- function get_options_roles() {
1203
- // initializing
1204
- global $wpdb;
1205
-
1206
- $options = array(
1207
- 'read' => 'Public'
1208
- );
1209
- $roles = get_option( $wpdb->prefix . 'user_roles' );
1210
-
1211
- foreach ( (array)$roles as $role ) {
1212
- $options[strtolower( $role['name'] )] = $role['name'];
1213
- }
1214
-
1215
- return $options;
1216
- }
1217
-
1218
-
1219
- /**
1220
- * Adds a box to the main column on the Post and Page edit screens
1221
- *
1222
- */
1223
- function _register() {
1224
- // this metabox is to be displayed for a certain object type only
1225
- if ( !empty( $this->_object_types ) && !in_array( $this->getCurrentPostType(), $this->_object_types ) )
1226
- return;
1227
-
1228
- if ( !$this->callback_args ) {
1229
- $this->callback_args = $this;
1230
- }
1231
-
1232
- // if the user has not already set the type of this metabox,
1233
- // then we need to do that now
1234
- if ( !$this->_type ) {
1235
- $this->setType();
1236
- }
1237
-
1238
- add_meta_box(
1239
- $this->_id,
1240
- $this->title,
1241
- $this->callback,
1242
- $this->getCurrentPostType(),
1243
- $this->context,
1244
- $this->priority,
1245
- $this->callback_args
1246
- );
1247
- }
1248
-
1249
-
1250
- /**
1251
- * Method set's the hooks for the options creted by this metabox
1252
- *
1253
- */
1254
- function setOptionHooks() {
1255
- foreach ( (array)$this->_fields as $field ) {
1256
- if ( !isset( $field['id'] ) ) continue;
1257
-
1258
- //creating the callback for the admin page
1259
- $function = create_function( '$default', '
1260
- return redrokk_admin_class::getInstance("'.$this->_isAdminPage.'")
1261
- ->getOption("'.$field['id'].'", $default, true);
1262
- ' );
1263
- add_filter( "pre_option_{$field['id']}", $function, 20, 2 );
1264
- }
1265
- }
1266
-
1267
-
1268
- /**
1269
- * Method redirects the user if we have added a request redirect
1270
- * in the url
1271
- *
1272
- * @param string $location
1273
- */
1274
- function _redirectIntervention( $location ) {
1275
- if ( isset( $_GET['_redirect'] ) ) {
1276
- $location = urldecode( $_GET['_redirect'] );
1277
- }
1278
- return $location;
1279
- }
1280
-
1281
-
1282
- /**
1283
- * Get the current page url
1284
- */
1285
- function _currentPageURL() {
1286
- $pageURL = 'http';
1287
- if ( isset( $_SERVER["HTTPS"] ) && $_SERVER["HTTPS"] == "on" ) {$pageURL .= "s";}
1288
- $pageURL .= "://";
1289
- if ( $_SERVER["SERVER_PORT"] != "80" ) {
1290
- $pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
1291
- } else {
1292
- $pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
1293
- }
1294
- return $pageURL;
1295
- }
1296
-
1297
-
1298
- /**
1299
- * Method to bind an associative array or object to the JTable instance.This
1300
- * method only binds properties that are publicly accessible and optionally
1301
- * takes an array of properties to ignore when binding.
1302
- *
1303
- * @param mixed $src An associative array or object to bind to the JTable instance.
1304
- * @param mixed $ignore An optional array or space separated list of properties to ignore while binding.
1305
- *
1306
- * @return boolean True on success.
1307
- *
1308
- * @link http://docs.joomla.org/JTable/bind
1309
- * @since 11.1
1310
- */
1311
- public function bind( $src, $ignore = array() ) {
1312
- // If the source value is not an array or object return false.
1313
- if ( !is_object( $src ) && !is_array( $src ) ) {
1314
- trigger_error( 'Bind failed as the provided source is not an array.' );
1315
- return false;
1316
- }
1317
-
1318
- // If the source value is an object, get its accessible properties.
1319
- if ( is_object( $src ) ) {
1320
- $src = get_object_vars( $src );
1321
- }
1322
-
1323
- // If the ignore value is a string, explode it over spaces.
1324
- if ( !is_array( $ignore ) ) {
1325
- $ignore = explode( ' ', $ignore );
1326
- }
1327
-
1328
- // Bind the source value, excluding the ignored fields.
1329
- foreach ( $this->getProperties() as $k => $v ) {
1330
- // Only process fields not in the ignore array.
1331
- if ( !in_array( $k, $ignore ) ) {
1332
- if ( isset( $src[$k] ) ) {
1333
- $this->$k = $src[$k];
1334
- }
1335
- }
1336
- }
1337
-
1338
- return true;
1339
- }
1340
-
1341
-
1342
- /**
1343
- * Set the object properties based on a named array/hash.
1344
- *
1345
- * @param mixed $properties Either an associative array or another object.
1346
- *
1347
- * @return boolean
1348
- *
1349
- * @since 11.1
1350
- *
1351
- * @see set()
1352
- */
1353
- public function setProperties( $properties ) {
1354
- if ( is_array( $properties ) || is_object( $properties ) ) {
1355
- foreach ( (array) $properties as $k => $v ) {
1356
- // Use the set function which might be overridden.
1357
- $this->set( $k, $v );
1358
- }
1359
- return true;
1360
- }
1361
-
1362
- return false;
1363
- }
1364
-
1365
-
1366
- /**
1367
- * Modifies a property of the object, creating it if it does not already exist.
1368
- *
1369
- * @param string $property The name of the property.
1370
- * @param mixed $value The value of the property to set.
1371
- *
1372
- * @return mixed Previous value of the property.
1373
- *
1374
- * @since 11.1
1375
- */
1376
- public function set( $property, $value = null ) {
1377
- $_property = 'set'.str_replace( ' ', '', ucwords( str_replace( '_', ' ', $property ) ) );
1378
- if ( method_exists( $this, $_property ) ) {
1379
- return $this->$_property( $value );
1380
- }
1381
-
1382
- $previous = isset( $this->$property ) ? $this->$property : null;
1383
- $this->$property = $value;
1384
- return $previous;
1385
- }
1386
-
1387
-
1388
- /**
1389
- * Returns an associative array of object properties.
1390
- *
1391
- * @param boolean $public If true, returns only the public properties.
1392
- *
1393
- * @return array
1394
- *
1395
- * @see get()
1396
- */
1397
- public function getProperties( $public = true ) {
1398
- $vars = get_object_vars( $this );
1399
- if ( $public ) {
1400
- foreach ( $vars as $key => $value ) {
1401
- if ( '_' == substr( $key, 0, 1 ) ) {
1402
- unset( $vars[$key] );
1403
- }
1404
- }
1405
- }
1406
-
1407
- return $vars;
1408
- }
1409
-
1410
-
1411
- /**
1412
- * contains the current instance of this class
1413
- *
1414
- * @var object
1415
- */
1416
- static $_instances = null;
1417
-
1418
- /**
1419
- * Method is called when we need to instantiate this class
1420
- *
1421
- * @param array $options
1422
- */
1423
- public static function getInstance( $_id, $options = array() ) {
1424
- if ( !isset( self::$_instances[$_id] ) ) {
1425
- $options['_id'] = $_id;
1426
- $class = get_class();
1427
- self::$_instances[$_id] = new $class( $options );
1428
- }
1429
- return self::$_instances[$_id];
1430
- }
1431
-
1432
-
1433
- }
1434
-
1435
-
1436
- endif;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/includes/requirements.php DELETED
@@ -1,69 +0,0 @@
1
- <?php
2
- /**
3
- Testimonials Widget
4
- Copyright (C) 2014 Michael Cannon
5
-
6
- This program is free software; you can redistribute it and/or modify
7
- it under the terms of the GNU General Public License as published by
8
- the Free Software Foundation; either version 2 of the License, or
9
- (at your option) any later version.
10
-
11
- This program is distributed in the hope that it will be useful,
12
- but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
- GNU General Public License for more details.
15
-
16
- You should have received a copy of the GNU General Public License along
17
- with this program; if not, write to the Free Software Foundation, Inc.,
18
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19
- */
20
-
21
- require_once TW_DIR_LIB . 'aihrus-framework/aihrus-framework.php';
22
-
23
-
24
- function tw_requirements_check( $force_check = false ) {
25
- $check_okay = get_transient( 'tw_requirements_check' );
26
- if ( empty( $force_check ) && $check_okay !== false ) {
27
- return $check_okay;
28
- }
29
-
30
- $deactivate_reason = false;
31
- if ( ! function_exists( 'aihr_check_aihrus_framework' ) ) {
32
- $deactivate_reason = esc_html__( 'Missing Aihrus Framework', 'testimonials-widget' );
33
- add_action( 'admin_notices', 'tw_notice_aihrus' );
34
- } elseif ( ! aihr_check_aihrus_framework( TW_BASE, TW_NAME, TW_AIHR_VERSION ) ) {
35
- $deactivate_reason = esc_html__( 'Old Aihrus Framework version detected', 'testimonials-widget' );
36
- }
37
-
38
- if ( ! aihr_check_php( TW_BASE, TW_NAME ) ) {
39
- $deactivate_reason = esc_html__( 'Old PHP version detected', 'testimonials-widget' );
40
- }
41
-
42
- if ( ! aihr_check_wp( TW_BASE, TW_NAME ) ) {
43
- $deactivate_reason = esc_html__( 'Old WordPress version detected', 'testimonials-widget' );
44
- }
45
-
46
- if ( ! empty( $deactivate_reason ) ) {
47
- aihr_deactivate_plugin( TW_BASE, TW_NAME, $deactivate_reason );
48
- }
49
-
50
- $check_okay = empty( $deactivate_reason );
51
- if ( $check_okay ) {
52
- delete_transient( 'tw_requirements_check' );
53
- set_transient( 'tw_requirements_check', $check_okay, HOUR_IN_SECONDS );
54
- }
55
-
56
- return $check_okay;
57
- }
58
-
59
-
60
- function tw_notice_aihrus() {
61
- $help_url = esc_url( 'https://aihrus.zendesk.com/entries/35689458' );
62
- $help_link = sprintf( __( '<a href="%1$s">Update plugins</a>. <a href="%2$s">More information</a>.', 'testimonials-widget' ), self_admin_url( 'update-core.php' ), $help_url );
63
-
64
- $text = sprintf( esc_html__( 'Plugin "%1$s" has been deactivated as it requires a current Aihrus Framework. Once corrected, "%1$s" can be activated. %2$s', 'testimonials-widget' ), TW_NAME, $help_link );
65
-
66
- aihr_notice_error( $text );
67
- }
68
-
69
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/languages/testimonials-widget-he_IL.mo DELETED
Binary file
trunk/languages/testimonials-widget-he_IL.po DELETED
@@ -1,546 +0,0 @@
1
- # This file was generated by WPML
2
- # WPML is a WordPress plugin that can turn any WordPress or WordPressMU site into a full featured multilingual content management system.
3
- # http://wpml.org
4
- msgid ""
5
- msgstr ""
6
- "Content-Type: text/plain; charset=UTF-8\n"
7
- "Content-Transfer-Encoding: 8bit\n"
8
- "Project-Id-Version: Testimonials-Widget\n"
9
- "POT-Creation-Date: \n"
10
- "PO-Revision-Date: \n"
11
- "Last-Translator: Ahrale <contact@atar4u.com>\n"
12
- "Language-Team: Ahrale - Atar4U <contact@atar4u.com>\n"
13
- "MIME-Version: 1.0\n"
14
- "X-Generator: Poedit 1.5.4\n"
15
- "Language: he_IL\n"
16
-
17
- # $form_parts['order'] = '<p><label for="' . $this->get_field_id( 'order' ) . '">' . __( 'ORDER BY Order', 'testimonials-widget' ) . '</label>' . $order_select . '</p>';
18
- #
19
- # $form_parts['random'] = '<p><input type="checkbox" id="' . $this->get_field_id( 'random' ) . '" name="' . $this->get_field_name( 'random' ) . '" value="true"' . checked( $instance['random'], 'true', false ) . ' /> <label for="' . $this->get_field_id( 'random' ) . '">' . __( 'Random order', 'testimonials-widget' ) . '</label><br/><span class="setting-description"><small>' . __( 'Unchecking this will rotate testimonials per ORDER BY and ORDER BY Order', 'testimonials-widget' ) . '</small></span></p>';
20
- msgid "Custom text or HTML for bottom of widgets"
21
- msgstr "טקסט מותאם אישית או HTML עבור תחתית הוידג'טים"
22
-
23
- # $form_parts['order'] = '<p><label for="' . $this->get_field_id( 'order' ) . '">' . __( 'ORDER BY Order', 'testimonials-widget' ) . '</label>' . $order_select . '</p>';
24
- #
25
- # $form_parts['random'] = '<p><input type="checkbox" id="' . $this->get_field_id( 'random' ) . '" name="' . $this->get_field_name( 'random' ) . '" value="true"' . checked( $instance['random'], 'true', false ) . ' /> <label for="' . $this->get_field_id( 'random' ) . '">' . __( 'Random order', 'testimonials-widget' ) . '</label><br/><span class="setting-description"><small>' . __( 'Unchecking this will rotate testimonials per ORDER BY and ORDER BY Order', 'testimonials-widget' ) . '</small></span></p>';
26
- msgid "Widget Bottom Text"
27
- msgstr "טקסט תחתית הוידג'ט"
28
-
29
- # $order_select .= '</select>';
30
- #
31
- # $form_parts['order'] = '<p><label for="' . $this->get_field_id( 'order' ) . '">' . __( 'ORDER BY Order', 'testimonials-widget' ) . '</label>' . $order_select . '</p>';
32
- msgid "Seconds between testimonial rotations or 0 for no refresh"
33
- msgstr "שניות בין החלפת עדויות או 0 כדי לא לרענן"
34
-
35
- # $order_select .= '</select>';
36
- #
37
- # $form_parts['order'] = '<p><label for="' . $this->get_field_id( 'order' ) . '">' . __( 'ORDER BY Order', 'testimonials-widget' ) . '</label>' . $order_select . '</p>';
38
- msgid "Rotation Speed"
39
- msgstr "מהירות רוטציה"
40
-
41
- # }
42
- #
43
- # $order_select .= '</select>';
44
- msgid ""
45
- "Unchecking this will rotate testimonials per ORDER BY and ORDER BY Order"
46
- msgstr "ביטול סימון תיבה זו יגרום לסבב עדויות לפי סדר"
47
-
48
- # }
49
- #
50
- # $order_select .= '</select>';
51
- msgid "Random order"
52
- msgstr "סדר אקראי"
53
-
54
- # $order_select .= $title;
55
- # $order_select .= '</option>';
56
- # }
57
- msgid "ORDER BY Order"
58
- msgstr "סדר לפי סדר"
59
-
60
- #
61
- # $form_parts['meta_key'] = '<p><label for="' . $this->get_field_id( 'meta_key' ) . '">' . __( 'Sort by meta key', 'testimonials-widget' ) . '</label>' . $meta_key_select . '<br/><span class="setting-description"><small>' . __( 'Used when Random order is disabled and sorting by a testimonials meta key is needed. Overrides ORDER BY', 'testimonials-widget' ) . '</small></span></p>';
62
- #
63
- msgid "Ascending"
64
- msgstr "סדר עולה"
65
-
66
- # $meta_key_select .= '</select>';
67
- #
68
- # $form_parts['meta_key'] = '<p><label for="' . $this->get_field_id( 'meta_key' ) . '">' . __( 'Sort by meta key', 'testimonials-widget' ) . '</label>' . $meta_key_select . '<br/><span class="setting-description"><small>' . __( 'Used when Random order is disabled and sorting by a testimonials meta key is needed. Overrides ORDER BY', 'testimonials-widget' ) . '</small></span></p>';
69
- msgid "Descending"
70
- msgstr "סדר יורד"
71
-
72
- # $meta_key_select .= $title;
73
- # $meta_key_select .= '</option>';
74
- # }
75
- msgid ""
76
- "Used when Random order is disabled and sorting by a testimonials meta key is "
77
- "needed. Overrides ORDER BY"
78
- msgstr ""
79
- "בשימוש כאשר הסדר האקראי כבוי ונדרש מיון לפי מפתח תיאור. דורס את סדר לפי"
80
-
81
- # $meta_key_select .= $title;
82
- # $meta_key_select .= '</option>';
83
- # }
84
- msgid "Sort by meta key"
85
- msgstr "מיין לפי מפתח תיאור"
86
-
87
- # $orderby_select .= '</select>';
88
- #
89
- # $form_parts['orderby'] = '<p><label for="' . $this->get_field_id( 'orderby' ) . '">' . __( 'ORDER BY', 'testimonials-widget' ) . '</label>' . $orderby_select . '<br/><span class="setting-description"><small>' . __( 'Used when Random order is disabled', 'testimonials-widget' ) . '</small></span></p>';
90
- msgid "None"
91
- msgstr "ללא"
92
-
93
- # $orderby_select .= $title;
94
- # $orderby_select .= '</option>';
95
- # }
96
- msgid "Used when Random order is disabled"
97
- msgstr "בשימוש כאשר הסדר האקראי כבוי"
98
-
99
- # $orderby_select .= $title;
100
- # $orderby_select .= '</option>';
101
- # }
102
- msgid "ORDER BY"
103
- msgstr "סדר לפי"
104
-
105
- # $orderby_select = '<select id="' . $this->get_field_id( 'orderby' ) . '" name="' . $this->get_field_name( 'orderby' ) . '">';
106
- # $orderby_options = array(
107
- # 'ID' => __( 'Testimonial ID', 'testimonials-widget' ),
108
- msgid "No order"
109
- msgstr "ללא סדר"
110
-
111
- #
112
- # $form_parts['max_height'] = '<p><label for="' . $this->get_field_id( 'max_height' ) . '">' . __('Maximum Height', 'testimonials-widget') . '</label><input size="4" type="text" id="' . $this->get_field_id( 'max_height' ) . '" name="' . $this->get_field_name( 'max_height' ) . '" value="' . htmlspecialchars($instance['max_height'], ENT_QUOTES) . '" /><br/><span class="setting-description"><small>' . __('Set for maximum display height', 'testimonials-widget') . '</small></span></p>';
113
- #
114
- msgid "Author"
115
- msgstr "מחבר"
116
-
117
- # $form_parts['min_height'] = '<p><label for="' . $this->get_field_id( 'min_height' ) . '">' . __('Minimum Height', 'testimonials-widget') . '</label><input size="4" type="text" id="' . $this->get_field_id( 'min_height' ) . '" name="' . $this->get_field_name( 'min_height' ) . '" value="' . htmlspecialchars($instance['min_height'], ENT_QUOTES) . '" /><br/><span class="setting-description"><small>' . __('Set for minimum display height', 'testimonials-widget') . '</small></span></p>';
118
- #
119
- # $form_parts['max_height'] = '<p><label for="' . $this->get_field_id( 'max_height' ) . '">' . __('Maximum Height', 'testimonials-widget') . '</label><input size="4" type="text" id="' . $this->get_field_id( 'max_height' ) . '" name="' . $this->get_field_name( 'max_height' ) . '" value="' . htmlspecialchars($instance['max_height'], ENT_QUOTES) . '" /><br/><span class="setting-description"><small>' . __('Set for maximum display height', 'testimonials-widget') . '</small></span></p>';
120
- msgid "Testimonial ID"
121
- msgstr "מזהה עדות"
122
-
123
- # $form_parts['exclude'] = '<p><label for="' . $this->get_field_id( 'exclude' ) . '">' . __( 'Exclude IDs filter', 'testimonials-widget' ) . '</label><input class="widefat" type="text" id="' . $this->get_field_id( 'exclude' ) . '" name="' . $this->get_field_name( 'exclude' ) . '" value="' . htmlspecialchars($instance['exclude'], ENT_QUOTES) . '" /><br/><span class="setting-description"><small>' . __( 'Comma separated IDs', 'testimonials-widget' ) . '</small></span></p>';
124
- #
125
- # $form_parts['limit'] = '<p><label for="' . $this->get_field_id( 'limit' ) . '">' . __( 'Limit', 'testimonials-widget' ) . '</label><input size="4" type="text" id="' . $this->get_field_id( 'limit' ) . '" name="' . $this->get_field_name( 'limit' ) . '" value="' . htmlspecialchars($instance['limit'], ENT_QUOTES) . '" /><br/><span class="setting-description"><small>' . __( 'Number of testimonials to rotate through', 'testimonials-widget' ) . '</small></span></p>';
126
- msgid "Set for maximum display height"
127
- msgstr "הגדר לגובה התצוגה המירבי"
128
-
129
- # $form_parts['exclude'] = '<p><label for="' . $this->get_field_id( 'exclude' ) . '">' . __( 'Exclude IDs filter', 'testimonials-widget' ) . '</label><input class="widefat" type="text" id="' . $this->get_field_id( 'exclude' ) . '" name="' . $this->get_field_name( 'exclude' ) . '" value="' . htmlspecialchars($instance['exclude'], ENT_QUOTES) . '" /><br/><span class="setting-description"><small>' . __( 'Comma separated IDs', 'testimonials-widget' ) . '</small></span></p>';
130
- #
131
- # $form_parts['limit'] = '<p><label for="' . $this->get_field_id( 'limit' ) . '">' . __( 'Limit', 'testimonials-widget' ) . '</label><input size="4" type="text" id="' . $this->get_field_id( 'limit' ) . '" name="' . $this->get_field_name( 'limit' ) . '" value="' . htmlspecialchars($instance['limit'], ENT_QUOTES) . '" /><br/><span class="setting-description"><small>' . __( 'Number of testimonials to rotate through', 'testimonials-widget' ) . '</small></span></p>';
132
- msgid "Maximum Height"
133
- msgstr "גובה מירבי"
134
-
135
- # $form_parts['ids'] = '<p><label for="' . $this->get_field_id( 'ids' ) . '">' . __( 'IDs filter', 'testimonials-widget' ) . '</label><input class="widefat" type="text" id="' . $this->get_field_id( 'ids' ) . '" name="' . $this->get_field_name( 'ids' ) . '" value="' . htmlspecialchars($instance['ids'], ENT_QUOTES) . '" /><br/><span class="setting-description"><small>' . __( 'Comma separated IDs', 'testimonials-widget' ) . '</small></span></p>';
136
- #
137
- # $form_parts['exclude'] = '<p><label for="' . $this->get_field_id( 'exclude' ) . '">' . __( 'Exclude IDs filter', 'testimonials-widget' ) . '</label><input class="widefat" type="text" id="' . $this->get_field_id( 'exclude' ) . '" name="' . $this->get_field_name( 'exclude' ) . '" value="' . htmlspecialchars($instance['exclude'], ENT_QUOTES) . '" /><br/><span class="setting-description"><small>' . __( 'Comma separated IDs', 'testimonials-widget' ) . '</small></span></p>';
138
- msgid "Set for minimum display height"
139
- msgstr "הגדר לגובה התצוגה המינימלי"
140
-
141
- # $form_parts['ids'] = '<p><label for="' . $this->get_field_id( 'ids' ) . '">' . __( 'IDs filter', 'testimonials-widget' ) . '</label><input class="widefat" type="text" id="' . $this->get_field_id( 'ids' ) . '" name="' . $this->get_field_name( 'ids' ) . '" value="' . htmlspecialchars($instance['ids'], ENT_QUOTES) . '" /><br/><span class="setting-description"><small>' . __( 'Comma separated IDs', 'testimonials-widget' ) . '</small></span></p>';
142
- #
143
- # $form_parts['exclude'] = '<p><label for="' . $this->get_field_id( 'exclude' ) . '">' . __( 'Exclude IDs filter', 'testimonials-widget' ) . '</label><input class="widefat" type="text" id="' . $this->get_field_id( 'exclude' ) . '" name="' . $this->get_field_name( 'exclude' ) . '" value="' . htmlspecialchars($instance['exclude'], ENT_QUOTES) . '" /><br/><span class="setting-description"><small>' . __( 'Comma separated IDs', 'testimonials-widget' ) . '</small></span></p>';
144
- msgid "Minimum Height"
145
- msgstr "גובה מינימלי"
146
-
147
- # $form_parts['char_limit'] = '<p><label for="' . $this->get_field_id( 'char_limit' ) . '">' . __( 'Character limit', 'testimonials-widget' ) . '</label><input size="4" type="text" id="' . $this->get_field_id( 'char_limit' ) . '" name="' . $this->get_field_name( 'char_limit' ) . '" value="' . htmlspecialchars($instance['char_limit'], ENT_QUOTES) . '" /><br/><span class="setting-description"><small>' . __( 'Number of characters to limit testimonial views to', 'testimonials-widget' ) . '</small></span></p>';
148
- #
149
- # $form_parts['ids'] = '<p><label for="' . $this->get_field_id( 'ids' ) . '">' . __( 'IDs filter', 'testimonials-widget' ) . '</label><input class="widefat" type="text" id="' . $this->get_field_id( 'ids' ) . '" name="' . $this->get_field_name( 'ids' ) . '" value="' . htmlspecialchars($instance['ids'], ENT_QUOTES) . '" /><br/><span class="setting-description"><small>' . __( 'Comma separated IDs', 'testimonials-widget' ) . '</small></span></p>';
150
- msgid "Number of testimonials to rotate through"
151
- msgstr "מספר העדויות בסבב"
152
-
153
- # $form_parts['char_limit'] = '<p><label for="' . $this->get_field_id( 'char_limit' ) . '">' . __( 'Character limit', 'testimonials-widget' ) . '</label><input size="4" type="text" id="' . $this->get_field_id( 'char_limit' ) . '" name="' . $this->get_field_name( 'char_limit' ) . '" value="' . htmlspecialchars($instance['char_limit'], ENT_QUOTES) . '" /><br/><span class="setting-description"><small>' . __( 'Number of characters to limit testimonial views to', 'testimonials-widget' ) . '</small></span></p>';
154
- #
155
- # $form_parts['ids'] = '<p><label for="' . $this->get_field_id( 'ids' ) . '">' . __( 'IDs filter', 'testimonials-widget' ) . '</label><input class="widefat" type="text" id="' . $this->get_field_id( 'ids' ) . '" name="' . $this->get_field_name( 'ids' ) . '" value="' . htmlspecialchars($instance['ids'], ENT_QUOTES) . '" /><br/><span class="setting-description"><small>' . __( 'Comma separated IDs', 'testimonials-widget' ) . '</small></span></p>';
156
- msgid "Limit"
157
- msgstr "הגבל"
158
-
159
- # $form_parts['target'] = '<p><label for="' . $this->get_field_id( 'target' ) . '">' . __( 'URL Target', 'testimonials-widget' ) . '</label><input size="15" type="text" id="' . $this->get_field_id( 'target' ) . '" name="' . $this->get_field_name( 'target' ) . '" value="' . htmlspecialchars($instance['target'], ENT_QUOTES) . '" /><br/><span class="setting-description"><small>' . __( 'Leave blank if none', 'testimonials-widget' ) . '</small></span></p>';
160
- #
161
- # $form_parts['char_limit'] = '<p><label for="' . $this->get_field_id( 'char_limit' ) . '">' . __( 'Character limit', 'testimonials-widget' ) . '</label><input size="4" type="text" id="' . $this->get_field_id( 'char_limit' ) . '" name="' . $this->get_field_name( 'char_limit' ) . '" value="' . htmlspecialchars($instance['char_limit'], ENT_QUOTES) . '" /><br/><span class="setting-description"><small>' . __( 'Number of characters to limit testimonial views to', 'testimonials-widget' ) . '</small></span></p>';
162
- msgid "Comma separated IDs"
163
- msgstr "מזהים מופרדים בפסיק"
164
-
165
- # $form_parts['target'] = '<p><label for="' . $this->get_field_id( 'target' ) . '">' . __( 'URL Target', 'testimonials-widget' ) . '</label><input size="15" type="text" id="' . $this->get_field_id( 'target' ) . '" name="' . $this->get_field_name( 'target' ) . '" value="' . htmlspecialchars($instance['target'], ENT_QUOTES) . '" /><br/><span class="setting-description"><small>' . __( 'Leave blank if none', 'testimonials-widget' ) . '</small></span></p>';
166
- #
167
- # $form_parts['char_limit'] = '<p><label for="' . $this->get_field_id( 'char_limit' ) . '">' . __( 'Character limit', 'testimonials-widget' ) . '</label><input size="4" type="text" id="' . $this->get_field_id( 'char_limit' ) . '" name="' . $this->get_field_name( 'char_limit' ) . '" value="' . htmlspecialchars($instance['char_limit'], ENT_QUOTES) . '" /><br/><span class="setting-description"><small>' . __( 'Number of characters to limit testimonial views to', 'testimonials-widget' ) . '</small></span></p>';
168
- msgid "IDs filter"
169
- msgstr "מסנן מזהים"
170
-
171
- # $form_parts['hide_url'] = '<p><input type="checkbox" id="' . $this->get_field_id( 'hide_url' ) . '" name="' . $this->get_field_name( 'hide_url' ) . '" value="true"' . checked( $instance['hide_url'], 'true', false ) . ' /> <label for="' . $this->get_field_id( 'hide_url' ) . '">' . __( 'Hide URL?', 'testimonials-widget' ) . '</label></p>';
172
- #
173
- # $form_parts['target'] = '<p><label for="' . $this->get_field_id( 'target' ) . '">' . __( 'URL Target', 'testimonials-widget' ) . '</label><input size="15" type="text" id="' . $this->get_field_id( 'target' ) . '" name="' . $this->get_field_name( 'target' ) . '" value="' . htmlspecialchars($instance['target'], ENT_QUOTES) . '" /><br/><span class="setting-description"><small>' . __( 'Leave blank if none', 'testimonials-widget' ) . '</small></span></p>';
174
- msgid "Number of characters to limit testimonial views to"
175
- msgstr "מספר התווים המירבי בתצוגת עדות"
176
-
177
- # $form_parts['hide_url'] = '<p><input type="checkbox" id="' . $this->get_field_id( 'hide_url' ) . '" name="' . $this->get_field_name( 'hide_url' ) . '" value="true"' . checked( $instance['hide_url'], 'true', false ) . ' /> <label for="' . $this->get_field_id( 'hide_url' ) . '">' . __( 'Hide URL?', 'testimonials-widget' ) . '</label></p>';
178
- #
179
- # $form_parts['target'] = '<p><label for="' . $this->get_field_id( 'target' ) . '">' . __( 'URL Target', 'testimonials-widget' ) . '</label><input size="15" type="text" id="' . $this->get_field_id( 'target' ) . '" name="' . $this->get_field_name( 'target' ) . '" value="' . htmlspecialchars($instance['target'], ENT_QUOTES) . '" /><br/><span class="setting-description"><small>' . __( 'Leave blank if none', 'testimonials-widget' ) . '</small></span></p>';
180
- msgid "Character limit"
181
- msgstr "הגבלת תווים"
182
-
183
- # $form_parts['hide_company'] = '<p><input type="checkbox" id="' . $this->get_field_id( 'hide_company' ) . '" name="' . $this->get_field_name( 'hide_company' ) . '" value="true"' . checked( $instance['hide_company'], 'true', false ) . ' /> <label for="' . $this->get_field_id( 'hide_company' ) . '">' . __( 'Hide company?', 'testimonials-widget' ) . '</label></p>';
184
- #
185
- # $form_parts['hide_url'] = '<p><input type="checkbox" id="' . $this->get_field_id( 'hide_url' ) . '" name="' . $this->get_field_name( 'hide_url' ) . '" value="true"' . checked( $instance['hide_url'], 'true', false ) . ' /> <label for="' . $this->get_field_id( 'hide_url' ) . '">' . __( 'Hide URL?', 'testimonials-widget' ) . '</label></p>';
186
- msgid "Leave blank if none"
187
- msgstr "השאר ריק אם לא"
188
-
189
- # $form_parts['hide_company'] = '<p><input type="checkbox" id="' . $this->get_field_id( 'hide_company' ) . '" name="' . $this->get_field_name( 'hide_company' ) . '" value="true"' . checked( $instance['hide_company'], 'true', false ) . ' /> <label for="' . $this->get_field_id( 'hide_company' ) . '">' . __( 'Hide company?', 'testimonials-widget' ) . '</label></p>';
190
- #
191
- # $form_parts['hide_url'] = '<p><input type="checkbox" id="' . $this->get_field_id( 'hide_url' ) . '" name="' . $this->get_field_name( 'hide_url' ) . '" value="true"' . checked( $instance['hide_url'], 'true', false ) . ' /> <label for="' . $this->get_field_id( 'hide_url' ) . '">' . __( 'Hide URL?', 'testimonials-widget' ) . '</label></p>';
192
- msgid "URL Target"
193
- msgstr "כתובת יעד URL"
194
-
195
- # $form_parts['hide_email'] = '<p><input type="checkbox" id="' . $this->get_field_id( 'hide_email' ) . '" name="' . $this->get_field_name( 'hide_email' ) . '" value="true"' . checked( $instance['hide_email'], 'true', false ) . ' /> <label for="' . $this->get_field_id( 'hide_email' ) . '">' . __( 'Hide email?', 'testimonials-widget' ) . '</label></p>';
196
- #
197
- # $form_parts['hide_company'] = '<p><input type="checkbox" id="' . $this->get_field_id( 'hide_company' ) . '" name="' . $this->get_field_name( 'hide_company' ) . '" value="true"' . checked( $instance['hide_company'], 'true', false ) . ' /> <label for="' . $this->get_field_id( 'hide_company' ) . '">' . __( 'Hide company?', 'testimonials-widget' ) . '</label></p>';
198
- msgid "Hide URL?"
199
- msgstr "האם להסתיר כתובת URL?"
200
-
201
- # $form_parts['hide_source'] = '<p><input type="checkbox" id="' . $this->get_field_id( 'hide_source' ) . '" name="' . $this->get_field_name( 'hide_source' ) . '" value="true"' . checked( $instance['hide_source'], 'true', false ) . ' /> <label for="' . $this->get_field_id( 'hide_source' ) . '">' . __( 'Hide source?', 'testimonials-widget' ) . '</label></p>';
202
- #
203
- # $form_parts['hide_email'] = '<p><input type="checkbox" id="' . $this->get_field_id( 'hide_email' ) . '" name="' . $this->get_field_name( 'hide_email' ) . '" value="true"' . checked( $instance['hide_email'], 'true', false ) . ' /> <label for="' . $this->get_field_id( 'hide_email' ) . '">' . __( 'Hide email?', 'testimonials-widget' ) . '</label></p>';
204
- msgid "Hide company?"
205
- msgstr "האם להסתיר חברה?"
206
-
207
- # $form_parts['hide_title'] = '<p><input type="checkbox" id="' . $this->get_field_id( 'hide_title' ) . '" name="' . $this->get_field_name( 'hide_title' ) . '" value="true"' . checked( $instance['hide_title'], 'true', false ) . ' /> <label for="' . $this->get_field_id( 'hide_title' ) . '">' . __( 'Hide title?', 'testimonials-widget' ) . '</label></p>';
208
- #
209
- # $form_parts['hide_source'] = '<p><input type="checkbox" id="' . $this->get_field_id( 'hide_source' ) . '" name="' . $this->get_field_name( 'hide_source' ) . '" value="true"' . checked( $instance['hide_source'], 'true', false ) . ' /> <label for="' . $this->get_field_id( 'hide_source' ) . '">' . __( 'Hide source?', 'testimonials-widget' ) . '</label></p>';
210
- msgid "Hide email?"
211
- msgstr "האם להסתיר מייל?"
212
-
213
- # $form_parts['hide_not_found'] = '<p><input type="checkbox" id="' . $this->get_field_id( 'hide_not_found' ) . '" name="' . $this->get_field_name( 'hide_not_found' ) . '" value="true"' . checked( $instance['hide_not_found'], 'true', false ) . ' /> <label for="' . $this->get_field_id( 'hide_not_found' ) . '">' . __( 'Hide testimonials not found?', 'testimonials-widget' ) . '</label></p>';
214
- #
215
- # $form_parts['hide_title'] = '<p><input type="checkbox" id="' . $this->get_field_id( 'hide_title' ) . '" name="' . $this->get_field_name( 'hide_title' ) . '" value="true"' . checked( $instance['hide_title'], 'true', false ) . ' /> <label for="' . $this->get_field_id( 'hide_title' ) . '">' . __( 'Hide title?', 'testimonials-widget' ) . '</label></p>';
216
- msgid "Hide source?"
217
- msgstr "האם להסתיר מקור?"
218
-
219
- # $form_parts['hide_image'] = '<p><input type="checkbox" id="' . $this->get_field_id( 'hide_image' ) . '" name="' . $this->get_field_name( 'hide_image' ) . '" value="true"' . checked( $instance['hide_image'], 'true', false ) . ' /> <label for="' . $this->get_field_id( 'hide_image' ) . '">' . __( 'Hide image?', 'testimonials-widget' ) . '</label></p>';
220
- #
221
- # $form_parts['hide_not_found'] = '<p><input type="checkbox" id="' . $this->get_field_id( 'hide_not_found' ) . '" name="' . $this->get_field_name( 'hide_not_found' ) . '" value="true"' . checked( $instance['hide_not_found'], 'true', false ) . ' /> <label for="' . $this->get_field_id( 'hide_not_found' ) . '">' . __( 'Hide testimonials not found?', 'testimonials-widget' ) . '</label></p>';
222
- msgid "Hide title?"
223
- msgstr "האם להסתיר כותרת?"
224
-
225
- # $form_parts['hide_gravatar'] = '<p><input type="checkbox" id="' . $this->get_field_id( 'hide_gravatar' ) . '" name="' . $this->get_field_name( 'hide_gravatar' ) . '" value="true"' . checked( $instance['hide_gravatar'], 'true', false ) . ' /> <label for="' . $this->get_field_id( 'hide_gravatar' ) . '">' . __( 'Hide gravatar?', 'testimonials-widget' ) . '</label></p>';
226
- #
227
- # $form_parts['hide_image'] = '<p><input type="checkbox" id="' . $this->get_field_id( 'hide_image' ) . '" name="' . $this->get_field_name( 'hide_image' ) . '" value="true"' . checked( $instance['hide_image'], 'true', false ) . ' /> <label for="' . $this->get_field_id( 'hide_image' ) . '">' . __( 'Hide image?', 'testimonials-widget' ) . '</label></p>';
228
- msgid "Hide testimonials not found?"
229
- msgstr "האם להסתיר עדות שלא נמצאת?"
230
-
231
- # $form_parts['adv_opts'] = '<div id="' . $this->get_field_id( 'adv_opts' ) . '" style="display:none">';
232
- #
233
- # $form_parts['hide_gravatar'] = '<p><input type="checkbox" id="' . $this->get_field_id( 'hide_gravatar' ) . '" name="' . $this->get_field_name( 'hide_gravatar' ) . '" value="true"' . checked( $instance['hide_gravatar'], 'true', false ) . ' /> <label for="' . $this->get_field_id( 'hide_gravatar' ) . '">' . __( 'Hide gravatar?', 'testimonials-widget' ) . '</label></p>';
234
- msgid "Hide image?"
235
- msgstr "האם להסתיר תמונה?"
236
-
237
- # $form_parts['adv_key'] = "<p style=\"text-align:left;\"><small><a id=\"" . $this->get_field_id( 'adv_key' ) . "\" style=\"cursor:pointer;\" onclick=\"jQuery( 'div#" . $this->get_field_id( 'adv_opts' ) . "' ) . slideToggle();\">" . __( 'Advanced Options', 'testimonials-widget' ) . " &raquo;</a></small></p>";
238
- #
239
- # $form_parts['adv_opts'] = '<div id="' . $this->get_field_id( 'adv_opts' ) . '" style="display:none">';
240
- msgid "Hide gravatar?"
241
- msgstr "האם להסתיר צלמית משתמש?"
242
-
243
- # $form_parts['tags_all'] = '<p><input type="checkbox" id="' . $this->get_field_id( 'tags_all' ) . '" name="' . $this->get_field_name( 'tags_all' ) . '" value="true"' . checked( $instance['tags_all'], 'true', false ) . ' /> <label for="' . $this->get_field_id( 'tags_all' ) . '">' . __( 'Require all tags', 'testimonials-widget' ) . '</label><br/><span class="setting-description"><small>' . __( 'Select only testimonials with all of the given tags', 'testimonials-widget' ) . '</small></span></p>';
244
- #
245
- # $form_parts['keep_whitespace'] = '<p><input type="checkbox" id="' . $this->get_field_id( 'keep_whitespace' ) . '" name="' . $this->get_field_name( 'keep_whitespace' ) . '" value="true"' . checked( $instance['keep_whitespace'], 'true', false ) . ' /> <label for="' . $this->get_field_id( 'keep_whitespace' ) . '">' . __( 'Keep whitespace?', 'testimonials-widget' ) . '</label><br/><span class="setting-description"><small>' . __( 'Keeps testimonials looking as entered than sans auto-formatting', 'testimonials-widget' ) . '</small></span></p>';
246
- msgid "Advanced Options"
247
- msgstr "אפשרויות מתקדמות"
248
-
249
- # $form_parts['tags'] = '<p><label for="' . $this->get_field_id( 'tags' ) . '">' . __( 'Tags filter', 'testimonials-widget' ) . '</label><input class="widefat" type="text" id="' . $this->get_field_id( 'tags' ) . '" name="' . $this->get_field_name( 'tags' ) . '" value="' . htmlspecialchars($instance['tags'], ENT_QUOTES) . '" /><br/><span class="setting-description"><small>' . __( 'Comma separated tag slug-names', 'testimonials-widget' ) . '</small></span></p>';
250
- #
251
- # $form_parts['tags_all'] = '<p><input type="checkbox" id="' . $this->get_field_id( 'tags_all' ) . '" name="' . $this->get_field_name( 'tags_all' ) . '" value="true"' . checked( $instance['tags_all'], 'true', false ) . ' /> <label for="' . $this->get_field_id( 'tags_all' ) . '">' . __( 'Require all tags', 'testimonials-widget' ) . '</label><br/><span class="setting-description"><small>' . __( 'Select only testimonials with all of the given tags', 'testimonials-widget' ) . '</small></span></p>';
252
- msgid "Keeps testimonials looking as entered than sans auto-formatting"
253
- msgstr "שומר עדויות הנראות כמוזנות עם עיצוב אוטומטי"
254
-
255
- # $form_parts['tags'] = '<p><label for="' . $this->get_field_id( 'tags' ) . '">' . __( 'Tags filter', 'testimonials-widget' ) . '</label><input class="widefat" type="text" id="' . $this->get_field_id( 'tags' ) . '" name="' . $this->get_field_name( 'tags' ) . '" value="' . htmlspecialchars($instance['tags'], ENT_QUOTES) . '" /><br/><span class="setting-description"><small>' . __( 'Comma separated tag slug-names', 'testimonials-widget' ) . '</small></span></p>';
256
- #
257
- # $form_parts['tags_all'] = '<p><input type="checkbox" id="' . $this->get_field_id( 'tags_all' ) . '" name="' . $this->get_field_name( 'tags_all' ) . '" value="true"' . checked( $instance['tags_all'], 'true', false ) . ' /> <label for="' . $this->get_field_id( 'tags_all' ) . '">' . __( 'Require all tags', 'testimonials-widget' ) . '</label><br/><span class="setting-description"><small>' . __( 'Select only testimonials with all of the given tags', 'testimonials-widget' ) . '</small></span></p>';
258
- msgid "Keep whitespace?"
259
- msgstr "להשאיר רווח לבן?"
260
-
261
- # $form_parts['category'] = '<p><label for="' . $this->get_field_id( 'category' ) . '">' . __( 'Category filter', 'testimonials-widget' ) . '</label><input class="widefat" type="text" id="' . $this->get_field_id( 'category' ) . '" name="' . $this->get_field_name( 'category' ) . '" value="' . htmlspecialchars($instance['category'], ENT_QUOTES) . '" /><br/><span class="setting-description"><small>' . __( 'Comma separated category slug-names', 'testimonials-widget' ) . '</small></span></p>';
262
- #
263
- # $form_parts['tags'] = '<p><label for="' . $this->get_field_id( 'tags' ) . '">' . __( 'Tags filter', 'testimonials-widget' ) . '</label><input class="widefat" type="text" id="' . $this->get_field_id( 'tags' ) . '" name="' . $this->get_field_name( 'tags' ) . '" value="' . htmlspecialchars($instance['tags'], ENT_QUOTES) . '" /><br/><span class="setting-description"><small>' . __( 'Comma separated tag slug-names', 'testimonials-widget' ) . '</small></span></p>';
264
- msgid "Select only testimonials with all of the given tags"
265
- msgstr "בחר רק עדויות עם כל התגיות שצוינו"
266
-
267
- # $form_parts['category'] = '<p><label for="' . $this->get_field_id( 'category' ) . '">' . __( 'Category filter', 'testimonials-widget' ) . '</label><input class="widefat" type="text" id="' . $this->get_field_id( 'category' ) . '" name="' . $this->get_field_name( 'category' ) . '" value="' . htmlspecialchars($instance['category'], ENT_QUOTES) . '" /><br/><span class="setting-description"><small>' . __( 'Comma separated category slug-names', 'testimonials-widget' ) . '</small></span></p>';
268
- #
269
- # $form_parts['tags'] = '<p><label for="' . $this->get_field_id( 'tags' ) . '">' . __( 'Tags filter', 'testimonials-widget' ) . '</label><input class="widefat" type="text" id="' . $this->get_field_id( 'tags' ) . '" name="' . $this->get_field_name( 'tags' ) . '" value="' . htmlspecialchars($instance['tags'], ENT_QUOTES) . '" /><br/><span class="setting-description"><small>' . __( 'Comma separated tag slug-names', 'testimonials-widget' ) . '</small></span></p>';
270
- msgid "Require all tags"
271
- msgstr "דרוש את כל התגיות"
272
-
273
- # $form_parts['title_link'] = '<p><label for="' . $this->get_field_id( 'title_link' ) . '">' . __( 'Title link', 'testimonials-widget' ) . '</label><input class="widefat" type="text" id="' . $this->get_field_id( 'title_link' ) . '" name="' . $this->get_field_name( 'title_link' ) . '" value="' . htmlspecialchars($instance['title_link'], ENT_QUOTES) . '" /><br/><span class="setting-description"><small>' . __( 'URL or Post ID to link widget title to', 'testimonials-widget' ) . '</small></span></p>';
274
- #
275
- # $form_parts['category'] = '<p><label for="' . $this->get_field_id( 'category' ) . '">' . __( 'Category filter', 'testimonials-widget' ) . '</label><input class="widefat" type="text" id="' . $this->get_field_id( 'category' ) . '" name="' . $this->get_field_name( 'category' ) . '" value="' . htmlspecialchars($instance['category'], ENT_QUOTES) . '" /><br/><span class="setting-description"><small>' . __( 'Comma separated category slug-names', 'testimonials-widget' ) . '</small></span></p>';
276
- msgid "Comma separated tag slug-names"
277
- msgstr "שמות סלאג תגיות מופרדים בפסיק"
278
-
279
- # $form_parts['title_link'] = '<p><label for="' . $this->get_field_id( 'title_link' ) . '">' . __( 'Title link', 'testimonials-widget' ) . '</label><input class="widefat" type="text" id="' . $this->get_field_id( 'title_link' ) . '" name="' . $this->get_field_name( 'title_link' ) . '" value="' . htmlspecialchars($instance['title_link'], ENT_QUOTES) . '" /><br/><span class="setting-description"><small>' . __( 'URL or Post ID to link widget title to', 'testimonials-widget' ) . '</small></span></p>';
280
- #
281
- # $form_parts['category'] = '<p><label for="' . $this->get_field_id( 'category' ) . '">' . __( 'Category filter', 'testimonials-widget' ) . '</label><input class="widefat" type="text" id="' . $this->get_field_id( 'category' ) . '" name="' . $this->get_field_name( 'category' ) . '" value="' . htmlspecialchars($instance['category'], ENT_QUOTES) . '" /><br/><span class="setting-description"><small>' . __( 'Comma separated category slug-names', 'testimonials-widget' ) . '</small></span></p>';
282
- msgid "Tags filter"
283
- msgstr "מסנן תגיות"
284
-
285
- # $form_parts['title'] = '<p><label for="' . $this->get_field_id( 'title' ) . '">' . __( 'Title', 'testimonials-widget' ) . '</label><input class="widefat" type="text" id="' . $this->get_field_id( 'title' ) . '" name="' . $this->get_field_name( 'title' ) . '" value="' . htmlspecialchars($instance['title'], ENT_QUOTES) . '" /></p>';
286
- #
287
- # $form_parts['title_link'] = '<p><label for="' . $this->get_field_id( 'title_link' ) . '">' . __( 'Title link', 'testimonials-widget' ) . '</label><input class="widefat" type="text" id="' . $this->get_field_id( 'title_link' ) . '" name="' . $this->get_field_name( 'title_link' ) . '" value="' . htmlspecialchars($instance['title_link'], ENT_QUOTES) . '" /><br/><span class="setting-description"><small>' . __( 'URL or Post ID to link widget title to', 'testimonials-widget' ) . '</small></span></p>';
288
- msgid "Comma separated category slug-names"
289
- msgstr "שמות סלאג קטגוריה מופרדים בפסיק"
290
-
291
- # $form_parts['title'] = '<p><label for="' . $this->get_field_id( 'title' ) . '">' . __( 'Title', 'testimonials-widget' ) . '</label><input class="widefat" type="text" id="' . $this->get_field_id( 'title' ) . '" name="' . $this->get_field_name( 'title' ) . '" value="' . htmlspecialchars($instance['title'], ENT_QUOTES) . '" /></p>';
292
- #
293
- # $form_parts['title_link'] = '<p><label for="' . $this->get_field_id( 'title_link' ) . '">' . __( 'Title link', 'testimonials-widget' ) . '</label><input class="widefat" type="text" id="' . $this->get_field_id( 'title_link' ) . '" name="' . $this->get_field_name( 'title_link' ) . '" value="' . htmlspecialchars($instance['title_link'], ENT_QUOTES) . '" /><br/><span class="setting-description"><small>' . __( 'URL or Post ID to link widget title to', 'testimonials-widget' ) . '</small></span></p>';
294
- msgid "Category filter"
295
- msgstr "מסנן קטגוריה"
296
-
297
- # $form_parts = array();
298
- #
299
- # $form_parts['title'] = '<p><label for="' . $this->get_field_id( 'title' ) . '">' . __( 'Title', 'testimonials-widget' ) . '</label><input class="widefat" type="text" id="' . $this->get_field_id( 'title' ) . '" name="' . $this->get_field_name( 'title' ) . '" value="' . htmlspecialchars($instance['title'], ENT_QUOTES) . '" /></p>';
300
- msgid "URL or Post ID to link widget title to"
301
- msgstr "כתובת URL או מזהה פוסט אליו יתקושר כותרת הוידג'ט"
302
-
303
- # $form_parts = array();
304
- #
305
- # $form_parts['title'] = '<p><label for="' . $this->get_field_id( 'title' ) . '">' . __( 'Title', 'testimonials-widget' ) . '</label><input class="widefat" type="text" id="' . $this->get_field_id( 'title' ) . '" name="' . $this->get_field_name( 'title' ) . '" value="' . htmlspecialchars($instance['title'], ENT_QUOTES) . '" /></p>';
306
- msgid "Title link"
307
- msgstr "קישור כותרת"
308
-
309
- # 'testimonials_widget',
310
- # __( 'Testimonials Widget', 'testimonials-widget' ),
311
- # $widget_ops,
312
- msgid "Testimonials Widget"
313
- msgstr "וידג'ט עדויות"
314
-
315
- # 'classname' => 'Testimonials_Widget_Widget',
316
- # 'description' => __( 'Display testimonials with multiple selection and display options', 'testimonials-widget' )
317
- # );
318
- msgid "Display testimonials with multiple selection and display options"
319
- msgstr "מציג עדויות עם בחירה מרובה ואפשרויות תצוגה"
320
-
321
- # 'testimonial_url' => $url,
322
- # );
323
- #
324
- msgid ""
325
- "Testimonial draft updated. <a target=\"_blank\" href=\"%s\">Preview "
326
- "testimonial</a>"
327
- msgstr ""
328
- "טיוטת העדות עודכנה. <a target=\"_blank\" href=\"%s\">תצוגה מוקדמת של העדות</"
329
- "a>"
330
-
331
- # 'testimonial_title' => get_post_meta( $post_id, 'testimonials-widget-title', true ),
332
- # 'testimonial_url' => $url,
333
- # );
334
- msgid ""
335
- "Testimonial scheduled for: <strong>%1$s</strong>. <a target=\"_blank\" href="
336
- "\"%2$s\">Preview testimonial</a>"
337
- msgstr ""
338
- "עדות מתוזמנת עבור: <strong>%1$s</strong>. <a target=\"_blank\" href=\"%2$s"
339
- "\">תצוגה מוקדמת של העדות</a>"
340
-
341
- # 'testimonial_source' => $row->post_title,
342
- # 'testimonial_title' => get_post_meta( $post_id, 'testimonials-widget-title', true ),
343
- # 'testimonial_url' => $url,
344
- msgid ""
345
- "Testimonial submitted. <a target=\"_blank\" href=\"%s\">Preview testimonial</"
346
- "a>"
347
- msgstr ""
348
- "העדות נשלחה. <a target=\"_blank\" href=\"%s\">תצוגה מוקדמת של העדות</a>"
349
-
350
- # 'testimonial_image' => $image,
351
- # 'testimonial_source' => $row->post_title,
352
- # 'testimonial_title' => get_post_meta( $post_id, 'testimonials-widget-title', true ),
353
- msgid "Testimonial saved."
354
- msgstr "העדות נשמרה."
355
-
356
- # 'testimonial_extra' => '',
357
- # 'testimonial_image' => $image,
358
- # 'testimonial_source' => $row->post_title,
359
- msgid "Testimonial published. <a href=\"%s\">View testimonial</a>"
360
- msgstr "העדות פורסמה. <a href=\"%s\">הצג את העדות</a>"
361
-
362
- # 'testimonial_email' => $email,
363
- # 'testimonial_extra' => '',
364
- # 'testimonial_image' => $image,
365
- msgid "Testimonial restored to revision from %s"
366
- msgstr "העדות שוחזרה למהדורה מ %s"
367
-
368
- # 'testimonial_company' => get_post_meta( $post_id, 'testimonials-widget-company', true ),
369
- # 'testimonial_content' => $row->post_content,
370
- # 'testimonial_email' => $email,
371
- msgid "Testimonial updated."
372
- msgstr "העדות עודכנה."
373
-
374
- # 'post_id' => $post_id,
375
- # 'testimonial_company' => get_post_meta( $post_id, 'testimonials-widget-company', true ),
376
- # 'testimonial_content' => $row->post_content,
377
- msgid "Custom field deleted."
378
- msgstr "השדה מותאם אישית נמחק."
379
-
380
- # $data = array(
381
- # 'post_id' => $post_id,
382
- # 'testimonial_company' => get_post_meta( $post_id, 'testimonials-widget-company', true ),
383
- msgid "Custom field updated."
384
- msgstr "השדה מותאם אישית עודכן."
385
-
386
- #
387
- # $data = array(
388
- # 'post_id' => $post_id,
389
- msgid "Testimonial updated. <a href=\"%s\">View testimonial</a>"
390
- msgstr "העדות עודכנה. <a href=\"%s\">הצג את העדות</a>"
391
-
392
- # $gravatar_size = apply_filters( 'testimonials_widget_gravatar_size', 96 );
393
- #
394
- # $testimonial_data = array();
395
- msgid "Enter testimonial source here"
396
- msgstr "הזן כאן את מקור העדות"
397
-
398
- # $image_size = apply_filters( 'testimonials_widget_image_size', 'thumbnail' );
399
- # $gravatar_size = apply_filters( 'testimonials_widget_gravatar_size', 96 );
400
- #
401
- msgid "Enter title here"
402
- msgstr "הזן כאן את הכותרת"
403
-
404
- #
405
- #
406
- # public function get_testimonials( $atts ) {
407
- msgid "Testimonial Data"
408
- msgstr "נתוני העדות"
409
-
410
- # if ($tag[0] == '&') // Handle HTML entity by copying straight through
411
- # {
412
- # $output .= $tag;
413
- msgid "&raquo;"
414
- msgstr "»"
415
-
416
- # {
417
- # $output .= $func_strcut($text, 0, $max_length - $output_length);
418
- # $truncated = true;
419
- msgid "&laquo;"
420
- msgstr "«"
421
-
422
- # $is_first = false;
423
- # }
424
- #
425
- msgid "…"
426
- msgstr "…"
427
-
428
- # 'date' => __( 'Date' , 'testimonials-widget' ),
429
- # );
430
- #
431
- msgid "View Testimonial"
432
- msgstr "הצג את העדות"
433
-
434
- # 'tags' => __( 'Tags' , 'testimonials-widget' ),
435
- # 'date' => __( 'Date' , 'testimonials-widget' ),
436
- # );
437
- msgid "Testimonial"
438
- msgstr "עדות"
439
-
440
- # 'categories' => __( 'Category' , 'testimonials-widget' ),
441
- # 'tags' => __( 'Tags' , 'testimonials-widget' ),
442
- # 'date' => __( 'Date' , 'testimonials-widget' ),
443
- msgid "Search Testimonials"
444
- msgstr "חיפוש בעדויות"
445
-
446
- # 'testimonials-widget-url' => __( 'URL' , 'testimonials-widget' ),
447
- # 'author' => __( 'Published by' , 'testimonials-widget' ),
448
- # 'categories' => __( 'Category' , 'testimonials-widget' ),
449
- msgid "No testimonials found in Trash"
450
- msgstr "לא נמצאו עדויות באשפה"
451
-
452
- # $target = ( preg_match( '#^\w+$#', $atts['target'] ) ) ? $atts['target'] : false;
453
- #
454
- # $html = '';
455
- msgid "No testimonials found"
456
- msgstr "לא נמצאו עדויות"
457
-
458
- # 'shortcode' => __( 'Shortcodes' , 'testimonials-widget' ),
459
- # 'testimonials-widget-title' => __( 'Title' , 'testimonials-widget' ),
460
- # 'testimonials-widget-email' => __( 'Email' , 'testimonials-widget' ),
461
- msgid "Edit Testimonial"
462
- msgstr "ערוך עדות"
463
-
464
- # 'testimonials-widget-email' => __( 'Email' , 'testimonials-widget' ),
465
- # 'testimonials-widget-company' => __( 'Company' , 'testimonials-widget' ),
466
- # 'testimonials-widget-url' => __( 'URL' , 'testimonials-widget' ),
467
- msgid "Add New Testimonial"
468
- msgstr "הוספת עדות חדשה"
469
-
470
- # 'thumbnail' => __( 'Image' , 'testimonials-widget' ),
471
- # 'title' => __( 'Source' , 'testimonials-widget' ),
472
- # 'shortcode' => __( 'Shortcodes' , 'testimonials-widget' ),
473
- msgid "New Testimonial"
474
- msgstr "עדות חדשה"
475
-
476
- #
477
- # $orderby_select = '<select id="' . $this->get_field_id( 'orderby' ) . '" name="' . $this->get_field_name( 'orderby' ) . '">';
478
- # $orderby_options = array(
479
- msgid "Date"
480
- msgstr "תאריך"
481
-
482
- #
483
- # $result = apply_filters( 'testimonials_widget_posts_custom_column', $result, $column, $post_id );
484
- #
485
- msgid "Tags"
486
- msgstr "תגיות"
487
-
488
- # }
489
- #
490
- # $result = apply_filters( 'testimonials_widget_posts_custom_column', $result, $column, $post_id );
491
- msgid "Category"
492
- msgstr "קטגוריה"
493
-
494
- # break;
495
- # }
496
- #
497
- msgid "Published by"
498
- msgstr "פורסם על ידי"
499
-
500
- # $meta_key_select = '<select id="' . $this->get_field_id( 'meta_key' ) . '" name="' . $this->get_field_name( 'meta_key' ) . '">';
501
- # $meta_key_options = array(
502
- # '' => __( 'None' , 'testimonials-widget'),
503
- msgid "URL"
504
- msgstr "כתובת URL"
505
-
506
- #
507
- # $meta_key_select = '<select id="' . $this->get_field_id( 'meta_key' ) . '" name="' . $this->get_field_name( 'meta_key' ) . '">';
508
- # $meta_key_options = array(
509
- msgid "Company"
510
- msgstr "חברה"
511
-
512
- # $form_parts['orderby'] = '<p><label for="' . $this->get_field_id( 'orderby' ) . '">' . __( 'ORDER BY', 'testimonials-widget' ) . '</label>' . $orderby_select . '<br/><span class="setting-description"><small>' . __( 'Used when Random order is disabled', 'testimonials-widget' ) . '</small></span></p>';
513
- #
514
- # $meta_key_select = '<select id="' . $this->get_field_id( 'meta_key' ) . '" name="' . $this->get_field_name( 'meta_key' ) . '">';
515
- msgid "Email"
516
- msgstr "מייל"
517
-
518
- #
519
- # $form_parts['orderby'] = '<p><label for="' . $this->get_field_id( 'orderby' ) . '">' . __( 'ORDER BY', 'testimonials-widget' ) . '</label>' . $orderby_select . '<br/><span class="setting-description"><small>' . __( 'Used when Random order is disabled', 'testimonials-widget' ) . '</small></span></p>';
520
- #
521
- msgid "Title"
522
- msgstr "כותרת"
523
-
524
- # } elseif ( is_email( $email ) ) {
525
- # $result = get_avatar( $email );
526
- # } else {
527
- msgid "Shortcode"
528
- msgstr "קיצור קוד"
529
-
530
- # $form_parts['max_height'] = '<p><label for="' . $this->get_field_id( 'max_height' ) . '">' . __('Maximum Height', 'testimonials-widget') . '</label><input size="4" type="text" id="' . $this->get_field_id( 'max_height' ) . '" name="' . $this->get_field_name( 'max_height' ) . '" value="' . htmlspecialchars($instance['max_height'], ENT_QUOTES) . '" /><br/><span class="setting-description"><small>' . __('Set for maximum display height', 'testimonials-widget') . '</small></span></p>';
531
- #
532
- # $orderby_select = '<select id="' . $this->get_field_id( 'orderby' ) . '" name="' . $this->get_field_name( 'orderby' ) . '">';
533
- msgid "Source"
534
- msgstr "מקור"
535
-
536
- # if ( has_post_thumbnail( $post_id ) ) {
537
- # $result = get_the_post_thumbnail( $post_id, 'thumbnail' );
538
- # } elseif ( is_email( $email ) ) {
539
- msgid "Image"
540
- msgstr "תמונה"
541
-
542
- # 'name' => __( 'Testimonials' , 'testimonials-widget' ),
543
- # 'new_item' => __( 'Add New Testimonial' , 'testimonials-widget' ),
544
- # 'not_found' => __( 'No testimonials found' , 'testimonials-widget' ),
545
- msgid "Testimonials"
546
- msgstr "עדויות"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/languages/testimonials-widget-nl_NL.mo DELETED
Binary file
trunk/languages/testimonials-widget-nl_NL.po DELETED
@@ -1,631 +0,0 @@
1
- # Copyright (C) 2013 Testimonials Widget
2
- # This file is distributed under the same license as the Testimonials Widget package.
3
- msgid ""
4
- msgstr ""
5
- "Project-Id-Version: Testimonials Widget 2.9.0\n"
6
- "Report-Msgid-Bugs-To: http://wordpress.org/tag/testimonials-widget\n"
7
- "POT-Creation-Date: 2013-03-13 13:55:03+00:00\n"
8
- "MIME-Version: 1.0\n"
9
- "Content-Type: text/plain; charset=UTF-8\n"
10
- "Content-Transfer-Encoding: 8bit\n"
11
- "PO-Revision-Date: 2013-03-16 16:22+0100\n"
12
- "Last-Translator: \n"
13
- "Language-Team: \n"
14
- "X-Generator: Poedit 1.5.5\n"
15
- "Language: Dutch/Nederlands\n"
16
-
17
- #: lib/settings.testimonials-widget.php:38
18
- msgid "General"
19
- msgstr "Algemeen"
20
-
21
- #: lib/settings.testimonials-widget.php:39
22
- msgid "Selection"
23
- msgstr "Selectie"
24
-
25
- #: lib/settings.testimonials-widget.php:40
26
- msgid "Ordering"
27
- msgstr "Volgorde"
28
-
29
- #: lib/settings.testimonials-widget.php:41
30
- msgid "Widget"
31
- msgstr "Widget"
32
-
33
- #: lib/settings.testimonials-widget.php:43
34
- msgid "Post Type"
35
- msgstr "Post Type"
36
-
37
- #: lib/settings.testimonials-widget.php:44
38
- msgid "Reset"
39
- msgstr "Herstellen"
40
-
41
- #: lib/settings.testimonials-widget.php:45
42
- msgid "About Testimonials Widget"
43
- msgstr "Over Testimonials Widget"
44
-
45
- #: lib/settings.testimonials-widget.php:55
46
- msgid "Widget Title"
47
- msgstr "Widget Titel"
48
-
49
- #: lib/settings.testimonials-widget.php:56 testimonials-widget.php:354
50
- #: testimonials-widget.php:382
51
- msgid "Testimonials"
52
- msgstr "Testimonials"
53
-
54
- #: lib/settings.testimonials-widget.php:61
55
- msgid "Title Link"
56
- msgstr "Titel Link"
57
-
58
- #: lib/settings.testimonials-widget.php:62
59
- msgid "URL or Post ID to link widget title to. Ex: 123 or http://example.com"
60
- msgstr ""
61
- "URL of Post ID om de widget titel naar te linken. Vb.: 123 of http://"
62
- "voorbeeld.com"
63
-
64
- #: lib/settings.testimonials-widget.php:67
65
- msgid "Keep Whitespace?"
66
- msgstr "Witruimte behouden?"
67
-
68
- #: lib/settings.testimonials-widget.php:68
69
- msgid "Keeps testimonials looking as entered than sans auto-formatting"
70
- msgstr "Behoud testimonials zoals ingegeven ipv auto-opmaak"
71
-
72
- #: lib/settings.testimonials-widget.php:74
73
- msgid "Minimum Height"
74
- msgstr "Minimum Hoogte"
75
-
76
- #: lib/settings.testimonials-widget.php:75
77
- msgid "Set for minimum display height, in pixels"
78
- msgstr "Geef de minimum weer te geven hoogte, in pixels"
79
-
80
- #: lib/settings.testimonials-widget.php:80
81
- msgid "Maximum Height"
82
- msgstr "Maximum Hoogte"
83
-
84
- #: lib/settings.testimonials-widget.php:81
85
- msgid "Set for maximum display height, in pixels"
86
- msgstr "Geef de maximum weer te geven hoogte, in pixels"
87
-
88
- #: lib/settings.testimonials-widget.php:86
89
- msgid "Rotation Speed"
90
- msgstr "Rotatiesnelheid"
91
-
92
- #: lib/settings.testimonials-widget.php:87
93
- msgid ""
94
- "Number of seconds between testimonial rotations or 0 for no rotation at all "
95
- "refresh"
96
- msgstr "Aantal seconden tussen testimonial rotaties of 0 voor geen rotatie"
97
-
98
- #: lib/settings.testimonials-widget.php:93
99
- msgid "General Options"
100
- msgstr "Algemene Opties"
101
-
102
- #: lib/settings.testimonials-widget.php:98
103
- msgid "Character Limit"
104
- msgstr "Teken limiet"
105
-
106
- #: lib/settings.testimonials-widget.php:99
107
- msgid "Number of characters to limit non-single testimonial views to"
108
- msgstr "Aantal karakters om enkelvoudige testimonials tot te beperken"
109
-
110
- #: lib/settings.testimonials-widget.php:103
111
- msgid "Hide \"Testimonials Not Found\"?"
112
- msgstr "Verberg \"Testimonials Niet gevonden\"?"
113
-
114
- #: lib/settings.testimonials-widget.php:108
115
- msgid "Hide Gravatar Image?"
116
- msgstr "Verberg Gravatar afbeelding?"
117
-
118
- #: lib/settings.testimonials-widget.php:113
119
- msgid "Hide Image?"
120
- msgstr "Verberg Afbeelding?"
121
-
122
- #: lib/settings.testimonials-widget.php:118
123
- msgid "Hide Testimonial Content?"
124
- msgstr "Verberg Testimonial inhoud?"
125
-
126
- #: lib/settings.testimonials-widget.php:123
127
- msgid "Hide Author/Source?"
128
- msgstr "Verberg Auteur/Bron?"
129
-
130
- #: lib/settings.testimonials-widget.php:125
131
- msgid "Don't display \"Post Title\" in cite"
132
- msgstr "Verberg \"Post Titel\" in citaat"
133
-
134
- #: lib/settings.testimonials-widget.php:129
135
- msgid "Hide Email?"
136
- msgstr "Verberg Email?"
137
-
138
- #: lib/settings.testimonials-widget.php:135
139
- msgid "Hide Title?"
140
- msgstr "Verberg Titel?"
141
-
142
- #: lib/settings.testimonials-widget.php:140
143
- msgid "Hide Location?"
144
- msgstr "Verberg Locatie?"
145
-
146
- #: lib/settings.testimonials-widget.php:145
147
- msgid "Hide Company?"
148
- msgstr "Verberg Bedrijf?"
149
-
150
- #: lib/settings.testimonials-widget.php:150
151
- msgid "Hide URL?"
152
- msgstr "Verberg URL?"
153
-
154
- #: lib/settings.testimonials-widget.php:155
155
- msgid "URL Target"
156
- msgstr "URL doel"
157
-
158
- #: lib/settings.testimonials-widget.php:156
159
- msgid "Adds target to all URLs; leave blank if none"
160
- msgstr "Voeg doel aan alle URLs toe; Laat leeg voor geen toe te voegen"
161
-
162
- #: lib/settings.testimonials-widget.php:160
163
- msgid "Testimonial Bottom Text"
164
- msgstr "Testimonial Bottom Text"
165
-
166
- #: lib/settings.testimonials-widget.php:161
167
- msgid "Custom text or HTML for bottom of testimonials"
168
- msgstr "Aangepaste text of HTML for onder de testimonials"
169
-
170
- #: lib/settings.testimonials-widget.php:166
171
- msgid "Enable Paging?"
172
- msgstr "Activeer Pagina nummering?"
173
-
174
- #: lib/settings.testimonials-widget.php:167
175
- msgid "For `[testimonialswidget_list]`"
176
- msgstr "Voor `[testimonialswidget_list]`"
177
-
178
- #: lib/settings.testimonials-widget.php:170
179
- msgid "Disable"
180
- msgstr "Uitschakelen"
181
-
182
- #: lib/settings.testimonials-widget.php:171
183
- msgid "Enable"
184
- msgstr "Inschakelen"
185
-
186
- #: lib/settings.testimonials-widget.php:172
187
- msgid "Before testimonials"
188
- msgstr "Voor testimonials"
189
-
190
- #: lib/settings.testimonials-widget.php:173
191
- msgid "After testimonials"
192
- msgstr "Na testimonials"
193
-
194
- #: lib/settings.testimonials-widget.php:179
195
- msgid "Remove `.hentry` CSS?"
196
- msgstr "Verwijder '.hentry' CSS?"
197
-
198
- #: lib/settings.testimonials-widget.php:180
199
- msgid ""
200
- "Some themes use class `.hentry` in a manner that breaks Testimonials Widgets "
201
- "CSS"
202
- msgstr ""
203
- "Sommige thema's gebruiken class '.hentry' dat de functies van Testimonials "
204
- "Widgets CSS schaadt."
205
-
206
- #: lib/settings.testimonials-widget.php:191
207
- msgid "Selection Options"
208
- msgstr "Selectie Opties"
209
-
210
- #: lib/settings.testimonials-widget.php:197
211
- msgid "Category Filter"
212
- msgstr "Categorie Filter"
213
-
214
- #: lib/settings.testimonials-widget.php:198
215
- msgid "Comma separated category slug-names. Ex: category-a, another-category"
216
- msgstr ""
217
- "Komma gescheiden categorie slug-namen. Vb.: categorie-a, andere-categorie"
218
-
219
- #: lib/settings.testimonials-widget.php:203
220
- msgid "Tags Filter"
221
- msgstr "Tags Filter"
222
-
223
- #: lib/settings.testimonials-widget.php:204
224
- msgid "Comma separated tag slug-names. Ex: tag-a, another-tag"
225
- msgstr "Komma gescheiden tag slug-namen. Vb.: tag-a, andere-tag"
226
-
227
- #: lib/settings.testimonials-widget.php:209
228
- msgid "Require All Tags?"
229
- msgstr "Vereist alle tags?"
230
-
231
- #: lib/settings.testimonials-widget.php:210
232
- msgid "Select only testimonials with all of the given tags"
233
- msgstr "Selecteer alleen testimonials met alle opgegeven tags"
234
-
235
- #: lib/settings.testimonials-widget.php:216
236
- msgid "Include IDs Filter"
237
- msgstr "Ingesloten IDs filter"
238
-
239
- #: lib/settings.testimonials-widget.php:217
240
- #: lib/settings.testimonials-widget.php:223
241
- msgid "Comma separated testimonial IDs. Ex: 3,1,2"
242
- msgstr "Komma gescheiden testimonial IDs. Vb.: 3,1,2"
243
-
244
- #: lib/settings.testimonials-widget.php:222
245
- msgid "Exclude IDs Filter"
246
- msgstr "Uitgesloten IDs filter"
247
-
248
- #: lib/settings.testimonials-widget.php:228
249
- msgid "Limit"
250
- msgstr "Limiet"
251
-
252
- #: lib/settings.testimonials-widget.php:229
253
- msgid "Number of testimonials to select per instance"
254
- msgstr "Aantal testimonials om te selecteren per exemplaar"
255
-
256
- #: lib/settings.testimonials-widget.php:241
257
- msgid "Ordering Options"
258
- msgstr "Volgorde Opties"
259
-
260
- #: lib/settings.testimonials-widget.php:247
261
- msgid "Random Order?"
262
- msgstr "Willekeurige Volgorde?"
263
-
264
- #: lib/settings.testimonials-widget.php:248
265
- msgid ""
266
- "If checked, ignores ORDER BY, ORDER BY meta_key, and ORDER BY Order. Widgets "
267
- "are random by default automatically"
268
- msgstr ""
269
- "Wanneer aangevinkt, negeer ORDER BY, ORDER BY meta_key, and ORDER BY Order. "
270
- "Widgets worden automatisch willekeurig ingesteld"
271
-
272
- #: lib/settings.testimonials-widget.php:254
273
- msgid "ORDER BY"
274
- msgstr "ORDER BY"
275
-
276
- #: lib/settings.testimonials-widget.php:255
277
- msgid "Used when \"Random Order\" is disabled"
278
- msgstr "Gebruikt wanneer \"Willekeurige Volgorde\" is uitgeschakeld"
279
-
280
- #: lib/settings.testimonials-widget.php:258
281
- msgid "Testimonial ID"
282
- msgstr "Testimonial ID"
283
-
284
- #: lib/settings.testimonials-widget.php:259
285
- msgid "Author"
286
- msgstr "Auteur"
287
-
288
- #: lib/settings.testimonials-widget.php:260 testimonials-widget.php:330
289
- msgid "Source"
290
- msgstr "Bron"
291
-
292
- #: lib/settings.testimonials-widget.php:261 testimonials-widget.php:340
293
- msgid "Date"
294
- msgstr "Datum"
295
-
296
- #: lib/settings.testimonials-widget.php:262
297
- msgid "No order"
298
- msgstr "Geen volgorde"
299
-
300
- #: lib/settings.testimonials-widget.php:269
301
- msgid "ORDER BY meta_key"
302
- msgstr "ORDER BY meta_key"
303
-
304
- #: lib/settings.testimonials-widget.php:270
305
- msgid ""
306
- "Used when \"Random Order\" is disabled and sorting by a testimonials meta "
307
- "key is needed. Overrides ORDER BY"
308
- msgstr ""
309
- "Gebruikt wanneer \"Willekeurige Volgorde\" uitgeschakeld is en de volgorde "
310
- "bepaald moet worden door meta key. Overheerst ORDER BY"
311
-
312
- #: lib/settings.testimonials-widget.php:273
313
- msgid "None"
314
- msgstr "Geen"
315
-
316
- #: lib/settings.testimonials-widget.php:274 testimonials-widget.php:332
317
- #: testimonials-widget.php:1224
318
- msgid "Title"
319
- msgstr "Titel"
320
-
321
- #: lib/settings.testimonials-widget.php:275 testimonials-widget.php:334
322
- #: testimonials-widget.php:1236
323
- msgid "Email"
324
- msgstr "Email"
325
-
326
- #: lib/settings.testimonials-widget.php:276 testimonials-widget.php:335
327
- #: testimonials-widget.php:1242
328
- msgid "Company"
329
- msgstr "Bedrijf"
330
-
331
- #: lib/settings.testimonials-widget.php:277 testimonials-widget.php:336
332
- #: testimonials-widget.php:1248
333
- msgid "URL"
334
- msgstr "URL"
335
-
336
- #: lib/settings.testimonials-widget.php:283
337
- msgid "ORDER BY Order"
338
- msgstr "ORDER BY Order"
339
-
340
- #: lib/settings.testimonials-widget.php:286
341
- msgid "Descending"
342
- msgstr "Aflopend"
343
-
344
- #: lib/settings.testimonials-widget.php:287
345
- msgid "Ascending"
346
- msgstr "Oplopend"
347
-
348
- #: lib/settings.testimonials-widget.php:300
349
- msgid "Debug Mode?"
350
- msgstr "Foutopsporingsmodus?"
351
-
352
- #: lib/settings.testimonials-widget.php:301
353
- msgid "Not implemented yet"
354
- msgstr "Nog niet geïmplementeerd"
355
-
356
- #: lib/settings.testimonials-widget.php:308
357
- msgid "Allow Comments?"
358
- msgstr "Commentaren toestaan?"
359
-
360
- #: lib/settings.testimonials-widget.php:309
361
- msgid "If checked, allows commenting on testimonial single-view pages"
362
- msgstr ""
363
- "Wanneer aangevinkt, staat commentaren toe op enkelvoudig testimonial pagina's"
364
-
365
- #: lib/settings.testimonials-widget.php:313
366
- msgid ""
367
- "URL slug-name for <a href=\"%1s\">testimonials archive</a> page. After "
368
- "changing, you must click \"Save Changes\" on <a href=\"%2s\">Permalink "
369
- "Settings</a> to update them."
370
- msgstr ""
371
- "URL slug-naam voor <a href=\"%1s\">testimonials archief</a> pagina. Na "
372
- "wijzigingen, klik op \"Wijzigingen opslaan\" om <a href=\"%2s\">Permalink "
373
- "instellingen</a> bij te werken."
374
-
375
- #: lib/settings.testimonials-widget.php:319
376
- msgid "Archive Page URL"
377
- msgstr "Archief pagina URL"
378
-
379
- #: lib/settings.testimonials-widget.php:324
380
- msgid ""
381
- "URL slug-name for testimonial view pages. After changing, you must click "
382
- "\"Save Changes\" on <a href=\"%1s\">Permalink Settings</a> to update them."
383
- msgstr ""
384
- "URL slug-naam voor testimonial pagina's. Na wijzigingen, klik \"Wijzigingen "
385
- "opslaan\" op <a href=\"%1s\">Permalink instellingen</a> om deze bij te "
386
- "werken."
387
-
388
- #: lib/settings.testimonials-widget.php:327
389
- msgid "Testimonial Page URL"
390
- msgstr "Testimonial Pagina URL"
391
-
392
- #: lib/settings.testimonials-widget.php:335
393
- msgid "Reset to Defaults?"
394
- msgstr "Herstellen naar standaard?"
395
-
396
- #: lib/settings.testimonials-widget.php:338
397
- msgid "Check this box to reset options to their defaults"
398
- msgstr "Vink aan om de opties te herstellen naar standaard opties"
399
-
400
- #: lib/settings.testimonials-widget.php:344
401
- msgid "Example Text Input"
402
- msgstr "Voorbeeld tekst invoer"
403
-
404
- #: lib/settings.testimonials-widget.php:345
405
- msgid "This is a description for the text input."
406
- msgstr "Dit is een beschrijving voor tekst invoer."
407
-
408
- #: lib/settings.testimonials-widget.php:350
409
- msgid "Example Textarea Input"
410
- msgstr "Voorbeeld tekstveld"
411
-
412
- #: lib/settings.testimonials-widget.php:351
413
- msgid "This is a description for the textarea input."
414
- msgstr "Dit is een beschrijving voor het tekstveld."
415
-
416
- #: lib/settings.testimonials-widget.php:357
417
- msgid "Example Checkbox"
418
- msgstr "Voorbeeld keuzevakje"
419
-
420
- #: lib/settings.testimonials-widget.php:358
421
- msgid "This is a description for the checkbox."
422
- msgstr "Dit is een beschrijving voor het keuzevakje."
423
-
424
- #: lib/settings.testimonials-widget.php:370
425
- msgid "Example Radio"
426
- msgstr "Voorbeeld keuzerondje"
427
-
428
- #: lib/settings.testimonials-widget.php:371
429
- msgid "This is a description for the radio buttons."
430
- msgstr "Dit is een beschrijving voor het keuzerondje."
431
-
432
- #: lib/settings.testimonials-widget.php:381
433
- msgid "Example Select"
434
- msgstr "Voorbeeld selectie"
435
-
436
- #: lib/settings.testimonials-widget.php:382
437
- msgid "This is a description for the drop-down."
438
- msgstr "Dit is een beschrijving voor de selectie."
439
-
440
- #: lib/settings.testimonials-widget.php:433
441
- #: lib/settings.testimonials-widget.php:465
442
- msgid "Testimonials Widget Settings"
443
- msgstr "Testimonials Widget Settings"
444
-
445
- #: lib/settings.testimonials-widget.php:433 testimonials-widget.php:90
446
- msgid "Settings"
447
- msgstr "Instellingen"
448
-
449
- #: lib/settings.testimonials-widget.php:484
450
- msgid "Save Changes"
451
- msgstr "Wijzigingen Opslaan"
452
-
453
- #: lib/settings.testimonials-widget.php:495
454
- msgid "Copyright &copy;%1$s %2$s."
455
- msgstr "Copyright &copy;%1$s %2$s."
456
-
457
- #: lib/testimonials-widget-widget.php:8
458
- msgid "Display testimonials with multiple selection and display options"
459
- msgstr "Geef testimonials weer met meerdere selectie en weergave mogelijkheden"
460
-
461
- #. #-#-#-#-# testimonials-widget.pot (Testimonials Widget 2.9.0) #-#-#-#-#
462
- #. Plugin Name of the plugin/theme
463
- #: lib/testimonials-widget-widget.php:19
464
- msgid "Testimonials Widget"
465
- msgstr "Testimonials Widget"
466
-
467
- #: lib/testimonials-widget-widget.php:138
468
- msgid "CSS Class"
469
- msgstr "CSS Class"
470
-
471
- #: lib/testimonials-widget-widget.php:139
472
- msgid "This widget's unique CSS class for styling"
473
- msgstr "Deze widget uniele CSS class voor stijlopmaak"
474
-
475
- #: lib/testimonials-widget-widget.php:177
476
- msgid "Expand/Collapse"
477
- msgstr "Uitvouwen/Samenvouwen"
478
-
479
- #: testimonials-widget.php:329
480
- msgid "Image"
481
- msgstr "Afbeelding"
482
-
483
- #: testimonials-widget.php:331
484
- msgid "Shortcodes"
485
- msgstr "Shortcodes"
486
-
487
- #: testimonials-widget.php:333 testimonials-widget.php:1230
488
- msgid "Location"
489
- msgstr "Locatie"
490
-
491
- #: testimonials-widget.php:337
492
- msgid "Published by"
493
- msgstr "Gepubliceerd door"
494
-
495
- #: testimonials-widget.php:338
496
- msgid "Category"
497
- msgstr "Categorie"
498
-
499
- #: testimonials-widget.php:339
500
- msgid "Tags"
501
- msgstr "Tags"
502
-
503
- #: testimonials-widget.php:351
504
- msgid "Add New"
505
- msgstr "Nieuw Toevoegen"
506
-
507
- #: testimonials-widget.php:352 testimonials-widget.php:355
508
- msgid "Add New Testimonial"
509
- msgstr "Nieuwe testimonial toevoegen"
510
-
511
- #: testimonials-widget.php:353
512
- msgid "Edit Testimonial"
513
- msgstr "Testimonial bewerken"
514
-
515
- #: testimonials-widget.php:356 testimonials-widget.php:617
516
- msgid "No testimonials found"
517
- msgstr "Geen testimonials gevonden"
518
-
519
- #: testimonials-widget.php:357
520
- msgid "No testimonials found in Trash"
521
- msgstr "Geen testimonials gevonden in prullenbak"
522
-
523
- #: testimonials-widget.php:359
524
- msgid "Search Testimonials"
525
- msgstr "Zoek testimonials"
526
-
527
- #: testimonials-widget.php:360
528
- msgid "Testimonial"
529
- msgstr "Testimonial"
530
-
531
- #: testimonials-widget.php:361
532
- msgid "View Testimonial"
533
- msgstr "Bekijk testimonial"
534
-
535
- #: testimonials-widget.php:650
536
- msgid "…"
537
- msgstr "..."
538
-
539
- #: testimonials-widget.php:996
540
- msgid "&laquo;"
541
- msgstr "&laquo;"
542
-
543
- #: testimonials-widget.php:1005
544
- msgid "&raquo;"
545
- msgstr "&raquo;"
546
-
547
- #: testimonials-widget.php:1260
548
- msgid "Testimonial Data"
549
- msgstr "Testimonial Data"
550
-
551
- #: testimonials-widget.php:1285
552
- msgid "Enter title here"
553
- msgstr "Geef titel op"
554
-
555
- #: testimonials-widget.php:1286
556
- msgid "Enter testimonial source here"
557
- msgstr "Geef testimonial bron op"
558
-
559
- #: testimonials-widget.php:1310
560
- msgid "Testimonial updated. <a href=\"%s\">View testimonial</a>"
561
- msgstr "Testimonial bijgewerkt. <a href=\"%s\">Bekijk testimonial</a>"
562
-
563
- #: testimonials-widget.php:1311
564
- msgid "Custom field updated."
565
- msgstr "Aangepast veld bijgewerkt."
566
-
567
- #: testimonials-widget.php:1312
568
- msgid "Custom field deleted."
569
- msgstr "Aangepast veld verwijderd."
570
-
571
- #: testimonials-widget.php:1313
572
- msgid "Testimonial updated."
573
- msgstr "Testimonial bijgewerkt."
574
-
575
- #. translators: %s: date and time of the revision
576
- #: testimonials-widget.php:1315
577
- msgid "Testimonial restored to revision from %s"
578
- msgstr "Testimonial herstelt naar revisie van %s"
579
-
580
- #: testimonials-widget.php:1316
581
- msgid "Testimonial published. <a href=\"%s\">View testimonial</a>"
582
- msgstr "Testimonial gepubliceerd. <a href=\"%s\">Bekijk testimonial</a>"
583
-
584
- #: testimonials-widget.php:1317
585
- msgid "Testimonial saved."
586
- msgstr "Testimonial opgeslaan."
587
-
588
- #: testimonials-widget.php:1318
589
- msgid ""
590
- "Testimonial submitted. <a target=\"_blank\" href=\"%s\">Preview testimonial</"
591
- "a>"
592
- msgstr ""
593
- "Testimonial toegevoegd. <a target=\"_blank\" href=\"%s\">Bekijk voorbeeld "
594
- "testimonial</a>"
595
-
596
- #: testimonials-widget.php:1319
597
- msgid ""
598
- "Testimonial scheduled for: <strong>%1$s</strong>. <a target=\"_blank\" href="
599
- "\"%2$s\">Preview testimonial</a>"
600
- msgstr ""
601
- "Testimonial gepland voor: <strong>%1$s</strong>. <a target=\"_blank\" href="
602
- "\"%2$s\">Bekijk voorbeeld testimonial</a>"
603
-
604
- #: testimonials-widget.php:1320
605
- msgid ""
606
- "Testimonial draft updated. <a target=\"_blank\" href=\"%s\">Preview "
607
- "testimonial</a>"
608
- msgstr ""
609
- "Testimonial concept bijgewerkt. <a target=\"_blank\" href=\"%s\">Bekijk "
610
- "voorbeeld</a>"
611
-
612
- #. Plugin URI of the plugin/theme
613
- msgid "http://wordpress.org/extend/plugins/testimonials-widget/"
614
- msgstr "http://wordpress.org/extend/plugins/testimonials-widget/"
615
-
616
- #. Description of the plugin/theme
617
- msgid ""
618
- "Testimonials Widget plugin allows you to display random or rotating "
619
- "portfolio, quotes, reviews, showcases, or text with images on your WordPress "
620
- "blog."
621
- msgstr ""
622
- "Testimonials Widget plugin laat je toe om willekeurig of roterend portfolio, "
623
- "quotes, recensies, showcases, of tekst met afbeeldingen op uw WordPress blog."
624
-
625
- #. Author of the plugin/theme
626
- msgid "Michael Cannon"
627
- msgstr "Michael Cannon"
628
-
629
- #. Author URI of the plugin/theme
630
- msgid "http://aihr.us/about-aihrus/michael-cannon-resume/"
631
- msgstr "http://aihr.us/about-aihrus/michael-cannon-resume/"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/languages/testimonials-widget.pot DELETED
@@ -1,1164 +0,0 @@
1
- # Copyright (C) 2014 Testimonials Widget
2
- # This file is distributed under the same license as the Testimonials Widget package.
3
- msgid ""
4
- msgstr ""
5
- "Project-Id-Version: Testimonials Widget 3.0.0\n"
6
- "Report-Msgid-Bugs-To: http://wordpress.org/tag/testimonials-widget\n"
7
- "POT-Creation-Date: 2014-10-14 19:31:18+00:00\n"
8
- "MIME-Version: 1.0\n"
9
- "Content-Type: text/plain; charset=UTF-8\n"
10
- "Content-Transfer-Encoding: 8bit\n"
11
- "PO-Revision-Date: 2014-MO-DA HO:MI+ZONE\n"
12
- "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13
- "Language-Team: LANGUAGE <LL@li.org>\n"
14
-
15
- #: includes/class-testimonials-widget-archives-widget.php:36
16
- msgid "A monthly archive of your site's testimonials."
17
- msgstr ""
18
-
19
- #: includes/class-testimonials-widget-archives-widget.php:38
20
- msgid "Testimonials Archives"
21
- msgstr ""
22
-
23
- #: includes/class-testimonials-widget-archives-widget.php:58
24
- #: includes/class-testimonials-widget-categories-widget.php:61
25
- msgid "Display as dropdown"
26
- msgstr ""
27
-
28
- #: includes/class-testimonials-widget-archives-widget.php:65
29
- #: includes/class-testimonials-widget-categories-widget.php:68
30
- msgid "Show post counts"
31
- msgstr ""
32
-
33
- #: includes/class-testimonials-widget-categories-widget.php:36
34
- msgid "A list or dropdown of testimonials' categories."
35
- msgstr ""
36
-
37
- #: includes/class-testimonials-widget-categories-widget.php:38
38
- msgid "Testimonials Categories"
39
- msgstr ""
40
-
41
- #: includes/class-testimonials-widget-categories-widget.php:75
42
- msgid "Show hierarchy"
43
- msgstr ""
44
-
45
- #: includes/class-testimonials-widget-recent-testimonials-widget.php:36
46
- msgid "Your site's most recent testimonials."
47
- msgstr ""
48
-
49
- #: includes/class-testimonials-widget-recent-testimonials-widget.php:38
50
- msgid "Recent Testimonials"
51
- msgstr ""
52
-
53
- #: includes/class-testimonials-widget-recent-testimonials-widget.php:61
54
- msgid "Number of testimonials to show"
55
- msgstr ""
56
-
57
- #: includes/class-testimonials-widget-recent-testimonials-widget.php:68
58
- msgid "Display testimonial date?"
59
- msgstr ""
60
-
61
- #: includes/class-testimonials-widget-settings.php:97
62
- msgid "Testimonials Settings"
63
- msgstr ""
64
-
65
- #: includes/class-testimonials-widget-settings.php:97
66
- #: includes/class-testimonials-widget.php:136
67
- msgid "Settings"
68
- msgstr ""
69
-
70
- #: includes/class-testimonials-widget-settings.php:113
71
- #: includes/class-testimonials-widget-settings.php:936
72
- msgid "General"
73
- msgstr ""
74
-
75
- #: includes/class-testimonials-widget-settings.php:114
76
- #: includes/class-testimonials-widget-settings.php:944
77
- msgid "Fields"
78
- msgstr ""
79
-
80
- #: includes/class-testimonials-widget-settings.php:115
81
- #: includes/class-testimonials-widget-settings.php:952
82
- msgid "Selection"
83
- msgstr ""
84
-
85
- #: includes/class-testimonials-widget-settings.php:116
86
- #: includes/class-testimonials-widget-settings.php:960
87
- msgid "Ordering"
88
- msgstr ""
89
-
90
- #: includes/class-testimonials-widget-settings.php:117
91
- #: includes/class-testimonials-widget-settings.php:968
92
- msgid "Columns"
93
- msgstr ""
94
-
95
- #: includes/class-testimonials-widget-settings.php:118
96
- #: includes/class-testimonials-widget-settings.php:976
97
- msgid "Post Type"
98
- msgstr ""
99
-
100
- #: includes/class-testimonials-widget-settings.php:119
101
- #: includes/class-testimonials-widget-settings.php:984
102
- msgid "Slider Widget"
103
- msgstr ""
104
-
105
- #: includes/class-testimonials-widget-settings.php:123
106
- msgid "Shortcode Examples"
107
- msgstr ""
108
-
109
- #: includes/class-testimonials-widget-settings.php:124
110
- msgid "Shortcode Attributes"
111
- msgstr ""
112
-
113
- #: includes/class-testimonials-widget-settings.php:139
114
- #: includes/libraries/aihrus-framework/includes/class-aihrus-widget.php:336
115
- msgid "Title"
116
- msgstr ""
117
-
118
- #: includes/class-testimonials-widget-settings.php:140
119
- #: includes/class-testimonials-widget.php:573
120
- #: includes/class-testimonials-widget.php:621
121
- msgid "Testimonials"
122
- msgstr ""
123
-
124
- #: includes/class-testimonials-widget-settings.php:146
125
- #: includes/libraries/aihrus-framework/includes/class-aihrus-widget.php:340
126
- msgid "Title Link"
127
- msgstr ""
128
-
129
- #: includes/class-testimonials-widget-settings.php:147
130
- #: includes/libraries/aihrus-framework/includes/class-aihrus-widget.php:341
131
- msgid "URL, path, or post ID to link widget title to. Ex: http://example.com/stuff, /testimonials, or 123"
132
- msgstr ""
133
-
134
- #: includes/class-testimonials-widget-settings.php:153
135
- msgid "Adaptive Slider Height?"
136
- msgstr ""
137
-
138
- #: includes/class-testimonials-widget-settings.php:154
139
- msgid "Dynamically adjust slider height based on each slide's height."
140
- msgstr ""
141
-
142
- #: includes/class-testimonials-widget-settings.php:162
143
- msgid "Bottom Text"
144
- msgstr ""
145
-
146
- #: includes/class-testimonials-widget-settings.php:163
147
- msgid "Common text or HTML for bottom of testimonials."
148
- msgstr ""
149
-
150
- #: includes/class-testimonials-widget-settings.php:170
151
- msgid "Character Limit"
152
- msgstr ""
153
-
154
- #: includes/class-testimonials-widget-settings.php:171
155
- msgid "Number of characters to limit non-single testimonial views to."
156
- msgstr ""
157
-
158
- #: includes/class-testimonials-widget-settings.php:177
159
- msgid "Keep Whitespace?"
160
- msgstr ""
161
-
162
- #: includes/class-testimonials-widget-settings.php:178
163
- msgid "Keeps testimonials looking as entered than sans auto-formatting."
164
- msgstr ""
165
-
166
- #: includes/class-testimonials-widget-settings.php:185
167
- msgid "Rotation Speed"
168
- msgstr ""
169
-
170
- #: includes/class-testimonials-widget-settings.php:186
171
- msgid "Number of seconds between testimonial rotations or 0 for no rotation at all refresh."
172
- msgstr ""
173
-
174
- #: includes/class-testimonials-widget-settings.php:193
175
- msgid "Show Play/Pause?"
176
- msgstr ""
177
-
178
- #: includes/class-testimonials-widget-settings.php:194
179
- msgid "Display start and stop buttons underneath the testimonial slider."
180
- msgstr ""
181
-
182
- #: includes/class-testimonials-widget-settings.php:202
183
- msgid "Transition Mode?"
184
- msgstr ""
185
-
186
- #: includes/class-testimonials-widget-settings.php:203
187
- msgid "Type of transition between slides."
188
- msgstr ""
189
-
190
- #: includes/class-testimonials-widget-settings.php:206
191
- msgid "Fade"
192
- msgstr ""
193
-
194
- #: includes/class-testimonials-widget-settings.php:207
195
- msgid "Horizontal"
196
- msgstr ""
197
-
198
- #: includes/class-testimonials-widget-settings.php:208
199
- msgid "Vertical"
200
- msgstr ""
201
-
202
- #: includes/class-testimonials-widget-settings.php:220
203
- msgid "General Options"
204
- msgstr ""
205
-
206
- #: includes/class-testimonials-widget-settings.php:225
207
- msgid "Default Reviewed Item?"
208
- msgstr ""
209
-
210
- #: includes/class-testimonials-widget-settings.php:226
211
- msgid "Name of thing being referenced in testimonials."
212
- msgstr ""
213
-
214
- #: includes/class-testimonials-widget-settings.php:233
215
- msgid "Default Reviewed Item URL?"
216
- msgstr ""
217
-
218
- #: includes/class-testimonials-widget-settings.php:234
219
- msgid "URL of thing being referenced in testimonials."
220
- msgstr ""
221
-
222
- #: includes/class-testimonials-widget-settings.php:241
223
- msgid "Disable built-in quotes?"
224
- msgstr ""
225
-
226
- #: includes/class-testimonials-widget-settings.php:242
227
- msgid "Remove open and close quote span tags surrounding testimonial content."
228
- msgstr ""
229
-
230
- #: includes/class-testimonials-widget-settings.php:248
231
- msgid "Disable \"Testimonials Not Found\"?"
232
- msgstr ""
233
-
234
- #: includes/class-testimonials-widget-settings.php:249
235
- msgid "Remove \"Testimonials Not Found\" content when no testimonials are found to be displayed."
236
- msgstr ""
237
-
238
- #: includes/class-testimonials-widget-settings.php:255
239
- msgid "Enable Paging?"
240
- msgstr ""
241
-
242
- #: includes/class-testimonials-widget-settings.php:256
243
- msgid "Show paging controls for `[testimonials]` listing."
244
- msgstr ""
245
-
246
- #: includes/class-testimonials-widget-settings.php:259
247
- msgid "Disable"
248
- msgstr ""
249
-
250
- #: includes/class-testimonials-widget-settings.php:260
251
- msgid "Enable"
252
- msgstr ""
253
-
254
- #: includes/class-testimonials-widget-settings.php:261
255
- msgid "Before testimonials"
256
- msgstr ""
257
-
258
- #: includes/class-testimonials-widget-settings.php:262
259
- msgid "After testimonials"
260
- msgstr ""
261
-
262
- #: includes/class-testimonials-widget-settings.php:268
263
- msgid "Adds HTML tag markup per the <a href=\"%s\">Review schema</a> to testimonials. Search engines including Bing, Google, Yahoo! and Yandex rely on this markup to improve the display of search results."
264
- msgstr ""
265
-
266
- #: includes/class-testimonials-widget-settings.php:271
267
- msgid "Enable Review Schema?"
268
- msgstr ""
269
-
270
- #: includes/class-testimonials-widget-settings.php:279
271
- msgid "Enable [shortcodes]?"
272
- msgstr ""
273
-
274
- #: includes/class-testimonials-widget-settings.php:280
275
- msgid "If unchecked, shortcodes are stripped."
276
- msgstr ""
277
-
278
- #: includes/class-testimonials-widget-settings.php:287
279
- msgid "Enable Video?"
280
- msgstr ""
281
-
282
- #: includes/class-testimonials-widget-settings.php:288
283
- msgid "Only enable when displaying video content."
284
- msgstr ""
285
-
286
- #: includes/class-testimonials-widget-settings.php:294
287
- msgid "Exclude bxSlider CSS?"
288
- msgstr ""
289
-
290
- #: includes/class-testimonials-widget-settings.php:295
291
- msgid "For a bare-bones, unthemed slider."
292
- msgstr ""
293
-
294
- #: includes/class-testimonials-widget-settings.php:303
295
- msgid "Exclude default CSS?"
296
- msgstr ""
297
-
298
- #: includes/class-testimonials-widget-settings.php:304
299
- msgid "Prevent default CSS from being loaded."
300
- msgstr ""
301
-
302
- #: includes/class-testimonials-widget-settings.php:312
303
- msgid "Remove `.hentry` CSS?"
304
- msgstr ""
305
-
306
- #: includes/class-testimonials-widget-settings.php:313
307
- msgid "Some themes use class `.hentry` in a manner that breaks Testimonials' CSS."
308
- msgstr ""
309
-
310
- #: includes/class-testimonials-widget-settings.php:320
311
- msgid "URL Target"
312
- msgstr ""
313
-
314
- #: includes/class-testimonials-widget-settings.php:321
315
- msgid "Add target to all URLs; leave blank if none."
316
- msgstr ""
317
-
318
- #: includes/class-testimonials-widget-settings.php:326
319
- msgid "Use `&lt;q&gt;` tag?"
320
- msgstr ""
321
-
322
- #: includes/class-testimonials-widget-settings.php:327
323
- msgid "Not HTML5 compliant."
324
- msgstr ""
325
-
326
- #: includes/class-testimonials-widget-settings.php:339
327
- msgid "Field Options"
328
- msgstr ""
329
-
330
- #: includes/class-testimonials-widget-settings.php:345
331
- #: includes/class-testimonials-widget-settings.php:611
332
- msgid "Hide Author?"
333
- msgstr ""
334
-
335
- #: includes/class-testimonials-widget-settings.php:348
336
- msgid "Don't display testimonial title in cite."
337
- msgstr ""
338
-
339
- #: includes/class-testimonials-widget-settings.php:353
340
- #: includes/class-testimonials-widget-settings.php:621
341
- msgid "Hide Company?"
342
- msgstr ""
343
-
344
- #: includes/class-testimonials-widget-settings.php:356
345
- msgid "Don't display testimonial company in cite."
346
- msgstr ""
347
-
348
- #: includes/class-testimonials-widget-settings.php:361
349
- msgid "Hide Content?"
350
- msgstr ""
351
-
352
- #: includes/class-testimonials-widget-settings.php:364
353
- msgid "Don't display testimonial content in a view."
354
- msgstr ""
355
-
356
- #: includes/class-testimonials-widget-settings.php:369
357
- #: includes/class-testimonials-widget-settings.php:631
358
- msgid "Hide Email?"
359
- msgstr ""
360
-
361
- #: includes/class-testimonials-widget-settings.php:373
362
- msgid "Don't display or link to testimonial email in cite."
363
- msgstr ""
364
-
365
- #: includes/class-testimonials-widget-settings.php:378
366
- msgid "Hide Gravatar?"
367
- msgstr ""
368
-
369
- #: includes/class-testimonials-widget-settings.php:381
370
- msgid "Don't display Gravatar image with testimonial."
371
- msgstr ""
372
-
373
- #: includes/class-testimonials-widget-settings.php:386
374
- #: includes/class-testimonials-widget-settings.php:651
375
- msgid "Hide Image?"
376
- msgstr ""
377
-
378
- #: includes/class-testimonials-widget-settings.php:389
379
- msgid "Don't display featured image with testimonial."
380
- msgstr ""
381
-
382
- #: includes/class-testimonials-widget-settings.php:394
383
- msgid "Hide Image in Single View?"
384
- msgstr ""
385
-
386
- #: includes/class-testimonials-widget-settings.php:402
387
- #: includes/class-testimonials-widget-settings.php:660
388
- msgid "Hide Job Title?"
389
- msgstr ""
390
-
391
- #: includes/class-testimonials-widget-settings.php:405
392
- msgid "Don't display testimonial job title in cite."
393
- msgstr ""
394
-
395
- #: includes/class-testimonials-widget-settings.php:410
396
- #: includes/class-testimonials-widget-settings.php:670
397
- msgid "Hide Location?"
398
- msgstr ""
399
-
400
- #: includes/class-testimonials-widget-settings.php:413
401
- msgid "Don't display testimonial location in cite."
402
- msgstr ""
403
-
404
- #: includes/class-testimonials-widget-settings.php:418
405
- #: includes/class-testimonials-widget-settings.php:689
406
- msgid "Hide URL?"
407
- msgstr ""
408
-
409
- #: includes/class-testimonials-widget-settings.php:421
410
- msgid "Don't display or link to testimonial URL in cite."
411
- msgstr ""
412
-
413
- #: includes/class-testimonials-widget-settings.php:431
414
- msgid "Selection Options"
415
- msgstr ""
416
-
417
- #: includes/class-testimonials-widget-settings.php:437
418
- msgid "Category Filter"
419
- msgstr ""
420
-
421
- #: includes/class-testimonials-widget-settings.php:438
422
- msgid "Comma separated category names or IDs."
423
- msgstr ""
424
-
425
- #: includes/class-testimonials-widget-settings.php:445
426
- msgid "Exclude IDs Filter"
427
- msgstr ""
428
-
429
- #: includes/class-testimonials-widget-settings.php:446
430
- #: includes/class-testimonials-widget-settings.php:453
431
- msgid "Comma separated testimonial IDs."
432
- msgstr ""
433
-
434
- #: includes/class-testimonials-widget-settings.php:452
435
- msgid "Include IDs Filter"
436
- msgstr ""
437
-
438
- #: includes/class-testimonials-widget-settings.php:459
439
- msgid "Limit"
440
- msgstr ""
441
-
442
- #: includes/class-testimonials-widget-settings.php:460
443
- msgid "Number of testimonials to select per instance."
444
- msgstr ""
445
-
446
- #: includes/class-testimonials-widget-settings.php:467
447
- msgid "Require All Tags?"
448
- msgstr ""
449
-
450
- #: includes/class-testimonials-widget-settings.php:468
451
- msgid "Select only testimonials with all of the given tags."
452
- msgstr ""
453
-
454
- #: includes/class-testimonials-widget-settings.php:475
455
- msgid "Tags Filter"
456
- msgstr ""
457
-
458
- #: includes/class-testimonials-widget-settings.php:476
459
- msgid "Comma separated tag names or IDs."
460
- msgstr ""
461
-
462
- #: includes/class-testimonials-widget-settings.php:489
463
- msgid "Ordering Options"
464
- msgstr ""
465
-
466
- #: includes/class-testimonials-widget-settings.php:495
467
- msgid "ORDER BY"
468
- msgstr ""
469
-
470
- #: includes/class-testimonials-widget-settings.php:496
471
- msgid "Used when \"Random Order\" is disabled."
472
- msgstr ""
473
-
474
- #: includes/class-testimonials-widget-settings.php:499
475
- msgid "Testimonial ID"
476
- msgstr ""
477
-
478
- #: includes/class-testimonials-widget-settings.php:500
479
- #: includes/class-testimonials-widget-settings.php:503
480
- #: includes/class-testimonials-widget.php:503
481
- #: includes/class-testimonials-widget.php:534
482
- #: includes/class-testimonials-widget.php:1363
483
- msgid "Author"
484
- msgstr ""
485
-
486
- #: includes/class-testimonials-widget-settings.php:501
487
- #: includes/class-testimonials-widget.php:505
488
- msgid "Date"
489
- msgstr ""
490
-
491
- #: includes/class-testimonials-widget-settings.php:502
492
- msgid "Menu Order"
493
- msgstr ""
494
-
495
- #: includes/class-testimonials-widget-settings.php:504
496
- msgid "No order"
497
- msgstr ""
498
-
499
- #: includes/class-testimonials-widget-settings.php:512
500
- msgid "ORDER BY meta_key"
501
- msgstr ""
502
-
503
- #: includes/class-testimonials-widget-settings.php:513
504
- msgid "Used when \"Random Order\" is disabled and sorting by a testimonials meta key is needed. Overrides ORDER BY."
505
- msgstr ""
506
-
507
- #: includes/class-testimonials-widget-settings.php:516
508
- msgid "None"
509
- msgstr ""
510
-
511
- #: includes/class-testimonials-widget-settings.php:517
512
- #: includes/class-testimonials-widget.php:539
513
- #: includes/class-testimonials-widget.php:1369
514
- msgid "Job Title"
515
- msgstr ""
516
-
517
- #: includes/class-testimonials-widget-settings.php:518
518
- #: includes/class-testimonials-widget.php:554
519
- #: includes/class-testimonials-widget.php:1387
520
- msgid "Email"
521
- msgstr ""
522
-
523
- #: includes/class-testimonials-widget-settings.php:519
524
- #: includes/class-testimonials-widget.php:544
525
- #: includes/class-testimonials-widget.php:1375
526
- msgid "Location"
527
- msgstr ""
528
-
529
- #: includes/class-testimonials-widget-settings.php:520
530
- #: includes/class-testimonials-widget.php:549
531
- #: includes/class-testimonials-widget.php:1381
532
- msgid "Company"
533
- msgstr ""
534
-
535
- #: includes/class-testimonials-widget-settings.php:521
536
- #: includes/class-testimonials-widget.php:559
537
- #: includes/class-testimonials-widget.php:1393
538
- msgid "URL"
539
- msgstr ""
540
-
541
- #: includes/class-testimonials-widget-settings.php:528
542
- msgid "ORDER BY Order"
543
- msgstr ""
544
-
545
- #: includes/class-testimonials-widget-settings.php:531
546
- msgid "Descending"
547
- msgstr ""
548
-
549
- #: includes/class-testimonials-widget-settings.php:532
550
- msgid "Ascending"
551
- msgstr ""
552
-
553
- #: includes/class-testimonials-widget-settings.php:540
554
- msgid "Random Order?"
555
- msgstr ""
556
-
557
- #: includes/class-testimonials-widget-settings.php:541
558
- msgid "If checked, ignores ORDER BY, ORDER BY meta_key, and ORDER BY Order. Widgets are random by default automatically."
559
- msgstr ""
560
-
561
- #: includes/class-testimonials-widget-settings.php:554
562
- msgid "Allow Comments?"
563
- msgstr ""
564
-
565
- #: includes/class-testimonials-widget-settings.php:555
566
- msgid "Only affects the Testimonials post edit page. Your theme controls the front-end view."
567
- msgstr ""
568
-
569
- #: includes/class-testimonials-widget-settings.php:562
570
- msgid "URL slug-name for <a href=\"%1s\">testimonials archive</a> page."
571
- msgstr ""
572
-
573
- #: includes/class-testimonials-widget-settings.php:568
574
- msgid "Archive Page URL"
575
- msgstr ""
576
-
577
- #: includes/class-testimonials-widget-settings.php:578
578
- msgid "Disable Default Taxonomies?"
579
- msgstr ""
580
-
581
- #: includes/class-testimonials-widget-settings.php:581
582
- msgid "If checked, use Testimonials' own category and tag taxonomies than WordPress' defaults."
583
- msgstr ""
584
-
585
- #: includes/class-testimonials-widget-settings.php:587
586
- msgid "Include testimonials in archive and category views."
587
- msgstr ""
588
-
589
- #: includes/class-testimonials-widget-settings.php:590
590
- msgid "Enable archives view?"
591
- msgstr ""
592
-
593
- #: includes/class-testimonials-widget-settings.php:596
594
- msgid "URL slug-name for testimonial view pages. Shouldn't be the same as the Archive Page URL nor should it match a page URL slug."
595
- msgstr ""
596
-
597
- #: includes/class-testimonials-widget-settings.php:600
598
- msgid "Testimonial Page URL"
599
- msgstr ""
600
-
601
- #: includes/class-testimonials-widget-settings.php:641
602
- msgid "Hide ID?"
603
- msgstr ""
604
-
605
- #: includes/class-testimonials-widget-settings.php:680
606
- msgid "Hide Shortcode?"
607
- msgstr ""
608
-
609
- #: includes/class-testimonials-widget-settings.php:700
610
- #: includes/class-testimonials-widget-settings.php:992
611
- #: includes/libraries/aihrus-framework/includes/class-aihrus-settings.php:65
612
- msgid "Reset"
613
- msgstr ""
614
-
615
- #: includes/class-testimonials-widget-settings.php:922
616
- msgid "These Testimonials Settings establish the default option values for shortcodes, theme functions, and widget instances. Widgets, once created no longer inherit these global settings. Therefore, you'll need to update each widget with the new settings. It might be easier to delete the widget and then recreate it."
617
- msgstr ""
618
-
619
- #: includes/class-testimonials-widget-settings.php:924
620
- msgid "Shortcode option names are listed below each entry."
621
- msgstr ""
622
-
623
- #: includes/class-testimonials-widget-settings.php:927
624
- msgid "View the <a href=\"%s\">Testimonials documentation</a>."
625
- msgstr ""
626
-
627
- #: includes/class-testimonials-widget-settings.php:937
628
- msgid "General options."
629
- msgstr ""
630
-
631
- #: includes/class-testimonials-widget-settings.php:945
632
- msgid "Show or hide fields."
633
- msgstr ""
634
-
635
- #: includes/class-testimonials-widget-settings.php:953
636
- msgid "Options used to select testimonials."
637
- msgstr ""
638
-
639
- #: includes/class-testimonials-widget-settings.php:961
640
- msgid "Options used to determine displayed testimonials ordering."
641
- msgstr ""
642
-
643
- #: includes/class-testimonials-widget-settings.php:969
644
- msgid "Allowed columns to display on edit page."
645
- msgstr ""
646
-
647
- #: includes/class-testimonials-widget-settings.php:977
648
- msgid "Archive and singular page URL related testimonials options."
649
- msgstr ""
650
-
651
- #: includes/class-testimonials-widget-settings.php:985
652
- msgid "Options related to showing testimonials in widgets."
653
- msgstr ""
654
-
655
- #: includes/class-testimonials-widget-settings.php:993
656
- msgid "Backwards compatibility, import/export options, and reset options."
657
- msgstr ""
658
-
659
- #: includes/class-testimonials-widget-slider-widget.php:35
660
- msgid "Displays rotating testimonials or statically."
661
- msgstr ""
662
-
663
- #: includes/class-testimonials-widget-slider-widget.php:37
664
- msgid "Testimonials Slider"
665
- msgstr ""
666
-
667
- #: includes/class-testimonials-widget-slider-widget.php:95
668
- msgid "CSS Class"
669
- msgstr ""
670
-
671
- #: includes/class-testimonials-widget-slider-widget.php:96
672
- msgid "This widget's unique CSS class for styling"
673
- msgstr ""
674
-
675
- #: includes/class-testimonials-widget-tag-cloud-widget.php:36
676
- msgid "A cloud of your most used testimonials' tags."
677
- msgstr ""
678
-
679
- #: includes/class-testimonials-widget-tag-cloud-widget.php:38
680
- msgid "Testimonials Tag Cloud"
681
- msgstr ""
682
-
683
- #: includes/class-testimonials-widget-tag-cloud-widget.php:63
684
- #: includes/class-testimonials-widget-tag-cloud-widget.php:70
685
- #: includes/class-testimonials-widget.php:510
686
- #: includes/class-testimonials-widget.php:513
687
- msgid "Category"
688
- msgstr ""
689
-
690
- #: includes/class-testimonials-widget-tag-cloud-widget.php:64
691
- #: includes/class-testimonials-widget-tag-cloud-widget.php:71
692
- #: includes/class-testimonials-widget.php:511
693
- #: includes/class-testimonials-widget.php:514
694
- msgid "Tags"
695
- msgstr ""
696
-
697
- #: includes/class-testimonials-widget-tag-cloud-widget.php:78
698
- msgid "Taxonomy"
699
- msgstr ""
700
-
701
- #: includes/class-testimonials-widget.php:367
702
- msgid "If your Testimonials display has gone to funky town, please <a href=\"%s\">read the FAQ</a> about possible CSS fixes."
703
- msgstr ""
704
-
705
- #: includes/class-testimonials-widget.php:504
706
- msgid "Published by"
707
- msgstr ""
708
-
709
- #: includes/class-testimonials-widget.php:519
710
- msgid "ID"
711
- msgstr ""
712
-
713
- #: includes/class-testimonials-widget.php:524
714
- msgid "Image"
715
- msgstr ""
716
-
717
- #: includes/class-testimonials-widget.php:529
718
- msgid "Shortcodes"
719
- msgstr ""
720
-
721
- #: includes/class-testimonials-widget.php:570
722
- msgid "Add New"
723
- msgstr ""
724
-
725
- #: includes/class-testimonials-widget.php:571
726
- #: includes/class-testimonials-widget.php:574
727
- msgid "Add New Testimonial"
728
- msgstr ""
729
-
730
- #: includes/class-testimonials-widget.php:572
731
- msgid "Edit Testimonial"
732
- msgstr ""
733
-
734
- #: includes/class-testimonials-widget.php:575
735
- #: includes/class-testimonials-widget.php:873
736
- msgid "No testimonials found"
737
- msgstr ""
738
-
739
- #: includes/class-testimonials-widget.php:576
740
- msgid "No testimonials found in Trash"
741
- msgstr ""
742
-
743
- #: includes/class-testimonials-widget.php:578
744
- msgid "Search Testimonials"
745
- msgstr ""
746
-
747
- #: includes/class-testimonials-widget.php:579
748
- #: includes/class-testimonials-widget.php:1454
749
- #: includes/class-testimonials-widget.php:1817
750
- msgid "Testimonial"
751
- msgstr ""
752
-
753
- #: includes/class-testimonials-widget.php:580
754
- msgid "View Testimonial"
755
- msgstr ""
756
-
757
- #: includes/class-testimonials-widget.php:1366
758
- msgid "Use when the testimonial title is not the authors' name."
759
- msgstr ""
760
-
761
- #: includes/class-testimonials-widget.php:1390
762
- msgid "If an email is provided, but not an image, a Gravatar icon will be attempted to be loaded."
763
- msgstr ""
764
-
765
- #: includes/class-testimonials-widget.php:1405
766
- msgid "Testimonial Data"
767
- msgstr ""
768
-
769
- #: includes/class-testimonials-widget.php:1429
770
- msgid "Testimonial updated. <a href=\"%s\">View testimonial</a>"
771
- msgstr ""
772
-
773
- #: includes/class-testimonials-widget.php:1430
774
- msgid "Custom field updated."
775
- msgstr ""
776
-
777
- #: includes/class-testimonials-widget.php:1431
778
- msgid "Custom field deleted."
779
- msgstr ""
780
-
781
- #: includes/class-testimonials-widget.php:1432
782
- msgid "Testimonial updated."
783
- msgstr ""
784
-
785
- #. translators: %s: date and time of the revision
786
-
787
- #: includes/class-testimonials-widget.php:1434
788
- msgid "Testimonial restored to revision from %s"
789
- msgstr ""
790
-
791
- #: includes/class-testimonials-widget.php:1435
792
- msgid "Testimonial published. <a href=\"%s\">View testimonial</a>"
793
- msgstr ""
794
-
795
- #: includes/class-testimonials-widget.php:1436
796
- msgid "Testimonial saved."
797
- msgstr ""
798
-
799
- #: includes/class-testimonials-widget.php:1437
800
- msgid "Testimonial submitted. <a target=\"_blank\" href=\"%s\">Preview testimonial</a>"
801
- msgstr ""
802
-
803
- #: includes/class-testimonials-widget.php:1438
804
- msgid "Testimonial scheduled for: <strong>%1$s</strong>. <a target=\"_blank\" href=\"%2$s\">Preview testimonial</a>"
805
- msgstr ""
806
-
807
- #: includes/class-testimonials-widget.php:1439
808
- msgid "Testimonial draft updated. <a target=\"_blank\" href=\"%s\">Preview testimonial</a>"
809
- msgstr ""
810
-
811
- #: includes/class-testimonials-widget.php:1712
812
- msgid "If your Testimonials display has gone to funky town, please <a href=\"%s\">read the FAQ</a> about possible fixes."
813
- msgstr ""
814
-
815
- #: includes/class-testimonials-widget.php:1731
816
- msgid "Failed version check"
817
- msgstr ""
818
-
819
- #: includes/class-testimonials-widget.php:1762
820
- msgid "Shortcode"
821
- msgstr ""
822
-
823
- #: includes/class-testimonials-widget.php:2178
824
- #: includes/class-testimonials-widget.php:2251
825
- msgid "Used with: "
826
- msgstr ""
827
-
828
- #: includes/class-testimonials-widget.php:2215
829
- #: includes/class-testimonials-widget.php:2279
830
- msgid "Options: "
831
- msgstr ""
832
-
833
- #: includes/class-testimonials-widget.php:2220
834
- #: includes/class-testimonials-widget.php:2284
835
- msgid "Usage: "
836
- msgstr ""
837
-
838
- #: includes/libraries/aihrus-framework/aihrus-framework.php:47
839
- msgid "`aihr_check_aihrus_framework` requires $file argument"
840
- msgstr ""
841
-
842
- #: includes/libraries/aihrus-framework/aihrus-framework.php:90
843
- #: includes/requirements.php:62
844
- msgid "<a href=\"%1$s\">Update plugins</a>. <a href=\"%2$s\">More information</a>."
845
- msgstr ""
846
-
847
- #: includes/libraries/aihrus-framework/aihrus-framework.php:101
848
- msgid "Plugin \"%1$s\" is causing the out of date issue."
849
- msgstr ""
850
-
851
- #: includes/libraries/aihrus-framework/aihrus-framework.php:106
852
- msgid "Plugin \"%1$s\" has been deactivated as it requires Aihrus Framework %2$s or newer. You're running Aihrus Framework %4$s. Once corrected, \"%1$s\" can be activated. %5$s %3$s"
853
- msgstr ""
854
-
855
- #: includes/libraries/aihrus-framework/aihrus-framework.php:115
856
- msgid "`aihr_check_php` requires $file argument"
857
- msgstr ""
858
-
859
- #: includes/libraries/aihrus-framework/aihrus-framework.php:154
860
- msgid "Plugin \"%1$s\" has been deactivated as it requires PHP %2$s or newer. You're running PHP %4$s. Once corrected, \"%1$s\" can be activated. <a href=\"%3$s\">More information</a>."
861
- msgstr ""
862
-
863
- #: includes/libraries/aihrus-framework/aihrus-framework.php:163
864
- msgid "`aihr_check_wp` requires $file argument"
865
- msgstr ""
866
-
867
- #: includes/libraries/aihrus-framework/aihrus-framework.php:206
868
- msgid "Plugin \"%1$s\" has been deactivated as it requires WordPress %2$s or newer. You're running WordPress %4$s. Once corrected, \"%1$s\" can be activated. <a href=\"%3$s\">Update WordPress</a>."
869
- msgstr ""
870
-
871
- #: includes/libraries/aihrus-framework/aihrus-framework.php:238
872
- msgid "<a href=\"%1$s\">update to</a>"
873
- msgstr ""
874
-
875
- #: includes/libraries/aihrus-framework/aihrus-framework.php:243
876
- msgid "<a href=\"%1$s\">install</a>"
877
- msgstr ""
878
-
879
- #: includes/libraries/aihrus-framework/aihrus-framework.php:246
880
- msgid "<a href=\"%1$s\">activate</a>"
881
- msgstr ""
882
-
883
- #: includes/libraries/aihrus-framework/aihrus-framework.php:250
884
- msgid "Plugin \"%3$s\" has been deactivated. Please %1$s \"%4$s\" version %2$s or newer before activating \"%3$s\"."
885
- msgstr ""
886
-
887
- #: includes/libraries/aihrus-framework/aihrus-framework.php:264
888
- msgid "<a href=\"%1$s\">%2$s &gt; Settings</a>, <em>Premium</em> tab, <em>License Key</em>"
889
- msgstr ""
890
-
891
- #: includes/libraries/aihrus-framework/aihrus-framework.php:269
892
- msgid "<a href=\"%s\">Where's my license key?</a>"
893
- msgstr ""
894
-
895
- #: includes/libraries/aihrus-framework/aihrus-framework.php:274
896
- msgid "<a href=\"%1$s\">Purchase</a>"
897
- msgstr ""
898
-
899
- #: includes/libraries/aihrus-framework/aihrus-framework.php:282
900
- msgid "%1$s/checkout/?edd_license_key=%2$s&download_id=%3$s"
901
- msgstr ""
902
-
903
- #: includes/libraries/aihrus-framework/aihrus-framework.php:286
904
- msgid "<a href=\"%1$s\">Renew</a> or "
905
- msgstr ""
906
-
907
- #: includes/libraries/aihrus-framework/aihrus-framework.php:291
908
- msgid "Plugin \"%1$s\" requires license activation for software updates and support. Please activate the license via %2$s. See %3$s for help. Alternately, %5$s%4$s a %1$s license."
909
- msgstr ""
910
-
911
- #: includes/libraries/aihrus-framework/aihrus-framework.php:301
912
- msgid "`aihr_deactivate_plugin` requires $file argument"
913
- msgstr ""
914
-
915
- #: includes/libraries/aihrus-framework/aihrus-framework.php:340
916
- msgid "Unknown"
917
- msgstr ""
918
-
919
- #: includes/libraries/aihrus-framework/aihrus-framework.php:347
920
- msgid "Plugin \"%1$s\" has been deactivated due to \"%2$s\". Once corrected, \"%1$s\" can be activated.</p><p>If you want to revert \"%1$s\", look for <a href=\"%3$s\">older versions on WordPress</a> or <a href=\"mailto:support@aihr.us?subject=Old+Plugin+Version+Request\">email Aihrus support</a> if this is a premium plugin."
921
- msgstr ""
922
-
923
- #: includes/libraries/aihrus-framework/aihrus-framework.php:358
924
- msgid "`aihr_deactivate_plugin_do` requires $file argument"
925
- msgstr ""
926
-
927
- #: includes/libraries/aihrus-framework/includes/class-aihrus-common.php:159
928
- msgid "Please donate $5 towards ongoing free support and development of the \"%1$s\" plugin. %2$s"
929
- msgstr ""
930
-
931
- #: includes/libraries/aihrus-framework/includes/class-aihrus-common.php:340
932
- msgid "cURL is not installed and file_get_contents is not accessible. Unable to retrieve URL %1$s."
933
- msgstr ""
934
-
935
- #: includes/libraries/aihrus-framework/includes/class-aihrus-common.php:660
936
- msgid "<a href=\"http://codex.wordpress.org/Function_Reference/absint\">absint</a>."
937
- msgstr ""
938
-
939
- #: includes/libraries/aihrus-framework/includes/class-aihrus-common.php:661
940
- msgid "Digit-only characters to make a multiple or single entries. Regex <code>#^\\d+(,\\s?\\d+)*$#</code>."
941
- msgstr ""
942
-
943
- #: includes/libraries/aihrus-framework/includes/class-aihrus-common.php:662
944
- msgid "<a href=\"php.net/manual/en/function.intval.php\">intval</a>."
945
- msgstr ""
946
-
947
- #: includes/libraries/aihrus-framework/includes/class-aihrus-common.php:663
948
- msgid "Values like true, 'true', 1, 'on', and 'yes' are <strong>true</strong>; otherwise <strong>false</strong>."
949
- msgstr ""
950
-
951
- #: includes/libraries/aihrus-framework/includes/class-aihrus-common.php:664
952
- msgid "An <a href=\"php.net/manual/en/function.intval.php\">intval</a> greater than zero."
953
- msgstr ""
954
-
955
- #: includes/libraries/aihrus-framework/includes/class-aihrus-common.php:665
956
- msgid "A non-zero <a href=\"php.net/manual/en/function.intval.php\">intval</a>."
957
- msgstr ""
958
-
959
- #: includes/libraries/aihrus-framework/includes/class-aihrus-common.php:666
960
- msgid "SQL ordering \"ASC\" or \"DESC\". Regex <code>#^desc|asc$#i</code>."
961
- msgstr ""
962
-
963
- #: includes/libraries/aihrus-framework/includes/class-aihrus-common.php:667
964
- msgid "<a href=\"http://codex.wordpress.org/Function_Reference/sanitize_title\">sanitize_title</a>."
965
- msgstr ""
966
-
967
- #: includes/libraries/aihrus-framework/includes/class-aihrus-common.php:668
968
- msgid "Word-only characters including a hyphen to make a single term. Regex <code>#^[\\w-]+$#</code>."
969
- msgstr ""
970
-
971
- #: includes/libraries/aihrus-framework/includes/class-aihrus-common.php:669
972
- msgid "Word-only characters to make a single term. Regex <code>#^\\w+$#</code>."
973
- msgstr ""
974
-
975
- #: includes/libraries/aihrus-framework/includes/class-aihrus-common.php:670
976
- msgid "Word-only characters including hyphens and spaces to make a multiple or single terms. Regex <code>#^(([\\w- ]+)(,\\s?)?)+$#</code>."
977
- msgstr ""
978
-
979
- #: includes/libraries/aihrus-framework/includes/class-aihrus-common.php:671
980
- msgid "Current license."
981
- msgstr ""
982
-
983
- #: includes/libraries/aihrus-framework/includes/class-aihrus-common.php:672
984
- msgid "<a href=\"http://php.net/manual/en/filter.filters.validate.php\">filter_var( $url, FILTER_VALIDATE_URL )</a>."
985
- msgstr ""
986
-
987
- #: includes/libraries/aihrus-framework/includes/class-aihrus-common.php:673
988
- msgid "<a href=\"http://codex.wordpress.org/Function_Reference/wp_kses_data\">wp_kses_data</a>."
989
- msgstr ""
990
-
991
- #: includes/libraries/aihrus-framework/includes/class-aihrus-common.php:674
992
- msgid "<a href=\"http://codex.wordpress.org/Function_Reference/wp_kses_post\">wp_kses_post</a>."
993
- msgstr ""
994
-
995
- #: includes/libraries/aihrus-framework/includes/class-aihrus-common.php:679
996
- msgid "Validatation: "
997
- msgstr ""
998
-
999
- #: includes/libraries/aihrus-framework/includes/class-aihrus-common.php:728
1000
- msgid "TBD empty "
1001
- msgstr ""
1002
-
1003
- #: includes/libraries/aihrus-framework/includes/class-aihrus-common.php:734
1004
- msgid "Pick an option"
1005
- msgstr ""
1006
-
1007
- #: includes/libraries/aihrus-framework/includes/class-aihrus-common.php:757
1008
- msgid "Category A, Another category, 123"
1009
- msgstr ""
1010
-
1011
- #: includes/libraries/aihrus-framework/includes/class-aihrus-common.php:759
1012
- msgid "Tag A, Another tag, 123"
1013
- msgstr ""
1014
-
1015
- #: includes/libraries/aihrus-framework/includes/class-aihrus-common.php:762
1016
- msgid "You decide…"
1017
- msgstr ""
1018
-
1019
- #: includes/libraries/aihrus-framework/includes/class-aihrus-licensing.php:80
1020
- msgid "%s license saved."
1021
- msgstr ""
1022
-
1023
- #: includes/libraries/aihrus-framework/includes/class-aihrus-licensing.php:84
1024
- msgid "%s license not saved."
1025
- msgstr ""
1026
-
1027
- #: includes/libraries/aihrus-framework/includes/class-aihrus-licensing.php:180
1028
- msgid "%s license deactivated."
1029
- msgstr ""
1030
-
1031
- #: includes/libraries/aihrus-framework/includes/class-aihrus-settings.php:66
1032
- msgid "About"
1033
- msgstr ""
1034
-
1035
- #: includes/libraries/aihrus-framework/includes/class-aihrus-settings.php:84
1036
- msgid "Export Settings"
1037
- msgstr ""
1038
-
1039
- #: includes/libraries/aihrus-framework/includes/class-aihrus-settings.php:86
1040
- msgid "These are your current settings in a serialized format. Copy the contents to make a backup of your settings."
1041
- msgstr ""
1042
-
1043
- #: includes/libraries/aihrus-framework/includes/class-aihrus-settings.php:95
1044
- msgid "Import Settings"
1045
- msgstr ""
1046
-
1047
- #: includes/libraries/aihrus-framework/includes/class-aihrus-settings.php:97
1048
- msgid "Paste new serialized settings here to overwrite your current configuration."
1049
- msgstr ""
1050
-
1051
- #: includes/libraries/aihrus-framework/includes/class-aihrus-settings.php:102
1052
- msgid "Delete all %s data and options from database on plugin deletion. Even if this option isn't checked, WordPress will still give a data deletion warning."
1053
- msgstr ""
1054
-
1055
- #: includes/libraries/aihrus-framework/includes/class-aihrus-settings.php:106
1056
- msgid "Remove Plugin Data on Deletion?"
1057
- msgstr ""
1058
-
1059
- #: includes/libraries/aihrus-framework/includes/class-aihrus-settings.php:116
1060
- msgid "Reset to Defaults?"
1061
- msgstr ""
1062
-
1063
- #: includes/libraries/aihrus-framework/includes/class-aihrus-settings.php:119
1064
- msgid "Check this box to reset options to their defaults."
1065
- msgstr ""
1066
-
1067
- #: includes/libraries/aihrus-framework/includes/class-aihrus-settings.php:252
1068
- msgid "<img class=\"alignright size-medium\" src=\"%1$simages/michael-cannon-red-square-300x2251.jpg\" alt=\"Michael in Red Square, Moscow, Russia\" width=\"300\" height=\"225\" /><a href=\"%2$s\">%3$s</a> is by <a href=\"%4$s\">Michael Cannon</a>. He's <a href=\"%5$s\">Peichi’s</a> smiling man, an adventurous <a href=\"%6$s\" target=\"_blank\">water-rat</a>, <a href=\"%7$s\">chief people officer</a>, <a href=\"%8$s\">cyclist</a>, <a href=\"%9$s\">full stack developer</a>, <a href=\"%10$s\">poet</a>, <a href=\"%11$s\">WWOOF’er</a> and <a href=\"%12$s\">world traveler</a>."
1069
- msgstr ""
1070
-
1071
- #: includes/libraries/aihrus-framework/includes/class-aihrus-settings.php:296
1072
- msgid "Save Changes"
1073
- msgstr ""
1074
-
1075
- #: includes/libraries/aihrus-framework/includes/class-aihrus-settings.php:304
1076
- msgid "If you like this plugin, please <a href=\"%1$s\" title=\"Donate for Good Karma\"><img src=\"%2$s\" border=\"0\" alt=\"Donate for Good Karma\" /></a> or <a href=\"%3$s\" title=\"purchase premium WordPress plugins from Aihrus \">purchase the Premium version</a> to help fund further development and <a href=\"%4$s\" title=\"Support forums\">support</a>."
1077
- msgstr ""
1078
-
1079
- #: includes/libraries/aihrus-framework/includes/class-aihrus-settings.php:315
1080
- msgid "Copyright &copy;%1$s <a href=\"%2$s\">Aihrus</a>."
1081
- msgstr ""
1082
-
1083
- #: includes/libraries/aihrus-framework/includes/class-aihrus-settings.php:622
1084
- msgid "Settings saved."
1085
- msgstr ""
1086
-
1087
- #: includes/libraries/aihrus-framework/includes/class-aihrus-settings.php:686
1088
- msgid "Required"
1089
- msgstr ""
1090
-
1091
- #: includes/libraries/aihrus-framework/includes/class-aihrus-widget.php:166
1092
- msgid "Expand All Options"
1093
- msgstr ""
1094
-
1095
- #: includes/libraries/aihrus-framework/includes/class-aihrus-widget.php:167
1096
- msgid "Collapse All Options"
1097
- msgstr ""
1098
-
1099
- #: includes/libraries/aihrus-framework/includes/class-aihrus-widget.php:178
1100
- msgid "Expand"
1101
- msgstr ""
1102
-
1103
- #: includes/libraries/aihrus-framework/includes/class-aihrus-widget.php:179
1104
- msgid "Collapse"
1105
- msgstr ""
1106
-
1107
- #: includes/requirements.php:32
1108
- msgid "Missing Aihrus Framework"
1109
- msgstr ""
1110
-
1111
- #: includes/requirements.php:35
1112
- msgid "Old Aihrus Framework version detected"
1113
- msgstr ""
1114
-
1115
- #: includes/requirements.php:39
1116
- msgid "Old PHP version detected"
1117
- msgstr ""
1118
-
1119
- #: includes/requirements.php:43
1120
- msgid "Old WordPress version detected"
1121
- msgstr ""
1122
-
1123
- #: includes/requirements.php:64
1124
- msgid "Plugin \"%1$s\" has been deactivated as it requires a current Aihrus Framework. Once corrected, \"%1$s\" can be activated. %2$s"
1125
- msgstr ""
1126
-
1127
- #: templates/testimonial-content.php:9
1128
- msgid "…"
1129
- msgstr ""
1130
-
1131
- #: templates/testimonials-archives.php:15
1132
- msgid "Select Month"
1133
- msgstr ""
1134
-
1135
- #: templates/testimonials-categories.php:22
1136
- msgid "Select Testimonials Category"
1137
- msgstr ""
1138
-
1139
- #: templates/testimonials-paging.php:18
1140
- msgid "&laquo;"
1141
- msgstr ""
1142
-
1143
- #: templates/testimonials-paging.php:25
1144
- msgid "&raquo;"
1145
- msgstr ""
1146
- #. Plugin Name of the plugin/theme
1147
- msgid "Testimonials Widget"
1148
- msgstr ""
1149
-
1150
- #. Plugin URI of the plugin/theme
1151
- msgid "http://wordpress.org/plugins/testimonials-widget/"
1152
- msgstr ""
1153
-
1154
- #. Description of the plugin/theme
1155
- msgid "Easily add social proofing to your website with Testimonials Widget. List or slide reviews via functions, shortcodes, or widgets."
1156
- msgstr ""
1157
-
1158
- #. Author of the plugin/theme
1159
- msgid "Michael Cannon"
1160
- msgstr ""
1161
-
1162
- #. Author URI of the plugin/theme
1163
- msgid "http://aihr.us/resume/"
1164
- msgstr ""
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/readme.txt DELETED
@@ -1,370 +0,0 @@
1
- === Testimonials Widget ===
2
-
3
- Contributors: comprock
4
- Donate link: http://aihr.us/about-aihrus/donate/
5
- Tags: aihrus, client, customer, portfolio, quote, quotes, random, recommendation, reference, review, reviews, slider, testimonial, testimonials, wpml
6
- Requires at least: 3.6
7
- Tested up to: 4.1.0
8
- Stable tag: 3.0.0
9
- License: GPLv2 or later
10
- License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
-
12
- Easily add social proofing to your website with Testimonials Widget. List or slide reviews via functions, shortcodes, or widgets.
13
-
14
-
15
- == Description ==
16
-
17
- Testimonials Widget lets you randomly slide or list selected portfolios, quotes, reviews, or text with images or videos on your WordPress site. You can insert Testimonials content via shortcode, theme functions, or widgets with category and tag selections and having multiple display options such as random or specific ordering. Also, [Review schema](http://schema.org/Review) for improved search engine results is built-in.
18
-
19
- = Testimonials Widget is Beyond a Simple WordPress Testimonials Slider! =
20
-
21
- * Carousel, fade, and slide transitions
22
- * Filter slideshow content by WordPress' categories, tags, or post-ID
23
- * Random display
24
- * Shortcode compatible - slide content that is rendered using shortcodes. e.g. Worpdress Galleries and Gravity Forms
25
- * Simply styled for easy theme adaption
26
- * Slide images - responsive image slideshow
27
- * Slide mixed content - responsively slide images, text, and video together
28
- * Slide text - useful for rotating testimonials
29
- * Slide videos - video slideshow
30
- * Widget and shortcode ready
31
-
32
- **Video Introduction**
33
-
34
- [youtube https://www.youtube.com/watch?v=bhUhuQ-2m8s]
35
-
36
- **View a [Live Testimonials Widget Demo](http://aihr.us/testimonials-examples/)**
37
-
38
- More than one testimonials shortcode or widget instance can be displayed at a time on a page. Additionally, with shortcodes and theme functions, you can display a short or long list or rotation of testimonials anywhere you need.
39
-
40
- Through categories and tagging, you can create organizational structures. Using categories for products, projects and services you can then apply tagging for further classification.
41
-
42
- As an example, create a **Portfolio** category and then use tags to identify _web_, _magazine_, _media_, _public_, _enterprise_, or other niches. Then configure the Testimonial instance to show only **Portfolio** testimonials with the _public_ and _enterprise_ tags. In another Testimonial instance, you can also select only **Portfolio** testimonials, but then allow _web_ and _media_ tags.
43
-
44
- For easy custom styling, each testimonial widget has its own CSS class identifier.
45
-
46
- Widgets display content sans `wpautop` formatting. This means there's no forced paragraph breaks unless the content specifically contains them. If needed, you can enable `wpautop` via the "Keep whitespace?" option.
47
-
48
- The single testimonial view supports image, author, title, location, email, company and URL details with optional Review schema.
49
-
50
- = Features =
51
-
52
- * Adjustable animation speed
53
- * Admin interface to add, edit and manage testimonials
54
- * API to manipulate testimonials output and selection
55
- * Archive Page URL and Testimonial Page URL are prevented from being the same or matching existing pages.
56
- * Author field can override testimonial title
57
- * Auto-suggest for category and tag options
58
- * Automatic linking of email and URL fields via author or company fields
59
- * Capable of handling multiple widgets per page or post
60
- * Clickable widget titles
61
- * Commenting on testimonial single-view pages
62
- * Compatible with WordPress multisite
63
- * Configuration based validation for easy extending or overriding
64
- * Content truncation respects HTML tags
65
- * Custom CSS in footer for HTML validation
66
- * Custom text or HTML for bottom of widgets
67
- * Custom widget bottom text
68
- * Customizable archive and testimonial URLs
69
- * Customizable testimonial data field `testimonial_extra`
70
- * Customizable views via filters and template files
71
- * Date based archives
72
- * Deletes testimonials-widget custom post type entries and settings on uninstall
73
- * Disable self-generated quotation marks
74
- * Easily label and link to reviewed item for Review schema
75
- * Easy to configure Next and Previous page indicators
76
- * Editors and admins can edit testimonial publisher
77
- * Fields for author, testimonial, image, title, location, email, company and URL details
78
- * Flush URLs on deactivation
79
- * Gravatars saved as featured images
80
- * IDs column shown in testimonials edit page
81
- * IE7 CSS hacks for quotes and join parts
82
- * Image, email based Gravatar, category and tag enabled
83
- * Include testimonials in archive and category views.
84
- * Internal version tracking for compatibility checks and automatic settings update
85
- * Localizable via `languages/testimonials-widget.pot`
86
- * Lots of examples at WordPress Admin > Testimonials > Settings, Examples tab
87
- * Minimalist CSS styling for easier theming
88
- * Multiple paging options for testimonials listings
89
- * Optional commenting on testimonial single-view pages
90
- * Performance optimizations
91
- * Recent testimonials widget
92
- * Respects meta capabilities
93
- * Rotation JavaScript in footer than body
94
- * Schema.org microdata format for improved search engine results
95
- * Settings export/import
96
- * Settings page contextual help
97
- * Settings screen for site-wide option defaults
98
- * Shortcode helpers on category and tag admin screens
99
- * Shortcodes allowed inside of testimonials content
100
- * Shortcodes and theme functions for listings and rotation
101
- * Single testimonial view includes image, author, title, location, email, company and URL details
102
- * Supports [WP-PageNavi](http://wordpress.org/extend/plugins/wp-pagenavi/)
103
- * Testimonial content supports HTML
104
- * Testimonial, email, and URL fields are clickable – URL requires `http://` or `https://` prefix
105
- * Testimonials archive view
106
- * Testimonials category widget
107
- * Testimonials output is completely customizable via filters
108
- * Testimonials slider widget displays rotating testimonials or statically
109
- * Testimonials support styling based upon CSS classes for category, tags and post id
110
- * Testimonials tag cloud widget
111
- * Unique CSS class per widget
112
- * URLs can be opened in new windows
113
- * Use custom taxonomy or WordPress's own for categories and tags
114
- * Uses [bxSlider](http://bxslider.com) for transitions
115
- * Widgets for testimonial's archives, categories, recent, slider, and tag cloud
116
- * WordPress Multilingual enabled [WPML](http://wpml.org/)
117
-
118
- = Shortcodes =
119
-
120
- * `[testimonials]` - Testimonials listings with paging
121
- * `[testimonials_archives]` - A monthly archive of your site's testimonials
122
- * `[testimonials_categories]` - A list or dropdown of testimonials' categories
123
- * `[testimonials_examples]` - Displays examples of commonly used testimonials' shortcodes with attributes
124
- * `[testimonials_options]` - Displays summary of testimonials' settings for use with shortcodes and theme functions
125
- * `[testimonials_recent]` - Your site's most recent testimonials
126
- * `[testimonials_slider]` - Displays rotating testimonials or statically
127
- * `[testimonials_tag_cloud]` - A cloud of your most used testimonials' tags
128
-
129
- = Theme Functions =
130
-
131
- * `<?php echo testimonials(); // Testimonials listing with paging ?>`
132
- * `<?php echo testimonials_archives(); // A monthly archive of your site's testimonials ?>`
133
- * `<?php echo testimonials_categories(); // A list or dropdown of testimonials' categories ?>`
134
- * `<?php echo testimonials_examples(); // Displays examples of commonly used testimonials' shortcodes with attributes ?>`
135
- * `<?php echo testimonials_options(); // Displays summary of testimonials' settings for use with shortcodes and theme functions ?>`
136
- * `<?php echo testimonials_recent(); // Your site's most recent testimonials ?>`
137
- * `<?php echo testimonials_slider(); // Displays rotating testimonials or statically ?>`
138
- * `<?php echo testimonials_tag_cloud(); // A cloud of your most used testimonials' tags ?>`
139
-
140
- = Testimonials Widget Premium =
141
-
142
- Testimonials Widget Premium includes all of Testimonials Widget' benefits and features to over a 100 with…
143
-
144
- * 5-star ratings
145
- * Caching
146
- * Excerpts
147
- * Free, comprehensive support
148
- * More selection options
149
- * Read more links
150
- * RSS feeds
151
- * Shortcodes and theme functions for testimonials count, form, and links summary
152
- * Use any post types for testimonials
153
- * User submitted testimonials
154
-
155
- **[Buy Testimonials Widget Premium](http://aihr.us/downloads/best-wordpress-testimonials-plugin-testimonials-premium/)** plugin for WordPress.
156
-
157
- = Testimonials Widget Premium Doesn't Work For You? =
158
-
159
- No problem, get a 100% refund and keep the software. Your license for support and updates will be revoked though.
160
-
161
- = Shortcode Examples =
162
-
163
- Read [EXAMPLES](https://github.com/michael-cannon/testimonials-widget/blob/master/EXAMPLES.md).
164
-
165
- = Shortcode and Widget Options =
166
-
167
- Please keep in mind that inheritance affects options. This means that changes made to Testimonials > Settings will not affect current widget instance options. You must change the widget instance manually. However, if you create a new widget instance, then the global settings will apply.
168
-
169
- Further, global settings are the baseline for shortcodes. If you want to alter the shortcode appearance, then alter the shortcode options directly.
170
-
171
- Details on the Shortcode Attributes tab at WordPress Admin > Testimonials > Settings.
172
-
173
- = Testimonials Widget Migration Helpers =
174
-
175
- * Testimonials Widget pre 2.0.0 - Install and activate Testimonials Widget 2.19.0 before installing the latest Testimonials Widget for automatic upgrading.
176
- * [GC Testimonials](http://wordpress.org/plugins/gc-testimonials-to-testimonials/)
177
- * [Testimonials by WooThemes](http://wordpress.org/plugins/wootheme-testimonials-to-testimonials/)
178
-
179
-
180
- == Installation ==
181
-
182
- = Requirements =
183
-
184
- * PHP 5.3+ [Read notice](https://aihrus.zendesk.com/entries/30678006) – Since 2.16.0
185
- * WordPress 3.6+
186
- * [jQuery 1.10+](https://aihrus.zendesk.com/entries/23693363)
187
-
188
- = Install Methods =
189
-
190
- * Through WordPress Admin > Plugins > Add New, Search for "Testimonials Widget"
191
- * Find "Testimonials Widget"
192
- * Click "Install Now" of "Testimonials Widget"
193
- * Download [`testimonials-widget.zip`](http://downloads.wordpress.org/plugin/testimonials-widget.zip) locally
194
- * Through WordPress Admin > Plugins > Add New
195
- * Click Upload
196
- * "Choose File" `testimonials-widget.zip`
197
- * Click "Install Now"
198
- * Download and unzip [`testimonials-widget.zip`](http://downloads.wordpress.org/plugin/testimonials-widget.zip) locally
199
- * Using FTP, upload directory `testimonials-widget` to your website's `/wp-content/plugins/` directory
200
-
201
- = Activation =
202
-
203
- * Click the "Activate" link for "Testimonials Widget" at WordPress Admin > Plugins
204
-
205
- = Usage =
206
-
207
- 1. Watch [Testimonial Widget](https://www.youtube.com/watch?v=zDz1igmRK2g)
208
- 1. Read [How do I create a testimonial record?](https://aihrus.zendesk.com/entries/30602506)
209
- 1. Add and manage testimonials through the **Testimonials Widget** menu in the WordPress admin area
210
- 1. To display testimonials as a widget, go to the **Appearance** > **Widgets** menu and drag the **Testimonials Slider** widget into the desired widget area. Then configure the widget to select options and display as desired.
211
- 1. Use the following shortcodes to display testimonials on a page, post, etc.
212
- * `[testimonials]` - Testimonials listings with paging
213
- * `[testimonials_archives]` - A monthly archive of your site's testimonials
214
- * `[testimonials_categories]` - A list or dropdown of testimonials' categories
215
- * `[testimonials_examples]` - Displays examples of commonly used testimonials' shortcodes with attributes
216
- * `[testimonials_options]` - Displays summary of testimonials' settings for use with shortcodes and theme functions
217
- * `[testimonials_recent]` - Your site's most recent testimonials
218
- * `[testimonials_slider]` - Displays rotating testimonials or statically
219
- * `[testimonials_tag_cloud]` - A cloud of your most used testimonials' tags
220
- 1. Read [theme functions usage](https://aihrus.zendesk.com/entries/23702878) for using the following theme helpers.
221
- * `<?php echo testimonials(); // Testimonials listing with paging ?>`
222
- * `<?php echo testimonials_archives(); // A monthly archive of your site's testimonials ?>`
223
- * `<?php echo testimonials_categories(); // A list or dropdown of testimonials' categories ?>`
224
- * `<?php echo testimonials_examples(); // Displays examples of commonly used testimonials' shortcodes with attributes ?>`
225
- * `<?php echo testimonials_options(); // Displays summary of testimonials' settings for use with shortcodes and theme functions ?>`
226
- * `<?php echo testimonials_recent(); // Your site's most recent testimonials ?>`
227
- * `<?php echo testimonials_slider(); // Displays rotating testimonials or statically ?>`
228
- * `<?php echo testimonials_tag_cloud(); // A cloud of your most used testimonials' tags ?>`
229
- 1. See the **Shortcode and Widget Options** section for configuring shortcode and theme function attributes.
230
-
231
- = Tutorials =
232
-
233
- * [Adding or Editing Testimonial Widget on Your WordPress Website](https://www.youtube.com/watch?v=YaXCJppYOUM)
234
- * [Adding Rotating Testimonials to WordPress Tutorial](https://www.youtube.com/watch?v=QoFCZgLAUSE)
235
- * [Testimonials Widget - WordPress Training Video](https://www.youtube.com/watch?v=ybV5mKZlegA)
236
- * [Testimonials Widget for WordPress](https://www.youtube.com/watch?v=LqZ-vcZD8E0)
237
- * [WordPress Testimonial Plugin Update](https://www.youtube.com/watch?v=b81oz7k1wbM)
238
-
239
- = Upgrading =
240
-
241
- * Through WordPress
242
- * Via WordPress Admin > Dashboard > Updates, click "Check Again"
243
- * Select plugins for update, click "Update Plugins"
244
- * Using FTP
245
- * Download and unzip [`testimonials-widget.zip`](http://downloads.wordpress.org/plugin/testimonials-widget.zip) locally
246
- * Upload directory `testimonials-widget` to your website's `/wp-content/plugins/` directory
247
- * Be sure to overwrite your existing `testimonials-widget` folder contents
248
-
249
- = Deactivation =
250
-
251
- * Click the "Deactivate" link for "Testimonials Widget" at WordPress Admin > Plugins
252
-
253
- = Deletion =
254
-
255
- * Click the "Delete" link for "Testimonials Widget" at WordPress Admin > Plugins
256
- * Click the "Yes, Delete these files and data" button to confirm "Testimonials Widget" plugin removal
257
-
258
-
259
- == Frequently Asked Questions ==
260
-
261
- = Testimonials Widget 3.0 Upgrading =
262
-
263
- This is a major overhaul *without* backwards compliance of over 80 changes. Please read the [Testimonials Widget 3.0 and Testimonials Widget Premium 2.0 Upgrade Notice](https://aihrus.zendesk.com/entries/52514055) for more help.
264
-
265
- = Most Common Issues =
266
-
267
- * Got `Parse error: syntax error, unexpected T_STATIC…`? See [Most Aihrus Plugins Require PHP 5.3+](https://aihrus.zendesk.com/entries/30678006)
268
- * Shortcode not working? Make sure your theme isn't using same shortcode.
269
- * [404 - Page not found](https://aihrus.zendesk.com/entries/23679301)
270
- * [Add testimonials using Gravity Forms](http://webtrainingwheels.com/how-to-collect-user-submitted-testimonials-wordpress/)
271
- * [Change styling or debug CSS](https://aihrus.zendesk.com/entries/24910733)
272
- * [Customize bxSlider](http://bxslider.com/examples)
273
- * [Debug theme and plugin conflicts](https://aihrus.zendesk.com/entries/25119302)
274
- * [How do I create a testimonial record?](https://aihrus.zendesk.com/entries/30602506)
275
- * [How do I reset testimonials?](https://aihrus.zendesk.com/entries/30746533)
276
- * [How to change testimonials layout](https://aihrus.zendesk.com/entries/38055707)
277
- * [My options don't work](https://aihrus.zendesk.com/entries/30746533)
278
- * [Pagination is broken](https://aihrus.zendesk.com/entries/23693513)
279
- * [Test Review schema output](http://www.google.com/webmasters/tools/richsnippets)
280
- * [Testimonials slider doesn't rotate](https://aihrus.zendesk.com/entries/23693363)
281
-
282
- = Still Stuck or Want Something Done? Get Support! =
283
-
284
- 1. [Knowledge Base](https://aihrus.zendesk.com/categories/20104507) - read and comment upon 125+ frequently asked questions
285
- 1. [Open Issues](https://github.com/michael-cannon/testimonials-widget/issues) - review and submit bug reports and enhancement requests
286
- 1. [Support on WordPress](http://wordpress.org/support/plugin/testimonials-widget) - ask questions and review responses
287
- 1. [Contribute Code](https://github.com/michael-cannon/testimonials-widget/blob/master/CONTRIBUTING.md)
288
- 1. [Beta Testers Needed](http://aihr.us/become-beta-tester/) - provide feedback and direction to plugin development
289
- 1. [Old Plugin Versions](http://wordpress.org/plugins/testimonials-widget/developers/)
290
-
291
-
292
- == Screenshots ==
293
-
294
- 1. Testimonials Slider widget in use
295
- 2. [testimonials_slider] demo
296
- 3. [testimonials] demo
297
- 4. [testimonials_archives] demo
298
- 5. [testimonials_categories] demo
299
- 6. [testimonials_tag_cloud] demo
300
- 7. [testimonials_recent] demo
301
- 8. Single page testimonial view
302
- 9. Testimonials edit page
303
- 10. Testimonials Settings page
304
- 11. Testimonials Categories page
305
- 12. Poedit Catalog properties
306
- 13. Using Review schema data structures
307
-
308
- [gallery]
309
-
310
-
311
- == Changelog ==
312
-
313
- Read [CHANGELOG](https://github.com/michael-cannon/testimonials-widget/blob/master/CHANGELOG.md).
314
-
315
-
316
- == Upgrade Notice ==
317
-
318
- = 3.0.0 =
319
-
320
- This is a major overhaul *without* backwards compliance of over 80 changes. Please read the [Testimonials Widget 3.0 and Testimonials Widget Premium 2.0 Upgrade Notice](https://aihrus.zendesk.com/entries/52514055) for more help.
321
-
322
- If you use custom CSS, actions, or filters to modify Testimonials Widget and Testimonials Widget Premium actions or output, this upgrade will not be compatible with those modifications until corrections are made.
323
-
324
- = Older Versions =
325
-
326
- Read [UPGRADING](https://github.com/michael-cannon/testimonials-widget/blob/master/UPGRADING.md).
327
-
328
-
329
- == API ==
330
-
331
- * Read [API](https://github.com/michael-cannon/testimonials-widget/blob/master/API.md).
332
-
333
-
334
- == Conflicts ==
335
-
336
- * [ReOrder Post Within Categories](http://wordpress.org/plugins/reorder-post-within-categories/) – Uses custom ordering table
337
-
338
-
339
- == Deprecation Notices ==
340
-
341
- Read [DEPRECATED](https://github.com/michael-cannon/testimonials-widget/blob/master/DEPRECATED.md).
342
-
343
-
344
- == Localization ==
345
-
346
- * Dutch by Bjorn Robijns
347
- * [Hebrew by Ahrale](http://atar4u.com/)
348
-
349
- You can translate this plugin into your own language if it's not done so already. The localization file `testimonials-widget.pot` can be found in the `languages` folder of this plugin. After translation, please [send the localized file](http://aihr.us/contact-aihrus/) for plugin inclusion.
350
-
351
- **[How do I localize?](https://aihrus.zendesk.com/entries/23691557)**
352
-
353
-
354
- == Notes ==
355
-
356
- * Default and Gravatar image size is based upon Thumbnail size in Media Settings
357
- * Review schema [structured data testing tool](http://www.google.com/webmasters/tools/richsnippets)
358
- * When plugin is uninstalled, all data and settings are deleted if "Remove Plugin Data on Deletion" is checked in Settings
359
-
360
-
361
- == Recommendation ==
362
-
363
- * Use Jonathan Lundström's [Drag & Drop Featured Image](http://wordpress.org/extend/plugins/drag-drop-featured-image/) to speed up loading of the featured image
364
-
365
-
366
- == Thank You ==
367
-
368
- A big, special thank you to [Joe Weber](https://plus.google.com/100063271269277312276/posts) of [12 Star Creative](http://www.12starcreative.com/) for creating the Testimonials Widget banner. It's fantastic.
369
-
370
- A cool thanks to RedRokk Library for the [redrokk_metabox_class](https://gist.github.com/1880770). It makes configuring meta boxes for your posts, pages or custom post types a snap.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/templates/span-author-email.php DELETED
@@ -1,9 +0,0 @@
1
- <?php
2
- global $tw_template_args;
3
-
4
- $testimonial = $tw_template_args['testimonial'];
5
-
6
- $email = $testimonial['testimonial_email'];
7
- $author = empty( $testimonial['testimonial_author'] ) ? $testimonial['testimonial_source'] : $testimonial['testimonial_author'];
8
- ?>
9
- <span class="author"><a href="mailto:<?php echo $email; ?>"><?php echo $author; ?></a></span>
 
 
 
 
 
 
 
 
 
trunk/templates/span-author-url.php DELETED
@@ -1,8 +0,0 @@
1
- <?php
2
- global $tw_template_args;
3
-
4
- $testimonial = $tw_template_args['testimonial'];
5
-
6
- $author = empty( $testimonial['testimonial_author'] ) ? $testimonial['testimonial_source'] : $testimonial['testimonial_author'];
7
- ?>
8
- <span class="author"><a href="<?php echo $testimonial['testimonial_url']; ?>" rel="nofollow"><?php echo $author; ?></a></span>
 
 
 
 
 
 
 
 
trunk/templates/span-author.php DELETED
@@ -1,8 +0,0 @@
1
- <?php
2
- global $tw_template_args;
3
-
4
- $testimonial = $tw_template_args['testimonial'];
5
-
6
- $author = empty( $testimonial['testimonial_author'] ) ? $testimonial['testimonial_source'] : $testimonial['testimonial_author'];
7
- ?>
8
- <span class="author"><?php echo $author; ?></span>
 
 
 
 
 
 
 
 
trunk/templates/span-company-url.php DELETED
@@ -1,6 +0,0 @@
1
- <?php
2
- global $tw_template_args;
3
-
4
- $testimonial = $tw_template_args['testimonial'];
5
- ?>
6
- <span class="company"><a href="<?php echo $testimonial['testimonial_url']; ?>" rel="nofollow"><?php echo $testimonial['testimonial_company']; ?></a></span>
 
 
 
 
 
 
trunk/templates/span-company.php DELETED
@@ -1,6 +0,0 @@
1
- <?php
2
- global $tw_template_args;
3
-
4
- $testimonial = $tw_template_args['testimonial'];
5
- ?>
6
- <span class="company"><?php echo $testimonial['testimonial_company']; ?></span>
 
 
 
 
 
 
trunk/templates/span-email.php DELETED
@@ -1,9 +0,0 @@
1
- <?php
2
- global $tw_template_args;
3
-
4
- $testimonial = $tw_template_args['testimonial'];
5
-
6
- $email = $testimonial['testimonial_email'];
7
- $email = make_clickable( $email );
8
- ?>
9
- <span class="email"><?php echo $email; ?></span>
 
 
 
 
 
 
 
 
 
trunk/templates/span-job-title.php DELETED
@@ -1,6 +0,0 @@
1
- <?php
2
- global $tw_template_args;
3
-
4
- $testimonial = $tw_template_args['testimonial'];
5
- ?>
6
- <span class="job-title"><?php echo $testimonial['testimonial_title']; ?></span>
 
 
 
 
 
 
trunk/templates/span-join-company.php DELETED
@@ -1,4 +0,0 @@
1
- <?php
2
- global $tw_template_args;
3
- ?>
4
- <span class="join"></span>
 
 
 
 
trunk/templates/span-join-location.php DELETED
@@ -1,4 +0,0 @@
1
- <?php
2
- global $tw_template_args;
3
- ?>
4
- <span class="join-location"></span>
 
 
 
 
trunk/templates/span-join-title.php DELETED
@@ -1,4 +0,0 @@
1
- <?php
2
- global $tw_template_args;
3
- ?>
4
- <span class="join-title"></span>
 
 
 
 
trunk/templates/span-location.php DELETED
@@ -1,6 +0,0 @@
1
- <?php
2
- global $tw_template_args;
3
-
4
- $testimonial = $tw_template_args['testimonial'];
5
- ?>
6
- <span class="location"><?php echo $testimonial['testimonial_location']; ?></span>
 
 
 
 
 
 
trunk/templates/span-url.php DELETED
@@ -1,9 +0,0 @@
1
- <?php
2
- global $tw_template_args;
3
-
4
- $testimonial = $tw_template_args['testimonial'];
5
-
6
- $url = $testimonial['testimonial_url'];
7
- $url = make_clickable( $url );
8
- ?>
9
- <span class="url"><?php echo $url; ?></span>
 
 
 
 
 
 
 
 
 
trunk/templates/testimonial-bottom.php DELETED
@@ -1,6 +0,0 @@
1
- <?php
2
- global $tw_template_args;
3
-
4
- $atts = $tw_template_args['atts'];
5
- ?>
6
- <div class="bottom_text"><?php echo $atts['bottom_text']; ?></div>
 
 
 
 
 
 
trunk/templates/testimonial-cite.php DELETED
@@ -1,78 +0,0 @@
1
- <?php
2
- global $tw_template_args;
3
-
4
- $atts = $tw_template_args['atts'];
5
- $testimonial = $tw_template_args['testimonial'];
6
-
7
- $do_company = ! $atts['hide_company'] && ! empty( $testimonial['testimonial_company'] );
8
- $do_email = ! $atts['hide_email'] && ! empty( $testimonial['testimonial_email'] ) && is_email( $testimonial['testimonial_email'] );
9
- $do_location = ! $atts['hide_location'] && ! empty( $testimonial['testimonial_location'] );
10
- $do_source = ! $atts['hide_source'] && ! empty( $testimonial['testimonial_source'] );
11
- $do_title = ! $atts['hide_title'] && ! empty( $testimonial['testimonial_title'] );
12
- $do_url = ! $atts['hide_url'] && ! empty( $testimonial['testimonial_url'] );
13
-
14
- $use_quote_tag = $atts['use_quote_tag'];
15
-
16
- $cite = '';
17
- $done_url = false;
18
-
19
- if ( $do_source && $do_email ) {
20
- $cite .= Testimonials_Widget::get_template_part( 'span', 'author-email' );
21
- } elseif ( $do_source && ! $do_company && $do_url ) {
22
- $done_url = true;
23
-
24
- $cite .= Testimonials_Widget::get_template_part( 'span', 'author-url' );
25
- } elseif ( $do_source ) {
26
- $cite .= Testimonials_Widget::get_template_part( 'span', 'author' );
27
- } elseif ( $do_email ) {
28
- $cite .= Testimonials_Widget::get_template_part( 'span', 'email' );
29
- }
30
-
31
- if ( $do_title && $cite ) {
32
- $cite .= Testimonials_Widget::get_template_part( 'span', 'join-title' );
33
- }
34
-
35
- if ( $do_title ) {
36
- $cite .= Testimonials_Widget::get_template_part( 'span', 'job-title' );
37
- }
38
-
39
- if ( ( $do_company || ( $do_url && ! $done_url ) ) && $cite ) {
40
- $cite .= Testimonials_Widget::get_template_part( 'span', 'join-company' );
41
- }
42
-
43
- if ( $do_company && $do_url ) {
44
- $cite .= Testimonials_Widget::get_template_part( 'span', 'company-url' );
45
- } elseif ( $do_company ) {
46
- $cite .= Testimonials_Widget::get_template_part( 'span', 'company' );
47
- } elseif ( $do_url && ! $done_url ) {
48
- $cite .= Testimonials_Widget::get_template_part( 'span', 'url' );
49
- }
50
-
51
- if ( $do_location && $cite ) {
52
- $cite .= Testimonials_Widget::get_template_part( 'span', 'join-location' );
53
- }
54
-
55
- if ( $do_location ) {
56
- $cite .= Testimonials_Widget::get_template_part( 'span', 'location' );
57
- }
58
-
59
- if ( ! empty( $cite ) ) {
60
- $cite = preg_replace( "#\r|\n#", '', $cite );
61
- }
62
-
63
- $cite = apply_filters( 'tw_cite_html', $cite, $testimonial, $atts );
64
-
65
- if ( empty( $cite ) ) {
66
- return;
67
- }
68
-
69
- if ( ! $use_quote_tag ) {
70
- ?>
71
- <div class="credit"><?php echo $cite; ?></div>
72
- <?php
73
- } else {
74
- ?>
75
- <cite><?php echo $cite; ?></cite>
76
- <?php
77
- }
78
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/templates/testimonial-close.php DELETED
@@ -1,4 +0,0 @@
1
- <?php
2
- global $tw_template_args;
3
- ?>
4
- </div>
 
 
 
 
trunk/templates/testimonial-content.php DELETED
@@ -1,35 +0,0 @@
1
- <?php
2
- global $tw_template_args;
3
-
4
- $atts = $tw_template_args['atts'];
5
- $testimonial = $tw_template_args['testimonial'];
6
- $widget_number = $tw_template_args['widget_number'];
7
-
8
- $char_limit = $atts['char_limit'];
9
- $content_more = apply_filters( 'tw_content_more', esc_html__( '…', 'testimonials-widget' ) );
10
- $content_more .= Testimonials_Widget::$tag_close_quote;
11
- $do_content = ! $atts['hide_content'] && ! empty( $testimonial['testimonial_content'] );
12
- $use_quote_tag = $atts['use_quote_tag'];
13
-
14
- if ( $do_content ) {
15
- $content = $testimonial['testimonial_content'];
16
- $content = Testimonials_Widget::format_content( $content, $widget_number, $atts );
17
- if ( $char_limit ) {
18
- $content = Testimonials_Widget::testimonials_truncate( $content, $char_limit, $content_more );
19
- $content = force_balance_tags( $content );
20
- }
21
-
22
- $content = apply_filters( 'tw_content', $content, $widget_number, $testimonial, $atts );
23
- $content = make_clickable( $content );
24
-
25
- if ( ! $use_quote_tag ) {
26
- ?>
27
- <blockquote><?php echo $content; ?></blockquote>
28
- <?php
29
- } else {
30
- ?>
31
- <q><?php echo $content; ?></q>
32
- <?php
33
- }
34
- }
35
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/templates/testimonial-extra.php DELETED
@@ -1,6 +0,0 @@
1
- <?php
2
- global $tw_template_args;
3
-
4
- $testimonial = $tw_template_args['testimonial'];
5
- ?>
6
- <div class="extra"><?php echo $testimonial['testimonial_extra']; ?></div>
 
 
 
 
 
 
trunk/templates/testimonial-image.php DELETED
@@ -1,6 +0,0 @@
1
- <?php
2
- global $tw_template_args;
3
-
4
- $testimonial = $tw_template_args['testimonial'];
5
- ?>
6
- <span class="image"><?php echo $testimonial['testimonial_image']; ?></span>
 
 
 
 
 
 
trunk/templates/testimonial-open.php DELETED
@@ -1,41 +0,0 @@
1
- <?php
2
- global $tw_template_args;
3
-
4
- $atts = $tw_template_args['atts'];
5
- $is_first = $tw_template_args['is_first'];
6
- $is_list = $tw_template_args['is_list'];
7
- $testimonial = $tw_template_args['testimonial'];
8
- $widget_number = $tw_template_args['widget_number'];
9
-
10
- $class = 'testimonials-widget-testimonial';
11
- if ( is_single() && empty( $widget_number ) ) {
12
- $class .= ' single';
13
- } elseif ( $is_list ) {
14
- $class .= ' list';
15
- } else {
16
- // widget display
17
- $refresh_interval = $atts['refresh_interval'];
18
- if ( ! $is_first && ! empty( $refresh_interval ) && ! in_array( $atts['transition_mode'], array( 'horizontal', 'vertical' ) ) ) {
19
- $class .= ' display-none';
20
- }
21
- }
22
-
23
- if ( $atts['keep_whitespace'] ) {
24
- $class .= ' whitespace';
25
- }
26
-
27
- $post_id = $testimonial['post_id'];
28
- if ( ! empty( $post_id ) ) {
29
- $class = join( ' ', get_post_class( $class, $post_id ) );
30
- } else {
31
- $class = 'testimonials-widget type-testimonials-widget status-publish hentry ' . $class;
32
- }
33
-
34
- if ( $atts['remove_hentry'] ) {
35
- $class = str_replace( ' hentry', '', $class );
36
- }
37
-
38
- $class = apply_filters( 'tw_get_testimonial_html_class', $class, $testimonial, $atts, $is_list, $is_first, $widget_number );
39
- ?>
40
- <div class="<?php echo $class; ?>">
41
- <!-- <?php echo Testimonials_Widget::ID; ?>:<?php echo $post_id; ?>: -->
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/templates/testimonials-archives.php DELETED
@@ -1,42 +0,0 @@
1
- <?php
2
- global $tw_template_args;
3
-
4
- $atts = $tw_template_args['atts'];
5
-
6
- $c = ! empty( $atts['count'] ) ? '1' : '0';
7
- $d = ! empty( $atts['dropdown'] ) ? '1' : '0';
8
-
9
- add_filter( 'getarchives_where', array( Testimonials_Widget, 'getarchives_where' ), 10, 2 );
10
- add_filter( 'get_archives_link', array( Testimonials_Widget, 'get_archives_link' ), 10, 1 );
11
-
12
- if ( $d ) {
13
- ?>
14
- <select name="archive-dropdown" onchange='document.location.href=this.options[this.selectedIndex].value;'>
15
- <option value=""><?php echo esc_attr( __( 'Select Month', 'testimonials-widget' ) ); ?></option>
16
- <?php
17
- $args = array(
18
- 'type' => 'monthly',
19
- 'format' => 'option',
20
- 'show_post_count' => $c,
21
- );
22
- wp_get_archives( apply_filters( 'tw_archives_dropdown_args', $args ) );
23
- ?>
24
- </select>
25
- <?php
26
- } else {
27
- ?>
28
- <ul>
29
- <?php
30
- $args = array(
31
- 'type' => 'monthly',
32
- 'show_post_count' => $c,
33
- );
34
- wp_get_archives( apply_filters( 'tw_archives_args', $args ) );
35
- ?>
36
- </ul>
37
- <?php
38
- }
39
-
40
- remove_filter( 'get_archives_link', array( Testimonials_Widget, 'get_archives_link' ), 10, 1 );
41
- remove_filter( 'getarchives_where', array( Testimonials_Widget, 'getarchives_where' ), 10, 2 );
42
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/templates/testimonials-categories.php DELETED
@@ -1,50 +0,0 @@
1
- <?php
2
- global $tw_template_args;
3
-
4
- $atts = $tw_template_args['atts'];
5
-
6
- $c = ! empty( $atts['count'] ) ? '1' : '0';
7
- $d = ! empty( $atts['dropdown'] ) ? '1' : '0';
8
- $h = ! empty( $atts['hierarchical'] ) ? '1' : '0';
9
-
10
- $cat_args = array(
11
- 'orderby' => 'name',
12
- 'show_count' => $c,
13
- 'hierarchical' => $h,
14
- );
15
-
16
- $use_cpt_taxonomy = tw_get_option( 'use_cpt_taxonomy', false );
17
- if ( $use_cpt_taxonomy ) {
18
- $cat_args['taxonomy'] = Testimonials_Widget::$cpt_category;
19
- }
20
-
21
- if ( $d ) {
22
- $cat_args['show_option_none'] = esc_html__( 'Select Testimonials Category', 'testimonials-widget' );
23
-
24
- wp_dropdown_categories( apply_filters( 'tw_categories_dropdown_args', $cat_args ) );
25
- ?>
26
- <script type='text/javascript'>
27
- /* <![CDATA[ */
28
- var dropdown = document.getElementById("cat");
29
- function onCatChange() {
30
- if ( dropdown.options[dropdown.selectedIndex].value > 0 ) {
31
- location.href = "<?php echo home_url(); ?>/?cat="+dropdown.options[dropdown.selectedIndex].value;
32
- }
33
- }
34
- dropdown.onchange = onCatChange;
35
- /* ]]> */
36
- </script>
37
- <?php
38
- } else {
39
- ?>
40
- <ul>
41
- <?php
42
- $cat_args['title_li'] = '';
43
-
44
- wp_list_categories( apply_filters( 'tw_categories_args', $cat_args ) );
45
- ?>
46
- </ul>
47
- <?php
48
- }
49
-
50
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/templates/testimonials-close.php DELETED
@@ -1,4 +0,0 @@
1
- <?php
2
- global $tw_template_args;
3
- ?>
4
- </div>
 
 
 
 
trunk/templates/testimonials-open.php DELETED
@@ -1,18 +0,0 @@
1
- <?php
2
- global $tw_template_args;
3
-
4
- $is_list = $tw_template_args['is_list'];
5
- $widget_number = $tw_template_args['widget_number'];
6
-
7
- $id = Testimonials_Widget::ID;
8
- if ( is_null( $widget_number ) ) {
9
- $class = $id;
10
- if ( $is_list ) {
11
- $class .= ' listing';
12
- }
13
- } else {
14
- $id_base = $id . $widget_number;
15
- $class = $id . ' ' . $id_base;
16
- }
17
- ?>
18
- <div class="<?php echo $class; ?>">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/templates/testimonials-paging.php DELETED
@@ -1,41 +0,0 @@
1
- <?php
2
- global $tw_template_args;
3
-
4
- $atts = $tw_template_args['atts'];
5
- $prepend = $tw_template_args['prepend'];
6
-
7
- if ( is_home() || 1 === Testimonials_Widget::$max_num_pages ) {
8
- return;
9
- }
10
-
11
- $class = ( $prepend ) ? 'prepend' : 'append';
12
- $paged = ( $atts['paged'] ) ? $atts['paged'] : 1;
13
-
14
- if ( ! function_exists( 'wp_pagenavi' ) ) {
15
- $paging = '<div class="alignleft">';
16
-
17
- if ( 1 < $paged ) {
18
- $laquo = apply_filters( 'tw_previous_posts_link_text', esc_html__( '&laquo;', 'testimonials-widget' ) );
19
- $paging .= get_previous_posts_link( $laquo, $paged );
20
- }
21
-
22
- $paging .= '</div>';
23
- $paging .= '<div class="alignright">';
24
- if ( $paged != Testimonials_Widget::$max_num_pages ) {
25
- $raquo = apply_filters( 'tw_next_posts_link_text', esc_html__( '&raquo;', 'testimonials-widget' ) );
26
- $paging .= get_next_posts_link( $raquo, Testimonials_Widget::$max_num_pages );
27
- }
28
-
29
- $paging .= '</div>';
30
- } else {
31
- $args = array(
32
- 'echo' => false,
33
- 'query' => Testimonials_Widget::$wp_query,
34
- );
35
- $args = apply_filters( 'tw_wp_pagenavi', $args );
36
-
37
- $paging = wp_pagenavi( $args );
38
- }
39
-
40
- ?>
41
- <div class="paging <?php echo $class; ?>"><?php echo $paging; ?></div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/templates/testimonials-recent.php DELETED
@@ -1,40 +0,0 @@
1
- <?php
2
- global $tw_template_args;
3
-
4
- $atts = $tw_template_args['atts'];
5
-
6
- $number = $atts['number'];
7
- $show_date = $atts['show_date'];
8
-
9
- $args = array(
10
- 'posts_per_page' => $number,
11
- 'no_found_rows' => true,
12
- 'post_status' => 'publish',
13
- 'ignore_sticky_posts' => true,
14
- 'post_type' => Testimonials_Widget::PT,
15
- );
16
- $args = apply_filters( 'tw_recent_testimonials_args', $args );
17
-
18
- $r = new WP_Query( $args );
19
- if ( $r->have_posts() ) {
20
- echo '<ul>';
21
- while ( $r->have_posts() ) {
22
- $r->the_post();
23
- echo '<li>';
24
-
25
- $title = get_the_title() ? get_the_title() : get_the_ID();
26
- echo '<a href="' . get_permalink() . '">' . $title . '</a>';
27
-
28
- if ( $show_date ) {
29
- echo ' <span class="post-date">' . get_the_date() . '</span>';
30
- }
31
-
32
- echo '</li>';
33
- }
34
-
35
- echo '</ul>';
36
- }
37
-
38
- // Reset the global $the_post as this query will have stomped on it
39
- wp_reset_postdata();
40
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/templates/testimonials-tag-cloud.php DELETED
@@ -1,13 +0,0 @@
1
- <?php
2
- global $tw_template_args;
3
-
4
- $atts = $tw_template_args['atts'];
5
- ?>
6
- <div class="tagcloud">
7
- <?php
8
- $args = array(
9
- 'taxonomy' => $atts['taxonomy'],
10
- );
11
- wp_tag_cloud( apply_filters( 'tw_tag_cloud_args', $args ) );
12
- ?>
13
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/testimonials-widget.php DELETED
@@ -1,201 +0,0 @@
1
- <?php
2
- /**
3
- * Plugin Name: Testimonials Widget
4
- * Plugin URI: http://wordpress.org/plugins/testimonials-widget/
5
- * Description: Easily add social proofing to your website with Testimonials Widget. List or slide reviews via functions, shortcodes, or widgets.
6
- * lets you socially randomly slide or list selected portfolios, quotes, reviews, or text with images or videos on your WordPress site.
7
- * Version: 3.0.0
8
- * Author: Michael Cannon
9
- * Author URI: http://aihr.us/resume/
10
- * License: GPLv2 or later
11
- * Text Domain: testimonials-widget
12
- * Domain Path: /languages
13
- */
14
-
15
-
16
- /**
17
- Testimonials Widget
18
- Copyright (C) 2014 Michael Cannon
19
-
20
- This program is free software; you can redistribute it and/or modify
21
- it under the terms of the GNU General Public License as published by
22
- the Free Software Foundation; either version 2 of the License, or
23
- (at your option) any later version.
24
-
25
- This program is distributed in the hope that it will be useful,
26
- but WITHOUT ANY WARRANTY; without even the implied warranty of
27
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
28
- GNU General Public License for more details.
29
-
30
- You should have received a copy of the GNU General Public License along
31
- with this program; if not, write to the Free Software Foundation, Inc.,
32
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
33
- */
34
-
35
- // Exit if accessed directly
36
- if ( ! defined( 'ABSPATH' ) ) {
37
- exit;
38
- }
39
-
40
- if ( ! defined( 'TW_AIHR_VERSION' ) ) {
41
- define( 'TW_AIHR_VERSION', '1.1.5' );
42
- }
43
-
44
- if ( ! defined( 'TW_BASE' ) ) {
45
- define( 'TW_BASE', plugin_basename( __FILE__ ) );
46
- }
47
-
48
- if ( ! defined( 'TW_DIR' ) ) {
49
- define( 'TW_DIR', plugin_dir_path( __FILE__ ) );
50
- }
51
-
52
- if ( ! defined( 'TW_DIR_INC' ) ) {
53
- define( 'TW_DIR_INC', TW_DIR . 'includes/' );
54
- }
55
-
56
- if ( ! defined( 'TW_DIR_LIB' ) ) {
57
- define( 'TW_DIR_LIB', TW_DIR_INC . 'libraries/' );
58
- }
59
-
60
- if ( ! defined( 'TW_NAME' ) ) {
61
- define( 'TW_NAME', 'Testimonials Widget' );
62
- }
63
-
64
- if ( ! defined( 'TW_PREMIUM_LINK' ) ) {
65
- define( 'TW_PREMIUM_LINK', '<a href="http://aihr.us/downloads/testimonials-widget-premium-wordpress-plugin/">Buy Premium</a>' );
66
- }
67
-
68
- if ( ! defined( 'TW_VERSION' ) ) {
69
- define( 'TW_VERSION', '3.0.0' );
70
- }
71
-
72
- require_once TW_DIR_INC . 'requirements.php';
73
-
74
- global $tw_activated;
75
-
76
- $tw_activated = true;
77
- if ( ! tw_requirements_check() ) {
78
- $tw_activated = false;
79
-
80
- return false;
81
- }
82
-
83
- require_once TW_DIR_INC . 'class-testimonials-widget.php';
84
-
85
- add_action( 'plugins_loaded', 'testimonialswidget_init', 99 );
86
-
87
-
88
- /**
89
- *
90
- *
91
- * @SuppressWarnings(PHPMD.LongVariable)
92
- * @SuppressWarnings(PHPMD.UnusedLocalVariable)
93
- */
94
- if ( ! function_exists( 'testimonialswidget_init' ) ) {
95
- function testimonialswidget_init() {
96
- if ( Testimonials_Widget::version_check() ) {
97
- global $Testimonials_Widget_Settings;
98
- if ( is_null( $Testimonials_Widget_Settings ) ) {
99
- $Testimonials_Widget_Settings = new Testimonials_Widget_Settings();
100
- }
101
-
102
- global $Testimonials_Widget;
103
- if ( is_null( $Testimonials_Widget ) ) {
104
- $Testimonials_Widget = new Testimonials_Widget();
105
- }
106
- }
107
- }
108
- }
109
-
110
-
111
- register_activation_hook( __FILE__, array( 'Testimonials_Widget', 'activation' ) );
112
- register_deactivation_hook( __FILE__, array( 'Testimonials_Widget', 'deactivation' ) );
113
- register_uninstall_hook( __FILE__, array( 'Testimonials_Widget', 'uninstall' ) );
114
-
115
-
116
- if ( ! function_exists( 'testimonials' ) ) {
117
- function testimonials( $atts = array() ) {
118
- global $Testimonials_Widget;
119
-
120
- return $Testimonials_Widget->testimonials( $atts );
121
- }
122
- }
123
-
124
-
125
- if ( ! function_exists( 'testimonials_archives' ) ) {
126
- function testimonials_archives( $atts = array() ) {
127
- global $Testimonials_Widget;
128
-
129
- return $Testimonials_Widget->testimonials_archives( $atts );
130
- }
131
- }
132
-
133
-
134
- if ( ! function_exists( 'testimonials_categories' ) ) {
135
- function testimonials_categories( $atts = array() ) {
136
- global $Testimonials_Widget;
137
-
138
- return $Testimonials_Widget->testimonials_categories( $atts );
139
- }
140
- }
141
-
142
-
143
- if ( ! function_exists( 'testimonials_recent' ) ) {
144
- function testimonials_recent( $atts = array() ) {
145
- global $Testimonials_Widget;
146
-
147
- return $Testimonials_Widget->testimonials_recent( $atts );
148
- }
149
- }
150
-
151
-
152
- if ( ! function_exists( 'testimonials_slider' ) ) {
153
- function testimonials_slider( $atts = array(), $widget_number = null ) {
154
- global $Testimonials_Widget;
155
-
156
- return $Testimonials_Widget->testimonials_slider( $atts, $widget_number );
157
- }
158
- }
159
-
160
-
161
- if ( ! function_exists( 'testimonials_tag_cloud' ) ) {
162
- function testimonials_tag_cloud( $atts = array() ) {
163
- global $Testimonials_Widget;
164
-
165
- return $Testimonials_Widget->testimonials_tag_cloud( $atts );
166
- }
167
- }
168
-
169
-
170
- if ( ! function_exists( 'testimonials_examples' ) ) {
171
- function testimonials_examples( $atts = array() ) {
172
- global $Testimonials_Widget;
173
-
174
- return $Testimonials_Widget->testimonials_examples( $atts );
175
- }
176
- }
177
-
178
-
179
- if ( ! function_exists( 'testimonials_options' ) ) {
180
- function testimonials_options( $atts = array() ) {
181
- global $Testimonials_Widget;
182
-
183
- return $Testimonials_Widget->testimonials_options( $atts );
184
- }
185
- }
186
-
187
-
188
- if ( ! function_exists( 'testimonialswidget_list' ) ) {
189
- function testimonialswidget_list( $atts = array() ) {
190
- return testimonials( $atts );
191
- }
192
- }
193
-
194
-
195
- if ( ! function_exists( 'testimonialswidget_widget' ) ) {
196
- function testimonialswidget_widget( $atts = array() ) {
197
- return testimonials_slider( $atts );
198
- }
199
- }
200
-
201
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/wpml-config.xml DELETED
@@ -1,20 +0,0 @@
1
- <wpml-config>
2
- <custom-fields>
3
- <custom-field action="copy">testimonials-widget-email</custom-field>
4
- <custom-field action="copy">testimonials-widget-url</custom-field>
5
- <custom-field action="ignore">_testimonials-widget:testimonial_id</custom-field>
6
- <custom-field action="translate">testimonials-widget-author</custom-field>
7
- <custom-field action="translate">testimonials-widget-company</custom-field>
8
- <custom-field action="translate">testimonials-widget-location</custom-field>
9
- <custom-field action="translate">testimonials-widget-title</custom-field>
10
- </custom-fields>
11
- <custom-types>
12
- <custom-type translate="1">testimonials-widget</custom-type>
13
- </custom-types>
14
- <taxonomies>
15
- <taxonomy translate="1">category</taxonomy>
16
- <taxonomy translate="1">post_tag</taxonomy>
17
- <taxonomy translate="1">testimonials-widget-category</taxonomy>
18
- <taxonomy translate="1">testimonials-widget-post_tag</taxonomy>
19
- </taxonomies>
20
- </wpml-config>