This commit was manufactured by cvs2svn to create tag
[Packages/TYPO3.CMS.git] / typo3 / mod / web / func / index.php
index d54a5c0..1eecac2 100755 (executable)
@@ -1,22 +1,22 @@
 <?php
 /***************************************************************
 *  Copyright notice
-*  
-*  (c) 1999-2003 Kasper Skårhøj (kasper@typo3.com)
+*
+*  (c) 1999-2004 Kasper Skaarhoj (kasper@typo3.com)
 *  All rights reserved
 *
-*  This script is part of the TYPO3 project. The TYPO3 project is 
+*  This script is part of the TYPO3 project. The TYPO3 project is
 *  free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  (at your option) any later version.
-* 
+*
 *  The GNU General Public License can be found at
 *  http://www.gnu.org/copyleft/gpl.html.
-*  A copy is found in the textfile GPL.txt and important notices to the license 
+*  A copy is found in the textfile GPL.txt and important notices to the license
 *  from the author is found in LICENSE.txt distributed with these scripts.
 *
-* 
+*
 *  This script is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *
 *  This copyright notice MUST APPEAR in all copies of the script!
 ***************************************************************/
-/** 
+/**
  * Module: Advanced functions
- *
  * Advanced Functions related to pages
  *
- * @author     Kasper Skårhøj <kasper@typo3.com>
+ * $Id$
+ * Revised for TYPO3 3.6 November/2003 by Kasper Skaarhoj
+ * XHTML compliant
+ *
+ * @author     Kasper Skaarhoj <kasper@typo3.com>
+ */
+/**
+ * [CLASS/FUNCTION INDEX of SCRIPT]
+ *
+ *
+ *
+ *   71: class SC_mod_web_func_index extends t3lib_SCbase
+ *   84:     function main()
+ *  164:     function printContent()
+ *
+ * TOTAL FUNCTIONS: 2
+ * (This index is automatically created/updated by the extension "extdeveval")
+ *
  */
 
 
 unset($MCONF);
-require ("conf.php");
-require ($BACK_PATH."init.php");
-require ($BACK_PATH."template.php");
-include (PATH_typo3."sysext/lang/locallang_mod_web_func.php");
-require_once (PATH_t3lib."class.t3lib_scbase.php");
+require ('conf.php');
+require ($BACK_PATH.'init.php');
+require ($BACK_PATH.'template.php');
+include (PATH_typo3.'sysext/lang/locallang_mod_web_func.php');
+require_once (PATH_t3lib.'class.t3lib_scbase.php');
 
 $BE_USER->modAccess($MCONF,1);
 
 
 
-// ***************************
-// Script Classes
-// ***************************
+/**
+ * Script Class for the Web > Functions module
+ * This class creates the framework to which other extensions can connect their sub-modules
+ *
+ * @author     Kasper Skaarhoj <kasper@typo3.com>
+ * @package TYPO3
+ * @subpackage core
+ */
 class SC_mod_web_func_index extends t3lib_SCbase {
+
+               // Internal, dynamic:
        var $pageinfo;
        var $fileProcessor;
-       
+
+
+
+       /**
+        * Initialize module header etc and call extObjContent function
+        *
+        * @return      void
+        */
        function main() {
-               global $BE_USER,$LANG,$BACK_PATH,$TCA_DESCR,$TCA,$HTTP_GET_VARS,$HTTP_POST_VARS,$CLIENT,$TYPO3_CONF_VARS;
-               
+               global $BE_USER,$LANG,$BACK_PATH;
+
                // Access check...
                // The page will show only if there is a valid page and if this page may be viewed by the user
                $this->pageinfo = t3lib_BEfunc::readPageAccess($this->id,$this->perms_clause);
                $access = is_array($this->pageinfo) ? 1 : 0;
-               
-               
+
+
                // **************************
                // Main
                // **************************
                if ($this->id && $access)       {
-                       $this->doc = t3lib_div::makeInstance("mediumDoc");
+                       $this->doc = t3lib_div::makeInstance('mediumDoc');
                        $this->doc->backPath = $BACK_PATH;
-               
+
                                // JavaScript
-                       $this->doc->JScode = '
-<script language="javascript" type="text/javascript">
-       script_ended = 0;
-       function jumpToUrl(URL) {
-//             alert(URL);
-               document.location = URL;
-       }
-</script>
-                       ';
-                       
-                       $this->doc->postCode='
-<script language="javascript" type="text/javascript">
-       script_ended = 1;
-       if (top.fsMod) top.fsMod.recentIds["web"] = '.intval($this->id).';
-</script>
-                       ';
-                       $this->doc->form='<form action="index.php" method="POST"><input type="hidden" name="id" value="'.$this->id.'">';
-
-                       $headerSection = $this->doc->getHeader("pages",$this->pageinfo,$this->pageinfo["_thePath"]).'<br>'.$LANG->sL("LLL:EXT:lang/locallang_core.php:labels.path").': '.t3lib_div::fixed_lgd_pre($this->pageinfo["_thePath"],50);
-               
+                       $this->doc->JScode = $this->doc->wrapScriptTags('
+                               script_ended = 0;
+                               function jumpToUrl(URL) {       //
+                                       document.location = URL;
+                               }
+                       ');
+                       $this->doc->postCode=$this->doc->wrapScriptTags('
+                               script_ended = 1;
+                               if (top.fsMod) top.fsMod.recentIds["web"] = '.intval($this->id).';
+                       ');
+
+
+                               // Setting up the context sensitive menu:
+                       $CMparts=$this->doc->getContextMenuCode();
+                       $this->doc->bodyTagAdditions = $CMparts[1];
+                       $this->doc->JScode.=$CMparts[0];
+                       $this->doc->postCode.= $CMparts[2];
+
+                       $this->doc->form='<form action="index.php" method="post"><input type="hidden" name="id" value="'.$this->id.'">';
+
+                       $headerSection = $this->doc->getHeader('pages',$this->pageinfo,$this->pageinfo['_thePath']).'<br />'.
+                               $LANG->sL('LLL:EXT:lang/locallang_core.php:labels.path').': '.
+                               '<span title="'.htmlspecialchars($this->pageinfo['_thePathFull']).'">'.htmlspecialchars(t3lib_div::fixed_lgd_pre($this->pageinfo['_thePath'],50)).'</span>';
+
                                // Draw the header.
-                       $this->content.=$this->doc->startPage($LANG->getLL("title"));
-                       $this->content.=$this->doc->header($LANG->getLL("title"));
+                       $this->content.=$this->doc->startPage($LANG->getLL('title'));
+                       $this->content.=$this->doc->header($LANG->getLL('title'));
                        $this->content.=$this->doc->spacer(5);
-                       $this->content.=$this->doc->section('',$this->doc->funcMenu($headerSection,t3lib_BEfunc::getFuncMenu($this->id,"SET[function]",$this->MOD_SETTINGS["function"],$this->MOD_MENU["function"])));
+                       $this->content.=$this->doc->section('',$this->doc->funcMenu($headerSection,t3lib_BEfunc::getFuncMenu($this->id,'SET[function]',$this->MOD_SETTINGS['function'],$this->MOD_MENU['function'])));
                        $this->content.=$this->doc->divider(5);
-               
-               
-                       
+
+
+
 
 
                        $this->extObjContent();
 
-               
-                       
-                       
+
+
+
                        // ShortCut
                        if ($BE_USER->mayMakeShortcut())        {
-                               $this->content.=$this->doc->spacer(20).$this->doc->section('',$this->doc->makeShortcutIcon("id","function,wiz,import_function,export_function",$this->MCONF["name"]));
+                               $this->content.=$this->doc->spacer(20).$this->doc->section('',$this->doc->makeShortcutIcon('id','function,wiz,import_function,export_function',$this->MCONF['name']));
                        }
-                       
+
                        $this->content.=$this->doc->spacer(10);
                } else {
                                // If no access or if ID == zero
-               
-                       $this->doc = t3lib_div::makeInstance("mediumDoc");
+
+                       $this->doc = t3lib_div::makeInstance('mediumDoc');
                        $this->doc->backPath = $BACK_PATH;
-               
-                       $this->content.=$this->doc->startPage($LANG->getLL("title"));
-                       $this->content.=$this->doc->header($LANG->getLL("title"));
-                       $this->content.=$this->doc->section("","<BR>".$LANG->getLL("clickAPage_content"),0,1);
+
+                       $this->content.=$this->doc->startPage($LANG->getLL('title'));
+                       $this->content.=$this->doc->header($LANG->getLL('title'));
+                       $this->content.=$this->doc->section('','<br />'.$LANG->getLL('clickAPage_content'),0,1);
                        $this->content.=$this->doc->spacer(5);
                        $this->content.=$this->doc->spacer(10);
                }
        }
+
+       /**
+        * Print module content (from $this->content)
+        *
+        * @return      void
+        */
        function printContent() {
-               global $SOBE;
 
-               $this->content.=$this->doc->middle();
                $this->content.=$this->doc->endPage();
                echo $this->content;
        }
-
-
-
 }
 
 // Include extension?
-if (defined("TYPO3_MODE") && $TYPO3_CONF_VARS[TYPO3_MODE]["XCLASS"]["typo3/mod/web/func/index.php"])   {
-       include_once($TYPO3_CONF_VARS[TYPO3_MODE]["XCLASS"]["typo3/mod/web/func/index.php"]);
+if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/mod/web/func/index.php'])   {
+       include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/mod/web/func/index.php']);
 }
 
 
@@ -152,19 +187,17 @@ if (defined("TYPO3_MODE") && $TYPO3_CONF_VARS[TYPO3_MODE]["XCLASS"]["typo3/mod/w
 
 
 // Make instance:
-$SOBE = t3lib_div::makeInstance("SC_mod_web_func_index");
+$SOBE = t3lib_div::makeInstance('SC_mod_web_func_index');
 $SOBE->init();
 
 // Include files?
-reset($SOBE->include_once);    
-while(list(,$INC_FILE)=each($SOBE->include_once))      {include_once($INC_FILE);}
+foreach($SOBE->include_once as $INC_FILE)      include_once($INC_FILE);
 $SOBE->checkExtObj();  // Checking for first level external objects
 
 // Repeat Include files! - if any files has been added by second-level extensions
-reset($SOBE->include_once);    
-while(list(,$INC_FILE)=each($SOBE->include_once))      {include_once($INC_FILE);}
+foreach($SOBE->include_once as $INC_FILE)      include_once($INC_FILE);
 $SOBE->checkSubExtObj();       // Checking second level external objects
 
 $SOBE->main();
 $SOBE->printContent();
-?>
\ No newline at end of file
+?>