class-rio-license.php
3 months ago
class-rio-log.php
7 months ago
class-rio-page.php
7 months ago
class-rio-settings.php
7 months ago
class-rio-statistic.php
7 months ago
index.php
3 years ago
class-rio-page.php
90 lines
| 1 | <?php |
| 2 | |
| 3 | /** |
| 4 | * The page Settings. |
| 5 | * |
| 6 | * @since 1.0.0 |
| 7 | */ |
| 8 | |
| 9 | // Exit if accessed directly |
| 10 | if ( ! defined( 'ABSPATH' ) ) { |
| 11 | exit; |
| 12 | } |
| 13 | |
| 14 | /** |
| 15 | * Класс отвечает за работу страницы настроек |
| 16 | * |
| 17 | * @version 1.0 |
| 18 | */ |
| 19 | class WRIO_Page extends WBCR\Factory_Templates_759\Impressive { |
| 20 | |
| 21 | /** |
| 22 | * {@inheritdoc} |
| 23 | */ |
| 24 | public $page_parent_page = null; |
| 25 | |
| 26 | /** |
| 27 | * {@inheritdoc} |
| 28 | */ |
| 29 | public $available_for_multisite = false; |
| 30 | |
| 31 | /** |
| 32 | * {@inheritdoc} |
| 33 | */ |
| 34 | public $clearfy_collaboration = false; |
| 35 | |
| 36 | /** |
| 37 | * {@inheritdoc} |
| 38 | * |
| 39 | * @var bool |
| 40 | */ |
| 41 | public $show_right_sidebar_in_options = false; |
| 42 | |
| 43 | /** |
| 44 | * Hide bottom sidebar by default - only show on Settings page |
| 45 | * |
| 46 | * @var bool |
| 47 | */ |
| 48 | public $show_bottom_sidebar = false; |
| 49 | |
| 50 | |
| 51 | /** |
| 52 | * @since 1.3.0 |
| 53 | * @var WRIO_Views |
| 54 | */ |
| 55 | protected $view; |
| 56 | |
| 57 | /** |
| 58 | * @param WRIO_Plugin $plugin |
| 59 | */ |
| 60 | public function __construct( WRIO_Plugin $plugin ) { |
| 61 | $this->view = WRIO_Views::get_instance( WRIO_PLUGIN_DIR ); |
| 62 | |
| 63 | if ( is_multisite() && defined( 'WCL_PLUGIN_ACTIVE' ) ) { |
| 64 | if ( WRIO_Plugin::app()->isNetworkActive() && WCL_Plugin::app()->isNetworkActive() ) { |
| 65 | $this->clearfy_collaboration = true; |
| 66 | } |
| 67 | } elseif ( defined( 'WCL_PLUGIN_ACTIVE' ) ) { |
| 68 | $this->clearfy_collaboration = true; |
| 69 | } |
| 70 | |
| 71 | parent::__construct( $plugin ); |
| 72 | } |
| 73 | |
| 74 | /** |
| 75 | * Подменяем простраинство имен для меню плагина, если активирован плагин |
| 76 | * Меню текущего плагина будет добавлено в общее меню |
| 77 | * |
| 78 | * @return string |
| 79 | */ |
| 80 | public function getMenuScope() { |
| 81 | if ( $this->clearfy_collaboration ) { |
| 82 | $this->page_parent_page = 'rio_general'; |
| 83 | |
| 84 | return 'wbcr_clearfy'; |
| 85 | } |
| 86 | |
| 87 | return 'robin-image-optimizer'; |
| 88 | } |
| 89 | } |
| 90 |