/** * getRequestContentAddItemFieldsPictureDetails( ) : * * @return string $pictureDetails : XML tag with the picture details * @access private * @version 1.0.0 * @since 0.0.3 */ private function getRequestContentAddItemFieldsPictureDetails() { global $TCA; $pictureDetails = null; // uploadfolder $table = $this->pObj->getDatamapTable(); $tcaColumn = $this->getTcaConfFields('pictures'); $uploadFolder = $TCA[$table]['columns'][$tcaColumn]['config']['uploadfolder']; $urlToPicture = TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('TYPO3_SITE_URL') . $uploadFolder . '/'; // #i0015, 141012, dwildt, 1+ $urlToPicture = str_replace('https://', 'http://', $urlToPicture); // var_dump(__METHOD__, __LINE__, $tcaColumn, $pictures, $uploadFolder, $GLOBALS['TYPO3_SITE_URL'], // TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('TYPO3_SITE_URL'), $url); $csvPictures = trim($this->getDatamapValueByTcaConfField('pictures'), ','); $arrPictures = explode(',', $csvPictures); $pictureUrl = null; foreach ($arrPictures as $picture) { $pictureUrl = $pictureUrl . ' <PictureURL>' . $urlToPicture . $picture . '</PictureURL>' . PHP_EOL; } if (empty($pictureUrl)) { return; } $pictureDetails = ' <PictureDetails> ' . $pictureUrl . ' </PictureDetails>'; return $pictureDetails; }
/** * Generate the website conf report * * @return string HTML code */ public static function displayWebsitesConf() { $items = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('uid, title', 'pages', 'is_siteroot = 1 AND deleted = 0 AND hidden = 0 AND pid != -1', '', '', '', 'uid'); $websiteconf = array(); if (!empty($items)) { foreach ($items as $itemKey => $itemValue) { $websiteconfItem = array(); $domainRecords = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('uid, pid, domainName', 'sys_domain', 'pid IN(' . $itemValue['uid'] . ') AND hidden=0', '', 'sorting'); $websiteconfItem['pid'] = $itemValue['uid']; $websiteconfItem['pagetitle'] = tx_additionalreports_util::getIconPage() . $itemValue['title']; $websiteconfItem['domains'] = ''; $websiteconfItem['template'] = ''; foreach ($domainRecords as $domain) { $websiteconfItem['domains'] .= tx_additionalreports_util::getIconDomain() . $domain['domainName'] . '<br/>'; } $templates = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('uid,title,root', 'sys_template', 'pid IN(' . $itemValue['uid'] . ') AND deleted=0 AND hidden=0', '', 'sorting'); foreach ($templates as $templateObj) { $websiteconfItem['template'] .= '<img src="' . TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('TYPO3_REQUEST_DIR'); $websiteconfItem['template'] .= 'sysext/t3skin/icons/gfx/i/template.gif"/> ' . $templateObj['title'] . ' '; $websiteconfItem['template'] .= '[uid=' . $templateObj['uid'] . ',root=' . $templateObj['root'] . ']<br/>'; } // baseurl $tmpl = TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\TypoScript\\ExtendedTemplateService'); $tmpl->tt_track = 0; $tmpl->init(); $tmpl->runThroughTemplates(tx_additionalreports_util::getRootLine($itemValue['uid']), 0); $tmpl->generateConfig(); $websiteconfItem['baseurl'] = $tmpl->setup['config.']['baseURL']; // count pages $list = tx_additionalreports_util::getTreeList($itemValue['uid'], 99, 0, '1=1'); $listArray = explode(',', $list); $websiteconfItem['pages'] = count($listArray) - 1; $websiteconfItem['pageshidden'] = tx_additionalreports_util::getCountPagesUids($list, 'hidden=1'); $websiteconfItem['pagesnosearch'] = tx_additionalreports_util::getCountPagesUids($list, 'no_search=1'); $websiteconf[] = $websiteconfItem; } } $view = TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Fluid\\View\\StandaloneView'); $view->setTemplatePathAndFilename(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('additional_reports') . 'Resources/Private/Templates/websiteconf-fluid.html'); $view->assign('items', $websiteconf); return $view->render(); }
public function indexAction() { // assign contents to the view $this->view->assign('contentId', $this->ceData['uid']); // assign width and height of map if (0 < (int) $this->settings['cbgmMapWidth']) { $width = $this->settings['cbgmMapWidth']; } else { $width = $this->settings['display']['width']; } $this->view->assign('width', $width); if (0 < (int) $this->settings['cbgmMapHeight']) { $height = $this->settings['cbgmMapHeight']; } else { $height = $this->settings['display']['height']; } $this->view->assign('height', $height); // assign pin description text $infoText = $this->settings['cbgmDescription']; $this->view->assign('infoText', urlencode($infoText)); // assign icon if given by constant and/or typoscript if (!empty($this->settings['display']['icon']) && file_exists(PATH_site . $this->settings['display']['icon'])) { $this->view->assign('icon', TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('TYPO3_REQUEST_HOST') . '/' . $this->settings['display']['icon']); } else { $this->view->assign('icon', null); } // assign deactivation of zooming by mousewheel $this->view->assign('useScrollwheel', $this->settings['options']['useScrollwheel'] ? 'true' : 'false'); // assign location (longitude and latitude) to the view $this->view->assign('latitude', (double) $this->settings['cbgmLatitude']); $this->view->assign('longitude', (double) $this->settings['cbgmLongitude']); // assign map zoom level to the view ,if given value is valid if (0 <= (int) $this->settings['cbgmScaleLevel'] && !empty($this->settings['cbgmScaleLevel'])) { $mapZoom = (int) $this->settings['cbgmScaleLevel']; } else { $mapZoom = $this->settings['display']['zoom']; } $this->view->assign('mapZoom', $mapZoom); // assign map type to the view, if given value is valid if (in_array((string) $this->settings['cbgmMapType'], preg_split("/[\\s]*[,][\\s]*/", $this->settings['valid']['mapTypes']))) { $mapType = $this->settings['cbgmMapType']; } else { $mapType = $this->settings['display']['mapType']; } $this->view->assign('mapType', $mapType); // assign navigation controls to the view if (in_array((string) $this->settings['cbgmNavigationControl'], preg_split("/[\\s]*[,][\\s]*/", $this->settings['valid']['navigationControl']))) { $navigationControl = $this->settings['cbgmNavigationControl']; } else { $navigationControl = $this->settings['display']['navigationControl']; } $this->view->assign('mapControl', $navigationControl); // assign map styling, if given $this->view->assign('mapStyling', null); if (!empty($this->settings['display']['mapStyling']) && file_exists(PATH_site . $this->settings['display']['mapStyling'])) { $styling = file_get_contents(PATH_site . $this->settings['display']['mapStyling']); if (!is_null(json_decode($styling))) { $this->view->assign('mapStyling', $styling); } } else { if (!empty($this->settings['display']['mapStyling']) && !is_null(json_decode($this->settings['display']['mapStyling']))) { $this->view->assign('mapStyling', $this->settings['display']['mapStyling']); } } $this->view->assign('braceStart', '{'); $this->view->assign('braceEnd', '}'); // assign auto open flag to the view $this->view->assign('openInfoBox', $this->settings['cbgmAutoOpen'] ? true : false); }
/** * creates the searchbox * 1. fills the marker for marker based templating and renders the searchbox * 2. fills fluid variables for fluid based templating to $this->fluidTemplateVariables * * @return string rendered searchbox (for static or ajax templating, not for fluid templating) */ public function getSearchboxContent() { // get main template code $content = $this->cObj->getSubpart($this->templateCode, '###SEARCHBOX_STATIC###'); // set page = 1 if not set yet or if we are in static mode if (!$this->piVars['page'] || $this->conf['renderMethod'] == 'static' || $this->conf['renderMethod'] == "fluidtemplate") { $pageValue = 1; } else { $pageValue = $this->piVars['page']; } $content = $this->cObj->substituteMarker($content, '###HIDDEN_PAGE_VALUE###', $pageValue); $this->fluidTemplateVariables['page'] = $pageValue; // submit $content = $this->cObj->substituteMarker($content, '###SUBMIT_VALUE###', $this->pi_getLL('submit')); $this->fluidTemplateVariables['submitAltText'] = $this->pi_getLL('submit'); // searchword input value $searchString = $this->piVars['sword']; if (!empty($searchString) && $searchString != $this->pi_getLL('searchbox_default_value')) { $this->swordValue = $searchString; $searchboxFocusJS = ''; $searchboxBlurJS = ''; } else { $this->swordValue = $this->pi_getLL('searchbox_default_value'); // set javascript for resetting searchbox value $searchboxFocusJS = 'searchboxFocus(this);'; $searchboxBlurJS = 'searchboxBlur(this);'; } $content = $this->cObj->substituteMarker($content, '###SWORD_VALUE###', htmlspecialchars($this->swordValue)); $this->fluidTemplateVariables['searchword'] = htmlspecialchars($this->swordValue); $content = $this->cObj->substituteMarker($content, '###SEARCHBOX_DEFAULT_VALUE###', htmlspecialchars($this->pi_getLL('searchbox_default_value'))); $this->fluidTemplateVariables['searchwordDefault'] = htmlspecialchars($this->pi_getLL('searchbox_default_value')); $content = $this->cObj->substituteMarker($content, '###SWORD_ONFOCUS###', $searchboxFocusJS); $content = $this->cObj->substituteMarker($content, '###SWORD_ONBLUR###', $searchboxBlurJS); $content = $this->cObj->substituteMarker($content, '###SORTBYFIELD###', $this->piVars['sortByField']); $this->fluidTemplateVariables['sortByField'] = $this->piVars['sortByField']; $content = $this->cObj->substituteMarker($content, '###SORTBYDIR###', $this->piVars['sortByDir']); $this->fluidTemplateVariables['sortByDir'] = $this->piVars['sortByDir']; // set onsubmit action if ($this->conf['renderMethod'] != 'static') { $onSubmitMarker = 'onsubmit="document.getElementById(\'pagenumber\').value=1;"'; } else { $onSubmitMarker = ''; } $content = $this->cObj->substituteMarker($content, '###ONSUBMIT###', $onSubmitMarker); // get filters $renderedFilters = $this->renderFilters(); $content = $this->cObj->substituteMarker($content, '###FILTER###', $renderedFilters); $this->fluidTemplateVariables['filter'] = $renderedFilters; // set form action pid $content = $this->cObj->substituteMarker($content, '###FORM_TARGET_PID###', $this->conf['resultPage']); $this->fluidTemplateVariables['targetpage'] = $this->conf['resultPage']; // set form action $siteUrl = TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('TYPO3_SITE_URL'); $lParam = TYPO3\CMS\Core\Utility\GeneralUtility::_GET('L'); $mpParam = TYPO3\CMS\Core\Utility\GeneralUtility::_GET('MP'); $typeParam = TYPO3\CMS\Core\Utility\GeneralUtility::_GP('type'); $actionUrl = $siteUrl . 'index.php'; $content = $this->cObj->substituteMarker($content, '###FORM_ACTION###', $actionUrl); $this->fluidTemplateVariables['actionUrl'] = $actionUrl; // set other hidden fields $hiddenFieldsContent = ''; // language parameter if (isset($lParam)) { $hiddenFieldValue = intval($lParam); $hiddenFieldsContent .= '<input type="hidden" name="L" value="' . $hiddenFieldValue . '" />'; $this->fluidTemplateVariables['lparam'] = $hiddenFieldValue; } // mountpoint parameter if (isset($mpParam)) { // the only allowed characters in the MP parameter are digits and , and - $hiddenFieldValue = preg_replace('/[^0-9,-]/', '', $mpParam); $hiddenFieldsContent .= '<input type="hidden" name="MP" value="' . $hiddenFieldValue . '" />'; $this->fluidTemplateVariables['mpparam'] = $hiddenFieldValue; } $content = $this->cObj->substituteMarker($content, '###HIDDENFIELDS###', $hiddenFieldsContent); // type param if ($typeParam) { $hiddenFieldValue = intval($typeParam); $typeContent = $this->cObj->getSubpart($this->templateCode, '###SUB_PAGETYPE###'); $typeContent = $this->cObj->substituteMarker($typeContent, '###PAGETYPE###', $typeParam); $this->fluidTemplateVariables['typeparam'] = $hiddenFieldValue; } else { $typeContent = ''; } $content = $this->cObj->substituteSubpart($content, '###SUB_PAGETYPE###', $typeContent, $recursive = 1); // add submit button in static mode if ($this->conf['renderMethod'] == 'static') { $submitButton = '<input type="submit" value="' . $this->pi_getLL('submit') . '" />'; } else { $submitButton = ''; } $content = $this->cObj->substituteMarker($content, '###SUBMIT###', $submitButton); // set reset link unset($linkconf); $linkconf['parameter'] = $this->conf['resultPage']; $resetUrl = $this->cObj->typoLink_URL($linkconf); $this->fluidTemplateVariables['resetUrl'] = $resetUrl; $resetLink = '<a href="' . $resetUrl . '" class="resetButton"><span>' . $this->pi_getLL('reset_button') . '</span></a>'; $content = $this->cObj->substituteMarker($content, '###RESET###', $resetLink); // init onDomReadyAction $this->initDomReadyAction(); return $content; }