Project

General

Profile

« Previous | Next » 

Revision 57d513cb

Added by Andreas Kohlbecker over 9 years ago

sources as bibliography per feature block

View differences:

7.x/modules/cdm_dataportal/classes/footnotemanager.php
118 118
    $key_label = NULL;
119 119
    if (!($key_label = self::footnoteExists($footnoteListKey, $object))) {
120 120

  
121
      $set_def = &self::findFootnoteSetDefinition($footnoteListKey);
121
      $set_def = &self::matchFootnoteSetDefinition($footnoteListKey);
122 122

  
123 123
      $fn_index = $set_def['key_index']++;
124 124

  
......
194 194
  }
195 195

  
196 196
  /**
197
   * Returns the footnote set definition defined via registerFootnoteSet() or returns the default.
197
   * Returns the footnote set definition which has been
198
   * registered with a key which matches the given $footnoteListKey.
199
   * A match is the first key which is equal to or which starts with $footnoteListKey
200
   * If no match is found the default is returned.
201
   *
202
   * @see registerFootnoteSet()
198 203
   *
199 204
   * @param $footnoteListKey
200 205
   * @return array
201 206
   */
202
  public static function &findFootnoteSetDefinition($footnoteListKey){
207
  public static function &matchFootnoteSetDefinition($footnoteListKey){
203 208

  
204
    if(isset(self::$fn_sets[$footnoteListKey])){
205
      return self::$fn_sets[$footnoteListKey];
209
    foreach(self::$fn_sets as $fn_set_key => &$fn_set_def){
210
      if($footnoteListKey == $fn_set_key || str_beginsWith($footnoteListKey, $fn_set_key)){
211
        return $fn_set_def;
212
      }
206 213
    }
207 214
    return self::$default_set_definition;
208 215
  }

Also available in: Unified diff