PluginProbe
Hustle – Email Marketing, Lead Generation, Optins, Popups / 7.8.3
Hustle – Email Marketing, Lead Generation, Optins, Popups v7.8.3
7.8.14.2 7.8.14 7.8.14.1 7.8.13 7.8.13.1 trunk 3.0 3.1 3.1.1 3.1.2 3.1.3 3.1.4 4.3.2 4.4.4 4.4.5 4.4.5.1 4.4.5.4 4.6 4.6.1.1 4.6.1.4 4.7.0.2 4.7.0.3 4.7.0.7 4.7.0.9 4.7.1.0 All 103 releases
wordpress-popup / inc / hustle-sshare-admin.php
hustle-sshare-admin.php
91 lines 2.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php // phpcs:ignore WordPress.Files.FileName.InvalidClassFileName
2 /**
3 * Hustle_SShare_Admin
4 *
5 * @package Hustle
6 */
7
8 if ( ! class_exists( 'Hustle_SShare_Admin' ) ) :
9
10 /**
11 * Class Hustle_SShare_Admin
12 */
13 class Hustle_SShare_Admin extends Hustle_Module_Page_Abstract {
14
15 /**
16 * Set page properties
17 */
18 protected function set_page_properties() {
19
20 $this->module_type = Hustle_Module_Model::SOCIAL_SHARING_MODULE;
21
22 $this->page_title = Opt_In_Utils::get_module_type_display_name( $this->module_type, false, true );
23
24 $this->page_template_path = '/admin/sshare/listing';
25 $this->page_edit_template_path = '/admin/sshare/wizard';
26 }
27
28 /**
29 * Gets the JS variables to be localized in Wizard for Social Sharing modules.
30 *
31 * @since 4.3.0
32 *
33 * @return array
34 */
35 protected function get_wizard_js_variables_to_localize() {
36 $variables = array(
37 'social_platforms' => Hustle_SShare_Model::get_social_platform_names(),
38 'social_platforms_with_endpoints' => Hustle_SShare_Model::get_sharing_endpoints(),
39 'social_platforms_with_api' => Hustle_SShare_Model::get_networks_counter_endpoint(),
40 'social_platforms_data' => array(
41 'email_message_default' => __( "I've found an excellent article on {post_url} which may interest you.", 'hustle' ),
42 ),
43 'palettes' => array(
44 'sshare_defaults' => $this->module->get_design()->get_defaults(),
45 ),
46 );
47 return $variables;
48 }
49
50 /**
51 * Get the args for the wizard page.
52 *
53 * @since 4.0.1
54 * @return array
55 */
56 protected function get_page_edit_template_args() {
57 return array(
58 'section' => $this->get_current_section( 'services' ),
59 'module_id' => $this->module->module_id,
60 'module' => $this->module,
61 'is_active' => (bool) $this->module->active,
62 );
63 }
64
65 /**
66 * Loads preview styles used only by the Ssharing wizard.
67 *
68 * @since 4.3.1
69 */
70 protected function on_listing_and_wizard_actions() {
71 parent::on_listing_and_wizard_actions();
72
73 // Load preview scripts used only by ssharing wizard.
74 if ( $this->page_edit === $this->current_page ) {
75 add_action( 'admin_print_styles', array( $this, 'print_preview_styles' ) );
76 }
77 }
78
79 /**
80 * Prints the styles for Ssharing inline modules.
81 *
82 * @since 4.3.1
83 */
84 public function print_preview_styles() {
85 $module_types = array( Hustle_Module_Model::SOCIAL_SHARING_MODULE, Hustle_SShare_Model::INLINE_MODULE );
86 Hustle_Module_Front::print_front_styles( $module_types );
87 }
88 }
89
90 endif;
91