/** * Set hook prefix for loading assets. * * @param string $prefix Current hook prefix. * * @return string */ public static function hook_prefix($prefix = '') { if ('admin' == $prefix && class_exists('WR_Pb_Helper_Functions') && WR_Pb_Helper_Functions::is_modal()) { $prefix = 'pb_admin'; } return $prefix; }
/** * Check if current page is modal page * * @param type $shortcode * * @return type */ public static function is_modal_of_element($shortcode) { if (empty($shortcode)) { return false; } return WR_Pb_Helper_Functions::is_modal() && isset($_GET['wr_modal_type']) && $_GET['wr_modal_type'] == $shortcode; }
/** * Show Modal page */ function modal_register() { if (WR_Pb_Helper_Functions::is_modal()) { $cls_modal = WR_Pb_Objects_Modal::get_instance(); if (!empty($_GET['wr_modal_type'])) { $cls_modal->preview_modal(); } if (!empty($_GET['wr_layout'])) { $cls_modal->preview_modal('_layout'); } if (!empty($_GET['wr_custom_css'])) { $cls_modal->preview_modal('_custom_css'); } if (!empty($_GET['wr_report_bug'])) { $cls_modal->preview_modal('_report_bug'); } if (!empty($_GET['wr_add_element'])) { $cls_modal->preview_modal('_add_element'); } } }