public function export_navigation_skins($export_navigation_skins) { $return_nav_skins = array(); if ($export_navigation_skins !== false && !empty($export_navigation_skins)) { $c_skins = new Essential_Grid_Navigation(); $skins = $c_skins->get_essential_navigation_skins(); if (!empty($skins)) { foreach ($export_navigation_skins as $e_skin_id) { foreach ($skins as $skin) { if ($e_skin_id == $skin['id']) { $return_nav_skins[] = $skin; break; } } } } } return $return_nav_skins; }
/** * widget output */ public function widget($args, $instance) { $grid_id = $instance["ess_grid"]; $title = @$instance["ess_grid_title"]; if (empty($grid_id)) { return false; } $base = new Essential_Grid_Base(); $grid = new Essential_Grid(); $grids = $grid->get_grids_short_widgets(); if (!isset($grids[$grid_id])) { return false; } $grid_handle = $grids[$grid_id]; //widget output $beforeWidget = $args["before_widget"]; $afterWidget = $args["after_widget"]; $beforeTitle = $args["before_title"]; $afterTitle = $args["after_title"]; echo $beforeWidget; if (!empty($title)) { echo $beforeTitle . $title . $afterTitle; } if ($base->is_shortcode_with_handle_exist($grid_handle)) { $eg_nav = new Essential_Grid_Navigation(); $eg_nav->output_cart(); } echo $afterWidget; }
/** * Handle Ajax Requests */ public static function on_ajax_action() { try { $token = self::getPostVar('token', false); //verify the token $isVerified = wp_verify_nonce($token, 'Essential_Grid_actions'); $error = false; if ($isVerified) { $data = self::getPostVar("data", false); switch (self::getPostVar("client_action", false)) { case 'add_google_fonts': $f = new ThemePunch_Fonts(); $result = $f->add_new_font($data); if ($result === true) { Essential_Grid::ajaxResponseSuccess(__("Font successfully created!", EG_TEXTDOMAIN), array('data' => $result, 'is_redirect' => true, 'redirect_url' => self::getFontsUrl())); } else { Essential_Grid::ajaxResponseError($result, false); } break; case 'remove_google_fonts': if (!isset($data['handle'])) { Essential_Grid::ajaxResponseError(__('Font not found', EG_TEXTDOMAIN), false); } $f = new ThemePunch_Fonts(); $result = $f->remove_font_by_handle($data['handle']); if ($result === true) { Essential_Grid::ajaxResponseSuccess(__("Font successfully removed!", EG_TEXTDOMAIN), array('data' => $result)); } else { Essential_Grid::ajaxResponseError($result, false); } break; case 'edit_google_fonts': if (!isset($data['handle'])) { Essential_Grid::ajaxResponseError(__('No handle given', EG_TEXTDOMAIN), false); } if (!isset($data['url'])) { Essential_Grid::ajaxResponseError(__('No parameters given', EG_TEXTDOMAIN), false); } $f = new ThemePunch_Fonts(); $result = $f->edit_font_by_handle($data); if ($result === true) { Essential_Grid::ajaxResponseSuccess(__("Font successfully changed!", EG_TEXTDOMAIN), array('data' => $result)); } else { Essential_Grid::ajaxResponseError($result, false); } break; case 'add_custom_meta': $m = new Essential_Grid_Meta(); $result = $m->add_new_meta($data); if ($result === true) { Essential_Grid::ajaxResponseSuccess(__("Meta successfully created!", EG_TEXTDOMAIN), array('data' => $result, 'is_redirect' => true, 'redirect_url' => self::getSubViewUrl(Essential_Grid_Admin::VIEW_SUB_CUSTOM_META_AJAX))); } else { Essential_Grid::ajaxResponseError($result, false); } break; case 'remove_custom_meta': if (!isset($data['handle'])) { Essential_Grid::ajaxResponseError(__('Meta not found', EG_TEXTDOMAIN), false); } $m = new Essential_Grid_Meta(); $result = $m->remove_meta_by_handle($data['handle']); if ($result === true) { Essential_Grid::ajaxResponseSuccess(__("Meta successfully removed!", EG_TEXTDOMAIN), array('data' => $result)); } else { Essential_Grid::ajaxResponseError($result, false); } break; case 'edit_custom_meta': if (!isset($data['handle'])) { Essential_Grid::ajaxResponseError(__('No handle given', EG_TEXTDOMAIN), false); } if (!isset($data['name'])) { Essential_Grid::ajaxResponseError(__('No name given', EG_TEXTDOMAIN), false); } $m = new Essential_Grid_Meta(); $result = $m->edit_meta_by_handle($data); if ($result === true) { Essential_Grid::ajaxResponseSuccess(__("Meta successfully changed!", EG_TEXTDOMAIN), array('data' => $result)); } else { Essential_Grid::ajaxResponseError($result, false); } break; case 'add_link_meta': $m = new Essential_Grid_Meta_Linking(); $result = $m->add_new_link_meta($data); if ($result === true) { Essential_Grid::ajaxResponseSuccess(__("Meta successfully created!", EG_TEXTDOMAIN), array('data' => $result, 'is_redirect' => true, 'redirect_url' => self::getSubViewUrl(Essential_Grid_Admin::VIEW_SUB_CUSTOM_META_AJAX))); } else { Essential_Grid::ajaxResponseError($result, false); } break; case 'remove_link_meta': if (!isset($data['handle'])) { Essential_Grid::ajaxResponseError(__('Meta not found', EG_TEXTDOMAIN), false); } $m = new Essential_Grid_Meta_Linking(); $result = $m->remove_link_meta_by_handle($data['handle']); if ($result === true) { Essential_Grid::ajaxResponseSuccess(__("Meta successfully removed!", EG_TEXTDOMAIN), array('data' => $result)); } else { Essential_Grid::ajaxResponseError($result, false); } break; case 'edit_link_meta': if (!isset($data['handle'])) { Essential_Grid::ajaxResponseError(__('No handle given', EG_TEXTDOMAIN), false); } if (!isset($data['name'])) { Essential_Grid::ajaxResponseError(__('No name given', EG_TEXTDOMAIN), false); } if (!isset($data['original'])) { Essential_Grid::ajaxResponseError(__('No original given', EG_TEXTDOMAIN), false); } $m = new Essential_Grid_Meta_Linking(); $result = $m->edit_link_meta_by_handle($data); if ($result === true) { Essential_Grid::ajaxResponseSuccess(__("Meta successfully changed!", EG_TEXTDOMAIN), array('data' => $result)); } else { Essential_Grid::ajaxResponseError($result, false); } break; case 'add_widget_area': $wa = new Essential_Grid_Widget_Areas(); $result = $wa->add_new_sidebar($data); if ($result === true) { Essential_Grid::ajaxResponseSuccess(__("Widget Area successfully created!", EG_TEXTDOMAIN), array('data' => $result, 'is_redirect' => true, 'redirect_url' => self::getSubViewUrl(Essential_Grid_Admin::VIEW_SUB_WIDGET_AREA_AJAX))); } else { Essential_Grid::ajaxResponseError($result, false); } break; case 'edit_widget_area': if (!isset($data['handle'])) { Essential_Grid::ajaxResponseError(__('No handle given', EG_TEXTDOMAIN), false); } if (!isset($data['name'])) { Essential_Grid::ajaxResponseError(__('No name given', EG_TEXTDOMAIN), false); } $wa = new Essential_Grid_Widget_Areas(); $result = $wa->edit_widget_area_by_handle($data); if ($result === true) { Essential_Grid::ajaxResponseSuccess(__("Widget Area successfully changed!", EG_TEXTDOMAIN), array('data' => $result)); } else { Essential_Grid::ajaxResponseError($result, false); } break; case 'remove_widget_area': if (!isset($data['handle'])) { Essential_Grid::ajaxResponseError(__('Widget Area not found', EG_TEXTDOMAIN), false); } $wa = new Essential_Grid_Widget_Areas(); $result = $wa->remove_widget_area_by_handle($data['handle']); if ($result === true) { Essential_Grid::ajaxResponseSuccess(__("Widget Area successfully removed!", EG_TEXTDOMAIN), array('data' => $result)); } else { Essential_Grid::ajaxResponseError($result, false); } break; case 'get_preview_html_markup': //add wpml transient $lang_code = ''; if (Essential_Grid_Wpml::is_wpml_exists()) { $lang_code = Essential_Grid_Wpml::get_current_lang_code(); } if (isset($data['id'])) { delete_transient('ess_grid_trans_query_' . $data['id'] . $lang_code); //delete cache } $result = Essential_Grid_Base::output_demo_skin_html($data); if (isset($result['error'])) { Essential_Grid::ajaxResponseData($result); } else { Essential_Grid::ajaxResponseData(array("data" => array('html' => $result['html'], 'preview' => @$result['preview']))); } break; /* //TP: CHUNK case 'get_preview_html_markup_chunk': //only for custom grid $grid = new Essential_Grid(); $grid->init_by_data($data); $html = ''; if($grid->is_custom_grid()){ ob_start(); $grid->output_by_custom('custom', true); $html = ob_get_contents(); ob_clean(); ob_end_clean(); } $order_id = self::getPostVar("order_id", false); Essential_Grid::ajaxResponseData(array("data"=>array('preview' => $html, 'order_id' => $order_id))); break; */ /* //TP: CHUNK case 'get_preview_html_markup_chunk': //only for custom grid $grid = new Essential_Grid(); $grid->init_by_data($data); $html = ''; if($grid->is_custom_grid()){ ob_start(); $grid->output_by_custom('custom', true); $html = ob_get_contents(); ob_clean(); ob_end_clean(); } $order_id = self::getPostVar("order_id", false); Essential_Grid::ajaxResponseData(array("data"=>array('preview' => $html, 'order_id' => $order_id))); break; */ case 'save_search_settings': if (!empty($data)) { update_option('esg-search-settings', $data); } Essential_Grid::ajaxResponseSuccess(__("Search Settings succesfully saved!", EG_TEXTDOMAIN)); break; case 'update_general_settings': $result = self::savePluginPermission($data['permission']); $cur_query = get_option('tp_eg_query_type', 'wp_query'); update_option('tp_eg_output_protection', @$data['protection']); update_option('tp_eg_tooltips', @$data['tooltips']); update_option('tp_eg_wait_for_fonts', @$data['wait_for_fonts']); update_option('tp_eg_js_to_footer', @$data['js_to_footer']); update_option('tp_eg_use_cache', @$data['use_cache']); update_option('tp_eg_query_type', @$data['query_type']); update_option('tp_eg_enable_log', @$data['enable_log']); update_option('tp_eg_use_lightbox', @$data['use_lightbox']); if (@$data['use_lightbox'] === 'jackbox') { Essential_Grid_Jackbox::enable_jackbox(); } else { Essential_Grid_Jackbox::disable_jackbox(); } if ($cur_query !== $data['query_type']) { //delete cache $lang = array(); if (Essential_Grid_Wpml::is_wpml_exists()) { $lang = icl_get_languages(); } $grids = Essential_Grid::get_essential_grids(); if (!empty($grids)) { foreach ($grids as $grid) { if (!empty($lang)) { foreach ($lang as $code => $val) { delete_transient('ess_grid_trans_query_' . $grid->id . $val['language_code']); delete_transient('ess_grid_trans_full_grid_' . $grid->id . $val['language_code']); } } else { delete_transient('ess_grid_trans_query_' . $grid->id); delete_transient('ess_grid_trans_full_grid_' . $grid->id); } } } } if ($result !== true) { $error = __("Global Settings did not change!", EG_TEXTDOMAIN); } else { Essential_Grid::ajaxResponseSuccess(__("Global Settings succesfully saved!", EG_TEXTDOMAIN), $result); } break; case 'update_create_grid': $result = self::update_create_grid($data); if ($result !== true) { $error = $result; } else { $lang = array(); if (Essential_Grid_Wpml::is_wpml_exists()) { $lang = icl_get_languages(); } if (isset($data['id']) && intval($data['id']) > 0) { if (!empty($lang)) { foreach ($lang as $code => $val) { delete_transient('ess_grid_trans_query_' . $data['id'] . $val['language_code']); //delete cache delete_transient('ess_grid_trans_full_grid_' . $data['id'] . $val['language_code']); //delete cache } } else { delete_transient('ess_grid_trans_query_' . $data['id']); //delete cache delete_transient('ess_grid_trans_full_grid_' . $data['id']); //delete cache } Essential_Grid::ajaxResponseSuccess(__("Grid successfully saved/changed!", EG_TEXTDOMAIN), $result); } else { Essential_Grid::ajaxResponseSuccess(__("Grid successfully saved/changed!", EG_TEXTDOMAIN), array('data' => $result, 'is_redirect' => true, 'redirect_url' => self::getViewUrl(Essential_Grid_Admin::VIEW_OVERVIEW))); } } break; case 'delete_grid': $result = self::delete_grid_by_id($data); if ($result !== true) { $error = $result; } else { Essential_Grid::ajaxResponseSuccess(__("Grid deleted", EG_TEXTDOMAIN), array('data' => $result, 'is_redirect' => true, 'redirect_url' => self::getViewUrl(Essential_Grid_Admin::VIEW_OVERVIEW))); } break; case 'duplicate_grid': $result = self::duplicate_grid_by_id($data); if ($result !== true) { $error = $result; } else { Essential_Grid::ajaxResponseSuccess(__("Grid duplicated", EG_TEXTDOMAIN), array('data' => $result, 'is_redirect' => true, 'redirect_url' => self::getViewUrl(Essential_Grid_Admin::VIEW_OVERVIEW))); } break; case 'update_create_item_skin': $result = Essential_Grid_Item_Skin::update_save_item_skin($data); if ($result !== true) { $error = $result; } else { if (isset($data['id']) && intval($data['id']) > 0) { Essential_Grid::ajaxResponseSuccess(__("Item Skin changed", EG_TEXTDOMAIN), array('data' => $result)); } else { Essential_Grid::ajaxResponseSuccess(__("Item Skin created/changed", EG_TEXTDOMAIN), array('data' => $result, 'is_redirect' => true, 'redirect_url' => self::getViewUrl("", "", 'essential-' . Essential_Grid_Admin::VIEW_SUB_ITEM_SKIN_OVERVIEW))); } } break; case 'update_custom_css': if (isset($data['global_css'])) { Essential_Grid_Global_Css::set_global_css_styles($data['global_css']); Essential_Grid::ajaxResponseSuccess(__("CSS saved!", EG_TEXTDOMAIN), ''); } else { $error = __("No CSS Received", EG_TEXTDOMAIN); } break; case 'delete_item_skin': $result = Essential_Grid_Item_Skin::delete_item_skin_by_id($data); if ($result !== true) { $error = $result; } else { Essential_Grid::ajaxResponseSuccess(__("Item Skin deleted", EG_TEXTDOMAIN), array('data' => $result)); } break; case 'duplicate_item_skin': $result = Essential_Grid_Item_Skin::duplicate_item_skin_by_id($data); if ($result !== true) { $error = $result; } else { Essential_Grid::ajaxResponseSuccess(__("Item Skin duplicated", EG_TEXTDOMAIN), array('data' => $result, 'is_redirect' => true, 'redirect_url' => self::getViewUrl("", "", 'essential-' . Essential_Grid_Admin::VIEW_SUB_ITEM_SKIN_OVERVIEW))); } break; case 'star_item_skin': $result = Essential_Grid_Item_Skin::star_item_skin_by_id($data); if ($result !== true) { $error = $result; } else { Essential_Grid::ajaxResponseSuccess(__("Favorite Changed", EG_TEXTDOMAIN), array('data' => $result)); } break; case 'update_create_item_element': $result = Essential_Grid_Item_Element::update_create_essential_item_element($data); if ($result !== true) { $error = $result; } else { Essential_Grid::ajaxResponseSuccess(__("Item Element created/changed", EG_TEXTDOMAIN), array('data' => $result)); } break; case 'check_item_element_existence': $result = Essential_Grid_Item_Element::check_existence_by_handle(@$data['name']); if ($result === false) { Essential_Grid::ajaxResponseData(array("data" => array('existence' => 'false'))); } elseif ($result === true) { Essential_Grid::ajaxResponseData(array("data" => array('existence' => 'true'))); } else { Essential_Grid::ajaxResponseData(array("data" => array('existence' => $result))); } break; case 'get_predefined_elements': $elements = Essential_Grid_Item_Element::getElementsForJavascript(); $html_elements = Essential_Grid_Item_Element::prepareDefaultElementsForEditor(); $html_elements .= Essential_Grid_Item_Element::prepareTextElementsForEditor(); Essential_Grid::ajaxResponseData(array("data" => array('elements' => $elements, 'html' => $html_elements))); break; case 'delete_predefined_elements': $result = Essential_Grid_Item_Element::delete_element_by_handle($data); if ($result !== true) { $error = $result; } else { Essential_Grid::ajaxResponseSuccess(__("Item Element successfully deleted", EG_TEXTDOMAIN), array('data' => $result)); } break; case 'update_create_navigation_skin_css': $nav = new Essential_Grid_Navigation(); $result = $nav->update_create_navigation_skin_css($data); if ($result !== true) { $error = $result; } else { $base = new Essential_Grid_Base(); $skin_css = Essential_Grid_Navigation::output_navigation_skins(); $skins = Essential_Grid_Navigation::get_essential_navigation_skins(); $select = ''; foreach ($skins as $skin) { $select .= '<option value="' . $skin['handle'] . '">' . $skin['name'] . '</option>' . "\n"; } if (isset($data['sid']) && intval($data['sid']) > 0) { Essential_Grid::ajaxResponseSuccess(__("Navigation Skin successfully changed!", EG_TEXTDOMAIN), array('css' => $skin_css, 'select' => $select, 'default_skins' => $skins)); } else { Essential_Grid::ajaxResponseSuccess(__("Navigation Skin successfully created", EG_TEXTDOMAIN), array('css' => $skin_css, 'select' => $select, 'default_skins' => $skins)); } } break; case 'delete_navigation_skin_css': $nav = new Essential_Grid_Navigation(); $result = $nav->delete_navigation_skin_css($data); if ($result !== true) { $error = $result; } else { $base = new Essential_Grid_Base(); $skin_css = Essential_Grid_Navigation::output_navigation_skins(); $skins = Essential_Grid_Navigation::get_essential_navigation_skins(); $select = ''; foreach ($skins as $skin) { $select .= '<option value="' . $skin['handle'] . '">' . $skin['name'] . '</option>' . "\n"; } Essential_Grid::ajaxResponseSuccess(__("Navigation Skin successfully deleted!", EG_TEXTDOMAIN), array('css' => $skin_css, 'select' => $select, 'default_skins' => $skins)); } break; case 'get_post_meta_html_for_editor': if (!isset($data['post_id']) || intval($data['post_id']) == 0) { Essential_Grid::ajaxResponseError(__('No Post ID/Wrong Post ID!', EG_TEXTDOMAIN), false); exit; } if (!isset($data['grid_id']) || intval($data['grid_id']) == 0) { Essential_Grid::ajaxResponseError(__('Please save the grid first to use this feature!', EG_TEXTDOMAIN), false); exit; } $post = get_post($data['post_id']); $disable_advanced = true; //nessecary, so that only normal things can be changed in preview mode if (!empty($post)) { $grid_id = $data['grid_id']; ob_start(); require 'views/elements/grid-meta-box.php'; $content = ob_get_contents(); ob_clean(); ob_end_clean(); Essential_Grid::ajaxResponseData(array("data" => array('html' => $content))); } else { Essential_Grid::ajaxResponseError(__('Post not found!', EG_TEXTDOMAIN), false); exit; } break; case 'update_post_meta_through_editor': if (!isset($data['metas']) || !isset($data['metas']['post_id']) || intval($data['metas']['post_id']) == 0) { Essential_Grid::ajaxResponseError(__('No Post ID/Wrong Post ID!', EG_TEXTDOMAIN), false); exit; } if (!isset($data['metas']) || !isset($data['metas']['grid_id']) || intval($data['metas']['grid_id']) == 0) { Essential_Grid::ajaxResponseError(__('Please save the grid first to use this feature!', EG_TEXTDOMAIN), false); exit; } //set the cobbles setting to the post $cobbles = json_decode(get_post_meta($data['metas']['post_id'], 'eg_cobbles', true), true); $cobbles[$data['metas']['grid_id']]['cobbles'] = $data['metas']['eg_cobbles_size']; $cobbles = json_encode($cobbles); update_post_meta($data['metas']['post_id'], 'eg_cobbles', $cobbles); //set the use_skin setting to the post $use_skin = json_decode(get_post_meta($data['metas']['post_id'], 'eg_use_skin', true), true); $use_skin[$data['metas']['grid_id']]['use-skin'] = $data['metas']['eg_use_skin']; $use_skin = json_encode($use_skin); update_post_meta($data['metas']['post_id'], 'eg_use_skin', $use_skin); $result = self::custom_meta_box_save($data['metas']['post_id'], $data['metas'], true); self::check_for_transient_deletion($data['metas']['post_id']); if ($result === true) { Essential_Grid::ajaxResponseSuccess(__("Post Meta saved!", EG_TEXTDOMAIN), array()); } else { Essential_Grid::ajaxResponseError(__('Post not found!', EG_TEXTDOMAIN), false); exit; } break; case 'trigger_post_meta_visibility': if (!isset($data['post_id']) || intval($data['post_id']) == 0) { Essential_Grid::ajaxResponseError(__('No Post ID/Wrong Post ID!', EG_TEXTDOMAIN), false); exit; } if (!isset($data['grid_id']) || intval($data['grid_id']) == 0) { Essential_Grid::ajaxResponseError(__('Please save the grid first to use this feature!', EG_TEXTDOMAIN), false); exit; } $visibility = json_decode(get_post_meta($data['post_id'], 'eg_visibility', true), true); $found = false; if (!empty($visibility) && is_array($visibility)) { foreach ($visibility as $grid => $setting) { if ($grid == $data['grid_id']) { if ($setting == false) { $visibility[$grid] = true; } else { $visibility[$grid] = false; } $found = true; break; } } } if (!$found) { $visibility[$data['grid_id']] = false; } $visibility = json_encode($visibility); update_post_meta($data['post_id'], 'eg_visibility', $visibility); self::check_for_transient_deletion($data['post_id']); Essential_Grid::ajaxResponseSuccess(__("Visibility of Post for this Grid changed!", EG_TEXTDOMAIN), array()); break; case 'get_image_by_id': if (!isset($data['img_id']) || intval($data['img_id']) == 0) { $error = __('Wrong Image ID given', EG_TEXTDOMAIN); } else { $img = wp_get_attachment_image_src($data['img_id'], 'full'); if ($img !== false) { Essential_Grid::ajaxResponseSuccess('', array('url' => $img[0])); } else { $error = __('Image with given ID does not exist', EG_TEXTDOMAIN); } } break; case 'activate_purchase_code': $result = false; if (!empty($data['username']) && !empty($data['api_key']) && !empty($data['code'])) { $result = Essential_Grid_Admin::check_purchase_verification($data); } else { $error = __('The API key, the Purchase Code and the Username need to be set!', EG_TEXTDOMAIN); } if ($result === true) { Essential_Grid::ajaxResponseSuccess(__('Purchase Code Successfully Activated', EG_TEXTDOMAIN), array('data' => $result, 'is_redirect' => true, 'redirect_url' => self::getViewUrl("", "", 'essential-' . Essential_Grid_Admin::VIEW_START))); } else { if ($result !== false) { $error = $result; } else { $error = __('Purchase Code is invalid', EG_TEXTDOMAIN); } Essential_Grid::ajaxResponseError($error, false); exit; } break; case 'deactivate_purchase_code': $result = Essential_Grid_Admin::do_purchase_deactivation($data); if ($result === true) { Essential_Grid::ajaxResponseSuccess(__('Successfully removed validation', EG_TEXTDOMAIN), array('data' => $result, 'is_redirect' => true, 'redirect_url' => self::getViewUrl("", "", 'essential-' . Essential_Grid_Admin::VIEW_START))); } else { if ($result !== false) { $error = $result; } else { $error = __('Could not remove Validation!', EG_TEXTDOMAIN); } Essential_Grid::ajaxResponseError($error, false); exit; } break; case 'dismiss_notice': update_option('tp_eg_valid-notice', 'false'); Essential_Grid::ajaxResponseSuccess('.'); break; case 'import_default_post_data': try { require EG_PLUGIN_PATH . 'includes/assets/default-posts.php'; require EG_PLUGIN_PATH . 'includes/assets/default-grids-meta-fonts.php'; if (isset($json_tax)) { $import_tax = new PunchPost(); $import_tax->import_taxonomies($json_tax); } //insert meta, grids & punchfonts $im = new Essential_Grid_Import(); if (isset($tp_grid_meta_fonts)) { $tp_grid_meta_fonts = json_decode($tp_grid_meta_fonts, true); $grids = @$tp_grid_meta_fonts['grids']; if (!empty($grids) && is_array($grids)) { $grids_imported = $im->import_grids($grids); } $custom_metas = @$tp_grid_meta_fonts['custom-meta']; if (!empty($custom_metas) && is_array($custom_metas)) { $custom_metas_imported = $im->import_custom_meta($custom_metas); } $custom_fonts = @$tp_grid_meta_fonts['punch-fonts']; if (!empty($custom_fonts) && is_array($custom_fonts)) { $custom_fonts_imported = $im->import_punch_fonts($custom_fonts); } } if (isset($json_posts)) { $import = new PunchPort(); $import->set_tp_import_posts($json_posts); $import->import_custom_posts(); } Essential_Grid::ajaxResponseSuccess(__('Demo data successfully imported', EG_TEXTDOMAIN), array()); } catch (Exception $d) { $error = __('Something went wrong, please contact the developer', EG_TEXTDOMAIN); } break; case 'export_data': $export_grids = self::getPostVar('export-grids-id', false); $export_skins = self::getPostVar('export-skins-id', false); $export_elements = self::getPostVar('export-elements-id', false); $export_navigation_skins = self::getPostVar('export-navigation-skins-id', false); $export_global_styles = self::getPostVar('export-global-styles', false); $export_custom_meta = self::getPostVar('export-custom-meta-handle', false); $export_punch_fonts = self::getPostVar('export-punch-fonts-handle', false); header('Content-Type: text/json'); header('Content-Disposition: attachment;filename=ess_grid.json'); ob_start(); $export = array(); $ex = new Essential_Grid_Export(); //export Grids if (!empty($export_grids)) { $export['grids'] = $ex->export_grids($export_grids); } //export Skins if (!empty($export_skins)) { $export['skins'] = $ex->export_skins($export_skins); } //export Elements if (!empty($export_elements)) { $export['elements'] = $ex->export_elements($export_elements); } //export Navigation Skins if (!empty($export_navigation_skins)) { $export['navigation-skins'] = $ex->export_navigation_skins($export_navigation_skins); } //export Custom Meta if (!empty($export_custom_meta)) { $export['custom-meta'] = $ex->export_custom_meta($export_custom_meta); } //export Punch Fonts if (!empty($export_punch_fonts)) { $export['punch-fonts'] = $ex->export_punch_fonts($export_punch_fonts); } //export Global Styles if ($export_global_styles == 'on') { $export['global-css'] = $ex->export_global_styles($export_global_styles); } echo json_encode($export); $content = ob_get_contents(); ob_clean(); ob_end_clean(); echo $content; exit; break; case 'import_data': if (!isset($data['imports']) || empty($data['imports'])) { Essential_Grid::ajaxResponseError(__('No data for import selected', EG_TEXTDOMAIN), false); exit; } try { $im = new Essential_Grid_Import(); $temp_d = @$data['imports']; unset($temp_d['data-grids']); unset($temp_d['data-skins']); unset($temp_d['data-elements']); unset($temp_d['data-navigation-skins']); unset($temp_d['data-global-css']); $im->set_overwrite_data($temp_d); //set overwrite data global to class $skins = @$data['imports']['data-skins']; if (!empty($skins) && is_array($skins)) { foreach ($skins as $key => $skin) { $tskin = json_decode(stripslashes($skin), true); if (empty($tskin)) { $tskin = json_decode($skin, true); } $skins[$key] = $tskin; } if (!empty($skins)) { $skins_ids = @$data['imports']['import-skins-id']; $skins_imported = $im->import_skins($skins, $skins_ids); } } $navigation_skins = @$data['imports']['data-navigation-skins']; if (!empty($navigation_skins) && is_array($navigation_skins)) { foreach ($navigation_skins as $key => $navigation_skin) { $tnavigation_skin = json_decode(stripslashes($navigation_skin), true); if (empty($tnavigation_skin)) { $tnavigation_skin = json_decode($navigation_skin, true); } $navigation_skins[$key] = $tnavigation_skin; } if (!empty($navigation_skins)) { $navigation_skins_ids = @$data['imports']['import-navigation-skins-id']; $navigation_skins_imported = $im->import_navigation_skins(@$navigation_skins, $navigation_skins_ids); } } $grids = @$data['imports']['data-grids']; if (!empty($grids) && is_array($grids)) { foreach ($grids as $key => $grid) { $tgrid = json_decode(stripslashes($grid), true); if (empty($tgrid)) { $tgrid = json_decode($grid, true); } $grids[$key] = $tgrid; } if (!empty($grids)) { $grids_ids = @$data['imports']['import-grids-id']; $grids_imported = $im->import_grids($grids, $grids_ids); } } $elements = @$data['imports']['data-elements']; if (!empty($elements) && is_array($elements)) { foreach ($elements as $key => $element) { $telement = json_decode(stripslashes($element), true); if (empty($telement)) { $telement = json_decode($element, true); } $elements[$key] = $telement; } if (!empty($elements)) { $elements_ids = @$data['imports']['import-elements-id']; $elements_imported = $im->import_elements(@$elements, $elements_ids); } } $custom_metas = @$data['imports']['data-custom-meta']; if (!empty($custom_metas) && is_array($custom_metas)) { foreach ($custom_metas as $key => $custom_meta) { $tcustom_meta = json_decode(stripslashes($custom_meta), true); if (empty($tcustom_meta)) { $tcustom_meta = json_decode($custom_meta, true); } $custom_metas[$key] = $tcustom_meta; } if (!empty($custom_metas)) { $custom_metas_handle = @$data['imports']['import-custom-meta-handle']; $custom_metas_imported = $im->import_custom_meta($custom_metas, $custom_metas_handle); } } $custom_fonts = @$data['imports']['data-punch-fonts']; if (!empty($custom_fonts) && is_array($custom_fonts)) { foreach ($custom_fonts as $key => $custom_font) { $tcustom_font = json_decode(stripslashes($custom_font), true); if (empty($tcustom_font)) { $tcustom_font = json_decode($custom_font, true); } $custom_fonts[$key] = $tcustom_font; } if (!empty($custom_fonts)) { $custom_fonts_handle = @$data['imports']['import-punch-fonts-handle']; $custom_fonts_imported = $im->import_punch_fonts($custom_fonts, $custom_fonts_handle); } } if (@$data['imports']['import-global-styles'] == 'on') { $global_css = @$data['imports']['data-global-css']; $tglobal_css = stripslashes($global_css); if (empty($tglobal_css)) { $tglobal_css = $global_css; } $global_styles_imported = $im->import_global_styles($tglobal_css); } Essential_Grid::ajaxResponseSuccess(__('Successfully imported data', EG_TEXTDOMAIN), array('is_redirect' => true, 'redirect_url' => self::getViewUrl("", "", 'essential-' . Essential_Grid_Admin::VIEW_START))); } catch (Exception $d) { $error = __('Something went wrong, please contact the developer', EG_TEXTDOMAIN); } break; case 'delete_full_cache': $lang = array(); if (Essential_Grid_Wpml::is_wpml_exists()) { $lang = icl_get_languages(); } $grids = Essential_Grid::get_essential_grids(); if (!empty($grids)) { foreach ($grids as $grid) { if (!empty($lang)) { foreach ($lang as $code => $val) { delete_transient('ess_grid_trans_query_' . $grid->id . $val['language_code']); delete_transient('ess_grid_trans_full_grid_' . $grid->id . $val['language_code']); } } else { delete_transient('ess_grid_trans_query_' . $grid->id); delete_transient('ess_grid_trans_full_grid_' . $grid->id); } } } Essential_Grid::ajaxResponseSuccess(__('Successfully deleted all cache', EG_TEXTDOMAIN), array()); break; case "get_image_url": if (isset($data['imageid']) && intval($data['imageid']) > 0) { $img_atts = wp_get_attachment_image_src($data['imageid']); if ($img_atts !== false) { $img_src = $img_atts[0]; Essential_Grid::ajaxResponseSuccess(__("Image URL found", EG_TEXTDOMAIN), array('url' => $img_src, 'imageid' => $data['imageid'])); } } $error = __('No correct image ID given', EG_TEXTDOMAIN); break; case "toggle_grid_favorite": if (isset($data['id']) && intval($data['id']) > 0) { $return = self::toggle_favorite_by_id($data['id']); if ($return === true) { Essential_Grid::ajaxResponseSuccess(__("Favorite Set", EG_TEXTDOMAIN)); } else { $error = $return; } } else { $error = __('No ID given', EG_TEXTDOMAIN); } break; case "subscribe_to_newsletter": if (isset($data['email']) && !empty($data['email'])) { $return = ThemePunch_Newsletter::subscribe($data['email']); if ($return !== false) { if (!isset($return['status']) || $return['status'] === 'error') { $error = isset($return['message']) && !empty($return['message']) ? $return['message'] : __('Invalid Email', EG_TEXTDOMAIN); } else { Essential_Grid::ajaxResponseSuccess(__("Success! Please check your Emails to finish the subscribtion", EG_TEXTDOMAIN), $return); } } else { $error = __('Invalid Email/Could not connect to the Newsletter server', EG_TEXTDOMAIN); } } else { $error = __('No Email given', EG_TEXTDOMAIN); } break; case "unsubscribe_to_newsletter": if (isset($data['email']) && !empty($data['email'])) { $return = ThemePunch_Newsletter::unsubscribe($data['email']); if ($return !== false) { if (!isset($return['status']) || $return['status'] === 'error') { $error = isset($return['message']) && !empty($return['message']) ? $return['message'] : __('Invalid Email', EG_TEXTDOMAIN); } else { Essential_Grid::ajaxResponseSuccess(__("Success! Please check your Emails to finish the process", EG_TEXTDOMAIN), $return); } } else { $error = __('Invalid Email/Could not connect to the Newsletter server', EG_TEXTDOMAIN); } } else { $error = __('No Email given', EG_TEXTDOMAIN); } break; default: $error = true; break; } } else { $error = true; } if ($error !== false) { $showError = __("Wrong Request!", EG_TEXTDOMAIN); if ($error !== true) { $showError = __("Ajax Error: ", EG_TEXTDOMAIN) . $error; } Essential_Grid::ajaxResponseError($showError, false); } exit; } catch (Exception $e) { exit; } }
<div class="divider1"></div> <div class="eg-creative-settings"> <div class="eg-cs-tbc-left"> <h3><span><?php _e('Item Skins', EG_TEXTDOMAIN); ?> </span></h3> </div> <div class="eg-cs-tbc eg-photoshop-bg"> <div id="eg-selected-skins-wrapper"> <div id="eg-selected-skins-default"> <?php $skins_c = new Essential_Grid_Item_Skin(); $navigation_c = new Essential_Grid_Navigation(); $grid_c = new Essential_Grid(); $grid_skin_sel['id'] = 'even'; $grid_skin_sel['name'] = __('Skin Selector', EG_TEXTDOMAIN); $grid_skin_sel['handle'] = 'skin-selector'; $grid_skin_sel['postparams'] = array(); $grid_skin_sel['layers'] = array(); $grid_skin_sel['params'] = array('navigation-skin' => ''); //leave empty, we use no skin $skins_html = ''; $skins_css = ''; $filters = array(); $skins = $skins_c->get_essential_item_skins(); $demo_img = array(); for ($i = 1; $i <= 18; $i++) { $demo_img[] = 'demoimage1.jpg';
/** * Output Filter from custom grid * @since 1.0.6 */ public function output_filter_by_custom() { $base = new Essential_Grid_Base(); $nav = new Essential_Grid_Navigation(); $filter_allow = $base->getVar($this->grid_params, 'filter-arrows', 'single'); $filter_start = $base->getVar($this->grid_params, 'filter-start', ''); $filter_all_text = $base->getVar($this->grid_params, 'filter-all-text', __('Filter - All', EG_TEXTDOMAIN)); $filter_dropdown_text = $base->getVar($this->grid_params, 'filter-dropdown-text', __('Filter Categories', EG_TEXTDOMAIN)); $show_count = $base->getVar($this->grid_params, 'filter-counter', 'off'); $nav->set_dropdown_text($filter_dropdown_text); $nav->set_show_count($show_count); $nav->set_filter_text($filter_all_text); $found_filter = array(); if (!empty($this->grid_layers) && count($this->grid_layers) > 0) { foreach ($this->grid_layers as $key => $entry) { $filters = array(); if (!empty($entry['custom-filter'])) { $cats = explode(',', $entry['custom-filter']); if (!is_array($cats)) { $cats = (array) $cats; } foreach ($cats as $category) { $filters[sanitize_key($category)] = array('name' => $category, 'slug' => sanitize_key($category)); $found_filter = $found_filter + $filters; //these are the found filters, only show filter that the posts have } } } } $nav->set_filter($found_filter); //set filters $nav_filters $found_filter $nav->set_filter_type($filter_allow); $nav->set_filter_start_select($filter_start); $nav->output_filter(); }
if (!defined('ABSPATH')) { exit; } //force the js file to be included wp_enqueue_script('essential-grid-item-editor-script', EG_PLUGIN_URL . 'admin/assets/js/grid-editor.js', array('jquery'), Essential_Grid::VERSION); ?> <h2 class="topheader"><?php _e('Overview', EG_TEXTDOMAIN); ?> </h2> <div id="eg-grid-even-item-skin-wrapper"> <?php $skins_c = new Essential_Grid_Item_Skin(); $navigation_c = new Essential_Grid_Navigation(); $grid_c = new Essential_Grid(); $grid['id'] = '1'; $grid['name'] = __('Overview', EG_TEXTDOMAIN); $grid['handle'] = 'overview'; $grid['postparams'] = array(); $grid['layers'] = array(); $grid['params'] = array('layout' => 'masonry', 'navigation-skin' => 'backend-flat', 'filter-arrows' => 'single', 'navigation-padding' => '0 0 0 0', 'force_full_width' => 'off', 'rows-unlimited' => 'off', 'rows' => 3, 'columns' => array(4, 3, 3, 2, 2, 2, 1), 'columns-width' => array(1400, 1170, 1024, 960, 778, 640, 480), 'spacings' => 15, 'grid-animation' => 'fade', 'grid-animation-speed' => 800, 'grid-animation-delay' => 5, 'x-ratio' => 4, 'y-ratio' => 3); $skins_html = ''; $skins_css = ''; $filters = array(); $skins = $skins_c->get_essential_item_skins(); $demo_img = array(); for ($i = 1; $i <= 4; $i++) { $demo_img[] = 'demoimage' . $i . '.jpg'; }
* Represents the view for the administration dashboard. * * This includes the header, options, and other information that should provide * The User Interface to the end user. * * @package Essential_Grid * @author ThemePunch <*****@*****.**> * @link http://www.themepunch.com/essential/ * @copyright 2014 ThemePunch */ if (!defined('ABSPATH')) { exit; } $grid = false; $base = new Essential_Grid_Base(); $nav_skin = new Essential_Grid_Navigation(); $wa = new Essential_Grid_Widget_Areas(); $meta = new Essential_Grid_Meta(); $isCreate = $base->getGetVar('create', 'true'); $title = __('Create New Ess. Grid', EG_TEXTDOMAIN); $save = __('Save Grid', EG_TEXTDOMAIN); $layers = false; if (intval($isCreate) > 0) { //currently editing $grid = Essential_Grid::get_essential_grid_by_id(intval($isCreate)); if (!empty($grid)) { $title = __('Settings', EG_TEXTDOMAIN); $layers = $grid['layers']; } } $postTypesWithCats = $base->getPostTypesWithCatsForClient();
public function import_navigation_skins($import_navigation_skins, $import_ids, $check_append = true) { if ($import_navigation_skins !== false && !empty($import_navigation_skins)) { global $wpdb; $c_nav = new Essential_Grid_Navigation(); $base = new Essential_Grid_Base(); $table_name = $wpdb->prefix . Essential_Grid::TABLE_NAVIGATION_SKINS; $nav_skins = $c_nav->get_essential_navigation_skins(); foreach ($import_navigation_skins as $i_nav_skin) { if (!empty($import_ids) && is_array($import_ids)) { $found = false; foreach ($import_ids as $id) { if ($i_nav_skin['id'] == $id) { $found = true; break; } } if (!$found) { continue; } } else { break; } $exist = false; if (!empty($nav_skins)) { foreach ($nav_skins as $nav_skin) { if ($nav_skin['handle'] == $i_nav_skin['handle']) { $i_nav_skin['id'] = $nav_skin['id']; //this will force an update $exist = true; break; } } } $append = true; if ($exist) { //skin exists - append or overwrite if ($check_append) { //check in $_POST if append or overwrite $do = $base->getVar($this->overwrite_data, 'nav-skin-overwrite-' . $i_nav_skin['id'], 'append'); $append = $do == 'append' ? true : false; } } if ($append) { //append if ($exist) { $orig_handle = $i_nav_skin['handle']; $i_nav_skin['handle'] = $i_nav_skin['handle'] . '-' . date('His'); $i_nav_skin['name'] = $i_nav_skin['name'] . '-' . date('His'); $i_nav_skin['css'] = str_replace($orig_handle, $i_nav_skin['handle'], $i_nav_skin['css']); //replace the class name to the new name } $response = $wpdb->insert($table_name, array('name' => $i_nav_skin['name'], 'handle' => $i_nav_skin['handle'], 'css' => $i_nav_skin['css'])); } else { //overwrite $response = $wpdb->update($table_name, array('css' => $i_nav_skin['css']), array('id' => $i_nav_skin['id'])); } } } }
/** * update to 2.0.1 * @since: 2.0.1 * @does: adds navigation skins to support search further, fixing some missing styles */ public function update_to_201() { //update navigation skins to support search $nav = new Essential_Grid_Navigation(); $navigation_skins = array(array('handle' => 'simple-light', 'css' => '/* SIMPLE LIGHT SEARCH 2.0.1 */ .simple-light input.eg-search-input[type="text"] { border-radius: 0px !important; height: 32px; box-sizing: border-box; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; } .simple-light .eg-search-submit, .simple-light .eg-search-clean { width:32px;height:32px; box-sizing: border-box; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; }'), array('handle' => 'minimal-dark', 'css' => '/* MINIMAL DARK SEARCH 2.0.1 */ .minimal-dark input.eg-search-input[type="text"] { height: 40px; box-sizing: border-box; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; } .minimal-dark .eg-search-submit, .minimal-dark .eg-search-clean { box-sizing: border-box; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; }'), array('handle' => 'minimal-light', 'css' => '/* MINIMAL LIGHT SEARCH 2.0.1 */ .minimal-light .eg-search-submit, .minimal-light .eg-search-clean { box-sizing: border-box; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; }'), array('handle' => 'simple-dark', 'css' => '/* SIMPLE DARK SEARCH 2.0.1 */ .simple-dark input.eg-search-input[type="text"] { box-sizing: border-box; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; height: 34px; border-radius: 0px !important; }')); foreach ($navigation_skins as $skin) { $old_skin = $nav->get_essential_navigation_skin_by_handle($skin['handle']); if ($old_skin !== false) { $old_skin['css'] .= "\n\n\n" . $skin['css']; //modify variables to meet requirement for update function $old_skin['skin_css'] = $old_skin['css']; $old_skin['sid'] = $old_skin['id']; unset($old_skin['name']); unset($old_skin['css']); unset($old_skin['id']); $nav->update_create_navigation_skin_css($old_skin); } } $this->update_version('2.0.1'); $this->set_version('2.0.1'); }
public function export_essential_grid() { require_once ABSPATH . 'wp-content/plugins/essential-grid/essential-grid.php'; $c_grid = new Essential_Grid(); $export_grids = array(); $grids = $c_grid->get_essential_grids(); foreach ($grids as $grid) { $export_grids[] = $grid->id; } $export_skins = array(); $item_skin = new Essential_Grid_Item_Skin(); $skins = $item_skin->get_essential_item_skins('all', false); foreach ($skins as $skin) { $export_grids[] = $skin['id']; } $export_elements = array(); $c_elements = new Essential_Grid_Item_Element(); $elements = $c_elements->get_essential_item_elements(); foreach ($elements as $element) { $export_elements[] = $element['id']; } $export_navigation_skins = array(); $c_nav_skins = new Essential_Grid_Navigation(); $nav_skins = $c_nav_skins->get_essential_navigation_skins(); foreach ($nav_skins as $nav_skin) { $export_navigation_skins[] = $nav_skin['id']; } $export_custom_meta = array(); $metas = new Essential_Grid_Meta(); $custom_metas = $metas->get_all_meta(); foreach ($custom_metas as $custom_meta) { $export_custom_meta[] = $custom_meta['handle']; } $export_punch_fonts = array(); $fonts = new ThemePunch_Fonts(); $custom_fonts = $fonts->get_all_fonts(); foreach ($custom_fonts as $custom_font) { $export_punch_fonts[] = $custom_font['handle']; } $export = array(); $ex = new Essential_Grid_Export(); //export Grids if (!empty($export_grids)) { $export['grids'] = $ex->export_grids($export_grids); } //export Skins if (!empty($export_skins)) { $export['skins'] = $ex->export_skins($export_skins); } //export Elements if (!empty($export_elements)) { $export['elements'] = $ex->export_elements($export_elements); } //export Navigation Skins if (!empty($export_navigation_skins)) { $export['navigation-skins'] = $ex->export_navigation_skins($export_navigation_skins); } //export Custom Meta if (!empty($export_custom_meta)) { $export['custom-meta'] = $ex->export_custom_meta($export_custom_meta); } //export Punch Fonts if (!empty($export_punch_fonts)) { $export['punch-fonts'] = $ex->export_punch_fonts($export_punch_fonts); } //export Global Styles $export['global-css'] = $ex->export_global_styles('on'); $this->save_as_txt_file('essential_grid.txt', json_encode($export)); }
public function update_to_110() { //update navigation skins to support dropdowns $nav = new Essential_Grid_Navigation(); $navigation_skins = array(array('handle' => 'flat-light', 'css' => '/* FLAT LIGHT SKIN DROP DOWN 1.1.0 */ .flat-light .esg-filterbutton { color:#000;color:rgba(0,0,0,0.5);} .flat-light .esg-selected-filterbutton { background:#fff; padding:10px 20px 10px 30px; color:#000; border-radius: 4px;font-weight:700;} .flat-light .esg-cartbutton, .flat-light .esg-cartbutton a, .flat-light .esg-cartbutton a:visited, .flat-light .esg-cartbutton a:hover, .flat-light .esg-cartbutton i, .flat-light .esg-cartbutton i.before { font-weight:700; color:#000; } .flat-light .esg-selected-filterbutton .eg-icon-down-open { margin-left:5px;font-size:12px; line-height: 20px; vertical-align: top;} .flat-light .esg-selected-filterbutton:hover .eg-icon-down-open, .flat-light .esg-selected-filterbutton.hoveredfilter .eg-icon-down-open { color:rgba(0,0,0,1); } .flat-light .esg-dropdown-wrapper { border-radius:5px;-moz-border-radius:5px;-webkit-border-radius:5px;} .flat-light .esg-dropdown-wrapper .esg-filterbutton { line-height: 25px; white-space: nowrap; padding:0px 10px; font-weight:700; text-align: left} .flat-light .esg-dropdown-wrapper .esg-filter-checked { display:inline-block; margin-left:0px !important;margin-right:7px; margin-top:-2px !important; line-height: 15px !important;} .flat-light .esg-dropdown-wrapper .esg-filter-checked span { vertical-align: middle; line-height:20px;}'), array('handle' => 'flat-dark', 'css' => '/* FLAT DARK SKIN DROP DOWN 1.1.0 */ .flat-dark .esg-filterbutton { color:#fff !important} .flat-dark .esg-selected-filterbutton { background: #3A3A3A; background: rgba(0, 0, 0, 0.2); padding:10px 20px 10px 30px; color:#fff; border-radius: 4px;font-weight:600; } .flat-dark .esg-cartbutton, .flat-dark .esg-cartbutton a, .flat-dark .esg-cartbutton a:visited, .flat-dark .esg-cartbutton a:hover, .flat-dark .esg-cartbutton i, .flat-dark .esg-cartbutton i.before { font-weight:600; color:#fff; } .flat-dark .esg-selected-filterbutton .eg-icon-down-open { margin-left:5px;font-size:12px; line-height: 20px; vertical-align: top;} .flat-dark .esg-selected-filterbutton:hover .eg-icon-down-open, .flat-dark .esg-selected-filterbutton.hoveredfilter .eg-icon-down-open { color:rgba(255,255,255,1); } .flat-dark .esg-cartbutton:hover, .flat-dark .esg-selected-filterbutton:hover, .flat-dark .esg-selected-filterbutton.hoveredfilter { background: rgba(0, 0, 0, 0.5); } .flat-dark .esg-dropdown-wrapper { background:#222; border-radius:5px;-moz-border-radius:5px;-webkit-border-radius:5px;} .flat-dark .esg-dropdown-wrapper .esg-filterbutton { background:transparent !important;line-height: 25px; white-space: nowrap; padding:0px 10px; font-weight:600; text-align: left; color:#fff; color:rgba(255,255,255,0.5) !important;} .flat-dark .esg-dropdown-wrapper .esg-filterbutton:hover, .flat-dark .esg-dropdown-wrapper .esg-filterbutton.selected { background:transparent !important; color:#fff; color:rgba(255,255,255,1) !important;} .flat-dark .esg-dropdown-wrapper .esg-filter-checked { display:inline-block; margin-left:0px !important;margin-right:7px; margin-top:-2px !important; line-height: 15px !important;} .flat-dark .esg-dropdown-wrapper .esg-filter-checked span { vertical-align: middle; line-height:20px;}'), array('handle' => 'minimal-dark', 'css' => '/* MINIMAL DARK SKIN DROP DOWN 1.1.0 */ .minimal-dark .esg-filterbutton { color:#fff !important} .minimal-dark .esg-selected-filterbutton { background: transparent; border: 1px solid rgba(255, 255, 255, 0.1);background: rgba(0, 0, 0, 0); padding:10px 20px 10px 30px; color:#fff; border-radius: 4px;font-weight:600;} .minimal-dark .esg-cartbutton { border: 1px solid rgba(255, 255, 255, 0.1) !important; border-radius:5px !important; -moz-border-radius:5px !important;-webkit-border-radius:5px !important;} .minimal-dark .esg-cartbutton, .minimal-dark .esg-cartbutton a, .minimal-dark .esg-cartbutton a:visited, .minimal-dark .esg-cartbutton a:hover, .minimal-dark .esg-cartbutton i, .minimal-dark .esg-cartbutton i.before { font-weight:600; color:#fff; } .minimal-dark .esg-selected-filterbutton .eg-icon-down-open { margin-left:5px;font-size:12px; line-height: 20px; vertical-align: top; color:#fff;} .minimal-dark .esg-cartbutton:hover, .minimal-dark .esg-selected-filterbutton:hover, .minimal-dark .esg-selected-filterbutton.hoveredfilter { border-color: rgba(255,255,255,0.2); background: rgba(255,255,255,0.1); } .minimal-dark .esg-dropdown-wrapper { background:#333; background:rgba(0,0,0,0.95);border: 1px solid rgba(255, 255, 255, 0.1);border-radius:5px;-moz-border-radius:5px;-webkit-border-radius:5px;} .minimal-dark .esg-dropdown-wrapper .esg-filterbutton { border:none !important; box-shadow:none !important; background:transparent !important;line-height: 25px; white-space: nowrap; padding:0px 10px; font-weight:600; text-align: left; color:#fff; color:rgba(255,255,255,0.5) !important;} .minimal-dark .esg-dropdown-wrapper .esg-filterbutton:hover, .minimal-dark .esg-dropdown-wrapper .esg-filterbutton.selected { background:transparent !important; color:#fff; color:rgba(255,255,255,1) !important; } .minimal-dark .esg-dropdown-wrapper .esg-filter-checked { display:inline-block; margin-left:0px !important;margin-right:7px; margin-top:-2px !important; line-height: 15px !important; border: 1px solid rgba(255, 255, 255, 0.2)} .minimal-dark .esg-dropdown-wrapper .esg-filter-checked span { vertical-align: middle; line-height:20px;}'), array('handle' => 'minimal-light', 'css' => '/* MINIMAL LIGHT SKIN DROP DOWN 1.1.0 */ .minimal-light .esg-filterbutton { color:#999 !important} .minimal-light .esg-selected-filterbutton { border: 1px solid #E5E5E5;background: #fff; padding:10px 20px 10px 30px; color:#999; border-radius: 4px;font-weight:700; } .minimal-light .esg-selected-filterbutton .eg-icon-down-open { margin-left:5px;font-size:12px; line-height: 20px; vertical-align: top; color:#999;} .minimal-light .esg-filter-wrapper .esg-filterbutton span i { color: #fff !important; } .minimal-light .esg-filter-wrapper .esg-filterbutton:hover span, .minimal-light .esg-filter-wrapper .esg-filterbutton.selected span { color: #000 !important; } .minimal-light .esg-filter-wrapper .esg-filterbutton:hover span i, .minimal-light .esg-filter-wrapper .esg-filterbutton.selected span i { color: #fff !important; } .minimal-light .esg-selected-filterbutton:hover .eg-icon-down-open, .minimal-light .esg-selected-filterbutton.hoveredfilter .eg-icon-down-open { color:rgba(0,0,0,1) !important; } .minimal-light .esg-cartbutton:hover, .minimal-light .esg-selected-filterbutton:hover, .minimal-light .esg-selected-filterbutton.hoveredfilter { border-color: #bbb; color: #333; box-shadow: 0px 3px 5px 0px rgba(0,0,0,0.13); } .minimal-light .esg-dropdown-wrapper { background:#fff; border-radius:5px;-moz-border-radius:5px;-webkit-border-radius:5px; border: 1px solid #bbb; box-shadow: 0px 3px 5px 0px rgba(0,0,0,0.13);} .minimal-light .esg-dropdown-wrapper .esg-filterbutton { border:none !important;line-height: 25px; white-space: nowrap; padding:0px 10px; font-weight:700; text-align: left; color:#999; } .minimal-light .esg-dropdown-wrapper .esg-filterbutton:hover, .minimal-light .esg-dropdown-wrapper .esg-filterbutton.selected { background:transparent !important; color:#000 !important; box-shadow: none !important} .minimal-light .esg-dropdown-wrapper .esg-filter-checked { display:inline-block; margin-left:0px !important;margin-right:7px; margin-top:-2px !important; line-height: 15px !important;} .minimal-light .esg-dropdown-wrapper .esg-filter-checked span { vertical-align: middle; line-height:20px;}'), array('handle' => 'simple-light', 'css' => '/* SIMPLE LIGHT SKIN DROP DOWN 1.1.0 */ .simple-light .esg-filterbutton { color:#999 !important} .simple-light .esg-selected-filterbutton { border: 1px solid #E5E5E5;background: #eee; padding:5px 5px 5px 10px; color:#000; font-weight:400;} .simple-light .esg-selected-filterbutton .eg-icon-down-open { margin-left:5px;font-size:9px; line-height: 20px; vertical-align: top; color:#000;} .simple-light .esg-cartbutton:hover, .simple-light .esg-selected-filterbutton:hover, .simple-light .esg-selected-filterbutton.hoveredfilter { background-color: #fff; border-color: #bbb; color: #333; box-shadow: 0px 3px 5px 0px rgba(0,0,0,0.13); } .simple-light .esg-filter-wrapper .esg-filterbutton span { color: #000; } .simple-light .esg-filter-wrapper .esg-filterbutton:hover span, .simple-light .esg-filter-wrapper .esg-filterbutton.selected span { color: #000 !important; } .simple-light .esg-filter-wrapper .esg-filterbutton:hover span i, .simple-light .esg-filter-wrapper .esg-filterbutton.selected span i { color: #fff !important; } .simple-light .esg-dropdown-wrapper { background:#fff; border: 1px solid #bbb; box-shadow: 0px 3px 5px 0px rgba(0,0,0,0.13);} .simple-light .esg-dropdown-wrapper .esg-filterbutton { border:none !important;background:transparent !important;line-height: 25px; white-space: nowrap; padding:0px 10px; font-weight:400; text-align: left; } .simple-light .esg-dropdown-wrapper .esg-filterbutton span { color:#777; } .simple-light .esg-dropdown-wrapper .esg-filterbutton:hover, .simple-light .esg-dropdown-wrapper .esg-filterbutton.selected { color:#000 !important; box-shadow: none !important} .simple-light .esg-dropdown-wrapper .esg-filter-checked { display:inline-block; margin-left:0px !important;margin-right:7px; margin-top:-2px !important; line-height: 15px !important;} .simple-light .esg-dropdown-wrapper .esg-filter-checked span { vertical-align: middle; line-height:20px;}'), array('handle' => 'simple-dark', 'css' => '/* SIMPLE DARK SKIN DROP DOWN */ .simple-dark .esg-filterbutton { color:#fff !important} .simple-dark .esg-selected-filterbutton { border: 1px solid rgba(255, 255, 255, 0.15);background:rgba(255, 255, 255, 0.08);padding:5px 5px 5px 10px; color:#fff; font-weight:600;} .simple-dark .esg-cartbutton { border: 1px solid rgba(255, 255, 255, 0.1) !important; } .simple-dark .esg-cartbutton, .simple-dark .esg-cartbutton a, .simple-dark .esg-cartbutton a:visited, .simple-dark .esg-cartbutton i, .simple-dark .esg-cartbutton i.before { font-weight:600; color:#fff; } .simple-dark .esg-cartbutton:hover a, .simple-dark .esg-cartbutton:hover i { color: #000; } .simple-dark .esg-selected-filterbutton:hover .eg-icon-down-open, .simple-dark .esg-selected-filterbutton.hoveredfilter .eg-icon-down-open { color:#000; } .simple-dark .esg-cartbutton:hover, .simple-dark .esg-selected-filterbutton:hover, .simple-dark .esg-selected-filterbutton.hoveredfilter { border-color: #fff; color: #000; box-shadow: 0px 3px 5px 0px rgba(0,0,0,0.13); background: #fff; } .simple-dark .esg-selected-filterbutton .eg-icon-down-open { margin-left:5px;font-size:9px; line-height: 20px; vertical-align: top; color:#fff;} .simple-dark .esg-filter-wrapper .esg-filterbutton:hover span, .simple-dark .esg-filter-wrapper .esg-filterbutton.selected span { color: #000 !important; } .simple-dark .esg-dropdown-wrapper { background:#fff; border: 1px solid #bbb; box-shadow: 0px 3px 5px 0px rgba(0,0,0,0.13); } .simple-dark .esg-dropdown-wrapper .esg-filterbutton { border:none !important;background:transparent !important;line-height: 25px; white-space: nowrap; padding:0px 10px; font-weight:600; text-align: left; color:#777 !important; } .simple-light .esg-dropdown-wrapper .esg-filterbutton span { color:#777; } .simple-dark .esg-dropdown-wrapper .esg-filterbutton:hover, .simple-dark .esg-dropdown-wrapper .esg-filterbutton.selected { color:#000 !important; box-shadow: none !important; font-weight: 600;} .simple-dark .esg-dropdown-wrapper .esg-filter-checked { display:inline-block; margin-left:0px !important;margin-right:7px; margin-top:-2px !important; line-height: 15px !important; border: 1px solid #444;} .simple-dark .esg-dropdown-wrapper .esg-filter-checked span { vertical-align: middle; line-height:20px;}'), array('handle' => 'text-dark', 'css' => '/* TEXT DARK SKIN DROP DOWN 1.1.0 */ .text-dark .esg-filterbutton { color: #FFF;color: rgba(255, 255, 255, 0.4) !important} .text-dark .esg-selected-filterbutton { padding:5px 5px 5px 10px; color: #FFF;color: rgba(255, 255, 255, 0.4); font-weight:600;} .text-dark .esg-cartbutton { } .text-dark .esg-cartbutton, .text-dark .esg-cartbutton a, .text-dark .esg-cartbutton a:visited, .text-dark .esg-cartbutton a:hover, .text-dark .esg-cartbutton i, .text-dark .esg-cartbutton i.before { font-weight:600; color: #FFF; color: rgba(255, 255, 255, 0.4); } .text-dark .esg-cartbutton:hover a, .text-dark .esg-cartbutton:hover i { color: rgba(255, 255, 255, 1); } .text-dark .esg-selected-filterbutton:hover .eg-icon-down-open, .text-dark .esg-selected-filterbutton.hoveredfilter .eg-icon-down-open { color: rgba(255, 255, 255, 1); } .text-dark .esg-cartbutton:hover, .text-dark .esg-selected-filterbutton:hover, .text-dark .esg-selected-filterbutton.hoveredfilter { color: rgba(255, 255, 255, 1); } .text-dark .esg-selected-filterbutton .eg-icon-down-open { margin-left:5px;font-size:9px; line-height: 20px; vertical-align: top; color: #FFF;color: rgba(255, 255, 255, 0.4); } .text-dark .esg-filter-wrapper .esg-filterbutton:hover span, .text-dark .esg-filter-wrapper .esg-filterbutton.selected span { color: rgba(255, 255, 255, 1); } .text-dark .esg-dropdown-wrapper { border: 1px solid rgba(0, 0, 0, 0.15); background:#000; background:rgba(0, 0, 0, 0.95); } .text-dark .esg-dropdown-wrapper .esg-filterbutton { border:none !important;background:transparent !important;line-height: 25px; white-space: nowrap; padding:0px 10px; font-weight:600; text-align: left; color:#999 !important; } .text-dark .esg-dropdown-wrapper .esg-filterbutton span { text-decoration: none !important; } .text-dark .esg-dropdown-wrapper .esg-filterbutton:hover, .text-dark .esg-dropdown-wrapper .esg-filterbutton.selected { color:#fff !important; box-shadow: none !important; } .text-dark .esg-dropdown-wrapper .esg-filter-checked { display:inline-block; margin-left:0px !important;margin-right:7px; margin-top:-2px !important; line-height: 15px !important; border: 1px solid #444;} .text-dark .esg-dropdown-wrapper .esg-filterbutton.selected .esg-filter-checked, .text-dark .esg-dropdown-wrapper .esg-filterbutton:hover .esg-filter-checked { color:#fff;} .text-dark .esg-dropdown-wrapper .esg-filter-checked span { vertical-align: middle; line-height:20px; color:#000;}'), array('handle' => 'text-light', 'css' => '/* TEXT LIGHT SKIN DROP DOWN 1.1.0 */ .text-light .esg-filterbutton { color: #999} .text-light .esg-selected-filterbutton { padding:5px 5px 5px 10px; color: #999; font-weight:600;} .text-light .esg-cartbutton { } .text-light .esg-cartbutton, .text-light .esg-cartbutton a, .text-light .esg-cartbutton a:visited, .text-light .esg-cartbutton a:hover, .text-light .esg-cartbutton i, .text-light .esg-cartbutton i.before { font-weight:600; color: #999; } .text-light .esg-cartbutton:hover a, .text-light .esg-cartbutton:hover i { color: #444; } .text-light .esg-selected-filterbutton:hover .eg-icon-down-open, .text-light .esg-selected-filterbutton.hoveredfilter .eg-icon-down-open { color: #444; } .text-light .esg-cartbutton:hover, .text-light .esg-selected-filterbutton:hover, .text-light .esg-selected-filterbutton.hoveredfilter { color: #444; } .text-light .esg-selected-filterbutton .eg-icon-down-open { margin-left:5px;font-size:9px; line-height: 20px; vertical-align: top; color: #999; } .text-light .esg-filter-wrapper .esg-filterbutton:hover span, .text-light .esg-filter-wrapper .esg-filterbutton.selected span { text-decoration: none !important; } .text-light .esg-dropdown-wrapper { border: 1px solid rgba(255, 255, 255, 0.15); background:#fff; background:rgba(255, 255, 255, 0.95); } .text-light .esg-dropdown-wrapper .esg-filterbutton { border:none !important;background:transparent !important;line-height: 25px; white-space: nowrap; padding:0px 10px; font-weight:600; text-align: left; color:#999 !important; } .text-light .esg-dropdown-wrapper .esg-filterbutton span { text-decoration: none !important; } .text-light .esg-dropdown-wrapper .esg-filterbutton:hover, .text-light .esg-dropdown-wrapper .esg-filterbutton.selected { color:#000 !important; box-shadow: none !important; } .text-light .esg-dropdown-wrapper .esg-filter-checked { display:inline-block; margin-left:0px !important;margin-right:7px; margin-top:-2px !important; line-height: 15px !important; border: 1px solid #ddd;} .text-light .esg-dropdown-wrapper .esg-filterbutton.selected .esg-filter-checked, .text-light .esg-dropdown-wrapper .esg-filterbutton:hover .esg-filter-checked { color:#000;} .text-light .esg-dropdown-wrapper .esg-filter-checked span { vertical-align: middle; line-height:20px; color:#000;}')); foreach ($navigation_skins as $skin) { $old_skin = $nav->get_essential_navigation_skin_by_handle($skin['handle']); if ($old_skin !== false) { $old_skin['css'] .= "\n\n\n" . $skin['css']; //modify variables to meet requirement for update function $old_skin['skin_css'] = $old_skin['css']; $old_skin['sid'] = $old_skin['id']; unset($old_skin['name']); unset($old_skin['css']); unset($old_skin['id']); $nav->update_create_navigation_skin_css($old_skin); } } $this->update_version('1.1.0'); $this->set_version('1.1.0'); }