Пример #1
0
								<div class="">
							   <?php 
$templates = $this->application->get_templates('application/views/template/', 'DocumentTemplate');
$atts = 'class="form-control"  data-bind="BootstrapSelect:{}"';
echo form_dropdown('template', $templates, element('template', $options), $atts);
?>
									<p class="help-block">Some help text</p>
								</div>
								
							</div>						
						</div>
						<div class="col-md-7">
							<?php 
$document_options = $this->application->get_config('document_options', 'template');
foreach (element('elements', $document_options) as $name => $element) {
    if (is_str_contain($name, '[]')) {
        //its array
        $name_ = str_replace("[]", "", $name);
        $selected = array_key_exists($name_, $options) ? element($name_, $options) : array();
        $elements = array_combine($selected, $selected);
        ?>
							<div class="form-group has-feedback">	
								<label class="control-label col-sm-3" for="<?php 
        echo $name;
        ?>
"><?php 
        echo $element;
        ?>
</label>
								<div class="col-sm-9">
								
Пример #2
0
    ?>

						</label>
				    </span>
				</div>
            </div>

            <?php 
    foreach ($checkout->checkout_fields['shipping'] as $key => $field) {
        if (is_str_contain('first_name', $key)) {
            $field['return'] = true;
            $output = woocommerce_form_field($key, $field, $checkout->get_value($key));
            $output = str_replace('col-md-12', 'col-md-6', $output);
            echo str_replace('</div></div></div>', '</div>', $output);
        }
        if (is_str_contain('last_name', $key)) {
            $field['return'] = true;
            $output = woocommerce_form_field($key, $field, $checkout->get_value($key));
            echo str_replace('<div class="row form-row-last validate-required" id="shipping_last_name_field"><div class="form-group"><div class="col-md-12">', '<div class="col-md-6 validate-required" id="billing_last_name_field">', $output);
        } else {
            woocommerce_form_field($key, $field, $checkout->get_value($key));
        }
    }
    ?>


            <?php 
    do_action('woocommerce_after_checkout_shipping_form', $checkout);
    ?>

        </div>
Пример #3
0
	
	
		<?php 
    if (is_array(element('doc_comments', $options))) {
        ?>
				<div class="box-footer">
		<?php 
        foreach (element('doc_comments', $options) as $meta) {
            $doc_comments = '';
            $doc_tag = $this->document_lib->get_element_name_from_tag_name($meta);
            if (in_array($doc_tag, $default_elements)) {
                $doc_comments = element($doc_tag, $autnhit);
            } else {
                $doc_comments = element($doc_tag, $document) ? element($doc_tag, $document) : $doc_comments;
            }
            if (is_array($doc_comments) && is_str_contain($doc_tag, "COMMENTS")) {
                $i = 0;
                $COMMENTS_DATA_CAN_REMOVE = element('COMMENTS_DATA_CAN_REMOVE', $document);
                $COMMENTS_DATA_CREATED_TIME = element('COMMENTS_DATA_CREATED_TIME', $document);
                $COMMENTS_DATA_FROM_ID = element('COMMENTS_DATA_FROM_ID', $document);
                $COMMENTS_DATA_FROM_NAME = element('COMMENTS_DATA_FROM_NAME', $document);
                $COMMENTS_DATA_ID = element('COMMENTS_DATA_ID', $document);
                $COMMENTS_DATA_LIKE_COUNT = element('COMMENTS_DATA_LIKE_COUNT', $document);
                $COMMENTS_DATA_MESSAGE = element('COMMENTS_DATA_MESSAGE', $document);
                $COMMENTS_DATA_USER_LIKES = element('COMMENTS_DATA_USER_LIKES', $document);
                $LIKES_DATA_ID = element('LIKES_DATA_ID', $document);
                $LIKES_DATA_NAME = element('LIKES_DATA_NAME', $document);
                ?>
						<div id="chat-box" class="box-body chat" >
							<?php 
                foreach ($doc_comments as $comment) {
Пример #4
0
 function set_menus()
 {
     // Get theme-supported menus.
     $spyropress_menus = get_theme_support('spyropress-core-menus');
     // If there is no menus, return.
     if (!is_array($spyropress_menus[0])) {
         return;
     }
     //get all registered menu locations
     $locations = get_theme_mod('nav_menu_locations');
     //get all created menus
     $menus = wp_get_nav_menus();
     if (!empty($menus) && !empty($spyropress_menus)) {
         foreach ($spyropress_menus[0] as $location => $search) {
             foreach ($menus as $menu) {
                 if (is_object($menu) && is_str_contain($search, $menu->name)) {
                     $locations[$location] = $menu->term_id;
                     break;
                 }
             }
         }
     }
     //update the theme
     set_theme_mod('nav_menu_locations', $locations);
 }
Пример #5
0
<?php

if (is_str_contain('[rotate_words]', $heading)) {
    $styles[] = 'word-rotator-title';
}
printf('<h%1$s%3$s class="%4$s">%2$s</h%1$s>', $html_tag, do_shortcode($heading), spyropress_build_atts(array('animation' => $animation), 'data-appear-'), spyropress_clean_cssclass($styles));
Пример #6
0
 /**
  * Build Group of Items
  *
  * Common Item Properties
  * id = A unique lower case alphanumeric string, underscores allowed.
  * label = Displayed as the label of a form element on the Theme Options page.
  * type = Choose one of the available option types.
  * desc = Enter a detailed description for the users to read on the Theme Options page, HTML is allowed.
  * This is also where you enter content for both the Info & Raw Info option types.
  * std = Setting the standard value for your option.
  * class = Add and optional class to this option type.
  *
  * Text, Textarea, Editor, CSS
  * placeholder = display placeholer HTML5 attribute
  * Textarea, Editor, CSS
  * rows = Enter a numeric value for the number of rows in your textarea.
  *
  * Custom Post Type Select
  * post_type = Add a comma separated list of post type like 'post,page'.
  *
  * Taxonomy Select
  * taxonomy = Add a comma separated list of any registered taxonomy like 'category,post_tag'.
  *
  */
 function build_group($group)
 {
     // Loop through group
     foreach ($group as $section) {
         // Defaults
         $defaults = array('id' => '', 'label' => '', 'type' => 'text', 'desc' => '', 'std' => '', 'class' => '', 'placeholder' => '', 'rows' => '15', 'post_type' => 'post', 'taxonomy' => 'category', 'options' => array());
         $section = wp_parse_args($section, $defaults);
         // id
         $id = $section['id'];
         // name
         if (!isset($section['name'])) {
             $section['name'] = $id;
         }
         // set to default
         if (!isset($this->settings[$id]) && isset($section['std']) && !empty($section['std']) && !empty($id)) {
             $this->settings[$id] = $section['std'];
         }
         // value
         $value = isset($this->settings[$id]) && !empty($this->settings[$id]) ? $this->settings[$id] : '';
         // Prefix method
         $field_method = 'spyropress_ui_' . $section['type'];
         // Run method
         if (function_exists($field_method)) {
             if (isset($this->settings['post']) && isset($section['desc']) && is_str_contain('{$post->ID}', $section['desc'])) {
                 $section['post'] = $this->settings['post'];
             }
             // Import Type
             if ($section['type'] == 'import_dummy' || $section['type'] == 'import' || $section['type'] == 'export' || $section['type'] == 'skin_generator') {
                 call_user_func_array($field_method, array($this->id));
             } else {
                 call_user_func_array($field_method, array($section, $id, $value));
             }
         }
     }
 }
Пример #7
0
 function create_field($section)
 {
     // Defaults
     $defaults = array('id' => '', 'label' => '', 'type' => 'text', 'desc' => '', 'std' => '', 'class' => 'section-full', 'placeholder' => '', 'rows' => '15', 'post_type' => 'post', 'taxonomy' => 'category', 'options' => array());
     $section = wp_parse_args($section, $defaults);
     // id
     $id = $section['id'];
     $section['id'] = $this->get_field_id($id);
     // name
     if (!isset($section['name'])) {
         $section['name'] = $this->get_field_name($id);
     }
     // set to default
     if (!isset($this->instance[$id]) && isset($section['std']) && $section['std']) {
         $this->instance[$id] = $section['std'];
     }
     // value
     $value = isset($this->instance[$id]) ? $this->instance[$id] : '';
     // Prefix method
     $field_method = 'spyropress_widget_' . $section['type'];
     // Run method
     if (function_exists($field_method)) {
         if (isset($this->instance['post']) && isset($section['desc']) && is_str_contain('{$post->ID}', $section['desc'])) {
             $section['post'] = $this->instance['post'];
         }
         return call_user_func_array($field_method, array($section, $section['id'], $value, $this->is_builder));
     }
 }
Пример #8
0
 /**
  * @see Walker::start_el()
  */
 function start_el(&$output, $item, $depth = 0, $args = array(), $id = 0)
 {
     $indent = $depth ? str_repeat("\t", $depth) : '';
     if (0 === $depth) {
         $this->has_megamenu = $item->isMega;
         $this->columns = $item->mega_columns;
     }
     if (1 === $depth) {
         $this->is_column = $item->is_mega_column;
     }
     if ('phone' == $item->title) {
         $output .= $indent . '<li class="phone"><span><i class="fa fa-phone"></i>' . get_setting('topbar_ph') . '</span>';
     } elseif (is_str_contain('divider', $item->title)) {
         $output .= $indent . '<li class="divider">';
     } elseif ('[sigin-form]' == $item->attr_title) {
         ob_start();
         $templates = array('woocommerce/nav-signin-form.php');
         include_once locate_template($templates, false);
         $nav_output = ob_get_clean();
         $output .= $nav_output;
     } elseif ('[mini-cart]' == $item->attr_title) {
         //check cart empty
         if (sizeof(WC()->cart->get_cart()) < 1 && get_setting('mini_cart_hide_if_empty', false)) {
             return;
         }
         ob_start();
         $templates = array('woocommerce/nav-mini-cart.php');
         include_once locate_template($templates, false);
         $nav_output = ob_get_clean();
         $output .= $nav_output;
     } else {
         $classes = empty($item->classes) ? array() : (array) $item->classes;
         $classes = apply_filters('nav_menu_css_class', array_filter($classes), $item, $args);
         if ($item->current && 'secondary' != $args->theme_location || in_array('current-menu-parent', $classes) || in_array('current-menu-ancestor', $classes)) {
             $classes[] = 'active';
         }
         if ($item->isMega || $item->bucket_id) {
             $classes[] = 'mega-menu-item mega-menu-fullwidth';
         }
         if ($item->bucket_id) {
             $classes[] = 'dropdown';
         }
         if ($this->has_children && $depth > 0) {
             $classes[] = 'dropdown-submenu';
         } else {
             if ($this->has_children && $depth === 0) {
                 $classes[] = 'dropdown';
             }
         }
         $class_names = spyropress_clean_cssclass($classes);
         $class_names = $class_names ? ' class="' . esc_attr($class_names) . '"' : '';
         if ($depth === 1 && $this->has_megamenu) {
             $output .= $indent . '<div class="{col_class}"><ul class="sub-menu"><li>';
         } elseif ($depth === 2 && $this->has_megamenu && $this->is_column) {
         } else {
             $output .= $indent . '<li' . $class_names . '>';
         }
         $item_output = '';
         if ($depth === 1 && $this->has_megamenu && $this->is_column) {
             // do nothing
         } elseif ($depth === 1 && $this->has_megamenu || $depth === 2 && $this->has_megamenu && $this->is_column) {
             $item_output .= '<span class="mega-menu-sub-title">' . apply_filters('the_title', $item->title, $item->ID) . '</span>';
         } else {
             $atts = array();
             $atts['title'] = !empty($item->attr_title) ? esc_attr($item->attr_title) : '';
             $atts['target'] = !empty($item->target) ? esc_attr($item->target) : '';
             $atts['rel'] = !empty($item->xfn) ? esc_attr($item->xfn) : '';
             $atts['href'] = !empty($item->url) ? esc_url($item->url) : '';
             if ($this->has_children && $depth == 0 || $item->bucket_id) {
                 $atts['class'] = 'dropdown-toggle';
             }
             $attributes = apply_filters('nav_menu_link_attributes', spyropress_build_atts($atts), $item, $args);
             if (is_str_contain('#HOME_URL#', $item->url)) {
                 $attributes .= ' data-hash';
             }
             $item_output = $args->before;
             $item_output .= '<a' . $attributes . '>';
             $item_output .= $args->link_before . apply_filters('the_title', $item->title, $item->ID) . $args->link_after;
             if ($this->has_children && $depth == 0) {
                 $item_output .= ' <i class="fa fa-angle-down"></i>';
             }
             $item_output .= '</a>';
             $item_output .= $args->after;
         }
         $output .= apply_filters('walker_nav_menu_start_el', $item_output, $item, $depth, $args);
         if ($item->bucket_id) {
             $output .= '<ul class="dropdown-menu"><li><div class="mega-menu-content">';
             $con = do_shortcode('[bucket id=' . $item->bucket_id . ']');
             $output .= str_replace('class="container"', '', $con);
             $output .= '</div></li></ul>';
         }
     }
 }
Пример #9
0
<div class="center">
<?php 
$class = 'short';
if (is_str_contain('[rotate_words]', $teaser1)) {
    $class .= ' word-rotator-title';
}
if ($teaser1) {
    echo '<h2 class="' . $class . '">' . do_shortcode($teaser1) . '</h2>';
}
if ($teaser2) {
    if ('style1' == $style) {
        echo '<p class="featured lead">' . do_shortcode($teaser2) . '</p>';
    } elseif ('style2' == $style) {
        echo '<h4 class="lead tall">' . do_shortcode($teaser2) . '</h4>';
    }
}
?>

</div>
Пример #10
0
/**
 * oEmbed Modifier
 */
function oembed_modifier($html)
{
    $html = preg_replace('/(width|height|frameborder)="\\d*"\\s/', "", $html);
    if (is_str_contain('embed-responsive embed-responsive-16by9', $html)) {
        return $html;
    }
    return '<div class="embed-responsive embed-responsive-16by9">' . $html . '</div>';
}
Пример #11
0
<?php

$class = is_str_contain('[rotate_words]', $title) ? 'word-rotator-title' : '';
if ($title) {
    echo '<h2 class="' . $class . '">' . do_shortcode($title) . '</h2>';
}
?>

<div class="<?php 
get_row_class();
?>
">
	<div class="col-md-10">
		<p class="lead">
		  <?php 
echo do_shortcode($sub_title);
?>

		</p>
	</div>
	<div class="col-md-2">
		<?php 
$btn_url_text = $btn_url_text ? $btn_url_text : 'Button Text';
$btn_url = $btn_link_url ? get_permalink($btn_link_url) : $btn_url;
if ($btn_url) {
    echo '<a href="' . $btn_url . '" class="btn btn-lg btn-primary push-top">' . $btn_url_text . '</a>';
}
?>

	</div>
</div>
Пример #12
0
function wp_link_pages_link_active($link)
{
    if (!is_str_contain('<a', $link)) {
        $link = '<li class="active"><a href="#">' . $link . '</a></li>';
    } else {
        $link = '<li>' . $link . '</li>';
    }
    return $link;
}