/** * (non-PHPdoc) * @see t3lib_SCbase::checkExtObj() */ public function checkExtObj() { if (is_array($this->extClassConf) && $this->extClassConf['name']) { $this->extObj = tx_rnbase::makeInstance($this->extClassConf['name']); $this->extObj->init($this, $this->extClassConf); // Re-write: tx_rnbase::load('tx_rnbase_parameters'); $this->MOD_SETTINGS = Tx_Rnbase_Backend_Utility::getModuleData($this->MOD_MENU, tx_rnbase_parameters::getPostOrGetParameter('SET'), $this->MCONF['name'], $this->modMenu_type, $this->modMenu_dontValidateList, $this->modMenu_setDefaultList); } }
/** * Submit-Button like this: name="mykey[123]" value="label" * You will get 123 as long as no other submit changes this value. * @param string $key * @param string $modName * @return mixed */ public function getStoredRequestData($key, $changed = array(), $modName = 'DEFRNBASEMOD') { $data = tx_rnbase_parameters::getPostOrGetParameter($key); if (is_array($data)) { list($itemid, ) = each($data); $changed[$key] = $itemid; } $ret = Tx_Rnbase_Backend_Utility::getModuleData(array($key => ''), $changed, $modName); return $ret[$key]; }
/** * Returns an ArrayObject containing all parameters * @param tx_rnbase_configurations $configurations */ protected function _makeParameterObject($configurations) { $parameters = tx_rnbase::makeInstance('tx_rnbase_parameters'); $parameters->setQualifier($configurations->getQualifier()); // get parametersArray for defined qualifier $parametersArray = tx_rnbase_parameters::getPostAndGetParametersMerged($configurations->getQualifier()); if ($configurations->isUniqueParameters() && array_key_exists($configurations->getPluginId(), $parametersArray)) { $parametersArray = $parametersArray[$configurations->getPluginId()]; } tx_rnbase_util_Arrays::overwriteArray($parameters, $parametersArray); // Initialize the cHash system if there are parameters available if (!$configurations->isPluginUserInt() && $GLOBALS['TSFE'] && $parameters->count()) { // Bei USER_INT wird der cHash nicht benötigt und führt zu 404 $GLOBALS['TSFE']->reqCHash(); } return $parameters; }
/** * Hilfsmethode zum Setzen von Filtern aus den Parametern. Ein schon gesetzter Wert im Field-Array * wird nicht überschrieben. Die * * @param string $idstr * @param array $fields * @param tx_rnbase_parameters $parameters * @param tx_rnbase_configurations $configurations * @param string $operator Operator-Konstante */ function setField($idstr, &$fields, &$parameters, &$configurations, $operator = OP_LIKE) { // Wenn der Wert schon gesetzt ist, wird er nicht überschrieben if (!isset($fields[$idstr][$operator]) && $parameters->offsetGet($idstr)) { $fields[$idstr][$operator] = $parameters->offsetGet($idstr); // Parameter als KeepVar merken TODO: Ist das noch notwendig $configurations->addKeepVar($configurations->createParamName($idstr), $fields[$idstr]); } }
protected function showHiddenSelector(&$marker, $options = array()) { $items = array(0 => $GLOBALS['LANG']->getLL('label_select_hide_hidden'), 1 => $GLOBALS['LANG']->getLL('label_select_show_hidden')); tx_rnbase::load('tx_rnbase_mod_Util'); $selectedItem = tx_rnbase_mod_Util::getModuleValue('showhidden', $this->getModule(), array('changed' => tx_rnbase_parameters::getPostOrGetParameter('SET'))); $options['label'] = $options['label'] ? $options['label'] : $GLOBALS['LANG']->getLL('label_hidden'); return tx_rnbase_mod_Util::showSelectorByArray($items, $selectedItem, 'showhidden', $marker, $options); }
/** * Init this link by typoscript setup * * @param tx_rnbase_configurations $configurations * @param string $confId * * @return tx_rnbase_util_Link */ public function initByTS($configurations, $confId, $parameterArr) { $parameterArr = is_array($parameterArr) ? $parameterArr : array(); $pid = $configurations->getCObj()->stdWrap($configurations->get($confId . 'pid'), $configurations->get($confId . 'pid.')); $qualifier = $configurations->get($confId . 'qualifier'); if ($qualifier) { $this->designator($qualifier); } $target = $configurations->get($confId . 'target'); if ($target) { $this->target($target); } // feste URL für externen Link if ($fixed = $configurations->get($confId . 'fixedUrl', TRUE)) { $this->destination($fixed); } else { $this->destination($pid ? $pid : $GLOBALS['TSFE']->id); // absolute und ggf. schema url erzeugen if ($absUrl = $configurations->get($confId . 'absurl')) { $this->setAbsUrl(TRUE, $absUrl == 1 || strtolower($absUrl) == 'true' ? '' : $absUrl); } } if (array_key_exists('SECTION', $parameterArr)) { $this->anchor(htmlspecialchars($parameterArr['SECTION'])); unset($parameterArr['SECTION']); } else { $this->anchor((string) $configurations->get($confId . 'section', TRUE)); } $this->parameters($parameterArr); // eigene Parameter für typolink, die einfach weitergegeben werden $typolinkCfg = $configurations->get($confId . 'typolink.'); if (is_array($typolinkCfg)) { foreach ($typolinkCfg as $cfgName => $cfgValue) { $this->addTypolinkParam($cfgName, $cfgValue); } } // Zusätzliche Parameter für den Link $atagParams = $configurations->get($confId . 'atagparams.', TRUE); if (is_array($atagParams)) { // Die Parameter werden jetzt nochmal per TS validiert und können somit dynamisch gesetzt werden $attributes = array(); foreach ($atagParams as $aParam => $lvalue) { if (substr($aParam, strlen($aParam) - 1, 1) == '.') { $aParam = substr($aParam, 0, strlen($aParam) - 1); if (array_key_exists($aParam, $atagParams)) { continue; } } $attributes[$aParam] = $configurations->getCObj()->stdWrap($atagParams[$aParam], $atagParams[$aParam . '.']); } $this->attributes($attributes); } // KeepVars prüfen // Per Default sind die KeepVars nicht aktiviert. Mit useKeepVars == 1 können sie hinzugefügt werden if (!$configurations->get($confId . 'useKeepVars')) { $this->overruled(); } elseif ($keepVarConf = $configurations->get($confId . 'useKeepVars.')) { // Sonderoptionen für KeepVars gesetzt $newKeepVars = array(); // skip empty values? default false! $skipEmpty = !empty($keepVarConf['skipEmpty']); $keepVars = $configurations->getKeepVars(); $allow = $keepVarConf['allow']; $deny = $keepVarConf['deny']; if ($allow) { $allow = tx_rnbase_util_Strings::trimExplode(',', $allow); foreach ($allow as $allowed) { $value = $keepVars->offsetGet($allowed); if ($skipEmpty && empty($value)) { continue; } $newKeepVars[$allowed] = $keepVars->offsetGet($allowed); } } elseif ($deny) { $deny = array_flip(tx_rnbase_util_Strings::trimExplode(',', $deny)); $keepVarsArr = $keepVars->getArrayCopy(); foreach ($keepVarsArr as $key => $value) { if ($skipEmpty && empty($value)) { continue; } if (!array_key_exists($key, $deny)) { $newKeepVars[$key] = $value; } } } $add = $keepVarConf['add']; if ($add) { $add = tx_rnbase_util_Strings::trimExplode(',', $add); foreach ($add as $linkvar) { $linkvar = tx_rnbase_util_Strings::trimExplode('=', $linkvar); if (count($linkvar) < 2) { // tt_news::* or ttnews::id list($qualifier, $name) = tx_rnbase_util_Strings::trimExplode('::', $linkvar[0]); if ($value = tx_rnbase_parameters::getPostOrGetParameter($qualifier)) { if ($name == '*' && is_array($value)) { foreach ($value as $paramName => $paramValue) { if ($skipEmpty && empty($paramValue)) { continue; } if (strpos($paramName, 'NK_') === FALSE) { $newKeepVars[$qualifier . '::' . $paramName] = $paramValue; } } } else { $newKeepVars[$linkvar[0]] = $value[$name]; } } } else { $newKeepVars[$linkvar[0]] = $linkvar[1]; } } } $this->overruled($newKeepVars); } if ($configurations->get($confId . 'noCache')) { $this->noCache(); } // Bei der Linkerzeugung wir normalerweise immer ein cHash angelegt. Bei Plugins, die als USER_INT // ausgeführt werden, ist dies nicht notwendig und geht auf die Performance. Daher wird hier // automatisch der cHash für USER_INT deaktiviert. Per Typocript kann man es aber bei Bedarf manuell // wieder aktivieren if ($configurations->get($confId . 'noHash') || $configurations->get($confId . 'noHash') !== '0' && $configurations->isPluginUserInt()) { $this->noHash(); } return $this; }
/** * @return array */ protected function getCacheKeyParts() { $keys = array(); // TSFE hash, contains page id, domain, etc. $keys[] = tx_rnbase_util_TYPO3::getTSFE()->getHash(); // the plugin ID (tt_content:uid or random md3, whenn rendered as USER in TS) $keys[] = $this->getConfigurations()->getPluginId(); // the conf id of the current action (without trailing dot) $keys[] = trim($this->getConfId(), '.'); // aditionaly a optional key set by ts $keys[] = $this->getSalt(); // include params to the cache key usage = qualifier|uid,tt_news|tt_news $params = $this->getIcludeParams(); if (!empty($params)) { // all get and post vars tx_rnbase::load('tx_rnbase_util_Arrays'); $gp = tx_rnbase_util_Arrays::mergeRecursiveWithOverrule(tx_rnbase_parameters::getGetParameters(), tx_rnbase_parameters::getPostParameters()); // the cobj to get the parameter value $cObj = $this->getConfigurations()->getCObj(); foreach ($params as $param) { $keys[] = 'P-' . $param . '-' . $cObj->getGlobal($param, $gp); } } return $keys; }