'', "width" => 'medium' ), $atts)); $titlearr=explode(',',$titles); $html='
'.do_shortcode($content).'
'; return $html; } add_shortcode('tabs', 'show_tabs'); function show_pane($atts, $content = null) { return '
'.do_shortcode($content).'
'; } add_shortcode('pane', 'show_pane'); function show_accordion($atts, $content = null) { return '
'.do_shortcode($content).'
'; } add_shortcode('accordion', 'show_accordion'); function show_apane($atts, $content = null) { extract(shortcode_atts(array( "title" => '' ), $atts)); return '

'.$title.'

'.do_shortcode($content).'
'; } add_shortcode('apane', 'show_apane'); /* ------------------------------------------------------------------------* * TESTIMONIALS * ------------------------------------------------------------------------*/ function pexeto_show_testim($atts, $content = null) { extract(shortcode_atts(array( "name" => '', "img" =>'', "org" =>'', "link" =>'', "occup" =>'' ), $atts)); $addClass=$img?'':' no-image'; $testim='

'.$name.'

'.$occup; if($org){ $testim.=' / '; if($link) $testim.=''; $testim.=$org; if($link) $testim.=''; } $testim.='
'; if ($img) $testim.=''; $testim.='

'.do_shortcode($content).'

'; return $testim; } add_shortcode('pextestim', 'pexeto_show_testim'); /* ------------------------------------------------------------------------* * SERVICES BOXES * ------------------------------------------------------------------------*/ function pexeto_services_boxes($atts, $content=null){ $html='
'.do_shortcode($content).'
'; return $html; } function pexeto_service_box($atts, $content=null){ extract(shortcode_atts(array( "title" => '', "link" =>'', "image" =>'', "last" =>false, "linktext" => '' ), $atts)); $lastClass=$last?' nomargin':''; $html='
'; if($image){ if(trim($link)) $html.=''; $html.='
'; if(trim($link)) $html.='
'; } $html.='
'; if(trim($link)) $html.=''; $html.='

'.$title.'

'; if(trim($link)) $html.='
'; $html.='

'.do_shortcode($content).'

'; if(trim($link) && trim($linktext)){ $html.=''.$linktext.''; } $html.='
'; return $html; } add_shortcode('servicesboxes', 'pexeto_services_boxes'); add_shortcode('servicesbox', 'pexeto_service_box'); /* ------------------------------------------------------------------------* * CONTACT FORM * ------------------------------------------------------------------------*/ function pexeto_contact_form(){ $html='
An error occurred. Message not sent.
'.pex_text('_send_text').'
'; return $html; } add_shortcode('contactform', 'pexeto_contact_form'); /* ------------------------------------------------------------------------* * PORTFOLIO CAROUSEL * ------------------------------------------------------------------------*/ /** * Builds the code for the portfolio carousel widget * @param $cat_id the ID of the category whose items will be displayed * @param $columns the number of images per page/slide */ function pexeto_portfolio_carousel($cat_id, $columns, $title){ //set the query_posts args $args= array( 'posts_per_page' =>get_opt('_carousel_max_items'), 'post_type' => PEXETO_PORTFOLIO_POST_TYPE ); if($cat_id!='-1'){ $slug=pexeto_get_taxonomy_slug($cat_id); $args['portfolio_category']=$slug; } $posts=get_posts($args); $i=0; $html= '
'.$title.'
'; foreach($posts as $post){ //open a page wrapper div on each first image of the page/slide if($i%$columns==0){ $html.='
'; } //pexeto_build_portfolio_image_html() is located in lib/functions/portfolio.php $html.='
'.pexeto_build_portfolio_image_html($post, 195, 150, true, 'carousel').'
'; if(($i+1)%$columns==0 || $i+1==sizeof($posts)){ //close the page wrapper div on the last image $html.='
'; } $i++; } $html.='
'; return $html; } function show_portfolio_carousel($atts, $content = null) { extract(shortcode_atts(array( "cat" => '', "title" => '' ), $atts)); $cat_id=$cat?get_term_by('name', $cat, 'portfolio_category')->term_id:'-1'; return pexeto_portfolio_carousel($cat_id,4,$title); } add_shortcode('carousel', 'show_portfolio_carousel'); /* ------------------------------------------------------------------------* * ADD CUSTOM FORMATTING BUTTONS * ------------------------------------------------------------------------*/ global $pexeto_buttons; $pexeto_styling_buttons=array("pexetointro", "pexetotitle", "pexetohighlight1", "pexetohighlight2", "pexetodropcaps", "|", "pexetolistcheck", "pexetoliststar", "pexetolistarrow", "pexetolistarrow2", "pexetolistarrow4", "pexetolistplus", "|", "pexetolinebreak", "pexetoframe", "pexetolightbox", "|", "pexetobutton", "pexetoinfoboxes"); $pexeto_content_buttons=array("pexetotwocolumns", "pexetothreecolumns", "pexetofourcolumns", "|", "pexetopricingtable", "|", "pexetoyoutube", "pexetovimeo", "pexetoflash", "|", "pexetotestimonials"); function add_pexeto_buttons() { if ( get_user_option('rich_editing') == 'true') { add_filter('mce_external_plugins', 'pexeto_add_btn_tinymce_plugin'); add_filter('mce_buttons_3', 'pexeto_register_styling_buttons'); add_filter('mce_buttons_4', 'pexeto_register_content_buttons'); } } add_action('init', 'add_pexeto_buttons'); /** * Register the buttons * @param $buttons */ function pexeto_register_styling_buttons($buttons) { global $pexeto_styling_buttons; array_push($buttons, implode(',',$pexeto_styling_buttons)); return $buttons; } /** * Add the buttons * @param $plugin_array */ function pexeto_add_btn_tinymce_plugin($plugin_array) { global $pexeto_styling_buttons, $pexeto_content_buttons; $merged_buttons=array_merge($pexeto_styling_buttons, $pexeto_content_buttons); foreach($merged_buttons as $btn){ $plugin_array[$btn] = PEXETO_LIB_URL.'formatting-buttons/editor-plugin.js'; } return $plugin_array; } /** * Register the buttons * @param $buttons */ function pexeto_register_content_buttons($buttons) { global $pexeto_content_buttons; array_push($buttons, implode(',',$pexeto_content_buttons)); return $buttons; }