/** * Processes a general request. The result can be returned by altering the given response. * * @param Tx_Extbase_MVC_RequestInterface $request The request object * @param Tx_Extbase_MVC_ResponseInterface $response The response, modified by this handler * @throws Tx_Extbase_MVC_Exception_UnsupportedRequestType if the controller doesn't support the current request type * @return void */ public function processRequest(Tx_Extbase_MVC_RequestInterface $request, Tx_Extbase_MVC_ResponseInterface $response) { $this->template = t3lib_div::makeInstance('template'); $this->pageRenderer = $this->template->getPageRenderer(); $GLOBALS['SOBE'] = new stdClass(); $GLOBALS['SOBE']->doc = $this->template; parent::processRequest($request, $response); $pageHeader = $this->template->startpage($GLOBALS['LANG']->sL('LLL:EXT:smoothmigration/Resources/Private/Language/locallang.xml:module.title')); $pageEnd = $this->template->endPage(); $response->setContent($pageHeader . $response->getContent() . $pageEnd); }
public function __construct() { //makeInstance should not be used, but injection does not work without FE-plugin? $objectManager = t3lib_div::makeInstance( 'Tx_Extbase_Object_ObjectManager' ); $configurationManager = $objectManager->get( 'Tx_Extbase_Configuration_ConfigurationManagerInterface' ); $configuration = $configurationManager->getConfiguration( Tx_Extbase_Configuration_ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK, 'T3Less', '' ); $this->configuration = $configuration; $this->lessfolder = Tx_T3Less_Utility_Utilities::getPath( $this->configuration['files']['pathToLessFiles'] ); $this->outputfolder = Tx_T3Less_Utility_Utilities::getPath( $this->configuration['files']['outputFolder'] ); parent::__construct(); }
/** * Override parent method to render error message for ExtJS (in JSON). * Also append detail about what property failed to error message. * * @author Adrien Crivelli * @return string */ protected function errorAction() { $message = parent::errorAction(); // Append detail of properties if available // Message layout is not optimal, but at least we avoid code duplication foreach ($this->argumentsMappingResults->getErrors() as $error) { if ($error instanceof Tx_Extbase_Validation_PropertyError) { foreach ($error->getErrors() as $subError) { $message .= 'Error: ' . $subError->getMessage() . PHP_EOL; } } } if ($this->view instanceof Tx_Newsletter_MVC_View_JsonView) { $this->view->setVariablesToRender(array('flashMessages', 'error', 'success')); $this->view->assign('flashMessages', $this->controllerContext->getFlashMessageQueue()->getAllMessagesAndFlush()); $this->view->assign('error', $message); $this->view->assign('success', false); } }
/** * Override getErrorFlashMessage to present * nice flash error messages. * * @return string */ protected function getErrorFlashMessage() { $defaultFlashMessage = parent::getErrorFlashMessage(); $locallangKey = sprintf('error.%s.%s', $this->request->getControllerName(), $this->actionMethodName); return $this->translate($locallangKey, $defaultFlashMessage); }
/** * This method is overriden to allow proper assignment of parameters to fake actions. * * Therefore we change the actionMethodName shortly if the called action is a "fake" action * * @return void * @see initializeArguments() */ protected function initializeActionMethodValidators() { if (!is_null($this->useActionName)) { $temp = $this->actionMethodName; $this->actionMethodName = $this->useActionName; } parent::initializeActionMethodValidators(); if (!is_null($this->useActionName)) { $this->actionMethodName = $temp; } }
/** * Initializes the view before invoking an action method. * * Override this method to solve assign variables common for all actions * or prepare the view in another way before the action is called. * * @param Tx_Extbase_View_ViewInterface $view The view to be initialized * * @return void */ protected function initializeView(Tx_Extbase_MVC_View_ViewInterface $view) { parent::initializeView($view); $view->assign('layout', $GLOBALS['TSFE']->type > 0 ? 'Widget' : 'Profile'); }
/** * Initializes the controller before invoking an action method. * * @return void */ protected function initializeAction() { parent::initializeAction(); $this->response->setHeader('Content-type', 'application/json; charset=utf-8'); }
/** * Handles a request. The result output is returned by altering the given response. * * @param Tx_Extbase_MVC_RequestInterface $request The request object * @param Tx_Extbase_MVC_ResponseInterface $response The response, modified by this handler * @return void * @api */ public function processRequest(Tx_Extbase_MVC_RequestInterface $request, Tx_Extbase_MVC_ResponseInterface $response) { $this->widgetConfiguration = $request->getWidgetContext()->getWidgetConfiguration(); parent::processRequest($request, $response); }
/** * Initializes the view before invoking an action method. * * @param Tx_Extbase_View_ViewInterface $view The view to be initialized * @return void * @author Romain Ruetschi <*****@*****.**> */ protected function initializeView(Tx_Extbase_MVC_View_ViewInterface $view) { parent::initializeView($view); $this->view = t3lib_div::makeInstance($this->viewAdapterClassName, $this->view); }