/**
  * Load the list of occurrence attributes into a static variable. 
  *
  * By maintaining a single list of attributes we can track which have already been output.
  * @param array $readAuth Read authorisation tokens.
  * @param integer $surveyId ID of the survey to load occurrence attributes for.
  */
 protected static function load_custom_occattrs($readAuth, $surveyId)
 {
     if (!isset(self::$occAttrs)) {
         // Add any dynamically generated controls
         $attrArgs = array('valuetable' => 'occurrence_attribute_value', 'attrtable' => 'occurrence_attribute', 'key' => 'occurrence_id', 'fieldprefix' => 'occAttr', 'extraParams' => $readAuth, 'survey_id' => $surveyId);
         if (count(self::$occurrenceIds) == 1) {
             // if we have a single occurrence Id to load, use it to get attribute values
             $attrArgs['id'] = self::$occurrenceIds[0];
         }
         self::$occAttrs = data_entry_helper::getAttributes($attrArgs, false);
     }
 }