Exemple #1
0
 private function setData()
 {
     $post_type = $this->post_type;
     $taxonomy = $this->taxonomy;
     $terms = $this->terms;
     if ($this->component == 'vegas') {
         $data = QueryBuilder::getImagesByPostType($post_type, $taxonomy, $terms);
     } else {
         $data = QueryBuilder::getPostBasicInfo($post_type, $taxonomy, $terms, false);
     }
     $this->data = $data;
 }
Exemple #2
0
 public static function getUserList($roles = ['administrator'], $basic = false)
 {
     $users = QueryBuilder::getUsersByRoles($roles);
     if ($basic) {
         $info = array();
         foreach ($users as $user) {
             $data = QueryBuilder::getUserBasicInfo($user);
             $info[] = $data;
         }
         return $info;
     } else {
         return $users;
     }
 }
Exemple #3
0
 public static function showcase_query($posttype, $category)
 {
     $query = null;
     switch ($category) {
         case 'promotions':
             $query = self::general_query($posttype, $category);
             break;
         case 'brochures':
             $query = self::general_query($posttype, $category);
             break;
         case 'theme':
             $query = self::by_terms_query($posttype, $category);
             break;
         case 'location':
             $query = self::by_terms_query($posttype, $category);
             break;
         case 'facility_type':
             $query = self::by_terms_query($posttype, $category);
             break;
         case 'all':
             $query = QueryBuilder::getPostByPostType($posttype);
             break;
         default:
             $query = null;
             break;
     }
     return $query;
 }
Exemple #4
0
/**
 *  Content Source Options
 */
$source_type = array('type' => 'select', 'label' => __('Source Content Type', 'sage'), 'help' => __('Here you can select what type of content displayed in the segment', 'sage'), 'field' => 'source_type', 'columns' => 6, 'value' => 'page', 'choices' => array('page' => __('Page', 'sage'), 'showcase' => __('Showcase', 'sage')));
$pages = array('type' => 'select', 'label' => __('Page to show', 'sage'), 'field' => 'pages', 'columns' => 6, 'choices' => Helpers::getPagesFromCurrentLanguage(), 'conditions' => array(array('field' => 'about_section_options:content_settings:source_type', 'value' => 'page')));
/**
 * Background Options
 */
$bg_html_line = $bg_html_title = array('type' => 'html', 'template' => 'field', 'columns' => 12, 'field' => 'bg_html_line', 'value' => '<hr>');
$bg_html_title = array('type' => 'html', 'template' => 'field', 'columns' => 12, 'field' => 'bg_html_title', 'value' => '<h4>' . __('Background Options', 'sage') . '</h4><hr>', 'conditions' => array(array('field' => 'about_section_options:background_settings:show_background', 'value' => 'TRUE')));
$background_type_showcase = array('type' => 'select', 'label' => __('Background Type', 'sage'), 'help' => __('Background customization types', 'sage'), 'field' => 'background_type_showcase', 'columns' => 12, 'value' => 'color', 'choices' => array('color' => __('Color', 'sage'), 'texture' => __('Texture', 'sage'), 'image' => __('Image', 'sage')), 'conditions' => array(array('field' => 'about_section_options:content_settings:source_type', 'value' => 'showcase'), array('field' => 'about_section_options:background_settings:show_background', 'value' => 'TRUE')));
$background_type_page = array('type' => 'select', 'label' => __('Background Type', 'sage'), 'help' => __('Background customization types', 'sage'), 'field' => 'background_type_page', 'columns' => 12, 'value' => 'color', 'choices' => array('color' => __('Color', 'sage'), 'texture' => __('Texture', 'sage'), 'image' => __('Image', 'sage'), 'slider' => __('Photo Slider', 'sage')), 'conditions' => array(array('field' => 'about_section_options:content_settings:source_type', 'value' => 'page'), array('field' => 'about_section_options:background_settings:show_background', 'value' => 'TRUE')));
$bg_color_page = array('type' => 'select', 'label' => __('Color', 'sage'), 'help' => __('Only the top border will be colored, check inverse color if you want to color the background instead', 'sage'), 'field' => 'background_color_page', 'columns' => 6, 'value' => '', 'choices' => array('' => __('No Color', 'sage'), 'red' => __('Red', 'sage'), 'orange' => __('Orange', 'sage'), 'yellow' => __('Yellow', 'sage'), 'olive' => __('Olive', 'sage'), 'green' => __('Green', 'sage'), 'teal' => __('Teal', 'sage'), 'blue' => __('Blue', 'sage'), 'violet' => __('Violet', 'sage'), 'purple' => __('Purple', 'sage'), 'pink' => __('Pink', 'sage'), 'brown' => __('Brown', 'sage'), 'grey' => __('Grey', 'sage'), 'black' => __('Black', 'sage'), 'website' => __('Default website', 'sage')), 'conditions' => array(array('field' => 'about_section_options:background_settings:show_background', 'value' => 'TRUE'), array('field' => 'about_section_options:content_settings:source_type', 'value' => 'page'), array('field' => 'about_section_options:background_settings:background_type_page', 'value' => 'color')));
$bg_color_showcase = array('type' => 'select', 'label' => __('Color', 'sage'), 'help' => __('Only the top border will be colored, check inverse color if you want to color the background instead', 'sage'), 'field' => 'background_color_showcase', 'columns' => 6, 'value' => '', 'choices' => array('' => __('No Color', 'sage'), 'red' => __('Red', 'sage'), 'orange' => __('Orange', 'sage'), 'yellow' => __('Yellow', 'sage'), 'olive' => __('Olive', 'sage'), 'green' => __('Green', 'sage'), 'teal' => __('Teal', 'sage'), 'blue' => __('Blue', 'sage'), 'violet' => __('Violet', 'sage'), 'purple' => __('Purple', 'sage'), 'pink' => __('Pink', 'sage'), 'brown' => __('Brown', 'sage'), 'grey' => __('Grey', 'sage'), 'black' => __('Black', 'sage'), 'website' => __('Default website', 'sage')), 'conditions' => array(array('field' => 'about_section_options:background_settings:show_background', 'value' => 'TRUE'), array('field' => 'about_section_options:content_settings:source_type', 'value' => 'showcase'), array('field' => 'about_section_options:background_settings:background_type_showcase', 'value' => 'color')));
$bg_color_inverted_page = array('type' => 'select', 'label' => __('Background style', 'sage'), 'help' => __('If inverted color is checked, this section background will be colored instead', 'sage'), 'field' => 'color_inverted_page', 'columns' => 6, 'value' => '', 'choices' => array('' => __('Simple', 'sage'), 'inverted' => __('Inverted color', 'sage')), 'conditions' => array(array('field' => 'about_section_options:background_settings:show_background', 'value' => 'TRUE'), array('field' => 'about_section_options:content_settings:source_type', 'value' => 'page'), array('field' => 'about_section_options:background_settings:background_type_page', 'value' => 'color')));
$bg_color_inverted_showcase = array('type' => 'select', 'label' => __('Background style', 'sage'), 'help' => __('If inverted color is checked, this section background will be colored instead', 'sage'), 'field' => 'color_inverted_showcase', 'columns' => 6, 'value' => '', 'choices' => array('' => __('Simple', 'sage'), 'inverted' => __('Inverted color', 'sage')), 'conditions' => array(array('field' => 'about_section_options:background_settings:show_background', 'value' => 'TRUE'), array('field' => 'about_section_options:content_settings:source_type', 'value' => 'showcase'), array('field' => 'about_section_options:background_settings:background_type_showcase', 'value' => 'color')));
$bg_texture_page = array('type' => 'file', 'field' => 'bg_texture_page', 'label' => __('Texture image', 'sage'), 'columns' => 6, 'options' => array('modal_title' => __('Add Texture', 'sage'), 'button' => __('Add Texture', 'sage')), 'validate' => array(array('type' => 'limit', 'options' => array('min' => 0, 'max' => 1))), 'conditions' => array(array('field' => 'about_section_options:background_settings:show_background', 'value' => 'TRUE'), array('field' => 'about_section_options:content_settings:source_type', 'value' => 'page'), array('field' => 'about_section_options:background_settings:background_type_page', 'value' => 'texture')));
$bg_texture_showcase = array('type' => 'file', 'field' => 'bg_texture_showcase', 'label' => __('Texture image', 'sage'), 'columns' => 6, 'options' => array('modal_title' => __('Add Texture', 'sage'), 'button' => __('Add Texture', 'sage')), 'validate' => array(array('type' => 'limit', 'options' => array('min' => 0, 'max' => 1))), 'conditions' => array(array('field' => 'about_section_options:background_settings:show_background', 'value' => 'TRUE'), array('field' => 'about_section_options:content_settings:source_type', 'value' => 'showcase'), array('field' => 'about_section_options:background_settings:background_type_showcase', 'value' => 'texture')));
$bg_image_page = array('type' => 'file', 'field' => 'bg_image_page', 'label' => __('Background image', 'sage'), 'columns' => 6, 'options' => array('modal_title' => __('Add Image', 'sage'), 'button' => __('Add Image', 'sage')), 'validate' => array(array('type' => 'limit', 'options' => array('min' => 0, 'max' => 1))), 'conditions' => array(array('field' => 'about_section_options:background_settings:show_background', 'value' => 'TRUE'), array('field' => 'about_section_options:content_settings:source_type', 'value' => 'page'), array('field' => 'about_section_options:background_settings:background_type_page', 'value' => 'image')));
$bg_image_size_page = array('type' => 'radio', 'field' => 'bg_image_size_page', 'label' => __('Background size', 'sage'), 'columns' => 6, 'list' => false, 'value' => 'content', 'choices' => array('full' => __('Full size', 'sage'), 'content' => __('Fit to content', 'sage')), 'conditions' => array(array('field' => 'about_section_options:background_settings:show_background', 'value' => 'TRUE'), array('field' => 'about_section_options:content_settings:source_type', 'value' => 'page'), array('field' => 'about_section_options:background_settings:background_type_page', 'value' => 'image')));
$bg_image_showcase = array('type' => 'file', 'field' => 'bg_image_showcase', 'label' => __('Background image', 'sage'), 'columns' => 6, 'options' => array('modal_title' => __('Add Image', 'sage'), 'button' => __('Add Image', 'sage')), 'validate' => array(array('type' => 'limit', 'options' => array('min' => 0, 'max' => 1))), 'conditions' => array(array('field' => 'about_section_options:background_settings:show_background', 'value' => 'TRUE'), array('field' => 'about_section_options:content_settings:source_type', 'value' => 'showcase'), array('field' => 'about_section_options:background_settings:background_type_showcase', 'value' => 'image')));
$bg_image_size_showcase = array('type' => 'radio', 'field' => 'bg_image_size_showcase', 'label' => __('Background size', 'sage'), 'columns' => 6, 'list' => false, 'value' => 'content', 'choices' => array('full' => __('Full size', 'sage'), 'content' => __('Fit to content', 'sage')), 'conditions' => array(array('field' => 'about_section_options:background_settings:show_background', 'value' => 'TRUE'), array('field' => 'about_section_options:content_settings:source_type', 'value' => 'showcase'), array('field' => 'about_section_options:background_settings:background_type_showcase', 'value' => 'image')));
$bg_category = array('type' => 'select', 'label' => __('Image Media Category', 'sage'), 'field' => 'media_category', 'columns' => 6, 'value' => '', 'choices' => \Experiensa\Modules\QueryBuilder::getTermsSlugByPTAndTaxonomy(['attachment'], ['media_category']), 'conditions' => array(array('field' => 'about_section_options:background_settings:show_background', 'value' => 'TRUE'), array('field' => 'about_section_options:content_settings:source_type', 'value' => 'page'), array('field' => 'about_section_options:background_settings:background_type_page', 'value' => 'slider')));
$show_background = array('type' => 'select', 'label' => __('Background', 'sage'), 'field' => 'show_background', 'columns' => 12, 'value' => 'FALSE', 'choices' => array('FALSE' => __('No background', 'sage'), 'TRUE' => __('Show background', 'sage')));
/**
 *  Main Section Option Field Group
 */
$content_settings = array('type' => 'group', 'field' => 'content_settings', 'fields' => array($source_type, $pages, $showcase_html_title, $showcase_component, $showcase_posttype, $showcase_categories, $slider_html_title, $slider_type, $slider_message, $showcase_terms, $show_textimage, $ti_html_title, $ti_display_title, $ti_display_subtitle, $ti_display_overlay, $ti_text_order, $ti_text_position, $ti_text_transformation, $ti_font_size, $ti_text_color, $show_layout, $layout_html_title, $segment_container, $segment_content_color, $segment_title_alignment, $segment_title_color, $segment_title, $segment_subtitle));
$background_settings = array('type' => 'group', 'field' => 'background_settings', 'fields' => array($bg_html_line, $show_background, $bg_html_title, $background_type_page, $background_type_showcase, $bg_color_page, $bg_color_inverted_page, $bg_color_showcase, $bg_color_inverted_showcase, $bg_texture_page, $bg_texture_showcase, $bg_image_page, $bg_image_size_page, $bg_image_showcase, $bg_image_size_showcase, $bg_category));
$dummy_field = array('type' => 'hidden', 'field' => 'dummy_field', 'value' => 'dummy');
piklist('field', array('type' => 'group', 'field' => 'about_section_options', 'label' => __('Section options', 'sage'), 'add_more' => true, 'help' => __('You can set the style to your custom template', 'sage'), 'fields' => array($dummy_field, $content_settings, $background_settings)));
Exemple #5
0
 private function setPageData()
 {
     $page_id = $this->content_settings['pages'];
     $page_data['title'] = get_the_title($page_id);
     $page_data['content'] = QueryBuilder::getPostContent($page_id);
     $this->page_data = $page_data;
 }