class-ad-groups-list.php
9 years ago
class-ad-type.php
9 years ago
class-licenses.php
9 years ago
class-menu.php
9 years ago
class-meta-box.php
9 years ago
class-notices.php
9 years ago
class-options.php
9 years ago
class-overview-widgets.php
9 years ago
class-settings.php
9 years ago
class-shortcode-creator.php
9 years ago
notices.php
9 years ago
shortcode-creator-l10n.php
10 years ago
class-options.php
60 lines
| 1 | <?php |
| 2 | defined( 'ABSPATH' ) || exit; |
| 3 | |
| 4 | /** |
| 5 | * logic to render options for ads, groups and placements |
| 6 | */ |
| 7 | |
| 8 | class Advanced_Ads_Admin_Options { |
| 9 | /** |
| 10 | * Instance of this class. |
| 11 | * |
| 12 | * @var object |
| 13 | */ |
| 14 | protected static $instance = null; |
| 15 | |
| 16 | private function __construct() { |
| 17 | } |
| 18 | |
| 19 | /** |
| 20 | * Return an instance of this class. |
| 21 | * |
| 22 | * @return object A single instance of this class. |
| 23 | */ |
| 24 | public static function get_instance() { |
| 25 | // If the single instance hasn't been set, set it now. |
| 26 | if ( null == self::$instance ) { |
| 27 | self::$instance = new self; |
| 28 | } |
| 29 | |
| 30 | return self::$instance; |
| 31 | } |
| 32 | |
| 33 | /** |
| 34 | * create a wrapper for a single option line |
| 35 | * |
| 36 | * @param str $id internal id of the option wrapper |
| 37 | * @param str $title label of the option |
| 38 | * @param str $content content of the option |
| 39 | * @param str $description description of the option |
| 40 | * |
| 41 | */ |
| 42 | public static function render_option( $id, $title, $content, $description = '' ){ |
| 43 | |
| 44 | /** |
| 45 | * this filter allows to extend the class dynamically by add-ons |
| 46 | * this would allow add-ons to dynamically hide/show only attributes belonging to them, practically not used now |
| 47 | */ |
| 48 | $class = apply_filters( 'advanced-ads-option-class', $id ); |
| 49 | ?> |
| 50 | <div class="advads-option advads-option-<?php echo $class; ?>"> |
| 51 | <span><?php echo $title ?></span> |
| 52 | <div> |
| 53 | <?php echo $content; ?> |
| 54 | <?php if( $description ) : echo '<p class="description">'. $description .'</p>'; endif; ?> |
| 55 | </div> |
| 56 | </div><?php |
| 57 | } |
| 58 | |
| 59 | } |
| 60 |