/** * Pagination [pagination] * Available Attributes: * @color: background color * @textColor: text color */ public static function pagination($atts, $content) { $color = !empty($atts['color']) ? $atts['color'] : ''; $text = !empty($atts['text']) ? $atts['text'] : ''; $class = $color . " " . $text . "-text"; $items = parent::get_stripped_shortcodes($content, 'pag_item'); $stripped_content = parent::strip_shortcode($content, 'pag_item'); $pag_items = $items[0]; ob_start(); ?> <span class="materializer"> <ul class="pagination <?php echo $class; ?> "> <?php if (!empty($pag_items)) { foreach ($pag_items as $item) { echo do_shortcode($item); } } ?> </ul> </span> <?php return ob_get_clean(); }
/** * Dropdown [card] * Available Attributes: * @color: background color * @textColor: text color */ public static function dropdown($atts, $content) { $name = !empty($atts['name']) ? $atts['name'] : '#'; $color = !empty($atts['color']) ? $atts['color'] : ''; $text = !empty($atts['text']) ? $atts['text'] : ''; $class = $color . " " . $text . "-text"; $items = parent::get_stripped_shortcodes($content, 'dropdown_item'); $stripped_content = parent::strip_shortcode($content, 'dropdown_item'); $dd_items = $items[0]; ob_start(); ?> <span class="materializer"> <a class='dropdown-button btn <?php echo $class; ?> ' href='<?php echo $to; ?> ' data-activates='<?php echo $name; ?> '> <?php echo do_shortcode($stripped_content); ?> </a> <?php if ($dd_items !== NULL) { ?> <ul id='<?php echo $name; ?> ' class='dropdown-content <?php echo $class; ?> '> <?php foreach ($dd_items as $item) { echo '<li>'; echo do_shortcode($item); echo '</li>'; } ?> </ul> <?php } ?> </span> <?php return ob_get_clean(); }
/** * Collection [collection] * Available Attributes: * @color: background color * @textColor: text color */ public static function collection($atts, $content) { $color = !empty($atts['color']) ? $atts['color'] : ''; $text = !empty($atts['text']) ? $atts['text'] : ''; $type = !empty($atts['type']) ? $atts['type'] : ''; $class = $color . " " . $text . "-text"; $items = parent::get_stripped_shortcodes($content, 'collection_item'); $stripped_content = parent::strip_shortcode($content, 'collection_item'); $collection_items = $items[0]; if ($type === "") { ob_start(); ?> <span class="materializer"> <ul class="collection <?php echo $class; ?> "> <?php if (!empty($collection_items)) { foreach ($collection_items as $item) { echo do_shortcode($item); } } ?> </ul> </span> <?php return ob_get_clean(); } if ($type === "links") { $links = preg_replace("/collection_item/", "collection_link", $collection_items); ob_start(); ?> <span class="materializer"> <div class="collection <?php echo $class; ?> "> <?php if (!empty($links)) { foreach ($links as $link) { echo do_shortcode($link); } } ?> </div> </span> <?php return ob_get_clean(); } }
/** * Collapsible [collapsible_popout] * Available Attributes: * @color: background color * @textColor: text color * @type: accordion/expandable (Default accordion) * @popout: default false, optional true * @preselected: a preselected option */ public static function collapsible($atts, $content) { $color = !empty($atts['color']) ? $atts['color'] : ''; $text = !empty($atts['text']) ? $atts['text'] : ''; $type = !empty($atts['type']) ? $atts['type'] : 'expandable'; $style = !empty($atts['style']) ? $atts['style'] : ''; $class = $style . " " . $color . " " . $text . "-text"; $items = parent::get_stripped_shortcodes($content, 'collapsible_item'); $stripped_content = parent::strip_shortcode($content, 'collapsible_item'); $collapsible_items = $items[0]; ob_start(); ?> <span class="materializer"> <ul class="collapsible <?php echo $class; ?> " data-collapsible="<?php echo $type; ?> "> <?php if (!empty($collapsible_items)) { ?> <?php foreach ($collapsible_items as $item) { ?> <li> <?php echo do_shortcode($item); ?> </li> <?php } ?> <?php } ?> </ul> </span> <?php return ob_get_clean(); }
/** * Reveal Card [card_reveal] * Available Attributes: * @img: The background image * @actionLink: Card action links * @color: background color * @textColor: text color * @size: small/medium/large */ public static function revealCard($atts, $content) { $title = isset($atts['title']) ? $atts['title'] : ''; $color = isset($atts['color']) ? $atts['color'] : ''; $text = isset($atts['text']) ? $atts['text'] : ''; $img = isset($atts['img']) ? $atts['img'] : ''; $titleColor = isset($atts['title_color']) ? $atts['title_color'] : ''; $more_icon = isset($atts['more_icon']) ? $atts['more_icon'] : '^'; $less_icon = isset($atts['less_icon']) ? $atts['less_icon'] : 'X'; $open_content = parent::get_stripped_shortcodes($content, 'card_open'); $stripped_content = parent::strip_shortcode($content, 'card_open'); ob_start(); ?> <div class="materializer"> <div class="card"> <div class="card-image waves-effect waves-block waves-light"> <img class="activator" src="https://simplyrets.com/images/scrot1.png"> </div> <div class="card-content"> <span class="card-title activator grey-text text-darken-4"> <?php echo $title; ?> <i class="right"><?php echo $more_icon; ?> </i> </span> <p> <?php echo do_shortcode($stripped_content); ?> </p> </div> <div class="card-reveal"> <span class="card-title grey-text text-darken-4"> <?php echo $title; ?> <i class="right"><?php echo $less_icon; ?> </i> </span> <?php echo do_shortcode($open_content[0][0]); ?> </div> </div> </div> <?php return ob_get_clean(); }
/** * Fixed Action Button [btn_fixed_action] * Available Attributes: * @waves: true (default/dark), light, false * @to: the element/page to link * @color: background color * @textColor: text color * @disabled: disabled (default false) */ public static function fixedActionButton($atts, $content) { $color = !empty($atts['color']) ? $atts['color'] : ''; $text = !empty($atts['text']) ? $atts['text'] : ''; $class = $color . " " . $text . "-text"; $links = parent::get_stripped_shortcodes($content, 'action'); $stripped_content = parent::strip_shortcode($content, 'action'); $action_links = $links[0]; ob_start(); ?> <div class="materializer"> <div class="fixed-action-btn" style="bottom: 45px; right: 24px;"> <a class="btn-floating btn-large red"> <i class="large material-icons">mode_edit</i> </a> <?php if ($action_links !== NULL) { ?> <ul> <?php foreach ($action_links as $link) { echo '<li>'; echo do_shortcode($link); echo '</li>'; } ?> </ul> <?php } ?> </div> </div> <?php return ob_get_clean(); }