コード例 #1
0
 public static function items_get($id)
 {
     // This is to make sure get_the_link() etc. work.
     global $item;
     $item = Items::get_instance()->get_item($id);
     if ($item != false) {
         $item->actions = apply_filters('action_bar', array());
     }
     $item->services = Services::get_for_item($item);
     return $item;
 }
コード例 #2
0
ファイル: skin.php プロジェクト: JocelynDelalande/Lilina
/**
 * 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');
}