195 |
195 |
return cdm_footnotes($footnote_list_key . '-annotations', $element_tag);
|
196 |
196 |
}
|
197 |
197 |
|
198 |
|
/**
|
199 |
|
* @todo Please document this function.
|
200 |
|
* @see http://drupal.org/node/1354
|
201 |
|
*/
|
202 |
|
function theme_cdm_annotation_content($variables) {
|
203 |
|
$AnnotationTO = $variables['AnnotationTO'];
|
204 |
|
drupal_add_js(drupal_get_path('module', 'cdm_dataportal') . '/js/cdm_annotations.js');
|
205 |
|
drupal_add_js(drupal_get_path('module', 'cdm_dataportal') . '/js/jquery.form.js');
|
206 |
|
|
207 |
|
$out = theme('cdm_list_of_annotations', array('annotationElements' => $AnnotationTO->annotationElements));
|
208 |
|
|
209 |
|
$annotationUrl = cdm_compose_url(CDM_WS_ANNOTATIONS, array(
|
210 |
|
$AnnotationTO->uuid,
|
211 |
|
));
|
212 |
|
$annotationProxyUrl = url('cdm_api/proxy/' . urlencode($annotationUrl) . '/cdm_annotation_post');
|
213 |
|
|
214 |
|
// TODO users have to be authenticated to the dataportal to be able to write
|
215 |
|
// annotations.
|
216 |
|
$out .= '
|
217 |
|
<div class="annotation_create">
|
218 |
|
<form action="' . $annotationProxyUrl . '" method="POST">
|
219 |
|
<textarea name="annotation"></textarea>
|
220 |
|
<input type="hidden" name="commentator" value="">
|
221 |
|
<input type="submit" value="' . t('Save annotation') . '" />
|
222 |
|
</form>
|
223 |
|
</div>
|
224 |
|
';
|
225 |
|
|
226 |
|
return $out;
|
227 |
|
}
|
228 |
|
|
229 |
|
/**
|
230 |
|
* @todo Please document this function.
|
231 |
|
* @see http://drupal.org/node/1354
|
232 |
|
*/
|
233 |
|
function theme_cdm_list_of_annotations($variables) {
|
234 |
|
$annotationElements = $variables['annotationElements'];
|
235 |
|
$out = '<ul class="annotation_list">';
|
236 |
|
|
237 |
|
foreach ($annotationElements as $key => $row) {
|
238 |
|
$created[$key] = $row;
|
239 |
|
}
|
240 |
|
array_multisort($created, SORT_ASC, $annotationElements);
|
241 |
|
|
242 |
|
foreach ($annotationElements as $annotation) {
|
243 |
|
$out .= '<li>' . $annotation->text . '</li>';
|
244 |
|
}
|
245 |
|
|
246 |
|
$out .= '</ul>';
|
247 |
|
|
248 |
|
return $out;
|
249 |
|
}
|
250 |
|
|
251 |
198 |
/* ============================ footnotes ============================= */
|
252 |
199 |
/**
|
253 |
200 |
* @todo Please document this function.
|
ref #8543 removing unused footnote related theme functions