示例#1
0
 private function addSourcesToRequestData(&$requestData, &$keepKeys, &$count, &$sourcesMap, &$notesMap, &$imagesMap, $elements, &$noteAdoptions, &$imageAdoptions)
 {
     if (is_array($elements)) {
         foreach ($elements as $element) {
             if (@$keepKeys[$element['key']]) {
                 $id = $sourcesMap[$element['id']];
                 $title = $element['title'];
                 $titleLower = mb_strtolower($title);
                 $ns = '';
                 if (strpos($titleLower, 'source:') === 0) {
                     $title = mb_substr($title, strlen('source:'));
                     $ns = NS_SOURCE;
                 } else {
                     if (strpos($titleLower, 'mysource:') === 0) {
                         $title = mb_substr($title, strlen('mysource:'));
                         $ns = NS_MYSOURCE;
                     }
                 }
                 $notes = $this->addAdoptions($element['key'], ESINHandler::mapSourcesImagesNotes($notesMap, $element['notes']), $noteAdoptions);
                 $images = $this->addAdoptions($element['key'], ESINHandler::mapSourcesImagesNotes($imagesMap, $element['images']), $imageAdoptions);
                 ESINHandler::addSourceToRequestData($requestData, $count, $id, $ns, $title, $element['record_name'], $element['page'], $element['quality'], $element['date'], $notes, $images, $element['text']);
                 $count++;
             }
         }
     }
 }