Commit dca0d260 authored by Kasper Skårhøj's avatar Kasper Skårhøj
Browse files

Initial revision


git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@20 709f56b5-9817-0410-a4d7-c38de5d9e867
parent feffa595
This diff is collapsed.
TYPO3 3.6.0-dev
PHP:
!!! $LANG->php3Lang + ->mainLang has been cancelled and replaced with a local-lang call: Search/replace regex: search for '->php3Lang\["([^]]*)"\]\["([^]]*)"\]', replace with '->sL("LLL:EXT:lang/locallang_core.php:\1.\2")'. Same for ->mainLang.
!!! The global var $AB has been removed (since the "alternative backend" is now THE backend and the classic is totally gone. If you use this var, you can safely expect $AB's value to be TRUE and therefore remove all code which would excute if it was FALSE.
!!! Removed what looked like unused functions and variables in the backend frameset JavaScript.
!!! Change db_list_frame and file_list_frame to just "list_frame".
!!! Cleaned up a lot in the template-class.
!!! dfw() and rfw() functions must be substituted with $GLOBALS["TBE_TEMPLATE"]->dfw() / ->rfw()
!!! fw() is highly depreciated (and does NOT wrap strings anymore!)
!!! if (top.theMenu) top.theMenu.recentuid
!!! Constant "PATH_temp" has been cancelled - no scripts seemed to use it and the dir is depreciated.
!!! typo3/temp/ has been cancelled. Changed to typo3/icons/ for STATIC icons and PATH_site.typo3temp/ is now used for the locally generated icons. So no more typo3/temp/ to be writable.
!!! t3lib_BEfunc::loadTablesDescriptions() and t3lib_BEfunc::loadSingleTableDescription is removed. A function call like t3lib_BEfunc::loadSingleTableDescription("pages",$LANG->lang); is substituted with $LANG->loadSingleTableDescription("pages");
!!! Function t3lib_BEfunc::pTypes() remove - nothing used it (apparently. prove me wrong... :-)
!!! Function t3lib_div::extParseurl removed
!!! Function t3lib_div::imagefinder, t3lib_div::linkfinder, t3lib_div::getStrippedURL, t3lib_div::getMimeType, t3lib_div::debug_white_space, t3lib_div::debug_code, t3lib_div::parsetime, t3lib_div::hardspace, t3lib_div::break_text, t3lib_div::unbreak_text removed
!!! The font files "arial.ttf" and "verdana.ttf" has been removed from the folder t3lib/fonts/ and substituted with similar typefaces, "nimbus.ttf" and "vera.ttf" respectively.
!!! The script "t3lib/formmail.php" has been removed. Was not used and didn't work anyways.
Charsets:
- A new class "t3lib_cs" has been added. It contains homemade functions for conversion to and from a list of charsets (conversion tables found in t3lib/csconvtbl/). The conversion could be speeded up enourmously by using PHP functions but I simply didn't find any that could be used. By time we can substitute the PHP-processing with internal PHP functions if possible.
- In TYPO3_CONF_VARS we can now set up a system charset. [BE][forceCharset] This is used a) for storage of information and b) for whole backend. Default is that charset of the current user (as always), but clearly recommended is "UTF-8"!!!
- The recommendation is that the forceCharset configuration is used for multilingual sites. In this way the SAME charset is ALWAYS used in the backend regardless of which language the current backend user has chosen. Thus all content in the sysmte is stored in the same charset.
\ No newline at end of file
<?php
/***************************************************************
* Copyright notice
*
* (c) 1999-2002
* All rights reserved
*
* 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
* 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
* GNU General Public License for more details.
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
/**
*
*
*
* @author
*/
class existingHTMLimport {
function main() {
global $SOBE,$SOBE;
$theOutput.=$SOBE->doc->section("Header",'PID: '.$SOBE->id);
$theOutput.=$SOBE->doc->divider(5);
$message="
This module is not published yet.
The module will not be able to import HTML code into nice editable content types like 'text', 'image', ...!!!
It imports the HTML pages into Typo3 as pages with a content record type 'HTML'. The module try to preserve the website structure. Additionally you can put template markers into the HTML code during import.
If you need a solution to import more that 20 HTML pages and you like to test the module then ask:
René Fritz r.fritz@colorcube.de";
$theOutput.=$SOBE->doc->section("NOTICE",nl2br($message));
$theOutput.=$SOBE->doc->divider(5);
return $theOutput;
}
}
// Include extension?
if (defined("TYPO3_MODE") && $TYPO3_CONF_VARS[TYPO3_MODE]["XCLASS"]["typo3/mod/web/func/class.existingHTMLimport.php"]) {
include_once($TYPO3_CONF_VARS[TYPO3_MODE]["XCLASS"]["typo3/mod/web/func/class.existingHTMLimport.php"]);
}
?>
\ No newline at end of file
<?php
/***************************************************************
* Copyright notice
*
* (c) 1999-2003 Kasper Skrhj (kasper@typo3.com)
* All rights reserved
*
* 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
* 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
* GNU General Public License for more details.
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
/**
* Module: Func / Export
*
* Include-file
*
* @author Kasper Skrhj <kasper@typo3.com>
*/
require_once (PATH_t3lib."class.t3lib_loaddbgroup.php");
require_once (PATH_t3lib."class.t3lib_exportdata.php");
class export {
function main () {
global $SOBE,$AB,$BE_USER,$LANG,$BACK_PATH,$TCA_DESCR,$TCA,$HTTP_GET_VARS,$HTTP_POST_VARS,$CLIENT,$TYPO3_CONF_VARS;
$export = t3lib_div::makeInstance("t3lib_exportData");
$export->script="index.php";
$export->backPath=$BACK_PATH;
$export->id=$SOBE->id;
// **************************
// Main
// **************************
$extension = $GLOBALS["SOBE"]->MOD_SETTINGS["export_function"];
$destination="";
if (trim($GLOBALS["SOBE"]->MOD_SETTINGS["export_filename"])) {
$theFile = trim($GLOBALS["SOBE"]->MOD_SETTINGS["export_filename"]).".".$extension;
$destination = $GLOBALS["SOBE"]->fileProcessor->findTempFolder()."/".$theFile;
}
// FILE exists:
// Export command:
if ($GLOBALS["SOBE"]->CMD=="export" && $destination && !@file_exists($destination)) {
$export->startExport($HTTP_POST_VARS["records"]);
$export->write(1,$destination);
debug("export!: ".$destination);
}
if ($extension) {
$Nmenu[]= array(fw("Destination:"),t3lib_BEfunc::getFuncMenu($SOBE->id,"SET[export_destination]",$GLOBALS["SOBE"]->MOD_SETTINGS["export_destination"],$GLOBALS["SOBE"]->MOD_MENU["export_destination"]));
$Nmenu[]= array(fw("Filename:"),t3lib_BEfunc::getFuncInput($SOBE->id,"SET[export_filename]",$GLOBALS["SOBE"]->MOD_SETTINGS["export_filename"],30).fw("&nbsp;.".$extension));
$info="";
if (trim($GLOBALS["SOBE"]->MOD_SETTINGS["export_filename"])) {
if (@file_exists($destination)) {
$info="<b>The file '".$theFile."' exists already! Enter another name.</b>";
} else {
// ...OK
}
} else {
$info="<b>Enter a filename!</b>";
}
$theOutput.=$SOBE->doc->section("Select file destination:",$SOBE->doc->menuTable($Nmenu).fw($info));
$theOutput.=$SOBE->doc->divider(5);
if (isset($HTTP_GET_VARS["exportRecords"])) {
$theOutput.=$SOBE->doc->section("ExPORT:", $HTTP_GET_VARS["exportRecords"]);
} else {
switch($extension) {
case "trd":
break;
case "html":
break;
case "csv":
break;
default:
$extension = "";
break;
}
if ($extension) {
$Nmenu= "Records: ".t3lib_BEfunc::getFuncMenu($SOBE->id,"SET[export_source]",$GLOBALS["SOBE"]->MOD_SETTINGS["export_source"],$GLOBALS["SOBE"]->MOD_MENU["export_source"]);
$theOutput.=$SOBE->doc->section("Select record source:",'<NOBR>'.$Nmenu.'</NOBR>');
if ($GLOBALS["SOBE"]->MOD_SETTINGS["export_source"]) {
$theOutput.=$SOBE->doc->section("",$export->getSource($GLOBALS["SOBE"]->MOD_SETTINGS["export_source"]));
if (count($export->recordsToLoad_fields)) { // If there was records...
$msg="";
$msg.= '<BR><BR><input type="hidden" name="id" value="'.$GLOBALS["SOBE"]->id.'">';
$msg.= '<input type="hidden" name="CMD" value="export">';
$msg.= '<input type="hidden" name="records" value="'.implode($export->recordsToLoad_fields,",").'">';
$msg.= '<input type="Submit" value="Save records to file">';
$theOutput.=$SOBE->doc->section("EXPORT RECORDS",$msg);
}
}
}
}
}
return $theOutput;
}
}
// Include extension?
if (defined("TYPO3_MODE") && $TYPO3_CONF_VARS[TYPO3_MODE]["XCLASS"]["typo3/mod/web/func/class.export.php"]) {
include_once($TYPO3_CONF_VARS[TYPO3_MODE]["XCLASS"]["typo3/mod/web/func/class.export.php"]);
}
?>
\ No newline at end of file
This diff is collapsed.
<!--###TEMPLATE_DEFAULT### begin
Help template for the default language, english
-->
<table border=1 cellpadding=4 cellspacing=1 bgcolor="#eeeeee">
<tr>
<td colspan=2>
<div align="center"><h3>Board Codes</h3></div>
<font face=verdana size=2>
You must insert a code in the CODE field of the "List" content element before the board will work. The code tells the board module what to do. You can insert multiple codes by separating them by a comma.<br>
Here is an example:<br><BR>
<div align="center"><img src="media/scripts/board_help1.gif" width="375" height="226" border="2" alt=""></div>
<HR>
Current CODE = "<b>###CODE###</b>"
</font>
</td>
</tr>
<tr>
<td><font face=verdana size=2><strong>LIST_CATEGORIES</strong></font></td>
<td><font face=verdana size=2>Lists the categories and forums in categories.</font></td>
</tr>
<tr>
<td><font face=verdana size=2><strong>LIST_FORUMS</strong></font></td>
<td><font face=verdana size=2>Lists the forums.</font></td>
</tr>
<tr>
<td><font face=verdana size=2><strong>FORUM</strong></font></td>
<td><font face=verdana size=2>Lists the content of a forum. If tt_board_uid is set as GET/POST var, that board-item/list is displayed instead.</font></td>
</tr>
<tr>
<td><font face=verdana size=2><strong>POSTFORM</strong></font></td>
<td><font face=verdana size=2>Displays a submit-form used to post replies/new threads.</font></td>
</tr>
<tr>
<td><font face=verdana size=2><strong>POSTFORM_REPLY</strong></font></td>
<td><font face=verdana size=2>As above, but only if it is a reply.</font></td>
</tr>
<tr>
<td><font face=verdana size=2><strong>POSTFORM_THREAD</strong></font></td>
<td><font face=verdana size=2>As above, but only if it is a new thread.</font></td>
</tr>
</table>
<!--###TEMPLATE_DEFAULT### end -->
###SUBJECT_PREFIX### '###HOST###'
Hello,
###AUTHOR### (###AUTHOR_EMAIL###) ###DID_WHAT### ###HOST###.
This thread is located at:
###URL###
Text Snippet:
~~~
Subject: ###SUBJECT###
Content:
###BODY###
~~~
<?php
/***************************************************************
* Copyright notice
*
* (c) 1999-2003 Kasper Skrhj (kasper@typo3.com)
* All rights reserved
*
* 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
* 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
* GNU General Public License for more details.
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
/**
* board_submit.inc
*
* See TSref document: boardLib.inc / FEDATA section for details on how to use this script.
* The static template 'plugin.tt_board' provides a working example of configuration.
*
* @author Kasper Skrhj <kasper@typo3.com>
*/
if (is_object($this)) {
if (is_array($this->newData["tt_board"]["NEW"])) {
// Plain insert of record:
// $this->newData["tt_board"]["NEW"]["datetime"]=time();
$query = $this->getNEWinsert("tt_board", $this->newData["tt_board"]["NEW"]);
//debug($query);
$res = mysql(TYPO3_db,$query);
$newId = mysql_insert_id();
echo mysql_error();
$this->clear_cacheCmd(intval($this->newData["tt_board"]["NEW"]["pid"]));
$conf = $this->getConf("tt_board");
// Clear specific cache:
if ($conf["clearCacheForPids"]) {
$ccPids=t3lib_div::intExplode(",",$conf["clearCacheForPids"]);
reset($ccPids);
while(list(,$pid)=each($ccPids)) {
if ($pid > 0) {$this->clear_cacheCmd($pid);}
}
}
//debug($conf);
// Send post to Mailing list ...
if ($conf["sendToMailingList"] && $conf["sendToMailingList."]["email"]) {
/*
TypoScript for this section (was used for the Typo3 mailing list.
sendToMailingList=1
sendToMailingList {
email = typo3@netfielders.de
reply = submitmail@typo3.com
namePrefix = Typo3Forum/
altSubject = Post from www.typo3.com
}
*/
$mConf = $conf["sendToMailingList."];
$maillist_data = $this->newData["tt_board"]["NEW"];
$maillist_recip = $mConf["email"];
$maillist_header='From: '.$mConf["namePrefix"].$maillist_data["author"].' <'.$mConf["reply"].'>'.chr(10);
$maillist_header.='Reply-To: '.$mConf["reply"];
// Subject
if ($maillist_data["parent"]) { // RE:
$query = "SELECT * FROM tt_board WHERE uid=".intval($maillist_data["parent"]);
$res = mysql(TYPO3_db,$query);
$row = mysql_fetch_assoc($res);
$maillist_subject = "Re: ".$row["subject"]." [#".$maillist_data["parent"]."]";
} else { // New:
$maillist_subject = (trim($maillist_data["subject"]) ? trim(stripslashes($maillist_data["subject"])) : $mConf["altSubject"])." [#".$newId."]";
}
// Message
$maillist_msg = stripslashes($maillist_data["subject"]).chr(10).chr(10).stripslashes($maillist_data["message"])."
--
".$maillist_data["author"];
// Send
if ($conf["debug"]) {
debug($maillist_recip,1);
debug($maillist_subject,1);
echo nl2br($maillist_msg.chr(10));
debug($maillist_header,1);
} else {
mail ($maillist_recip, $maillist_subject, $maillist_msg, $maillist_header);
}
}
// Notify me...
if (t3lib_div::GPvar("notify_me") && $conf["notify"]) {
$thescript = parse_url($GLOBALS["HTTP_SERVER_VARS"]["REQUEST_URI"]);
$notifyMe = t3lib_div::uniqueList(str_replace(",".$maillist_data["email"].",", ",", ",".t3lib_div::GPvar("notify_me").","));
$markersArray=array();
$markersArray["###AUTHOR###"] = trim(stripslashes($this->newData["tt_board"]["NEW"][author]));
$markersArray["###AUTHOR_EMAIL###"] = trim(stripslashes($this->newData["tt_board"]["NEW"][email]));
$markersArray["###HOST###"] = t3lib_div::getIndpEnv("HTTP_HOST");
$markersArray["###URL###"] = 'http://'.t3lib_div::getIndpEnv("HTTP_HOST").$thescript["path"].'?id='.$GLOBALS["TSFE"]->id.'&type='.$GLOBALS["TSFE"]->type.'&no_cache=1&tt_board_uid='.$newId;
if ($maillist_data["parent"]) { // If reply and not new thread:
$msg = t3lib_div::getUrl($GLOBALS["TSFE"]->tmpl->getFileName($conf["newReply."]["msg"]));
$markersArray["###DID_WHAT###"]= $conf["newReply."]["didWhat"];
$markersArray["###SUBJECT_PREFIX###"]=$conf["newReply."]["subjectPrefix"];
} else { // If new thread:
$msg = t3lib_div::getUrl($GLOBALS["TSFE"]->tmpl->getFileName($conf["newThread."]["msg"]));
$markersArray["###DID_WHAT###"]= $conf["newThread."]["didWhat"];
$markersArray["###SUBJECT_PREFIX###"]=$conf["newThread."]["subjectPrefix"];
}
$markersArray["###SUBJECT###"] = stripslashes(strtoupper($this->newData["tt_board"]["NEW"][subject]));
$markersArray["###BODY###"] = t3lib_div::fixed_lgd(stripslashes($this->newData["tt_board"]["NEW"][message]),1000);
reset($markersArray);
while(list($marker,$markContent)=each($markersArray)) {
$msg=str_replace($marker,$markContent,$msg);
}
$headers=array();
if ($conf["notify_from"]) {$headers[]="FROM: ".$conf["notify_from"];}
$msgParts = split(chr(10),$msg,2);
if ($conf["debug"]) {
debug($notifyMe,1);
debug($headers,1);
debug($msgParts);
} else {
mail ($notifyMe, $msgParts[0], $msgParts[1], implode($headers,chr(10)));
}
}
}
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<TITLE>Board example template</TITLE>
</head>
<body>
<br>
<br>
<br>
<H1>BOARD TEMPLATES</H1>
<h2>EXAMPLE 1 - LIST style</h2>
<br>
<br>
<br>
<pre>
<strong>Global markers, as set up in TypoScript:</strong>
These are substituted throughout the whole template.
GW1B / GW1E
GW2B / GW2E
GW3B / GW3E
GC1
GC2
GC3
GC4
</pre>
<BR><BR><BR><BR><HR><BR><BR><BR>
<h3>TEMPLATE_OVERVIEW</h3>
<em>This is the template for the overview of categories and forums.</em><br>
<pre>
// Category Markers:
CATEGORY_TITLE
CATEGORY_DESCRIPTION
CATEGORY_FORUMNUMBER
// Category subparts:
LINK
// Forum Markers:
FORUM_POSTS
FORUM_THREADS
FORUM_TITLE
FORUM_DESCRIPTION
LAST_POST_DATE,
LAST_POST_TIME
LAST_POST_AUTHOR
LAST_POST_AGE
// Forum subparts:
LINK
LINK_LAST_POST
// Post Markers:
POST_TITLE // include link
POST_CONTENT
POST_REPLIES
POST_AUTHOR
POST_DATE,
POST_TIME
POST_AGE
// Post Subparts:
LINK
</pre>
<br>
<br>
<!-- ###TEMPLATE_OVERVIEW### begin
This is the template for the overview of categories and forums.
-->
<TABLE cellpadding="4" cellspacing="1" border="0" width="98%">
<TR bgcolor="###GC3###">
<TD>&nbsp;</TD>
<TD valign="bottom">###GW3B### <B>Forum</B> ###GW3E###
</TD><TD nowrap valign="bottom" align="center"><B>###GW3B### Posts ###GW3E###</B></TD>
<TD nowrap valign="bottom" align="center"><B>###GW3B### Threads ###GW3E###</B></TD>
<TD nowrap valign="bottom" align="center">###GW3B### <B>Last Post</B>###GW3E###</TD>
</TR>
<!-- ###CONTENT### begin
This is the part of the template substituted with the list of categories and forums:
-->
<!-- ###CATEGORY### begin
Template for the category title
-->
<TR bgcolor="###GC4###">
<TD colspan="5"><B>###GW2B###<font color="#FFFFFF"><!--###LINK###-->###CATEGORY_TITLE###<!--###LINK###--></FONT>###GW2E###</B></TD>
</TR>
<!-- ###CATEGORY### end -->
<!-- ###FORUM### begin
Template for the display of forum information
-->
<TR>
<TD bgcolor="###GC2###" align="center" valign="top"><IMG src="clear.gif" width=20 height=1 border="0"></TD>
<TD bgcolor="###GC2###" valign="top">###GW1B### <B><!--###LINK###-->###FORUM_TITLE###<!--###LINK###--></B>###GW1E###<BR>###GW2B### ###FORUM_DESCRIPTION### ###GW2E###</TD>
<TD bgcolor="###GC1###" align="center" valign="top" nowrap>###GW1B### ###FORUM_POSTS### ###GW1E###</TD>
<TD bgcolor="###GC2###" align="center" valign="top" nowrap>###GW1B### ###FORUM_THREADS### ###GW1E###</TD>
<TD bgcolor="###GC1###" nowrap valign="top" align="center">###GW2B### <!--###LINK_LAST_POST###-->Last Post!<!--###LINK_LAST_POST###--> ###LAST_POST_DATE### ###LAST_POST_TIME###<BR>###LAST_POST_AUTHOR### - ###LAST_POST_AGE### ###GW2E###</TD>
</TR>
<!-- ###FORUM### end-->
<!-- ###POST### begin
Template for the display of latest posts of a forum
-->
<TR>
<TD align="center" valign="top">NEW!</TD>
<TD valign="top"><!--###LINK###-->###GW1B### <B>###POST_TITLE###</B>###GW1E###<!--###LINK###--><BR>###GW2B### ###POST_CONTENT### ###GW2E###</TD>
<TD align="center" valign="top" nowrap>###GW1B### ###POST_REPLIES### ###GW1E###</TD>
<TD align="center" valign="top" nowrap>###GW1B### &nbsp; ###GW1E###</TD>
<TD nowrap valign="top" align="center">###GW2B### ###POST_DATE### ###POST_TIME###<BR>###POST_AUTHOR### ###GW2E###</TD>
</TR>
<!-- ###POST### end-->
<!-- ###CONTENT### end -->
</TABLE>
<!-- ###TEMPLATE_OVERVIEW### end -->
<BR><BR><BR><BR><HR><BR><BR><BR>
<h3>TEMPLATE_FORUM</h3>
<em>Template for listing of items in a single forum.</em><br>
<pre>
// Post Markers
POST_THREAD_CODE
POST_TITLE
POST_CONTENT
POST_REPLIES