function _init(&$oForm, $aElement, $aObjectType, $sXPath, $sNamePrefix = FALSE)
 {
     parent::_init($oForm, $aElement, $aObjectType, $sXPath, $sNamePrefix);
     if (!t3lib_extmgm::isLoaded("extbase")) {
         $this->oForm->mayday("datasource:CONTENTREPOSITORY[name='" . $this->getName() . "'] The Content Repository API is <b>not loaded</b>, and should be (<b>EXT:extbase</b>).");
     }
     $this->loadContentRepositoryFramework();
     $this->loadAggregates();
     $this->loadRepository();
 }
    /**
     * including of all nessecary core files (gzip or seperate, additional language files, callbackJS)
     * 
     * @param	array		config to use
     * @return	array		code incl. script tags
     */
    function getCoreScript($config)
    {
        $code = '';
        $loaded = t3lib_extmgm::isLoaded($config['languagesExtension']) ? 1 : 0;
        if ($config['gzip']) {
            $code .= '
				<script type="text/javascript" src="' . $config['tiny_mceGzipPath'] . '"></script>
				<script type="text/javascript">
				tinyMCE_GZ.init({
					plugins : "' . $config['init.']['plugins'] . '",
					themes : "advanced",
					languages : "' . $config['init.']['language'] . '",
					disk_cache : ' . $config['gzipFileCache'] . ',
					langExt : "' . $config['languagesExtension'] . '",
					langExtLoaded : ' . $loaded . ',
					debug : false
				});
				</script>
			';
        } else {
            $code .= '<script type="text/javascript" src="' . $config['tiny_mcePath'] . '"></script>';
            if (t3lib_extmgm::isLoaded($config['languagesExtension']) && $config['init.']['language'] != 'en' && $config['init.']['language'] != 'de') {
                $code .= '<script type="text/javascript">';
                $code .= $this->loadLanguageExtension($config['init.']['language'], $config['init.']['plugins'], $this->getPath('EXT:' . $config['languagesExtension'] . '/tiny_mce/'));
                $code .= '</script>';
            }
        }
        return $code;
    }
 /**
  * searches extensions in a given path
  *
  * Modes for $state:
  * 0 - loaded and unloaded
  * 1 - only loaded
  * 2 - only unloaded
  *
  * @throws Exception raised, if the given path cant be opened for reading
  * @param string path
  * @param integer optional: extension state to ignore (see above)
  * @param string optional: directories to ignore (regular expression; pcre with slashes)
  * @return array result of the search
  */
 public static function searchExtensions($path, $state = 0, $extIgnoreRegExp = '')
 {
     if (!@($fhd = opendir($path))) {
         throw new Exception('cant open "' . $path . '"');
     }
     while ($extDir = readdir($fhd)) {
         $extDirPath = $path . '/' . $extDir;
         // ignore all unless the file is a directory and no point dir
         if (!is_dir($extDirPath) || preg_match('/^\\.{1,2}$/', $extDir)) {
             continue;
         }
         // check, if the directory/extension should be saved
         if (preg_match($extIgnoreRegExp, $extDir)) {
             continue;
         }
         // state filter
         if ($state) {
             $extState = intval(t3lib_extmgm::isLoaded($extDir));
             if ($extState && $state == 2 || !$extState && $state == 1) {
                 continue;
             }
         }
         $extArray[] = $extDirPath;
     }
     closedir($fhd);
     return $extArray;
 }
Пример #4
0
 public function formatValue($mValue)
 {
     if (t3lib_extmgm::isLoaded("dam")) {
         if (is_numeric($mValue)) {
             $oMedia = tx_dam::media_getByUid($mValue);
             return $oMedia->meta['file_name'];
         }
     }
     return $mValue;
 }
Пример #5
0
 /**
  * Gets a Translator by its extension name.
  *
  * @param string $extensionName
  *        the extension name to get the Translator for, must not be empty, the corresponding extension must be loaded
  *
  * @return Tx_Oelib_Translator the Translator for the specified extension
  *                             name
  */
 private function getByExtensionName($extensionName)
 {
     if ($extensionName === '') {
         throw new InvalidArgumentException('The parameter $extensionName must not be empty.', 1331489578);
     }
     if (!t3lib_extmgm::isLoaded($extensionName)) {
         throw new BadMethodCallException('The extension with the name "' . $extensionName . '" is not loaded.', 1331489598);
     }
     if (!isset($this->translators[$extensionName])) {
         $localizedLabels = $this->getLocalizedLabelsFromFile($extensionName);
         // Overrides the localized labels with labels from TypoScript only
         // in the front end.
         if ($this->getFrontEndController() !== NULL && isset($localizedLabels[$this->languageKey]) && is_array($localizedLabels[$this->languageKey])) {
             $labelsFromTyposcript = $this->getLocalizedLabelsFromTypoScript($extensionName);
             foreach ($labelsFromTyposcript as $labelKey => $labelFromTyposcript) {
                 $localizedLabels[$this->languageKey][$labelKey][0]['target'] = $labelFromTyposcript;
             }
         }
         /** @var Tx_Oelib_Translator $translator */
         $translator = t3lib_div::makeInstance('Tx_Oelib_Translator', $this->languageKey, $this->alternativeLanguageKey, $localizedLabels);
         $this->translators[$extensionName] = $translator;
     }
     return $this->translators[$extensionName];
 }