Esempio n. 1
0
 /**
  * @param Model\Document $document
  */
 protected function addTranslationsData(Model\Document $document)
 {
     $service = new Model\Document\Service();
     $translations = $service->getTranslations($document);
     $language = $document->getProperty("language");
     unset($translations[$language]);
     $document->translations = $translations;
 }
Esempio n. 2
0
 public function translationDetermineParentAction()
 {
     $success = false;
     $targetPath = null;
     $document = Document::getById($this->getParam("id"));
     if ($document) {
         $service = new Document\Service();
         $translations = $service->getTranslations($document->getParent());
         if (isset($translations[$this->getParam("language")])) {
             $targetDocument = Document::getById($translations[$this->getParam("language")]);
             $targetPath = $targetDocument->getRealFullPath();
             $success = true;
         }
     }
     $this->_helper->json(["success" => $success, "targetPath" => $targetPath]);
 }