function _includeFormidablePath() { $sPath = t3lib_div::getIndpEnv('TYPO3_SITE_URL') . t3lib_extmgm::siteRelPath("ameos_formidable"); $sScript = <<<JAVASCRIPT \tFormidable.initialize({path: '{$sPath}'}); JAVASCRIPT; $this->oForm->attachInitTask($sScript, "Framework Formidable.path initialization"); }
/** * Init Function: here all the needed configuration values are stored in class variables.. * * @param array $conf : configuration array from TS * @return void */ function init($conf) { $this->conf = $conf; $this->pi_setPiVarDefaults(); $this->pi_loadLL(); $this->pi_USER_INT_obj = 1; // Configuring so caching is not expected. This value means that no cHash params are ever set. We do this, because it's a USER_INT object! //Get Eventcontainer-PID -- Set actual page if no container is specified $this->eventFolder = explode(',', $this->cObj->data['pages']); // if there is no startingpoint, use the current page as eventfolder: if (!intval($this->eventFolder[0])) { $this->eventFolder[0] = $GLOBALS['TSFE']->id; } $this->eventFolderSQLPart = ' AND (ev.pid=' . $this->eventFolder[0] . ''; if (count($this->eventFolder > 1)) { for ($i = 1; $i < count($this->eventFolder); $i++) { $this->eventFolderSQLPart .= ' OR ev.pid=' . $this->eventFolder[$i] . ''; } } $this->eventFolderSQLPart .= ')'; // startingpointRecursiveLevel: $this->startingpointRecursiveLevel = $this->cObj->data['recursive']; // Path to extension: $this->extPath = t3lib_extmgm::extPath($this->extKey); $this->extRelPath = t3lib_extmgm::siteRelPath($this->extKey); //Set Vars $content = ""; $this->img_pfad = 'uploads/tx_kbeventboard/'; $this->yesterday = mktime(0, 0, 0, date("m"), date("d") - 1, date("Y")); $this->today = time(); $this->aktUserGroup = $GLOBALS['TSFE']->fe_user->groupData[uid]; if (empty($this->aktUserGroup)) { $this->aktUserGroup = array(0 => '0'); } $this->spanindex = 0; // get data from Flexform: $this->pi_initPIflexForm(); // loading template: $templateflex_file = $this->pi_getFFvalue($this->cObj->data['pi_flexform'], 'template_file', 's_template'); if ($this->pi_getFFvalue($this->cObj->data['pi_flexform'], 'template_file', 's_template') != "" && strchr($templateflex_file, 'fileadmin')) { $templateflex_file = explode("fileadmin", $templateflex_file); $templateflex_file = "fileadmin" . $templateflex_file[1]; } else { $templateflex_file = 'EXT:kb_eventboard/template.tmpl'; } $this->tmpl = $this->cObj->fileResource($templateflex_file); // some vars: $this->sel_categories = array_unique(explode(',', $this->pi_getFFvalue($this->cObj->data['pi_flexform'], 'sel_categories', 's_template'))); $this->step = $this->pi_getFFvalue($this->cObj->data['pi_flexform'], 'step', 's_template') ? $this->pi_getFFvalue($this->cObj->data['pi_flexform'], 'step', 's_template') : $this->conf["step"]; $this->csseven = $this->pi_getFFvalue($this->cObj->data['pi_flexform'], 'csseven', 's_template'); $this->cssodd = $this->pi_getFFvalue($this->cObj->data['pi_flexform'], 'cssodd', 's_template'); $this->showmode = $this->piVars['showmode'] ? $this->piVars['showmode'] : $this->pi_getFFvalue($this->cObj->data['pi_flexform'], 'showmode', 's_template'); $this->showLocation = $this->pi_getFFvalue($this->cObj->data['pi_flexform'], 'show_location', 's_template'); $this->allevents = $this->pi_getFFvalue($this->cObj->data['pi_flexform'], 'allevents', 's_template'); $this->showMorelink = $this->pi_getFFvalue($this->cObj->data['pi_flexform'], 'show_morelink', 's_template'); $this->showTitleLink = $this->pi_getFFvalue($this->cObj->data['pi_flexform'], 'showTitleLink', 's_template'); $this->morelinkId = $this->pi_getFFvalue($this->cObj->data['pi_flexform'], 'morelink', 's_template'); $this->eventid = $this->piVars['evt'] ? $this->piVars['evt'] : t3lib_div::_GET('evt'); $this->eventid = intval($this->eventid); $this->ascDesc = $this->pi_getFFvalue($this->cObj->data['pi_flexform'], 'ascDesc', 's_template') ? ' DESC' : ' ASC'; $this->include_css = $this->pi_getFFvalue($this->cObj->data['pi_flexform'], 'include_css', 's_template'); $this->showImages = $this->pi_getFFvalue($this->cObj->data['pi_flexform'], 'showImages', 's_template'); $this->showAllImages = $this->pi_getFFvalue($this->cObj->data['pi_flexform'], 'showAllImages', 's_template'); }
/** * tx_dam::file_relativeSitePath() */ public function test_file_relativeSitePath() { $GLOBALS['T3_VAR']['ext']['dam']['pathInfoCache'] = array(); $filepath = $this->getFixtureFilename(); $filename = tx_dam::file_basename($filepath); $testpath = tx_dam::file_dirname($filepath); $relPath = t3lib_extmgm::siteRelPath('dam') . 'tests/fixtures/' . $filename; $path = tx_dam::path_makeClean($testpath); $path = tx_dam::path_makeRelative($path); $path = tx_dam::file_relativeSitePath($path . $filename); self::assertEquals($path, $relPath, 'File path differs: ' . $path . ' (' . $relPath . ')'); $filepath = $this->getFixtureFilename(); $fileinfo = tx_dam::file_compileInfo($filepath, $ignoreExistence = false); $path = tx_dam::file_relativeSitePath($fileinfo); self::assertEquals($path, $relPath, 'File path differs: ' . $path . ' (' . $relPath . ')'); }
/** * Displays a full debug of : * - the XML conf * - the collection of declared DataHandlers * - the collection of declared Renderers * - the collection of declared Renderlets * - the collection of declared Validators * * Can be called by the parent Extension, or by FORMidable itselves, if the XML conf sets /formidable/meta/debug/ to TRUE * * @param [type] $bExpand: ... * @return void * @see tx_ameosformidable::mayday(), tx_ameosformidable::_render() */ function debug($bExpand = FALSE) { // $this->oJs->_includeThisFormDebugFuncs(); $aHtml = array(); $aHtml[] = "<a name = '" . $this->formid . "formidable_debugtop' />"; if ($bExpand === FALSE) { $aHtml[] = "<a href = 'javascript:void(Formidable.f(\"" . $this->formid . "\").toggleDebug())'><img src='" . t3lib_div::getIndpEnv("TYPO3_SITE_URL") . t3lib_extmgm::siteRelPath("ameos_formidable") . "/res/images/debug.gif' border='0' alt='Toggle FORMidable::debug()' title='Toggle FORMidable::debug()'></a>"; $aHtml[] = "<div id = '" . $this->formid . "_debugzone' style = 'font-family: Verdana; display: none; background-color: #bed1f4; padding-left: 10px; padding-top: 3px; padding-bottom: 10px;font-size: 9px;'>"; } else { $aHtml[] = "<img src='" . t3lib_div::getIndpEnv("TYPO3_SITE_URL") . t3lib_extmgm::siteRelPath("ameos_formidable") . "/res/images/debug.gif' border='0' alt='Toggle FORMidable::debug()' title='Toggle FORMidable::debug()'>"; $aHtml[] = "<div id = '" . $this->formid . "_debugzone' style = 'font-family: Verdana; display: block; background-color: #bed1f4; padding-left: 10px; padding-top: 3px; padding-bottom: 10px;font-size: 9px;'>"; } $aHtml[] = "<h4>FORMidable debug()</h4>"; $aHtml[] = "<h5>t3lib_div::_POST()</h5>"; $aHtml[] = t3lib_div::view_array(t3lib_div::_POST()); $aHtml[] = "<h5>t3lib_div::_GET()</h5>"; $aHtml[] = t3lib_div::view_array(t3lib_div::_GET()); /*$aHtml[] = "<ul>"; $aHtml[] = "<li><a href = 'http://typo3.org/documentation/document-library/ameos_formidable/' target = '_blank'>FORMidable user documentation</a></li>"; $aHtml[] = "</ul>";*/ $aHtml[] = "<br>"; $aHtml[] = "<ul>"; if (!is_null($this->_xmlPath)) { // conf passed by php array ( // typoscript ) $aHtml[] = "<li><a href = '#" . $this->formid . "formidable_xmlpath' target = '_self'>XML Path</a></li>"; } $aHtml[] = "<li><a href = '#" . $this->formid . "formidable_configuration' target = '_self'>FORM configuration</a></li>"; $aHtml[] = "<li><a href = '#" . $this->formid . "formidable_callstack' target = '_self'>Call stack</a></li>"; // $aHtml[] = "<li><a href = '#" . $this->formid . "formidable_objects' target = '_self'>Available DataHandlers, Renderers, Renderlets, Validators and Actionlets</a></li>"; $aHtml[] = "</ul>"; if (!is_null($this->_xmlPath)) { $aHtml[] = "<a name = '" . $this->formid . "formidable_xmlpath' />"; $aHtml[] = "<h5>XML Path</h5>"; $aHtml[] = $this->_xmlPath; $aHtml[] = "<p align = 'right'><a href = '#" . $this->formid . "formidable_debugtop' target = '_self'>^top^</a></p>"; $aHtml[] = "<a name = '" . $this->formid . "formidable_xmlfile' />"; } $aHtml[] = "<a name = '" . $this->formid . "formidable_configuration' />"; $aHtml[] = "<h5>FORM configuration</h5>"; $aHtml[] = "<div WIDTH = '100%' style = 'HEIGHT: 400px; overflow: scroll'>" . t3lib_div::view_array($this->_aConf) . "</div>"; $aHtml[] = "<p align = 'right'><a href = '#" . $this->formid . "formidable_debugtop' target = '_self'>^top^</a></p>"; $aHtml[] = "<a name = '" . $this->formid . "formidable_callstack' />"; $aHtml[] = "<h5>Call stack</h5>"; $aHtml[] = implode("<hr>", $this->aDebug); $aHtml[] = "<p align = 'right'><a href = '#" . $this->formid . "formidable_debugtop' target = '_self'>^top^</a></p>"; $aHtml[] = "</div>"; return implode("\n", $aHtml); }