Example #1
0
function css($atts)
{
    global $css, $doctype;
    extract(lAtts(array('format' => 'url', 'media' => 'screen', 'n' => $css, 'name' => $css, 'rel' => 'stylesheet', 'title' => ''), $atts));
    if (isset($atts['n'])) {
        $name = $n;
        trigger_error(gTxt('deprecated_attribute', array('{name}' => 'n')), E_USER_NOTICE);
    }
    if (empty($name)) {
        $name = 'default';
    }
    if (has_handler('css.url')) {
        $url = callback_event('css.url', '', false, compact('name'));
    } else {
        $url = hu . 'css.php?n=' . urlencode($name);
    }
    if ($format == 'link') {
        return tag_void('link', array('rel' => $rel, 'type' => $doctype != 'html5' ? 'text/css' : '', 'media' => $media, 'title' => $title, 'href' => $url));
    }
    return txpspecialchars($url);
}
Example #2
0
/**
 * Gets a page template's contents.
 *
 * The page template's reading method can be modified by registering a handler
 * to a 'page.fetch' callback event. Any value returned by the callback function
 * will be used as the template markup.
 *
 * @param   string      $name The template
 * @return  string|bool The page template, or FALSE on error
 * @package TagParser
 * @since   4.6.0
 * @example
 * echo fetch_page('default');
 */
function fetch_page($name)
{
    if (has_handler('page.fetch')) {
        $page = callback_event('page.fetch', '', false, compact('name'));
    } else {
        $page = safe_field('user_html', 'txp_page', "name = '" . doSlash($name) . "'");
    }
    if ($page === false) {
        return false;
    }
    trace_add('[' . gTxt('page') . ': ' . $name . ']');
    return $page;
}
Example #3
0
/**
 * Gets a page template's contents.
 *
 * The page template's reading method can be modified by registering a handler
 * to a 'page.fetch' callback event. Any value returned by the callback function
 * will be used as the template markup.
 *
 * @param   string $name The template
 * @return  string|bool The page template, or FALSE on error
 * @package TagParser
 * @since   4.6.0
 * @example
 * echo fetch_page('default');
 */
function fetch_page($name)
{
    if (has_handler('page.fetch')) {
        $page = callback_event('page.fetch', '', false, compact('name'));
    } else {
        $page = safe_field("user_html", 'txp_page', "name = '" . doSlash($name) . "'");
    }
    if ($page === false) {
        return false;
    }
    trace_add("[Page: '{$name}']");
    return $page;
}