Example #1
0
/**
 * Form themeing function - fieldset
 * @param array $structure Form structure
 * @return string HTML construction
 */
function theme_render_fieldset($structure)
{
    $out = '<fieldset' . (isset($structure['#attributes']) ? ssc_attributes($structure['#attributes']) : '') . '>' . (isset($structure['#title']) ? '<legend>' . $structure['#title'] . '</legend>' : '');
    $out .= $structure['#value'] . '</fieldset>';
    return $out;
}
Example #2
0
/**
 * Builds a link.
 * 
 * @param string $title Text for use as title of link
 * @param string $path Path relative to base of fully HTTP url
 * @param array $op Options for formatting the link
 * @return string Completed HTML link
 */
function l($title, $path, $op = array())
{
    global $ssc_site_url;
    // Defaults
    $op += array('abs' => false, 'html' => false);
    // Are we an active link?
    if ($path == $_GET['q']) {
        if (isset($op['attributes']['class'])) {
            $op['attributes']['class'] .= ' active';
        } else {
            $op['attributes']['class'] = 'active';
        }
    }
    // Check for absolute path
    if (strpos($path, '://') !== false) {
        $op['ext'] = true;
    } else {
        $path = $ssc_site_url . $path;
    }
    return '<a href="' . $path . '" ' . (!empty($op['attributes']) ? ssc_attributes($op['attributes']) : '') . '>' . ($op['html'] ? $title : check_plain($title)) . '</a>';
}