Project

General

Profile

Revision bc7f81f1

IDbc7f81f1a57354979c2d4908f1565ea2a2a32ff5
Parent 8e677507
Child 963f9de3

Added by Andreas Kohlbecker about 2 months ago

ref #8543 removing unused footnote related theme functions

View differences:

modules/cdm_dataportal/theme/cdm_dataportal.common.theme
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.
modules/cdm_dataportal/theme/theme_registry.inc
38 38

  
39 39
    // Themes in cdm_dataportal.common.theme.
40 40
    'cdm_entities_annotations_as_footnotekeys' => array('variables' => array('cdmBase_list' => NULL, 'footnote_list_key' => NULL)),
41
    'cdm_annotation_content' => array('variables' => array('AnnotationTO' => NULL)),
42
    'cdm_list_of_annotations' => array('variables' => array('annotationElements' => NULL)),
43 41
    'cdm_footnote_key' => array('variables' => array(
44 42
        'footnoteKey' => NULL,
45 43
        'separator' => '',

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)