Added feature #15783: Improve ExtJS skin: Tabs
[Packages/TYPO3.CMS.git] / typo3 / show_rechis.php
old mode 100755 (executable)
new mode 100644 (file)
index 3349614..adf46e1
@@ -2,7 +2,7 @@
 /***************************************************************
 *  Copyright notice
 *
-*  (c) 1999-2005 Kasper Skaarhoj (kasperYYYY@typo3.com)
+*  (c) 1999-2010 Kasper Skårhøj (kasperYYYY@typo3.com)
 *  All rights reserved
 *
 *  This script is part of the TYPO3 project. The TYPO3 project is
  * Shows information about a database or file item
  *
  * $Id$
- * Revised for TYPO3 3.6 November/2003 by Kasper Skaarhoj
+ * Revised for TYPO3 3.6 November/2003 by Kasper Skårhøj
  * XHTML Compliant
  *
- * @author     Kasper Skaarhoj <kasperYYYY@typo3.com>
+ * @author     Kasper Skårhøj <kasperYYYY@typo3.com>
  */
 /**
  * [CLASS/FUNCTION INDEX of SCRIPT]
@@ -52,8 +52,6 @@
 $BACK_PATH='';
 require ($BACK_PATH.'init.php');
 require ($BACK_PATH.'template.php');
-require_once (PATH_t3lib.'class.t3lib_diff.php');
-require_once (PATH_t3lib.'class.t3lib_tcemain.php');
 $LANG->includeLLFile('EXT:lang/locallang_show_rechis.xml');
 require_once ('class.show_rechis.inc');
 
@@ -68,7 +66,7 @@ require_once ('class.show_rechis.inc');
 /**
  * Script Class for showing the history module of TYPO3s backend
  *
- * @author     Kasper Skaarhoj <kasperYYYY@typo3.com>
+ * @author     Kasper Skårhøj <kasperYYYY@typo3.com>
  * @package TYPO3
  * @subpackage core
  * @see class.show_rechis.inc
@@ -77,6 +75,12 @@ class SC_show_rechis {
 
                // Internal:
        var $content;
+
+       /**
+        * Document template object
+        *
+        * @var mediumDoc
+        */
        var $doc;
 
        /**
@@ -88,11 +92,11 @@ class SC_show_rechis {
                global $LANG;
 
                        // Create internal template object:
-               $this->doc = t3lib_div::makeInstance('mediumDoc');
-               $this->doc->docType = 'xhtml_trans';
+               $this->doc = t3lib_div::makeInstance('template');
+               $this->doc->backPath = $GLOBALS['BACK_PATH'];
+               $this->doc->setModuleTemplate('templates/show_rechis.html');
 
                        // Start the page header:
-               $this->content.=$this->doc->startPage($LANG->getLL('title'));
                $this->content.=$this->doc->header($LANG->getLL('title'));
                $this->content.=$this->doc->spacer(5);
        }
@@ -108,19 +112,17 @@ class SC_show_rechis {
                        // Start history object
                $historyObj = t3lib_div::makeInstance('recordHistory');
 
-                       // Return link:
-               if ($historyObj->returnUrl)     {
-                       $this->content .= '<a href="'.htmlspecialchars($historyObj->returnUrl).'" class="typo3-goBack"><img'.t3lib_iconWorks::skinImg('','gfx/goback.gif','width="14" height="14"').' alt="" />'.$LANG->getLL('returnLink',1).'</a>';
-               }
-
                        // Get content:
                $this->content .= $historyObj->main();
 
-                       // Return link:
-               if ($historyObj->returnUrl)     {
-                       $link = '<a href="'.htmlspecialchars($historyObj->returnUrl).'" class="typo3-goBack"><img'.t3lib_iconWorks::skinImg('','gfx/goback.gif','width="14" height="14"').' alt="" />'.$LANG->getLL('returnLink',1).'</a>';
-                       $this->content .= $this->doc->section($LANG->getLL('return'),$link,0,1);
-               }
+                       // Setting up the buttons and markers for docheader
+               $docHeaderButtons = $this->getButtons();
+               $markers['CONTENT'] = $this->content;
+               $markers['CSH'] = $docHeaderButtons['csh'];
+
+                       // Build the <body> for the module
+               $this->content = $this->doc->startPage($LANG->getLL('title'));
+               $this->content.= $this->doc->moduleBody($this->pageinfo, $docHeaderButtons, $markers);
        }
 
        /**
@@ -134,21 +136,36 @@ class SC_show_rechis {
                $this->content = $this->doc->insertStylesAndJS($this->content);
                echo $this->content;
        }
-}
-
-// Include extension?
-if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/show_rechis.php'])  {
-       include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/show_rechis.php']);
-}
-
-
 
+       /**
+        * Create the panel of buttons for submitting the form or otherwise perform operations.
+        *
+        * @return      array   all available buttons as an assoc. array
+        */
+       protected function getButtons() {
+               $buttons = array(
+                       'csh' => '',
+                       'back' => ''
+               );
 
+                       // CSH
+               $buttons['csh'] = t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'history_log', $GLOBALS['BACK_PATH'], '', TRUE);
 
+                       // Start history object
+               $historyObj = t3lib_div::makeInstance('recordHistory');
 
+               if ($historyObj->returnUrl)     {
+                       $buttons['back']= '<a href="' . htmlspecialchars($historyObj->returnUrl) . '" class="typo3-goBack">' . t3lib_iconWorks::getSpriteIcon('actions-view-go-back') . '</a>';
+               }
 
+               return $buttons;
+       }
+}
 
 
+if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/show_rechis.php'])  {
+       include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/show_rechis.php']);
+}
 
 
 
@@ -157,4 +174,5 @@ $SOBE = t3lib_div::makeInstance('SC_show_rechis');
 $SOBE->init();
 $SOBE->main();
 $SOBE->printContent();
+
 ?>
\ No newline at end of file