Exemplo n.º 1
0
        }
        return $figure;
    } else {
        $class = trim($tag->attr('class') . ' ' . $tag->attr('imgclass'));
        return $_link($_image($class));
    }
});
// link tag
kirbytext::$tags['link'] = array('attr' => array('text', 'class', 'title', 'rel', 'target', 'popup'), 'html' => function ($tag) {
    $link = url($tag->attr('link'));
    $text = $tag->attr('text');
    if (empty($text)) {
        $text = escape::attr($link);
    } else {
        if (str::isURL($text)) {
            $text = escape::attr($text);
        }
    }
    return html::a($link, $text, array('rel' => $tag->attr('rel'), 'class' => $tag->attr('class'), 'title' => $tag->attr('title'), 'target' => $tag->target()));
});
// tel tag
kirbytext::$tags['tel'] = array('attr' => array('text', 'class', 'title'), 'html' => function ($tag) {
    $text = $tag->attr('text');
    $tel = str_replace(array('/', ' ', '-'), '', $tag->attr('tel'));
    if (empty($text)) {
        $text = $tag->attr('tel');
    }
    return html::a('tel:' . $tel, html($text), array('rel' => $tag->attr('rel'), 'class' => $tag->attr('class'), 'title' => html($tag->attr('title'))));
});
// twitter tag
kirbytext::$tags['twitter'] = array('attr' => array('class', 'title', 'text', 'rel', 'target', 'popup'), 'html' => function ($tag) {
Exemplo n.º 2
0
        }
        return $figure;
    } else {
        $class = trim($tag->attr('class') . ' ' . $tag->attr('imgclass'));
        return $_link($_image($class));
    }
});
// link tag
kirbytext::$tags['link'] = array('attr' => array('text', 'class', 'title', 'rel', 'lang', 'target', 'popup'), 'html' => function ($tag) {
    $link = url($tag->attr('link'), $tag->attr('lang'));
    $text = $tag->attr('text');
    if (empty($text)) {
        $text = escape::attr($link, true);
    } else {
        if (str::isURL($text)) {
            $text = escape::attr($text, true);
        }
    }
    return html::a($link, $text, array('rel' => $tag->attr('rel'), 'class' => $tag->attr('class'), 'title' => $tag->attr('title'), 'target' => $tag->target()));
});
// tel tag
kirbytext::$tags['tel'] = array('attr' => array('text', 'class', 'title'), 'html' => function ($tag) {
    $text = $tag->attr('text');
    $tel = str_replace(array('/', ' ', '-'), '', $tag->attr('tel'));
    if (empty($text)) {
        $text = $tag->attr('tel');
    }
    return html::a('tel:' . $tel, html($text), array('rel' => $tag->attr('rel'), 'class' => $tag->attr('class'), 'title' => html($tag->attr('title'))));
});
// twitter tag
kirbytext::$tags['twitter'] = array('attr' => array('class', 'title', 'text', 'rel', 'target', 'popup'), 'html' => function ($tag) {