예제 #1
0
function wpv_shortcode_list($atts, $content = null, $code)
{
    extract(shortcode_atts(array('style' => false, 'color' => ''), $atts));
    if ($color) {
        $color = ' icon-' . $color;
    }
    $icon_font = wpv_get_icon_type($style);
    $content = str_replace('<li>', '<li class="">', do_shortcode($content));
    $content = preg_replace('/(<li .*?class="[^"]*)"/', '$1 icon-b ' . $icon_font . '" data-icon="' . wpv_get_icon($style) . '"', $content);
    return str_replace('<ul>', '<ul class="styled-list ' . $color . '">', $content);
}
예제 #2
0
 /**
  * JSON-encoded list of icons
  */
 public function get_icon_list()
 {
     header('Content-type: application/json');
     $icons = wpv_get_icons_extended();
     $result = array();
     $result[''] = '<span>' . __('No icon') . '</span>';
     foreach ($icons as $key => $name) {
         $type = wpv_get_icon_type($key);
         if ($type !== '') {
             $type .= '-icon';
         }
         $result[$key] = '<span title="' . esc_attr($name) . '" class="vamtam-icon ' . $type . '">&#' . wpv_get_icon_num($key) . '</span>';
     }
     echo json_encode($result);
     exit;
 }
예제 #3
0
    private function get_special_markup($id, $content)
    {
        $result = apply_filters('wpv_editor_get_special_markup', $content, $id);
        if ($result !== $content) {
            return $result;
        }
        ob_start();
        switch ($id) {
            case 'accordion':
                if (!wpv_sub_shortcode('pane', $content, $params, $sub_contents)) {
                    return $content;
                }
                echo '<div class="wpv_accordion">';
                foreach ($sub_contents as $i => $text) {
                    ?>

					<div>
						<h3 class="title-wrapper clearfix">
							<a class="accordion-title"><?php 
                    echo $params[$i]['title'];
                    ?>
</a>
							<a class="accordion-remove icon-remove" title="<?php 
                    esc_attr_e('Remove', 'honeymoon');
                    ?>
"></a>
							<a class="accordion-clone icon-copy" title="<?php 
                    esc_attr_e('Clone', 'honeymoon');
                    ?>
"></a>
							<a class="accordion-background-selector" data-background-image="<?php 
                    if (isset($params[$i]['background_image'])) {
                        echo esc_attr($params[$i]['background_image']);
                    }
                    ?>
" title="<?php 
                    esc_attr_e('Change Pane Background', 'honeymoon');
                    ?>
"><?php 
                    wpv_icon('image');
                    ?>
</a>
						</h3>
						<div class="pane clearfix inner-sortable"><?php 
                    echo $this->do_parse($text);
                    ?>
</div>
					</div>

				<?php 
                }
                echo '<div><h3><a class="accordion-add icon-plus"></a></h3></div>';
                echo '</div>';
                break;
            case 'tabs':
                if (!wpv_sub_shortcode('tab', $content, $params, $sub_contents)) {
                    return $content;
                }
                $suffix = 'tabs-' . $this->get_uniqid_suffix();
                echo '<div class="wpv_tabs"><ul>';
                foreach ($params as $i => $pi) {
                    $p = shortcode_atts(array('title' => '', 'icon' => ''), $pi);
                    ?>
					<li>
						<a href="#tabs-<?php 
                    echo esc_attr($suffix . $i);
                    ?>
" class="tab-title"><?php 
                    echo $p['title'];
                    ?>
</a>
						<a class="tab-remove icon-remove" title="<?php 
                    esc_attr_e('Remove', 'honeymoon');
                    ?>
"></a>
						<a class="tab-clone icon-copy" title="<?php 
                    esc_attr_e('Clone', 'honeymoon');
                    ?>
"></a>
						<a class="wpv-icon-selector-trigger tab-icon-selector vamtam-icon <?php 
                    echo esc_attr(wpv_get_icon_type($p['icon']));
                    ?>
 <?php 
                    if (empty($p['icon'])) {
                        echo 'no-icon';
                    }
                    ?>
" data-icon-name="<?php 
                    echo esc_attr($p['icon']);
                    ?>
" title="<?php 
                    esc_attr_e('Change Icon', 'honeymoon');
                    ?>
"><?php 
                    wpv_icon($p['icon']);
                    ?>
</a>
					</li>
				<?php 
                }
                echo '<li class="ui-state-default"><a class="tab-add icon-plus"></a></li>';
                echo '</ul>';
                foreach ($sub_contents as $i => $text) {
                    ?>
					<div id="tabs-<?php 
                    echo $suffix . $i;
                    ?>
" class="clearfix inner-sortable"><?php 
                    echo $this->do_parse($text);
                    ?>
</div>
				<?php 
                }
                echo '</div>';
                break;
            case 'services_expandable':
                echo "<textarea class='inner-content'>{$content}</textarea>";
                // xss ok
                break;
            default:
                echo $content;
                // xss ok
        }
        return ob_get_clean();
    }
예제 #4
0
" type="text" value="<?php 
    echo $custom_urls[$i];
    ?>
" />
			</p>

			<p>
				<label for="<?php 
    echo $this->get_field_id($custom_icon);
    ?>
"><?php 
    printf(__('Icon:', 'church-event'), $i);
    ?>
</label>
				<a href="#" class="wpv-icon-selector-trigger vamtam-icon <?php 
    echo esc_attr(wpv_get_icon_type($custom_icons[$i]));
    ?>
 <?php 
    if (empty($custom_icons[$i])) {
        echo 'no-icon';
    }
    ?>
" data-icon-name="<?php 
    echo esc_attr($custom_icons[$i]);
    ?>
" title="<?php 
    esc_attr_e('Change Icon', 'church-event');
    ?>
"><?php 
    wpv_icon($custom_icons[$i]);
    ?>
예제 #5
0
<?php 
for ($i = 1; $i <= $custom_count; $i++) {
    $name = isset($instance["custom_name"][$i]) ? $instance["custom_name"][$i] : '';
    $icon = isset($instance["custom_icon"][$i]) ? $instance["custom_icon"][$i] : '';
    $link = isset($instance["custom_url"][$i]) ? $instance["custom_url"][$i] : '#';
    ?>
		<li>
			<a href="<?php 
    echo $link;
    ?>
" rel="nofollow" target="_blank" title="<?php 
    echo esc_attr($name);
    ?>
">
				<span class="icon before <?php 
    echo esc_attr(wpv_get_icon_type($icon));
    ?>
" data-icon-type="<?php 
    echo $icon;
    ?>
"><?php 
    wpv_icon($icon);
    ?>
</span><span class="content"><?php 
    echo $name;
    ?>
</span><span class="icon after"><?php 
    wpv_icon('arrow-right1');
    ?>
</span>
			</a>
예제 #6
0
/**
 * Helper functions for dealing with the icon fonts used by the theme
 *
 * @package wpv
 */
function wpv_icon_type($icon)
{
    echo wpv_get_icon_type($icon);
    // xss ok
}