/** * Output all available "actions" for the current item * */ function action_bar($args = '') { $defaults = array('header' => '<ul>', 'footer' => '</ul>', 'before' => '<li class="action">', 'after' => '</li>'); $args = lilina_parse_args($args, $defaults); /** Make sure we don't overwrite any current variables */ extract($args, EXTR_SKIP); $actions = apply_filters('action_bar', array()); if (!empty($actions)) { echo $header; foreach ($actions as $action) { echo $before . $action . $after; } echo $footer; } do_action('river_entry'); }
/** * Output all available "actions" for the current item * */ function action_bar($args = '') { global $item; $defaults = array('header' => '<ul>', 'footer' => '</ul>', 'before' => '<li class="action">', 'after' => '</li>'); $args = lilina_parse_args($args, $defaults); /** Make sure we don't overwrite any current variables */ extract($args, EXTR_SKIP); $services = Services::get_for_item($item); if (!empty($services)) { echo $header; foreach ($services as $id => $service) { echo $before . '<a href="' . $service['action'] . '" class="service service-' . $service['type'] . ' service-' . $id . '">' . $service['label'] . '</a>' . $after; } echo $footer; } do_action('river_entry'); }