Skip to content
Snippets Groups Projects
Commit 07477c96 authored by Oliver Hader's avatar Oliver Hader Committed by Christian Kuhn
Browse files

[BUGFIX] Enable extenisions with BE modules don't refresh the module list

When installing an extension with BE modules through the new
extension manager, the left frame with modules is not
refreshed. An accordant call to the module menu widget needs
to be triggered in those cases.

Change-Id: Ibead3b1a0da99be300c16ae3237986387294a74f
Releases: 6.0
Fixes: #42009
Reviewed-on: http://review.typo3.org/16129
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
parent f20f134f
No related merge requests found
......@@ -35,6 +35,15 @@ namespace TYPO3\CMS\Extensionmanager\Controller;
*/
class AbstractController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionController {
const TRIGGER_RefreshModuleMenu = 'refreshModuleMenu';
/**
* @var array
*/
protected $triggerArguments = array(
self::TRIGGER_RefreshModuleMenu,
);
/**
* Resolve view and initialize the general view-variables extensionName,
* controllerName and actionName based on the request object
......@@ -61,7 +70,25 @@ class AbstractController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionControl
protected function translate($key, $arguments = NULL) {
return \TYPO3\CMS\Extbase\Utility\LocalizationUtility::translate($key, 'extensionmanager', $arguments);
}
}
/**
* Handles trigger arguments, e.g. refreshing the module menu
* widget if an extension with backend modules has been enabled
* or disabled.
*
* @return void
*/
protected function handleTriggerArguments() {
$triggers = array();
foreach ($this->triggerArguments as $triggerArgument) {
if ($this->request->hasArgument($triggerArgument)) {
$triggers[$triggerArgument] = $this->request->getArgument($triggerArgument);
}
}
$this->view->assign('triggers', $triggers);
}
}
?>
\ No newline at end of file
......@@ -88,7 +88,7 @@ class ActionController extends \TYPO3\CMS\Extensionmanager\Controller\AbstractCo
$this->installUtility->enrichExtensionWithDetails($extension)
);
}
$this->redirect('index', 'List');
$this->redirect('index', 'List', NULL, array(self::TRIGGER_RefreshModuleMenu => TRUE));
}
/**
......
......@@ -94,6 +94,7 @@ class ListController extends \TYPO3\CMS\Extensionmanager\Controller\AbstractCont
$availableAndInstalledExtensions = $this->listUtility->getAvailableAndInstalledExtensions($availableExtensions);
$availableAndInstalledExtensions = $this->listUtility->enrichExtensionsWithEmConfAndTerInformation($availableAndInstalledExtensions);
$this->view->assign('extensions', $availableAndInstalledExtensions);
$this->handleTriggerArguments();
}
/**
......
......@@ -65,11 +65,12 @@ class ContainerViewHelper extends \TYPO3\CMS\Fluid\ViewHelpers\Be\AbstractBacken
* @param boolean $enableExtJsDebug if TRUE, debug version of ExtJS is loaded. Use this for development only
* @param array $addCssFiles Custom CSS files to be loaded
* @param array $addJsFiles Custom JavaScript files to be loaded
* @param array $triggers Defined triggers to be forwarded to client (e.g. refreshing backend widgets)
* @return string
* @see template
* @see t3lib_PageRenderer
*/
public function render($pageTitle = '', $enableJumpToUrl = TRUE, $enableClickMenu = TRUE, $loadPrototype = TRUE, $loadScriptaculous = FALSE, $scriptaculousModule = '', $loadExtJs = FALSE, $loadExtJsTheme = TRUE, $extJsAdapter = '', $enableExtJsDebug = FALSE, $addCssFiles = array(), $addJsFiles = array()) {
public function render($pageTitle = '', $enableJumpToUrl = TRUE, $enableClickMenu = TRUE, $loadPrototype = TRUE, $loadScriptaculous = FALSE, $scriptaculousModule = '', $loadExtJs = FALSE, $loadExtJsTheme = TRUE, $extJsAdapter = '', $enableExtJsDebug = FALSE, $addCssFiles = array(), $addJsFiles = array(), array $triggers = array()) {
$doc = $this->getDocInstance();
$pageRenderer = $doc->getPageRenderer();
if ($enableJumpToUrl) {
......@@ -108,6 +109,13 @@ class ContainerViewHelper extends \TYPO3\CMS\Fluid\ViewHelpers\Be\AbstractBacken
$pageRenderer->addJsFile($addJsFile);
}
}
// Handle triggers
if (!empty($triggers[\TYPO3\CMS\Extensionmanager\Controller\AbstractController::TRIGGER_RefreshModuleMenu])) {
$pageRenderer->addJsInlineCode(
\TYPO3\CMS\Extensionmanager\Controller\AbstractController::TRIGGER_RefreshModuleMenu,
'if (top.TYPO3ModuleMenu.refreshMenu) { top.TYPO3ModuleMenu.refreshMenu(); }'
);
}
$output = $this->renderChildren();
$output = $doc->startPage($pageTitle) . $output;
$output .= $doc->endPage();
......
{namespace em=TYPO3\CMS\Extensionmanager\ViewHelpers}
<em:be.container pageTitle="Extension Manager" enableJumpToUrl="true" enableClickMenu="false" loadPrototype="false" loadScriptaculous="false" loadExtJs="false" loadExtJsTheme="true"
triggers="{triggers}"
addCssFiles="{
0:'{f:uri.resource(path:\'Css/main.css\')}',
1:'{f:uri.resource(path:\'Contrib/LoadMask/jquery.loadmask.css\')}'
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment