Blocks
1 month ago
MenuService.php
1 month ago
SBR_About_Builder.php
1 month ago
SBR_Admin_Notice.php
1 month ago
SBR_Collections_Builder.php
1 month ago
SBR_New_User.php
1 month ago
SBR_Notifications.php
1 month ago
SBR_Plugin_Insltaller.php
1 month ago
SBR_Support_Builder.php
1 month ago
SBR_Support_Tool.php
1 month ago
SBR_Collections_Builder.php
83 lines
| 1 | <?php |
| 2 | |
| 3 | /** |
| 4 | * Reviews Collections Page |
| 5 | * |
| 6 | * @since 1.0 |
| 7 | */ |
| 8 | |
| 9 | namespace SmashBalloon\Reviews\Common\Admin; |
| 10 | |
| 11 | if (! defined('ABSPATH')) { |
| 12 | exit; |
| 13 | } |
| 14 | |
| 15 | use Smashballoon\Customizer\V2\Collections_Builder; |
| 16 | use SmashBalloon\Reviews\Common\Builder\Config\Proxy; |
| 17 | use SmashBalloon\Reviews\Common\Builder\SBR_Sources; |
| 18 | use SmashBalloon\Reviews\Common\Util; |
| 19 | |
| 20 | |
| 21 | class SBR_Collections_Builder extends Collections_Builder |
| 22 | { |
| 23 | protected $config_proxy; |
| 24 | |
| 25 | /** |
| 26 | * MEnu Slug |
| 27 | * @since 1.0 |
| 28 | */ |
| 29 | protected $builder_menu_slug; |
| 30 | protected $current_plugin; |
| 31 | protected $add_to_menu; |
| 32 | |
| 33 | protected $menu; |
| 34 | |
| 35 | public function __construct(Proxy $config_proxy) |
| 36 | { |
| 37 | $this->config_proxy = $config_proxy; |
| 38 | $this->builder_menu_slug = SBR_CUSTOMIZER_MENU_SLUG; |
| 39 | $this->current_plugin = 'ReviewsPro'; |
| 40 | $this->add_to_menu = !Util::sbr_is_pro() ? true : check_license_valid(); |
| 41 | |
| 42 | add_action('init', [$this, 'init_menu']); |
| 43 | } |
| 44 | |
| 45 | public function init_menu() |
| 46 | { |
| 47 | $menu_title = __('Collections', 'reviews-feed') . ( !Util::sbr_is_pro() ? '<span class="sb-men-pro">PRO</span>' : ''); |
| 48 | $this->menu = [ |
| 49 | 'parent_menu_slug' => "sbr", |
| 50 | 'page_title' => "Collections", |
| 51 | 'menu_title' => $menu_title, |
| 52 | 'menu_slug' => "sbr-collections", |
| 53 | ]; |
| 54 | } |
| 55 | public function custom_collections_data() |
| 56 | { |
| 57 | |
| 58 | $collections_data = [ |
| 59 | 'nonce' => wp_create_nonce('sbr-admin'), |
| 60 | 'assetsURL' => SB_COMMON_ASSETS, |
| 61 | 'plugins' => Util::get_plugins_info(), |
| 62 | 'providers' => Util::get_providers(), |
| 63 | 'isPro' => Util::sbr_is_pro(), |
| 64 | 'recommendedPlugins' => Util::get_smashballoon_recommended_plugins_info(), |
| 65 | 'adminNoticeContent' => apply_filters('sbr_admin_notices_filter', 1), |
| 66 | 'collectionsPageUrl' => admin_url('admin.php?page=sbr-collections'), |
| 67 | 'sourcesList' => SBR_Sources::get_sources_list(), |
| 68 | 'sourcesCount' => SBR_Sources::get_sources_count(), |
| 69 | 'builderUrl' => admin_url('admin.php?page=sbr'), |
| 70 | 'adminHomeURL' => admin_url('admin.php'), |
| 71 | 'editHomeURL' => admin_url('edit.php'), |
| 72 | ]; |
| 73 | if (Util::sbr_is_pro()) { |
| 74 | $FormsManager = new \SmashBalloon\Reviews\Pro\Integrations\Forms\FormsManager(); |
| 75 | $collections_data['formsManagerData'] = $FormsManager->get_form_plugins_data(); |
| 76 | } |
| 77 | return $collections_data; |
| 78 | } |
| 79 | |
| 80 | |
| 81 | |
| 82 | } |
| 83 |