示例#1
0
function ogpl_css3_apachesolr_unclick_link($facet_text, $path, $options = array())
{
    //apachesolr_js();
    // Determine if we are dealing with ratings output
    if ($options['delta'] == 'sis_ratings') {
        $options['html'] = TRUE;
        $text = theme('fivestar_static', $facet_text, variable_get('fivestar_stars_resource', 5));
    }
    if (empty($options['html'])) {
        $text = check_plain($facet_text);
    } else {
        // Don't pass this option as TRUE into apachesolr_l().
        unset($options['html']);
    }
    if ($facet_text == 'text/csv') {
        $text = "CSV";
    }
    if ($facet_text == 'text/plain') {
        $text = "TXT";
    }
    if ($facet_text == 'text/xml') {
        $text = "XML";
    }
    if ($facet_text == 'text/html') {
        $text = "HTML";
    }
    if ($facet_text == 'application/pdf') {
        $text = "PDF";
    }
    if ($facet_text == 'application/zip') {
        $text = "ZIP";
    }
    if ($facet_text == 'application/vnd.ms-powerpoint') {
        $text = "PPT";
    }
    if ($facet_text == 'application/vnd.openxmlformats-officedocument.wordprocessingml.document') {
        $text = "DOCX";
    }
    if ($facet_text == 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet') {
        $text = "XLSX";
    }
    if ($facet_text == 'application/vnd.openxmlformats-officedocument.presentationml.presentation') {
        $text = "PPTX";
    }
    if ($facet_text == 'application/vnd.ms-document') {
        $text = "DOC";
    }
    if ($facet_text == 'application/vnd.ms-excel') {
        $text = "XLS";
    }
    //CATALOG_TYPE_LABELS
    if ($facet_text == 'catalog_type_raw_data') {
        $text = "Raw Data";
    }
    if ($facet_text == 'catalog_type_data_apps') {
        $text = "Apps";
    }
    if ($facet_text == 'catalog_type_document') {
        $text = "Documents";
    }
    if ($facet_text == 'catalog_type_data_tools') {
        $text = "Tools";
    }
    if ($facet_text == 'catalog_type_data_service') {
        $text = "Services";
    }
    if (is_numeric($facet_text)) {
        $nid = (int) $facet_text;
        $node = node_load($nid);
        $text = $node->title;
    }
    $options['attributes']['title'] = 'Remove Filter';
    $options['attributes']['class'] = 'apachesolr-unclick';
    return apachesolr_l("(-)", $path, $options) . ' ' . $text;
}
示例#2
0
function tendu_apachesolr_unclick_link($facet_text, $path, $options = array())
{
    if (empty($options['html'])) {
        $facet_text = check_plain($facet_text);
    } else {
        // Don't pass this option as TRUE into apachesolr_l().
        unset($options['html']);
    }
    if (strpos($facet_text, '[') == 0) {
        $trans = array("[" => "\$", "TO " => "- \$", "]" => "");
        $facet_text = strtr($facet_text, $trans);
    }
    $options['attributes']['class'] = 'apachesolr-unclick';
    return apachesolr_l("(X)", $path, $options) . ' ' . $facet_text;
}