| 1 |
<?php |
| 2 |
|
| 3 |
/* * ********************************************************* |
| 4 |
* BUTTONS |
| 5 |
* ********************************************************* */ |
| 6 |
|
| 7 |
function osc_theme_button($params, $content = null) { |
| 8 |
extract(shortcode_atts(array( |
| 9 |
'title' => 'osCitas', |
| 10 |
'link' => '', |
| 11 |
'linkrel' => '', |
| 12 |
'type' => 'link', |
| 13 |
'style' => '', |
| 14 |
'align' => '', |
| 15 |
'target' => '', |
| 16 |
'icon' => '', |
| 17 |
'class' => '', |
| 18 |
'iconcolor'=>'' |
| 19 |
), $params)); |
| 20 |
$out = ''; |
| 21 |
$iconcount = array(); |
| 22 |
if ($icon) $iconcount=explode(' ',$icon); |
| 23 |
array_filter($iconcount); |
| 24 |
if(count($iconcount)==1){ |
| 25 |
$icon= 'glyphicon '.$icon; |
| 26 |
} |
| 27 |
if($icon!=''){ |
| 28 |
if($iconcolor!=''){ |
| 29 |
$iconcolor='style="color:'.$iconcolor.';"'; |
| 30 |
} |
| 31 |
if($align=='right'){ |
| 32 |
$value=$title.' <i class="'.$icon.'" '.$iconcolor.'></i>'; |
| 33 |
} else{ |
| 34 |
$value='<i class="'.$icon.'" '.$iconcolor.'></i> '.$title; |
| 35 |
} |
| 36 |
}else{ |
| 37 |
$value=$title; |
| 38 |
} |
| 39 |
$target = ' target="'.($target != 'false' ? '_blank':'_self').'"'; |
| 40 |
if ($type == 'link') { |
| 41 |
$out = '<a class="btn ' . $style . ' ' . $class . ' '.EBS_CONTAINER_CLASS.'" href="' . $link . '" rel="' . $linkrel . '" ' . ($target) . '>' . $value . '</a>'; |
| 42 |
} elseif ($type == 'button') { |
| 43 |
$out = '<button class="btn ' . $style . ' ' . $class . ' '.EBS_CONTAINER_CLASS.'" >' . $value . '</button>'; |
| 44 |
} |
| 45 |
return $out; |
| 46 |
} |
| 47 |
|
| 48 |
ebs_backward_compatibility_callback('button', 'osc_theme_button'); |