| @@ -2,14 +2,15 @@ | ||
| 2 | 2 | namespace Elementor\Core\Kits\Documents; |
| 3 | 3 | |
| 4 | 4 | use Elementor\Core\DocumentTypes\PageBase; |
| 5 | 5 | use Elementor\Core\Files\CSS\Post as Post_CSS; |
| 6 | +use Elementor\Core\Kits\Documents\Tabs; | |
| 6 | 7 | use Elementor\Core\Settings\Manager as SettingsManager; |
| 7 | 8 | use Elementor\Core\Settings\Page\Manager as PageManager; |
| 8 | 9 | use Elementor\Plugin; |
| 9 | 10 | |
| 10 | 11 | if ( ! defined( 'ABSPATH' ) ) { |
| 11 | - exit; // Exit if accessed directly. | |
| 12 | + exit; // Exit if accessed directly | |
| 12 | 13 | } |
| 13 | 14 | |
| 14 | 15 | class Kit extends PageBase { |
| 15 | 16 | /** |
| @@ -34,34 +35,16 @@ | ||
| 34 | 35 | |
| 35 | 36 | return $properties; |
| 36 | 37 | } |
| 37 | 38 | |
| 38 | - public static function get_type() { | |
| 39 | + public function get_name() { | |
| 39 | 40 | return 'kit'; |
| 40 | 41 | } |
| 41 | 42 | |
| 42 | 43 | public static function get_title() { |
| 43 | - return esc_html__( 'Kit', 'elementor' ); | |
| 44 | + return __( 'Kit', 'elementor' ); | |
| 44 | 45 | } |
| 45 | 46 | |
| 46 | - /** | |
| 47 | - * @return Tabs\Tab_Base[] | |
| 48 | - */ | |
| 49 | - public function get_tabs() { | |
| 50 | - return $this->tabs; | |
| 51 | - } | |
| 52 | - | |
| 53 | - /** | |
| 54 | - * Retrieve a tab by ID. | |
| 55 | - * | |
| 56 | - * @param $id | |
| 57 | - * | |
| 58 | - * @return Tabs\Tab_Base | |
| 59 | - */ | |
| 60 | - public function get_tab( $id ) { | |
| 61 | - return self::get_items( $this->get_tabs(), $id ); | |
| 62 | - } | |
| 63 | - | |
| 64 | 47 | protected function get_have_a_look_url() { |
| 65 | 48 | return ''; |
| 66 | 49 | } |
| 67 | 50 | |
| @@ -68,9 +51,9 @@ | ||
| 68 | 51 | public static function get_editor_panel_config() { |
| 69 | 52 | $config = parent::get_editor_panel_config(); |
| 70 | 53 | $config['default_route'] = 'panel/global/menu'; |
| 71 | 54 | |
| 72 | - $config['needHelpUrl'] = 'https://go.elementor.com/global-settings/'; | |
| 55 | + $config['needHelpUrl'] = 'https://go.elementor.com/global-settings'; | |
| 73 | 56 | |
| 74 | 57 | return $config; |
| 75 | 58 | } |
| 76 | 59 | |
| @@ -78,12 +61,8 @@ | ||
| 78 | 61 | return '.elementor-kit-' . $this->get_main_id(); |
| 79 | 62 | } |
| 80 | 63 | |
| 81 | 64 | public function save( $data ) { |
| 82 | - foreach ( $this->tabs as $tab ) { | |
| 83 | - $data = $tab->before_save( $data ); | |
| 84 | - } | |
| 85 | - | |
| 86 | 65 | $saved = parent::save( $data ); |
| 87 | 66 | |
| 88 | 67 | if ( ! $saved ) { |
| 89 | 68 | return false; |
| @@ -110,12 +89,12 @@ | ||
| 110 | 89 | /** |
| 111 | 90 | * Register a kit settings menu. |
| 112 | 91 | * |
| 113 | 92 | * @param $id |
| 114 | - * @param $class_name | |
| 93 | + * @param $class | |
| 115 | 94 | */ |
| 116 | - public function register_tab( $id, $class_name ) { | |
| 117 | - $this->tabs[ $id ] = new $class_name( $this ); | |
| 95 | + public function register_tab( $id, $class ) { | |
| 96 | + $this->tabs[ $id ] = new $class( $this ); | |
| 118 | 97 | } |
| 119 | 98 | |
| 120 | 99 | /** |
| 121 | 100 | * @inheritDoc |
| @@ -124,9 +103,8 @@ | ||
| 124 | 103 | $config = parent::get_initial_config(); |
| 125 | 104 | |
| 126 | 105 | foreach ( $this->tabs as $id => $tab ) { |
| 127 | 106 | $config['tabs'][ $id ] = [ |
| 128 | - 'id' => $id, | |
| 129 | 107 | 'title' => $tab->get_title(), |
| 130 | 108 | 'icon' => $tab->get_icon(), |
| 131 | 109 | 'group' => $tab->get_group(), |
| 132 | 110 | 'helpUrl' => $tab->get_help_url(), |
| @@ -150,10 +128,10 @@ | ||
| 150 | 128 | } |
| 151 | 129 | |
| 152 | 130 | protected function get_post_statuses() { |
| 153 | 131 | return [ |
| 154 | - 'draft' => sprintf( '%s (%s)', esc_html__( 'Disabled', 'elementor' ), esc_html__( 'Draft', 'elementor' ) ), | |
| 155 | - 'publish' => esc_html__( 'Published', 'elementor' ), | |
| 132 | + 'draft' => sprintf( '%s (%s)', __( 'Disabled', 'elementor' ), __( 'Draft', 'elementor' ) ), | |
| 133 | + 'publish' => __( 'Published', 'elementor' ), | |
| 156 | 134 | ]; |
| 157 | 135 | } |
| 158 | 136 | |
| 159 | 137 | public function add_repeater_row( $control_id, $item ) { |
| @@ -172,9 +150,9 @@ | ||
| 172 | 150 | |
| 173 | 151 | $page_settings_manager = SettingsManager::get_settings_managers( 'page' ); |
| 174 | 152 | $page_settings_manager->save_settings( $document_settings, $this->get_id() ); |
| 175 | 153 | |
| 176 | - /** @var Kit $autosave */ | |
| 154 | + /** @var Kit $autosave **/ | |
| 177 | 155 | $autosave = $this->get_autosave(); |
| 178 | 156 | |
| 179 | 157 | if ( $autosave ) { |
| 180 | 158 | $autosave->add_repeater_row( $control_id, $item ); |
| @@ -207,9 +185,8 @@ | ||
| 207 | 185 | 'settings-site-identity' => Tabs\Settings_Site_Identity::class, |
| 208 | 186 | 'settings-background' => Tabs\Settings_Background::class, |
| 209 | 187 | 'settings-layout' => Tabs\Settings_Layout::class, |
| 210 | 188 | 'settings-lightbox' => Tabs\Settings_Lightbox::class, |
| 211 | - 'settings-page-transitions' => Tabs\Settings_Page_Transitions::class, | |
| 212 | 189 | 'settings-custom-css' => Tabs\Settings_Custom_CSS::class, |
| 213 | 190 | ]; |
| 214 | 191 | |
| 215 | 192 | foreach ( $tabs as $id => $class ) { |