| 1 |
<?php |
| 2 |
/** |
| 3 |
* @package FireBox |
| 4 |
* @version 2.0.12 Free |
| 5 |
* |
| 6 |
* @author FirePlugins <info@fireplugins.com> |
| 7 |
* @link https://www.fireplugins.com |
| 8 |
* @copyright Copyright © 2023 FirePlugins All Rights Reserved |
| 9 |
* @license GNU GPLv3 <http://www.gnu.org/licenses/gpl.html> or later |
| 10 |
*/ |
| 11 |
|
| 12 |
namespace FireBox\Core\Admin\Forms\FireBox; |
| 13 |
|
| 14 |
if (!defined('ABSPATH')) |
| 15 |
{ |
| 16 |
exit; // Exit if accessed directly. |
| 17 |
} |
| 18 |
|
| 19 |
use FireBox\Core\Helpers\BoxHelper; |
| 20 |
|
| 21 |
class DisplayConditions |
| 22 |
{ |
| 23 |
/** |
| 24 |
* Holds the Display Conditions Settings |
| 25 |
* |
| 26 |
* @return array |
| 27 |
*/ |
| 28 |
public function getSettings() |
| 29 |
{ |
| 30 |
$settings = [ |
| 31 |
'title' => firebox()->_('FB_DISPLAY_CONDITIONS'), |
| 32 |
'content' => [ |
| 33 |
'general' => [ |
| 34 |
'fields' => [ |
| 35 |
[ |
| 36 |
'name' => 'display_conditions_type', |
| 37 |
'type' => 'Toggle', |
| 38 |
'label' => firebox()->_('FB_DISPLAY_POPUP'), |
| 39 |
'description' => firebox()->_('FB_DISPLAY_POPUP_DESC'), |
| 40 |
'default' => 'all', |
| 41 |
'choices' => [ |
| 42 |
'all' => firebox()->_('FB_DISPLAY_CONDITIONS_TYPE_ALL_PAGES'), |
| 43 |
'mirror' => firebox()->_('FB_DISPLAY_CONDITIONS_TYPE_MIRROR'), |
| 44 |
'custom' => firebox()->_('FB_DISPLAY_CONDITIONS_TYPE_CUSTOM') |
| 45 |
] |
| 46 |
], |
| 47 |
[ |
| 48 |
'name' => 'mirror_box', |
| 49 |
'type' => 'Dropdown', |
| 50 |
'label' => firebox()->_('FB_POPUP'), |
| 51 |
'description' => firebox()->_('FB_MIRROR_POPUP_SELECT_DESC'), |
| 52 |
'default' => 1, |
| 53 |
'class' => ['fpf-flex-row-fields'], |
| 54 |
'description_class' => ['bottom'], |
| 55 |
'input_class' => ['fullwidth'], |
| 56 |
'choices' => BoxHelper::getAllMirrorBoxesExceptID(get_the_ID()), |
| 57 |
'showon' => '[display_conditions_type]:mirror' |
| 58 |
], |
| 59 |
[ |
| 60 |
'name' => 'rules', |
| 61 |
'type' => 'ConditionBuilder', |
| 62 |
'showon' => '[display_conditions_type]:custom', |
| 63 |
'plugin' => 'FPF_FIREBOX', |
| 64 |
|
| 65 |
'exclude_rules' => [ |
| 66 |
'Date\Date', |
| 67 |
'Date\Day', |
| 68 |
'Date\Month', |
| 69 |
'Date\Time', |
| 70 |
'WP\UserID', |
| 71 |
'WP\UserGroup', |
| 72 |
'WP\Tags', |
| 73 |
'WP\Categories', |
| 74 |
'WP\CustomPostTypes', |
| 75 |
'WP\Language', |
| 76 |
'Device', |
| 77 |
'Browser', |
| 78 |
'OS', |
| 79 |
'Geo\City', |
| 80 |
'Geo\Country', |
| 81 |
'Geo\Region', |
| 82 |
'Geo\Continent', |
| 83 |
'FireBox\Popup', |
| 84 |
'FireBox\Form', |
| 85 |
'Referrer', |
| 86 |
'IP', |
| 87 |
'Pageviews', |
| 88 |
'Cookie', |
| 89 |
'PHP', |
| 90 |
'TimeOnSite', |
| 91 |
'NewReturningVisitor', |
| 92 |
'WooCommerce\CartContainsProducts', |
| 93 |
'WooCommerce\CartContainsXProducts', |
| 94 |
'WooCommerce\CartValue', |
| 95 |
'WooCommerce\Product', |
| 96 |
'WooCommerce\PurchasedProduct', |
| 97 |
'WooCommerce\LastPurchasedDate', |
| 98 |
'WooCommerce\CurrentProductPrice', |
| 99 |
'WooCommerce\TotalSpend', |
| 100 |
'WooCommerce\CurrentProductStock', |
| 101 |
'WooCommerce\Category', |
| 102 |
'WooCommerce\CategoryView', |
| 103 |
'EDD\CartContainsProducts', |
| 104 |
'EDD\CartContainsXProducts', |
| 105 |
'EDD\CartValue', |
| 106 |
'EDD\Product', |
| 107 |
'EDD\PurchasedProduct', |
| 108 |
'EDD\LastPurchasedDate', |
| 109 |
'EDD\CurrentProductPrice', |
| 110 |
'EDD\TotalSpend', |
| 111 |
'EDD\CurrentProductStock', |
| 112 |
'EDD\Category', |
| 113 |
'EDD\CategoryView', |
| 114 |
], |
| 115 |
'exclude_rules_pro' => true, |
| 116 |
|
| 117 |
|
| 118 |
], |
| 119 |
] |
| 120 |
] |
| 121 |
] |
| 122 |
]; |
| 123 |
|
| 124 |
return apply_filters('firebox/box/settings/display_conditions/edit', $settings); |
| 125 |
} |
| 126 |
} |