Initial revision
[Packages/TYPO3.CMS.git] / typo3 / alt_doc_nodoc.php
1 <?php
2 /***************************************************************
3 * Copyright notice
4 *
5 * (c) 1999-2003 Kasper Skårhøj (kasper@typo3.com)
6 * All rights reserved
7 *
8 * This script is part of the TYPO3 project. The TYPO3 project is
9 * free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 * The GNU General Public License can be found at
15 * http://www.gnu.org/copyleft/gpl.html.
16 * A copy is found in the textfile GPL.txt and important notices to the license
17 * from the author is found in LICENSE.txt distributed with these scripts.
18 *
19 *
20 * This script is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 * GNU General Public License for more details.
24 *
25 * This copyright notice MUST APPEAR in all copies of the script!
26 ***************************************************************/
27 /**
28 * No-document script
29 *
30 *
31 * @author Kasper Skårhøj <kasper@typo3.com>
32 * @package TYPO3
33 * @subpackage core
34 *
35 */
36
37 require ("init.php");
38 require ("template.php");
39 include ("sysext/lang/locallang_alt_doc.php");
40
41
42 if (t3lib_extMgm::isLoaded("taskcenter") && t3lib_extMgm::isLoaded("taskcenter_recent")) {
43 require_once(t3lib_extMgm::extPath("taskcenter")."task/class.mod_user_task.php");
44 require_once(t3lib_extMgm::extPath("taskcenter_recent")."class.tx_taskcenterrecent.php");
45 }
46
47 // ***************************
48 // Script Classes
49 // ***************************
50 class SC_alt_doc_nodoc {
51 var $content;
52
53 function init() {
54 global $BACK_PATH;
55
56 $this->doc = t3lib_div::makeInstance("mediumDoc");
57 $this->doc->bodyTagMargins["x"]=5;
58 $this->doc->bodyTagMargins["y"]=5;
59 $this->doc->backPath = $BACK_PATH;
60
61 $this->content="";
62 $this->content.=$this->doc->startPage("TYPO3 Edit Document");
63 }
64 function main() {
65 global $BE_USER,$LANG,$BACK_PATH,$TCA,$HTTP_GET_VARS,$HTTP_POST_VARS,$CLIENT,$TYPO3_CONF_VARS;
66
67 $msg=array();
68 $msg[]=$LANG->getLL("noDocuments_msg");
69 $a_wl = $BE_USER->check("modules","web_list");
70 $a_wp = t3lib_extMgm::isLoaded("cms") && $BE_USER->check("modules","web_layout");
71 if ($a_wl || $a_wp) {
72 $msg_2 = array();
73 if ($a_wp) {
74 $msg_2[]='<strong><a href="#" onClick="top.goToModule(\'web_layout\'); return false;">'.$LANG->getLL("noDocuments_pagemodule").' <img src="'.t3lib_extMgm::extRelPath("cms").'/layout/layout.gif" width="14" height="12" border="0" align="top"></a></strong>';
75 if ($a_wl) $msg_2[]=$LANG->getLL("noDocuments_OR");
76 }
77 if ($a_wl) {
78 $msg_2[]='<strong><a href="#" onClick="top.goToModule(\'web_list\'); return false;">'.$LANG->getLL("noDocuments_listmodule").' <img src="mod/web/list/list.gif" width="14" height="12" border="0" align="top"></a></strong>';
79 }
80 $msg[]="<BR><BR>".sprintf($LANG->getLL("noDocuments_msg2"),implode(" ",$msg_2));
81 }
82
83 if ($BE_USER->check("modules","user_task") && t3lib_extMgm::isLoaded("taskcenter_recent")) {
84 $modObj = t3lib_div::makeInstance("tx_taskcenterrecent");
85 $modObj->backPath = $BACK_PATH;
86 $modObj->BE_USER = $BE_USER;
87 $modObj->perms_clause = $BE_USER->getPagePermsClause(1);
88
89 $msg[]="<BR><BR>".$LANG->getLL("noDocuments_msg3")."<BR><BR>".$modObj->_renderRecent();
90 }
91
92 $this->content.=$this->doc->section($LANG->getLL("noDocuments"),implode(" ",$msg),0,1);
93 }
94 function printContent() {
95 echo $this->content.$this->doc->endPage();
96 }
97 }
98
99 // Include extension?
100 if (defined("TYPO3_MODE") && $TYPO3_CONF_VARS[TYPO3_MODE]["XCLASS"]["typo3/alt_doc_nodoc.php"]) {
101 include_once($TYPO3_CONF_VARS[TYPO3_MODE]["XCLASS"]["typo3/alt_doc_nodoc.php"]);
102 }
103
104
105
106
107
108
109
110
111
112
113
114 // Make instance:
115 $SOBE = t3lib_div::makeInstance("SC_alt_doc_nodoc");
116 $SOBE->init();
117 $SOBE->main();
118 $SOBE->printContent();
119 ?>