public function __construct($oLanguageObject, $aRequestPath = null)
 {
     if (isset($_REQUEST['document_category_id'])) {
         $this->iCategoryId = $_REQUEST['document_category_id'];
     }
     parent::__construct($oLanguageObject, $aRequestPath);
 }
 public function getDisplayOptions()
 {
     $aResult = array();
     foreach (ResourceFinder::findResourceObjectsByExpressions(array(DIRNAME_MODULES, FrontendModule::getType(), FrontendModule::getNameByClassName('LoginFrontendModule'), DIRNAME_TEMPLATES, '/^[\\w_\\d-]+\\.tmpl$/')) as $oResource) {
         $sFileName = $oResource->getFileName('.tmpl');
         if (strpos($sFileName, '_action_') !== false) {
             continue;
         }
         $aResult[$sFileName] = StringUtil::makeReadableName($sFileName);
     }
     return $aResult;
 }
Ejemplo n.º 3
0
 public static function getDirectoryForModule($sModuleName)
 {
     $aModules = FrontendModule::listModules();
     $sPath = $aModules[$sModuleName];
     return $sPath;
 }
Ejemplo n.º 4
0
 public function __construct($oLanguageObject, $aRequestPath = null)
 {
     parent::__construct($oLanguageObject, $aRequestPath);
 }
Ejemplo n.º 5
0
 public function getPreview($iSize = 190, $bRefresh = true, $bMayReturnTemplate = false)
 {
     $aOptions = array();
     $aOptions['document_id'] = $this->getId();
     if ($this->getDocumentType()->getDocumentKind() === 'image') {
         // Objects don’t get displayed otherwise
         $aOptions['max_width'] = $iSize;
         $aOptions['max_height'] = $iSize;
         $aOptions['force_refresh'] = $bRefresh;
     } else {
         $aOptions['width'] = $iSize;
         $aOptions['height'] = $iSize * 0.747;
     }
     $aFallback = $aOptions;
     $aFallback['document_id'] = '';
     $aFallback['height'] = $iSize;
     $aFallback['url'] = LinkUtil::link(array('document_type_preview', $this->getDocumentTypeId()), 'FileManager', array('size' => $iSize));
     $oModule = FrontendModule::getModuleInstance('media_object', serialize(array($aOptions, $aFallback)));
     $oResult = $oModule->renderFrontend();
     if ($bMayReturnTemplate) {
         return $oResult;
     }
     return $oResult->render();
 }
Ejemplo n.º 6
0
 public function fillAutofill()
 {
     $bIsPreview = $this->isPreview();
     $this->oTemplate->replaceIdentifierCallback("autofill", function ($oTemplateIdentifier, $iFlags) use($bIsPreview) {
         $oModule = FrontendModule::getModuleInstance($oTemplateIdentifier->getValue(), $oTemplateIdentifier->getParameter('data'));
         $mResult = $oModule->cachedFrontend($bIsPreview);
         if (($sCss = $oModule->getCssForFrontend()) !== null) {
             ResourceIncluder::defaultIncluder()->addCustomCss($sCss);
         }
         if (($sJs = $oModule->getJsForFrontend()) !== null) {
             ResourceIncluder::defaultIncluder()->addCustomJs($sJs);
         }
         return $mResult;
     }, null, Template::NO_HTML_ESCAPE);
 }
Ejemplo n.º 7
0
 public function getObjectTypeName($sLanguageId = null)
 {
     return FrontendModule::getDisplayNameByName($this->getObjectType(), $sLanguageId);
 }
Ejemplo n.º 8
0
 public function getAdminWidget()
 {
     return WidgetModule::getWidget('language_object_control', null, $this, FrontendModule::getModuleInstance($this->getContentObject()->getObjectType(), $this));
 }
Ejemplo n.º 9
0
 private function paramsForObject($oObject)
 {
     $aObject = array('id' => $oObject->getId());
     $aObject['language_objects'] = array();
     foreach (LanguageQuery::create()->orderById()->find() as $oLanguage) {
         $aLanguageInfo = array();
         $oLanguageObject = $oObject->getLanguageObject($oLanguage->getId());
         $aLanguageInfo['exists_in_language'] = $oLanguageObject !== null;
         if ($oLanguageObject === null) {
             $oLanguageObject = LanguageObjectHistoryQuery::create()->filterByLanguageId($oLanguage->getId())->filterByObjectId($oObject->getId())->sort()->findOne();
             $aLanguageInfo['is_draft'] = $oLanguageObject !== null;
         } else {
             $aLanguageInfo['is_draft'] = $oLanguageObject->getHasDraft();
         }
         if ($oLanguageObject !== null) {
             $sFrontendModuleClass = FrontendModule::getClassNameByName($oObject->getObjectType());
             if (class_exists($sFrontendModuleClass, true)) {
                 $mContentInfo = $sFrontendModuleClass::getContentInfo($oLanguageObject);
             } else {
                 $mContentInfo = null;
             }
             $aLanguageInfo['content_info'] = $mContentInfo;
         } else {
             $aLanguageInfo['content_info'] = null;
         }
         $aObject['language_objects'][$oLanguage->getId()] = $aLanguageInfo;
     }
     $aObject['object_type'] = $oObject->getObjectType();
     $aObject['has_condition'] = $oObject->getConditionSerialized() !== null;
     $aObject['object_type_display_name'] = FrontendModule::getDisplayNameByName($oObject->getObjectType());
     return $aObject;
 }
 public function renderPreview($aPostData)
 {
     $sModuleData = $this->oFrontendModule->dataFromPost($aPostData);
     $oModule = FrontendModule::getModuleInstance('media_object', $sModuleData);
     return $oModule->renderFrontend()->render();
 }
Ejemplo n.º 11
0
 public function __construct($oLanguageObject = null, $aRequestPath = null, $iId = 1)
 {
     parent::__construct($oLanguageObject, $aRequestPath, $iId);
 }