Iframe functionality in taskcenter updated. sys_action adjusted to the changes in...
authorChristian Jul Jensen <christian.jensen@typo3.org>
Wed, 2 Feb 2005 10:29:57 +0000 (10:29 +0000)
committerChristian Jul Jensen <christian.jensen@typo3.org>
Wed, 2 Feb 2005 10:29:57 +0000 (10:29 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@547 709f56b5-9817-0410-a4d7-c38de5d9e867

typo3/sysext/sys_action/class.tx_sysaction.php
typo3/sysext/taskcenter/task/class.mod_user_task.php
typo3/sysext/taskcenter/task/index.php

index 432305d..96fc39b 100755 (executable)
@@ -41,13 +41,12 @@ class tx_sysaction extends mod_user_task {
        var $xCol;
        var $t3lib_TCEforms;
 
-       function overview_main(&$pObj)  {
+       function overview_main()        {
                $mC = $this->renderActionList();
                if ($mC)        {
                        $icon = '<img src="'.$this->backPath.t3lib_extMgm::extRelPath("sys_action").'ext_icon.gif" width=18 height=16 class="absmiddle">';
-                       $content.=$pObj->doc->section($icon."&nbsp;".$this->headLink("tx_sysaction",1),$mC,1,1,0,1);
+                       return $this->mkMenuConfig($icon.$this->headLink("tx_sysaction",1),'',$mC);
                }
-               return $content;
        }
        function main() {
                global $SOBE,$BE_USER,$LANG,$BACK_PATH,$TCA_DESCR,$TCA,$CLIENT,$TYPO3_CONF_VARS;
@@ -283,7 +282,7 @@ class tx_sysaction extends mod_user_task {
                return $out;
        }
        function action_link($str,$id,$title="")        {
-               $str='<a href="index.php?SET[function]=tx_sysaction&sys_action_uid='.$id.'" target="list_frame" onClick="this.blur();" title="'.htmlspecialchars($title).'">'.$str.'</a>';
+               $str='<a href="index.php?SET[function]=tx_sysaction&sys_action_uid='.$id.'" onClick="this.blur();" title="'.htmlspecialchars($title).'">'.$str.'</a>';
                return $str;
        }
        function action_linkUserName($str,$id,$bid)     {
index 56a50de..e481a17 100755 (executable)
                /**
                * Create configuration for entry in the left tab menu.
                *
-               * @param string  $htmlContent: Content that does not get escaped, use this for icons links etc. (HTML)
-               * @param string  $label: Title of the tab, escaped for HTML, dispalyed after html content.
-               * @param string  $content: html content that gets displayed when the tab is activated. (HTML)
+               * @param string  $htmlContent:                  Content that does not get escaped, use this for icons links etc. (HTML)
+               * @param string  $label:                                                bTitle of the tab, escaped for HTML, dispalyed after html content.
+               * @param string  $content:                                      html content that gets displayed when the tab is activated. (HTML)
                * @param string  $popUpDescription: alt-text for the tab text
-               * @return array         proper configuration for the tab menu.
+               * @return array                                                                                 proper configuration for the tab menu.
                */
                function mkMenuConfig($htmlContent, $label = "", $content = "", $popUpDescription = '') {
                        $configArr = Array();
                * @param string  $url: url to display
                * @return string        code that inserts the iframe (HTML)
                */
-               function urlInIframe($url) {
-                       return '<iframe onLoad="this.height=this.contentDocument.height+30;" scrolling="auto" width="100%" src="'.$url.'" name="list_frame" style="border: none;" />';
+               function urlInIframe($url,$max=0) {
+                       return '<iframe onload="resizeIframe(this,'.$max.');" scrolling="auto" width="100%" src="'.$url.'" name="list_frame" frameborder="no" style="border: none;"></iframe>';
                }
                 
                 
index 2e23291..c7391c4 100755 (executable)
                                </script>
                                ';
                        $this->doc->JScode .= $this->doc->getDynTabMenuJScode();
-                        
-                       //DEV - remove before release;
-                       $this->doc->parseTimeFlag = true;
+                       $this->doc->JScode .= '  <script language="javascript" type="text/javascript">
+                       function resizeIframe(frame,max) {
+                       try {
+                                       innerDoc = (frame.contentDocument) ? frame.contentDocument : frame.contentWindow.document;
+                                                       if(max==0) {
+                                               frame.height = innerDoc.body.scrollHeight + 30;
+                                                       } else {
+                                               frame.height = Math.max(innerDoc.body.scrollHeight + 30,document.body.scrollHeight);
+                                                       }
+                       }
+                       catch (e) {
+                       window.status = e.message;
+                       }
+
+                       }
+ </script>';
                         
                        /* call getMainContent first, because what happens here might affect leftContent */
                        $mainContent = $this->getMainContent();
                        /* content... */
                        $this->content = '';
                        $this->content .= $this->doc->startPage($this->MOD_MENU['function'][$this->MOD_SETTINGS['function']]);
-                       $this->content .= '<table style="width: 100%;"><tr>';
+                       $this->content .= '<table style="width: 98%;"><tr>';
                        $this->content .= '<td valign="top" style="width: 20%;">'.$this->getleftHeader().$this->getDynTabMenu().'</td>';
                        $this->content .= '<td valign="top" style="height:100%">'.$mainContent.'</td>';
                        $this->content .= '</tr></table>';