Ejemplo n.º 1
0
/**
 * Handles the [practiceareas /] shortcode. Usage:
 *
 * - [practiceareas /]
 * - [practiceareas list /]
 * - [practiceareas max=5 list /]
 * - [practiceareas length=250 columns=4 more /] (Max of 250 chars, in four columns, with a "more" link)
 *
 * @param array $atts
 * @param string $content
 */
function ciHandlePracticeAreaShortcode($atts, $content = "")
{
    $list = false;
    $max = 1000;
    $length = 250;
    $columns = 4;
    $more = false;
    $mb = 30;
    extract(shortcode_atts(array('list' => $list, 'max' => $max, 'length' => $length, 'columns' => $columns, 'more' => $more, 'mb' => $mb), ciNormalizeShortcodeAtts($atts), 'practiceareas'));
    if ($list) {
        return ciGetPracticeAreasTitlesList($max);
    } else {
        return ciGetPracticeAreasHTML($max, 3, $length, true, $columns, $more, $mb);
    }
}
Ejemplo n.º 2
0
function ciGetAvailabilityArray($atts)
{
    $xs = false;
    // Defined for the sake of the IDE's error-checking
    $sm = false;
    $md = false;
    $lg = false;
    extract(shortcode_atts(array('xs' => false, 'sm' => false, 'md' => false, 'lg' => false), ciNormalizeShortcodeAtts($atts)), EXTR_OVERWRITE);
    $arr = array();
    if ($xs) {
        $arr[] = "xs";
    }
    if ($sm) {
        $arr[] = "sm";
    }
    if ($md) {
        $arr[] = "md";
    }
    if ($lg) {
        $arr[] = "lg";
    }
    return $arr;
}
Ejemplo n.º 3
0
 function ciAddColoredBackground($atts, $content = "")
 {
     $p = false;
     // Defined for the sake of the IDE's error-checking
     $mt = -1;
     $mb = -1;
     $highlight = false;
     extract(shortcode_atts(array('mt' => -1, 'mb' => -1, 'highlight' => false, 'p' => false), ciNormalizeShortcodeAtts($atts)), EXTR_OVERWRITE);
     $class = "colored-bg";
     if ($mt >= 0) {
         $class .= " mt{$mt}";
     }
     if ($mb >= 0) {
         $class .= " mb{$mb}";
     }
     if ($highlight) {
         $class .= " highlight";
     }
     $markup = "<span class=\"{$class}\">" . do_shortcode($content) . "</span>";
     if ($p) {
         $markup = "<p>" . $markup . "</p>";
     }
     return $markup;
 }
Ejemplo n.º 4
0
 function ciEmployeeHTMLShortcode($atts)
 {
     $columns = 1;
     // Defined for the sake of the IDE's error-checking
     $length = 250;
     $list = false;
     $number = 100;
     extract(shortcode_atts(array('columns' => 1, 'length' => 250, 'number' => $number, 'list' => $list), ciNormalizeShortcodeAtts($atts)), EXTR_OVERWRITE);
     return ciGetEmployeesHTML(intval($columns), $number, 3, intval($length), $list);
 }