示例#1
0
    function content_template_fb($fields, $values)
    {
        $fonts = array('title' => array(), 'content' => array());
        if (isset($values[0])) {
            $fonts = $values[1];
            $values = $values[0];
        }
        //op_font_style_str
        $html = '';
        op_mod('comments')->need_js = true;
        $button_1 = op_get_var($values, 'button_1_text');
        $button_2 = op_get_var($values, 'button_2_text');
        $title = op_get_var($values, 'title');
        $font_str = op_font_style_str(op_get_var($fonts, 'title', array()));
        $html .= empty($title) ? '' : '<h2' . (!empty($font_str) ? ' style=\'' . $font_str . '\'' : '') . '>' . nl2br($title) . '</h2>
		';
        $content = wpautop(op_get_var($values, 'content'));
        $font_str = op_font_style_str(op_get_var($fonts, 'content', array()));
        $GLOBALS['OP_LIVEEDITOR_FONT_STR'] = array('elements' => array('p', 'a'), 'style_str' => $font_str);
        $content = op_process_asset_content($content);
        $html .= $content . (empty($button_1) ? '' : '
		<a class="button-style-2 button-style-2-orange" href="' . op_get_var($values, 'button_1_url') . '"><span>' . $button_1 . '</span></a>') . (empty($button_2) ? '' : '
		<a class="button-style-2 button-style-2-orange" href="' . op_get_var($values, 'button_2_url') . '"><span>' . $button_2 . '</span></a>');
        return $html;
    }
示例#2
0
 function content_fields($fields, $values)
 {
     $fonts = array();
     if (isset($values[0])) {
         $fonts = $values[1];
         $values = $values[0];
     }
     $html = '';
     $fields = $fields['fields'];
     foreach ($fields as $name => $settings) {
         $font_str = op_font_style_str(op_get_var($fonts, $name, array()));
         if ($font_str != '') {
             $font_str = ' style=\'' . $font_str . '\'';
         }
         $value = op_get_var($values, $name);
         $type = op_get_var($settings, 'type');
         if ($type == 'textarea' || $type == 'wysiwyg') {
             $GLOBALS['OP_LIVEEDITOR_FONT_STR'] = array('elements' => array('p', 'a'), 'style_str' => $font_str);
             $value = do_shortcode(wpautop($value));
             $value = op_process_asset_content($value);
         } elseif ($type == 'image') {
             $value = '<img src="' . $value . '" alt="" />';
         }
         $values[$name] = $value;
         if (empty($value)) {
             continue;
         }
         if ($name == 'title') {
             $el1 = op_get_var($settings, 'element', 'h2');
             $value = '<' . $el1 . $font_str . '>' . $value . '</' . $el1 . '>';
         } elseif ($name == 'subtitle') {
             $el2 = op_get_var($settings, 'element', 'h3');
             $value = '<' . $el2 . $font_str . '>' . $value . '</' . $el2 . '>';
         } elseif ($name == 'link_url') {
             $value = '';
         } elseif ($name == 'submit_button') {
             $value = '<a class="button-style-2 button-style-2-orange button-style-2-large" href="' . $values['link_url'] . '"><span>' . $value . '</span></a>';
         } elseif ($name == 'image' && $type != 'image') {
             $value = '<img src="' . $value . '" alt="" />';
         }
         if (isset($settings['wrap'])) {
             $html .= sprintf($settings['wrap'], $value);
         } else {
             $html .= $value;
         }
     }
     return $html;
 }
示例#3
0
    function big_content($fields, $values)
    {
        $fonts = array();
        if (isset($values[0])) {
            $fonts = $values[1];
            $values = $values[0];
        }
        $headline_str = '';
        if (isset($fonts['top_headline'])) {
            foreach ($fonts['top_headline'] as $var => $val) {
                $headline_str .= ' ' . $var . '="' . str_replace('"', "'", $val) . '"';
            }
        }
        $font_str = op_font_style_str(op_get_var($fonts, 'title', array()));
        if ($font_str != '') {
            $font_str = ' style=\'' . $font_str . '\'';
        }
        $title = op_get_var($values, 'title');
        if (!empty($title)) {
            $title = '<h1' . $font_str . '>' . nl2br($title) . '</h1>';
        }
        $html = '
		[headline style="15" align="center"' . $headline_str . ']' . stripslashes(nl2br(op_get_var($values, 'top_headline'))) . '[/headline]
		' . $title . '
		[divider style="7"]
		<div class="feature-area-content">
		' . wpautop(op_get_var($values, 'content')) . '
		</div>';
        return do_shortcode($html);
    }
示例#4
0
function op_asset_font_style($atts, $prefix = 'font_')
{
    $vars = shortcode_atts(array($prefix . 'size' => '', $prefix . 'font' => '', $prefix . 'style' => '', $prefix . 'color' => '', $prefix . 'spacing' => '', $prefix . 'shadow' => ''), $atts);
    return op_font_style_str($vars, $prefix);
}