/** * @return C_Displayed_Gallery_Trigger_Manager */ static function get_instance() { if (!self::$_instance) { $klass = get_class(); self::$_instance = new $klass(); } return self::$_instance; }
function render_object() { $root_element = $this->call_parent('render_object'); if (($displayed_gallery = $this->object->get_param('displayed_gallery')) && $this->object->get_param('display_type_rendering')) { $triggers = C_Displayed_Gallery_Trigger_Manager::get_instance(); $triggers->render($root_element, $displayed_gallery); } return $root_element; }
function initialize() { parent::initialize(); if (!is_admin()) { $triggers = C_Displayed_Gallery_Trigger_Manager::get_instance(); $triggers->add(NGG_PRO_LIGHTBOX_TRIGGER, 'C_NextGen_Pro_Lightbox_Trigger'); $triggers->add(NGG_PRO_LIGHTBOX_COMMENT_TRIGGER, 'C_NextGen_Pro_Lightbox_Trigger'); } }
/** * This method should be overwritten by other adapters/mixins, and call * wp_enqueue_script() / wp_enqueue_style() */ function enqueue_frontend_resources($displayed_gallery) { // This script provides common JavaScript among all display types wp_enqueue_script('ngg_common'); // Enqueue the display type library wp_enqueue_script($displayed_gallery->display_type, $this->object->_get_js_lib_url($displayed_gallery)); // Add "galleries = {};" $this->object->_add_script_data('ngg_common', 'galleries', new stdClass(), TRUE, FALSE); // Add "galleries.gallery_1 = {};" $this->object->_add_script_data('ngg_common', 'galleries.gallery_' . $displayed_gallery->id(), (array) $displayed_gallery->get_entity(), FALSE); // Enqueue trigger button resources C_Displayed_Gallery_Trigger_Manager::get_instance()->enqueue_resources($displayed_gallery); // Enqueue lightbox library $this->object->enqueue_lightbox_resources($displayed_gallery); }
function initialize() { parent::initialize(); if (!is_admin()) { // adds lightbox JS overrides if (version_compare(NGG_PLUGIN_VERSION, '2.0.67') >= 0) { M_NextGen_Pro_Lightbox::add_component('photocrati-nextgen_pro_proofing', 'C_NextGen_Pro_Proofing_Lightbox'); } else { M_NextGen_Pro_Lightbox_Legacy::add_component('photocrati-nextgen_pro_proofing', 'C_NextGen_Pro_Proofing_Lightbox'); } $triggers = C_Displayed_Gallery_Trigger_Manager::get_instance(); $triggers->add(NGG_PRO_PROOFING_TRIGGER, 'C_NextGen_Pro_Proofing_Trigger'); C_NextGen_Shortcode_Manager::add('ngg_pro_proofing', array(&$this, 'render_proofed_images')); } }
function initialize() { parent::initialize(); if (!is_admin()) { // Add lightbox components if (version_compare(NGG_PLUGIN_VERSION, '2.0.67') >= 0) { M_NextGen_Pro_Lightbox::add_component('photocrati-add_to_cart', 'C_NextGen_Pro_Add_To_Cart'); } else { M_NextGen_Pro_Lightbox_Legacy::add_component('photocrati-add_to_cart', 'C_NextGen_Pro_Add_To_Cart'); } // Add trigger $triggers = C_Displayed_Gallery_Trigger_Manager::get_instance(); $triggers->add(NGG_ECOMMERCE_TRIGGER, 'C_NextGen_Pro_Ecommerce_Trigger'); C_NextGen_Shortcode_Manager::add('ngg_pro_cart_count', array(&$this, 'render_cart_count')); C_NextGen_Shortcode_Manager::add('ngg_pro_checkout', array(&$this, 'render_checkout_form')); C_NextGen_Shortcode_Manager::add('ngg_pro_digital_downloads', array(&$this, 'render_digital_downloads')); C_NextGen_Shortcode_Manager::add('ngg_pro_order_details', array(&$this, 'render_order_details')); C_NextGen_Shortcode_Manager::add('ngg_pro_verify_order', array(&$this, 'render_order_verification')); } // Add pricelist sources $sources = C_Pricelist_Source_Manager::get_instance(); $sources->register(NGG_PRO_MANUAL_PRICELIST_SOURCE, array('title' => __('Manual Pricelist', 'nextgen-gallery-pro'), 'shipping_method' => 'C_NextGen_Pro_Flat_Rate_Shipping_Calculator', 'settings_field' => 'manual_settings')); $sources->register(NGG_PRO_DIGITAL_DOWNLOADS_SOURCE, array('title' => __('Digital Downloads', 'nextgen-gallery-pro'), 'shipping_method' => NULL, 'settings_field' => 'digital_download_settings')); }