Index: t3lib/stddb/tables.sql
===================================================================
--- t3lib/stddb/tables.sql (revision 1740)
+++ t3lib/stddb/tables.sql (working copy)
@@ -49,7 +49,7 @@
ses_hashlock int(11) DEFAULT '0' NOT NULL,
ses_userid int(11) unsigned DEFAULT '0' NOT NULL,
ses_tstamp int(11) unsigned DEFAULT '0' NOT NULL,
- ses_data mediumblob NOT NULL,
+ ses_data longblob NOT NULL,
ses_backuserid int(11) NOT NULL default '0',
PRIMARY KEY (ses_id,ses_name)
);
Index: typo3/mod/user/ws/workspaceforms.php
===================================================================
--- typo3/mod/user/ws/workspaceforms.php (revision 1740)
+++ typo3/mod/user/ws/workspaceforms.php (working copy)
@@ -2,7 +2,7 @@
/***************************************************************
* Copyright notice
*
-* (c) 1999-2005 Dmitry Dulepov (typo3@accio.lv)
+* (c) 1999-2006 Kasper Skaarhoj (kasperYYYY@typo3.com)
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
@@ -645,8 +645,8 @@
}
// Include extension?
-if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/mod/user/ws/class.mod_user_ws_workspaceForms.php']) {
- include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/mod/user/ws/class.mod_user_ws_workspaceforms.php']);
+if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/mod/user/ws/workspaceforms.php']) {
+ include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/mod/user/ws/workspaceForms.php']);
}
// Make instance:
Index: typo3/mod/user/ws/.htaccess
===================================================================
--- typo3/mod/user/ws/.htaccess (revision 0)
+++ typo3/mod/user/ws/.htaccess (revision 0)
@@ -0,0 +1,7 @@
+
+
+ ExpiresActive on
+ ExpiresDefault "access plus 7 days"
+
+ FileETag MTime Size
+
Index: typo3/mod/user/ws/publish.php
===================================================================
--- typo3/mod/user/ws/publish.php (revision 0)
+++ typo3/mod/user/ws/publish.php (revision 0)
@@ -0,0 +1,251 @@
+
+ */
+/**
+ * [CLASS/FUNCTION INDEX of SCRIPT]
+ *
+ */
+
+
+// Initialize module:
+unset($MCONF);
+require('conf.php');
+require($BACK_PATH . 'init.php');
+require($BACK_PATH . 'template.php');
+$BE_USER->modAccess($MCONF, 1);
+
+// Include libraries of various kinds used inside:
+$LANG->includeLLFile('EXT:lang/locallang_mod_user_ws.xml');
+require_once(PATH_t3lib . 'class.t3lib_scbase.php');
+require_once(PATH_typo3 . 'mod/user/ws/class.wslib.php');
+require_once(PATH_t3lib . 'class.t3lib_tcemain.php');
+
+define('MAX_RECORDS_TO_PUBLISH', 30);
+
+class SC_mod_user_ws_publish extends t3lib_SCbase {
+
+ var $isSwap;
+ var $title;
+ var $nextRecordNumber;
+ var $publishData;
+ var $recordCount;
+
+ /**
+ * Initializes the module. See t3lib_SCbase::init()
for more information.
+ *
+ * @return void
+ */
+ function init() {
+ // Setting module configuration:
+ $this->MCONF = $GLOBALS['MCONF'];
+
+ $this->isSwap = t3lib_div::_GP('swap');
+ $this->nextRecordNumber = t3lib_div::_GP('continue_publish');
+
+ // Initialize Document Template object:
+ $this->doc = t3lib_div::makeInstance('mediumDoc');
+ $this->doc->backPath = $GLOBALS['BACK_PATH'];
+ $this->doc->docType = 'xhtml_trans';
+ $this->doc->JScode = '
+ ';
+ $this->doc->inDocStyles = '
+ #progress-block { width: 450px; margin: 50px auto; text-align: center; }
+ H3 { margin-bottom: 20px; }
+ P, IMG { margin-bottom: 20px; }
+ #progress-block A { text-decoration: underline; }
+';
+
+ // Parent initialization:
+ t3lib_SCbase::init();
+ }
+
+ /**
+ * Creates module content.
+ *
+ * @return void
+ */
+ function main() {
+ $this->title = $GLOBALS['LANG']->getLL($this->isSwap ? 'swap_title' : 'publish_title');
+
+ $content = $this->getContent(); // sets body parts to doc!
+
+ $this->content .= $this->doc->startPage($this->title);
+ $this->content .= $content;
+ $this->content .= $this->doc->endPage();
+ }
+
+ /**
+ * Outputs content.
+ *
+ * @return void
+ */
+ function printContent() {
+ echo $this->content;
+ }
+
+ /**
+ * Performs action and generates content.
+ *
+ * @return string Generated content
+ */
+ function getContent() {
+ $content = '';
+ if ($this->nextRecordNumber) {
+ // Prepare limited set of records
+ $this->publishData = $GLOBALS['BE_USER']->getSessionData('workspacePublisher');
+ $this->recordCount = $GLOBALS['BE_USER']->getSessionData('workspacePublisher_count');
+ $limitedCmd = array(); $numRecs = 0;
+ foreach ($this->publishData as $table => $recs) {
+ foreach ($recs as $key => $value) {
+ $numRecs++;
+ $limitedCmd[$table][$key] = $value;
+ //$this->content .= $table.':'.$key.'
';
+ if ($numRecs == MAX_RECORDS_TO_PUBLISH) {
+ break;
+ }
+ }
+ if ($numRecs == MAX_RECORDS_TO_PUBLISH) {
+ break;
+ }
+ }
+
+ if ($numRecs == 0) {
+ // All done
+ $GLOBALS['BE_USER']->setAndSaveSessionData('workspacePublisher', null);
+ $GLOBALS['BE_USER']->setAndSaveSessionData('workspacePublisher_count', 0);
+ $content .= '
';
+ }
+ else {
+ // Execute the commands:
+ $tce = t3lib_div::makeInstance('t3lib_TCEmain');
+ $tce->stripslashes_values = 0;
+ $tce->start(array(), $limitedCmd);
+ $tce->process_cmdmap();
+
+ $errors = $tce->errorLog;
+ if (count($errors) > 0) {
+ $content .= '' . $LANG->getLL('label_errors') . '
' . implode('
',$errors);
+ $content .= '
' . $GLOBALS['LANG']->getLL('return_to_index') . '';
+ }
+ else {
+
+ // Unset processed records
+ foreach ($limitedCmd as $table => $recs) {
+ foreach ($recs as $key => $value) {
+ unset($this->publishData[$table][$key]);
+ }
+ }
+ $GLOBALS['BE_USER']->setAndSaveSessionData('workspacePublisher', $this->publishData);
+ $content .= $this->formatProgressBlock($this->isSwap ? 'swap_status' : 'publish_status');
+ $this->doc->bodyTagAdditions = 'onload="nextPortion(' . ($this->nextRecordNumber + MAX_RECORDS_TO_PUBLISH) . ')"';
+ }
+ }
+ }
+ else {
+ $this->getRecords();
+ if ($this->recordCount > 0) {
+ $GLOBALS['BE_USER']->setAndSaveSessionData('workspacePublisher', $this->publishData);
+ $GLOBALS['BE_USER']->setAndSaveSessionData('workspacePublisher_count', $this->recordCount);
+ $content .= $this->formatProgressBlock($this->isSwap ? 'swap_prepare' : 'publish_prepare');
+ $this->doc->bodyTagAdditions = 'onload="nextPortion(1)"';
+ }
+ else {
+ $this->doc->bodyTagAdditions = 'onload="closeAndReload()"';
+ }
+ }
+ return $content;
+ }
+
+ /**
+ * Fetches command array for publishing and calculates number of records in it. Sets class members accordingly.
+ *
+ * @return void
+ */
+ function getRecords() {
+ $wslibObj = t3lib_div::makeInstance('wslib');
+ $this->publishData = $wslibObj->getCmdArrayForPublishWS($GLOBALS['BE_USER']->workspace, $this->isSwap);
+
+ $numRecs = 0;
+ foreach ($this->publishData as $table => $recs) {
+ foreach ($recs as $key => $value) {
+ $numRecs++;
+ }
+ }
+ $this->recordCount = $numRecs;
+ }
+
+ /**
+ * Creates block with progress bar
+ *
+ * @param string $messageLabel Message label to display
+ * @return string Generated content
+ */
+ function formatProgressBlock($messageLabel) {
+ return '' . $this->title . '
' .
+ sprintf($GLOBALS['LANG']->getLL($messageLabel),
+ $this->nextRecordNumber,
+ min($this->recordCount, $this->nextRecordNumber - 1 + MAX_RECORDS_TO_PUBLISH),
+ $this->recordCount) . '
' .
+ $GLOBALS['LANG']->getLL('please_wait') .
+ '
' .
+ '
' .
+ $GLOBALS['LANG']->getLL('do_not_interrupt_publishing_1') .
+ '
' .
+ $GLOBALS['LANG']->getLL('do_not_interrupt_publishing_2') .
+ '
';
+ }
+}
+
+
+// Include extension?
+if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/mod/user/ws/publish.php']) {
+ include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/mod/user/ws/publish.php']);
+}
+
+// Make instance:
+$SOBE = t3lib_div::makeInstance('SC_mod_user_ws_publish');
+$SOBE->init();
+$SOBE->main();
+$SOBE->printContent();
+?>
\ No newline at end of file
Index: typo3/mod/user/ws/index.php
===================================================================
--- typo3/mod/user/ws/index.php (revision 1740)
+++ typo3/mod/user/ws/index.php (working copy)
@@ -2,7 +2,7 @@
/***************************************************************
* Copyright notice
*
-* (c) 1999-2005 Kasper Skaarhoj (kasperYYYY@typo3.com)
+* (c) 1999-2006 Kasper Skaarhoj (kasperYYYY@typo3.com)
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
@@ -83,9 +83,6 @@
* 1964: function versionsInOtherWS($table,$uid)
* 1994: function showStageChangeLog($table,$id,$stageCommands)
*
- * SECTION: Processing
- * 2055: function publishAction()
- *
* TOTAL FUNCTIONS: 37
* (This index is automatically created/updated by the extension "extdeveval")
*
@@ -290,9 +287,6 @@
$this->content .= $this->doc->wrapScriptTags('top.location.href="' . $BACK_PATH . 'alt_main.php";');
}
else {
- // Perform workspace publishing action if buttons are pressed:
- $errors = $this->publishAction();
-
// Starting page:
$this->content.=$this->doc->startPage($LANG->getLL('title'));
$this->content.=$this->doc->header($LANG->getLL('title'));
@@ -302,7 +296,7 @@
$menuItems = array();
$menuItems[] = array(
'label' => $LANG->getLL('menuitem_review'),
- 'content' => (count($errors) ? '' . $LANG->getLL('label_errors') . '
'.implode('
',$errors).'
' : '').$this->moduleContent_publish()
+ 'content' => $this->moduleContent_publish()
);
$menuItems[] = array(
'label' => $LANG->getLL('menuitem_workspaces'),
@@ -396,10 +390,10 @@
if ($GLOBALS['BE_USER']->workspace!==0) {
if ($this->publishAccess) {
$confirmation = $LANG->JScharCode($LANG->getLL(($GLOBALS['BE_USER']->workspaceRec['publish_access'] & 1) ? 'submit_publish_workspace_confirmation_1' : 'submit_publish_workspace_confirmation_2'));
- $actionLinks.= '';
+ $actionLinks.= '';
if ($GLOBALS['BE_USER']->workspaceSwapAccess()) {
$confirmation = $LANG->JScharCode($LANG->getLL(($GLOBALS['BE_USER']->workspaceRec['publish_access'] & 1) ? 'submit_swap_workspace_confirmation_1' : 'submit_swap_workspace_confirmation_2'));
- $actionLinks.= '';
+ $actionLinks.= '';
}
} else {
$actionLinks.= $this->doc->icons(1) . $LANG->getLL('no_publish_permission');
@@ -2040,36 +2034,6 @@
-
- /**********************************
- *
- * Processing
- *
- **********************************/
-
- /**
- * Will publish workspace if buttons are pressed
- *
- * @return void
- */
- function publishAction() {
-
- // If "Publish" or "Swap" buttons are pressed:
- if (t3lib_div::_POST('_publish') || t3lib_div::_POST('_swap')) {
-
- // Initialize workspace object and request all pending versions:
- $wslibObj = t3lib_div::makeInstance('wslib');
- $cmd = $wslibObj->getCmdArrayForPublishWS($GLOBALS['BE_USER']->workspace, t3lib_div::_POST('_swap'));
-
- // Execute the commands:
- $tce = t3lib_div::makeInstance('t3lib_TCEmain');
- $tce->stripslashes_values = 0;
- $tce->start(array(), $cmd);
- $tce->process_cmdmap();
-
- return $tce->errorLog;
- }
- }
}
// Include extension?
Index: typo3/sysext/lang/locallang_mod_user_ws.xml
===================================================================
--- typo3/sysext/lang/locallang_mod_user_ws.xml (revision 1740)
+++ typo3/sysext/lang/locallang_mod_user_ws.xml (working copy)
@@ -100,6 +100,18 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file