Project

General

Profile

Revision 72d57201

ID72d57201d9c9b557895fd7ede7a277f84d1d9b76
Parent fb308159
Child b90ef618

Added by Katja Luther over 1 year ago

ref #8182: specimen tree is collapsable, blast result table with clickable details

View differences:

modules/cdm_dataportal/theme/cdm_dataportal.page.theme
99 99
        $out .= "Specimen ";
100 100
    }
101 101

  
102
  if($collection){
103
    $out .= $collection." ";
104
  }
105
  $out .= $specimenID;
102
    if($collection){
103
        $out .= $collection." ";
104
    }
105
    $out .= $specimenID;
106 106

  
107
  RenderHints::popFromRenderStack();
107
    RenderHints::popFromRenderStack();
108

  
109
    return '<span class="' . $specimen->class . '">' . $out . '</span>';
110
}
111

  
112
/**
113
 * Returns HTML for the default title of a specimen page.
114
 *  * The returned title is a the identifier of the specimen.
115
 *
116
 * @param array $variables
117
 *   An associative array containing:
118
 *   - specimen: The specimen being formatted for the title.
119
 *
120
 * @return string
121
 *  Markup for the title of a specimen page
122
 *
123
 * @ingroup themeable
124
 */
125
function theme_cdm_specimen_dto_page_title($variables)
126
{
127

  
128
    $specimen = $variables['specimen'];
129
    RenderHints::pushToRenderStack('specimen_page_title');
130
    $referenceUri = '';
131
    $out = '';
132

  
133
    $collection = null;
134
    if (!($specimen->class == 'FieldUnit')) {
135
        if ($specimen->collection) {
136
            if ($specimen->collection->code) {
137
                $collection = $specimen->collection->code;
138
            } elseif ($specimen->collection->name) {
139
                $collection = $specimen->collection->name;
140
            }
141
        }
142
        if ($specimen->accessionNumber) {
143
            $specimenID = $specimen->accessionNumber;
144
        } elseif ($specimen->barcode) {
145
            $specimenID = $specimen->barcode;
146
        } elseif ($specimen->catalogNumber) {
147
            $specimenID = $specimen->catalogNumber;
148
        } elseif ($specimen->titleCache) {
149
            $specimenID = $specimen->titleCache;
150
        }
151
        if (!isset($specimenID) and !isset($collection)) {
152
            $specimenID = $specimen->uuid;
153
        }
154
    }else{
155
        if ($specimen->titleCache) {
156
            $specimenID = $specimen->titleCache;
157
        }
158
        if (!isset($specimenID) and !isset($collection)) {
159
            $specimenID = $specimen->uuid;
160
        }
161
    }
162

  
163
    if ($specimen ->class == 'FieldUnit'){
164
        $out .= "FieldUnit ";
165
    }else{
166
        $out .= "Specimen ";
167
    }
168

  
169
    if($collection){
170
        $out .= $collection." ";
171
    }
172
    $out .= $specimenID;
173

  
174
    RenderHints::popFromRenderStack();
108 175

  
109
  return '<span class="' . $specimen->class . '">' . $out . '</span>';
176
    return '<span class="' . $specimen->class . '">' . $out . '</span>';
110 177
}
111 178

  
112 179
/**

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)