acf_addons

Acf_addons.

Defined (1)

The class is defined in the following location(s).

/core/controllers/addons.php  
  1. class acf_addons 
  2.  
  3. var $action; 
  4.  
  5.  
  6. /** 
  7. * __construct 
  8. * @description:  
  9. * @since 3.1.8 
  10. * @created: 23/06/12 
  11. */ 
  12.  
  13. function __construct() 
  14. // actions 
  15. add_action('admin_menu', array($this, 'admin_menu'), 11, 0); 
  16.  
  17.  
  18. /** 
  19. * admin_menu 
  20. * @description:  
  21. * @created: 2/08/12 
  22. */ 
  23.  
  24. function admin_menu() 
  25. // add page 
  26. $page = add_submenu_page('edit.php?post_type=acf', __('Add-ons', 'acf'), __('Add-ons', 'acf'), 'manage_options', 'acf-addons', array($this, 'html')); 
  27.  
  28.  
  29. // actions 
  30. add_action('load-' . $page, array($this, 'load')); 
  31. add_action('admin_print_scripts-' . $page, array($this, 'admin_print_scripts')); 
  32. add_action('admin_print_styles-' . $page, array($this, 'admin_print_styles')); 
  33. add_action('admin_head-' . $page, array($this, 'admin_head')); 
  34.  
  35.  
  36. /** 
  37. * load 
  38. * @description:  
  39. * @since 3.5.2 
  40. * @created: 16/11/12 
  41. * @thanks: Kevin Biloski and Charlie Eriksen via Secunia SVCRP 
  42. */ 
  43.  
  44. function load() 
  45.  
  46.  
  47.  
  48. /** 
  49. * admin_print_scripts 
  50. * @description:  
  51. * @since 3.1.8 
  52. * @created: 23/06/12 
  53. */ 
  54.  
  55. function admin_print_scripts() 
  56.  
  57.  
  58.  
  59. /** 
  60. * admin_print_styles 
  61. * @description:  
  62. * @since 3.1.8 
  63. * @created: 23/06/12 
  64. */ 
  65.  
  66. function admin_print_styles() 
  67. wp_enqueue_style(array( 
  68. 'wp-pointer',  
  69. 'acf-global',  
  70. 'acf',  
  71. )); 
  72.  
  73.  
  74. /** 
  75. * admin_head 
  76. * @description:  
  77. * @since 3.1.8 
  78. * @created: 23/06/12 
  79. */ 
  80.  
  81. function admin_head() 
  82.  
  83.  
  84.  
  85. /** 
  86. * html 
  87. * @description:  
  88. * @since 3.1.8 
  89. * @created: 23/06/12 
  90. */ 
  91.  
  92. function html() 
  93. // vars 
  94. $dir = apply_filters('acf/get_info', 'dir'); 
  95.  
  96.  
  97. $premium = array(); 
  98. $premium[] = array( 
  99. 'title' => __("Repeater Field", 'acf'),  
  100. 'description' => __("Create infinite rows of repeatable data with this versatile interface!", 'acf'),  
  101. 'thumbnail' => $dir . 'images/add-ons/repeater-field-thumb.jpg',  
  102. 'active' => class_exists('acf_field_repeater'),  
  103. 'url' => 'http://www.advancedcustomfields.com/add-ons/repeater-field/' 
  104. ); 
  105. $premium[] = array( 
  106. 'title' => __("Gallery Field", 'acf'),  
  107. 'description' => __("Create image galleries in a simple and intuitive interface!", 'acf'),  
  108. 'thumbnail' => $dir . 'images/add-ons/gallery-field-thumb.jpg',  
  109. 'active' => class_exists('acf_field_gallery'),  
  110. 'url' => 'http://www.advancedcustomfields.com/add-ons/gallery-field/' 
  111. ); 
  112. $premium[] = array( 
  113. 'title' => __("Options Page", 'acf'),  
  114. 'description' => __("Create global data to use throughout your website!", 'acf'),  
  115. 'thumbnail' => $dir . 'images/add-ons/options-page-thumb.jpg',  
  116. 'active' => class_exists('acf_options_page_plugin'),  
  117. 'url' => 'http://www.advancedcustomfields.com/add-ons/options-page/' 
  118. ); 
  119. $premium[] = array( 
  120. 'title' => __("Flexible Content Field", 'acf'),  
  121. 'description' => __("Create unique designs with a flexible content layout manager!", 'acf'),  
  122. 'thumbnail' => $dir . 'images/add-ons/flexible-content-field-thumb.jpg',  
  123. 'active' => class_exists('acf_field_flexible_content'),  
  124. 'url' => 'http://www.advancedcustomfields.com/add-ons/flexible-content-field/' 
  125. ); 
  126.  
  127.  
  128. $free = array(); 
  129. $free[] = array( 
  130. 'title' => __("Gravity Forms Field", 'acf'),  
  131. 'description' => __("Creates a select field populated with Gravity Forms!", 'acf'),  
  132. 'thumbnail' => $dir . 'images/add-ons/gravity-forms-field-thumb.jpg',  
  133. 'active' => class_exists('gravity_forms_field'),  
  134. 'url' => 'https://github.com/stormuk/Gravity-Forms-ACF-Field/' 
  135. ); 
  136. $free[] = array( 
  137. 'title' => __("Date & Time Picker", 'acf'),  
  138. 'description' => __("jQuery date & time picker", 'acf'),  
  139. 'thumbnail' => $dir . 'images/add-ons/date-time-field-thumb.jpg',  
  140. 'active' => class_exists('acf_field_date_time_picker'),  
  141. 'url' => 'http://wordpress.org/extend/plugins/acf-field-date-time-picker/' 
  142. ); 
  143. $free[] = array( 
  144. 'title' => __("Google Map Extended", 'acf'),  
  145. 'description' => __("Find addresses and coordinates of a desired location", 'acf'),  
  146. 'thumbnail' => $dir . 'images/add-ons/google-maps-field-thumb.jpg',  
  147. 'active' => class_exists('acf_field_google_map_extended'),  
  148. 'url' => 'https://wordpress.org/plugins/advanced-custom-fields-google-map-extended/' 
  149. ); 
  150. $free[] = array( 
  151. 'title' => __("Contact Form 7 Field", 'acf'),  
  152. 'description' => __("Assign one or more contact form 7 forms to a post", 'acf'),  
  153. 'thumbnail' => $dir . 'images/add-ons/cf7-field-thumb.jpg',  
  154. 'active' => class_exists('acf_field_cf7'),  
  155. 'url' => 'https://github.com/taylormsj/acf-cf7-field/' 
  156. ); 
  157.  
  158. ?> 
  159. <div class="wrap" style="max-width:970px;"> 
  160.  
  161. <div class="icon32" id="icon-acf"><br></div> 
  162. <h2 style="margin: 4px 0 15px;"><?php _e("Advanced Custom Fields Add-Ons", 'acf'); ?></h2> 
  163.  
  164. <div class="acf-alert"> 
  165. <p style=""><?php _e("The following Add-ons are available to increase the functionality of the Advanced Custom Fields plugin.", 'acf'); ?><br /> 
  166. <?php _e("Each Add-on can be installed as a separate plugin (receives updates) or included in your theme (does not receive updates).", 'acf'); ?></p> 
  167. </div> 
  168. <?php /** 
  169. <div class="acf-alert"> 
  170. <p><strong><?php _e("Just updated to version 4?", 'acf'); ?></strong> <?php _e("Activation codes have changed to plugins! Download your purchased add-ons", 'acf'); ?> <a href="http://www.advancedcustomfields.com/add-ons-download/" target="_blank"><?php _e("here", 'acf'); ?></a></p> 
  171. </div> 
  172. */ ?> 
  173.  
  174. <div id="add-ons" class="clearfix"> 
  175.  
  176. <div class="add-on-group clearfix"> 
  177. <?php foreach( $premium as $addon ): ?> 
  178. <div class="add-on wp-box <?php if( $addon['active'] ): ?>add-on-active<?php endif; ?>"> 
  179. <a target="_blank" href="<?php echo $addon['url']; ?>"> 
  180. <img src="<?php echo $addon['thumbnail']; ?>" /> 
  181. </a> 
  182. <div class="inner"> 
  183. <h3><a target="_blank" href="<?php echo $addon['url']; ?>"><?php echo $addon['title']; ?></a></h3> 
  184. <p><?php echo $addon['description']; ?></p> 
  185. </div> 
  186. <div class="footer"> 
  187. <?php if( $addon['active'] ): ?> 
  188. <a class="button button-disabled"><span class="acf-sprite-tick"></span><?php _e("Installed", 'acf'); ?></a> 
  189. <?php else: ?> 
  190. <a target="_blank" href="<?php echo $addon['url']; ?>" class="button"><?php _e("Purchase & Install", 'acf'); ?></a> 
  191. <?php endif; ?> 
  192. </div> 
  193. </div> 
  194. <?php endforeach; ?> 
  195. </div> 
  196.  
  197. <div class="add-on-group clearfix"> 
  198. <?php foreach( $free as $addon ): ?> 
  199. <div class="add-on wp-box <?php if( $addon['active'] ): ?>add-on-active<?php endif; ?>"> 
  200. <a target="_blank" href="<?php echo $addon['url']; ?>"> 
  201. <img src="<?php echo $addon['thumbnail']; ?>" /> 
  202. </a> 
  203. <div class="inner"> 
  204. <h3><a target="_blank" href="<?php echo $addon['url']; ?>"><?php echo $addon['title']; ?></a></h3> 
  205. <p><?php echo $addon['description']; ?></p> 
  206. </div> 
  207. <div class="footer"> 
  208. <?php if( $addon['active'] ): ?> 
  209. <a class="button button-disabled"><span class="acf-sprite-tick"></span><?php _e("Installed", 'acf'); ?></a> 
  210. <?php else: ?> 
  211. <a target="_blank" href="<?php echo $addon['url']; ?>" class="button"><?php _e("Download", 'acf'); ?></a> 
  212. <?php endif; ?> 
  213. </div> 
  214. </div> 
  215. <?php endforeach; ?>  
  216. </div> 
  217.  
  218.  
  219. </div> 
  220.  
  221. </div> 
  222. <script type="text/javascript"> 
  223. (function($) { 
  224.  
  225. $(window).on('load', function() { 
  226.  
  227. $('#add-ons .add-on-group').each(function() { 
  228.  
  229. var $el = $(this),  
  230. h = 0; 
  231.  
  232.  
  233. $el.find('.add-on').each(function() { 
  234.  
  235. h = Math.max( $(this).height(), h ); 
  236.  
  237. }); 
  238.  
  239. $el.find('.add-on').height( h ); 
  240.  
  241. }); 
  242.  
  243. }); 
  244.  
  245. })(jQuery);  
  246. </script> 
  247. <?php 
  248.  
  249. return; 
  250.  
  251. }