function &_fetchData() { if (($mData = $this->_navConf("/data")) === FALSE || !tx_ameosformidable::isRunneable($mData)) { $this->oForm->mayday("RENDERLET JSTREE <b>" . $this->_getName() . "</b> - requires <b>/data</b> to be properly set with a runneable. Check your XML conf."); } return $this->oForm->callRunneable($mData); }
function &_getRowsSubpart($sTemplate) { $aRowsTmpl = array(); if (($sAltRows = $this->_navConf("/template/alternaterows")) !== FALSE) { if (tx_ameosformidable::isRunneable($sAltRows)) { $sAltRows = tx_ameosformidable::isRunneable($sAltRows); } if (!is_string($sAltRows)) { $sAltRows = FALSE; } else { $sAltRows = trim($sAltRows); } } $aAltList = t3lib_div::trimExplode(",", $sAltRows); if (sizeof($aAltList) > 0) { $sRowsPart = t3lib_parsehtml::getSubpart($sTemplate, "###ROWS###"); reset($aAltList); while (list(, $sAltSubpart) = each($aAltList)) { $sHtml = t3lib_parsehtml::getSubpart($sRowsPart, $sAltSubpart); if (empty($sHtml)) { $this->oForm->mayday("renderlet:" . $this->_getType() . "[name=" . $this->getName() . "] - The given template with subpart marquer <b>'" . $sAltSubpart . "'</b> returned an empty string - Please check your template!"); } $aRowsTmpl[] = $sHtml; } } return $aRowsTmpl; }
function _doTheMagic($bShouldProcess = TRUE) { if ($bShouldProcess && $this->_allIsValid()) { $aData = $this->_getFormData(); // calling back $callback = $this->oForm->_navConf($this->oForm->sXpathToControl . "datahandler/"); if (tx_ameosformidable::isRunneable($callback)) { $this->callRunneable($callback, $aData); } else { $callback = $this->oForm->_navConf($this->oForm->sXpathToControl . "datahandler/parentcallback/"); if ($callback === FALSE) { $callback = $this->oForm->_navConf($this->oForm->sXpathToControl . "datahandler/callback/"); } if ($callback !== FALSE) { if (tx_ameosformidable::isRunneable($callback)) { $this->callRunneable($callback, $aData); } elseif (is_string($callback)) { if (method_exists($this->oForm->_oParent, $callback)) { $this->oForm->_oParent->{$callback}($aData); } else { $this->oForm->mayday("DATAHANDLER RAW : the callback method " . $callback . " doesn't exists in the definition of the Parent object"); } } } else { $this->oForm->mayday("DATAHANDLER RAW : you MUST declare a callback method on the Parent Object <b>" . get_class($this->oForm->_oParent) . "</b> in the section <b>/control/datahandler/parentcallback/</b> of the XML conf for this DATAHANDLER ( RAW )"); } } } }
function getValue() { $mValue = $this->_navConf("/data/value"); if (tx_ameosformidable::isRunneable($mValue)) { $mValue = $this->oForm->callRunneable($mValue); } return $mValue; }
function getSubmitMode() { $sMode = $this->_navConf("/mode"); if (tx_ameosformidable::isRunneable($sMode)) { $sMode = $this->callRunneable($sMode); } if (is_string($sMode)) { return strtolower(trim($sMode)); } return "full"; }
private function getTemplatePath() { $sPath = $this->_navConf("/template/path/"); if (tx_ameosformidable::isRunneable($sPath)) { $sPath = $this->callRunneable($sPath); } if (is_string($sPath)) { return $this->oForm->toServerPath($sPath); } return FALSE; }
function _getPathReload() { if (($sPath = $this->_navConf("/reloadpic/")) !== FALSE) { if (tx_ameosformidable::isRunneable($sPath)) { $sPath = $this->callRunneable($sPath); } if (t3lib_div::isFirstPartOfStr($sPath, "EXT:")) { $sPath = t3lib_div::getIndpEnv("TYPO3_SITE_URL") . str_replace(t3lib_div::getIndpEnv("TYPO3_DOCUMENT_ROOT"), "", t3lib_div::getFileAbsFileName($sPath)); } } return $sPath; }
function _initBinding() { if (tx_ameosformidable::isRunneable($aBindsTo = $this->_navConf("/bindsto"))) { $this->aSource =& $this->callRunneable($aBindsTo); $this->iTotalRows = count($this->aSource); if (!is_array($this->aSource)) { $this->aSource = array(); $this->iTotalRows = 0; } } else { $this->oForm->mayday("DATASOURCE PHPARRAY \"" . $this->aElement["name"] . "\" - requires /bindsTo. Check your XML conf."); } $this->_sortSource(); $this->_limitSource(); }
function &_fetchData($aConfig = array(), $aFilters = array()) { $aResults = array(); $iNumRows = 0; if (($aGet = $this->_navConf("/get")) !== FALSE) { if (tx_ameosformidable::isRunneable($aGet)) { $aResults = $this->callRunneable($aGet); if (is_array($aResults)) { $iNumRows = count($aResults); } else { $aResults = array(); } } else { $this->oForm->mayday("datasource:PHP[name='" . $this->getName() . "'] /get has to be runnable (userobj, or reference to a code-behind)."); } } else { $this->oForm->mayday("datasource:PHP[name='" . $this->getName() . "'] You have to provide a runnable on <b>/get</b>."); } return array("numrows" => $iNumRows, "results" => &$aResults); }
function _doTheMagic($aRendered, $sForm) { $sUrl = ""; if ($this->oForm->oDataHandler->_allIsValid()) { if (($mPage = $this->_navConf("/pageid")) !== FALSE) { if (tx_ameosformidable::isRunneable($mPage)) { $mPage = $this->callRunneable($mPage); } $sUrl = $this->oForm->cObj->typolink_URL(array("parameter" => $mPage)); if (!t3lib_div::isFirstPartOfStr($sUrl, "http://") && trim($GLOBALS["TSFE"]->baseUrl) !== "") { $sUrl = $this->oForm->_removeEndingSlash($GLOBALS["TSFE"]->baseUrl) . "/" . $sUrl; } } else { $sUrl = $this->_navConf("/url"); if (tx_ameosformidable::isRunneable($sUrl)) { $sUrl = $this->callRunneable($sUrl); } } if (is_string($sUrl) && trim($sUrl) !== "") { header("Location: " . $sUrl); exit; } } }
function isFalseVal($mVal) { if (tx_ameosformidable::isRunneable($mVal)) { $mVal = $this->callRunneable($mVal); } return $mVal == FALSE || strtoupper($mVal) == "FALSE"; }
function wrapErrorMessage($sMessage) { if ($this->isTrue("/template/errortagcompilednowrap")) { return $sMessage; } if (($sErrWrap = $this->_navConf("/template/errortagwrap")) !== FALSE) { if (tx_ameosformidable::isRunneable($sErrWrap)) { $sErrWrap = $this->callRunneable($sErrWrap); } $sErrWrap = $this->oForm->_substLLLInHtml($sErrWrap); } else { $sErrWrap = "<span class='errors'>|</span>"; } return str_replace("|", $sMessage, $sErrWrap); }
function _renderReadOnly() { $sValue = $this->getValue(); if ($this->isTrue("/typolink")) { $sUrl = $this->oForm->cObj->typolink_URL(array("parameter" => $sValue, "additionalParams" => "")); } elseif (($iPageId = $this->_navConf("pageid")) !== FALSE || ($iPageId = $this->_navConf("pid")) !== FALSE) { if (tx_ameosformidable::isRunneable($iPageId)) { $iPageId = $this->callRunneable($iPageId); } $sUrl = $this->oForm->cObj->typolink_URL(array("parameter" => $iPageId, "additionalParams" => "")); } else { $sUrl = $this->_navConf("/href"); if ($sUrl === FALSE) { $sUrl = $this->_navConf("/url"); } if (tx_ameosformidable::isRunneable($sUrl)) { $sUrl = $this->callRunneable($sUrl); } if (!$sUrl) { $sValue = trim($sValue); $aParsedURL = @parse_url($sValue); if (t3lib_div::inList('ftp,ftps,http,https,gopher,telnet', $aParsedURL['scheme'])) { $sUrl = $sValue; } else { $sUrl = FALSE; } } } if (($sAnchor = $this->_navConf("/anchor")) !== FALSE) { if (tx_ameosformidable::isRunneable($sAnchor)) { $sAnchor = $this->callRunneable($sAnchor); } if (is_string($sAnchor) && $sAnchor !== "") { $sAnchor = str_replace("#", "", $sAnchor); } else { $sAnchor = ""; } if ($sAnchor !== "") { if ($sUrl === FALSE) { $sUrl = t3lib_div::getIndpEnv("REQUEST_URI"); } if (array_key_exists($sAnchor, $this->oForm->aORenderlets)) { $sAnchor = $this->oForm->aORenderlets[$sAnchor]->_getElementHtmlId(); } $sAnchor = "#" . $sAnchor; } } if ($sUrl !== FALSE) { if ($sAnchor !== FALSE) { $sHref = $sUrl . $sAnchor; } else { $sHref = $sUrl; } } else { $sHref = FALSE; } $aHtmlBag = array("url" => $sUrl, "href" => $sHref, "anchor" => $sAnchor, "tag." => array("begin" => "", "innerhtml" => "", "end" => "")); if (!$this->oForm->isTrue("/urlonly", $this->aElement)) { if ($this->hasChilds()) { $aChilds = $this->renderChildsBag(); $sCaption = $this->renderChildsCompiled($aChilds); } else { if (!$this->_emptyFormValue($sValue)) { $sCaption = $sValue; } else { $sCaption = $sHref; } if (($sLabel = $this->getLabel()) !== "") { $sCaption = $sLabel; } else { $aItems = $this->_getItems(); if (count($aItems) > 0) { reset($aItems); while (list($itemindex, $aItem) = each($aItems)) { if ($aItem["value"] == $value) { $sCaption = $aItem["caption"]; } } } } } if ($sCaption === FALSE) { $sCaption = ""; } $aHtmlBag["caption"] = $sCaption; if ($sHref !== FALSE) { $aHtmlBag["tag."]["begin"] = "<a " . ($sHref != "" ? "href=\"" . $sHref . "\"" : "") . " id=\"" . $this->_getElementHtmlId() . "\"" . $this->_getAddInputParams() . ">"; $aHtmlBag["tag."]["innerhtml"] = $sCaption; $aHtmlBag["tag."]["end"] = "</a>"; } else { $aHtmlBag["tag."]["begin"] = "<span id=\"" . $this->_getElementHtmlId() . "\" " . $this->_getAddInputParams() . ">"; $aHtmlBag["tag."]["innerhtml"] = $sCaption; $aHtmlBag["tag."]["end"] = "</span>"; } $sCompiled = $aHtmlBag["tag."]["begin"] . $aHtmlBag["tag."]["innerhtml"] . $aHtmlBag["tag."]["end"]; $aHtmlBag["wrap"] = $aHtmlBag["tag."]["begin"] . "|" . $aHtmlBag["tag."]["end"]; } else { $sCompiled = $sHref; } $aHtmlBag["__compiled"] = $sCompiled; return $aHtmlBag; }
function _getAdditionalWheres($aWheres, $sPrefix = "") { $sTempWhere = ""; if ($aWheres !== FALSE && is_array($aWheres) && count($aWheres) > 0) { $aClauses = array(); $bClauses = FALSE; reset($aWheres); while (list($sType, $aWhere) = each($aWheres)) { $aTemp = explode("-", $sType); $sType = trim(strtoupper($aTemp[0])); $bProcess = TRUE; if (is_array($aWhere) && array_key_exists("process", $aWhere)) { if (tx_ameosformidable::isRunneable($aWhere["process"])) { $bProcess = $this->callRunneable($aWhere["process"]); } else { if ($this->oForm->isFalseVal($aWhere["process"])) { $bProcess = FALSE; } } } if ($bProcess) { switch ($sType) { case "WHERE": if (($mProcess = $this->oForm->defaultTrue("/process", $aWhere)) !== FALSE) { if (tx_ameosformidable::isRunneable($mProcess)) { $mProcess = $this->callRunneable($mProcess); } } if ($mProcess === TRUE) { if (array_key_exists("value", $aWhere)) { $mValue = $aWhere["value"]; } else { $mValue = ""; } if (tx_ameosformidable::isRunneable($mValue)) { $mValue = $this->callRunneable($mValue); } if ($mValue == "") { $mValue = "''"; } if (tx_ameosformidable::isRunneable($aWhere["comparison"])) { $aWhere["comparison"] = $this->callRunneable($aWhere["comparison"]); } $sComparison = strtoupper(trim($aWhere["comparison"])); if ($bClauses && ($mLogic = $this->oForm->_navConf("/logic", $aWhere)) !== FALSE) { if (tx_ameosformidable::isRunneable($mLogic)) { $mLogic = $this->callRunneable($mLogic); } $aClauses[] = in_array(trim(strtoupper($mLogic)), array("AND", "OR")) ? trim(strtoupper($mLogic)) : "AND"; } $aClauses[] = " " . $sPrefix . $aWhere["term"] . " " . $sComparison . ($sComparison == "IN" || $sComparison == "NOT IN" ? " (" : " '") . $mValue . ($sComparison == "IN" || $sComparison == "NOT IN" ? ") " : "'"); $bClauses = TRUE; break; } case "BEGINBRACE": $aClauses[] = "("; break; case "ENDBRACE": $aClauses[] = ")"; break; case "LOGIC": if ($bClauses) { if (is_array($aWhere) && array_key_exists("value", $aWhere)) { $mValue = $aWhere["value"]; } else { $mValue = $aWhere; } if (tx_ameosformidable::isRunneable($mValue)) { $mValue = $this->callRunneable($mValue); } $aClauses[] = in_array(trim(strtoupper($mValue)), array("AND", "OR")) ? trim(strtoupper($mValue)) : ""; } break; } } } $sTempWhere = implode(" ", $aClauses); } if ($bClauses && trim($sTempWhere) != "") { return " AND (" . $sTempWhere . ")"; } return ""; }
function getPxWidth() { $mWidth = FALSE; if (($mWidth = $this->_navConf("/width")) !== FALSE) { if (tx_ameosformidable::isRunneable($mWidth)) { $mWidth = intval($this->oForm->callRunneable($mWidth)); } if (($mWidth = intval($mWidth)) === 0) { $mWidth = FALSE; } } return $mWidth; }
function validateByPath($sPath) { if (!$this->hasError()) { $aConf = $this->_navConf($sPath); if (is_array($aConf) && !empty($aConf)) { $sAbsName = $this->getAbsName(); while (!$this->hasError() && (list($sKey, $aValidator) = each($aConf))) { if ($sKey[0] === "v" && $sKey[1] === "a" && t3lib_div::isFirstPartOfStr($sKey, "validator") && !t3lib_div::isFirstPartOfStr($sKey, "validators")) { // the conf section exists // call validator $oValidator = $this->oForm->_makeValidator($aValidator); if ($oValidator->_matchConditions()) { $bHasToValidate = TRUE; $aValidMap = $this->oForm->_navConf($this->oForm->sXpathToControl . "factorize/switchvalidation"); if (tx_ameosformidable::isRunneable($aValidMap)) { $aValidMap = $this->callRunneable($aValidMap); } if (is_array($aValidMap) && array_key_exists($sAbsName, $aValidMap)) { $bHasToValidate = $aValidMap[$sAbsName]; } if ($bHasToValidate === TRUE) { $oValidator->validate($this); } } } } } } }
function handleDam() { if ($this->useDam()) { $bSimulatedUser = FALSE; global $BE_USER; if (!isset($BE_USER) || !is_object($BE_USER) || intval($GLOBALS["BE_USER"]->user["uid"]) === 0) { // no be_user available // we are using the one created for formidable+dam, named _formidable+dam $rSql = $GLOBALS["TYPO3_DB"]->exec_SELECTquery("uid", "be_users", "LOWER(username)='_formidable+dam'"); if (($aRs = $GLOBALS["TYPO3_DB"]->sql_fetch_assoc($rSql)) !== FALSE) { // we found user _formidable+dam // simulating user unset($BE_USER); $BE_USER = t3lib_div::makeInstance('t3lib_beUserAuth'); $BE_USER->OS = TYPO3_OS; $BE_USER->setBeUserByUid($aRs["uid"]); $BE_USER->fetchGroupData(); $BE_USER->backendSetUC(); $GLOBALS['BE_USER'] = $BE_USER; $bSimulatedUser = TRUE; } else { $this->oForm->mayday("renderlet:UPLOAD[name=" . $this->_getName() . "] /dam/use is enabled; for DAM to operate properly, you have to create a backend-user named '_formidable+dam' with permissions on dam tables"); } } if ($this->isMultiple()) { $aFiles = t3lib_div::trimExplode(",", $this->getValue()); } else { $aFiles = array($this->getValue()); } reset($aFiles); while (list(, $sFileName) = each($aFiles)) { $sFilePath = $this->getServerPath($sFileName); tx_dam::notify_fileChanged($sFilePath); $oMedia = tx_dam::media_getForFile($sFilePath); if (($mTitle = $this->_navConf("/dam/addtitle")) !== FALSE) { if (tx_ameosformidable::isRunneable($mTitle)) { $mTitle = $this->callRunneable($mTitle, array("filename" => $sFileName, "filepath" => $sFilePath, "media" => $oMedia, "currentcats" => $aCurCats, "files" => $aFiles)); } $oMedia->meta["title"] = $mTitle; if (trim($mTitle) !== '') { $oMedia->meta["title"] = $mTitle; } } if (($mDescription = $this->_navConf("/dam/adddescription")) !== FALSE) { if (tx_ameosformidable::isRunneable($mDescription)) { $mDescription = $this->callRunneable($mDescription, array("filename" => $sFileName, "filepath" => $sFilePath, "media" => $oMedia, "currentcats" => $aCurCats, "files" => $aFiles)); } $oMedia->meta["description"] = $mDescription; if (trim($mDescription) !== '') { $oMedia->meta["description"] = $mDescription; } } if (($mCaption = $this->_navConf("/dam/addcaption")) !== FALSE) { if (tx_ameosformidable::isRunneable($mCaption)) { $mCaption = $this->callRunneable($mCaption, array("filename" => $sFileName, "filepath" => $sFilePath, "media" => $oMedia, "currentcats" => $aCurCats, "files" => $aFiles)); } if (trim($mCaption) !== '') { $oMedia->meta["caption"] = $mCaption; } } if (($mCategories = $this->_navConf("/dam/addcategories")) !== FALSE) { require_once PATH_txdam . "lib/class.tx_dam_db.php"; $aCurCats = $GLOBALS["TYPO3_DB"]->exec_SELECTgetRows("uid_foreign", "tx_dam_mm_cat", "uid_local='" . $oMedia->meta["uid"] . "'", "", "sorting ASC"); if (!is_array($aCurCats)) { $aCurCats = array(); } reset($aCurCats); while (list($sKey, ) = each($aCurCats)) { $aCurCats[$sKey] = $aCurCats[$sKey]["uid_foreign"]; } if (tx_ameosformidable::isRunneable($mCategories)) { $mCategories = $this->callRunneable($mCategories, array("filename" => $sFileName, "filepath" => $sFilePath, "media" => $oMedia, "currentcats" => $aCurCats, "files" => $aFiles)); } $aCategories = array(); if (!is_array($mCategories)) { if (trim($mCategories) !== "") { $aCategories = t3lib_div::trimExplode(",", trim($mCategories)); } } else { $aCategories = $mCategories; } if (count($aCategories) > 0) { reset($aCurCats); $aCategories = array_unique(array_merge($aCurCats, $aCategories)); if (!empty($aCategories)) { $oMedia->meta["category"] = implode(",", $aCategories); } } } tx_dam_db::insertUpdateData($oMedia->meta); } if ($bSimulatedUser === TRUE) { unset($BE_USER); unset($GLOBALS["BE_USER"]); } } }
/** * [Describe function...] * * @param [type] $$oRequest: ... * @return [type] ... */ function handleAjaxRequest(&$oRequest) { if ($oRequest->aRequest["servicekey"] == "ajaxevent") { $sEventId = $oRequest->aRequest["eventid"]; if (!array_key_exists($sEventId, $this->aAjaxEvents)) { $oRequest->denyService("Unknown Event ID " . $sEventId . "(" . $this->formid . ")"); } $this->oMajixEvent =& $oRequest; $oThrower =& $oRequest->getThrower(); if ($oThrower !== FALSE && $this->isTrueVal($this->aAjaxEvents[$sEventId]["event"]["syncvalue"])) { $oThrower->setValue($oRequest->aRequest["params"]["sys_syncvalue"]); unset($oRequest->aRequest["params"]["sys_syncvalue"]); } if (!empty($oRequest->aRequest["context"])) { reset($oRequest->aRequest["context"]); while (list($sKey, ) = each($oRequest->aRequest["context"])) { if (($oRdt =& $this->rdt($sKey)) !== FALSE) { $oRdt->handleRefreshContext($oRequest->aRequest["context"][$sKey]); } } } if (tx_ameosformidable::isRunneable($this->aAjaxEvents[$sEventId]["event"])) { if ($oRequest->aRequest["trueargs"] !== FALSE) { $aArgs =& $oRequest->aRequest["trueargs"]; $iNbParams = count($aArgs); } else { $iNbParams = 0; } if ($oThrower !== FALSE) { $oObject =& $oThrower; } else { $oObject =& $this; } // logic: for back-compat, when trueargs is empty, we pass parameters as we always did // if trueargs set, we replicate arguments switch ($iNbParams) { case 0: return $oObject->callRunneable($this->aAjaxEvents[$sEventId]["event"], $oRequest->aRequest["params"]); break; case 1: return $oObject->callRunneable($this->aAjaxEvents[$sEventId]["event"], $aArgs[0]); break; case 2: return $oObject->callRunneable($this->aAjaxEvents[$sEventId]["event"], $aArgs[0], $aArgs[1]); break; case 3: return $oObject->callRunneable($this->aAjaxEvents[$sEventId]["event"], $aArgs[0], $aArgs[1], $aArgs[2]); break; case 4: return $oObject->callRunneable($this->aAjaxEvents[$sEventId]["event"], $aArgs[0], $aArgs[1], $aArgs[2], $aArgs[3]); break; case 5: return $oObject->callRunneable($this->aAjaxEvents[$sEventId]["event"], $aArgs[0], $aArgs[1], $aArgs[2], $aArgs[3], $aArgs[4]); break; case 6: return $oObject->callRunneable($this->aAjaxEvents[$sEventId]["event"], $aArgs[0], $aArgs[1], $aArgs[2], $aArgs[3], $aArgs[4], $aArgs[5]); break; case 7: return $oObject->callRunneable($this->aAjaxEvents[$sEventId]["event"], $aArgs[0], $aArgs[1], $aArgs[2], $aArgs[3], $aArgs[4], $aArgs[5], $aArgs[6]); break; case 8: return $oObject->callRunneable($this->aAjaxEvents[$sEventId]["event"], $aArgs[0], $aArgs[1], $aArgs[2], $aArgs[3], $aArgs[4], $aArgs[5], $aArgs[6], $aArgs[7]); break; case 9: return $oObject->callRunneable($this->aAjaxEvents[$sEventId]["event"], $aArgs[0], $aArgs[1], $aArgs[2], $aArgs[3], $aArgs[4], $aArgs[5], $aArgs[6], $aArgs[7], $aArgs[8]); break; case 10: return $oObject->callRunneable($this->aAjaxEvents[$sEventId]["event"], $aArgs[0], $aArgs[1], $aArgs[2], $aArgs[3], $aArgs[4], $aArgs[5], $aArgs[6], $aArgs[7], $aArgs[8], $aArgs[9]); break; default: $this->mayday("CallRunneable: can not declare more than 10 arguments."); break; } } } elseif ($oRequest->aRequest["servicekey"] == "ajaxservice") { $sServiceId = $oRequest->aRequest["serviceid"]; if (!array_key_exists($sServiceId, $this->aAjaxServices)) { $oRequest->denyService("Unknown Service ID " . $sServiceId); } if (tx_ameosformidable::isRunneable($this->aAjaxServices[$sServiceId]["definition"])) { if ($oRequest->aRequest["trueargs"] !== FALSE) { $aArgs =& $oRequest->aRequest["trueargs"]; $iNbParams = count($aArgs); } else { $iNbParams = 0; } // if trueargs set, we replicate arguments switch ($iNbParams) { case 0: $mRes = $this->callRunneable($this->aAjaxServices[$sServiceId]["definition"]); break; case 1: $mRes = $this->callRunneable($this->aAjaxServices[$sServiceId]["definition"], $aArgs[0]); break; case 2: $mRes = $this->callRunneable($this->aAjaxServices[$sServiceId]["definition"], $aArgs[0], $aArgs[1]); break; case 3: $mRes = $this->callRunneable($this->aAjaxServices[$sServiceId]["definition"], $aArgs[0], $aArgs[1], $aArgs[2]); break; case 4: $mRes = $this->callRunneable($this->aAjaxServices[$sServiceId]["definition"], $aArgs[0], $aArgs[1], $aArgs[2], $aArgs[3]); break; case 5: $mRes = $this->callRunneable($this->aAjaxServices[$sServiceId]["definition"], $aArgs[0], $aArgs[1], $aArgs[2], $aArgs[3], $aArgs[4]); break; case 6: $mRes = $this->callRunneable($this->aAjaxServices[$sServiceId]["definition"], $aArgs[0], $aArgs[1], $aArgs[2], $aArgs[3], $aArgs[4], $aArgs[5]); break; case 7: $mRes = $this->callRunneable($this->aAjaxServices[$sServiceId]["definition"], $aArgs[0], $aArgs[1], $aArgs[2], $aArgs[3], $aArgs[4], $aArgs[5], $aArgs[6]); break; case 8: $mRes = $this->callRunneable($this->aAjaxServices[$sServiceId]["definition"], $aArgs[0], $aArgs[1], $aArgs[2], $aArgs[3], $aArgs[4], $aArgs[5], $aArgs[6], $aArgs[7]); break; case 9: $mRes = $this->callRunneable($this->aAjaxServices[$sServiceId]["definition"], $aArgs[0], $aArgs[1], $aArgs[2], $aArgs[3], $aArgs[4], $aArgs[5], $aArgs[6], $aArgs[7], $aArgs[8]); break; case 10: $mRes = $this->callRunneable($this->aAjaxServices[$sServiceId]["definition"], $aArgs[0], $aArgs[1], $aArgs[2], $aArgs[3], $aArgs[4], $aArgs[5], $aArgs[6], $aArgs[7], $aArgs[8], $aArgs[9]); break; default: $this->mayday("CallRunneable: can not declare more than 10 arguments."); break; } } return $this->array2json($mRes); } }
function beforeDisplay($aRendered) { if (($aUserObj = $this->_navConf("/beforedisplay/")) !== FALSE) { if (tx_ameosformidable::isRunneable($aUserObj)) { $aRendered = $this->callRunneable($aUserObj, $aRendered); } } if (!is_array($aRendered)) { $aRendered = array(); } reset($aRendered); return $aRendered; }
function validate($oRdt) { $sAbsName = $oRdt->getAbsName(); $sFileName = $oRdt->getValue(); $bError = FALSE; $this->oFileFunc = t3lib_div::makeInstance("t3lib_basicFileFunctions"); if ($oRdt->_getType() === "FILE") { // renderlet:FILE $sFileName = strtolower($this->oFileFunc->cleanFileName($sFileName)); } elseif ($oRdt->_getType() === "UPLOAD") { // managing multiple, if set if ($sFileName !== "") { if ($oRdt->isMultiple()) { $aFileList = t3lib_div::trimExplode(",", $sFileName); $sFileName = array_pop($aFileList); // last one, and remove from list; will be added later if valid } } } if ($sFileName === "") { // never evaluate if value is empty // as this is left to STANDARD:required return ""; } $aKeys = array_keys($this->_navConf("/")); reset($aKeys); while (!$oRdt->hasError() && (list(, $sKey) = each($aKeys))) { /*********************************************************************** * * /extension * ***********************************************************************/ if ($sKey[0] === "e" && t3lib_div::isFirstPartOfStr($sKey, "extension")) { $sFileExts = $this->_navConf("/" . $sKey . "/value"); if (tx_ameosformidable::isRunneable($sFileExts)) { $sFileExts = $this->callRunneable($sFileExts); } $aExtensions = t3lib_div::trimExplode(",", $sFileExts); if (!$this->_checkFileExt($sFileName, $aExtensions, $sAbsName)) { $this->oForm->_declareValidationError($sAbsName, "FILE:extension", $this->oForm->_getLLLabel($this->_navConf("/" . $sKey . "/message")), $sFileName); $bError = TRUE; break; } } /*********************************************************************** * * /filesize * ***********************************************************************/ if ($sKey[0] === "f" && t3lib_div::isFirstPartOfStr($sKey, "filesize") && t3lib_div::isFirstPartOfStr($sKey, "filesizekb") && t3lib_div::isFirstPartOfStr($sKey, "filesizemb")) { $mSize = $this->_navConf("/" . $sKey . "/value"); if (tx_ameosformidable::isRunneable($mSize)) { $mSize = $this->callRunneable($mSize); } if (!$this->_checkFileSize($sFileName, $mSize, $sAbsName)) { $this->oForm->_declareValidationError($sAbsName, "FILE:filesize", $this->oForm->_getLLLabel($this->_navConf("/" . $sKey . "/message")), $sFileName); $bError = TRUE; break; } } /*********************************************************************** * * /filesizekb * ***********************************************************************/ if ($sKey[0] === "f" && t3lib_div::isFirstPartOfStr($sKey, "filesizekb")) { $mSize = $this->_navConf("/" . $sKey . "/value"); if (tx_ameosformidable::isRunneable($mSize)) { $mSize = $this->callRunneable($mSize); } if (!$this->_checkFileSizeKb($sFileName, $mSize, $sAbsName)) { $this->oForm->_declareValidationError($sAbsName, "FILE:filesizekb", $this->oForm->_getLLLabel($this->_navConf("/" . $sKey . "/message")), $sFileName); $bError = TRUE; break; } } /*********************************************************************** * * /filesizemb * ***********************************************************************/ if ($sKey[0] === "f" && t3lib_div::isFirstPartOfStr($sKey, "filesizemb")) { $mSize = $this->_navConf("/" . $sKey . "/value"); if (tx_ameosformidable::isRunneable($mSize)) { $mSize = $this->callRunneable($mSize); } if (!$this->_checkFileSizeMb($sFileName, $mSize, $sAbsName)) { $this->oForm->_declareValidationError($sAbsName, "FILE:filesizemb", $this->oForm->_getLLLabel($this->_navConf("/" . $sKey . "/message")), $sFileName); $bError = TRUE; break; } } } if ($bError === TRUE && $oRdt->_getType() === "UPLOAD") { if ($oRdt->isMultiple()) { // current filenamehas been remove from aFileList by previous array_pop $oRdt->setValue(implode(", ", $aFileList)); } else { $oRdt->setValue(""); } } }
function _processAfterEdition($aData) { if (($aUserObj = $this->_navConf("/process/afteredition/")) !== FALSE) { if (tx_ameosformidable::isRunneable($aUserObj)) { $this->oForm->callRunneable($aUserObj, $aData); } } }
function &_fetchData($aConfig = array()) { if ($this->defaultFalse('/keepalllistidinsession')) { $aListUidConfig = array('page' => 0, 'sortcolumn' => $aConfig['sortcolumn'], 'sortdirection' => $aConfig['sortdirection']); $aRecords = $this->oDataSource->_fetchData($aListUidConfig, $this->_getFilters()); if (($mCol = $this->_navConf('/columnforlist')) !== FALSE) { if (tx_ameosformidable::isRunneable($mCol)) { $mCol = $this->oForm->callRunneable($mCol); } } else { $mCol = 'uid'; } foreach ($aRecords['results'] as $aRecord) { if (!empty($aRecord[$mCol])) { $aList[] = $aRecord[$mCol]; } } $aData =& $GLOBALS["_SESSION"]["ameos_formidable"]["applicationdata"]["rdt_lister"][$this->getSearchHash()][$this->getAbsName()]["infos"]; $aData["list"] = $aList; } $aResults = $this->processAfterSearch($this->oDataSource->_fetchData($aConfig, $this->_getFilters())); if ($this->defaultFalse("/keepresultsinsession") === TRUE) { $this->storeResultsInSession($aResults); } reset($aResults); return $aResults; }
function validate(&$oRdt) { $sAbsName = $oRdt->getAbsName(); $mValue = $oRdt->getValue(); $aKeys = array_keys($this->_navConf("/")); reset($aKeys); while (!$oRdt->hasError() && (list(, $sKey) = each($aKeys))) { /*********************************************************************** * * /required * ***********************************************************************/ if ($sKey[0] === "r" && t3lib_div::isFirstPartOfStr($sKey, "required")) { if ($this->_isEmpty($oRdt, $mValue)) { if (($mMessage = $this->_navConf("/" . $sKey . "/message")) !== FALSE && tx_ameosformidable::isRunneable($mMessage)) { $mMessage = $oRdt->callRunneable($mMessage); } $this->oForm->_declareValidationError($sAbsName, "STANDARD:required", $this->oForm->_getLLLabel($mMessage)); break; } } /*********************************************************************** * * /authentified * ***********************************************************************/ if ($sKey[0] === "a" && t3lib_div::isFirstPartOfStr($sKey, "authentified")) { if (!$this->_isAuthentified()) { $message = $this->oForm->_getLLLabel($this->_navConf("/" . $sKey . "/message/")); $this->oForm->_declareValidationError($sAbsName, "STANDARD:authentified", $message); break; } } /*********************************************************************** * * /maxsize * ***********************************************************************/ if ($sKey[0] === "m" && t3lib_div::isFirstPartOfStr($sKey, "maxsize")) { $iMaxSize = intval($this->_navConf("/" . $sKey . "/value/")); if ($this->_isTooLong($mValue, $iMaxSize)) { $message = $this->oForm->_getLLLabel($this->_navConf("/" . $sKey . "/message/")); $this->oForm->_declareValidationError($sAbsName, "STANDARD:maxsize", $message, $mValue); break; } } /*********************************************************************** * * /minsize * ***********************************************************************/ if ($sKey[0] === "m" && t3lib_div::isFirstPartOfStr($sKey, "minsize")) { $iMinSize = intval($this->_navConf("/" . $sKey . "/value/")); if ($this->_isTooSmall($mValue, $iMinSize)) { $message = $this->oForm->_getLLLabel($this->_navConf("/" . $sKey . "/message/")); $this->oForm->_declareValidationError($sAbsName, "STANDARD:minsize", $message, $mValue); break; } } /*********************************************************************** * * /size * ***********************************************************************/ if ($sKey[0] === "s" && t3lib_div::isFirstPartOfStr($sKey, "size")) { $iSize = intval($this->_navConf("/" . $sKey . "/value/")); if (!$this->_sizeIs($mValue, $iSize)) { $message = $this->oForm->_getLLLabel($this->_navConf("/" . $sKey . "/message/")); $this->oForm->_declareValidationError($sAbsName, "STANDARD:size", $message, $mValue); break; } } /*********************************************************************** * * /sameas * ***********************************************************************/ if ($sKey[0] === "s" && t3lib_div::isFirstPartOfStr($sKey, "sameas")) { $sameas = trim($this->_navConf("/" . $sKey . "/value/")); if (array_key_exists($sameas, $this->oForm->aORenderlets)) { $samevalue = $this->oForm->aORenderlets[$sameas]->getValue(); if (!$this->_isSameAs($mValue, $samevalue)) { $message = $this->oForm->_getLLLabel($this->_navConf("/" . $sKey . "/message/")); $this->oForm->_declareValidationError($sAbsName, "STANDARD:sameas", $message, $samevalue); break; } } } /*********************************************************************** * * /email * ***********************************************************************/ if ($sKey[0] === "e" && t3lib_div::isFirstPartOfStr($sKey, "email")) { if (!$this->_isEmail($mValue)) { $message = $this->oForm->_getLLLabel($this->_navConf("/" . $sKey . "/message/")); $this->oForm->_declareValidationError($sAbsName, "STANDARD:email", $message, $mValue); break; } } /*********************************************************************** * * /userobj * @deprecated; use custom instead * ***********************************************************************/ if ($sKey[0] === "u" && t3lib_div::isFirstPartOfStr($sKey, "userobj")) { $this->oForm->mayday("[" . $oRdt->getName() . "] <b>/validator:STANDARD/userobj is deprecated.</b> Use /validator:STANDARD/custom instead."); } /*********************************************************************** * * /unique * ***********************************************************************/ if ($sKey[0] === "u" && t3lib_div::isFirstPartOfStr($sKey, "unique")) { // field value has to be unique in the database // checking this if (!$this->_isUnique($oRdt, $mValue)) { $this->oForm->_declareValidationError($sAbsName, "STANDARD:unique", $this->oForm->_getLLLabel($this->_navConf("/" . $sKey . "/message/")), $mValue); break; } } /*********************************************************************** * * /custom * ***********************************************************************/ if ($sKey[0] === "c" && t3lib_div::isFirstPartOfStr($sKey, "custom")) { $mCustom = $this->_navconf("/" . $sKey); if (tx_ameosformidable::isRunneable($mCustom)) { if ($this->oForm->isUserObj($mCustom)) { $mResult = $this->oForm->_callUserObj($mCustom, array("value" => $mValue)); } else { $mResult = $this->oForm->callRunneable($mCustom, $mValue); } if ($mResult !== TRUE) { if (is_string($mResult)) { $message = $this->oForm->_getLLLabel($mResult); } else { $message = $this->oForm->_getLLLabel($this->_navConf("/" . $sKey . "/message/")); } $this->oForm->_declareValidationError($sAbsName, "STANDARD:custom", $message, $mValue); break; } } } } }
function getFileTypeDesc() { $sFileTypeDesc = "LLL:EXT:ameos_formidable/api/base/rdt_swfupload/res/locallang.xml:filetypedesc.allfiles"; if (($mFileTypeDesc = $this->_navConf("/filetypedesc")) !== FALSE) { if (tx_ameosformidable::isRunneable($mFileTypeDesc)) { $mFileTypeDesc = $this->callRunneable($mFileTypeDesc); } $sFileTypeDesc = $mFileTypeDesc; } return $this->oForm->_getLLLabel($sFileTypeDesc); }
function _getAddInputParamsArray() { $aAddParams = parent::_getAddInputParamsArray(); if (($mUseMap = $this->_navConf("/usemap")) !== FALSE) { if (tx_ameosformidable::isRunneable($mUseMap)) { $mUseMap = $this->callRunneable($mUseMap); } if ($mUseMap !== FALSE) { $aAddParams[] = " usemap=\"" . $mUseMap . "\" "; } } if (($mAlt = $this->_navConf("/alt")) !== FALSE) { if (tx_ameosformidable::isRunneable($mAlt)) { $mAlt = $this->callRunneable($mAlt); } if ($mAlt !== FALSE) { $aAddParams[] = " alt=\"" . $mAlt . "\" "; } } reset($aAddParams); return $aAddParams; }
function generateFlexigridJson() { $aJson = array(); if (($sTitle = $this->_navConf('/flexigridconfiguration/title')) !== FALSE) { $aJson[] = 'title : "' . $this->oForm->getLLLabel($sTitle) . '"'; } if (($sWidth = $this->_navConf('/flexigridconfiguration/width')) !== FALSE) { $aJson[] = 'width : "' . $sWidth . '"'; } if (($sHeight = $this->_navConf('/flexigridconfiguration/height')) !== FALSE) { $aJson[] = 'height : "' . $sHeight . '"'; } if ($this->defaultFalse('/flexigridconfiguration/showtabletogglebtn')) { $aJson[] = 'showTableToggleBtn : true'; } if ($this->defaultTrue('/flexigridconfiguration/striped') === FALSE) { $aJson[] = 'striped : false'; } if ($this->defaultTrue('/flexigridconfiguration/userp') === FALSE) { $aJson[] = 'useRp : false'; } if ($this->defaultTrue('/flexigridconfiguration/resizable') === FALSE) { $aJson[] = 'resizable : false'; } if ($this->aLimitAndSort["rowsperpage"] > 0) { $aJson[] = 'rp : ' . $this->aLimitAndSort["rowsperpage"] . ''; } if (($sRpoptions = $this->_navConf('/flexigridconfiguration/rpoptions')) !== FALSE) { $aJson[] = 'rpOptions : ' . $sRpoptions . ''; } if ($this->defaultFalse('/flexigridconfiguration/usepager')) { $aJson[] = 'usepager : true'; } if (($sPagestat = $this->_navConf('/flexigridconfiguration/pagestat')) !== FALSE) { $aJson[] = 'pagestat : "' . $this->oForm->getLLLabel($sPagestat) . '"'; } if (($sPagetext = $this->_navConf('/flexigridconfiguration/pagetext')) !== FALSE) { $aJson[] = 'pagetext : "' . $this->oForm->getLLLabel($sPagetext) . '"'; } if (($sOutof = $this->_navConf('/flexigridconfiguration/outof')) !== FALSE) { $aJson[] = 'outof : "' . $this->oForm->getLLLabel($sOutof) . '"'; } if (($sMinwidth = $this->_navConf('/flexigridconfiguration/minwidth')) !== FALSE) { $aJson[] = 'minwidth : "' . $sMinwidth . '"'; } if (($sMinheight = $this->_navConf('/flexigridconfiguration/minheight')) !== FALSE) { $aJson[] = 'minheight : "' . $sMinheight . '"'; } if (!empty($this->aLimitAndSort["sortby"])) { $aJson[] = 'sortname : "' . $this->aLimitAndSort["sortby"] . '"'; } if (!empty($this->aLimitAndSort["sortdir"])) { $aJson[] = 'sortorder : "' . $this->aLimitAndSort["sortdir"] . '"'; } if (($mEmpty = $this->_navConf("/ifempty")) !== FALSE) { if (is_array($mEmpty)) { if ($this->oForm->_navConf("/message", $mEmpty) !== FALSE) { if (tx_ameosformidable::isRunneable($mEmpty["message"])) { $sMessage = $this->callRunneable($mEmpty["message"]); } else { $sMessage = $mEmpty["message"]; } $sMessage = $this->oForm->_substLLLInHtml($sMessage); $aJson[] = 'nomsg : "' . $sMessage . '"'; } } else { $aJson[] = 'nomsg : "' . $this->oForm->_getLLLabel($mEmpty) . '"'; } } if (($aButtons = $this->_navConf('/flexigridconfiguration/buttons')) !== FALSE) { $aJsonButtons = array(); foreach ($aButtons as $sKey => $aButton) { if ($sKey[0] == 'b' && $sKey[1] == 'u' && substr($sKey, 0, 6) === 'button') { // show button ? if (!isset($aButton['visible'])) { $mVisible = TRUE; } else { if (tx_ameosformidable::isRunneable($aButton['visible'])) { $mVisible = $this->callRunneable($aButton['visible']); } else { $mVisible = strtolower($aButton['visible']) === 'true'; } } if ($mVisible === TRUE) { $aJsonButton = array(); $aJsonButton[] = 'name : "' . $this->oForm->getLLLabel($aButton['label']) . '"'; $aJsonButton[] = 'bclass : "' . $aButton['class'] . '"'; $aJsonButton[] = 'onpress : function(){' . $this->synthetizeAjaxEventCb('onclick', $aButton['exec'], FALSE, FALSE) . '}'; $aJsonButtons[] = '{' . implode(',', $aJsonButton) . '}'; } } } if (!empty($aJsonButtons)) { $aJson[] = 'buttons : [' . implode(',', $aJsonButtons) . ']'; } } if ($this->isAdvanceFlexgridLister()) { $aColsJson = array(); foreach ($this->aOColumns as $sColname => $oColumn) { $aColJson = array(); if ($sColname == 'selectrow') { $sCheck = $this->bAllRowsSelected === TRUE ? 'checked=\'checked\'' : ''; $aColJson[] = 'display: "<input type=\'checkbox\' name=\'' . $this->_getElementHtmlName() . '[selectall]\' class=\'formidable-selectall\' id=\'' . $this->_getElementHtmlId() . '.selectall\' value=\'1\' ' . $sCheck . '/>"'; } else { $aColJson[] = 'display: "' . $this->getListHeader($sColname) . '"'; } $aColJson[] = 'name: "' . $sColname . '"'; if (($sWidth = $oColumn->_navConf('/width')) !== FALSE) { $aColJson[] = 'width: "' . $sWidth . '"'; } elseif ($sColname == 'selectrow') { $aColJson[] = 'width: "40"'; } if (($sSortable = $oColumn->_navConf('/sortable')) !== FALSE) { $aColJson[] = 'sortable: ' . $sSortable; } elseif ($sColname == 'selectrow') { $aColJson[] = 'sortable: false'; } if ($oColumn->defaultFalse('/hide') !== FALSE) { $aColJson[] = 'hide: true'; } if (($sAlign = $oColumn->_navConf('/align')) !== FALSE) { $aColJson[] = 'align: "' . $sAlign . '"'; } $aColsJson[] = '{' . implode(',', $aColJson) . '}'; } $aJson[] = 'colModel : [' . implode(',', $aColsJson) . ']'; $aJson[] = 'url: "' . $this->sGridurl . '"'; $aJson[] = 'dataType: "xml"'; } $aJson[] = 'onSuccess : function() { Formidable.f("' . $this->oForm->formid . '").o("' . $this->_getElementHtmlIdWithoutFormId() . '").initSelectrow(); }'; return '{' . implode(',', $aJson) . '}'; }
function _wrapItem($sHtml) { if (($mWrap = $this->_navConf("/wrapitem")) !== FALSE) { if (tx_ameosformidable::isRunneable($mWrap)) { $mWrap = $this->callRunneable($mWrap); } $sHtml = str_replace("|", $sHtml, $mWrap); } return $sHtml; }
function &_getRowsSubpart($sTemplate) { $aRowsTmpl = array(); if (($sAltRows = $this->_navConf("/template/alternaterows")) !== FALSE && tx_ameosformidable::isRunneable($sAltRows)) { $sAltList = $this->callRunneable($sAltRows); } elseif (($sAltList = $this->_navConf("/template/alternaterows")) === FALSE) { $this->oForm->mayday("RENDERLET TICKER <b>" . $this->_getName() . "</b> requires /template/alternaterows to be properly set. Please check your XML configuration"); } $aAltList = t3lib_div::trimExplode(",", $sAltList); if (sizeof($aAltList) > 0) { $sRowsPart = t3lib_parsehtml::getSubpart($sTemplate, "###ROWS###"); reset($aAltList); while (list(, $sAltSubpart) = each($aAltList)) { $aRowsTmpl[] = t3lib_parsehtml::getSubpart($sRowsPart, $sAltSubpart); } } return $aRowsTmpl; }
function _render() { $sHtml = tx_ameosformidable::isRunneable($this->aElement["html"]) ? $this->callRunneable($this->aElement["html"]) : $this->_navConf("/html"); $sHtml = $this->oForm->_substLLLInHtml($sHtml); $sMode = $this->_navConf("/mode"); if ($sMode === FALSE) { $sMode = "div"; } else { $sMode = strtolower(trim($sMode)); if ($sMode === "") { $sMode = "div"; } elseif ($sMode === "none" || $sMode === "inline") { $sMode = "inline"; } } if ($this->hasData()) { $sValue = $this->getValue(); if (!$this->_emptyFormValue($sValue) && $this->hasData() && !$this->hasValue()) { $sHtml = $this->getValueForHtml($sValue); } $sName = $this->_getElementHtmlName(); $sId = $this->_getElementHtmlId() . "_value"; $sHidden = "<input type=\"hidden\" name=\"" . $sName . "\" id=\"" . $sId . "\" value=\"" . $this->getValueForHtml($sValue) . "\" />"; } elseif ($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) . "\" />"; #$sHidden .= "<input type=\"hidden\" name=\"" . $this->oForm->formid . "[_databridge][" . base64_encode($this->_getElementHtmlIdWithoutFormId()) . "]\" value=\"" . base64_encode($this->oDataSource->getName()) . "\" />"; #debug($sHidden2, "hidden2"); } if ($sMode !== "inline") { $sBegin = "<" . $sMode . " id='" . $this->_getElementHtmlId() . "' " . $this->_getAddInputParams() . ">"; $sEnd = "</" . $sMode . ">" . $sHidden; } else { $sBegin = "<!--BEGIN:BOX:inline:" . $this->_getElementHtmlId() . "-->"; $sEnd = "<!--END:BOX:inline:" . $this->_getElementHtmlId() . "-->"; } $aChilds = $this->renderChildsBag(); $sCompiledChilds = ''; if (!empty($aChilds)) { $sCompiledChilds = $this->renderChildsCompiled($aChilds); } // allowed because of $bCustomIncludeScript = TRUE $this->includeScripts(array("hasdata" => $this->hasData())); if (($mDraggable = $this->_navConf("/draggable")) !== FALSE) { $aConf = array(); if (is_array($mDraggable)) { if ($this->defaultTrue("/draggable/use") === TRUE) { $bDraggable = TRUE; $aConf["revert"] = $this->defaultFalse("/draggable/revert"); if (($sHandle = $this->_navConf("/draggable/handle")) !== FALSE) { $aConf["handle"] = $this->oForm->aORenderlets[$sHandle]->_getElementHtmlId(); } if (($sConstraint = $this->_navConf("/draggable/constraint")) !== FALSE) { $aConf["constraint"] = strtolower($sConstraint); } } } else { $bDraggable = TRUE; } if ($bDraggable === TRUE) { $sHtmlId = $this->_getElementHtmlId(); $sJson = $this->oForm->array2json($aConf); /* $sScript = ' new Draggable("' . $sHtmlId . '", ' . $sJson . '); '; */ $sScript = 'Formidable.draggable("#' . $sHtmlId . '", ' . $sJson . ');'; $this->oForm->attachInitTask($sScript); } } if (($mDroppable = $this->_navConf("/droppable")) !== FALSE) { $aConf = array(); if (is_array($mDroppable)) { if ($this->defaultTrue("/droppable/use") === TRUE) { $bDroppable = TRUE; if (($sAccept = $this->_navConf("/droppable/accept")) !== FALSE) { //$aConf["accept"] = t3lib_div::trimExplode(",", $sAccept); $aConf["accept"] = $sAccept; } if (($sContainment = $this->_navConf("/droppable/containment")) !== FALSE) { $aConf["containment"] = t3lib_div::trimExplode($sContainment); reset($aConf["containment"]); while (list($iKey, ) = each($aConf["containment"])) { $aConf["containment"][$iKey] = $this->oForm->aORenderlets[$aConf["containment"][$iKey]]->_getElementHtmlId(); } } if (($sHoverClass = $this->_navConf("/droppable/hoverclass")) !== FALSE) { $aConf["hoverclass"] = $sHoverClass; } if (($sOverlap = $this->_navConf("/droppable/overlap")) !== FALSE) { $aConf["overlap"] = $sOverlap; } if (($bGreedy = $this->defaultFalse("/droppable/greedy")) !== FALSE) { $aConf["greedy"] = $bGreedy; } } } else { $bDroppable = TRUE; } if ($bDroppable === TRUE) { $aTemp = array(); $sHtmlId = $this->_getElementHtmlId(); if (array_key_exists("ondragdrop", $this->aCustomEvents)) { $sJs = implode("\n", $this->aCustomEvents["ondragdrop"]); $sRandKey = md5(rand()); $aTemp["###" . $sRandKey . "###"] = "function() {" . $sJs . "}"; $aConf["onDrop"] = "###" . $sRandKey . "###"; } if (array_key_exists("ondraghover", $this->aCustomEvents)) { $sJs = implode("\n", $this->aCustomEvents["ondraghover"]); $sRandKey = md5(rand()); $aTemp["###" . $sRandKey . "###"] = "function() {" . $sJs . "}"; $aConf["onHover"] = "###" . $sRandKey . "###"; } $sJson = $this->oForm->array2json($aConf); reset($aTemp); while (list($sKey, ) = each($aTemp)) { $sJson = str_replace('"' . $sKey . '"', $aTemp[$sKey], $sJson); } /* $sScript = ' Droppables.add("' . $sHtmlId . '", ' . $sJson . '); '; */ $sScript = 'Formidable.droppable("#' . $sHtmlId . '", ' . $sJson . ');'; $this->oForm->attachInitTask($sScript); } } //debug($this->aCustomEvents); $aHtmlBag = array("__compiled" => $this->_displayLabel($sLabel) . $sBegin . $sHtml . $sCompiledChilds . $sEnd, "html" => $sHtml, "box." => array("begin" => $sBegin, "end" => $sEnd, "mode" => $sMode), "childs" => $aChilds); return $aHtmlBag; }
function _getTimeFormat() { $bTime = $this->oForm->defaultFalse("/data/datetime/displaytime/", $this->aElement); if (!$bTime) { return ''; } $mFormat = $this->_navConf("/data/datetime/timeformat/"); if (tx_ameosformidable::isRunneable($mFormat)) { $mFormat = $this->callRunneable($mFormat); } if (!$mFormat) { $mFormat = "%H/%M"; } return $mFormat; }