Project

General

Profile

Feature #10817 » v2.patch

Tolleiv Nietsch, 2010-11-16 20:02

View differences:

Classes/Controller/ReviewController.php (working copy)
protected function initializeAction() {
parent::initializeAction();
if (tx_Workspaces_Service_Workspaces::isOldStyleWorkspaceUsed()) {
$message = t3lib_div::makeInstance(
't3lib_FlashMessage',
$GLOBALS['LANG']->sL('LLL:EXT:workspaces/Resources/Private/Language/locallang.xml:warning.oldStyleWorkspaceInUser'),
'',
t3lib_FlashMessage::WARNING
);
t3lib_FlashMessageQueue::addMessage($message);
}
$this->pageRenderer->loadExtJS();
$this->pageRenderer->enableExtJSQuickTips();
$this->pageRenderer->enableExtJsDebug();
Classes/Service/Workspaces.php (working copy)
}
return $permittedElements;
}
/**
* Trivial check to see if the user already migrated his workspaces
* to the new style (either manually or with the migrator scripts)
*
* @return bool
*/
public static function isOldStyleWorkspaceUsed() {
$oldStyleWorkspaceIsUsed = FALSE;
$cacheKey = 'workspace-oldstyleworkspace-notused';
$cacheResult = $GLOBALS['BE_USER']->getSessionData($cacheKey);
if (!$cacheResult) {
$where = 'adminusers != "" AND adminusers NOT LIKE "%be_users%" AND adminusers NOT LIKE "%be_groups%" AND deleted=0';
$count = $GLOBALS['TYPO3_DB']->exec_SELECTcountRows('uid', 'sys_workspace', $where);
$oldStyleWorkspaceIsUsed = $count > 0;
$GLOBALS['BE_USER']->setAndSaveSessionData($cacheKey, !$oldStyleWorkspaceIsUsed);
} else {
$oldStyleWorkspaceIsUsed = !$cacheResult;
}
return $oldStyleWorkspaceIsUsed;
}
}
Classes/ViewHelpers/TempFlashMessageQueueViewHelper.php (revision 0)
<?php
/* *
* This script belongs to the FLOW3 package "Fluid". *
* *
* It is free software; you can redistribute it and/or modify it under *
* the terms of the GNU Lesser General Public License as published by the *
* Free Software Foundation, either version 3 of the License, or (at your *
* option) any later version. *
* *
* This script is distributed in the hope that it will be useful, but *
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- *
* TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser *
* General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with the script. *
* If not, see http://www.gnu.org/licenses/lgpl.html *
* *
* The TYPO3 project - inspiring people to share! *
* */
/**
* View helper which renders the FlashMessageQueu
*
* = Examples =
*
* <code title="Minimal">
* <f:be.flashMessageQueue />
* </code>
*
* Output:
* All FlashMessages which were registered using t3lib_FlashMessageQueue::addMessage($message);
*
* @author Tolleiv Nietsch <info@tolleiv.de>
* @license http://www.gnu.org/copyleft/gpl.html
* @version SVN: $Id:
*
*/
/**
* ViewHelper to integrate the backend FlashMessageQueue into our module
*
* @todo Remove this viewHelper once http://forge.typo3.org/issues/10821 is available
*/
class Tx_Workspaces_ViewHelpers_TempFlashMessageQueueViewHelper extends Tx_Fluid_ViewHelpers_Be_AbstractBackendViewHelper {
/**
* Renders a shortcut button as known from the TYPO3 backend
*
* @return string the rendered flashMessage
* @see template::makeShortcutIcon()
*/
public function render() {
$renderedMessages = '';
$flashMessages = t3lib_FlashMessageQueue::renderFlashMessages();
if (!empty($flashMessages)) {
$renderedMessages = '<div id="typo3-messages">' . $flashMessages . '</div>';
}
return $renderedMessages;
}
}
?>
Resources/Private/Language/locallang.xml (working copy)
<label index="window.sendToNextStageWindow.additionalRecipients">Additional recipients</label>
<label index="window.sendToNextStageWindow.comments">Comments</label>
<label index="error.getStageTitle.stageNotFound">Stage not found</label>
<label index="warning.oldStyleWorkspaceInUser">It seems that you're stil using old-style workspace. If you continue using this module without migrating your workspace you might loose data.</label>
</languageKey>
</data>
</T3locallang>
Resources/Private/Layouts/module.html (working copy)
{namespace this=Tx_Workspaces_ViewHelpers}
<!-- ###FULLDOC### begin -->
<div class="typo3-fullDoc">
<!-- Page header with buttons, path details and csh -->
......
<!-- Content of module, for instance listing, info or editing -->
<div id="typo3-docbody">
<div id="typo3-inner-docbody">
<this:TempFlashMessageQueue />
<f:render partial="navigation" arguments="{workspaceList: workspaceList, activeWorkspaceUid: activeWorkspaceUid, showAllWorkspaceTab:showAllWorkspaceTab}" />
<div class="typo3-dyntabmenu-divs"><f:render section="main" /></div>
<f:if condition="{showLegend}"><f:render partial="legend" /></f:if>
(2-2/2)