Example #1
0
 /**
  * Iterates through list of documents and indexes them
  *
  * @access	protected
  *
  * @return	void
  */
 protected function indexLoop()
 {
     // Get document from list.
     list($uid, $title) = $this->list->remove(0);
     $this->list->save();
     // Save document to database and index.
     $doc =& tx_dlf_document::getInstance($uid, 0, TRUE);
     if ($doc->ready) {
         $doc->save($doc->pid, $this->data['core']);
     }
     // Give feedback about progress.
     $_message = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Messaging\\FlashMessage', htmlspecialchars(sprintf(tx_dlf_helper::getLL('flash.documentsToGo'), count($this->list))), tx_dlf_helper::getLL('flash.running', TRUE), \TYPO3\CMS\Core\Messaging\FlashMessage::INFO, TRUE);
     $this->markerArray['CONTENT'] .= $_message->render();
     // Start next loop.
     $this->markerArray['CONTENT'] .= '<script type="text/javascript">window.location.href=unescape("' . \TYPO3\CMS\Core\Utility\GeneralUtility::rawUrlEncodeJS(\TYPO3\CMS\Core\Utility\GeneralUtility::locationHeaderUrl(\TYPO3\CMS\Core\Utility\GeneralUtility::linkThisScript(array('id' => $this->id, 'CMD' => 'indexLoop', $this->prefixId => array('core' => $this->data['core']), 'random' => uniqid())))) . '");</script>';
     $this->printContent();
 }