本文整理汇总了PHP中Essential_Grid_Base类的典型用法代码示例。如果您正苦于以下问题:PHP Essential_Grid_Base类的具体用法?PHP Essential_Grid_Base怎么用?PHP Essential_Grid_Base使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Essential_Grid_Base类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: get_meta_query
/**
* get meta query for filtering woocommerce posts.
*/
public static function get_meta_query($args)
{
$base = new Essential_Grid_Base();
$regPriceFrom = $base->getVal($args, self::ARG_REGULAR_PRICE_FROM);
$regPriceTo = $base->getVal($args, self::ARG_REGULAR_PRICE_TO);
$salePriceFrom = $base->getVal($args, self::ARG_SALE_PRICE_FROM);
$salePriceTo = $base->getVal($args, self::ARG_SALE_PRICE_TO);
$inStockOnly = $base->getVal($args, self::ARG_IN_STOCK_ONLY);
$featuredOnly = $base->getVal($args, self::ARG_FEATURED_ONLY);
$arrQueries = array();
//get regular price array
if (!empty($regPriceFrom) || !empty($regPriceTo)) {
$arrQueries[] = self::get_price_query($regPriceFrom, $regPriceTo, self::META_REGULAR_PRICE);
}
//get sale price array
if (!empty($salePriceFrom) || !empty($salePriceTo)) {
$arrQueries[] = self::get_price_query($salePriceFrom, $salePriceTo, self::META_SALE_PRICE);
}
if ($inStockOnly == 'true') {
$query = array('key' => self::META_STOCK_STATUS, 'value' => 'instock');
$arrQueries[] = $query;
}
if ($featuredOnly == 'true') {
$query = array('key' => self::META_FEATURED, 'value' => 'yes');
$arrQueries[] = $query;
}
$query = array();
if (!empty($arrQueries)) {
$query = array('meta_query' => $arrQueries);
}
return $query;
}
开发者ID:pcuervo,项目名称:odc,代码行数:35,代码来源:woocommerce.class.php
示例2: output_global_css_styles_wrapped
/**
* echo global CSS with wrapper
*/
public static function output_global_css_styles_wrapped()
{
$base = new Essential_Grid_Base();
echo '<style type="text/css">';
echo $base->compress_css(self::get_global_css_styles());
echo '</style>' . "\n";
}
开发者ID:Lumbe,项目名称:dev_servus,代码行数:10,代码来源:global-css.class.php
示例3: split_terms_fix
/**
* Search all Grids and change the term IDs set in the selected terms if needed
* @since: 2.1.0
**/
static function split_terms_fix($old_term_id, $new_term_id, $term_taxonomy_id, $taxonomy)
{
$base = new Essential_Grid_Base();
$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) {
$selected = json_decode($grid->postparams, true);
$post_category = $base->getVar($selected, 'post_category');
$cat_tax = $base->getCatAndTaxData($post_category);
$cats = array();
if (!empty($cat_tax['cats'])) {
$cats = explode(',', $cat_tax['cats']);
}
$taxes = array('post_tag');
if (!empty($cat_tax['tax'])) {
$taxes = explode(',', $cat_tax['tax']);
}
$cont = false;
if (!empty($cats)) {
foreach ($cats as $cat) {
if ($old_term_id == $cat && in_array($taxonomy, $taxes)) {
//ID needs to be changed
foreach ($taxes as $t) {
//replace all occuring old term id with the new term id and then Save the Grid
$post_category = str_replace($t . '_' . $old_term_id, $t . '_' . $new_term_id, $post_category);
}
$selected['post_category'] = $post_category;
$grid->postparams = $selected;
$grid->params = json_decode($grid->params, true);
$grid->layers = json_decode($grid->layers, true);
$new_grid = (array) $grid;
//cast to array as update_create_grid expects an array
Essential_Grid_Admin::update_create_grid($new_grid);
//now delete cache of the Grid so that changes take effect immediately
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);
}
$cont = true;
}
if ($cont == true) {
break;
}
}
}
}
}
}
开发者ID:Lumbe,项目名称:dev_servus,代码行数:61,代码来源:wordpress-update-fix.class.php
示例4: export_grids
public function export_grids($export_grids)
{
$return_grids = array();
if ($export_grids !== false && !empty($export_grids)) {
$c_grid = new Essential_Grid();
$base = new Essential_Grid_Base();
$item_skin = new Essential_Grid_Item_Skin();
$grids = $c_grid->get_essential_grids();
if (!empty($grids)) {
foreach ($export_grids as $e_grid_id) {
foreach ($grids as $grid) {
$grid = (array) $grid;
if ($e_grid_id == $grid['id']) {
//change categories/tags id to slug
$check = json_decode($grid['postparams'], true);
if (isset($check['post_category']) && !empty($check['post_category'])) {
$slug_cats = array();
$the_cats = explode(',', $check['post_category']);
foreach ($the_cats as $cat) {
$raw = explode('_', $cat);
$catSlug = $raw[count($raw) - 1];
unset($raw[count($raw) - 1]);
$cat = implode('_', $raw);
$category = $base->get_categories_by_ids((array) $catSlug, $cat);
foreach ($category as $cat_obj) {
$slug_cats[] = $cat . '_' . $cat_obj->slug;
}
}
$check['post_category'] = implode(',', $slug_cats);
$grid['postparams'] = json_encode($check);
}
//change choosen skinid to skinhandle
$check = json_decode($grid['params'], true);
if (isset($check['entry-skin']) && !empty($check['entry-skin']) && intval($check['entry-skin']) != 0) {
$skin = $item_skin->get_handle_by_id($check['entry-skin']);
if (!empty($skin)) {
$check['entry-skin'] = $skin['handle'];
}
$grid['params'] = json_encode($check);
}
$return_grids[] = $grid;
break;
}
}
}
}
}
return $return_grids;
}
开发者ID:kfwebdev,项目名称:wp-atd,代码行数:49,代码来源:export.class.php
示例5: get_allowed_meta
/**
* get list of allowed things on meta
*/
public function get_allowed_meta()
{
$base = new Essential_Grid_Base();
$transitions_media = $base->get_hover_animations(true);
//true will get with in/out
return array(array('name' => array('handle' => 'color', 'text' => __('Font Color', EG_TEXTDOMAIN)), 'type' => 'color', 'default' => '#FFFFFF', 'container' => 'style', 'hover' => 'true'), array('name' => array('handle' => 'font-style', 'text' => __('Font Style', EG_TEXTDOMAIN)), 'type' => 'select', 'default' => 'normal', 'values' => array('normal' => __('Normal', EG_TEXTDOMAIN), 'italic' => __('Italic', EG_TEXTDOMAIN)), 'container' => 'style', 'hover' => 'true'), array('name' => array('handle' => 'text-decoration', 'text' => __('Text Decoration', EG_TEXTDOMAIN)), 'type' => 'select', 'default' => 'none', 'values' => array('none' => __('None', EG_TEXTDOMAIN), 'underline' => __('Underline', EG_TEXTDOMAIN), 'overline' => __('Overline', EG_TEXTDOMAIN), 'line-through' => __('Line Through', EG_TEXTDOMAIN)), 'container' => 'style', 'hover' => 'true'), array('name' => array('handle' => 'text-transform', 'text' => __('Text Transform', EG_TEXTDOMAIN)), 'type' => 'select', 'default' => 'none', 'values' => array('none' => __('None', EG_TEXTDOMAIN), 'capitalize' => __('Capitalize', EG_TEXTDOMAIN), 'uppercase' => __('Uppercase', EG_TEXTDOMAIN), 'lowercase' => __('Lowercase', EG_TEXTDOMAIN)), 'container' => 'style', 'hover' => 'true'), array('name' => array('handle' => 'border-color', 'text' => __('Border Color', EG_TEXTDOMAIN)), 'type' => 'color', 'default' => '#FFFFFF', 'container' => 'style', 'hover' => 'true'), array('name' => array('handle' => 'border-style', 'text' => __('Border Style', EG_TEXTDOMAIN)), 'type' => 'select', 'default' => 'none', 'values' => array('none' => __('None', EG_TEXTDOMAIN), 'solid' => __('solid', EG_TEXTDOMAIN), 'dotted' => __('dotted', EG_TEXTDOMAIN), 'dashed' => __('dashed', EG_TEXTDOMAIN), 'double' => __('double', EG_TEXTDOMAIN)), 'container' => 'style', 'hover' => 'true'), array('name' => array('handle' => 'background', 'text' => __('Background Color', EG_TEXTDOMAIN)), 'type' => 'text', 'default' => 'repeat center center #FFFFFF', 'container' => 'style', 'hover' => 'true'), array('name' => array('handle' => 'box-shadow', 'text' => __('Box Shadow', EG_TEXTDOMAIN)), 'type' => 'text', 'default' => '0px 0px 0px 0px #000000', 'container' => 'style', 'hover' => 'true'), array('name' => array('handle' => 'transition', 'text' => __('Transition', EG_TEXTDOMAIN)), 'type' => 'select', 'default' => 'fade', 'values' => $transitions_media, 'container' => 'anim'), array('name' => array('handle' => 'transition-delay', 'text' => __('Transition Delay', EG_TEXTDOMAIN)), 'type' => 'number', 'default' => '0', 'values' => array('0', '60', '1'), 'container' => 'anim'), array('name' => array('handle' => 'cover-bg-color', 'text' => __('Cover BG Color', EG_TEXTDOMAIN)), 'type' => 'color', 'default' => '#FFFFFF', 'container' => 'layout'), array('name' => array('handle' => 'cover-bg-opacity', 'text' => __('Cover BG Opacity', EG_TEXTDOMAIN)), 'type' => 'number', 'default' => '100', 'container' => 'layout'), array('name' => array('handle' => 'item-bg-color', 'text' => __('Item BG Color', EG_TEXTDOMAIN)), 'type' => 'color', 'default' => '#FFFFFF', 'container' => 'layout'), array('name' => array('handle' => 'content-bg-color', 'text' => __('Content BG Color', EG_TEXTDOMAIN)), 'type' => 'color', 'default' => '#FFFFFF', 'container' => 'layout'));
}
开发者ID:daanbakker1995,项目名称:vanteun,代码行数:10,代码来源:item-element.class.php
示例6: replace_all_meta_in_text
/**
* replace all metas with corresponding text
*/
public function replace_all_meta_in_text($post_id, $text)
{
if (trim($text) === '' || intval($post_id) === 0) {
return '';
}
$base = new Essential_Grid_Base();
$meta_link = new Essential_Grid_Meta_Linking();
$cmeta = $this->get_all_meta();
//process meta tags:
$arr_matches = array();
preg_match_all("/%[^%]*%/", $text, $arr_matches);
if (!empty($arr_matches)) {
$my_post = get_post($post_id, ARRAY_A);
foreach ($arr_matches as $matches) {
if (is_array($matches)) {
foreach ($matches as $match) {
$meta = trim(str_replace('%', '', $match));
$meta_value = get_post_meta($post_id, $meta, true);
if (!empty($cmeta)) {
foreach ($cmeta as $me) {
if ('eg-' . $me['handle'] == $meta) {
if ($me['type'] == 'image') {
if (intval($meta_value) > 0) {
//get URL to Image
$img = wp_get_attachment_image_src($meta_value, 'full');
if ($img !== false) {
$meta_value = $img[0];
} else {
$meta_value = '';
}
} else {
$meta_value = '';
}
}
if ($meta_value == '' && isset($me['default'])) {
$meta_value = $me['default'];
}
break;
}
}
}
//check woocommerce
if (Essential_Grid_Woocommerce::is_woo_exists()) {
$wc_text = Essential_Grid_Woocommerce::get_value_by_meta($post_id, $meta);
if ($wc_text !== '') {
$meta_value = $wc_text;
}
}
if (empty($meta_value) && !empty($my_post)) {
//try to get from post
switch ($meta) {
//Post elements
case 'post_url':
$post_id = $base->getVar($my_post, 'ID', '');
$meta_value = get_permalink($post_id);
break;
case 'post_id':
$meta_value = $base->getVar($my_post, 'ID', '');
break;
case 'title':
$meta_value = $base->getVar($my_post, 'post_title', '');
break;
case 'excerpt':
$meta_value = trim($base->getVar($my_post, 'post_excerpt'));
if (empty($meta_value)) {
$meta_value = trim($base->getVar($my_post, 'post_content'));
}
$meta_value = strip_tags($meta_value);
//,"<b><br><br/><i><strong><small>"
break;
case 'meta':
$m = new Essential_Grid_Meta();
$meta_value = $m->get_meta_value_by_handle($my_post['ID'], $meta);
break;
case 'alias':
$meta_value = $base->getVar($my_post, 'post_name');
break;
case 'content':
$meta_value = $base->getVar($my_post, 'post_content');
break;
case 'link':
$meta_value = get_permalink($my_post['ID']);
break;
case 'date':
$postDate = $base->getVar($my_post, "post_date_gmt");
$meta_value = $base->convert_post_date($postDate);
break;
case 'date_modified':
$dateModified = $base->getVar($my_post, "post_modified");
$meta_value = $base->convert_post_date($dateModified);
break;
case 'author_name':
$authorID = $base->getVar($my_post, 'post_author');
$meta_value = get_the_author_meta('display_name', $authorID);
break;
case 'num_comments':
$meta_value = $base->getVar($my_post, 'comment_count');
//.........这里部分代码省略.........
开发者ID:kfwebdev,项目名称:wp-atd,代码行数:101,代码来源:meta.class.php
示例7: output_navigation_skins
public static function output_navigation_skins()
{
$base = new Essential_Grid_Base();
$skins = self::get_essential_navigation_skins();
$css = '';
if (!empty($skins)) {
foreach ($skins as $skin) {
$css .= '<style class="navigation-skin-css-' . $skin['id'] . '" type="text/css">';
$css .= $base->compress_css($skin['css']);
$css .= '</style>' . "\n";
}
}
return $css;
}
开发者ID:mertyildiran,项目名称:grandinsaat,代码行数:14,代码来源:navigation.class.php
示例8: widget
/**
* 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;
}
开发者ID:kfwebdev,项目名称:wp-atd,代码行数:32,代码来源:grids-widget.class.php
示例9: eg_filter_tab_function
function eg_filter_tab_function($id, $params)
{
global $grid;
global $categories;
global $postTypesWithCats;
$base = new Essential_Grid_Base();
?>
<div class="eg-filter-options-wrap" style="display:inline-block">
<div class="eg-filter-header-block"><i class="eg-icon-megaphone"></i><?php
_e('Filter -', EG_TEXTDOMAIN);
?>
<span class="filter-header-id"><?php
echo $id;
?>
</span></div>
<p class="eg-filter-label"><?php
_e('Filter "All" Text', EG_TEXTDOMAIN);
?>
</p>
<p class="eg-filter-option-field">
<input type="text" name="filter-all-text-<?php
echo $id;
?>
" data-origname="filter-all-text-#NR" class="eg-tooltip-wrap" title="<?php
_e('Visible Title on All Filter Button.', EG_TEXTDOMAIN);
?>
" value="<?php
echo $base->getVar($params, 'filter-all-text-' . $id, __('Filter - All', EG_TEXTDOMAIN));
?>
" class="firstinput">
<span class="eg-remove-filter-tab" style="display: none;"><i class="eg-icon-cancel"></i></span>
</p>
<p class="eg-filter-label"><?php
_e('Layout Option', EG_TEXTDOMAIN);
?>
</p>
<p class="eg-filter-option-field">
<?php
$filter_listing = $base->getVar($params, 'filter-listing-' . $id, 'list');
?>
<select class="firstinput" name="filter-listing-<?php
echo $id;
?>
" data-origname="filter-listing-#NR">
<option value="list" <?php
checked($filter_listing, 'list');
?>
><?php
_e('In Line', EG_TEXTDOMAIN);
?>
</option>
<option value="dropdown" <?php
selected($filter_listing, 'dropdown');
?>
><?php
_e('Dropdown', EG_TEXTDOMAIN);
?>
</option>
</select>
</p>
<p class="eg-filter-label"><?php
_e('Dropdown Start Text', EG_TEXTDOMAIN);
?>
</p>
<p class="filter-only-if-dropdown eg-filter-option-field">
<?php
$filter_dropdown_text = $base->getVar($params, 'filter-dropdown-text-' . $id, __('Filter Categories', EG_TEXTDOMAIN));
?>
<input class="firstinput" type="text" data-origname="filter-dropdown-text-#NR" name="filter-dropdown-text-<?php
echo $id;
?>
" title="<?php
_e('Default Text on the Filter Dropdown List.', EG_TEXTDOMAIN);
?>
" value="<?php
echo $filter_dropdown_text;
?>
" />
</p>
<p class="eg-filter-label"><?php
_e('Available Filters in Group', EG_TEXTDOMAIN);
?>
</p>
<div class="filter-only-for-post">
<?php
$filter_selected = $base->getVar($params, 'filter-selected-' . $id, '');
?>
<div class="eg-media-source-order-wrap eg-filter-selected-order-wrap-<?php
echo $id;
?>
">
<?php
if (!empty($filter_selected)) {
if (!isset($params['filter-selected-' . $id])) {
//we are either a new Grid or old Grid that had not this option (since 1.1.0)
if ($grid !== false) {
//set the values
$use_cat = @$categories;
} else {
$use_cat = @$postTypesWithCats['post'];
//.........这里部分代码省略.........
开发者ID:Brandonsmith23,项目名称:prodgyr,代码行数:101,代码来源:grid-settings.php
示例10: Essential_Grid_Base
/**
* Represents the view for the metabox in post / pages
*
* @package Essential_Grid
* @author ThemePunch <[email protected]>
* @link http://www.themepunch.com/essential/
* @copyright 2014 ThemePunch
*/
if (!defined('ABSPATH')) {
exit;
}
if (!isset($post)) {
return false;
}
//not called as it should be
$base = new Essential_Grid_Base();
$item_skin = new Essential_Grid_Item_Skin();
$item_elements = new Essential_Grid_Item_Element();
$meta = new Essential_Grid_Meta();
$values = get_post_custom($post->ID);
$eg_sources_html5_mp4 = isset($values['eg_sources_html5_mp4']) ? esc_attr($values['eg_sources_html5_mp4'][0]) : "";
$eg_sources_html5_ogv = isset($values['eg_sources_html5_ogv']) ? esc_attr($values['eg_sources_html5_ogv'][0]) : "";
$eg_sources_html5_webm = isset($values['eg_sources_html5_webm']) ? esc_attr($values['eg_sources_html5_webm'][0]) : "";
$eg_vimeo_ratio = isset($values['eg_vimeo_ratio']) ? esc_attr($values['eg_vimeo_ratio'][0]) : "0";
$eg_youtube_ratio = isset($values['eg_youtube_ratio']) ? esc_attr($values['eg_youtube_ratio'][0]) : "0";
$eg_wistia_ratio = isset($values['eg_wistia_ratio']) ? esc_attr($values['eg_wistia_ratio'][0]) : "0";
$eg_html5_ratio = isset($values['eg_html5_ratio']) ? esc_attr($values['eg_html5_ratio'][0]) : "0";
$eg_soundcloud_ratio = isset($values['eg_soundcloud_ratio']) ? esc_attr($values['eg_soundcloud_ratio'][0]) : "0";
$eg_sources_youtube = isset($values['eg_sources_youtube']) ? esc_attr($values['eg_sources_youtube'][0]) : "";
$eg_sources_wistia = isset($values['eg_sources_wistia']) ? esc_attr($values['eg_sources_wistia'][0]) : "";
$eg_sources_vimeo = isset($values['eg_sources_vimeo']) ? esc_attr($values['eg_sources_vimeo'][0]) : "";
开发者ID:daanbakker1995,项目名称:vanteun,代码行数:31,代码来源:grid-meta-box.php
示例11: validate_wpml_exists
/**
* valdiate that wpml exists
*/
private static function validate_wpml_exists()
{
if (!self::is_wpml_exists()) {
Essential_Grid_Base::throw_error(__("The wpml plugin don't exists", EG_TEXTDOMAIN));
}
}
开发者ID:daanbakker1995,项目名称:vanteun,代码行数:9,代码来源:wpml.class.php
示例12: Essential_Grid_Meta
$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();
$jsonTaxWithCats = $base->jsonEncodeForClientSide($postTypesWithCats);
$base = new Essential_Grid_Base();
$pages = get_pages(array('sort_column' => 'post_name'));
$post_elements = $base->getPostTypesAssoc();
$postTypes = $base->getVar($grid['postparams'], 'post_category', 'post');
$categories = $base->setCategoryByPostTypes($postTypes, $postTypesWithCats);
$selected_pages = explode(',', $base->getVar($grid['postparams'], 'selected_pages', '-1', 's'));
$columns = $base->getVar($grid['params'], 'columns', '');
$columns = $base->set_basic_colums($columns);
$columns_width = $base->getVar($grid['params'], 'columns-width', '');
$columns_width = $base->set_basic_colums_width($columns_width);
$columns_height = $base->getVar($grid['params'], 'columns-height', '');
$columns_height = $base->set_basic_colums_height($columns_height);
$columns_advanced[] = $base->getVar($grid['params'], 'columns-advanced-rows-0', '');
$columns_advanced[] = $base->getVar($grid['params'], 'columns-advanced-rows-1', '');
$columns_advanced[] = $base->getVar($grid['params'], 'columns-advanced-rows-2', '');
$columns_advanced[] = $base->getVar($grid['params'], 'columns-advanced-rows-3', '');
开发者ID:kfwebdev,项目名称:wp-atd,代码行数:31,代码来源:grid-create.php
示例13: import_global_styles
public function import_global_styles($import_global_styles, $check_append = true)
{
$base = new Essential_Grid_Base();
$c_css = new Essential_Grid_Global_Css();
$append = true;
if ($check_append) {
//check in $_POST if append or overwrite
$do = $base->getVar($this->overwrite_data, 'global-styles-overwrite', 'append');
$append = $do == 'append' ? true : false;
}
if ($append) {
//append
$global_styles = $c_css->get_global_css_styles();
$import_global_styles = $global_styles . "\n" . $import_global_styles;
}
$c_css->set_global_css_styles($import_global_styles);
}
开发者ID:daanbakker1995,项目名称:vanteun,代码行数:17,代码来源:import.class.php
示例14: get_option
<?php
/**
* Panel to the search options.
*
* @package Essential_Grid
* @author ThemePunch <[email protected]>
* @link http://www.themepunch.com/essential/
* @copyright 2014 ThemePunch
* @since: 2.0
*/
$settings = get_option('esg-search-settings', array('settings' => array(), 'global' => array(), 'shortcode' => array()));
$settings = Essential_Grid_Base::stripslashes_deep($settings);
$base = new Essential_Grid_Base();
$grids = Essential_Grid::get_grids_short();
$my_skins = array('light' => __('Light', EG_TEXTDOMAIN), 'dark' => __('Dark', EG_TEXTDOMAIN));
$my_skins = apply_filters('essgrid_modify_search_skins', $my_skins);
?>
<h2 class="topheader"><?php
_e('Search Settings', EG_TEXTDOMAIN);
?>
</h2>
<div id="eg-grid-search-wrapper">
<ul class="es-grid-search-tabs">
<li><a href="#eg-search-settings-wrap"><?php
_e('Global Settings', EG_TEXTDOMAIN);
?>
</a></li>
<li><a href="#eg-shortcode-search-wrap"><?php
_e('ShortCode Search', EG_TEXTDOMAIN);
开发者ID:NgocSon2412,项目名称:website_banhang,代码行数:31,代码来源:grid-search.php
示例15: on_ajax_action
//.........这里部分代码省略.........
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 = '';
开发者ID:hhgr,项目名称:EveryonePlay,代码行数:66,代码来源:essential-grid-admin.class.php
示例16: wp_enqueue_script
<?php
if (!defined('ABSPATH')) {
exit;
}
//force the js file to be included
wp_enqueue_script('essential-grid-item-editor-script', plugins_url('../../assets/js/grid-editor.js', __FILE__), array('jquery'), Essential_Grid::VERSION);
$base = new Essential_Grid_Base();
$item_elements = new Essential_Grid_Item_Element();
$meta = new Essential_Grid_Meta();
$meta_link = new Essential_Grid_Meta_Linking();
$fonts = new ThemePunch_Fonts();
//check if id exists and get data from database if so.
$skin = false;
$skin_id = false;
$isCreate = $base->getGetVar('create', 'true');
$title = __('Create New Item Skin', EG_TEXTDOMAIN);
$save = __('Save Item Skin', EG_TEXTDOMAIN);
if (intval($isCreate) > 0) {
//currently editing
$skin = Essential_Grid_Item_Skin::get_essential_item_skin_by_id(intval($isCreate));
if (!empty($skin)) {
$title = __('Change Item Skin', EG_TEXTDOMAIN);
$save = __('Change Item Skin', EG_TEXTDOMAIN);
$skin_id = intval($isCreate);
}
}
$elements = $item_elements->getElementsForJavascript();
$style_attributes = $item_elements->get_existing_elements(true);
$all_attributes = $item_elements->get_existing_elements();
$element_type = $item_elements->getElementsForDropdown();
开发者ID:Lumbe,项目名称:dev_servus,代码行数:31,代码来源:grid-item-skin-editor.php
示例17: get_custom_element_value
/**
* Retrieve the value of post elements
*/
public function get_custom_element_value($handle, $separator, $meta = '')
{
$base = new Essential_Grid_Base();
$m = new Essential_Grid_Meta();
$text = '';
$text = $base->getVar($this->layer_values, $handle, '');
if ($text == '' && $meta != '') {
$text = $base->getVar($this->layer_values, $meta, '');
}
if (intval($text) > 0) {
//we may be an image from the metas
$custom_meta = $m->get_all_meta(false);
if (!empty($custom_meta)) {
foreach ($custom_meta as $cmeta) {
if ($cmeta['handle'] == $handle) {
if ($cmeta['type'] == 'image') {
$img = wp_get_attachment_image_src($text, $this->media_sources_type);
if ($img !== false) {
$text = $img[0];
//replace with URL
}
}
break;
}
}
}
}
return $text;
}
开发者ID:NgocSon2412,项目名称:website_banhang,代码行数:32,代码来源:item-skin.class.php
示例18: on_front_ajax_action
/**
* Handle Ajax Requests
*/
public static function on_front_ajax_action()
{
$base = new Essential_Grid_Base();
$token = $base->getPostVar("token", false);
//verify the token
$isVerified = wp_verify_nonce($token, 'Essential_Grid_Front');
$error = false;
if ($isVerified) {
$data = $base->getPostVar('data', false);
//client_action: load_more_items
switch ($base->getPostVar('client_action', false)) {
case 'load_more_items':
$gridid = $base->getPostVar('gridid', 0, 'i');
if (!empty($data) && $gridid > 0) {
$grid = new Essential_Grid();
$result = $grid->init_by_id($gridid);
if (!$result) {
$error = __('Grid not found', EG_TEXTDOMAIN);
} else {
$grid->set_loading_ids($data);
//set to only load choosen items
$html = false;
//check if we are custom grid
if ($grid->is_custom_grid()) {
$html = $grid->output_by_specific_ids();
} else {
$html = $grid->output_by_specific_posts();
}
if ($html !== false) {
self::ajaxResponseData($html);
} else {
$error = __('Items Not Found', EG_TEXTDOMAIN);
}
}
} else {
$error = __('No Data Received', EG_TEXTDOMAIN);
}
break;
case 'load_more_content':
$postid = $base->getPostVar('postid', 0, 'i');
if ($postid > 0) {
$raw_content = get_post_field('post_content', $postid);
if (!is_wp_error($raw_content)) {
$content = apply_filters('the_content', $raw_content);
//filter apply for qTranslate and other
self::ajaxResponseData($content);
}
}
$error = __('Post Not Found', EG_TEXTDOMAIN);
break;
case 'get_search_results':
$search_string = $base->getVar($data, 'search', '');
$search_skin = $base->getVar($data, 'skin', 0, 'i');
if ($search_string !== '' && $search_skin > 0) {
$search = new Essential_Grid_Search();
$return = $search->output_search_result($search_string, $search_skin);
self::ajaxResponseData($return);
}
$error = __('Not found', EG_TEXTDOMAIN);
break;
case 'get_grid_search_ids':
$search_string = $base->getVar($data, 'search', '');
$grid_id = $base->getVar($data, 'id', 0, 'i');
if ($search_string !== '' && $grid_id > 0) {
$return = Essential_Grid_Search::output_search_result_ids($search_string, $grid_id);
if (!is_array($return)) {
$error = $return;
} else {
self::ajaxResponseSuccess('', $return);
}
}
$error = __('Not found', EG_TEXTDOMAIN);
break;
}
} else {
$error = true;
}
if ($error !== false) {
$showError = __('Loading Error', EG_TEXTDOMAIN);
if ($error !== true) {
$showError = $error;
}
self::ajaxResponseError($showError, false);
}
exit;
}
开发者ID:kfwebdev,项目名称:wp-atd,代码行数:89,代码来源:essential-grid.class.php
示例19: add_tiny_mce_shortcode_dialog
/**
* Add tinymce shortcode dialog
* @since 1.2.0
*/
public static function add_tiny_mce_shortcode_dialog()
{
$base = new Essential_Grid_Base();
$grid_c = new Essential_Grid();
$skins_c = new Essential_Grid_Item_Skin();
|
请发表评论