/** * @todo Variable Locations aus den Orten, dazu tt_address ergänzen * * @param \Mittwald\MmEvents\Domain\Model\Location $address * @return string $content HTML code */ public function render($address) { $postalcode = urlencode('90403'); $street = urlencode('Ludwigsplatz 12'); $city = urlencode('Nürnberg'); $content2 = '<iframe width="600" height="400" src="http://nominatim.openstreetmap.org/search.php?street=' . $street . '&postalcode=' . $postalcode . '&city=' . $city . '&addressdetails=1&dedupe=1&viewbox=9.69%2C52.37%2C9.76%2C52.34"></iframe>'; $path = str_replace('../', '/', \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('mm_events') . 'Resources/Public/OpenLayers/lib/OpenLayers.js'); $content = '<div class="" id="demoMap" style="height:350px;background-color: #FFFFFF;border: 1px solid #DDDDDD;border-radius: 4px 4px 4px 4px;line-height: 1.42857;max-width: 100%;padding: 4px;transition: all 0.2s ease-in-out 0s;"></div> <script src="' . $path . '"></script> <script> var lon = 11.07075; var lat = 49.45060; var zoom = 18; var map, layer; map = new OpenLayers.Map("demoMap"); map.addLayer(new OpenLayers.Layer.OSM()); // map.addControl(new OpenLayers.Control.PanZoomBar()); // OpenLayers.ImgPath = "/resources/external/images/ol/"; // map.zoomToMaxExtent(); map.setCenter( new OpenLayers.LonLat(lon, lat).transform( new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject() ), zoom ); </script>'; return $content; }
public function init() { $ico = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('mydashboard') . 'widgets/icon/tx_mydashboard_serverinfo.png'; $this->setIcon($ico); $this->setTitle('Server Info'); return true; }
/** * Hook function for the user settings module * * @param array $PA * @param \TYPO3\CMS\Setup\Controller\SetupModuleController $fsobj * @return string */ public function getBackendSetting(&$PA, &$fsobj) { /** @var \TYPO3\CMS\Core\Page\PageRenderer $pageRenderer */ $pageRenderer = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Page\PageRenderer::class); $pageRenderer->addJsFile(ExtensionManagementUtility::extRelPath('authenticator') . '/Resources/Public/JavaScript/qrcode.js'); return $this->createImageAndText($GLOBALS['BE_USER']); }
/** * Calls addJsFile for each file in the given folder on the Instance of TYPO3\CMS\Core\Page\PageRenderer. * * @param string $name the file to include * @param string $extKey the extension, where the file is located * @param string $pathInsideExt the path to the file relative to the ext-folder * @param bool $recursive */ public function render($name = null, $extKey = null, $pathInsideExt = 'Resources/Public/JavaScript/', $recursive = false) { if ($extKey == null) { $extKey = $this->controllerContext->getRequest()->getControllerExtensionKey(); } $extPath = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($extKey); if (TYPO3_MODE === 'FE') { $extRelPath = substr($extPath, strlen(PATH_site)); } else { $extRelPath = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath($extKey); } $absFolderPath = $extPath . $pathInsideExt . $name; // $files will include all files relative to $pathInsideExt if ($recursive === false) { $files = \TYPO3\CMS\Core\Utility\GeneralUtility::getFilesInDir($absFolderPath); foreach ($files as $hash => $filename) { $files[$hash] = $name . $filename; } } else { $files = \TYPO3\CMS\Core\Utility\GeneralUtility::getAllFilesAndFoldersInPath([], $absFolderPath, '', 0, 99, '\\.svn'); foreach ($files as $hash => $absPath) { $files[$hash] = str_replace($extPath . $pathInsideExt, '', $absPath); } } foreach ($files as $name) { $this->pageRenderer->addJsFile($extRelPath . $pathInsideExt . $name); } }
public function initializeAction() { $this->targetGroupRepository = $this->objectManager->get('MUM\\BjrFreizeit\\Domain\\Repository\\TargetGroupRepository'); $css = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath($this->request->getControllerExtensionKey()) . 'Resources/Public/Css/bjrfreizeitfeadmin.css'; /** */ $GLOBALS['TSFE']->getPageRenderer()->addCssFile($css); }
function proc($wizardItems) { $languageService = $this->getLanguageService(); $localLang = $this->getLocalLang(); $wizardItems['plugins_tx_irfaq_pi1'] = array('icon' => ExtensionManagementUtility::extRelPath('irfaq') . 'res/ce_wiz.gif', 'title' => $languageService->getLLL('pi1_title_irfaq', $localLang), 'description' => $languageService->getLLL('pi1_plus_wiz_description_irfaq', $localLang), 'params' => '&defVals[tt_content][CType]=list&defVals[tt_content][list_type]=irfaq_pi1'); return $wizardItems; }
/** * Initialize editor * * Initializes the module. * Done in this function because we may need to re-initialize if data is submitted! * * @param int $pageId * @param int $template_uid * @return bool */ public function initialize_editor($pageId, $template_uid = 0) { $templateService = GeneralUtility::makeInstance(ExtendedTemplateService::class); $GLOBALS['tmpl'] = $templateService; // Do not log time-performance information $templateService->tt_track = false; $templateService->init(); $templateService->ext_localGfxPrefix = ExtensionManagementUtility::extPath('tstemplate'); $templateService->ext_localWebGfxPrefix = ExtensionManagementUtility::extRelPath('tstemplate') . 'Resources/Public/'; // Get the row of the first VISIBLE template of the page. whereclause like the frontend. $GLOBALS['tplRow'] = $templateService->ext_getFirstTemplate($pageId, $template_uid); // IF there was a template... if (is_array($GLOBALS['tplRow'])) { // Gets the rootLine $sys_page = GeneralUtility::makeInstance(PageRepository::class); $rootLine = $sys_page->getRootLine($pageId); // This generates the constants/config + hierarchy info for the template. $templateService->runThroughTemplates($rootLine, $template_uid); // The editable constants are returned in an array. $GLOBALS['theConstants'] = $templateService->generateConfig_constants(); // The returned constants are sorted in categories, that goes into the $tmpl->categories array $templateService->ext_categorizeEditableConstants($GLOBALS['theConstants']); // This array will contain key=[expanded constant name], value=line number in template. (after edit_divider, if any) $templateService->ext_regObjectPositions($GLOBALS['tplRow']['constants']); return true; } return false; }
public function initializeAction() { //parent::initializeAction(); // TODO: Change the autogenerated stub $css = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath($this->request->getControllerExtensionKey()) . 'Resources/Public/Css/bjrfreizeitfeadmin.css'; /** */ $GLOBALS['TSFE']->getPageRenderer()->addCssFile($css); }
/** * Initialize editor * * @param integer $pageId * @param integer $template_uid * @return integer * @todo Define visibility */ public function initialize_editor($pageId, $template_uid = 0) { // Initializes the module. Done in this function because we may need to re-initialize if data is submitted! global $tmpl, $tplRow, $theConstants; $tmpl = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\TypoScript\\ExtendedTemplateService'); // Defined global here! $tmpl->tt_track = 0; // Do not log time-performance information $tmpl->init(); $tmpl->ext_localGfxPrefix = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('tstemplate'); $tmpl->ext_localWebGfxPrefix = $GLOBALS['BACK_PATH'] . \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('tstemplate') . 'Resources/Public/'; // Get the row of the first VISIBLE template of the page. whereclause like the frontend. $tplRow = $tmpl->ext_getFirstTemplate($pageId, $template_uid); // IF there was a template... if (is_array($tplRow)) { // Gets the rootLine $sys_page = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Frontend\\Page\\PageRepository'); $rootLine = $sys_page->getRootLine($pageId); // This generates the constants/config + hierarchy info for the template. $tmpl->runThroughTemplates($rootLine, $template_uid); // The editable constants are returned in an array. $theConstants = $tmpl->generateConfig_constants(); // The returned constants are sorted in categories, that goes into the $tmpl->categories array $tmpl->ext_categorizeEditableConstants($theConstants); // This array will contain key=[expanded constantname], value=linenumber in template. (after edit_divider, if any) $tmpl->ext_regObjectPositions($tplRow['constants']); return 1; } }
/** * Main function, adding the item to input menuItems array * * @param ClickMenu $backRef References to parent clickmenu objects. * @param array $menuItems Array of existing menu items accumulated. New element added to this. * @param string $table Table name of the element * @param int $uid Record UID of the element * @return array Modified menuItems array */ public function main(&$backRef, $menuItems, $table, $uid) { $localItems = array(); if (!$backRef->cmLevel && $uid > 0 && $GLOBALS['BE_USER']->check('modules', 'web_txversionM1')) { // Returns directly, because the clicked item was not from the pages table if (in_array('versioning', $backRef->disabledItems) || !$GLOBALS['TCA'][$table] || !$GLOBALS['TCA'][$table]['ctrl']['versioningWS']) { return $menuItems; } // Adds the regular item $LL = $this->includeLL(); // "Versioning" element added: $url = \TYPO3\CMS\Backend\Utility\BackendUtility::getModuleUrl('web_txversionM1', array('table' => $table, 'uid' => $uid)); $localItems[] = $backRef->linkItem($GLOBALS['LANG']->getLLL('title', $LL), $backRef->excludeIcon('<img src="' . $backRef->backPath . \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('version') . 'Resources/Public/Icons/module-version.png" width="15" height="12" border="0" align="top" alt="" />'), $backRef->urlRefForCM($url), TRUE); // Find position of "delete" element: $c = 0; foreach ($menuItems as $k => $value) { $c++; if ($k === 'delete') { break; } } // .. subtract two (delete item + divider line) $c -= 2; // ... and insert the items just before the delete element. array_splice($menuItems, $c, 0, $localItems); } return $menuItems; }
/** * Add an entry to the CacheMenuItems array * * @param array $cacheActions Array of CacheMenuItems * @param array $optionValues Array of AccessConfigurations-identifiers (typically used by userTS with options.clearCache.identifier) */ public function manipulateCacheActions(&$cacheActions, &$optionValues) { $title = LocalizationUtility::translate('cache_action.title', 'cs_clear_images'); $icon = '<img ' . IconUtility::skinImg($GLOBALS['BACK_PATH'], ExtensionManagementUtility::extRelPath('cs_clear_images') . 'Resources/Public/Images/clear_cache_icon.png', 'width="16" height="16"') . ' alt="" title="' . $title . '"/>'; // Clearing of processed images $cacheActions[] = array('id' => 'tx_csclearimages', 'title' => $title, 'href' => $this->backPath . 'tce_db.php?vC=' . $GLOBALS['BE_USER']->veriCode() . '&cacheCmd=tx_csclearimages&ajaxCall=1' . \TYPO3\CMS\Backend\Utility\BackendUtility::getUrlToken('tceAction'), 'icon' => $icon); }
/** * Build up the HDNET contact Info Box * * @return string */ protected function autoloaderTest() { $icon = ExtensionManagementUtility::extRelPath('autoloader') . 'ext_icon.png'; $box = '<div id="t3-login-news-outer" class="t3-login-box"> <div class="t3-headline"> <h2 style="background: url(' . $icon . ') no-repeat scroll 10px center transparent;">Contact</h2> </div> <div class="t3-login-box-body"> <dl id="t3-login-news" style="margin-top: 0;"> <!-- ###NEWS_ITEM### begin --> <div class="t3-login-news-item first-item"> <dl> <dt> <span class="t3-news-date"></span> <span class="t3-news-title">Autoloader</span> </dt> <dd> This is the Autoloader Test </dd> </dl> </div> <!-- ###NEWS_ITEM### end --> </dl> </div> </div> <div class="t3-login-box-border-bottom"></div>'; return $box; }
/** * action index * * @return void */ public function indexAction() { $this->extKey = 'twitterbox'; $this->pluginKey = 'twitterbox'; $this->extPath = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($this->extKey); $this->extRelPath = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath($this->extKey); $this->config = $this->loadConfig(); $this->view->assign('config', $this->config); $headerData = array(); if ($this->config['includeCSS']) { $headerData[] = '<link rel="stylesheet" type="text/css" href="' . $this->extRelPath . 'Resources/Public/Css/' . $this->pluginKey . '.css" />'; } $GLOBALS['TSFE']->additionalHeaderData['tx_' . $this->extKey . '_' . $this->pluginKey] = implode('', $headerData); if ($this->config['templateDir'] !== false) { $this->view->setTemplateRootPath($this->config['templateDir']); } $tweets = array(); if ($this->config['consumerKey'] !== false && $this->config['consumerSecret']) { $tokenUrl = "https://api.twitter.com/oauth2/token"; $auth = base64_encode(urlencode($this->config['consumerKey']) . ':' . urlencode($this->config['consumerSecret'])); try { $getTokenCH = curl_init(); curl_setopt($getTokenCH, CURLOPT_URL, $tokenUrl); curl_setopt($getTokenCH, CURLOPT_POST, 1); curl_setopt($getTokenCH, CURLOPT_HTTPHEADER, array('Authorization: Basic ' . $auth)); curl_setopt($getTokenCH, CURLOPT_POSTFIELDS, "grant_type=client_credentials"); curl_setopt($getTokenCH, CURLOPT_RETURNTRANSFER, 1); $token = json_decode(curl_exec($getTokenCH)); curl_close($getTokenCH); if (isset($token->errors)) { throw new \Exception('Error ' . $token->errors[0]->code . ': ' . $token->errors[0]->message); } $token = $token->access_token; if ($this->settings['mode'] == 'user') { $quest = 'https://api.twitter.com/1.1/statuses/user_timeline.json?screen_name=' . urlencode($this->settings['filter']); } else { $quest = 'https://api.twitter.com/1.1/search/tweets.json?q=' . urlencode($this->settings['filter']) . '&result_type=recent'; } $quest .= '&count=' . $this->config['numTweets']; $questCH = curl_init(); curl_setopt($questCH, CURLOPT_URL, $quest); curl_setopt($questCH, CURLOPT_RETURNTRANSFER, 1); curl_setopt($questCH, CURLOPT_HTTPHEADER, array('Authorization: Bearer ' . $token)); $result = json_decode(curl_exec($questCH)); curl_close($questCH); if (isset($result->errors)) { throw new \Exception('Error ' . $token->errors[0]->code . ': ' . $token->errors[0]->message); } if (isset($result->statuses)) { $tweets = $result->statuses; } else { $tweets = $result; } } catch (\Exception $e) { echo $e->getMessage(); } } $this->view->assign('heading', array('mode' => $this->settings['mode'], 'filter' => $this->settings['filter'])); $this->view->assign('tweets', $tweets); }
/** * Index action shows install tool / step installer or redirect to action to enable install tool * * @param ServerRequestInterface $request * @param ResponseInterface $response * @return ResponseInterface */ public function index(ServerRequestInterface $request, ResponseInterface $response) { /** @var EnableFileService $enableFileService */ $enableFileService = GeneralUtility::makeInstance(EnableFileService::class); /** @var AbstractFormProtection $formProtection */ $formProtection = FormProtectionFactory::get(); if ($enableFileService->checkInstallToolEnableFile()) { // Install tool is open and valid, redirect to it $response = $response->withStatus(303)->withHeader('Location', 'sysext/install/Start/Install.php?install[context]=backend'); } elseif ($request->getMethod() === 'POST' && $request->getParsedBody()['action'] === 'enableInstallTool') { // Request to open the install tool $installToolEnableToken = $request->getParsedBody()['installToolEnableToken']; if (!$formProtection->validateToken($installToolEnableToken, 'installTool')) { throw new \RuntimeException('Given form token was not valid', 1369161225); } $enableFileService->createInstallToolEnableFile(); // Install tool is open and valid, redirect to it $response = $response->withStatus(303)->withHeader('Location', 'sysext/install/Start/Install.php?install[context]=backend'); } else { // Show the "create enable install tool" button /** @var StandaloneView $view */ $view = GeneralUtility::makeInstance(StandaloneView::class); $view->setTemplatePathAndFilename(GeneralUtility::getFileAbsFileName('EXT:install/Resources/Private/Templates/BackendModule/ShowEnableInstallToolButton.html', false)); $token = $formProtection->generateToken('installTool'); $view->assign('installToolEnableToken', $token); /** @var ModuleTemplate $moduleTemplate */ $moduleTemplate = GeneralUtility::makeInstance(ModuleTemplate::class); $pageRenderer = $moduleTemplate->getPageRenderer(); $pageRenderer->addCssFile(ExtensionManagementUtility::extRelPath('install') . 'Resources/Public/Css/BackendModule/ShowEnableInstallToolButton.css'); $moduleTemplate->setContent($view->render()); $response->getBody()->write($moduleTemplate->renderContent()); } return $response; }
/** * Processing the wizard items array * * @param array $wizardItems: The wizard items * @return Modified array with wizard items */ function proc($wizardItems) { global $LANG; $LL = $this->includeLocalLang(); $wizardItems['plugins_tx_test_pi2'] = array('icon' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('gorillary') . 'pi2/wizicon.png', 'title' => $LANG->getLLL('pi2_title', $LL), 'description' => $LANG->getLLL('pi2_plus_wiz_description', $LL), 'params' => '&defVals[tt_content][CType]=list&defVals[tt_content][list_type]=gorillary_pi2'); return $wizardItems; }
/** * Processing the wizard items array * * @param array $wizardItems: The wizard items * @return Modified array with wizard items */ public function proc($wizardItems) { global $LANG; $LL = $this->includeLocalLang(); $wizardItems['plugins_tx_rgsmoothgallery_pi1'] = array('icon' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('rgsmoothgallery') . 'pi1/ce_wiz.gif', 'title' => $LANG->getLLL('pi1_title', $LL), 'description' => $LANG->getLLL('pi1_plus_wiz_description', $LL), 'params' => '&defVals[tt_content][CType]=list&defVals[tt_content][list_type]=rgsmoothgallery_pi1'); return $wizardItems; }
public function init($PA, $fobj) { $GLOBALS['LANG']->includeLLFile(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('cal') . 'Resources/Private/Language/locallang_db.xml'); $this->frequency = $PA['row']['freq']; if (\TYPO3\CMS\Core\Utility\VersionNumberUtility::convertVersionNumberToInteger(TYPO3_version) >= 7005000) { $this->frequency = $PA['row']['freq'][0]; } $this->uid = $PA['row']['uid']; $this->row = $PA['row']; $this->table = $PA['table']; $this->rdateType = $this->row['rdate_type']; $this->rdate = $this->row['rdate']; $this->rdateValues = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $this->row['rdate'], 1); if (\TYPO3\CMS\Core\Utility\VersionNumberUtility::convertVersionNumberToInteger(TYPO3_version) >= 7004000) { $this->garbageIcon = '<span class="t3-icon fa t3-icon fa fa-trash"> </span>'; $this->newIcon = '<span title="' . $GLOBALS['LANG']->getLL('tx_cal_event.add_recurrence') . '" class="t3-icon fa t3-icon fa fa-plus-square"> </span>'; } else { $this->garbageIcon = '<img' . \TYPO3\CMS\Backend\Utility\IconUtility::skinImg($GLOBALS['BACK_PATH'], 'gfx/garbage.gif') . ' title="' . $GLOBALS['LANG']->getLL('tx_cal_event.remove_recurrence') . '" alt="' . $GLOBALS['LANG']->getLL('tx_cal_event.delete_recurrence') . '" />'; $this->newIcon = '<img' . \TYPO3\CMS\Backend\Utility\IconUtility::skinImg($GLOBALS['BACK_PATH'], 'gfx/new_el.gif') . ' title="' . $GLOBALS['LANG']->getLL('tx_cal_event.add_recurrence') . '" alt="' . $GLOBALS['LANG']->getLL('tx_cal_event.add_recurrence') . '" />'; } $this->commonJS = ''; if (\TYPO3\CMS\Core\Utility\VersionNumberUtility::convertVersionNumberToInteger(TYPO3_version) >= 7004000) { $this->commonJS .= '<script src="' . \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('cal') . 'Resources/Public/js/recurui2.js" type="text/javascript"></script>' . chr(10) . '<script src="' . \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('cal') . 'Resources/Public/js/url2.js" type="text/javascript"></script>'; } else { $this->commonJS .= '<script src="' . \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('cal') . 'Resources/Public/js/recurui.js" type="text/javascript"></script>' . chr(10) . '<script src="' . \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('cal') . 'Resources/Public/js/url.js" type="text/javascript"></script>'; } $this->everyMonthText = $GLOBALS['LANG']->getLL('tx_cal_event.recurs_every_month'); $this->selectedMonthText = $GLOBALS['LANG']->getLL('tx_cal_event.recurs_selected_months'); $this->counts = $this->getCountsArray(); $startDay = $this->getWeekStartDay($PA); $this->weekdays = $this->getWeekDaysArray($startDay); $this->months = $this->getMonthsArray(); }
/** * Returns information about this extension plugin * * @param array $params Parameters to the hook * * @return string Information about pi1 plugin * @hook TYPO3_CONF_VARS|SC_OPTIONS|cms/layout/class.tx_cms_layout.php|list_type_Info|calendarize_calendar */ public function getExtensionSummary(array $params) { if ($params['row']['list_type'] != 'calendarize_calendar') { return ''; } $this->flexFormService = GeneralUtility::makeInstance('HDNET\\Calendarize\\Service\\FlexFormService'); $this->flexFormService->load($params['row']['pi_flexform']); if (!$this->flexFormService->isValid()) { return ''; } $extensionIcon = IconUtility::getByExtensionKey('calendarize', true); $extensionRelPath = ExtensionManagementUtility::extRelPath('calendarize'); $this->layoutService = GeneralUtility::makeInstance('HDNET\\Calendarize\\Service\\ContentElementLayoutService'); $this->layoutService->setTitle('<img src="' . str_replace('EXT:calendarize/', $extensionRelPath, $extensionIcon) . '" width="32" height="32" /> Calendarize'); $actions = $this->flexFormService->get('switchableControllerActions', 'main'); $parts = GeneralUtility::trimExplode(';', $actions, true); $parts = array_map(function ($element) { $split = explode('->', $element); return ucfirst($split[1]); }, $parts); $actionKey = lcfirst(implode('', $parts)); $this->layoutService->addRow(TranslateUtility::get('mode'), TranslateUtility::get('mode.' . $actionKey)); $this->layoutService->addRow(TranslateUtility::get('configuration'), $this->flexFormService->get('settings.configuration', 'main')); if ((bool) $this->flexFormService->get('settings.hidePagination', 'main')) { $this->layoutService->addRow(TranslateUtility::get('hide.pagination.teaser'), '!!!'); } $this->addPageIdsToTable(); return $this->layoutService->render(); }
public function init() { // Check if tt_news is active if (!\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('tt_news')) { return false; } // Init Parent parent::init(); // Build config $config = array('item_limit' => array('default' => 10, 'type' => 'int'), 'sysFolderID' => array('default' => 0, 'type' => 'int')); // Set the Default config $this->setDefaultConfig($config); // Set title & icon $title = 'Latest News'; if ((int) $this->getConfigVar('sysFolderID')) { $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*', 'pages', 'deleted=0 AND hidden=0 AND uid=' . (int) $this->getConfigVar('sysFolderID'), '', '', 1); $row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res); if (sizeof($row['title']) > 0) { $title .= ' - ' . $row['title']; } } # if $this->setTitle($title); $this->setIcon(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('tt_news') . '/ext_icon.gif'); return true; }
/** * Processing the wizard items array * * @param array $wizardItems The wizard items * @return array Modified array with wizard items */ function proc($wizardItems) { global $LANG; $LL = $this->includeLocalLang(); $wizardItems['plugins_caretaker_pi_abstract'] = array('icon' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('caretaker') . 'pi_abstract/ce_wiz.gif', 'title' => $LANG->getLLL('pi_abstract_title', $LL), 'description' => $LANG->getLLL('pi_abstract_plus_wiz_description', $LL), 'params' => '&defVals[tt_content][CType]=list&defVals[tt_content][list_type]=caretaker_pi_abstract'); return $wizardItems; }
/** * This method renders the report * * @return string The status report as HTML */ public function getReport() { $this->setCss(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('additional_reports') . 'Resources/Public/Shadowbox/shadowbox.css'); $this->setJs(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('additional_reports') . 'Resources/Public/Shadowbox/shadowbox.js'); $content = tx_additionalreports_main::displayExtensions(); return $content; }
/** * Initializes the Module * * @return void */ public function initialize() { parent::init(); $this->doc = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Template\\DocumentTemplate'); $this->doc->setModuleTemplate(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('recycler') . 'mod1/mod_template.html'); $this->doc->backPath = $GLOBALS['BACK_PATH']; $this->doc->setExtDirectStateProvider(); $this->pageRenderer = $this->doc->getPageRenderer(); $this->relativePath = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('recycler'); $this->pageRecord = BackendUtility::readPageAccess($this->id, $this->perms_clause); $this->isAccessibleForCurrentUser = $this->id && is_array($this->pageRecord) || !$this->id && $this->isCurrentUserAdmin(); //don't access in workspace if ($GLOBALS['BE_USER']->workspace !== 0) { $this->isAccessibleForCurrentUser = FALSE; } //read configuration $modTS = $GLOBALS['BE_USER']->getTSConfig('mod.recycler'); if ($this->isCurrentUserAdmin()) { $this->allowDelete = TRUE; } else { $this->allowDelete = $modTS['properties']['allowDelete'] == '1'; } if (isset($modTS['properties']['recordsPageLimit']) && (int) $modTS['properties']['recordsPageLimit'] > 0) { $this->recordsPageLimit = (int) $modTS['properties']['recordsPageLimit']; } }
/** * Returns a file path correct value by finding the 'EXT:xxx' values. * * @param string $path The path to the file. * @return string The correct path; */ private function getFileRealPath($path) { if (preg_match('/^EXT:([^\\/]*)\\/(.*)$/', $path, $res)) { $extRelPath = ExtensionManagementUtility::extRelPath($res[1]); $path = str_replace('EXT:' . $res[1] . '/', $extRelPath, $path); } return $path; }
/** * Processing the wizard items array * * @param array $wizardItems : The wizard items * @return Modified array with wizard items */ public function proc($wizardItems) { global $LANG; $LL = $this->includeLocalLang(); $extRelPath = ExtensionManagementUtility::extRelPath('ke_search'); $wizardItems['plugins_tx_kesearch_pi2'] = array('icon' => $extRelPath . 'pi2/ce_wiz.gif', 'title' => $LANG->getLLL('pi_title', $LL), 'description' => $LANG->getLLL('pi_plus_wiz_description', $LL), 'params' => '&defVals[tt_content][CType]=list&defVals[tt_content][list_type]=ke_search_pi2'); return $wizardItems; }
/** * Adds RSA-specific JavaScript * * @param array $configuration * @param \TYPO3\CMS\Backend\Controller\BackendController $backendController * @return void */ public function addRsaJsLibraries(array $configuration, \TYPO3\CMS\Backend\Controller\BackendController $backendController) { $javascriptPath = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('rsaauth') . 'resources/'; $files = array('jsbn/jsbn.js', 'jsbn/prng4.js', 'jsbn/rng.js', 'jsbn/rsa.js', 'jsbn/base64.js'); foreach ($files as $file) { $backendController->getPageRenderer()->addJsLibrary($file, $javascriptPath . $file); } }
/** * wrapper function called by hook (\TYPO3\CMS\Core\Page\PageRenderer->render-preProcess) * * @param array $parameters : An array of available parameters * @param \TYPO3\CMS\Core\Page\PageRenderer $pageRenderer : The parent object that triggered this hook * * @return void */ public function addJSCSS($parameters, &$pageRenderer) { // Add javascript $pageRenderer->loadRequireJsModule('TYPO3/CMS/Themes/ThemesBackendTca'); // Add css $filename = $pageRenderer->backPath . ExtensionManagementUtility::extRelPath('themes') . 'Resources/Public/Stylesheet/ThemesBackendTca.css'; $pageRenderer->addCssFile($filename, 'stylesheet', 'screen'); }
/** * indexer configurations * * Adds the custom indexer to the TCA of indexer configurations, so that * it's selectable in the backend as an indexer type when you create a * new indexer configuration. * * @param array $params * @param type $pObj */ function registerIndexerConfiguration(&$params, $pObj) { // add address indexer item to "type" field $newArray = array('Modern Address', 'hwtaddressindexer', \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('hwt_address') . 'Resources/Public/Icons/tx_hwtaddress_domain_model_address.gif'); $params['items'][] = $newArray; // enable "sysfolder" field $GLOBALS['TCA']['tx_kesearch_indexerconfig']['columns']['sysfolder']['displayCond'] .= ',hwtaddressindexer'; }
function proc($wizardItems) { global $LANG; $LL = $this->includeLocalLang(); for ($i = 1; $i <= 6; $i++) { $wizardItems["plugins_tx_mmforum_pi{$i}"] = array("icon" => ExtensionManagementUtility::extRelPath("mm_forum") . "pi1/ce_wiz.gif", "title" => $LANG->getLLL('pi' . $i . '_title', $LL), "description" => $LANG->getLLL('pi' . $i . '_plus_wiz_description', $LL), "params" => '&defVals[tt_content][CType]=list&defVals[tt_content][list_type]=mm_forum_pi' . $i); } return $wizardItems; }
/** * fe_user-Feld und Passwort-Feld darstellen, damit im Backend das Passwort eines Users geändert werden kann. * Problem: Passwort muss in Tabelle fe_users gespeichert werden, nicht in der Members-Tabelle. * Das Speichern übernimmt per Hook: Nnmembers_Hooks_ProcessDataMapHook * **/ function display_sysfilereference_field($PA, $fobj) { if (!\NNGrad\T3pimper\Utilities\SettingsUtility::isEnabledInConf('falCropping')) { return ''; } $this->doc = $this->objectManager->get('\\TYPO3\\CMS\\Backend\\Template\\MediumDocumentTemplate'); $this->doc->getPageRenderer()->addCssFile(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('t3pimper') . 'Resources/Public/TCA/css/style.css'); $this->doc->getPageRenderer()->addJsFile(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('t3pimper') . 'Resources/Public/TCA/js/jquery.focalpointselect.js'); $this->doc->getPageRenderer()->addJsFile(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('t3pimper') . 'Resources/Public/TCA/js/jquery.imgareaselect.js'); $this->doc->getPageRenderer()->addJsFile(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('t3pimper') . 'Resources/Public/TCA/js/scripts.js'); $table = $PA['table']; $field = $PA['field']; $row = $PA['row']; $selRef = $row[$field]; $fileRepo = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('\\TYPO3\\CMS\\Core\\Resource\\FileRepository'); if (substr($row['uid'], 0, 3) == 'NEW') { } // Hier gibt es sicher einen besseren Weg? $sysFileUid = intval(preg_replace('/[^0-9]/i', '', $row['uid_local'])); if (!$sysFileUid) { return ''; } $sysFileRow = $GLOBALS['TYPO3_DB']->exec_SELECTgetSingleRow('*', 'sys_file', 'uid=' . $sysFileUid); $sysFileStorage = 'fileadmin'; if ($sysFileRow['storage'] > 1) { $tmp = $GLOBALS['TYPO3_DB']->exec_SELECTgetSingleRow('*', 'sys_file_storage', 'uid=' . $sysFileRow['storage']); $sysFileStorage = $tmp['name']; } $filename = $sysFileStorage . $sysFileRow['identifier']; /* // Die eigentlich bessere Art – funktioniert aber nicht bei noch nicht persistierten sys_file_records! $file = $fileRepo->findFileReferenceByUid($row['uid']); $filename = $file->getPublicUrl(); */ $TS = $this->settingsUtility->getTsSetup($row['pid']); if (!($setup = $TS['imgvariants']['presets'])) { return 'Keine Definition in config.t3pimper.imgvariants.presets gefunden.'; } /* $image = $this->imageService->getImage($filename, null, false); $processingInstructions = array( 'maxWidth' => 400, 'maxHeight' => 200, ); $processedImage = $this->imageService->applyProcessingInstructions($image, $processingInstructions); $imageUri = $this->imageService->getImageUri($processedImage); $arr = array(); foreach ($setup as $key => $conf) { $arr[] = $key; } */ $html = $this->anyHelper->renderTemplate('typo3conf/ext/t3pimper/Resources/Private/TCA/Imgvariants.html', array('uniqid' => uniqid(), 'image' => $filename, 'TS' => $TS['imgvariants'], 'value' => $selRef, 'setup' => $setup, 'arr' => $arr, 'data' => $row, 'table' => $table, 'field' => $field, 'PA' => $PA)); return $html; }
/** * Main function * * @param [type] $$backRef: ... * @param [type] $menuItems: ... * @param [type] $table: ... * @param [type] $uid: ... * @return [type] ... */ function main(&$backRef, $menuItems, $table, $uid) { global $BE_USER, $TCA, $LANG; $localItems = array(); if (!$backRef->cmLevel) { // Returns directly, because the clicked item was not from the pages table if ($table == "tx_l10nmgr_cfg") { // Adds the regular item: $LL = $this->includeLL(); // Repeat this (below) for as many items you want to add! // Remember to add entries in the localconf.php file for additional titles. $url = ExtensionManagementUtility::extRelPath("l10nmgr") . "cm1/index.php?id=" . $uid; $localItems[] = $backRef->linkItem($GLOBALS["LANG"]->getLLL("cm1_title", $LL), $backRef->excludeIcon('<img src="' . ExtensionManagementUtility::extRelPath("l10nmgr") . 'cm1/cm_icon.gif" width="15" height="12" border="0" align="top" />'), $backRef->urlRefForCM($url), 1); } $localItems["moreoptions_tx_l10nmgr_cm3"] = $backRef->linkItem('L10Nmgr tools', '', "top.loadTopMenu('" . GeneralUtility::linkThisScript() . "&cmLevel=1&subname=moreoptions_tx_l10nmgrXX_cm3');return false;", 0, 1); // Simply merges the two arrays together and returns ... $menuItems = array_merge($menuItems, $localItems); } elseif (GeneralUtility::_GET('subname') == 'moreoptions_tx_l10nmgrXX_cm3') { $url = ExtensionManagementUtility::extRelPath("l10nmgr") . "cm3/index.php?id=" . $uid . '&table=' . $table; $localItems[] = $backRef->linkItem('Create priority', '', $backRef->urlRefForCM($url . '&cmd=createPriority'), 1); $localItems[] = $backRef->linkItem('Manage priorities', '', $backRef->urlRefForCM($url . '&cmd=managePriorities'), 1); $localItems[] = $backRef->linkItem('Update Index', '', $backRef->urlRefForCM($url . '&cmd=updateIndex'), 1); $localItems[] = $backRef->linkItem('Flush Translations', '', $backRef->urlRefForCM($url . '&cmd=flushTranslations'), 1); $menuItems = array_merge($menuItems, $localItems); } return $menuItems; }