* Added GET-params "module" and "modParams" to alt_main.php to allow external urls...
authorChristian Jul Jensen <christian.jensen@typo3.org>
Thu, 24 Nov 2005 13:09:14 +0000 (13:09 +0000)
committerChristian Jul Jensen <christian.jensen@typo3.org>
Thu, 24 Nov 2005 13:09:14 +0000 (13:09 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@881 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
typo3/alt_main.php

index 7a4ab53..fc08270 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2005-11-24  Christian Jul Jensen  <christian@jul.net>
+
+       * Added GET-params "module" and "modParams" to alt_main.php to allow external urls to access specific points in modules
+
 2005-11-23  Michael Stucki  <michael@typo3.org>
 
        * Always use fputs() for writing to logfiles. There is no case when it can't be used, so the alternative "echo" call was never needed.
index e0b1e39..622961d 100755 (executable)
@@ -372,6 +372,7 @@ class SC_alt_main {
 
                        // Check editing of page:
                $this->editPageHandling();
+               $this->startModule();
        }
 
        /**
@@ -386,7 +387,7 @@ class SC_alt_main {
                if (!t3lib_extMgm::isLoaded('cms'))     return;
 
                        // EDIT page:
-               $editId = ereg_replace('[^[:alnum:]_]','',t3lib_div::_GET('edit'));
+               $editId = preg_replace('/[^[:alnum:]_]/','',t3lib_div::_GET('edit'));
                $theEditRec = '';
 
                if ($editId)    {
@@ -427,6 +428,28 @@ class SC_alt_main {
        }
 
        /**
+        * Sets the startup module from either GETvars module and mpdParams or user configuration.
+        *
+        * @return      void
+        */
+       function startModule() {
+               global $BE_USER;
+               $module = preg_replace('/[^[:alnum:]_]/','',t3lib_div::_GET('module'));
+               if (!$module && $BE_USER->uc['startInTaskCenter']) {
+                       $module = 'user_task';
+               }
+
+               $params = t3lib_div::_GET('modParams');
+               if ($module) {
+                       $this->mainJScode.='
+               // open in module:
+       window.setTimeout("top.goToModule(\''.$module.'\',false,\''.$params.'\');",500);
+                       ';
+               }
+       }
+       
+
+       /**
         * Creates the header and frameset of the backend interface
         *
         * @return      void
@@ -452,7 +475,7 @@ class SC_alt_main {
                $this->content.=$GLOBALS['TBE_TEMPLATE']->startPage($title);
 
                        // Creates frameset
-               $fr_content = '<frame name="content" src="'.($BE_USER->uc['startInTaskCenter']&&t3lib_extMgm::isLoaded('taskcenter')?t3lib_extMgm::extRelPath('taskcenter').'task/index.php':'alt_intro.php').'" marginwidth="0" marginheight="0" frameborder="0" scrolling="auto" noresize="noresize" />';
+               $fr_content = '<frame name="content" src="alt_intro.php" marginwidth="0" marginheight="0" frameborder="0" scrolling="auto" noresize="noresize" />';
                $fr_toplogo = '<frame name="toplogo" src="alt_toplogo.php" marginwidth="0" marginheight="0" frameborder="0" scrolling="no" noresize="noresize" />';
                $fr_topmenu = '<frame name="topmenuFrame" src="alt_topmenu_dummy.php" marginwidth="0" marginheight="0" frameborder="0" scrolling="no" noresize="noresize" />';