/**
  * Lädt ein COnfigurations Objekt nach mit der TS aus der Extension
  * Dabei wird alles geholt was in "plugin.tx_$extKey", "lib.$extKey." und
  * "lib.links." liegt
  *
  * @param string $extKey Extension, deren TS Config geladen werden soll
  * @param string $extKeyTS Extension, deren Konfig innerhalb der
  *     TS Config geladen werden soll.
  *     Es kann also zb. das TS von mklib geladen werden aber darin die konfig für
  *     das plugin von mkxyz
  * @param string $sStaticPath pfad zum TS
  * @param array $aConfig zusätzliche Konfig, die die default  überschreibt
  * @param boolean $resolveReferences sollen referenzen die in lib.
  *     und plugin.tx_$extKeyTS stehen aufgelöst werden?
  * @param boolean $forceTsfePreparation
  * @return tx_rnbase_configurations
  */
 public static function loadConfig4BE($extKey, $extKeyTs = null, $sStaticPath = '', $aConfig = array(), $resolveReferences = false, $forceTsfePreparation = false)
 {
     $extKeyTs = is_null($extKeyTs) ? $extKey : $extKeyTs;
     if (!$sStaticPath) {
         $sStaticPath = '/static/ts/setup.txt';
     }
     if (file_exists(t3lib_div::getFileAbsFileName('EXT:' . $extKey . $sStaticPath))) {
         t3lib_extMgm::addPageTSConfig('<INCLUDE_TYPOSCRIPT: source="FILE:EXT:' . $extKey . $sStaticPath . '">');
     }
     tx_rnbase::load('tx_rnbase_configurations');
     tx_rnbase::load('tx_rnbase_util_Misc');
     $tsfePreparationOptions = array();
     if ($forceTsfePreparation) {
         $tsfePreparationOptions['force'] = true;
     }
     // Ist bei Aufruf aus BE notwendig! (@TODO: sicher???)
     tx_rnbase_util_Misc::prepareTSFE($tsfePreparationOptions);
     $GLOBALS['TSFE']->config = array();
     $cObj = t3lib_div::makeInstance('tslib_cObj');
     $pageTsConfig = self::getPagesTSconfig(0);
     $tempConfig = $pageTsConfig['plugin.']['tx_' . $extKeyTs . '.'];
     $tempConfig['lib.'][$extKeyTs . '.'] = $pageTsConfig['lib.'][$extKeyTs . '.'];
     $tempConfig['lib.']['links.'] = $pageTsConfig['lib.']['links.'];
     if ($resolveReferences) {
         $GLOBALS['TSFE']->tmpl->setup['lib.'][$extKeyTs . '.'] = $tempConfig['lib.'][$extKeyTs . '.'];
         $GLOBALS['TSFE']->tmpl->setup['plugin.']['tx_' . $extKeyTs . '.'] = $pageTsConfig['plugin.']['tx_' . $extKeyTs . '.'];
     }
     $pageTsConfig = $tempConfig;
     $qualifier = $pageTsConfig['qualifier'] ? $pageTsConfig['qualifier'] : $extKeyTs;
     // möglichkeit die default konfig zu überschreiben
     $pageTsConfig = t3lib_div::array_merge_recursive_overrule($pageTsConfig, $aConfig);
     $configurations = new tx_rnbase_configurations();
     $configurations->init($pageTsConfig, $cObj, $extKeyTs, $qualifier);
     return $configurations;
 }
 /**
  * Merges the values of $setup with plugin.[xxx].settings
  *
  * @param array $setup
  * @return void
  */
 public function merge($setup)
 {
     if (isset($setup) && is_array($setup)) {
         $settings = $this->setup['settings.'];
         $settings = t3lib_div::array_merge_recursive_overrule($settings, $setup);
         $this->setup['settings.'] = $settings;
     }
 }
 /**
  * Creates an isntance of this class.
  *
  * @return void
  */
 public function __construct()
 {
     $urlParameters = t3lib_div::array_merge_recursive_overrule($_GET, $_POST);
     $this->currentPage = max(1, intval($urlParameters['page']));
     unset($urlParameters['page']);
     unset($urlParameters['cmd']);
     $this->baseURL = t3lib_div::getIndpEnv('TYPO3_REQUEST_SCRIPT') . '?' . t3lib_div::implodeArrayForUrl('', $urlParameters);
     $this->resultsPerPage = self::RESULTS_PER_PAGE_DEFAULT;
 }
 /**
  * Implements array_merge_recursive_overrule() in a cross-version way.
  *
  * This code is a copy from realurl, written by Dmitry Dulepov <*****@*****.**>.
  *
  * @param array $array1
  * @param array $array2
  * @return array
  */
 public static function array_merge_recursive_overrule($array1, $array2)
 {
     if (class_exists('\\TYPO3\\CMS\\Core\\Utility\\ArrayUtility')) {
         /** @noinspection PhpUndefinedClassInspection PhpUndefinedNamespaceInspection */
         \TYPO3\CMS\Core\Utility\ArrayUtility::mergeRecursiveWithOverrule($array1, $array2);
     } else {
         /** @noinspection PhpDeprecationInspection */
         $array1 = t3lib_div::array_merge_recursive_overrule($array1, $array2);
     }
     return $array1;
 }
 /**
  * Initialize the action and get correct configuration
  *
  * @return void
  */
 public function initializeAction()
 {
     $this->objects = $this->widgetConfiguration['objects'];
     $this->configuration = t3lib_div::array_merge_recursive_overrule($this->configuration, (array) $this->widgetConfiguration['configuration'], TRUE);
     $this->numberOfPages = (int) ceil(count($this->objects) / (int) $this->configuration['itemsPerPage']);
     $this->pagesBefore = (int) $this->configuration['pagesBefore'];
     $this->pagesAfter = (int) $this->configuration['pagesAfter'];
     $this->lessPages = (bool) $this->configuration['lessPages'];
     $this->forcedNumberOfLinks = (int) $this->configuration['forcedNumberOfLinks'];
     $this->templatePath = t3lib_div::getFileAbsFileName($this->configuration['templatePath']);
 }
 /**
  * Returns the TypoScript configuration found in module.tx_yourextension_yourmodule
  * merged with the global configuration of your extension from module.tx_yourextension
  *
  * @param string $extensionName
  * @param string $pluginName in BE mode this is actually the module signature. But we're using it just like the plugin name in FE
  * @return array
  */
 protected function getPluginConfiguration($extensionName, $pluginName)
 {
     $setup = $this->getTypoScriptSetup();
     $pluginConfiguration = array();
     if (is_array($setup['module.']['tx_' . strtolower($extensionName) . '.'])) {
         $pluginConfiguration = Tx_Extbase_Utility_TypoScript::convertTypoScriptArrayToPlainArray($setup['module.']['tx_' . strtolower($extensionName) . '.']);
     }
     $pluginSignature = strtolower($extensionName . '_' . $pluginName);
     if (is_array($setup['module.']['tx_' . $pluginSignature . '.'])) {
         $pluginConfiguration = t3lib_div::array_merge_recursive_overrule($pluginConfiguration, Tx_Extbase_Utility_TypoScript::convertTypoScriptArrayToPlainArray($setup['module.']['tx_' . $pluginSignature . '.']));
     }
     return $pluginConfiguration;
 }
 /**
 * Download a file
 *
 * @param string $file Path to the file
 * @param array $configuration configuration used to render the filelink cObject
 * @param boolean $hideError define if an error should be displayed if file not found
 * 	 * @param string $class optional class
 * 	 * @param string $target target
 * 	 * @param string $alt alt text
 * 	 * @param string $title title text
 * @return string
 * @throws Tx_Fluid_Core_ViewHelper_Exception_InvalidVariableException
 */
 public function render($file, $configuration = array(), $hideError = FALSE, $class = '', $target = '', $alt = '', $title = '')
 {
     if (!is_file($file)) {
         $errorMessage = sprintf('Given file "%s" for %s is not valid', htmlspecialchars($file), get_class());
         t3lib_div::devLog($errorMessage, 'news', t3lib_div::SYSLOG_SEVERITY_WARNING);
         if (!$hideError) {
             throw new Tx_Fluid_Core_ViewHelper_Exception_InvalidVariableException('Given file is not a valid file: ' . htmlspecialchars($file));
         }
     }
     $cObj = t3lib_div::makeInstance('tslib_cObj');
     $fileInformation = pathinfo($file);
     $fileInformation['file'] = $file;
     $fileInformation['size'] = filesize($file);
     $cObj->data = $fileInformation;
     // set a basic configuration for cObj->filelink
     $tsConfiguration = array('path' => $fileInformation['dirname'] . '/', 'ATagParams' => 'class="download-link basic-class ' . strtolower($fileInformation['extension']) . '"', 'labelStdWrap.' => array('cObject.' => array('value' => $this->renderChildren())));
     // Fallback if no configuration given
     if (!is_array($configuration)) {
         $configuration = array('labelStdWrap.' => array('cObject' => 'TEXT'));
     } else {
         if (class_exists('Tx_Extbase_Utility_TypoScript')) {
             $configuration = Tx_Extbase_Utility_TypoScript::convertPlainArrayToTypoScriptArray($configuration);
         } else {
             /** @var $typoscriptService Tx_Extbase_Service_TypoScriptService */
             $typoscriptService = t3lib_div::makeInstance('Tx_Extbase_Service_TypoScriptService');
             $configuration = $typoscriptService->convertPlainArrayToTypoScriptArray($configuration);
         }
     }
     // merge default configuration with optional configuration
     $tsConfiguration = t3lib_div::array_merge_recursive_overrule($tsConfiguration, $configuration);
     if (!empty($class)) {
         $tsConfiguration['ATagParams'] .= ' class="' . $class . '"';
     }
     if (!empty($target)) {
         $tsConfiguration['target'] = $target;
     }
     if (!empty($alt)) {
         $tsConfiguration['altText'] = $alt;
     }
     if (!empty($title)) {
         $tsConfiguration['titleText'] = $title;
     }
     // generate link
     $link = $cObj->filelink($fileInformation['basename'], $tsConfiguration);
     return $link;
 }
 /**
  * @test
  */
 public function initializationIsCorrect()
 {
     $controller = $this->getAccessibleMock('Tx_News_ViewHelpers_Widget_Controller_PaginateController', array('dummy'));
     $objects = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14);
     $configuration = array('pagesBefore' => '10', 'pagesAfter' => '3x', 'forcedNumberOfLinks' => '9fo', 'lessPages' => 0, 'templatePath' => 'fo/bar', 'itemsPerPage' => '3');
     $widgetConfiguration = array('fo' => 'bar');
     $controller->_set('configuration', $configuration);
     $controller->_set('widgetConfiguration', array('configuration' => $widgetConfiguration, 'objects' => $objects));
     $controller->initializeAction();
     $this->assertEquals($controller->_get('objects'), $objects);
     $this->assertEquals($controller->_get('configuration'), t3lib_div::array_merge_recursive_overrule($configuration, $widgetConfiguration, TRUE));
     $this->assertEquals($controller->_get('numberOfPages'), 5);
     $this->assertEquals($controller->_get('pagesBefore'), 10);
     $this->assertEquals($controller->_get('pagesAfter'), 3);
     $this->assertEquals($controller->_get('lessPages'), FALSE);
     $this->assertEquals($controller->_get('forcedNumberOfLinks'), 9);
     $this->assertEquals($controller->_get('templatePath'), PATH_site . 'fo/bar');
 }
 function extraGlobalMarkerProcessor(&$pObj, $markerArray)
 {
     // configuration of chgallery
     $confDefault = $pObj->conf['globalmarkers.'];
     if (!is_array($confDefault)) {
         return $markerArray;
     }
     // merge with special configuration (based on chosen CODE [SINGLE, LIST, LATEST]) if this is available
     if (is_array($confDefault[$pObj->config['code'] . '.'])) {
         $conf = t3lib_div::array_merge_recursive_overrule($confDefault, $confDefault[$pObj->config['code'] . '.']);
     } else {
         $conf = $confDefault;
     }
     if (is_array($conf)) {
         foreach ($conf as $key => $value) {
             $key2 = trim($key, '.');
             $markerArray['###GLOBAL_' . strtoupper($key2) . '###'] = $pObj->cObj->cObjGetSingle($conf[$key2], $conf[$key]);
         }
     }
     return $markerArray;
 }
Пример #10
0
 function majixShowBox($aConfig = array(), $aTags = array())
 {
     if ($this->oForm->__getEnvExecMode() !== "EID") {
         #$bOldValue = $this->oForm->bInlineEvents;
         #$this->oForm->bInlineEvents = TRUE;
         $aEventsBefore = array_keys($this->oForm->aRdtEvents);
         //debug($aEventsBefore);
     }
     if ($this->isDataBridge()) {
         $sDBridgeName = $this->_getElementHtmlName() . "[databridge]";
         $sDBridgeId = $this->_getElementHtmlId() . "_databridge";
         $sSignature = $this->dbridge_getCurrentDsetSignature();
         $sHidden = "<input type=\"hidden\" name=\"" . $sDBridgeName . "\" id=\"" . $sDBridgeId . "\" value=\"" . htmlspecialchars($sSignature) . "\" />";
     }
     $aChildsBag = $this->renderChildsBag();
     $aChildsBag = t3lib_div::array_merge_recursive_overrule($aChildsBag, $aTags);
     if ($this->oForm->__getEnvExecMode() !== "EID") {
         #$this->oForm->bInlineEvents = $bOldValue;
         $aEventsAfter = array_keys($this->oForm->aRdtEvents);
         $aAddedKeys = array_diff($aEventsAfter, $aEventsBefore);
         $aAddedEvents = array();
         reset($aAddedKeys);
         while (list(, $sKey) = each($aAddedKeys)) {
             $aAddedEvents[$sKey] = $this->oForm->aRdtEvents[$sKey];
             unset($this->oForm->aRdtEvents[$sKey]);
             // unset because if rendered in a lister,
             // we need to be able to detect the new events even if they were already declared by other loops in the lister
         }
         //debug($aAddedEvents);
         $aConfig["attachevents"] = $aAddedEvents;
     }
     $sCompiledChilds = $this->renderChildsCompiled($aChildsBag);
     $aConfig["html"] = $sCompiledChilds;
     $aConfig["postinit"] = $this->aPostInitTasks;
     $aConfig["preuninit"] = $this->aPreUninitTasks;
     return $this->buildMajixExecuter("showBox", $aConfig);
 }
Пример #11
0
 function majixShowBox($aConfig = array(), $aTags = array())
 {
     if ($this->oForm->__getEnvExecMode() !== "EID") {
         $aEventsBefore = array_keys($this->oForm->aRdtEvents);
     }
     $aChildsBag = $this->renderChildsBag();
     $aChildsBag = t3lib_div::array_merge_recursive_overrule($aChildsBag, $aTags);
     if ($this->oForm->__getEnvExecMode() !== "EID") {
         $aEventsAfter = array_keys($this->oForm->aRdtEvents);
         $aAddedKeys = array_diff($aEventsAfter, $aEventsBefore);
         $aAddedEvents = array();
         reset($aAddedKeys);
         while (list(, $sKey) = each($aAddedKeys)) {
             $aAddedEvents[$sKey] = $this->oForm->aRdtEvents[$sKey];
             unset($this->oForm->aRdtEvents[$sKey]);
             // unset because if rendered in a lister,
             // we need to be able to detect the new events even if they were already declared by other loops in the lister
         }
         $aConfig["attachevents"] = $aAddedEvents;
         $aConfig["postinit"] = $this->oForm->aPostInitTasks;
     } else {
         # specific to this renderlet
         # as events have to be attached to the HTML
         # after the execution of the majix tasks
         # in that case, using the modalbox's afterLoad event handler
         $aConfig["attachevents"] = $this->oForm->aRdtEventsAjax;
         $aConfig["postinit"] = $this->oForm->aPostInitTasksAjax;
         $this->oForm->aRdtEventsAjax = array();
         $this->oForm->aPostInitTasksAjax = array();
     }
     $aConfig["postinit"] = array_merge($this->aPostInitTasks, $aConfig["postinit"]);
     $aConfig["preuninit"] = $this->aPreUninitTasks;
     $sCompiledChilds = $this->renderChildsCompiled($aChildsBag);
     $aConfig["html"] = $sCompiledChilds;
     return $this->buildMajixExecuter("showBox", $aConfig);
 }
 /**
  * The main method of the PlugIn
  *
  * @access	public
  *
  * @param	string		$content: The PlugIn content
  * @param	array		$conf: The PlugIn configuration
  *
  * @return	string		The content that is displayed on the website
  */
 public function main($content, $conf)
 {
     $this->init($conf);
     // Merge configuration with conf array of toolbox.
     $this->conf = t3lib_div::array_merge_recursive_overrule($this->cObj->data['conf'], $this->conf);
     // Load current document.
     $this->loadDocument();
     if ($this->doc === NULL || $this->doc->numPages < 1 || empty($this->conf['fileGrpFulltext'])) {
         // Quit without doing anything if required variables are not set.
         return $content;
     } else {
         // Set default values if not set.
         // page may be integer or string (physical page attribute)
         if ((int) $this->piVars['page'] > 0 || empty($this->piVars['page'])) {
             $this->piVars['page'] = tx_dlf_helper::intInRange((int) $this->piVars['page'], 1, $this->doc->numPages, 1);
         } else {
             $this->piVars['page'] = array_search($this->piVars['page'], $this->doc->physicalPages);
         }
         $this->piVars['double'] = tx_dlf_helper::intInRange($this->piVars['double'], 0, 1, 0);
     }
     // Load template file.
     if (!empty($this->conf['templateFile'])) {
         $this->template = $this->cObj->getSubpart($this->cObj->fileResource($this->conf['templateFile']), '###TEMPLATE###');
     } else {
         $this->template = $this->cObj->getSubpart($this->cObj->fileResource('EXT:dlf/plugins/toolbox/tools/fulltext/template.tmpl'), '###TEMPLATE###');
     }
     $fullTextFile = $this->doc->physicalPagesInfo[$this->doc->physicalPages[$this->piVars['page']]]['files'][$this->conf['fileGrpFulltext']];
     // Get single page downloads.
     if (!empty($fullTextFile)) {
         $markerArray['###FULLTEXT_SELECT###'] = '<a class="select" title="' . $this->pi_getLL('fulltext-select', '', TRUE) . '" onclick="tx_dlf_viewer.toogleFulltextSelect();">' . $this->pi_getLL('fulltext-select', '', TRUE) . '</a>';
     } else {
         $markerArray['###FULLTEXT_SELECT###'] = $this->pi_getLL('fulltext-select', '', TRUE);
     }
     $content .= $this->cObj->substituteMarkerArray($this->template, $markerArray);
     return $this->pi_wrapInBaseClass($content);
 }
Пример #13
0
 *		TOTAL FUNCTIONS: 7
 * (This index is automatically created/updated by the extension "extdeveval")
 *
 */
unset($MCONF);
require 'conf.php';
require $BACK_PATH . 'init.php';
require $BACK_PATH . 'template.php';
// Unset MCONF/MLANG since all we wanted was back path etc. for this particular script.
unset($MCONF);
unset($MLANG);
// Merging locallang files/arrays:
$LANG->includeLLFile('EXT:lang/locallang_misc.xml');
$LOCAL_LANG_orig = $LOCAL_LANG;
$LANG->includeLLFile('EXT:templavoila/mod1/locallang_db_new_content_el.xml');
$LOCAL_LANG = t3lib_div::array_merge_recursive_overrule($LOCAL_LANG_orig, $LOCAL_LANG);
// Exits if 'cms' extension is not loaded:
t3lib_extMgm::isLoaded('cms', 1);
// Include needed libraries:
require_once PATH_t3lib . 'class.t3lib_page.php';
require_once t3lib_extMgm::extPath('templavoila') . 'class.tx_templavoila_api.php';
/**
 * Script Class for the New Content element wizard
 *
 * @author	Robert Lemke <*****@*****.**>
 * @package TYPO3
 * @subpackage templavoila
 */
class tx_templavoila_dbnewcontentel
{
    // Internal, static (from GPvars):
 /**
  * Loads Page TSconfig until the outermost template record and parses the configuration - if TSFE.constants object path is found it is merged with the default data in here!
  *
  * @param	array		Constants array, default input.
  * @return	array		Constants array, modified
  * @todo	Apply caching to the parsed Page TSconfig. This is done in the other similar functions for both frontend and backend. However, since this functions works for BOTH frontend and backend we will have to either write our own local caching function or (more likely) detect if we are in FE or BE and use caching functions accordingly. Not having caching affects mostly the backend modules inside the "Template" module since the overhead in the frontend is only seen when TypoScript templates are parsed anyways (after which point they are cached anyways...)
  */
 function mergeConstantsFromPageTSconfig($constArray)
 {
     $TSdataArray = array();
     $TSdataArray[] = $GLOBALS['TYPO3_CONF_VARS']['BE']['defaultPageTSconfig'];
     // Setting default configuration:
     for ($a = 0; $a <= $this->outermostRootlineIndexWithTemplate; $a++) {
         $TSdataArray[] = $this->absoluteRootLine[$a]['TSconfig'];
     }
     // Parsing the user TS (or getting from cache)
     $TSdataArray = t3lib_TSparser::checkIncludeLines_array($TSdataArray);
     $userTS = implode(LF . '[GLOBAL]' . LF, $TSdataArray);
     $parseObj = t3lib_div::makeInstance('t3lib_TSparser');
     $parseObj->parse($userTS);
     if (is_array($parseObj->setup['TSFE.']['constants.'])) {
         $constArray = t3lib_div::array_merge_recursive_overrule($constArray, $parseObj->setup['TSFE.']['constants.']);
     }
     return $constArray;
 }
 /**
  * Gets the query arguments and assembles them for URLs.
  * Arguments may be removed or set, depending on configuration.
  *
  * @param	string		Configuration
  * @param	array		Multidimensional key/value pairs that overrule incoming query arguments
  * @param	boolean		If set, key/value pairs not in the query but the overrule array will be set
  * @return	string		The URL query part (starting with a &)
  */
 public function getQueryArguments($conf, $overruleQueryArguments = array(), $forceOverruleArguments = FALSE)
 {
     switch ((string) $conf['method']) {
         case 'GET':
             $currentQueryArray = t3lib_div::_GET();
             break;
         case 'POST':
             $currentQueryArray = t3lib_div::_POST();
             break;
         case 'GET,POST':
             $currentQueryArray = array_merge(t3lib_div::_GET(), t3lib_div::_POST());
             break;
         case 'POST,GET':
             $currentQueryArray = array_merge(t3lib_div::_POST(), t3lib_div::_GET());
             break;
         default:
             $currentQueryArray = t3lib_div::explodeUrl2Array(t3lib_div::getIndpEnv('QUERY_STRING'), TRUE);
     }
     if ($conf['exclude']) {
         $exclude = str_replace(',', '&', $conf['exclude']);
         $exclude = t3lib_div::explodeUrl2Array($exclude, TRUE);
         // never repeat id
         $exclude['id'] = 0;
         $newQueryArray = t3lib_div::arrayDiffAssocRecursive($currentQueryArray, $exclude);
     } else {
         $newQueryArray = $currentQueryArray;
     }
     if ($forceOverruleArguments) {
         $newQueryArray = t3lib_div::array_merge_recursive_overrule($newQueryArray, $overruleQueryArguments);
     } else {
         $newQueryArray = t3lib_div::array_merge_recursive_overrule($newQueryArray, $overruleQueryArguments, TRUE);
     }
     return t3lib_div::implodeArrayForUrl('', $newQueryArray);
 }
Пример #16
0
 /**
  * Builds a data map by adding column maps for all the configured columns in the $TCA.
  * It also resolves the type of values the column is holding and the typo of relation the column
  * represents.
  *
  * @param string $className The class name you want to fetch the Data Map for
  * @return Tx_Extbase_Persistence_Mapper_DataMap The data map
  */
 public function buildDataMap($className)
 {
     if (!class_exists($className)) {
         throw new Tx_Extbase_Persistence_Exception_InvalidClass('Could not find class definition for name "' . $className . '". This could be caused by a mis-spelling of the class name in the class definition.');
     }
     $recordType = NULL;
     $subclasses = array();
     $tableName = strtolower($className);
     $columnMapping = array();
     $frameworkConfiguration = $this->configurationManager->getConfiguration(Tx_Extbase_Configuration_ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK);
     $classSettings = $frameworkConfiguration['persistence']['classes'][$className];
     if ($classSettings !== NULL) {
         if (isset($classSettings['subclasses']) && is_array($classSettings['subclasses'])) {
             $subclasses = $classSettings['subclasses'];
         }
         if (isset($classSettings['mapping']['recordType']) && strlen($classSettings['mapping']['recordType']) > 0) {
             $recordType = $classSettings['mapping']['recordType'];
         }
         if (isset($classSettings['mapping']['tableName']) && strlen($classSettings['mapping']['tableName']) > 0) {
             $tableName = $classSettings['mapping']['tableName'];
         }
         $classHierachy = array_merge(array($className), class_parents($className));
         foreach ($classHierachy as $currentClassName) {
             if (in_array($currentClassName, array('Tx_Extbase_DomainObject_AbstractEntity', 'Tx_Extbase_DomainObject_AbstractValueObject'))) {
                 break;
             }
             $currentClassSettings = $frameworkConfiguration['persistence']['classes'][$currentClassName];
             if ($currentClassSettings !== NULL) {
                 if (isset($currentClassSettings['mapping']['columns']) && is_array($currentClassSettings['mapping']['columns'])) {
                     $columnMapping = t3lib_div::array_merge_recursive_overrule($columnMapping, $currentClassSettings['mapping']['columns'], 0, FALSE);
                     // FALSE means: do not include empty values form 2nd array
                 }
             }
         }
     }
     $dataMap = new Tx_Extbase_Persistence_Mapper_DataMap($className, $tableName, $recordType, $subclasses);
     $dataMap = $this->addMetaDataColumnNames($dataMap, $tableName);
     // $classPropertyNames = $this->reflectionService->getClassPropertyNames($className);
     $tcaColumnsDefinition = $this->getColumnsDefinition($tableName);
     $tcaColumnsDefinition = t3lib_div::array_merge_recursive_overrule($tcaColumnsDefinition, $columnMapping);
     // TODO Is this is too powerful?
     foreach ($tcaColumnsDefinition as $columnName => $columnDefinition) {
         if (isset($columnDefinition['mapOnProperty'])) {
             $propertyName = $columnDefinition['mapOnProperty'];
         } else {
             $propertyName = t3lib_div::underscoredToLowerCamelCase($columnName);
         }
         // if (in_array($propertyName, $classPropertyNames)) { // TODO Enable check for property existance
         $columnMap = new Tx_Extbase_Persistence_Mapper_ColumnMap($columnName, $propertyName);
         $propertyMetaData = $this->reflectionService->getClassSchema($className)->getProperty($propertyName);
         $columnMap = $this->setRelations($columnMap, $columnDefinition['config'], $propertyMetaData);
         $dataMap->addColumnMap($columnMap);
         // }
     }
     // debug($dataMap);
     return $dataMap;
 }
 /**
  * [Describe function...]
  *
  * @param	[type]		$arr: ...
  * @return	[type]		...
  */
 function ext_mergeIncomingWithExisting($arr)
 {
     $parseObj = t3lib_div::makeInstance("t3lib_TSparser");
     $parseObj->parse(implode(LF, $this->ext_incomingValues));
     $arr2 = $parseObj->setup;
     return t3lib_div::array_merge_recursive_overrule($arr, $arr2);
 }
 /**
  * Merge a WHERE definition array to the select WHERE array part.
  *
  * @param	array		$where Where clause(s).
  * @return	void
  */
 function mergeWhere($where)
 {
     if (is_array($where)) {
         $this->query['WHERE'] = t3lib_div::array_merge_recursive_overrule($this->query['WHERE'], $where);
     }
 }
	/**
	 * Decodes a speaking URL path into an array of GET parameters and a page id.
	 *
	 * @param	string		Speaking URL path (after the "root" path of the website!) but without query parameters
	 * @param	boolean		If cHash caching is enabled or not.
	 * @return	array		Array with id and GET parameters.
	 * @see decodeSpURL()
	 */
	protected function decodeSpURL_doDecode($speakingURIpath, $cHashCache = FALSE) {

		// Cached info:
		$cachedInfo = array();

		// Convert URL to segments
		$pathParts = explode('/', $speakingURIpath);
		array_walk($pathParts, create_function('&$value', '$value = urldecode($value);'));

		// Strip/process file name or extension first
		$file_GET_VARS = $this->decodeSpURL_decodeFileName($pathParts);

		// Setting original dir-parts:
		$this->dirParts = $pathParts;

		// Setting "preVars":
		$pre_GET_VARS = $this->decodeSpURL_settingPreVars($pathParts, $this->extConf['preVars']);
		if (isset($this->extConf['pagePath']['languageGetVar'])) {
			$languageGetVar = $this->extConf['pagePath']['languageGetVar'];
			if (isset($pre_GET_VARS[$languageGetVar]) && self::testInt($pre_GET_VARS[$languageGetVar])) {
				// Language from URL
				$this->detectedLanguage = $pre_GET_VARS[$languageGetVar];
			}
			elseif (isset($_GET[$languageGetVar]) && self::testInt($_GET[$languageGetVar])) {
				// This is for _DOMAINS feature
				$this->detectedLanguage = $_GET[$languageGetVar];
			}
		}

		// Setting page id:
		list($cachedInfo['id'], $id_GET_VARS, $cachedInfo['rootpage_id']) = $this->decodeSpURL_idFromPath($pathParts);

		// Fixed Post-vars:
		$fixedPostVarSetCfg = $this->getPostVarSetConfig($cachedInfo['id'], 'fixedPostVars');
		$fixedPost_GET_VARS = $this->decodeSpURL_settingPreVars($pathParts, $fixedPostVarSetCfg);

		// Setting "postVarSets":
		$postVarSetCfg = $this->getPostVarSetConfig($cachedInfo['id']);
		$post_GET_VARS = $this->decodeSpURL_settingPostVarSets($pathParts, $postVarSetCfg, $cachedInfo['id']);

		// Looking for remaining parts:
		if (count($pathParts)) {
			$this->decodeSpURL_throw404('"' . $speakingURIpath . '" could not be found, closest page matching is ' . substr(implode('/', $this->dirParts), 0, -strlen(implode('/', $pathParts))) . '');
		}

		// Merge Get vars together:
		$cachedInfo['GET_VARS'] = array();
		if (is_array($pre_GET_VARS))
			$cachedInfo['GET_VARS'] = t3lib_div::array_merge_recursive_overrule($cachedInfo['GET_VARS'], $pre_GET_VARS);
		if (is_array($id_GET_VARS))
			$cachedInfo['GET_VARS'] = t3lib_div::array_merge_recursive_overrule($cachedInfo['GET_VARS'], $id_GET_VARS);
		if (is_array($fixedPost_GET_VARS))
			$cachedInfo['GET_VARS'] = t3lib_div::array_merge_recursive_overrule($cachedInfo['GET_VARS'], $fixedPost_GET_VARS);
		if (is_array($post_GET_VARS))
			$cachedInfo['GET_VARS'] = t3lib_div::array_merge_recursive_overrule($cachedInfo['GET_VARS'], $post_GET_VARS);
		if (is_array($file_GET_VARS))
			$cachedInfo['GET_VARS'] = t3lib_div::array_merge_recursive_overrule($cachedInfo['GET_VARS'], $file_GET_VARS);

		// cHash handling:
		if ($cHashCache && count($cachedInfo['GET_VARS']) > 0) {
			$cHash_value = $this->decodeSpURL_cHashCache($speakingURIpath);
			if ($cHash_value) {
				$cachedInfo['GET_VARS']['cHash'] = $cHash_value;
			}
		}

		// Return information found:
		return $cachedInfo;
	}
 /**
  * Merges two arrays recursively and "binary safe".
  *
  * @see \TYPO3\CMS\Core\Utility\ArrayUtility::mergeRecursiveWithOverrule();
  *
  * @param array $original
  * @param array $overrule
  * @param boolean $addKeys
  * @param boolean $includeEmptyValues
  * @param boolean $enableUnsetFeature
  * @return void
  */
 public static function mergeRecursiveWithOverrule(array $original, array $overrule, $addKeys = TRUE, $includeEmptyValues = TRUE, $enableUnsetFeature = TRUE)
 {
     if (tx_rnbase_util_TYPO3::isTYPO62OrHigher()) {
         \TYPO3\CMS\Core\Utility\ArrayUtility::mergeRecursiveWithOverrule($original, $overrule, $addKeys, $includeEmptyValues, $enableUnsetFeature);
         return $original;
     } else {
         return t3lib_div::array_merge_recursive_overrule($original, $overrule, !$addKeys, $includeEmptyValues, $enableUnsetFeature);
     }
 }
Пример #21
0
 /**
  * Constructor
  * Imports relevant parts from global $TBE_STYLES (colorscheme)
  *
  * @return	void
  */
 function template()
 {
     global $TBE_STYLES;
     // Initializes the page rendering object:
     $this->getPageRenderer();
     // Setting default scriptID:
     if (($temp_M = (string) t3lib_div::_GET('M')) && $GLOBALS['TBE_MODULES']['_PATHS'][$temp_M]) {
         $this->scriptID = preg_replace('/^.*\\/(sysext|ext)\\//', 'ext/', $GLOBALS['TBE_MODULES']['_PATHS'][$temp_M] . 'index.php');
     } else {
         $this->scriptID = preg_replace('/^.*\\/(sysext|ext)\\//', 'ext/', substr(PATH_thisScript, strlen(PATH_site)));
     }
     if (TYPO3_mainDir != 'typo3/' && substr($this->scriptID, 0, strlen(TYPO3_mainDir)) == TYPO3_mainDir) {
         $this->scriptID = 'typo3/' . substr($this->scriptID, strlen(TYPO3_mainDir));
         // This fixes if TYPO3_mainDir has been changed so the script ids are STILL "typo3/..."
     }
     $this->bodyTagId = preg_replace('/[^A-Za-z0-9-]/', '-', $this->scriptID);
     // Individual configuration per script? If so, make a recursive merge of the arrays:
     if (is_array($TBE_STYLES['scriptIDindex'][$this->scriptID])) {
         $ovr = $TBE_STYLES['scriptIDindex'][$this->scriptID];
         // Make copy
         $TBE_STYLES = t3lib_div::array_merge_recursive_overrule($TBE_STYLES, $ovr);
         // merge styles.
         unset($TBE_STYLES['scriptIDindex'][$this->scriptID]);
         // Have to unset - otherwise the second instantiation will do it again!
     }
     // Color scheme:
     if ($TBE_STYLES['mainColors']['bgColor']) {
         $this->bgColor = $TBE_STYLES['mainColors']['bgColor'];
     }
     if ($TBE_STYLES['mainColors']['bgColor1']) {
         $this->bgColor1 = $TBE_STYLES['mainColors']['bgColor1'];
     }
     if ($TBE_STYLES['mainColors']['bgColor2']) {
         $this->bgColor2 = $TBE_STYLES['mainColors']['bgColor2'];
     }
     if ($TBE_STYLES['mainColors']['bgColor3']) {
         $this->bgColor3 = $TBE_STYLES['mainColors']['bgColor3'];
     }
     if ($TBE_STYLES['mainColors']['bgColor4']) {
         $this->bgColor4 = $TBE_STYLES['mainColors']['bgColor4'];
     }
     if ($TBE_STYLES['mainColors']['bgColor5']) {
         $this->bgColor5 = $TBE_STYLES['mainColors']['bgColor5'];
     }
     if ($TBE_STYLES['mainColors']['bgColor6']) {
         $this->bgColor6 = $TBE_STYLES['mainColors']['bgColor6'];
     }
     if ($TBE_STYLES['mainColors']['hoverColor']) {
         $this->hoverColor = $TBE_STYLES['mainColors']['hoverColor'];
     }
     // Main Stylesheets:
     if ($TBE_STYLES['stylesheet']) {
         $this->styleSheetFile = $TBE_STYLES['stylesheet'];
     }
     if ($TBE_STYLES['stylesheet2']) {
         $this->styleSheetFile2 = $TBE_STYLES['stylesheet2'];
     }
     if ($TBE_STYLES['styleSheetFile_post']) {
         $this->styleSheetFile_post = $TBE_STYLES['styleSheetFile_post'];
     }
     if ($TBE_STYLES['inDocStyles_TBEstyle']) {
         $this->inDocStyles_TBEstyle = $TBE_STYLES['inDocStyles_TBEstyle'];
     }
     // include all stylesheets
     foreach ($this->getSkinStylesheetDirectories() as $stylesheetDirectory) {
         $this->addStylesheetDirectory($stylesheetDirectory);
     }
     // Background image
     if ($TBE_STYLES['background']) {
         $this->backGroundImage = $TBE_STYLES['background'];
     }
 }
 protected function parseConditionsBlock($settings)
 {
     $finalResult = FALSE;
     foreach ($settings['if.'] as $idx => $conditionSettings) {
         $conditions = $conditionSettings['conditions.'];
         $condition = '';
         $orConditions = array();
         foreach ($conditions as $subIdx => $andConditions) {
             $results = array();
             foreach ($andConditions as $subSubIdx => $andCondition) {
                 if (strstr($andCondition, '=')) {
                     list($field, $value) = t3lib_div::trimExplode('=', $andCondition);
                     $result = Tx_Formhandler_Globals::$cObj->getGlobal($field, $this->gp) === $value;
                 } elseif (strstr($andCondition, '>')) {
                     list($field, $value) = t3lib_div::trimExplode('>', $andCondition);
                     $result = Tx_Formhandler_Globals::$cObj->getGlobal($field, $this->gp) > $value;
                 } elseif (strstr($andCondition, '<')) {
                     list($field, $value) = t3lib_div::trimExplode('<', $andCondition);
                     $result = Tx_Formhandler_Globals::$cObj->getGlobal($field, $this->gp) < $value;
                 } elseif (strstr($andCondition, '!=')) {
                     list($field, $value) = t3lib_div::trimExplode('!=', $andCondition);
                     $result = Tx_Formhandler_Globals::$cObj->getGlobal($field, $this->gp) !== $value;
                 } else {
                     $field = $andCondition;
                     $keys = explode('|', $field);
                     $numberOfLevels = count($keys);
                     $rootKey = trim($keys[0]);
                     $value = $this->gp[$rootKey];
                     $result = isset($this->gp[$rootKey]);
                     for ($i = 1; $i < $numberOfLevels && isset($value); $i++) {
                         $currentKey = trim($keys[$i]);
                         if (is_object($value)) {
                             $value = $value->{$currentKey};
                             $result = isset($value->{$currentKey});
                         } elseif (is_array($value)) {
                             $value = $value[$currentKey];
                             $result = isset($value[$currentKey]);
                         } else {
                             $result = FALSE;
                         }
                     }
                 }
                 $results[] = $result ? 'TRUE' : 'FALSE';
             }
             $orConditions[] = '(' . implode(' && ', $results) . ')';
         }
         $finalCondition = '(' . implode(' || ', $orConditions) . ')';
         eval('$evaluation = ' . $finalCondition . ';');
         if ($evaluation) {
             $newSettings = $conditionSettings['isTrue.'];
             if (is_array($newSettings)) {
                 $this->settings = t3lib_div::array_merge_recursive_overrule($this->settings, $newSettings);
             }
         } else {
             $newSettings = $conditionSettings['else.'];
             if (is_array($newSettings)) {
                 $this->settings = t3lib_div::array_merge_recursive_overrule($this->settings, $newSettings);
             }
         }
     }
 }
 /**
  * Initializes the languages.
  *
  * @static
  * @return void
  */
 public static function initialize()
 {
     /** @var $instance t3lib_l10n_Locales */
     $instance = t3lib_div::makeInstance('t3lib_l10n_Locales');
     $instance->isoMapping = array_flip($instance->isoReverseMapping);
     // Allow user-defined locales
     if (isset($GLOBALS['TYPO3_CONF_VARS']['SYS']['localization']['locales']['user']) && is_array($GLOBALS['TYPO3_CONF_VARS']['SYS']['localization']['locales']['user'])) {
         foreach ($GLOBALS['TYPO3_CONF_VARS']['SYS']['localization']['locales']['user'] as $locale => $name) {
             if (!isset($instance->languages[$locale])) {
                 $instance->languages[$locale] = $name;
             }
         }
     }
     // Initializes the locale dependencies with TYPO3 supported locales
     $instance->localeDependencies = array();
     foreach ($instance->languages as $locale => $name) {
         if (strlen($locale) == 5) {
             $instance->localeDependencies[$locale] = array(substr($locale, 0, 2));
         }
     }
     // Merge user-provided locale dependencies
     if (isset($GLOBALS['TYPO3_CONF_VARS']['SYS']['localization']['locales']['dependencies']) && is_array($GLOBALS['TYPO3_CONF_VARS']['SYS']['localization']['locales']['dependencies'])) {
         $instance->localeDependencies = t3lib_div::array_merge_recursive_overrule($instance->localeDependencies, $GLOBALS['TYPO3_CONF_VARS']['SYS']['localization']['locales']['dependencies']);
     }
     /**
      * @deprecated since TYPO3 4.6, will be removed in TYPO3 4.8
      */
     $instance->locales = array_keys($instance->languages);
     /**
      * @deprecated since TYPO3 4.6, will be removed in TYPO3 4.8
      */
     define('TYPO3_languages', implode('|', $instance->getLocales()));
 }
 /**
  * Set values for the local environment.
  * The environment are special keys/values that gives the action information what to do.
  *
  * @param	mixed		$param1 If array it is the env array. If string it is the key for the second paramater.
  * @param	string		$param2 Is value if the first paramater is a string which is the key for this value.
  * @return	void
  */
 function setEnv($param1, $param2 = NULL)
 {
     $env = array();
     if (is_array($param1)) {
         foreach ($param1 as $key => $value) {
             if (is_string($value) and preg_match('#^http://#', $value)) {
                 // this append ? to any url so easily &params can be appended
                 $value = strpos($value, '?') ? $value : $value . '?';
             }
             $env[$key] = $value;
         }
     } elseif (!is_array($param1) and !is_null($param2)) {
         $env[$param1] = $param2;
     }
     $this->env = t3lib_div::array_merge_recursive_overrule($this->env, $env);
 }
 /**
  * Initializing the wizard.
  *
  * @return    void
  */
 function initWizArray()
 {
     $inArray = unserialize(base64_decode($this->modData['wizArray_ser']));
     $this->wizArray = is_array($inArray) ? $inArray : array();
     if (is_array($this->modData['wizArray_upd'])) {
         $this->wizArray = t3lib_div::array_merge_recursive_overrule($this->wizArray, $this->modData['wizArray_upd']);
         // Use "overwrite_files" from uploaded data always. This prevents recreation of removed files.
         if (isset($this->modData['wizArray_upd']['save']['overwrite_files'])) {
             $this->wizArray['save']['overwrite_files'] = $this->modData['wizArray_upd']['save']['overwrite_files'];
         }
     }
     $lA = is_array($this->wizArray['languages']) ? current($this->wizArray['languages']) : '';
     if (is_array($lA)) {
         foreach ($lA as $k => $v) {
             if ($v && isset($this->languages[$k])) {
                 $this->selectedLanguages[$k] = $this->languages[$k];
             }
         }
     }
 }
Пример #26
0
 function renderChildsBag()
 {
     $aRendered = array();
     if ($this->mayHaveChilds() && $this->hasChilds()) {
         reset($this->aChilds);
         while (list($sName, ) = each($this->aChilds)) {
             $oRdt =& $this->aChilds[$sName];
             if ($this->bForcedValue === TRUE && is_array($this->mForcedValue) && array_key_exists($sName, $this->mForcedValue)) {
                 // parent may have childs
                 // AND has forced value
                 // AND value is a nested array of values
                 // AND subvalue for current child exists in the data array
                 // => forcing subvalue for this child
                 $oRdt->forceValue($this->mForcedValue[$sName]);
                 $aRendered[$sName] = $this->oForm->_renderElement($oRdt);
                 $oRdt->unForceValue();
             } else {
                 $aRendered[$sName] = $this->oForm->_renderElement($oRdt);
             }
         }
     }
     // adding prerendered renderlets in the html bag
     $sAbsName = $this->getAbsName();
     $sAbsPath = str_replace(".", ".childs.", $sAbsName);
     $sAbsPath = str_replace(".", "/", $sAbsPath);
     if (($mValue = $this->oForm->navDeepData($sAbsPath, $this->oForm->aPreRendered)) !== FALSE) {
         if (is_array($mValue) && array_key_exists("childs", $mValue)) {
             $aRendered = t3lib_div::array_merge_recursive_overrule($aRendered, $mValue["childs"]);
         }
     }
     reset($aRendered);
     return $aRendered;
 }
    public function extraItemMarkerProcessor($markerArray, $row, $lConf, &$pObj)
    {
        $this->cObj = t3lib_div::makeInstance('tslib_cObj');
        // local cObj.
        $this->pObj =& $pObj;
        $this->realConf = $pObj;
        // configuration array of rgSmoothGallery
        $rgsgConfDefault = $this->realConf->conf['rgsmoothgallery.'];
        // merge with special configuration (based on chosen CODE [SINGLE, LIST, LATEST]) if this is available
        if (is_array($rgsgConfDefault[$pObj->config['code'] . '.'])) {
            $rgsgConf = t3lib_div::array_merge_recursive_overrule($rgsgConfDefault, $rgsgConfDefault[$pObj->config['code'] . '.']);
        } else {
            $rgsgConf = $rgsgConfDefault;
        }
        #echo t3lib_div::view_array($rgsgConf);
        $this->rgsgConf = $rgsgConf;
        // if the configuration is available, otherwise just do nothing
        if ($rgsgConf) {
            // unique ID > uid of the record
            $uniqueId = $row['uid'];
            // possibility to use a different field for the images + caption
            $imageField = $this->rgsgConf['imageField'] ? $this->rgsgConf['imageField'] : 'image';
            $imageFieldPrefix = $this->rgsgConf['imageFieldPrefix'] ? $this->rgsgConf['imageFieldPrefix'] : 'uploads/pics/';
            $captionField = $this->rgsgConf['captionField'] ? $this->rgsgConf['captionField'] : 'imagecaption';
            // query for the images & caption
            $field = 'pid,uid,' . $imageField . ',' . $captionField;
            $table = 'tt_news';
            $where = 'uid = ' . $uniqueId;
            $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery($field, $table, $where);
            $row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res);
            if ($GLOBALS['TSFE']->sys_language_content) {
                $OLmode = $this->sys_language_mode == 'strict' ? 'hideNonTranslated' : '';
                $row = $GLOBALS['TSFE']->sys_page->getRecordOverlay('tt_news', $row, $GLOBALS['TSFE']->sys_language_content, '');
            }
            // needed fields: image & imagecaption
            $images = explode(',', $row[$imageField]);
            $caption = explode("\n", $row[$captionField]);
            // If there are any images and minimum count of images is reached
            if ($row[$imageField] && count($images) >= $rgsgConf['minimumImages']) {
                // call rgsmoothgallery
                require_once t3lib_extMgm::extPath('rgsmoothgallery') . 'pi1/class.tx_rgsmoothgallery_pi1.php';
                $this->gallery = t3lib_div::makeInstance('tx_rgsmoothgallery_pi1');
                // if no js is available
                $noJsImg = $rgsgConf['big.'];
                $noJsImg['file'] = $imageFieldPrefix . $images[0];
                if ($rgsgConf['externalControl'] == 1) {
                    $externalControl1 = 'var myGallery' . $uniqueId . ';';
                } else {
                    $externalControl2 = 'var';
                }
                // real unique key, needed for more than 1 view of tt_news on 1 page
                $uniqueId = $this->realConf->config['code'] . $uniqueId;
                // configuration of gallery
                $duration = $rgsgConf['duration'] ? 'timed:true,delay: ' . $rgsgConf['duration'] : 'timed:false';
                $thumbs = $rgsgConf['showThumbs'] == 1 ? 'true' : 'false';
                $arrows = $rgsgConf['arrows'] == 1 ? 'true' : 'false';
                // advanced settings (from TS + tab flexform configuration)
                $advancedSettings .= $rgsgConf['hideInfoPane'] == 1 ? 'showInfopane: false,' : '';
                if ($rgsgConf['thumbOpacity'] && $rgsgConf['thumbOpacity'] > 0 && $rgsgConf['thumbOpacity'] <= 1) {
                    $advancedSettings .= 'thumbOpacity: ' . $rgsgConf['thumbOpacity'] . ',';
                }
                if ($rgsgConf['slideInfoZoneOpacity'] && $rgsgConf['slideInfoZoneOpacity'] && $rgsgConf['slideInfoZoneOpacity'] > 0 && $rgsgConf['slideInfoZoneOpacity'] <= 1) {
                    $advancedSettings .= 'slideInfoZoneOpacity: ' . $rgsgConf['slideInfoZoneOpacity'] . ',';
                }
                $advancedSettings .= $rgsgConf['thumbSpacing'] ? 'thumbSpacing: ' . $rgsgConf['thumbSpacing'] . ',' : '';
                // external thumbs
                $advancedSettings .= $rgsgConf['externalThumbs'] ? 'useExternalCarousel:true,carouselElement:$("' . $rgsgConf['externalThumbs'] . '"),' : '';
                // configuration
                $configuration = '
				<script type="text/javascript">' . $externalControl1 . '
					function startGallery' . $uniqueId . '() {
						if(window.gallery' . $uniqueId . ') {
                            ' . $externalControl2 . ' myGallery' . $uniqueId . ' = new gallery($(\'myGallery' . $uniqueId . '\'), {
                                ' . $duration . ',
                                showArrows: ' . $arrows . ',
                                showCarousel: ' . $thumbs . ',
                                embedLinks: false,
                                ' . $advancedSettings . '
                            });
						} else {
							window.gallery' . $uniqueId . '=true;
							if(this.ie) {
								window.setTimeout("startGallery' . $uniqueId . '();",3000);
							} else {
								window.setTimeout("startGallery' . $uniqueId . '();",100);
							}
						}
					}
                    window.addEvent("domready", startGallery' . $uniqueId . ');
				</script>
				<noscript>
					<div><img src="' . $this->cObj->IMG_RESOURCE($noJsImg) . '"  /></div>
				</noscript>
			';
                // get the JS
                $content = $this->gallery->getJs(1, 1, 0, $rgsgConf['width'], $rgsgConf['height'], '', $uniqueId, $rgsgConf, $configuration);
                // Begin the gallery
                $content .= $this->gallery->beginGallery($uniqueId);
                // add the images
                $i = 0;
                foreach ($images as $key => $value) {
                    $path = $imageFieldPrefix . $value;
                    // single Image
                    $imgTSConfigThumb = $rgsgConf['thumb.'];
                    $imgTSConfigThumb['file'] = $path;
                    $imgTSConfigBig = $rgsgConf['big.'];
                    $imgTSConfigBig['file'] = $path;
                    // caption text
                    $text = explode('|', $caption[$i]);
                    // add image
                    $content .= $this->addImage($path, $text[0], $text[1]);
                    $i++;
                }
                # end foreach file
                // end of image
                $content .= $this->gallery->endGallery();
                // write new gallery into the marker
                $markerName = $this->rgsgConf['imageMarker'] ? $this->rgsgConf['imageMarker'] : 'NEWS_IMAGE';
                $markerArray['###' . $markerName . '###'] = '<div class="news-single-img">' . $content . '</div>';
            } elseif ($this->rgsgConf['imageMarker'] != '') {
                $markerArray['###' . $this->rgsgConf['imageMarker'] . '###'] = '';
            }
        }
        # end if ($rgsgConf) {
        return $markerArray;
    }
 /**
  * Returns the right settings for the formhandler (Checks if predefined form was selected)
  *
  * @author Reinhard Führicht <*****@*****.**>
  * @return array The settings
  */
 public function getSettings()
 {
     $settings = $this->configuration->getSettings();
     if ($this->predefined && is_array($settings['predef.'][$this->predefined])) {
         $predefSettings = $settings['predef.'][$this->predefined];
         unset($settings['predef.'][$this->predefined]);
         $settings = t3lib_div::array_merge_recursive_overrule($settings, $predefSettings);
     }
     return $settings;
 }
Пример #29
0
 function getRelatedNewsAsList($uid)
 {
     // save some variables which are used to build the backLink to the list view
     $tmpcatExclusive = $this->catExclusive;
     $tmparcExclusive = $this->arcExclusive;
     $tmpCategories = $this->categories;
     $tmpcode = $this->theCode;
     $tmpBrowsePage = intval($this->piVars['pointer']);
     unset($this->piVars['pointer']);
     $tmpPS = intval($this->piVars['pS']);
     unset($this->piVars['pS']);
     $tmpPL = intval($this->piVars['pL']);
     unset($this->piVars['pL']);
     $confSave = $this->conf;
     $configSave = $this->config;
     $tmplocal_cObj = clone $this->local_cObj;
     $tmp_renderMarkers = $this->renderMarkers;
     if (!is_array($this->conf['displayRelated.'])) {
         $this->conf['displayRelated.'] = array();
     }
     $this->conf = t3lib_div::array_merge_recursive_overrule($this->conf, $this->conf['displayRelated.']);
     $this->config = $this->conf;
     $this->arcExclusive = $this->conf['archive'];
     $this->LOCAL_LANG_loaded = FALSE;
     $this->pi_loadLL();
     // reload language-labels
     $this->theCode = 'RELATED';
     $this->relNewsUid = $uid;
     $this->addFromTable = 'tt_news_related_mm';
     $relatedNews = trim($this->displayList());
     // restore variables
     $this->conf = $confSave;
     $this->config = $configSave;
     $this->theCode = $tmpcode;
     $this->catExclusive = $tmpcatExclusive;
     $this->arcExclusive = $tmparcExclusive;
     $this->categories = $tmpCategories;
     $this->piVars['pointer'] = $tmpBrowsePage;
     $this->piVars['pS'] = $tmpPS;
     $this->piVars['pL'] = $tmpPL;
     $this->local_cObj = $tmplocal_cObj;
     $this->renderMarkers = $tmp_renderMarkers;
     unset($confSave, $configSave, $tmpCategories, $this->addFromTable, $tmplocal_cObj);
     return $relatedNews;
 }
Пример #30
0
 /**
  * Builds the URI, backend flavour
  * The resulting URI is relative and starts with "mod.php".
  * The settings pageUid, pageType, noCache, useCacheHash & linkAccessRestrictedPages
  * will be ignored in the backend.
  *
  * @return string The URI
  */
 public function buildBackendUri()
 {
     if ($this->addQueryString === TRUE) {
         $arguments = t3lib_div::_GET();
         foreach ($this->argumentsToBeExcludedFromQueryString as $argumentToBeExcluded) {
             unset($arguments[$argumentToBeExcluded]);
         }
     } else {
         $arguments = array('M' => t3lib_div::_GET('M'), 'id' => t3lib_div::_GET('id'));
     }
     $arguments = t3lib_div::array_merge_recursive_overrule($arguments, $this->arguments);
     $arguments = $this->convertDomainObjectsToIdentityArrays($arguments);
     $this->lastArguments = $arguments;
     $uri = 'mod.php?' . http_build_query($arguments, NULL, '&');
     if ($this->section !== '') {
         $uri .= '#' . $this->section;
     }
     if ($this->createAbsoluteUri === TRUE) {
         $uri = $this->request->getBaseURI() . $uri;
     }
     return $uri;
 }