* Moved tstemplate, tstemplate_analyzer, tstemplate_ceditor, tstemplate_info, tstempl...
authorMichael Stucki <michael.stucki@typo3.org>
Fri, 23 Dec 2005 13:54:07 +0000 (13:54 +0000)
committerMichael Stucki <michael.stucki@typo3.org>
Fri, 23 Dec 2005 13:54:07 +0000 (13:54 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@925 709f56b5-9817-0410-a4d7-c38de5d9e867

86 files changed:
ChangeLog
typo3/sysext/tstemplate/ChangeLog [new file with mode: 0644]
typo3/sysext/tstemplate/ext_emconf.php [new file with mode: 0644]
typo3/sysext/tstemplate/ext_icon.gif [new file with mode: 0644]
typo3/sysext/tstemplate/ext_tables.php [new file with mode: 0644]
typo3/sysext/tstemplate/ts/clear.gif [new file with mode: 0644]
typo3/sysext/tstemplate/ts/conf.php [new file with mode: 0644]
typo3/sysext/tstemplate/ts/index.php [new file with mode: 0644]
typo3/sysext/tstemplate/ts/locallang_mod.php [new file with mode: 0644]
typo3/sysext/tstemplate/ts/ts.gif [new file with mode: 0644]
typo3/sysext/tstemplate/ts/ts1.gif [new file with mode: 0644]
typo3/sysext/tstemplate_analyzer/ChangeLog [new file with mode: 0644]
typo3/sysext/tstemplate_analyzer/class.tx_tstemplateanalyzer.php [new file with mode: 0644]
typo3/sysext/tstemplate_analyzer/ext_emconf.php [new file with mode: 0644]
typo3/sysext/tstemplate_analyzer/ext_icon.gif [new file with mode: 0644]
typo3/sysext/tstemplate_analyzer/ext_tables.php [new file with mode: 0644]
typo3/sysext/tstemplate_ceditor/ChangeLog [new file with mode: 0644]
typo3/sysext/tstemplate_ceditor/class.tx_tstemplateceditor.php [new file with mode: 0644]
typo3/sysext/tstemplate_ceditor/doc/TODO.txt [new file with mode: 0644]
typo3/sysext/tstemplate_ceditor/ext_emconf.php [new file with mode: 0644]
typo3/sysext/tstemplate_ceditor/ext_icon.gif [new file with mode: 0644]
typo3/sysext/tstemplate_ceditor/ext_tables.php [new file with mode: 0644]
typo3/sysext/tstemplate_ceditor/gfx/1.gif [new file with mode: 0644]
typo3/sysext/tstemplate_ceditor/gfx/10.gif [new file with mode: 0644]
typo3/sysext/tstemplate_ceditor/gfx/11.gif [new file with mode: 0644]
typo3/sysext/tstemplate_ceditor/gfx/12.gif [new file with mode: 0644]
typo3/sysext/tstemplate_ceditor/gfx/13.gif [new file with mode: 0644]
typo3/sysext/tstemplate_ceditor/gfx/14.gif [new file with mode: 0644]
typo3/sysext/tstemplate_ceditor/gfx/15.gif [new file with mode: 0644]
typo3/sysext/tstemplate_ceditor/gfx/16.gif [new file with mode: 0644]
typo3/sysext/tstemplate_ceditor/gfx/17.gif [new file with mode: 0644]
typo3/sysext/tstemplate_ceditor/gfx/18.gif [new file with mode: 0644]
typo3/sysext/tstemplate_ceditor/gfx/19.gif [new file with mode: 0644]
typo3/sysext/tstemplate_ceditor/gfx/2.gif [new file with mode: 0644]
typo3/sysext/tstemplate_ceditor/gfx/20.gif [new file with mode: 0644]
typo3/sysext/tstemplate_ceditor/gfx/3.gif [new file with mode: 0644]
typo3/sysext/tstemplate_ceditor/gfx/4.gif [new file with mode: 0644]
typo3/sysext/tstemplate_ceditor/gfx/5.gif [new file with mode: 0644]
typo3/sysext/tstemplate_ceditor/gfx/6.gif [new file with mode: 0644]
typo3/sysext/tstemplate_ceditor/gfx/7.gif [new file with mode: 0644]
typo3/sysext/tstemplate_ceditor/gfx/8.gif [new file with mode: 0644]
typo3/sysext/tstemplate_ceditor/gfx/9.gif [new file with mode: 0644]
typo3/sysext/tstemplate_ceditor/gfx/BUG_basic.gif [new file with mode: 0644]
typo3/sysext/tstemplate_ceditor/gfx/BUG_menu.gif [new file with mode: 0644]
typo3/sysext/tstemplate_ceditor/gfx/BUG_menu2.gif [new file with mode: 0644]
typo3/sysext/tstemplate_ceditor/gfx/BUSINESS_basic.gif [new file with mode: 0644]
typo3/sysext/tstemplate_ceditor/gfx/BUSINESS_menu.gif [new file with mode: 0644]
typo3/sysext/tstemplate_ceditor/gfx/CANDIDATE_basic.gif [new file with mode: 0644]
typo3/sysext/tstemplate_ceditor/gfx/CANDIDATE_menu.gif [new file with mode: 0644]
typo3/sysext/tstemplate_ceditor/gfx/CANDIDATE_page.gif [new file with mode: 0644]
typo3/sysext/tstemplate_ceditor/gfx/CrCPH_basic.gif [new file with mode: 0644]
typo3/sysext/tstemplate_ceditor/gfx/FIRST_basic.gif [new file with mode: 0644]
typo3/sysext/tstemplate_ceditor/gfx/FIRST_menu.gif [new file with mode: 0644]
typo3/sysext/tstemplate_ceditor/gfx/GLCK_basic.gif [new file with mode: 0644]
typo3/sysext/tstemplate_ceditor/gfx/GLCK_columns.gif [new file with mode: 0644]
typo3/sysext/tstemplate_ceditor/gfx/GLCK_menu.gif [new file with mode: 0644]
typo3/sysext/tstemplate_ceditor/gfx/GREEN_basic.gif [new file with mode: 0644]
typo3/sysext/tstemplate_ceditor/gfx/GREEN_menu.gif [new file with mode: 0644]
typo3/sysext/tstemplate_ceditor/gfx/GREEN_menu2.gif [new file with mode: 0644]
typo3/sysext/tstemplate_ceditor/gfx/GREEN_menu3.gif [new file with mode: 0644]
typo3/sysext/tstemplate_ceditor/gfx/HYPER_basic.gif [new file with mode: 0644]
typo3/sysext/tstemplate_ceditor/gfx/HYPER_menu.gif [new file with mode: 0644]
typo3/sysext/tstemplate_ceditor/gfx/HYPER_menu2.gif [new file with mode: 0644]
typo3/sysext/tstemplate_ceditor/gfx/HYPER_page.gif [new file with mode: 0644]
typo3/sysext/tstemplate_ceditor/gfx/HYPER_toptitle.gif [new file with mode: 0644]
typo3/sysext/tstemplate_ceditor/gfx/MM_basic.gif [new file with mode: 0644]
typo3/sysext/tstemplate_ceditor/gfx/MM_menu.gif [new file with mode: 0644]
typo3/sysext/tstemplate_ceditor/gfx/MM_right.gif [new file with mode: 0644]
typo3/sysext/tstemplate_ceditor/gfx/NEWSLETTER_basic.gif [new file with mode: 0644]
typo3/sysext/tstemplate_ceditor/gfx/RE_basic.gif [new file with mode: 0644]
typo3/sysext/tstemplate_ceditor/gfx/RE_leftmenu.gif [new file with mode: 0644]
typo3/sysext/tstemplate_ceditor/gfx/RE_menu.gif [new file with mode: 0644]
typo3/sysext/tstemplate_ceditor/gfx/RE_top.gif [new file with mode: 0644]
typo3/sysext/tstemplate_ceditor/gfx/TU_basic.gif [new file with mode: 0644]
typo3/sysext/tstemplate_ceditor/gfx/TU_menu.gif [new file with mode: 0644]
typo3/sysext/tstemplate_info/ChangeLog [new file with mode: 0644]
typo3/sysext/tstemplate_info/class.tx_tstemplateinfo.php [new file with mode: 0644]
typo3/sysext/tstemplate_info/ext_emconf.php [new file with mode: 0644]
typo3/sysext/tstemplate_info/ext_icon.gif [new file with mode: 0644]
typo3/sysext/tstemplate_info/ext_tables.php [new file with mode: 0644]
typo3/sysext/tstemplate_objbrowser/ChangeLog [new file with mode: 0644]
typo3/sysext/tstemplate_objbrowser/class.tx_tstemplateobjbrowser.php [new file with mode: 0644]
typo3/sysext/tstemplate_objbrowser/doc/TODO.txt [new file with mode: 0644]
typo3/sysext/tstemplate_objbrowser/ext_emconf.php [new file with mode: 0644]
typo3/sysext/tstemplate_objbrowser/ext_icon.gif [new file with mode: 0644]
typo3/sysext/tstemplate_objbrowser/ext_tables.php [new file with mode: 0644]

index a0a8189..b75dae3 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,8 +1,13 @@
+2005-12-23  Michael Stucki  <michael@typo3.org>
+
+       * Moved tstemplate, tstemplate_analyzer, tstemplate_ceditor, tstemplate_info, tstemplate_objbrowser as system extensions to TYPO3core
+
 2005-12-21  Christian Jul Jensen  <julle@typo3.org>
 
        * Fixed bug regarding MM-relations to same table in befunc::getProcessedValues
 
-2005-12-19  Michael Scharkow <michael@underused.org>
+2005-12-19  Michael Scharkow  <michael@underused.org>
+
        * Fixed bug #1915: trigger 404 with bogus aliases
 
 2005-12-19  Sebastian Kurfuerst  <sebastian@garbahe-group.de>
diff --git a/typo3/sysext/tstemplate/ChangeLog b/typo3/sysext/tstemplate/ChangeLog
new file mode 100644 (file)
index 0000000..a21c14f
--- /dev/null
@@ -0,0 +1,11 @@
+2005-12-23  Michael Stucki  <michael@typo3.org>
+
+       * Moved tstemplate, tstemplate_analyzer, tstemplate_ceditor, tstemplate_info, tstemplate_objbrowser as system extensions to TYPO3core
+
+2005-12-15  Michael Stucki  <michael@typo3.org>
+
+       * Small change related with the object-list fix in the object browser
+
+2005-11-25  Michael Stucki  <michael@typo3.org>
+
+       * Added a ChangeLog
diff --git a/typo3/sysext/tstemplate/ext_emconf.php b/typo3/sysext/tstemplate/ext_emconf.php
new file mode 100644 (file)
index 0000000..112df05
--- /dev/null
@@ -0,0 +1,42 @@
+<?php
+
+########################################################################
+# Extension Manager/Repository config file for ext: "tstemplate"
+# 
+# Auto generated 07-10-2005 15:54
+# 
+# Manual updates:
+# Only the data in the array - anything else is removed by next write
+########################################################################
+
+$EM_CONF[$_EXTKEY] = Array (
+       'title' => 'Web>Template',
+       'description' => 'Framework for management of TypoScript template records for the CMS frontend.',
+       'category' => 'module',
+       'shy' => 1,
+       'dependencies' => 'cms',
+       'conflicts' => '',
+       'priority' => '',
+       'loadOrder' => '',
+       'TYPO3_version' => '-',
+       'PHP_version' => '-',
+       'module' => 'ts',
+       'state' => 'stable',
+       'internal' => 0,
+       'uploadfolder' => 0,
+       'createDirs' => '',
+       'modify_tables' => '',
+       'clearCacheOnLoad' => 0,
+       'lockType' => '',
+       'author' => 'Kasper Skårhøj',
+       'author_email' => 'kasperYYYY@typo3.com',
+       'author_company' => 'Curby Soft Multimedia',
+       'CGLcompliance' => '',
+       'CGLcompliance_note' => '',
+       'private' => 0,
+       'download_password' => '',
+       'version' => '0.0.5',   // Don't modify this! Managed automatically during upload to repository.
+       '_md5_values_when_last_written' => 'a:8:{s:12:"ext_icon.gif";s:4:"a421";s:14:"ext_tables.php";s:4:"041b";s:12:"ts/clear.gif";s:4:"cc11";s:11:"ts/conf.php";s:4:"0862";s:12:"ts/index.php";s:4:"cc15";s:20:"ts/locallang_mod.php";s:4:"9c7a";s:9:"ts/ts.gif";s:4:"18cb";s:10:"ts/ts1.gif";s:4:"a421";}',
+);
+
+?>
\ No newline at end of file
diff --git a/typo3/sysext/tstemplate/ext_icon.gif b/typo3/sysext/tstemplate/ext_icon.gif
new file mode 100644 (file)
index 0000000..e15e35f
Binary files /dev/null and b/typo3/sysext/tstemplate/ext_icon.gif differ
diff --git a/typo3/sysext/tstemplate/ext_tables.php b/typo3/sysext/tstemplate/ext_tables.php
new file mode 100644 (file)
index 0000000..d3e8e88
--- /dev/null
@@ -0,0 +1,5 @@
+<?php
+if (!defined ('TYPO3_MODE'))   die ('Access denied.');
+
+if (TYPO3_MODE=='BE')  t3lib_extMgm::addModule('web','ts','',t3lib_extMgm::extPath($_EXTKEY).'ts/');
+?>
\ No newline at end of file
diff --git a/typo3/sysext/tstemplate/ts/clear.gif b/typo3/sysext/tstemplate/ts/clear.gif
new file mode 100644 (file)
index 0000000..9ed1269
Binary files /dev/null and b/typo3/sysext/tstemplate/ts/clear.gif differ
diff --git a/typo3/sysext/tstemplate/ts/conf.php b/typo3/sysext/tstemplate/ts/conf.php
new file mode 100644 (file)
index 0000000..5d7876b
--- /dev/null
@@ -0,0 +1,11 @@
+<?php
+define('TYPO3_MOD_PATH', 'ext/tstemplate/ts/');
+$BACK_PATH='../../../';
+
+$MLANG['default']['tabs_images']['tab'] = 'ts1.gif';
+$MLANG['default']['ll_ref']='LLL:EXT:tstemplate/ts/locallang_mod.php';
+
+$MCONF['script']='index.php';
+$MCONF['access']='admin';              // If this is changed so not only admin-users can manipulate templates, there need to be done something with the constant editor that is not allowed to 'clear all cache' then!!
+$MCONF['name']='web_ts';
+?>
\ No newline at end of file
diff --git a/typo3/sysext/tstemplate/ts/index.php b/typo3/sysext/tstemplate/ts/index.php
new file mode 100644 (file)
index 0000000..fbce510
--- /dev/null
@@ -0,0 +1,444 @@
+<?php
+/***************************************************************
+*  Copyright notice
+*
+*  (c) 1999-2005 Kasper Skaarhoj (kasperYYYY@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: TypoScript Tools
+ *
+ *
+ *     $TYPO3_CONF_VARS["MODS"]["web_ts"]["onlineResourceDir"]  = Directory of default resources. Eg. "fileadmin/res/" or so.
+ *
+ *
+ * @author     Kasper Skårhøj <kasperYYYY@typo3.com>
+ */
+
+
+
+unset($MCONF);
+require ("conf.php");
+require ($BACK_PATH."init.php");
+require ($BACK_PATH."template.php");
+require_once (PATH_t3lib."class.t3lib_page.php");
+require_once (PATH_t3lib."class.t3lib_tstemplate.php");
+require_once (PATH_t3lib."class.t3lib_tsparser_ext.php");
+
+require_once (PATH_t3lib."class.t3lib_scbase.php");
+
+$BE_USER->modAccess($MCONF,1);
+
+
+// ***************************
+// Script Classes
+// ***************************
+class SC_mod_web_ts_index extends t3lib_SCbase {
+       var $perms_clause;
+       var $e;
+       var $sObj;
+       var $edit;
+       var $textExtensions = "html,htm,txt,css,tmpl,inc";
+
+       var $modMenu_type = "";
+       var $modMenu_dontValidateList = "ts_browser_toplevel_setup,ts_browser_toplevel_const,ts_browser_TLKeys_setup,ts_browser_TLKeys_const";
+       var $modMenu_setDefaultList = "ts_browser_linkObjects,ts_browser_fixedLgd";
+
+       function init() {
+               global $BE_USER,$LANG,$BACK_PATH,$TCA_DESCR,$TCA,$CLIENT,$TYPO3_CONF_VARS;
+
+               parent::init();
+
+               $this->id = intval(t3lib_div::_GP("id"));
+               $this->e = t3lib_div::_GP("e");
+               $this->sObj = t3lib_div::_GP("sObj");
+               $this->edit = t3lib_div::_GP("edit");
+
+               $this->perms_clause = $BE_USER->getPagePermsClause(1);
+
+               if (t3lib_div::_GP("clear_all_cache"))  {
+                       $this->include_once[]=PATH_t3lib."class.t3lib_tcemain.php";
+               }
+       }
+       function clearCache()   {
+               if (t3lib_div::_GP("clear_all_cache"))  {
+                       $tce = t3lib_div::makeInstance("t3lib_TCEmain");
+                       $tce->stripslashes_values=0;
+                       $tce->start(Array(),Array());
+                       $tce->clear_cacheCmd("all");
+               }
+       }
+       function main() {
+               global $BE_USER,$LANG,$BACK_PATH,$TCA_DESCR,$TCA,$CLIENT,$TYPO3_CONF_VARS;
+
+               // Access check...
+               // The page will show only if there is a valid page and if this page may be viewed by the user
+               $pageinfo = t3lib_BEfunc::readPageAccess($this->id,$this->perms_clause);
+               $access = is_array($pageinfo) ? 1 : 0;
+
+               if ($this->id && $access)       {
+                       $this->doc = t3lib_div::makeInstance("template");
+                       $this->doc->backPath = $BACK_PATH;
+
+
+                               // JavaScript
+                       $this->doc->JScode = '
+               <script language="javascript" type="text/javascript">
+                       script_ended = 0;
+                       function jumpToUrl(URL) {
+                               document.location = URL;
+                       }
+                       function uFormUrl(aname)        {
+                               document.forms[0].action = "index.php?id='.$this->id.'#"+aname;
+                       }
+                       function brPoint(lnumber,t)     {
+                               document.location = "index.php?id='.$this->id.'&SET[function]=tx_tstemplateobjbrowser&SET[ts_browser_type]="+(t?"setup":"const")+"&breakPointLN="+lnumber;
+                               return false;
+                       }
+               </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->inDocStylesArray[] = '
+                               TABLE#typo3-objectBrowser A { text-decoration: none; }
+                       ';
+
+
+                               // 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];
+
+
+                       $headerSection = $this->doc->getHeader("pages",$pageinfo,$pageinfo["_thePath"]).'<br>'.
+                               $LANG->sL("LLL:EXT:lang/locallang_core.php:labels.path").': '.
+                               '<span title="'.htmlspecialchars($pageinfo['_thePathFull']).'">'.htmlspecialchars(t3lib_div::fixed_lgd_cs($pageinfo['_thePath'],-50)).'</span>';
+
+                               // Draw the header.
+                       $this->doc->form='<form action="index.php?id='.$this->id.'" method="post" enctype="'.$GLOBALS["TYPO3_CONF_VARS"]["SYS"]["form_enctype"].'" name="editForm">';
+                       $this->content.=$this->doc->startPage("Template Tools");
+                       $this->content.=$this->doc->header("Template Tools");
+                       $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->extObjContent();
+
+
+
+                       // ShortCut
+                       if ($BE_USER->mayMakeShortcut())        {
+                               $this->content.=$this->doc->spacer(20).$this->doc->section('',$this->doc->makeShortcutIcon("id,e,sObj,template","function,ts_browser_type,constant_editor_cat",$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->backPath = $BACK_PATH;
+
+                       $this->content.=$this->doc->startPage("Template Tools");
+                       $this->content.=$this->doc->header("Template Tools");
+                       $this->content.=$this->doc->spacer(5);
+
+
+                               // Template pages:
+                       $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
+                                               'pages.uid, count(*) AS count, max(sys_template.root) AS root_max_val, min(sys_template.root) AS root_min_val',
+                                               'pages,sys_template',
+                                               'pages.uid=sys_template.pid'.
+                                                       t3lib_BEfunc::deleteClause('pages').
+                                                       t3lib_BEfunc::versioningPlaceholderClause('pages').
+                                                       t3lib_BEfunc::deleteClause('sys_template').
+                                                       t3lib_BEfunc::versioningPlaceholderClause('sys_template'),
+                                               'pages.uid'
+                                       );
+                       $templateArray = array();
+                       $pArray = array();
+                       while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res))       {
+                               $this->setInPageArray(
+                                       $pArray,
+                                       t3lib_BEfunc::BEgetRootLine ($row["uid"],"AND 1=1"),
+                                       $row
+                               );
+                       }
+
+                       $lines = array();
+                       $lines[] = '<tr class="bgColor5">
+                               <td nowrap><strong>Page name</strong></td>
+                               <td nowrap><strong># Templates</strong></td>
+                               <td nowrap><strong>Is Root?</strong></td>
+                               <td nowrap><strong>Is Ext?</strong></td>
+                               </tr>';
+                       $lines = array_merge($lines,$this->renderList($pArray));
+
+                       $table = '<table border=0 cellpadding=0 cellspacing=1>'.implode("",$lines).'</table>';
+                       $this->content.= $this->doc->section("",'
+                       <BR>
+                       This is an overview of the pages in the database containing one or more template records. Click a page title to go to the page.
+                       <BR><BR>
+                       '.$table);
+               //      debug($pArray);
+                       // ********************************************
+                       // RENDER LIST of pages with templates, END
+                       // ********************************************
+
+
+
+                       // ShortCut
+                       if ($BE_USER->mayMakeShortcut())        {
+                               $this->content.=$this->doc->spacer(20).$this->doc->section('',$this->doc->makeShortcutIcon("id","",$this->MCONF["name"]));
+                       }
+
+                       $this->content.=$this->doc->spacer(10);
+               }
+       }
+       function printContent() {
+
+               $this->content.=$this->doc->endPage();
+               echo $this->content;
+       }
+
+       // ***************************
+       // OTHER FUNCTIONS:
+       // ***************************
+       function getCountCacheTables($humanReadable)    {
+               $out=array();
+
+               $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('count(*)', 'cache_pages', '');
+               list($out["cache_pages"]) = $GLOBALS['TYPO3_DB']->sql_fetch_row($res);
+
+               $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('count(*)', 'cache_pagesection', '');
+               list($out["cache_pagesection"]) = $GLOBALS['TYPO3_DB']->sql_fetch_row($res);
+
+               $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('count(*)', 'cache_hash', '');
+               list($out["cache_hash"]) = $GLOBALS['TYPO3_DB']->sql_fetch_row($res);
+
+               if ($humanReadable)     {
+                       $newOut=array();
+                       reset($out);
+                       while(list($k,$v)=each($out))   {
+                               $newOut[]=$k.":".$v;
+                       }
+                       $out=implode($newOut,", ");
+               }
+               return $out;
+       }
+
+       function linkWrapTemplateTitle($title,$onlyKey="")      {
+               if ($onlyKey)   {
+                       $title = '<a href="index.php?id='.$GLOBALS["SOBE"]->id.'&e['.$onlyKey.']=1&SET[function]=tx_tstemplateinfo">'.htmlspecialchars($title).'</a>';
+               } else {
+                       $title = '<a href="index.php?id='.$GLOBALS["SOBE"]->id.'&e[constants]=1&e[config]=1&SET[function]=tx_tstemplateinfo">'.htmlspecialchars($title).'</a>';
+               }
+               return $title;
+       }
+       function noTemplate($newStandardTemplate=0)     {
+               global $SOBE;
+
+               $tmpl = t3lib_div::makeInstance("t3lib_tsparser_ext");  // Defined global here!
+               $tmpl->tt_track = 0;    // Do not log time-performance information
+               $tmpl->init();
+
+               $confirm = ' onClick="return confirm(\'Are you sure you want to do this?\');"';
+
+                       // No template
+               $theOutput.=$this->doc->spacer(10);
+               $theOutput.=$this->doc->section('<span class="typo3-red">No template</span>',"There was no template on this page!<BR>Create a template record first in order to edit constants!",0,0,0,1);
+                       // New standard?
+               if ($newStandardTemplate)       {
+                       $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('title,uid', 'static_template', '', '', 'title');
+                       $opt = "";
+                       while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res))       {
+                               if (substr(trim($row["title"]),0,8)=="template")        {
+                                       $opt.='<option value="'.$row["uid"].'">'.htmlspecialchars($row["title"]).'</option>';
+                               }
+                       }
+                       $selector = '<select name="createStandard"><option></option>'.$opt.'</select>';
+                               // Extension?
+                       $theOutput.=$this->doc->spacer(10);
+                       $theOutput.=$this->doc->section("Create new website",'If you want this page to be the root of a new website, optionally based on one of the standard templates, then press the button below:<BR>
+                       <BR>
+                       '.$selector.'<BR>
+                       <img src="'.$GLOBALS["BACK_PATH"].'t3lib/gfx/icon_warning.gif" width=18 height=16 hspace=5 align=top><input type="Submit" name="newWebsite" value="Create template for a new site"'.$confirm.'>',0,1);
+               }
+                       // Extension?
+               $theOutput.=$this->doc->spacer(10);
+               $theOutput.=$this->doc->section("Create extension template",'An extension template allows you to enter TypoScript values that will affect only this page and subpages.<BR><BR><img src="'.$GLOBALS["BACK_PATH"].'t3lib/gfx/icon_warning.gif" width=18 height=16 hspace=5 align=top><input type="submit" name="createExtension" value="Click here to create an extension template."'.$confirm.'>',0,1);
+
+                       // Go to first appearing...
+               $first = $tmpl->ext_prevPageWithTemplate($this->id,$this->perms_clause);
+               if ($first)     {
+                       $theOutput.=$this->doc->spacer(10);
+                       $theOutput.=$this->doc->section("Go to closest page with template",sprintf("Closest template is on page '%s' (uid %s).<BR><BR>%s<strong>Click here to go.</strong>%s",$first["title"],$first["uid"],'<a href="index.php?id='.$first["uid"].'">','</a>'),0,1);
+               }
+               return $theOutput;
+       }
+       function templateMenu() {
+               $tmpl = t3lib_div::makeInstance("t3lib_tsparser_ext");  // Defined global here!
+               $tmpl->tt_track = 0;    // Do not log time-performance information
+               $tmpl->init();
+               $all = $tmpl->ext_getAllTemplates($this->id,$this->perms_clause);
+               $menu='';
+               if (count($all)>1)      {
+                       $this->MOD_MENU['templatesOnPage']=array();
+                       foreach($all as $d)     {
+                               $this->MOD_MENU['templatesOnPage'][$d['uid']] = $d['title'];
+                       }
+               }
+
+               $this->MOD_SETTINGS = t3lib_BEfunc::getModuleData($this->MOD_MENU, t3lib_div::_GP('SET'), $this->MCONF['name']);
+               $menu = t3lib_BEfunc::getFuncMenu($this->id,'SET[templatesOnPage]',$this->MOD_SETTINGS['templatesOnPage'],$this->MOD_MENU['templatesOnPage']);
+
+               return $menu;
+       }
+       function createTemplate($id)    {
+               if (t3lib_div::_GP("createExtension"))  {
+                       require_once (PATH_t3lib."class.t3lib_tcemain.php");
+                       $tce = t3lib_div::makeInstance("t3lib_TCEmain");
+                       $tce->stripslashes_values=0;
+                       $recData=array();
+                       $recData["sys_template"]["NEW"] = array(
+                               "pid" => $id,
+                               "title" => "+ext",
+                               "sorting" => time()
+                       );
+                       $tce->start($recData,Array());
+                       $tce->process_datamap();
+               } elseif (t3lib_div::_GP("newWebsite")) {
+                       require_once (PATH_t3lib."class.t3lib_tcemain.php");
+                       $tce = t3lib_div::makeInstance("t3lib_TCEmain");
+                       $tce->stripslashes_values=0;
+                       $recData=array();
+                       if (intval(t3lib_div::_GP("createStandard")))   {
+                               $staticT = intval(t3lib_div::_GP("createStandard"));
+                               $recData["sys_template"]["NEW"] = array(
+                                       "pid" => $id,
+                                       "title" => "NEW SITE, based on standard",
+                                       "sorting" => 0,
+                                       "root" => 1,
+                                       "clear" => 3,
+                                       "include_static" => $staticT.",57"      // 57 is cSet
+                               );
+                       } else {
+                               $recData["sys_template"]["NEW"] = array(
+                                       "pid" => $id,
+                                       "title" => "NEW SITE",
+                                       "sorting" => 0,
+                                       "root" => 1,
+                                       "clear" => 3,
+                                       "config" => '
+# Default PAGE object:
+page = PAGE
+page.10 = TEXT
+page.10.value = HELLO WORLD!
+'
+                               );
+                       }
+                       $tce->start($recData,Array());
+                       $tce->process_datamap();
+                       $tce->clear_cacheCmd("all");
+               }
+       }
+       // ********************************************
+       // RENDER LIST of pages with templates, BEGIN
+       // ********************************************
+       function setInPageArray(&$pArray,$rlArr,$row)   {
+               ksort($rlArr);
+               reset($rlArr);
+               if (!$rlArr[0]["uid"])          array_shift($rlArr);
+
+               $cEl = current($rlArr);
+               $pArray[$cEl["uid"]]=$cEl["title"];
+               array_shift($rlArr);
+               if (count($rlArr))      {
+                       if (!isset($pArray[$cEl["uid"]."."]))   $pArray[$cEl["uid"]."."]=array();
+                       $this->setInPageArray($pArray[$cEl["uid"]."."],$rlArr,$row);
+               } else {
+                       $pArray[$cEl["uid"]."_"]=$row;
+               }
+       }
+       function renderList($pArray,$lines=array(),$c=0)        {
+               if (is_array($pArray))  {
+                       reset($pArray);
+                       while(list($k,$v)=each($pArray))        {
+                               if (t3lib_div::testInt($k))     {
+                                       if (isset($pArray[$k."_"]))     {
+                                               $lines[]='<tr class="bgColor4">
+                                                       <td nowrap><img src=clear.gif width=1 height=1 hspace='.($c*10).' align=top>'.
+                                                       '<a href="'.t3lib_div::linkThisScript(array("id"=>$k)).'">'.
+                                                       t3lib_iconWorks::getIconImage("pages",t3lib_BEfunc::getRecordWSOL("pages",$k),$GLOBALS["BACK_PATH"],' align="top" title="ID: '.$k.'"').
+                                                       t3lib_div::fixed_lgd_cs($pArray[$k],30).'</a></td>
+                                                       <td align=center>'.$pArray[$k."_"]["count"].'</td>
+                                                       <td align=center>'.($pArray[$k."_"]["root_max_val"]>0?"x":"&nbsp;").'</td>
+                                                       <td align=center>'.($pArray[$k."_"]["root_min_val"]==0?"x":"&nbsp;").'</td>
+                                                       </tr>';
+                                       } else {
+                                               $lines[]='<tr>
+                                                       <td nowrap colspan=3><img src=clear.gif width=1 height=1 hspace='.($c*10).' align=top>'.
+                                                       t3lib_iconWorks::getIconImage("pages",t3lib_BEfunc::getRecordWSOL("pages",$k),$GLOBALS["BACK_PATH"]," align=top").
+                                                       t3lib_div::fixed_lgd_cs($pArray[$k],30).'</td>
+                                                       </tr>';
+                                       }
+                                       $lines=$this->renderList($pArray[$k."."],$lines,$c+1);
+                               }
+                       }
+               }
+               return $lines;
+       }
+}
+
+// Include extension?
+if (defined("TYPO3_MODE") && $TYPO3_CONF_VARS[TYPO3_MODE]["XCLASS"]["ext/tstemplate/ts/index.php"])    {
+       include_once($TYPO3_CONF_VARS[TYPO3_MODE]["XCLASS"]["ext/tstemplate/ts/index.php"]);
+}
+
+
+
+
+
+
+
+
+
+
+
+
+// Make instance:
+$SOBE = t3lib_div::makeInstance("SC_mod_web_ts_index");
+$SOBE->init();
+
+// Include files?
+foreach($SOBE->include_once as $INC_FILE)      include_once($INC_FILE);
+$SOBE->checkExtObj();  // Checking for first level external objects
+
+$SOBE->clearCache();
+$SOBE->main();
+$SOBE->printContent();
+?>
diff --git a/typo3/sysext/tstemplate/ts/locallang_mod.php b/typo3/sysext/tstemplate/ts/locallang_mod.php
new file mode 100644 (file)
index 0000000..f367f75
--- /dev/null
@@ -0,0 +1,93 @@
+<?php
+
+$LOCAL_LANG = Array (
+       'default' => Array (
+               'mlang_labels_tablabel' => 'Template tools',
+               'mlang_labels_tabdescr' => 'Here you manage the TypoScript templates which are in charge of the look of your website on the frontend. The module provides specialized features like an object browser, a constant editor and raw editing facilities.<br /><em>Access for \'admin\' users only!</em>',
+               'mlang_tabs_tab' => 'Template',
+       ),
+       'dk' => Array (
+               'mlang_labels_tablabel' => 'Skabelon værktøjer',
+               'mlang_labels_tabdescr' => 'Her bearbejder du dine TypoScript skabeloner som er afgørende for udseendet af dit website. Modulet giver dig adgang til specielle funktioner såsom en \'Object Browser\', \'Constant Editor\' samt egentlige redigeringsfaciliteter.<br /><em>Adgang kun for \'admin\' brugere!</em>',
+               'mlang_tabs_tab' => 'Skabelon',
+       ),
+       'de' => Array (
+               'mlang_labels_tablabel' => 'Template Werkzeuge',
+               'mlang_labels_tabdescr' => 'Hier können Sie die TypoScript Templates verwalten. Diese Templates sind für das Erscheinungsbild Ihrer Webseite verantwortlich. Das Modul bietet spezielle Funktionen wie einen Objekt-Browser, einen Konstanteneditor und einfache Bearbeitungsmöglichkeiten.<br /><em>Zugriff nur für Administratoren!</em>',
+               'mlang_tabs_tab' => 'Template',
+       ),
+       'no' => Array (
+               'mlang_labels_tablabel' => 'Mal verktøy',
+               'mlang_labels_tabdescr' => 'Her arbeider du med dine TypoScript maler som er avgjørende for utseendet på webområdet ditt. Modulen gir deg adgang til spesielle funksjoner slik som \'Objekt Browser\', \'Constant Editor\' samt egentlige redigeringsfasiliteter. <br /><em>Kun adgang for \'admin\' brukere!</em>',
+               'mlang_tabs_tab' => 'Mal',
+       ),
+       'it' => Array (
+               'mlang_labels_tablabel' => 'Strumenti templates',
+               'mlang_labels_tabdescr' => 'Attraverso questo modulo potete gestire i template Typoscript, che sono responsabili del layout del sito web. Il modulo offre speciali funzioni, tra le quali l\'object browser e l\'editor di costanti.<br /><em>L\'accesso è consentito solo agli utenti \'Admin\'!</em> ',
+               'mlang_tabs_tab' => 'Template',
+       ),
+       'fr' => Array (
+               'mlang_labels_tablabel' => 'Outils de gabarit.',
+               'mlang_labels_tabdescr' => 'Ici, vous pouvez manipuler les Gabarit TypoScript qui sont en charge de l\'aspect visuel de votre site. <br /><em>Accès réservé à l\'Administrateur, uniquement!<em>',
+               'mlang_tabs_tab' => 'Gabarit',
+       ),
+       'es' => Array (
+               'mlang_labels_tablabel' => 'Herramientas de Templates',
+               'mlang_labels_tabdescr' => 'El módulo WebList provee del acceso a mas bajo nivel de los registros que forman una página. En tanto que los otros módulos están especializados en cietas operaciones en ciertas tablas, este módulo permite el acceso total a los registros en crudo disponibles para el usuario.',
+               'mlang_tabs_tab' => 'Template',
+       ),
+       'nl' => Array (
+               'mlang_labels_tablabel' => 'Sjabloon werkset',
+               'mlang_labels_tabdescr' => 'Hier regel je de TypoScriptsjablonen die bepalen hoe je website er uit gaat zien. Deze module biedt gespecialiseerde onderdelen zoals een \'object browser\', een \'constant editor\' en simpele mogelijkheden om variabelen te aan te passen.<br /><em>Alleen toegankelijk voor \'admin\' gebruikers!</em> ',
+               'mlang_tabs_tab' => 'Sjabloon',
+       ),
+       'cz' => Array (
+               'mlang_labels_tablabel' => 'Nástroje pro \9aablony',
+               'mlang_labels_tabdescr' => 'Zde ovládáte \9aablony Typoscriptu, které odpovídají za vzhled va\9aeho website ve frontendu. Tento modul má specializované funkce jako je prohlí\9eeè objektù, editor konstant a pøímé editovací mo\9enosti.<br /><em>Pøístup pouze pro \'admin\' u\9eivatele!</em>',
+               'mlang_tabs_tab' => '\8aablona',
+       ),
+       'pl' => Array (
+               'mlang_labels_tablabel' => 'Narzêdzia szablonu',
+               'mlang_labels_tabdescr' => 'Tutaj zarz±dzasz szablonami, które s± odpowiedzialne za wygl±d witryny. Modu³ umo¿liwia przegl±danie obiektów i edycjê.<br /><em>Dostêp tylko dla administratorów!</em>',
+               'mlang_tabs_tab' => 'Szablon',
+       ),
+       'si' => Array (
+               'mlang_labels_tablabel' => 'Orodja za predloge',
+               'mlang_labels_tabdescr' => 'Tukaj urejate TypoScript predloge, ki so osnova izgleda va\9aih strani. Modul ima posebne mo\9enosti kot so pregledovalnik objektov, a urejevalnik konstant in neobdelanega besedila.<br /><em>Uporaba je dovoljena le \'admin\' uporabnikom!</em>',
+               'mlang_tabs_tab' => 'Predloge',
+       ),
+       'fi' => Array (
+               'mlang_labels_tablabel' => 'Malli työkalut',
+               'mlang_labels_tabdescr' => 'Täällä hoidat TypoScript mmalleja, joiden avulla www-sivusi saavat ulkonäkönsä. Moduli sisältää ominaisuuksia kuten objekstien selailua, määritysten muotilua ja suoria editointi mahdollisuuksia.<br /><em>Oikeudet vain \'Admin\' käyttäjille!</em>',
+               'mlang_tabs_tab' => 'Malli',
+       ),
+       'tr' => Array (
+               'mlang_labels_tablabel' => 'Þablon araçlarý',
+               'mlang_labels_tabdescr' => 'Burada websitenizin önplaný üzerinde olan Typoscript þablonlarýný kontrollü bir þekilde bakarak yönetebilirsiniz. Bu modül uzmanlaþmýþ özellikleri saðlar tarayýcý madde, sürekli düzenleyici ve henüz yapýlmamýþ donanýmlar gibi.<br /><em>Sadece kullanýcýlarýn \'yönetim\' için geçiþi!</em>',
+               'mlang_tabs_tab' => 'Þablon',
+       ),
+       'se' => Array (
+       ),
+       'pt' => Array (
+               'mlang_labels_tablabel' => 'Ferramentas dos Modelos',
+               'mlang_labels_tabdescr' => 'Quando mexe com os modelos TypoScript que são responsáveis pelo aspecto do seu site público.  O módulo fornece opções especializadas tais como um navegador de objectos, um editor de constantes e facilidades de edição básicas.<br /><em>Acesso só para utilizadores \'admin\'!</em>',
+               'mlang_tabs_tab' => 'Modelo',
+       ),
+       'ru' => Array (
+               'mlang_labels_tablabel' => 'Èíñòðóìåíòû äëÿ øàáëîíîâ',
+               'mlang_labels_tabdescr' => 'Çäåñü âû óïðàâëÿåòå âàøèìè øàáëîíàìè TypoScript, êîòîðûå îáåñïå÷èâàþò âíåøíèé ïîêàç âàøåãî ñàéòà. Ýòîò ìîäóëü ïðåäîñòàâëÿåò ñïåöèàëüíûå èíñòðóìåíòû, òàêèå êàê Îáúåêòíûé áðàóçåð, Ðåäàêòîð êîíñòàíò è äðóãèå ñðåäñòâà ðåäàêòèðîâàíèÿ.<br /><em>Äîñòóï òîëüêî äëÿ Àäìèíèñòðàòîðîâ</em>',
+               'mlang_tabs_tab' => 'Øàáëîí',
+       ),
+       'ro' => Array (
+               'mlang_labels_tablabel' => 'Utilitare template',
+               'mlang_labels_tabdescr' => 'Aici puteþi administra template-urile TypoScript, care controleazã modul în care aratã site-ul dumneavoastrã. Modulul vã oferã opþiuni specializate, cum ar fi trecere în revistã a obiectelor, editor de constante ºi facilitãþi de scris neformatat..<br /><em>Acces doar pentru administratori!</em>',
+               'mlang_tabs_tab' => 'Template',
+       ),
+       'ch' => Array (
+       ),
+       'sk' => Array (
+       ),
+       'lt' => Array (
+       ),
+);
+?>
\ No newline at end of file
diff --git a/typo3/sysext/tstemplate/ts/ts.gif b/typo3/sysext/tstemplate/ts/ts.gif
new file mode 100644 (file)
index 0000000..02e840e
Binary files /dev/null and b/typo3/sysext/tstemplate/ts/ts.gif differ
diff --git a/typo3/sysext/tstemplate/ts/ts1.gif b/typo3/sysext/tstemplate/ts/ts1.gif
new file mode 100644 (file)
index 0000000..e15e35f
Binary files /dev/null and b/typo3/sysext/tstemplate/ts/ts1.gif differ
diff --git a/typo3/sysext/tstemplate_analyzer/ChangeLog b/typo3/sysext/tstemplate_analyzer/ChangeLog
new file mode 100644 (file)
index 0000000..95299d4
--- /dev/null
@@ -0,0 +1,7 @@
+2005-12-23  Michael Stucki  <michael@typo3.org>
+
+       * Moved tstemplate, tstemplate_analyzer, tstemplate_ceditor, tstemplate_info, tstemplate_objbrowser as system extensions to TYPO3core
+
+2005-11-25  Michael Stucki  <michael@typo3.org>
+
+       * Added a ChangeLog
diff --git a/typo3/sysext/tstemplate_analyzer/class.tx_tstemplateanalyzer.php b/typo3/sysext/tstemplate_analyzer/class.tx_tstemplateanalyzer.php
new file mode 100644 (file)
index 0000000..54d0e11
--- /dev/null
@@ -0,0 +1,210 @@
+<?php
+/***************************************************************
+*  Copyright notice
+*
+*  (c) 1999-2005 Kasper Skaarhoj (kasperYYYY@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!
+***************************************************************/
+/**
+ * @author     Kasper Skårhøj <kasperYYYY@typo3.com>
+ */
+
+require_once(PATH_t3lib."class.t3lib_extobjbase.php");
+
+class tx_tstemplateanalyzer extends t3lib_extobjbase {
+       function modMenu()      {
+               global $LANG;
+
+               return Array (
+                       "ts_analyzer_checkSetup" => "",
+                       "ts_analyzer_checkConst" => "",
+                       "ts_analyzer_checkLinenum" => "",
+                       "ts_analyzer_checkComments" => "",
+                       "ts_analyzer_checkCrop" => "",
+                       "ts_analyzer_checkSyntax" => "",
+                       "ts_analyzer_checkSyntaxBlockmode" => "",
+               );
+       }
+
+       function initialize_editor($pageId,$template_uid=0)     {
+                       // Initializes the module. Done in this function because we may need to re-initialize if data is submitted!
+               global $tmpl,$tplRow,$theConstants,$rootLine;
+
+               $tmpl = t3lib_div::makeInstance("t3lib_tsparser_ext");  // Defined global here!
+               $tmpl->tt_track = 0;    // Do not log time-performance information
+               $tmpl->init();
+
+                       // Gets the rootLine
+               $sys_page = t3lib_div::makeInstance("t3lib_pageSelect");
+               $rootLine = $sys_page->getRootLine($pageId);
+               $tmpl->runThroughTemplates($rootLine,$template_uid);    // This generates the constants/config + hierarchy info for the template.
+
+               $tplRow = $tmpl->ext_getFirstTemplate($pageId,$template_uid);   // Get the row of the first VISIBLE template of the page. whereclause like the frontend.
+               if (is_array($tplRow))  {       // IF there was a template...
+                       return 1;
+               }
+       }
+       function main() {
+                       // Initializes the module. Done in this function because we may need to re-initialize if data is submitted!
+               global $SOBE,$BE_USER,$LANG,$BACK_PATH,$TCA_DESCR,$TCA,$CLIENT,$TYPO3_CONF_VARS;
+               global $tmpl,$tplRow,$theConstants,$rootLine;
+
+               // **************************
+               // Checking for more than one template an if, set a menu...
+               // **************************
+               $manyTemplatesMenu = $this->pObj->templateMenu();
+               $template_uid = 0;
+               if ($manyTemplatesMenu) {
+                       $template_uid = $this->pObj->MOD_SETTINGS["templatesOnPage"];
+               }
+
+               // **************************
+               // Main
+               // **************************
+
+               // BUGBUG: Should we check if the uset may at all read and write template-records???
+               $existTemplate = $this->initialize_editor($this->pObj->id,$template_uid);               // initialize
+               if ($existTemplate)     {
+                       $theOutput.=$this->pObj->doc->divider(5);
+                       $theOutput.=$this->pObj->doc->section("Current template:",'<img src="'.$BACK_PATH.t3lib_iconWorks::getIcon("sys_template",$tplRow).'" width=18 height=16 align=top><b>'.$this->pObj->linkWrapTemplateTitle($tplRow["title"]).'</b>'.htmlspecialchars(trim($tplRow["sitetitle"])?' - ('.$tplRow["sitetitle"].')':''));
+               }
+               if ($manyTemplatesMenu) {
+                       $theOutput.=$this->pObj->doc->section("",$manyTemplatesMenu);
+               }
+
+               //      debug($tmpl->hierarchyInfo);
+
+               $tmpl->clearList_const_temp = array_flip($tmpl->clearList_const);
+               $tmpl->clearList_setup_temp = array_flip($tmpl->clearList_setup);
+
+               $pointer = count($tmpl->hierarchyInfo);
+               $tmpl->hierarchyInfoArr = $tmpl->ext_process_hierarchyInfo(array(), $pointer);
+               $tmpl->procesIncludes();
+
+               $hierarArr = array();
+               $head= '<tr>';
+               $head.= '<td class="bgColor2"><b>Title&nbsp;&nbsp;</b></td>';
+               $head.= '<td class="bgColor2"><b>Rootlevel&nbsp;&nbsp;</b></td>';
+               $head.= '<td class="bgColor2"><b>C. Setup&nbsp;&nbsp;</b></td>';
+               $head.= '<td class="bgColor2"><b>C. Const&nbsp;&nbsp;</b></td>';
+               $head.= '<td class="bgColor2"><b>PID/RL&nbsp;&nbsp;</b></td>';
+               $head.= '<td class="bgColor2"><b>NL&nbsp;&nbsp;</b></td>';
+               $head.= '</tr>';
+               $hierar = implode(array_reverse($tmpl->ext_getTemplateHierarchyArr($tmpl->hierarchyInfoArr, "",array(),1)),"");
+               $hierar= '<table border=0 cellpadding=0 cellspacing=0>'.$head.$hierar.'</table>';
+
+               $theOutput.=$this->pObj->doc->spacer(5);
+               $theOutput.=$this->pObj->doc->section("Template hierarchy:",$hierar,0,1);
+
+
+                       // Output constants
+               $theOutput.=$this->pObj->doc->spacer(25);
+               $theOutput.=$this->pObj->doc->divider(0);
+               $theOutput.=$this->pObj->doc->section("",
+                       "Linenumbers".t3lib_BEfunc::getFuncCheck($this->pObj->id,"SET[ts_analyzer_checkLinenum]",$this->pObj->MOD_SETTINGS["ts_analyzer_checkLinenum"]).
+                       "&nbsp;&nbsp;&nbsp;Syntax HL".t3lib_BEfunc::getFuncCheck($this->pObj->id,"SET[ts_analyzer_checkSyntax]",$this->pObj->MOD_SETTINGS["ts_analyzer_checkSyntax"]).
+                       (!$this->pObj->MOD_SETTINGS["ts_analyzer_checkSyntax"] ?
+                               "&nbsp;&nbsp;&nbsp;Comments".t3lib_BEfunc::getFuncCheck($this->pObj->id,"SET[ts_analyzer_checkComments]",$this->pObj->MOD_SETTINGS["ts_analyzer_checkComments"]).
+                               "&nbsp;&nbsp;&nbsp;Crop lines".t3lib_BEfunc::getFuncCheck($this->pObj->id,"SET[ts_analyzer_checkCrop]",$this->pObj->MOD_SETTINGS["ts_analyzer_checkCrop"])
+                               :
+                               "&nbsp;&nbsp;&nbsp;Block mode".t3lib_BEfunc::getFuncCheck($this->pObj->id,"SET[ts_analyzer_checkSyntaxBlockmode]",$this->pObj->MOD_SETTINGS["ts_analyzer_checkSyntaxBlockmode"])
+                       )
+               );
+               $theOutput.=$this->pObj->doc->divider(2);
+               //$theOutput.=$this->pObj->doc->section("Constants:",t3lib_BEfunc::getFuncCheck($this->pObj->id,"SET[ts_analyzer_checkConst]",$this->pObj->MOD_SETTINGS["ts_analyzer_checkConst"]).fw("Enable"));
+               $theOutput.=$this->pObj->doc->section("Constants:","",0,1);
+               $theOutput.=$this->pObj->doc->sectionEnd();
+               if (1==1 || $this->pObj->MOD_SETTINGS["ts_analyzer_checkConst"])        {
+                       $theOutput.='
+                               <table border=0 cellpadding=1 cellspacing=0>
+                       ';
+                       $tmpl->ext_lineNumberOffset=-2; // Don't know why -2 and not 0... :-) But works.
+                       $tmpl->ext_lineNumberOffset_mode="const";
+                       $tmpl->ext_lineNumberOffset+=count(explode(chr(10),t3lib_TSparser::checkIncludeLines("".$GLOBALS["TYPO3_CONF_VARS"]["FE"]["defaultTypoScript_constants"])))+1;
+
+                       reset($tmpl->constants);
+                       reset($tmpl->clearList_const);
+                       while(list($key,$val)=each($tmpl->constants))   {
+                               $cVal = current($tmpl->clearList_const);
+                               if ($cVal==t3lib_div::_GET('template') || t3lib_div::_GET('template')=="all")   {
+                                       $theOutput.='
+                                               <tr>
+                                                       <td><img src=clear.gif width=3 height=1></td><td class="bgColor2"><b>'.$tmpl->templateTitles[$cVal].'</b></td></tr>
+                                               <tr>
+                                                       <td><img src=clear.gif width=3 height=1></td>
+                                                       <td class="bgColor2"><table border=0 cellpadding=0 cellspacing=0 bgcolor="#D9D5C9" width="100%"><tr><td nowrap>'.$tmpl->ext_outputTS(array($val),$this->pObj->MOD_SETTINGS["ts_analyzer_checkLinenum"],$this->pObj->MOD_SETTINGS["ts_analyzer_checkComments"],$this->pObj->MOD_SETTINGS["ts_analyzer_checkCrop"],$this->pObj->MOD_SETTINGS["ts_analyzer_checkSyntax"],$this->pObj->MOD_SETTINGS["ts_analyzer_checkSyntaxBlockmode"]).'</td></tr></table>
+                                                       </td>
+                                               </tr>
+                                       ';
+                                       if (t3lib_div::_GET('template')!="all")         break;
+                               }
+                               $tmpl->ext_lineNumberOffset+=count(explode(chr(10),$val))+1;
+                               next($tmpl->clearList_const);
+                       }
+                       $theOutput.='
+                               </table>
+                       ';
+               }
+
+                       // Output setup
+               $theOutput.=$this->pObj->doc->spacer(15);
+               //$theOutput.=$this->pObj->doc->section("SETUP:",t3lib_BEfunc::getFuncCheck($this->pObj->id,"SET[ts_analyzer_checkSetup]",$this->pObj->MOD_SETTINGS["ts_analyzer_checkSetup"]).fw("Enable"));
+               $theOutput.=$this->pObj->doc->section("SETUP:","",0,1);
+               $theOutput.=$this->pObj->doc->sectionEnd();
+               if (1==1 || $this->pObj->MOD_SETTINGS["ts_analyzer_checkSetup"])        {
+                       $theOutput.='
+                               <table border=0 cellpadding=1 cellspacing=0>
+                       ';
+                       $tmpl->ext_lineNumberOffset=0;
+                       $tmpl->ext_lineNumberOffset_mode="setup";
+                       $tmpl->ext_lineNumberOffset+=count(explode(chr(10),t3lib_TSparser::checkIncludeLines("".$GLOBALS["TYPO3_CONF_VARS"]["FE"]["defaultTypoScript_setup"])))+1;
+
+                       reset($tmpl->config);
+                       reset($tmpl->clearList_setup);
+                       while(list($key,$val)=each($tmpl->config))      {
+                               if (current($tmpl->clearList_setup)==t3lib_div::_GET('template') || t3lib_div::_GET('template')=="all") {
+                                       $theOutput.='
+                                               <tr>
+                                                       <td><img src=clear.gif width=3 height=1></td><td class="bgColor2"><b>'.$tmpl->templateTitles[current($tmpl->clearList_setup)].'</b></td></tr>
+                                               <tr>
+                                                       <td><img src=clear.gif width=3 height=1></td>
+                                                       <td class="bgColor2"><table border=0 cellpadding=0 cellspacing=0 bgcolor="#D9D5C9" width="100%"><tr><td nowrap>'.$tmpl->ext_outputTS(array($val),$this->pObj->MOD_SETTINGS["ts_analyzer_checkLinenum"],$this->pObj->MOD_SETTINGS["ts_analyzer_checkComments"],$this->pObj->MOD_SETTINGS["ts_analyzer_checkCrop"],$this->pObj->MOD_SETTINGS["ts_analyzer_checkSyntax"],$this->pObj->MOD_SETTINGS["ts_analyzer_checkSyntaxBlockmode"]).'</td></tr></table>
+                                                       </td>
+                                               </tr>
+                                       ';
+                                       if (t3lib_div::_GET('template')!="all")         break;
+                               }
+                               $tmpl->ext_lineNumberOffset+=count(explode(chr(10),$val))+1;
+                               next($tmpl->clearList_setup);
+                       }
+                       $theOutput.='
+                               </table>
+                       ';
+               }
+               return $theOutput;
+       }
+}
+
+if (defined("TYPO3_MODE") && $TYPO3_CONF_VARS[TYPO3_MODE]["XCLASS"]["ext/tstemplate_analyzer/class.tx_tstemplateanalyzer.php"])        {
+       include_once($TYPO3_CONF_VARS[TYPO3_MODE]["XCLASS"]["ext/tstemplate_analyzer/class.tx_tstemplateanalyzer.php"]);
+}
+?>
diff --git a/typo3/sysext/tstemplate_analyzer/ext_emconf.php b/typo3/sysext/tstemplate_analyzer/ext_emconf.php
new file mode 100644 (file)
index 0000000..a308557
--- /dev/null
@@ -0,0 +1,42 @@
+<?php
+
+########################################################################
+# Extension Manager/Repository config file for ext: "tstemplate_analyzer"
+# 
+# Auto generated 07-10-2005 15:56
+# 
+# Manual updates:
+# Only the data in the array - anything else is removed by next write
+########################################################################
+
+$EM_CONF[$_EXTKEY] = Array (
+       'title' => 'Web>Template, Template analyzer',
+       'description' => 'Analyzes the hierarchy of included static and custom template records.',
+       'category' => 'module',
+       'shy' => 1,
+       'dependencies' => 'tstemplate',
+       'conflicts' => '',
+       'priority' => '',
+       'loadOrder' => '',
+       'TYPO3_version' => '-',
+       'PHP_version' => '-',
+       'module' => '',
+       'state' => 'stable',
+       'internal' => 0,
+       'uploadfolder' => 0,
+       'createDirs' => '',
+       'modify_tables' => '',
+       'clearCacheOnLoad' => 0,
+       'lockType' => '',
+       'author' => 'Kasper Skårhøj',
+       'author_email' => 'kasperYYYY@typo3.com',
+       'author_company' => 'Curby Soft Multimedia',
+       'CGLcompliance' => '',
+       'CGLcompliance_note' => '',
+       'private' => 0,
+       'download_password' => '',
+       'version' => '0.0.4',   // Don't modify this! Managed automatically during upload to repository.
+       '_md5_values_when_last_written' => 'a:3:{s:31:"class.tx_tstemplateanalyzer.php";s:4:"6865";s:12:"ext_icon.gif";s:4:"52a3";s:14:"ext_tables.php";s:4:"f45f";}',
+);
+
+?>
\ No newline at end of file
diff --git a/typo3/sysext/tstemplate_analyzer/ext_icon.gif b/typo3/sysext/tstemplate_analyzer/ext_icon.gif
new file mode 100644 (file)
index 0000000..e5f0d85
Binary files /dev/null and b/typo3/sysext/tstemplate_analyzer/ext_icon.gif differ
diff --git a/typo3/sysext/tstemplate_analyzer/ext_tables.php b/typo3/sysext/tstemplate_analyzer/ext_tables.php
new file mode 100644 (file)
index 0000000..33ffdb1
--- /dev/null
@@ -0,0 +1,12 @@
+<?php
+if (!defined ('TYPO3_MODE'))   die ('Access denied.');
+
+if (TYPO3_MODE=='BE')  {
+       t3lib_extMgm::insertModuleFunction(
+               'web_ts',
+               'tx_tstemplateanalyzer',
+               t3lib_extMgm::extPath($_EXTKEY).'class.tx_tstemplateanalyzer.php',
+               'Template Analyzer'
+       );
+}
+?>
\ No newline at end of file
diff --git a/typo3/sysext/tstemplate_ceditor/ChangeLog b/typo3/sysext/tstemplate_ceditor/ChangeLog
new file mode 100644 (file)
index 0000000..95299d4
--- /dev/null
@@ -0,0 +1,7 @@
+2005-12-23  Michael Stucki  <michael@typo3.org>
+
+       * Moved tstemplate, tstemplate_analyzer, tstemplate_ceditor, tstemplate_info, tstemplate_objbrowser as system extensions to TYPO3core
+
+2005-11-25  Michael Stucki  <michael@typo3.org>
+
+       * Added a ChangeLog
diff --git a/typo3/sysext/tstemplate_ceditor/class.tx_tstemplateceditor.php b/typo3/sysext/tstemplate_ceditor/class.tx_tstemplateceditor.php
new file mode 100644 (file)
index 0000000..ddd661f
--- /dev/null
@@ -0,0 +1,209 @@
+<?php
+/***************************************************************
+*  Copyright notice
+*
+*  (c) 1999-2005 Kasper Skaarhoj (kasperYYYY@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!
+***************************************************************/
+/**
+ * TypoScript Constant editor
+ *
+ * Module Include-file
+ *
+ * localconf-variables:
+ * $TYPO3_CONF_VARS["MODS"]["web_ts"]["onlineResourceDir"] = "fileadmin/fonts/";               // This is the path (must be in "fileadmin/" !!) where the web_ts/constant-editor submodule fetches online resources. Put fonts (ttf) and standard images here!
+ *
+ * @author     Kasper Skårhøj <kasperYYYY@typo3.com>
+ */
+
+require_once(PATH_t3lib."class.t3lib_extobjbase.php");
+
+class tx_tstemplateceditor extends t3lib_extobjbase {
+       function initialize_editor($pageId,$template_uid=0)     {
+                       // Initializes the module. Done in this function because we may need to re-initialize if data is submitted!
+               global $tmpl,$tplRow,$theConstants;
+
+               $tmpl = t3lib_div::makeInstance("t3lib_tsparser_ext");  // Defined global here!
+               $tmpl->tt_track = 0;    // Do not log time-performance information
+               $tmpl->init();
+
+               $tmpl->ext_localGfxPrefix=t3lib_extMgm::extPath("tstemplate_ceditor");
+               $tmpl->ext_localWebGfxPrefix=$GLOBALS["BACK_PATH"].t3lib_extMgm::extRelPath("tstemplate_ceditor");
+
+               $tplRow = $tmpl->ext_getFirstTemplate($pageId,$template_uid);   // Get the row of the first VISIBLE template of the page. whereclause like the frontend.
+               if (is_array($tplRow))  {       // IF there was a template...
+                               // Gets the rootLine
+                       $sys_page = t3lib_div::makeInstance("t3lib_pageSelect");
+                       $rootLine = $sys_page->getRootLine($pageId);
+                       $tmpl->runThroughTemplates($rootLine,$template_uid);    // This generates the constants/config + hierarchy info for the template.
+                       $theConstants = $tmpl->generateConfig_constants();      // The editable constants are returned in an array.
+                       $tmpl->ext_categorizeEditableConstants($theConstants);  // The returned constants are sorted in categories, that goes into the $tmpl->categories array
+                       $tmpl->ext_regObjectPositions($tplRow["constants"]);            // This array will contain key=[expanded constantname], value=linenumber in template. (after edit_divider, if any)
+                       return 1;
+               }
+       }
+       function displayExample($theOutput)     {
+               global $SOBE,$tmpl;
+               if ($tmpl->helpConfig["imagetag"] || $tmpl->helpConfig["description"] || $tmpl->helpConfig["header"])   {
+       //              $theOutput.=$this->pObj->doc->divider(20);
+                       $theOutput.=$this->pObj->doc->spacer(30);
+                       $theOutput.=$this->pObj->doc->section($tmpl->helpConfig["header"],
+                               '<div align="center">'.$tmpl->helpConfig["imagetag"].'</div><BR>'.
+                               ($tmpl->helpConfig["description"] ? implode(explode("//",$tmpl->helpConfig["description"]),"<BR>")."<BR>" : "").
+                               ($tmpl->helpConfig["bulletlist"] ? "<ul><li>".implode(explode("//",$tmpl->helpConfig["bulletlist"]),"<li>")."</ul>" : "<BR>")
+                               );
+               }
+               return $theOutput;
+       }
+
+       function main() {
+               global $SOBE,$BE_USER,$LANG,$BACK_PATH,$TCA_DESCR,$TCA,$CLIENT,$TYPO3_CONF_VARS;
+               global $tmpl,$tplRow,$theConstants;
+
+
+               // **************************
+               // Create extension template
+               // **************************
+               $this->pObj->createTemplate($this->pObj->id);
+
+
+
+
+               // **************************
+               // Checking for more than one template an if, set a menu...
+               // **************************
+               $manyTemplatesMenu = $this->pObj->templateMenu();
+               $template_uid = 0;
+               if ($manyTemplatesMenu) {
+                       $template_uid = $this->pObj->MOD_SETTINGS["templatesOnPage"];
+               }
+
+
+
+               // **************************
+               // Main
+               // **************************
+
+               // BUGBUG: Should we check if the uset may at all read and write template-records???
+               $existTemplate = $this->initialize_editor($this->pObj->id,$template_uid);               // initialize
+
+               if ($existTemplate)     {
+                       $saveId = $tplRow['_ORIG_uid'] ? $tplRow['_ORIG_uid'] : $tplRow['uid'];
+
+                               // Update template ?
+                       if (t3lib_div::_POST("submit")) {
+                               require_once (PATH_t3lib."class.t3lib_tcemain.php");
+                               $tmpl->changed=0;
+                               $tmpl->ext_procesInput(t3lib_div::_POST(),$_FILES,$theConstants,$tplRow);
+               //              debug($tmpl->changed);
+               //              debug($tmpl->raw);
+               //              $tmpl->changed=0;
+                               if ($tmpl->changed)     {
+                                               // Set the data to be saved
+                                       $recData=array();
+                                       $recData["sys_template"][$saveId]["constants"] = implode($tmpl->raw,chr(10));
+                                               // Create new  tce-object
+                                       $tce = t3lib_div::makeInstance("t3lib_TCEmain");
+                                       $tce->stripslashes_values=0;
+                                               // Initialize
+                                       $tce->start($recData,Array());
+                                               // Saved the stuff
+                                       $tce->process_datamap();
+                                               // Clear the cache (note: currently only admin-users can clear the cache in tce_main.php)
+                                       $tce->clear_cacheCmd("all");
+
+                                               // re-read the template ...
+                                       $this->initialize_editor($this->pObj->id,$template_uid);
+                               }
+                       }
+
+                       // Output edit form
+                       $tmpl->ext_readDirResources($TYPO3_CONF_VARS["MODS"]["web_ts"]["onlineResourceDir"]);
+                       $tmpl->ext_resourceDims();
+
+                               // Resetting the menu (start). I wonder if this in any way is a violation of the menu-system. Haven't checked. But need to do it here, because the menu is dependent on the categories available.
+                       $this->pObj->MOD_MENU["constant_editor_cat"] = $tmpl->ext_getCategoryLabelArray();
+
+                       $this->pObj->MOD_SETTINGS = t3lib_BEfunc::getModuleData($this->pObj->MOD_MENU, t3lib_div::_GP("SET"), $this->pObj->MCONF["name"]);
+                               // Resetting the menu (stop)
+
+                       $theOutput.=$this->pObj->doc->spacer(5);
+                       $theOutput.=$this->pObj->doc->section("Edit constants for template:",'<img src="'.$BACK_PATH.t3lib_iconWorks::getIcon("sys_template",$tplRow).'" width=18 height=16 align=top><b>'.$this->pObj->linkWrapTemplateTitle($tplRow["title"],"constants").'</b>'.htmlspecialchars(trim($tplRow["sitetitle"])?' - ('.$tplRow["sitetitle"].')':''),0,1);
+                       if ($manyTemplatesMenu) {
+                               $theOutput.=$this->pObj->doc->section("",$manyTemplatesMenu);
+                               $theOutput.=$this->pObj->doc->divider(5);
+                       }
+
+                       $theOutput.=$this->pObj->doc->spacer(5);
+                       if (count($this->pObj->MOD_MENU["constant_editor_cat"]))        {
+                               $menu = "Category: ".t3lib_BEfunc::getFuncMenu($this->pObj->id,"SET[constant_editor_cat]",$this->pObj->MOD_SETTINGS["constant_editor_cat"],$this->pObj->MOD_MENU["constant_editor_cat"]);
+                               $theOutput.=$this->pObj->doc->section("",'<NOBR>'.$menu.'</NOBR>');
+                       } else {
+                               $theOutput.=$this->pObj->doc->section("No constants available","There are no editable constants available for the Constant Editor.",1,0,1);
+                       }
+
+
+                                       // Category and constant editor config:
+                       $category = $this->pObj->MOD_SETTINGS["constant_editor_cat"];
+               /*      $TSCE_tmpl = t3lib_div::makeInstance("t3lib_tsparser_ext");     // Defined global here!
+                       $TSCE_tmpl->tt_track = 0;       // Do not log time-performance information
+                       $TSCE_tmpl->init();
+                       $TSCE_tmpl->constants=array($tplRow["constants"]);
+                       debug($tplRow);
+                       $TSCE_tmpl->generateConfig_constants();
+                       debug($TSCE_tmpl->setup);
+                       */
+                       $tmpl->ext_getTSCE_config($category);
+
+# NOT WORKING:
+                       if ($BE_USER_modOptions["properties"]["constantEditor."]["example"]=="top")     {
+                               $theOutput=$this->displayExample($theOutput);
+                       }
+
+                       $printFields = trim($tmpl->ext_printFields($theConstants,$category));
+                       if ($printFields)       {
+                               $theOutput.=$this->pObj->doc->spacer(20);
+                               $theOutput.=$this->pObj->doc->section("",'<input type="Submit" name="submit" value="Update">');
+                               $theOutput.=$this->pObj->doc->spacer(15);
+                               $theOutput.=$this->pObj->doc->section("",$printFields);
+                               $theOutput.=$this->pObj->doc->spacer(10);
+                               $theOutput.=$this->pObj->doc->section("",'<input type="Submit" name="submit" value="Update">');
+                       }
+
+                       if ($BE_USER_modOptions["properties"]["constantEditor."]["example"]!="top")     {
+                               $theOutput=$this->displayExample($theOutput);
+                       }
+
+                       $theOutput.=$this->pObj->doc->spacer(10);
+                       $theOutput.=$this->pObj->doc->section("Cache",'Click here to <a href="index.php?id='.$this->pObj->id.'&clear_all_cache=1"><strong>clear all cache</strong></a>',0,1);
+               } else {
+                       $theOutput.=$this->pObj->noTemplate(1);
+               }
+               return $theOutput;
+       }
+}
+
+if (defined("TYPO3_MODE") && $TYPO3_CONF_VARS[TYPO3_MODE]["XCLASS"]["ext/tstemplate_ceditor/class.tx_tstemplateceditor.php"])  {
+       include_once($TYPO3_CONF_VARS[TYPO3_MODE]["XCLASS"]["ext/tstemplate_ceditor/class.tx_tstemplateceditor.php"]);
+}
+
+?>
diff --git a/typo3/sysext/tstemplate_ceditor/doc/TODO.txt b/typo3/sysext/tstemplate_ceditor/doc/TODO.txt
new file mode 100644 (file)
index 0000000..71bb358
--- /dev/null
@@ -0,0 +1 @@
+- Checkboxes: "Typically a user would expect to set the flag by checking the checkbox, but the checkbox rather enables another checkbox which must be set (and the two checkboxes next to each other are somewhat confusing). If the first checkbox would be replaced by a button labeled "Change" this would be more clearly to a user." (My note: "[ ] Change?" where label "Change" would disappear after reload and the first time such a checkbox were clicked a message would also appear telling what happens...)
diff --git a/typo3/sysext/tstemplate_ceditor/ext_emconf.php b/typo3/sysext/tstemplate_ceditor/ext_emconf.php
new file mode 100644 (file)
index 0000000..f31f7b7
--- /dev/null
@@ -0,0 +1,42 @@
+<?php
+
+########################################################################
+# Extension Manager/Repository config file for ext: "tstemplate_ceditor"
+# 
+# Auto generated 07-10-2005 15:55
+# 
+# Manual updates:
+# Only the data in the array - anything else is removed by next write
+########################################################################
+
+$EM_CONF[$_EXTKEY] = Array (
+       'title' => 'Web>Template, Constant Editor',
+       'description' => 'Edit the most popular constants of the standard static templates by form fields. Includes explanations in english.',
+       'category' => 'module',
+       'shy' => 1,
+       'dependencies' => 'tstemplate',
+       'conflicts' => '',
+       'priority' => '',
+       'loadOrder' => '',
+       'TYPO3_version' => '-',
+       'PHP_version' => '-',
+       'module' => '',
+       'state' => 'stable',
+       'internal' => 0,
+       'uploadfolder' => 0,
+       'createDirs' => '',
+       'modify_tables' => '',
+       'clearCacheOnLoad' => 0,
+       'lockType' => '',
+       'author' => 'Kasper Skårhøj',
+       'author_email' => 'kasperYYYY@typo3.com',
+       'author_company' => 'Curby Soft Multimedia',
+       'CGLcompliance' => '',
+       'CGLcompliance_note' => '',
+       'private' => 0,
+       'download_password' => '',
+       'version' => '0.0.4',   // Don't modify this! Managed automatically during upload to repository.
+       '_md5_values_when_last_written' => 'a:57:{s:30:"class.tx_tstemplateceditor.php";s:4:"425e";s:12:"ext_icon.gif";s:4:"8bf7";s:14:"ext_tables.php";s:4:"f7b3";s:9:"gfx/1.gif";s:4:"baec";s:10:"gfx/10.gif";s:4:"a032";s:10:"gfx/11.gif";s:4:"2bce";s:10:"gfx/12.gif";s:4:"df65";s:10:"gfx/13.gif";s:4:"03f8";s:10:"gfx/14.gif";s:4:"952c";s:10:"gfx/15.gif";s:4:"6a96";s:10:"gfx/16.gif";s:4:"fd2e";s:10:"gfx/17.gif";s:4:"4c76";s:10:"gfx/18.gif";s:4:"d103";s:10:"gfx/19.gif";s:4:"b5e4";s:9:"gfx/2.gif";s:4:"9f11";s:10:"gfx/20.gif";s:4:"7f97";s:9:"gfx/3.gif";s:4:"38ce";s:9:"gfx/4.gif";s:4:"4554";s:9:"gfx/5.gif";s:4:"02b7";s:9:"gfx/6.gif";s:4:"56fe";s:9:"gfx/7.gif";s:4:"0aaa";s:9:"gfx/8.gif";s:4:"9ae9";s:9:"gfx/9.gif";s:4:"391e";s:17:"gfx/BUG_basic.gif";s:4:"a183";s:16:"gfx/BUG_menu.gif";s:4:"4c34";s:17:"gfx/BUG_menu2.gif";s:4:"e059";s:22:"gfx/BUSINESS_basic.gif";s:4:"99d7";s:21:"gfx/BUSINESS_menu.gif";s:4:"7feb";s:23:"gfx/CANDIDATE_basic.gif";s:4:"52d6";s:22:"gfx/CANDIDATE_menu.gif";s:4:"9050";s:22:"gfx/CANDIDATE_page.gif";s:4:"40af";s:19:"gfx/CrCPH_basic.gif";s:4:"eba6";s:19:"gfx/FIRST_basic.gif";s:4:"e219";s:18:"gfx/FIRST_menu.gif";s:4:"3243";s:18:"gfx/GLCK_basic.gif";s:4:"fd8c";s:20:"gfx/GLCK_columns.gif";s:4:"7bd0";s:17:"gfx/GLCK_menu.gif";s:4:"03aa";s:19:"gfx/GREEN_basic.gif";s:4:"b48a";s:18:"gfx/GREEN_menu.gif";s:4:"6742";s:19:"gfx/GREEN_menu2.gif";s:4:"bdf1";s:19:"gfx/GREEN_menu3.gif";s:4:"e716";s:19:"gfx/HYPER_basic.gif";s:4:"e7d7";s:18:"gfx/HYPER_menu.gif";s:4:"55a8";s:19:"gfx/HYPER_menu2.gif";s:4:"fa7e";s:18:"gfx/HYPER_page.gif";s:4:"5e10";s:22:"gfx/HYPER_toptitle.gif";s:4:"8831";s:16:"gfx/MM_basic.gif";s:4:"1941";s:15:"gfx/MM_menu.gif";s:4:"eedb";s:16:"gfx/MM_right.gif";s:4:"caa9";s:24:"gfx/NEWSLETTER_basic.gif";s:4:"66b7";s:16:"gfx/RE_basic.gif";s:4:"2798";s:19:"gfx/RE_leftmenu.gif";s:4:"448a";s:15:"gfx/RE_menu.gif";s:4:"dbca";s:14:"gfx/RE_top.gif";s:4:"86e9";s:16:"gfx/TU_basic.gif";s:4:"d973";s:15:"gfx/TU_menu.gif";s:4:"d208";s:12:"doc/TODO.txt";s:4:"069e";}',
+);
+
+?>
\ No newline at end of file
diff --git a/typo3/sysext/tstemplate_ceditor/ext_icon.gif b/typo3/sysext/tstemplate_ceditor/ext_icon.gif
new file mode 100644 (file)
index 0000000..1a0be79
Binary files /dev/null and b/typo3/sysext/tstemplate_ceditor/ext_icon.gif differ
diff --git a/typo3/sysext/tstemplate_ceditor/ext_tables.php b/typo3/sysext/tstemplate_ceditor/ext_tables.php
new file mode 100644 (file)
index 0000000..3ecd219
--- /dev/null
@@ -0,0 +1,12 @@
+<?php
+if (!defined ('TYPO3_MODE'))   die ('Access denied.');
+
+if (TYPO3_MODE=='BE')  {
+       t3lib_extMgm::insertModuleFunction(
+               'web_ts',
+               'tx_tstemplateceditor',
+               t3lib_extMgm::extPath($_EXTKEY).'class.tx_tstemplateceditor.php',
+               'Constant Editor'
+       );
+}
+?>
\ No newline at end of file
diff --git a/typo3/sysext/tstemplate_ceditor/gfx/1.gif b/typo3/sysext/tstemplate_ceditor/gfx/1.gif
new file mode 100644 (file)
index 0000000..d8585b0
Binary files /dev/null and b/typo3/sysext/tstemplate_ceditor/gfx/1.gif differ
diff --git a/typo3/sysext/tstemplate_ceditor/gfx/10.gif b/typo3/sysext/tstemplate_ceditor/gfx/10.gif
new file mode 100644 (file)
index 0000000..7a0778f
Binary files /dev/null and b/typo3/sysext/tstemplate_ceditor/gfx/10.gif differ
diff --git a/typo3/sysext/tstemplate_ceditor/gfx/11.gif b/typo3/sysext/tstemplate_ceditor/gfx/11.gif
new file mode 100644 (file)
index 0000000..7eea74f
Binary files /dev/null and b/typo3/sysext/tstemplate_ceditor/gfx/11.gif differ
diff --git a/typo3/sysext/tstemplate_ceditor/gfx/12.gif b/typo3/sysext/tstemplate_ceditor/gfx/12.gif
new file mode 100644 (file)
index 0000000..ec946c8
Binary files /dev/null and b/typo3/sysext/tstemplate_ceditor/gfx/12.gif differ
diff --git a/typo3/sysext/tstemplate_ceditor/gfx/13.gif b/typo3/sysext/tstemplate_ceditor/gfx/13.gif
new file mode 100644 (file)
index 0000000..96fb217
Binary files /dev/null and b/typo3/sysext/tstemplate_ceditor/gfx/13.gif differ
diff --git a/typo3/sysext/tstemplate_ceditor/gfx/14.gif b/typo3/sysext/tstemplate_ceditor/gfx/14.gif
new file mode 100644 (file)
index 0000000..bc4a222
Binary files /dev/null and b/typo3/sysext/tstemplate_ceditor/gfx/14.gif differ
diff --git a/typo3/sysext/tstemplate_ceditor/gfx/15.gif b/typo3/sysext/tstemplate_ceditor/gfx/15.gif
new file mode 100644 (file)
index 0000000..e2d70b5
Binary files /dev/null and b/typo3/sysext/tstemplate_ceditor/gfx/15.gif differ
diff --git a/typo3/sysext/tstemplate_ceditor/gfx/16.gif b/typo3/sysext/tstemplate_ceditor/gfx/16.gif
new file mode 100644 (file)
index 0000000..94263fb
Binary files /dev/null and b/typo3/sysext/tstemplate_ceditor/gfx/16.gif differ
diff --git a/typo3/sysext/tstemplate_ceditor/gfx/17.gif b/typo3/sysext/tstemplate_ceditor/gfx/17.gif
new file mode 100644 (file)
index 0000000..a509feb
Binary files /dev/null and b/typo3/sysext/tstemplate_ceditor/gfx/17.gif differ
diff --git a/typo3/sysext/tstemplate_ceditor/gfx/18.gif b/typo3/sysext/tstemplate_ceditor/gfx/18.gif
new file mode 100644 (file)
index 0000000..d06ddaa
Binary files /dev/null and b/typo3/sysext/tstemplate_ceditor/gfx/18.gif differ
diff --git a/typo3/sysext/tstemplate_ceditor/gfx/19.gif b/typo3/sysext/tstemplate_ceditor/gfx/19.gif
new file mode 100644 (file)
index 0000000..dd3d350
Binary files /dev/null and b/typo3/sysext/tstemplate_ceditor/gfx/19.gif differ
diff --git a/typo3/sysext/tstemplate_ceditor/gfx/2.gif b/typo3/sysext/tstemplate_ceditor/gfx/2.gif
new file mode 100644 (file)
index 0000000..4539ff2
Binary files /dev/null and b/typo3/sysext/tstemplate_ceditor/gfx/2.gif differ
diff --git a/typo3/sysext/tstemplate_ceditor/gfx/20.gif b/typo3/sysext/tstemplate_ceditor/gfx/20.gif
new file mode 100644 (file)
index 0000000..363a987
Binary files /dev/null and b/typo3/sysext/tstemplate_ceditor/gfx/20.gif differ
diff --git a/typo3/sysext/tstemplate_ceditor/gfx/3.gif b/typo3/sysext/tstemplate_ceditor/gfx/3.gif
new file mode 100644 (file)
index 0000000..78c80fa
Binary files /dev/null and b/typo3/sysext/tstemplate_ceditor/gfx/3.gif differ
diff --git a/typo3/sysext/tstemplate_ceditor/gfx/4.gif b/typo3/sysext/tstemplate_ceditor/gfx/4.gif
new file mode 100644 (file)
index 0000000..6cd425e
Binary files /dev/null and b/typo3/sysext/tstemplate_ceditor/gfx/4.gif differ
diff --git a/typo3/sysext/tstemplate_ceditor/gfx/5.gif b/typo3/sysext/tstemplate_ceditor/gfx/5.gif
new file mode 100644 (file)
index 0000000..60c5640
Binary files /dev/null and b/typo3/sysext/tstemplate_ceditor/gfx/5.gif differ
diff --git a/typo3/sysext/tstemplate_ceditor/gfx/6.gif b/typo3/sysext/tstemplate_ceditor/gfx/6.gif
new file mode 100644 (file)
index 0000000..ee15a43
Binary files /dev/null and b/typo3/sysext/tstemplate_ceditor/gfx/6.gif differ
diff --git a/typo3/sysext/tstemplate_ceditor/gfx/7.gif b/typo3/sysext/tstemplate_ceditor/gfx/7.gif
new file mode 100644 (file)
index 0000000..f113118
Binary files /dev/null and b/typo3/sysext/tstemplate_ceditor/gfx/7.gif differ
diff --git a/typo3/sysext/tstemplate_ceditor/gfx/8.gif b/typo3/sysext/tstemplate_ceditor/gfx/8.gif
new file mode 100644 (file)
index 0000000..305e388
Binary files /dev/null and b/typo3/sysext/tstemplate_ceditor/gfx/8.gif differ
diff --git a/typo3/sysext/tstemplate_ceditor/gfx/9.gif b/typo3/sysext/tstemplate_ceditor/gfx/9.gif
new file mode 100644 (file)
index 0000000..46f88d4
Binary files /dev/null and b/typo3/sysext/tstemplate_ceditor/gfx/9.gif differ
diff --git a/typo3/sysext/tstemplate_ceditor/gfx/BUG_basic.gif b/typo3/sysext/tstemplate_ceditor/gfx/BUG_basic.gif
new file mode 100644 (file)
index 0000000..d93a8ed
Binary files /dev/null and b/typo3/sysext/tstemplate_ceditor/gfx/BUG_basic.gif differ
diff --git a/typo3/sysext/tstemplate_ceditor/gfx/BUG_menu.gif b/typo3/sysext/tstemplate_ceditor/gfx/BUG_menu.gif
new file mode 100644 (file)
index 0000000..80dd52b
Binary files /dev/null and b/typo3/sysext/tstemplate_ceditor/gfx/BUG_menu.gif differ
diff --git a/typo3/sysext/tstemplate_ceditor/gfx/BUG_menu2.gif b/typo3/sysext/tstemplate_ceditor/gfx/BUG_menu2.gif
new file mode 100644 (file)
index 0000000..9a1cf2e
Binary files /dev/null and b/typo3/sysext/tstemplate_ceditor/gfx/BUG_menu2.gif differ
diff --git a/typo3/sysext/tstemplate_ceditor/gfx/BUSINESS_basic.gif b/typo3/sysext/tstemplate_ceditor/gfx/BUSINESS_basic.gif
new file mode 100644 (file)
index 0000000..42a4083
Binary files /dev/null and b/typo3/sysext/tstemplate_ceditor/gfx/BUSINESS_basic.gif differ
diff --git a/typo3/sysext/tstemplate_ceditor/gfx/BUSINESS_menu.gif b/typo3/sysext/tstemplate_ceditor/gfx/BUSINESS_menu.gif
new file mode 100644 (file)
index 0000000..e76c3f4
Binary files /dev/null and b/typo3/sysext/tstemplate_ceditor/gfx/BUSINESS_menu.gif differ
diff --git a/typo3/sysext/tstemplate_ceditor/gfx/CANDIDATE_basic.gif b/typo3/sysext/tstemplate_ceditor/gfx/CANDIDATE_basic.gif
new file mode 100644 (file)
index 0000000..e0acd38
Binary files /dev/null and b/typo3/sysext/tstemplate_ceditor/gfx/CANDIDATE_basic.gif differ
diff --git a/typo3/sysext/tstemplate_ceditor/gfx/CANDIDATE_menu.gif b/typo3/sysext/tstemplate_ceditor/gfx/CANDIDATE_menu.gif
new file mode 100644 (file)
index 0000000..77ec68d
Binary files /dev/null and b/typo3/sysext/tstemplate_ceditor/gfx/CANDIDATE_menu.gif differ
diff --git a/typo3/sysext/tstemplate_ceditor/gfx/CANDIDATE_page.gif b/typo3/sysext/tstemplate_ceditor/gfx/CANDIDATE_page.gif
new file mode 100644 (file)
index 0000000..d075f46
Binary files /dev/null and b/typo3/sysext/tstemplate_ceditor/gfx/CANDIDATE_page.gif differ
diff --git a/typo3/sysext/tstemplate_ceditor/gfx/CrCPH_basic.gif b/typo3/sysext/tstemplate_ceditor/gfx/CrCPH_basic.gif
new file mode 100644 (file)
index 0000000..ba9dbea
Binary files /dev/null and b/typo3/sysext/tstemplate_ceditor/gfx/CrCPH_basic.gif differ
diff --git a/typo3/sysext/tstemplate_ceditor/gfx/FIRST_basic.gif b/typo3/sysext/tstemplate_ceditor/gfx/FIRST_basic.gif
new file mode 100644 (file)
index 0000000..7b8b2c9
Binary files /dev/null and b/typo3/sysext/tstemplate_ceditor/gfx/FIRST_basic.gif differ
diff --git a/typo3/sysext/tstemplate_ceditor/gfx/FIRST_menu.gif b/typo3/sysext/tstemplate_ceditor/gfx/FIRST_menu.gif
new file mode 100644 (file)
index 0000000..13e4c03
Binary files /dev/null and b/typo3/sysext/tstemplate_ceditor/gfx/FIRST_menu.gif differ
diff --git a/typo3/sysext/tstemplate_ceditor/gfx/GLCK_basic.gif b/typo3/sysext/tstemplate_ceditor/gfx/GLCK_basic.gif
new file mode 100644 (file)
index 0000000..c23aaf4
Binary files /dev/null and b/typo3/sysext/tstemplate_ceditor/gfx/GLCK_basic.gif differ
diff --git a/typo3/sysext/tstemplate_ceditor/gfx/GLCK_columns.gif b/typo3/sysext/tstemplate_ceditor/gfx/GLCK_columns.gif
new file mode 100644 (file)
index 0000000..91ee716
Binary files /dev/null and b/typo3/sysext/tstemplate_ceditor/gfx/GLCK_columns.gif differ
diff --git a/typo3/sysext/tstemplate_ceditor/gfx/GLCK_menu.gif b/typo3/sysext/tstemplate_ceditor/gfx/GLCK_menu.gif
new file mode 100644 (file)
index 0000000..40057f5
Binary files /dev/null and b/typo3/sysext/tstemplate_ceditor/gfx/GLCK_menu.gif differ
diff --git a/typo3/sysext/tstemplate_ceditor/gfx/GREEN_basic.gif b/typo3/sysext/tstemplate_ceditor/gfx/GREEN_basic.gif
new file mode 100644 (file)
index 0000000..4f3ab9b
Binary files /dev/null and b/typo3/sysext/tstemplate_ceditor/gfx/GREEN_basic.gif differ
diff --git a/typo3/sysext/tstemplate_ceditor/gfx/GREEN_menu.gif b/typo3/sysext/tstemplate_ceditor/gfx/GREEN_menu.gif
new file mode 100644 (file)
index 0000000..f258b51
Binary files /dev/null and b/typo3/sysext/tstemplate_ceditor/gfx/GREEN_menu.gif differ
diff --git a/typo3/sysext/tstemplate_ceditor/gfx/GREEN_menu2.gif b/typo3/sysext/tstemplate_ceditor/gfx/GREEN_menu2.gif
new file mode 100644 (file)
index 0000000..9984aad
Binary files /dev/null and b/typo3/sysext/tstemplate_ceditor/gfx/GREEN_menu2.gif differ
diff --git a/typo3/sysext/tstemplate_ceditor/gfx/GREEN_menu3.gif b/typo3/sysext/tstemplate_ceditor/gfx/GREEN_menu3.gif
new file mode 100644 (file)
index 0000000..11cb19f
Binary files /dev/null and b/typo3/sysext/tstemplate_ceditor/gfx/GREEN_menu3.gif differ
diff --git a/typo3/sysext/tstemplate_ceditor/gfx/HYPER_basic.gif b/typo3/sysext/tstemplate_ceditor/gfx/HYPER_basic.gif
new file mode 100644 (file)
index 0000000..f430efa
Binary files /dev/null and b/typo3/sysext/tstemplate_ceditor/gfx/HYPER_basic.gif differ
diff --git a/typo3/sysext/tstemplate_ceditor/gfx/HYPER_menu.gif b/typo3/sysext/tstemplate_ceditor/gfx/HYPER_menu.gif
new file mode 100644 (file)
index 0000000..3a350df
Binary files /dev/null and b/typo3/sysext/tstemplate_ceditor/gfx/HYPER_menu.gif differ
diff --git a/typo3/sysext/tstemplate_ceditor/gfx/HYPER_menu2.gif b/typo3/sysext/tstemplate_ceditor/gfx/HYPER_menu2.gif
new file mode 100644 (file)
index 0000000..7f30a41
Binary files /dev/null and b/typo3/sysext/tstemplate_ceditor/gfx/HYPER_menu2.gif differ
diff --git a/typo3/sysext/tstemplate_ceditor/gfx/HYPER_page.gif b/typo3/sysext/tstemplate_ceditor/gfx/HYPER_page.gif
new file mode 100644 (file)
index 0000000..0ffe393
Binary files /dev/null and b/typo3/sysext/tstemplate_ceditor/gfx/HYPER_page.gif differ
diff --git a/typo3/sysext/tstemplate_ceditor/gfx/HYPER_toptitle.gif b/typo3/sysext/tstemplate_ceditor/gfx/HYPER_toptitle.gif
new file mode 100644 (file)
index 0000000..9047ef5
Binary files /dev/null and b/typo3/sysext/tstemplate_ceditor/gfx/HYPER_toptitle.gif differ
diff --git a/typo3/sysext/tstemplate_ceditor/gfx/MM_basic.gif b/typo3/sysext/tstemplate_ceditor/gfx/MM_basic.gif
new file mode 100644 (file)
index 0000000..1423783
Binary files /dev/null and b/typo3/sysext/tstemplate_ceditor/gfx/MM_basic.gif differ
diff --git a/typo3/sysext/tstemplate_ceditor/gfx/MM_menu.gif b/typo3/sysext/tstemplate_ceditor/gfx/MM_menu.gif
new file mode 100644 (file)
index 0000000..3fe516f
Binary files /dev/null and b/typo3/sysext/tstemplate_ceditor/gfx/MM_menu.gif differ
diff --git a/typo3/sysext/tstemplate_ceditor/gfx/MM_right.gif b/typo3/sysext/tstemplate_ceditor/gfx/MM_right.gif
new file mode 100644 (file)
index 0000000..9ef8996
Binary files /dev/null and b/typo3/sysext/tstemplate_ceditor/gfx/MM_right.gif differ
diff --git a/typo3/sysext/tstemplate_ceditor/gfx/NEWSLETTER_basic.gif b/typo3/sysext/tstemplate_ceditor/gfx/NEWSLETTER_basic.gif
new file mode 100644 (file)
index 0000000..2964ed0
Binary files /dev/null and b/typo3/sysext/tstemplate_ceditor/gfx/NEWSLETTER_basic.gif differ
diff --git a/typo3/sysext/tstemplate_ceditor/gfx/RE_basic.gif b/typo3/sysext/tstemplate_ceditor/gfx/RE_basic.gif
new file mode 100644 (file)
index 0000000..61f36ca
Binary files /dev/null and b/typo3/sysext/tstemplate_ceditor/gfx/RE_basic.gif differ
diff --git a/typo3/sysext/tstemplate_ceditor/gfx/RE_leftmenu.gif b/typo3/sysext/tstemplate_ceditor/gfx/RE_leftmenu.gif
new file mode 100644 (file)
index 0000000..99efd24
Binary files /dev/null and b/typo3/sysext/tstemplate_ceditor/gfx/RE_leftmenu.gif differ
diff --git a/typo3/sysext/tstemplate_ceditor/gfx/RE_menu.gif b/typo3/sysext/tstemplate_ceditor/gfx/RE_menu.gif
new file mode 100644 (file)
index 0000000..402a9c6
Binary files /dev/null and b/typo3/sysext/tstemplate_ceditor/gfx/RE_menu.gif differ
diff --git a/typo3/sysext/tstemplate_ceditor/gfx/RE_top.gif b/typo3/sysext/tstemplate_ceditor/gfx/RE_top.gif
new file mode 100644 (file)
index 0000000..4b1ee32
Binary files /dev/null and b/typo3/sysext/tstemplate_ceditor/gfx/RE_top.gif differ
diff --git a/typo3/sysext/tstemplate_ceditor/gfx/TU_basic.gif b/typo3/sysext/tstemplate_ceditor/gfx/TU_basic.gif
new file mode 100644 (file)
index 0000000..c57d75d
Binary files /dev/null and b/typo3/sysext/tstemplate_ceditor/gfx/TU_basic.gif differ
diff --git a/typo3/sysext/tstemplate_ceditor/gfx/TU_menu.gif b/typo3/sysext/tstemplate_ceditor/gfx/TU_menu.gif
new file mode 100644 (file)
index 0000000..7495b62
Binary files /dev/null and b/typo3/sysext/tstemplate_ceditor/gfx/TU_menu.gif differ
diff --git a/typo3/sysext/tstemplate_info/ChangeLog b/typo3/sysext/tstemplate_info/ChangeLog
new file mode 100644 (file)
index 0000000..95299d4
--- /dev/null
@@ -0,0 +1,7 @@
+2005-12-23  Michael Stucki  <michael@typo3.org>
+
+       * Moved tstemplate, tstemplate_analyzer, tstemplate_ceditor, tstemplate_info, tstemplate_objbrowser as system extensions to TYPO3core
+
+2005-11-25  Michael Stucki  <michael@typo3.org>
+
+       * Added a ChangeLog
diff --git a/typo3/sysext/tstemplate_info/class.tx_tstemplateinfo.php b/typo3/sysext/tstemplate_info/class.tx_tstemplateinfo.php
new file mode 100644 (file)
index 0000000..16d7b95
--- /dev/null
@@ -0,0 +1,429 @@
+<?php
+/***************************************************************
+*  Copyright notice
+*
+*  (c) 1999-2005 Kasper Skaarhoj (kasperYYYY@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!
+***************************************************************/
+/**
+ * @author     Kasper Skårhøj <kasperYYYY@typo3.com>
+ */
+
+require_once(PATH_t3lib."class.t3lib_extobjbase.php");
+
+class tx_tstemplateinfo extends t3lib_extobjbase {
+       function modMenu()      {
+               global $LANG;
+
+               return Array (
+                       #"ts_template_editor_TArows" => ""
+               );
+       }
+       function tableRow($label,$data,$field)  {
+               $ret='<tr><td bgcolor="#D9D5C9" width="1%">';
+               $ret.='<a href="index.php?id='.$this->pObj->id.'&e['.$field.']=1"><img src="'.$GLOBALS["BACK_PATH"].'gfx/edit2.gif" width=11 height=12 hspace=3 border=0 title="Edit field"></a>';
+               $ret.='</td><td bgcolor="#D9D5C9" width="1%"><b>'.$label.'&nbsp;&nbsp;</b></td><td bgcolor="#D9D5C9" width="99%">'.$data.'&nbsp;</td></tr>';
+               return $ret;
+       }
+       function procesResources($resources,$func=0)    {
+               $arr = t3lib_div::trimExplode(",",$resources.",,",1);
+               $out="";
+               if ($func)      {$bgcol=' class="bgColor4"';} else {$bgcol="";}
+               while(list($k,$v)=each($arr))   {
+                       $path = PATH_site.$GLOBALS["TCA"]["sys_template"]["columns"]["resources"]["config"]["uploadfolder"]."/".$v;
+                       $functions="";
+                       if ($func)      {
+                               $functions='<td bgcolor=red nowrap>Delete: <input type="Checkbox" name="data[remove_resource]['.$k.']" value="'.htmlspecialchars($v).'"></td>';
+                               $functions.='<td'.$bgcol.' nowrap>To top: <input type="Checkbox" name="data[totop_resource]['.$k.']" value="'.htmlspecialchars($v).'"></td>';
+                               $functions.='<td'.$bgcol.' nowrap>';
+                               $fI=t3lib_div::split_fileref($v);
+                               if (t3lib_div::inList($this->pObj->textExtensions,$fI["fileext"]))      {
+                                       $functions.='<a href="index.php?id='.$this->pObj->id.'&e[file]='.rawurlencode($v).'"><img src="'.$GLOBALS["BACK_PATH"].'gfx/edit2.gif" width=11 height=12 hspace=3 border=0 title="Edit file"></a>';
+                               }
+                               $functions.='</td>';
+                       }
+                       $thumb=t3lib_BEfunc::thumbCode(array("resources"=>$v),"sys_template","resources",$GLOBALS["BACK_PATH"],"");
+                       $out.='<tr><td'.$bgcol.' nowrap>'.$v.'&nbsp;&nbsp;</td><td'.$bgcol.' nowrap>&nbsp;'.t3lib_div::formatSize(@filesize($path)).'&nbsp;</td>'.$functions.'<td'.$bgcol.'>'.trim($thumb).'</td></tr>';
+               }
+               if ($out)       {
+                       if ($func)      {
+                               $out = '<table border=0 cellpadding=1 cellspacing=1 width="100%">'.$out.'</table>';
+                               $out='<table border=0 cellpadding=0 cellspacing=0>
+                                       <tr><td class="bgColor2">'.$out.'<img src=clear.gif width=465 height=1></td></tr>
+                               </table>';
+                       } else {
+                               $out = '<table border=0 cellpadding=0 cellspacing=0>'.$out.'</table>';
+                       }
+               }
+               return $out;
+       }
+       function resourceListForCopy($id,$template_uid) {
+               global $tmpl;
+               $sys_page = t3lib_div::makeInstance("t3lib_pageSelect");
+               $rootLine = $sys_page->getRootLine($id);
+               $tmpl->runThroughTemplates($rootLine,$template_uid);    // This generates the constants/config + hierarchy info for the template.
+               $theResources = t3lib_div::trimExplode(",",$tmpl->resources,1);
+               reset($theResources);
+               while(list($k,$v)=each($theResources))  {
+                       $fI=pathinfo($v);
+                       if (t3lib_div::inList($this->pObj->textExtensions,strtolower($fI["extension"])))        {
+                               $path = PATH_site.$GLOBALS["TCA"]["sys_template"]["columns"]["resources"]["config"]["uploadfolder"]."/".$v;
+                               $thumb=t3lib_BEfunc::thumbCode(array("resources"=>$v),"sys_template","resources",$GLOBALS["BACK_PATH"],"");
+                               $out.='<tr><td'.$bgcol.' nowrap>'.$v.'&nbsp;&nbsp;</td><td'.$bgcol.' nowrap>&nbsp;'.t3lib_div::formatSize(@filesize($path)).'&nbsp;</td><td'.$bgcol.'>'.trim($thumb).'</td><td><input type="Checkbox" name="data[makecopy_resource]['.$k.']" value="'.htmlspecialchars($v).'"></td></tr>';
+                       }
+               }
+               $out = $out ? '<table border=0 cellpadding=0 cellspacing=0>'.$out.'</table>' : "";
+               return $out;
+       }
+       function initialize_editor($pageId,$template_uid=0)     {
+                       // Initializes the module. Done in this function because we may need to re-initialize if data is submitted!
+               global $tmpl,$tplRow,$theConstants;
+
+               $tmpl = t3lib_div::makeInstance("t3lib_tsparser_ext");  // Defined global here!
+               $tmpl->tt_track = 0;    // Do not log time-performance information
+               $tmpl->init();
+
+               $tplRow = $tmpl->ext_getFirstTemplate($pageId,$template_uid);   // Get the row of the first VISIBLE template of the page. whereclause like the frontend.
+               if (is_array($tplRow))  {
+                       return 1;
+               }
+       }
+       function main() {
+               global $SOBE,$BE_USER,$LANG,$BACK_PATH,$TCA_DESCR,$TCA,$CLIENT,$TYPO3_CONF_VARS;
+               global $tmpl,$tplRow,$theConstants;
+
+               $edit = $this->pObj->edit;
+               $e = $this->pObj->e;
+
+               t3lib_div::loadTCA("sys_template");
+
+               // **************************
+               // Create extension template
+               // **************************
+               $this->pObj->createTemplate($this->pObj->id);
+
+
+               // **************************
+               // Checking for more than one template an if, set a menu...
+               // **************************
+               $manyTemplatesMenu = $this->pObj->templateMenu();
+               $template_uid = 0;
+               if ($manyTemplatesMenu) {
+                       $template_uid = $this->pObj->MOD_SETTINGS["templatesOnPage"];
+               }
+
+
+
+
+
+               // **************************
+               // Initialize
+               // **************************
+               $existTemplate = $this->initialize_editor($this->pObj->id,$template_uid);               // initialize
+               if ($existTemplate)     {
+                       $saveId = $tplRow['_ORIG_uid'] ? $tplRow['_ORIG_uid'] : $tplRow['uid'];
+
+                               // Update template ?
+                       $POST = t3lib_div::_POST();
+                       if ($POST["submit"])    {
+                               require_once (PATH_t3lib."class.t3lib_tcemain.php");
+                                       // Set the data to be saved
+                               $recData=array();
+                               $alternativeFileName=array();
+                               $resList = $tplRow["resources"];
+
+                               $tmp_upload_name = '';
+                               $tmp_newresource_name = '';     // Set this to blank
+
+                               if (is_array($POST["data"]))    {
+                                       while(list($field,$val)=each($POST["data"]))    {
+                                               switch($field)  {
+                                                       case "constants":
+                                                       case "config":
+                                                       case "title":
+                                                       case "sitetitle":
+                                                       case "description":
+                                                               $recData["sys_template"][$saveId][$field] = $val;
+                                                       break;
+                                                       case "resources":
+                                                               $tmp_upload_name = t3lib_div::upload_to_tempfile($_FILES["resources"]["tmp_name"]);     // If there is an uploaded file, move it for the sake of safe_mode.
+                                                               if ($tmp_upload_name)   {
+                                                                       if ($tmp_upload_name!="none" && $_FILES["resources"]["name"])   {
+                                                                               $alternativeFileName[$tmp_upload_name] = trim($_FILES["resources"]["name"]);
+                                                                               $resList = $tmp_upload_name.",".$resList;
+                                                                       }
+                                                               }
+                                                       break;
+                                                       case "new_resource":
+                                                               $newName = trim(t3lib_div::_GP("new_resource"));
+                                                               if ($newName)   {
+                                                                       $newName.=".".t3lib_div::_GP("new_resource_ext");
+                                                                       $tmp_newresource_name = t3lib_div::tempnam("new_resource_");
+                                                                       $alternativeFileName[$tmp_newresource_name] = $newName;
+                                                                       $resList = $tmp_newresource_name.",".$resList;
+                                                               }
+                                                       break;
+                                                       case "makecopy_resource":
+                                                               if (is_array($val))     {
+                                                                       reset($val);
+                                                                       $resList=",".$resList.",";
+                                                                       while(list($k,$file)=each($val))        {
+                                                                               $tmp_name = PATH_site.$TCA["sys_template"]["columns"]["resources"]["config"]["uploadfolder"]."/".$file;
+               //                                                              debug($tmp_name);
+                                                                               $resList = $tmp_name.",".$resList;
+                                                                       }
+                                                               }
+                                                       break;
+                                                       case "remove_resource":
+                                                               if (is_array($val))     {
+                                                                       reset($val);
+                                                                       $resList=",".$resList.",";
+                                                                       while(list($k,$file)=each($val))        {
+                                                                               $resList = str_replace(",".$file.",", ",", $resList);
+                                                                       }
+                                                               }
+                                                       break;
+                                                       case "totop_resource":
+                                                               if (is_array($val))     {
+                                                                       reset($val);
+                                                                       $resList=",".$resList.",";
+                                                                       while(list($k,$file)=each($val))        {
+                                                                               $resList = str_replace(",".$file.",", ",", $resList);
+                                                                               $resList = ",".$file.$resList;
+                                                                       }
+                                                               }
+               //                                              debug($resList);
+                                                       break;
+                                               }
+                                       }
+                               }
+                               $resList=implode(t3lib_div::trimExplode(",",$resList,1),",");
+                               if (strcmp($resList,$tplRow["resources"]))      {
+                                       $recData["sys_template"][$saveId]["resources"] = $resList;
+               //                      debug("update resource - ".$resList);
+                               }
+                               if (count($recData))    {
+                                               // Create new  tce-object
+                                       $tce = t3lib_div::makeInstance("t3lib_TCEmain");
+                                       $tce->stripslashes_values=0;
+                                       $tce->alternativeFileName = $alternativeFileName;
+                                               // Initialize
+               //                              debug($recData);
+                                       $tce->start($recData,Array());
+                                               // Saved the stuff
+                                       $tce->process_datamap();
+                                               // Clear the cache (note: currently only admin-users can clear the cache in tce_main.php)
+                                       $tce->clear_cacheCmd("all");
+
+                                               // re-read the template ...
+                                       $this->initialize_editor($this->pObj->id,$template_uid);
+                               }
+
+                                       // Unlink any uploaded/new temp files there was:
+                               t3lib_div::unlink_tempfile($tmp_upload_name);
+                               t3lib_div::unlink_tempfile($tmp_newresource_name);
+
+                                       // If files has been edited:
+                               if (is_array($edit))            {
+                                       if ($edit["filename"] && $tplRow["resources"] && t3lib_div::inList($tplRow["resources"], $edit["filename"]))    {               // Check if there are resources, and that the file is in the resourcelist.
+                                               $path = PATH_site.$TCA["sys_template"]["columns"]["resources"]["config"]["uploadfolder"]."/".$edit["filename"];
+                                               $fI=t3lib_div::split_fileref($edit["filename"]);
+                                               if (@is_file($path) && t3lib_div::getFileAbsFileName($path) && t3lib_div::inList($this->pObj->textExtensions,$fI["fileext"]))   {               // checks that have already been done.. Just to make sure
+                                                       if (filesize($path)<(30*1024))  {       // checks that have already been done.. Just to make sure
+                                                               t3lib_div::writeFile($path,$edit['file']);
+
+                                                               $theOutput.=$this->pObj->doc->spacer(10);
+                                                               $theOutput.=$this->pObj->doc->section("<font color=red>FILE CHANGED</font>","Resource '".$edit["filename"]."' has been updated.",0,0,0,1);
+
+                                                                       // Clear cache - the file has probably affected the template setup
+                                                               $tce = t3lib_div::makeInstance("t3lib_TCEmain");
+                                                               $tce->stripslashes_values=0;
+                                                               $tce->start(Array(),Array());
+                                                               $tce->clear_cacheCmd("all");
+                                                       }
+                                               }
+                                       }
+                               }
+                       }
+
+                       $theOutput.=$this->pObj->doc->spacer(5);
+                       $theOutput.=$this->pObj->doc->section("Template information:",'<img src="'.$BACK_PATH.t3lib_iconWorks::getIcon("sys_template",$tplRow).'" width=18 height=16 align=top><b>'.htmlspecialchars($tplRow["title"]).'</b>'.htmlspecialchars(trim($tplRow["sitetitle"])?' - ('.$tplRow["sitetitle"].')':''),0,1);
+                       if ($manyTemplatesMenu) {
+                               $theOutput.=$this->pObj->doc->section("",$manyTemplatesMenu);
+                               $theOutput.=$this->pObj->doc->divider(5);
+                       }
+
+               /*      $e[constants]=1;
+                       $e[config]=1;
+                       $e[title]=1;
+                       $e[sitetitle]=1;
+                       */
+                       #$numberOfRows= t3lib_div::intInRange($this->pObj->MOD_SETTINGS["ts_template_editor_TArows"],0,150);
+                       #if (!$numberOfRows)
+                       $numberOfRows = 35;
+
+                       if (t3lib_div::_POST('abort'))          {unset($e);}    // If abort pressed, nothing should be edited.
+
+                       if (is_array($e))       {
+                               $theOutput.=$this->pObj->doc->section("",'<BR><input type="Submit" name="submit" value="Update"> <input type="Submit" name="abort" value="Cancel">');
+                       }
+                       if ($e["title"])        {
+                               $outCode='<input type="Text" name="data[title]" value="'.htmlspecialchars($tplRow[title]).'"'.$this->pObj->doc->formWidth().'>';
+                               $outCode.='<input type="Hidden" name="e[title]" value="1">';
+                               $theOutput.=$this->pObj->doc->spacer(15);
+                               $theOutput.=$this->pObj->doc->section("Title:",$outCode);
+                       }
+                       if ($e["sitetitle"])    {
+                               $outCode='<input type="Text" name="data[sitetitle]" value="'.htmlspecialchars($tplRow[sitetitle]).'"'.$this->pObj->doc->formWidth().'>';
+                               $outCode.='<input type="Hidden" name="e[sitetitle]" value="1">';
+                               $theOutput.=$this->pObj->doc->spacer(15);
+                               $theOutput.=$this->pObj->doc->section("Sitetitle:",$outCode);
+                       }
+                       if ($e["description"])  {
+                               $outCode='<textarea name="data[description]" rows="5" '.$this->pObj->doc->formWidthText(48,"","").'>'.t3lib_div::formatForTextarea($tplRow[description]).'</textarea>';
+                               $outCode.='<input type="Hidden" name="e[description]" value="1">';
+                               $theOutput.=$this->pObj->doc->spacer(15);
+                               $theOutput.=$this->pObj->doc->section("Description:",$outCode);
+                       }
+                       if ($e["resources"])    {
+                                       // Upload
+                               $outCode='<input type="File" name="resources"'.$this->pObj->doc->formWidth().' size="50">';
+                               $outCode.='<input type="Hidden" name="data[resources]" value="1">';
+                               $outCode.='<input type="Hidden" name="e[resources]" value="1">';
+                               $outCode.='<BR>Allowed extensions: <b>'.$TCA["sys_template"]["columns"]["resources"]["config"]["allowed"].'</b>';
+                               $outCode.='<BR>Max file size: <b>'.t3lib_div::formatSize($TCA["sys_template"]["columns"]["resources"]["config"]["max_size"]*1024).'</b>';
+                               $theOutput.=$this->pObj->doc->spacer(15);
+                               $theOutput.=$this->pObj->doc->section("Upload resource:",$outCode);
+
+                                       // New
+                               $opt=explode(",",$this->pObj->textExtensions);
+                               $optTags="";
+                               while(list(,$extVal)=each($opt))        {
+                                       $optTags.='<option value="'.$extVal.'">.'.$extVal.'</option>';
+                               }
+                               $outCode='<input type="text" name="new_resource"'.$this->pObj->doc->formWidth(20).'>
+                                       <select name="new_resource_ext">'.$optTags.'</select>';
+                               $outCode.='<input type="Hidden" name="data[new_resource]" value="1">';
+                               $theOutput.=$this->pObj->doc->spacer(15);
+                               $theOutput.=$this->pObj->doc->section("New text resource (enter name):",$outCode);
+
+                                       // Make copy
+                               $rL = $this->resourceListForCopy($this->pObj->id,$template_uid);
+                               if ($rL)        {
+                                       $theOutput.=$this->pObj->doc->spacer(20);
+                                       $theOutput.=$this->pObj->doc->section("Make a copy of resource:",$rL);
+                               }
+
+                                       // Update resource list
+                               $rL = $this->procesResources($tplRow["resources"],1);
+                               if ($rL)        {
+                                       $theOutput.=$this->pObj->doc->spacer(20);
+                                       $theOutput.=$this->pObj->doc->section("Update resource list:",$rL);
+                               }
+                       }
+                       if ($e["constants"])    {
+                               $outCode='<textarea name="data[constants]" rows="'.$numberOfRows.'" wrap="off"'.$this->pObj->doc->formWidthText(48,"width:98%;height:70%","off").'>'.t3lib_div::formatForTextarea($tplRow["constants"]).'</textarea>';
+                               $outCode.='<input type="Hidden" name="e[constants]" value="1">';
+                               $theOutput.=$this->pObj->doc->spacer(15);
+                               $theOutput.=$this->pObj->doc->section("Constants:","");
+                               $theOutput.=$this->pObj->doc->sectionEnd().$outCode;
+                       }
+                       if ($e["file"]) {
+                               $path = PATH_site.$TCA["sys_template"]["columns"]["resources"]["config"]["uploadfolder"]."/".$e[file];
+               //              debug($path);
+                               $fI=t3lib_div::split_fileref($e[file]);
+                               if (@is_file($path) && t3lib_div::inList($this->pObj->textExtensions,$fI["fileext"]))   {
+                                       if (filesize($path)<(30*1024))  {
+                                               $fileContent = t3lib_div::getUrl($path);
+                                               $outCode='File: <b>'.$e[file].'</b><BR>';
+                                               $outCode.='<textarea name="edit[file]" rows="'.$numberOfRows.'" wrap="off"'.$this->pObj->doc->formWidthText(48,"width:98%;height:70%","off").'>'.t3lib_div::formatForTextarea($fileContent).'</textarea>';
+                                               $outCode.='<input type="Hidden" name="edit[filename]" value="'.$e[file].'">';
+                                               $outCode.='<input type="Hidden" name="e[file]" value="'.htmlspecialchars($e[file]).'">';
+                                               $theOutput.=$this->pObj->doc->spacer(15);
+                                               $theOutput.=$this->pObj->doc->section("Edit Resource:","");
+                                               $theOutput.=$this->pObj->doc->sectionEnd().$outCode;
+                                       } else {
+                                               $theOutput.=$this->pObj->doc->spacer(15);
+                                               $theOutput.=$this->pObj->doc->section('<font color=red>Filesize exceeded 30 Kbytes</font>','Files larger than 30 KByes are not allowed to be edited.',0,0,0,1);
+                                       }
+                               }
+                       }
+                       if ($e["config"])       {
+                               $outCode='<textarea name="data[config]" rows="'.$numberOfRows.'" wrap="off"'.$this->pObj->doc->formWidthText(48,"width:98%;height:70%","off").'>'.t3lib_div::formatForTextarea($tplRow["config"]).'</textarea>';
+
+                               if (t3lib_extMgm::isLoaded("tsconfig_help"))    {
+                                       $url=$BACK_PATH."wizard_tsconfig.php?mode=tsref";
+                                       $params=array();
+                                       $params["formName"]="editForm";
+                                       $params["itemName"]="data[config]";
+                                       $outCode.='<a href="#" onClick="vHWin=window.open(\''.$url.t3lib_div::implodeArrayForUrl("",array("P"=>$params)).'\',\'popUp'.$md5ID.'\',\'height=500,width=780,status=0,menubar=0,scrollbars=1\');vHWin.focus();return false;"><img src="'.$BACK_PATH.'gfx/wizard_tsconfig.gif" width="22" height="27" border="0" title="TSref reference"></a>';
+                               }
+
+                               $outCode.='<input type="Hidden" name="e[config]" value="1">';
+                               $theOutput.=$this->pObj->doc->spacer(15);
+                               $theOutput.=$this->pObj->doc->section("Setup:","");
+                               $theOutput.=$this->pObj->doc->sectionEnd().$outCode;
+                       }
+                       if (is_array($e))       {
+                               $theOutput.=$this->pObj->doc->section("",'<BR><input type="Submit" name="submit" value="Update"> <input type="Submit" name="abort" value="Cancel">');
+                       }
+
+                                       // Processing:
+               //      debug($tplRow);
+                       $outCode="";
+                       $outCode.=$this->tableRow("Title:",htmlspecialchars($tplRow["title"]),"title");
+                       $outCode.=$this->tableRow("Sitetitle:",htmlspecialchars($tplRow["sitetitle"]),"sitetitle");
+                       $outCode.=$this->tableRow("Description:",nl2br(htmlspecialchars($tplRow["description"])),"description");
+                       $outCode.=$this->tableRow("Resources:",$this->procesResources($tplRow["resources"]),"resources");
+                       $outCode.=$this->tableRow("Constants:","(edit to view, ".(trim($tplRow[constants]) ? count(explode(chr(10), $tplRow[constants])):0)." lines)","constants");
+                       $outCode.=$this->tableRow("Setup:","(edit to view, ".(trim($tplRow[config]) ? count(explode(chr(10), $tplRow[config])):0)." lines)","config");
+                       $outCode='<table border=0 cellpadding=1 cellspacing=1 width="100%">'.$outCode.'</table>';
+
+                       $outCode='<table border=0 cellpadding=0 cellspacing=0>
+                               <tr><td class="bgColor2">'.$outCode.'<img src=clear.gif width=465 height=1></td></tr>
+                       </table>';
+
+                               // Edit all icon:
+                       $outCode.='<BR><a href="#" onClick="'.t3lib_BEfunc::editOnClick(rawurlencode('&createExtension=0').'&edit[sys_template]['.$tplRow['uid'].']=edit',$BACK_PATH,'').'"><strong>Click here to edit whole template record</strong></a>';
+
+                       $theOutput.=$this->pObj->doc->spacer(25);
+                       $theOutput.=$this->pObj->doc->section("",$outCode);
+
+                       $theOutput.=$this->pObj->doc->spacer(10);
+                       $theOutput.=$this->pObj->doc->section("Cache",'Click here to <a href="index.php?id='.$this->pObj->id.'&clear_all_cache=1"><strong>clear all cache</strong></a>.<BR><br>
+                       Status: '.$this->pObj->getCountCacheTables(1),0,1);
+
+               //      $theOutput.=$this->pObj->doc->divider(5);
+#                      $menu = htmlspecialchars("Rows in <TEXTAREA> fields: ").t3lib_BEfunc::getFuncInput($this->pObj->id,"SET[ts_template_editor_TArows]",$this->pObj->MOD_SETTINGS["ts_template_editor_TArows"]);
+#                      $theOutput.=$this->pObj->doc->section("CONFIG:",$menu,0,1);
+               } else {
+                       $theOutput.=$this->pObj->noTemplate(1);
+               }
+               return $theOutput;
+       }
+}
+
+if (defined("TYPO3_MODE") && $TYPO3_CONF_VARS[TYPO3_MODE]["XCLASS"]["ext/tstemplate_info/class.tx_tstemplateinfo.php"])        {
+       include_once($TYPO3_CONF_VARS[TYPO3_MODE]["XCLASS"]["ext/tstemplate_info/class.tx_tstemplateinfo.php"]);
+}
+
+?>
diff --git a/typo3/sysext/tstemplate_info/ext_emconf.php b/typo3/sysext/tstemplate_info/ext_emconf.php
new file mode 100644 (file)
index 0000000..7d28fa1
--- /dev/null
@@ -0,0 +1,42 @@
+<?php
+
+########################################################################
+# Extension Manager/Repository config file for ext: "tstemplate_info"
+# 
+# Auto generated 07-10-2005 15:55
+# 
+# Manual updates:
+# Only the data in the array - anything else is removed by next write
+########################################################################
+
+$EM_CONF[$_EXTKEY] = Array (
+       'title' => 'Web>Template, Info/Modify',
+       'description' => 'Quick and easy editing of template record Setup and Constants fields. Allows editing of attached txt-resource files.',
+       'category' => 'module',
+       'shy' => 1,
+       'dependencies' => 'tstemplate',
+       'conflicts' => '',
+       'priority' => '',
+       'loadOrder' => '',
+       'TYPO3_version' => '-',
+       'PHP_version' => '-',
+       'module' => '',
+       'state' => 'stable',
+       'internal' => 0,
+       'uploadfolder' => 0,
+       'createDirs' => '',
+       'modify_tables' => '',
+       'clearCacheOnLoad' => 0,
+       'lockType' => '',
+       'author' => 'Kasper Skårhøj',
+       'author_email' => 'kasperYYYY@typo3.com',
+       'author_company' => 'Curby Soft Multimedia',
+       'CGLcompliance' => '',
+       'CGLcompliance_note' => '',
+       'private' => 0,
+       'download_password' => '',
+       'version' => '0.0.4',   // Don't modify this! Managed automatically during upload to repository.
+       '_md5_values_when_last_written' => 'a:3:{s:27:"class.tx_tstemplateinfo.php";s:4:"5379";s:12:"ext_icon.gif";s:4:"ecbc";s:14:"ext_tables.php";s:4:"f4b1";}',
+);
+
+?>
\ No newline at end of file
diff --git a/typo3/sysext/tstemplate_info/ext_icon.gif b/typo3/sysext/tstemplate_info/ext_icon.gif
new file mode 100644 (file)
index 0000000..338f0df
Binary files /dev/null and b/typo3/sysext/tstemplate_info/ext_icon.gif differ
diff --git a/typo3/sysext/tstemplate_info/ext_tables.php b/typo3/sysext/tstemplate_info/ext_tables.php
new file mode 100644 (file)
index 0000000..8070e77
--- /dev/null
@@ -0,0 +1,12 @@
+<?php
+if (!defined ('TYPO3_MODE'))   die ('Access denied.');
+
+if (TYPO3_MODE=='BE')  {
+       t3lib_extMgm::insertModuleFunction(
+               'web_ts',
+               'tx_tstemplateinfo',
+               t3lib_extMgm::extPath($_EXTKEY).'class.tx_tstemplateinfo.php',
+               'Info/Modify'
+       );
+}
+?>
\ No newline at end of file
diff --git a/typo3/sysext/tstemplate_objbrowser/ChangeLog b/typo3/sysext/tstemplate_objbrowser/ChangeLog
new file mode 100644 (file)
index 0000000..a024c9e
--- /dev/null
@@ -0,0 +1,11 @@
+2005-12-23  Michael Stucki  <michael@typo3.org>
+
+       * Moved tstemplate, tstemplate_analyzer, tstemplate_ceditor, tstemplate_info, tstemplate_objbrowser as system extensions to TYPO3core
+
+2005-12-15  Michael Stucki  <michael@typo3.org>
+
+       * Fixed the broken object-list feature
+
+2005-11-25  Michael Stucki  <michael@typo3.org>
+
+       * Added a ChangeLog
diff --git a/typo3/sysext/tstemplate_objbrowser/class.tx_tstemplateobjbrowser.php b/typo3/sysext/tstemplate_objbrowser/class.tx_tstemplateobjbrowser.php
new file mode 100644 (file)
index 0000000..adaf181
--- /dev/null
@@ -0,0 +1,507 @@
+<?php
+/***************************************************************
+*  Copyright notice
+*
+*  (c) 1999-2005 Kasper Skaarhoj (kasperYYYY@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!
+***************************************************************/
+/**
+ * @author     Kasper Skårhøj <kasperYYYY@typo3.com>
+ */
+
+require_once(PATH_t3lib."class.t3lib_extobjbase.php");
+
+class tx_tstemplateobjbrowser extends t3lib_extobjbase {
+       function modMenu()      {
+               global $LANG;
+
+               $modMenu = array (
+                       "ts_browser_type" => array(
+                               "setup" => "Setup",
+                               "const" => "Constants"
+                       ),
+                       "ts_browser_toplevel_setup" => array(
+                               "0" => "ALL"
+                       ),
+                       "ts_browser_toplevel_const" => array(
+                               "0" => "ALL"
+                       ),
+                       "ts_browser_const" => array(
+                               "0" => "Plain substitution (default)",
+                               "subst" => "Substituted constants in green",
+                               "const" => "UN-substituted constants in green"
+                       ),
+                       "ts_browser_regexsearch" => "",
+                       "ts_browser_fixedLgd" => "1",
+                       "ts_browser_linkObjects" => "1",
+               );
+
+               foreach(array('setup','const') as $bType)       {
+                       $addKey = t3lib_div::_GET('addKey');
+                       if (is_array($addKey))  {               // If any plus-signs were clicked, it's registred.
+                               reset($addKey);
+                               if (current($addKey))   {
+                                       $this->pObj->MOD_SETTINGS['ts_browser_TLKeys_'.$bType][key($addKey)] = key($addKey);
+                               } else {
+                                       unset($this->pObj->MOD_SETTINGS['ts_browser_TLKeys_'.$bType][key($addKey)]);
+                               }
+                               $GLOBALS['BE_USER']->pushModuleData($this->pObj->MCONF['name'],$this->pObj->MOD_SETTINGS);
+                       }
+
+                       if (count($this->pObj->MOD_SETTINGS['ts_browser_TLKeys_'.$bType]))      {
+                               $modMenu['ts_browser_toplevel_'.$bType]['-']='---';
+                               $modMenu['ts_browser_toplevel_'.$bType] = $modMenu['ts_browser_toplevel_'.$bType] + $this->pObj->MOD_SETTINGS['ts_browser_TLKeys_'.$bType];
+                       }
+               }
+
+               return $modMenu;
+       }
+       function verify_TSobjects($propertyArray,$parentType,$parentValue)      {
+               $TSobjTable = array(
+                       "PAGE" => array(
+                               "prop" => array (
+                                       "typeNum" => "int",
+                                       "1,2,3" => "COBJ",
+                                       "bodyTag" => "string"
+                               )
+                       ),
+                       "TEXT" => array(
+                               "prop" => array (
+                                       "value" => "string"
+                               )
+                       ),
+                       "HTML" => array(
+                               "prop" => array (
+                                       "value" => "stdWrap"
+                               )
+                       ),
+                       "stdWrap" => array(
+                               "prop" => array (
+                                       "field" => "string",
+                                       "current" => "boolean"
+                               )
+                       ),
+               );
+               $TSobjDataTypes = array(
+                       "COBJ" => "TEXT,CONTENT",
+                       "PAGE" => "PAGE",
+                       "stdWrap" => ""
+               );
+
+               if ($parentType)        {
+                       if (isset($TSobjDataTypes[$parentType]) && (!$TSobjDataTypes[$parentType] || t3lib_div::inlist($TSobjDataTypes[$parentType],$parentValue)))     {
+                               $ObjectKind = $parentValue;
+                       } else {
+                               $ObjectKind = "";       // Object kind is "" if it should be known.
+                       }
+               } else {
+                       $ObjectKind = $parentValue;     // If parentType is not given, then it can be anything. Free.
+               }
+
+               if ($ObjectKind && is_array($TSobjTable[$ObjectKind]))  {
+                       $result=array();
+                       if (is_array($propertyArray))           {
+                               reset($propertyArray);
+                               while(list($key,$val)=each($propertyArray))     {
+                                       if (t3lib_div::testInt($key))   {       // If num-arrays
+                                               $result[$key]=$TSobjTable[$ObjectKind]["prop"]["1,2,3"];
+                                       } else {        // standard
+                                               $result[$key]=$TSobjTable[$ObjectKind]["prop"][$key];
+                                       }
+                               }
+                       }
+                       return $result;
+               }
+       }
+       function initialize_editor($pageId,$template_uid=0)     {
+                       // Initializes the module. Done in this function because we may need to re-initialize if data is submitted!
+               global $tmpl,$tplRow,$theConstants;
+
+               $tmpl = t3lib_div::makeInstance("t3lib_tsparser_ext");  // Defined global here!
+               $tmpl->tt_track = 0;    // Do not log time-performance information
+               $tmpl->init();
+
+                               // Gets the rootLine
+               $sys_page = t3lib_div::makeInstance("t3lib_pageSelect");
+               $rootLine = $sys_page->getRootLine($pageId);
+               $tmpl->runThroughTemplates($rootLine,$template_uid);    // This generates the constants/config + hierarchy info for the template.
+
+               $tplRow = $tmpl->ext_getFirstTemplate($pageId,$template_uid);   // Get the row of the first VISIBLE template of the page. whereclause like the frontend.
+               if (is_array($tplRow))  {       // IF there was a template...
+                       return 1;
+               }
+       }
+       function main() {
+               global $SOBE,$BE_USER,$LANG,$BACK_PATH,$TCA_DESCR,$TCA,$CLIENT,$TYPO3_CONF_VARS;
+               global $tmpl,$tplRow,$theConstants;
+
+               $POST = t3lib_div::_POST();
+
+               // **************************
+               // Checking for more than one template an if, set a menu...
+               // **************************
+               $manyTemplatesMenu = $this->pObj->templateMenu();
+               $template_uid = 0;
+               if ($manyTemplatesMenu) {
+                       $template_uid = $this->pObj->MOD_SETTINGS["templatesOnPage"];
+               }
+
+
+
+
+
+               // **************************
+               // Main
+               // **************************
+
+               // BUGBUG: Should we check if the uset may at all read and write template-records???
+               $bType= $this->pObj->MOD_SETTINGS["ts_browser_type"];
+               $existTemplate = $this->initialize_editor($this->pObj->id,$template_uid);               // initialize
+               if ($existTemplate)     {
+                       $theOutput.=$this->pObj->doc->divider(5);
+                       $theOutput.=$this->pObj->doc->section("Current template:",'<img src="'.$BACK_PATH.t3lib_iconWorks::getIcon("sys_template",$tplRow).'" width=18 height=16 align=top><b>'.$this->pObj->linkWrapTemplateTitle($tplRow["title"], ($bType=="setup"?"config":"constants")).'</b>'.htmlspecialchars(trim($tplRow["sitetitle"])?' - ('.$tplRow["sitetitle"].')':''),0,0);
+                       if ($manyTemplatesMenu) {
+                               $theOutput.=$this->pObj->doc->section("",$manyTemplatesMenu);
+                               $theOutput.=$this->pObj->doc->divider(5);
+                       }
+
+                       if ($POST["add_property"] || $POST["update_value"] || $POST["clear_object"])    {
+                                       // add property
+                               $line="";
+               //              debug($POST);
+                               if (is_array($POST["data"]))    {
+                                       if ($POST["add_property"])      {
+                                               reset($POST["data"]);
+                                               $name = key($POST["data"]);
+                                               $property = trim($POST["data"][$name]["name"]);
+                                               if (ereg_replace("[^a-zA-Z0-9_\.]*","",$property)!=$property)   {
+                                                       $theOutput.=$this->pObj->doc->spacer(10);
+                                                       $theOutput.=$this->pObj->doc->section($GLOBALS["TBE_TEMPLATE"]->rfw("BAD PROPERTY!"),'You must enter a property with characters a-z, A-Z and 0-9, no spaces!<BR>Nothing was updated!',0,0,0,1);
+                                               } else {
+                                                       $pline= $name.".".$property." = ".trim($POST["data"][$name]["propertyValue"]);
+                                                       $theOutput.=$this->pObj->doc->spacer(10);
+                                                       $theOutput.=$this->pObj->doc->section($GLOBALS["TBE_TEMPLATE"]->rfw("PROPERTY ADDED"),htmlspecialchars($pline),0,0,0,1);
+                                                       $line.=chr(10).$pline;
+                                               }
+                                       }
+                                       if ($POST["update_value"])      {
+                                               reset($POST["data"]);
+                                               $name = key($POST["data"]);
+                                               $pline= $name." = ".trim($POST["data"][$name]["value"]);
+                                               $theOutput.=$this->pObj->doc->spacer(10);
+                                               $theOutput.=$this->pObj->doc->section($GLOBALS["TBE_TEMPLATE"]->rfw("VALUE UPDATED"),htmlspecialchars($pline),0,0,0,1);
+                                               $line.=chr(10).$pline;
+                                       }
+                                       if ($POST["clear_object"])      {
+                                               reset($POST["data"]);
+                                               $name = key($POST["data"]);
+                                               if ($POST["data"][$name]["clearValue"]) {
+                                                       $pline= $name." >";
+                                                       $theOutput.=$this->pObj->doc->spacer(10);
+                                                       $theOutput.=$this->pObj->doc->section($GLOBALS["TBE_TEMPLATE"]->rfw("Object cleared"),htmlspecialchars($pline),0,0,0,1);
+                                                       $line.=chr(10).$pline;
+                                               }
+                                       }
+                               }
+                               if ($line)      {
+                                       require_once (PATH_t3lib."class.t3lib_tcemain.php");
+                                       $saveId = $tplRow['_ORIG_uid'] ? $tplRow['_ORIG_uid'] : $tplRow['uid'];
+                                               // Set the data to be saved
+                                       $recData=array();
+                                       $field =$bType=="setup"?"config":"constants";
+                                       $recData["sys_template"][$saveId][$field] = $tplRow[$field].$line;
+                                               // Create new  tce-object
+                                       $tce = t3lib_div::makeInstance("t3lib_TCEmain");
+                                       $tce->stripslashes_values=0;
+                                               // Initialize
+                                       $tce->start($recData,Array());
+                                               // Saved the stuff
+                                       $tce->process_datamap();
+                                               // Clear the cache (note: currently only admin-users can clear the cache in tce_main.php)
+                                       $tce->clear_cacheCmd("all");
+
+                                               // re-read the template ...
+                                       $this->initialize_editor($this->pObj->id,$template_uid);
+                               }
+                       }
+               }
+
+               $tsbr = t3lib_div::_GET('tsbr');
+               $update=0;
+               if (is_array($tsbr))    {               // If any plus-signs were clicked, it's registred.
+                       $this->pObj->MOD_SETTINGS["tsbrowser_depthKeys_".$bType] = $tmpl->ext_depthKeys($tsbr, $this->pObj->MOD_SETTINGS["tsbrowser_depthKeys_".$bType]);
+                       $update=1;
+               }
+
+               if ($POST["Submit"])    {               // If any POST-vars are send, update the condition array
+                       $this->pObj->MOD_SETTINGS["tsbrowser_conditions"] = $POST["conditions"];
+                       $update=1;
+               }
+               if ($update)    { $GLOBALS["BE_USER"]->pushModuleData($this->pObj->MCONF["name"],$this->pObj->MOD_SETTINGS); }
+
+
+               $tmpl->matchAlternative = $this->pObj->MOD_SETTINGS['tsbrowser_conditions'];
+               $tmpl->matchAlternative[] = 'dummydummydummydummydummydummydummydummydummydummydummy';  // This is just here to make sure that at least one element is in the array so that the tsparser actually uses this array to match.
+
+               $tmpl->constantMode = $this->pObj->MOD_SETTINGS["ts_browser_fixedLgd"] ? "" : $this->pObj->MOD_SETTINGS["ts_browser_const"];
+               if ($this->pObj->sObj && $tmpl->constantMode)   {$tmpl->constantMode = "untouched";}
+
+               $tmpl->regexMode = $this->pObj->MOD_SETTINGS["ts_browser_regexsearch"];
+               $tmpl->fixedLgd=$this->pObj->MOD_SETTINGS["ts_browser_fixedLgd"];
+#              $tmpl->linkObjects=$this->pObj->MOD_SETTINGS["ts_browser_linkObjects"];
+               $tmpl->linkObjects = TRUE;
+               $tmpl->ext_regLinenumbers = TRUE;
+               $tmpl->bType=$bType;
+               $tmpl->resourceCheck=1;
+               $tmpl->uplPath = PATH_site.$tmpl->uplPath;
+               $tmpl->removeFromGetFilePath = PATH_site;
+               //debug($tmpl->uplPath);
+
+               if ($this->pObj->MOD_SETTINGS["ts_browser_type"]=="const")      {
+                       $tmpl->ext_constants_BRP=intval(t3lib_div::_GP("breakPointLN"));
+               } else {
+                       $tmpl->ext_config_BRP=intval(t3lib_div::_GP("breakPointLN"));
+               }
+               $tmpl->generateConfig();
+
+               if ($bType=="setup")    {
+                       $theSetup = $tmpl->setup;
+               } else {
+                       $theSetup = $tmpl->setup_constants;
+               }
+
+                       // EDIT A VALUE:
+               if ($this->pObj->sObj)  {
+                       list($theSetup,$theSetupValue) = $tmpl->ext_getSetup($theSetup, ($this->pObj->sObj?$this->pObj->sObj:""));
+                       $theOutput.=$this->pObj->doc->divider(5);
+                       if ($existTemplate)     {
+                                       // Value
+                               $out="";
+                               $out=$this->pObj->sObj." =<BR>";
+                               $out.='<input type="Text" name="data['.$this->pObj->sObj.'][value]" value="'.htmlspecialchars($theSetupValue).'"'.$GLOBALS["TBE_TEMPLATE"]->formWidth(40).'>';
+                               $out.='<input type="Submit" name="update_value" value="Update">';
+                               $theOutput.=$this->pObj->doc->section("Edit object/property value:",$out,0,0);
+
+                                       // Property
+                               if (t3lib_extMgm::isLoaded("tsconfig_help"))    {
+                                       $url=$BACK_PATH."wizard_tsconfig.php?mode=tsref&onlyProperty=1";
+                                       $params=array();
+                                       $params["formName"]="editForm";
+                                       $params["itemName"]="data[".$this->pObj->sObj."][name]";
+                                       $params["itemValue"]="data[".$this->pObj->sObj."][propertyValue]";
+                                       $TSicon='<a href="#" onClick="vHWin=window.open(\''.$url.t3lib_div::implodeArrayForUrl("",array("P"=>$params)).'\',\'popUp'.$md5ID.'\',\'height=500,width=780,status=0,menubar=0,scrollbars=1\');vHWin.focus();return false;"><img src="'.$BACK_PATH.'gfx/wizard_tsconfig_s.gif" width="22" height="16" border="0" class="absmiddle" hspace=2 title="TSref reference"></a>';
+                               } else $TSicon="";
+                               $out="";
+                               $out="<nobr>".$this->pObj->sObj.".";
+                               $out.='<input type="Text" name="data['.$this->pObj->sObj.'][name]"'.$GLOBALS["TBE_TEMPLATE"]->formWidth(20).'>'.$TSicon.' = </nobr><BR>';
+                               $out.='<input type="Text" name="data['.$this->pObj->sObj.'][propertyValue]"'.$GLOBALS["TBE_TEMPLATE"]->formWidth(40).'>';
+                               $out.='<input type="Submit" name="add_property" value="Add">';
+
+
+
+                               $theOutput.=$this->pObj->doc->spacer(20);
+                               $theOutput.=$this->pObj->doc->section("Add object property:",$out,0,0);
+
+                                       // clear
+                               $out="";
+                               $out=$this->pObj->sObj." <b>CLEAR?</b> &nbsp;&nbsp;";
+                               $out.='<input type="Checkbox" name="data['.$this->pObj->sObj.'][clearValue]" value="1">';
+                               $out.='<input type="Submit" name="clear_object" value="Clear">';
+                               $theOutput.=$this->pObj->doc->spacer(20);
+                               $theOutput.=$this->pObj->doc->section("Clear object:",$out,0,0);
+
+                               $theOutput.=$this->pObj->doc->spacer(10);
+                       } else {
+                               $theOutput.=$this->pObj->doc->section("EDIT:",$GLOBALS["TBE_TEMPLATE"]->rfw("You cannot edit properties and values, if there's no current template."),0,0,0,1);
+                       }
+                               // Links:
+                       $out='';
+                       if (!$this->pObj->MOD_SETTINGS['ts_browser_TLKeys_'.$bType][$this->pObj->sObj]) {
+                               if (count($theSetup))   {
+                                       $out = '<a href="index.php?id='.$this->pObj->id.'&addKey['.$this->pObj->sObj.']=1&SET[ts_browser_toplevel_'.$bType.']='.rawurlencode($this->pObj->sObj).'"><b>Add key</b></a> "'.$this->pObj->sObj.'" to Object List (OL)';
+                               }
+                       } else {
+                               $out = '<a href="index.php?id='.$this->pObj->id.'&addKey['.$this->pObj->sObj.']=0&SET[ts_browser_toplevel_'.$bType.']=0"><b>Remove key</b></a> "'.$this->pObj->sObj.'" from Object List (OL)';
+                       }
+                       if ($out)       {
+                               $theOutput.=$this->pObj->doc->divider(5);
+                               $theOutput.=$this->pObj->doc->section("",$out);
+                       }
+
+                               // back
+                       $out = "< Back";
+                       $out = '<a href="index.php?id='.$this->pObj->id.'"><b>'.$out.'</b></a>';
+                       $theOutput.=$this->pObj->doc->divider(5);
+                       $theOutput.=$this->pObj->doc->section("",$out);
+
+               } else {
+                       $tmpl->tsbrowser_depthKeys=$this->pObj->MOD_SETTINGS["tsbrowser_depthKeys_".$bType];
+               //      debug($tmpl->tsbrowser_depthKeys);
+
+                       if (t3lib_div::_POST('search') && t3lib_div::_POST('search_field'))     {               // If any POST-vars are send, update the condition array
+                               $tmpl->tsbrowser_depthKeys = $tmpl->ext_getSearchKeys($theSetup, '', t3lib_div::_POST('search_field'), array());
+               //              debug($tmpl->tsbrowser_depthKeys);
+               //              debug($tmpl->tsbrowser_searchKeys);
+                       }
+
+
+
+                       // Expanding menu
+               /*      if (is_array($theSetup))        {
+                               reset($theSetup);
+                               while(list($tkey,$tval)=each($theSetup))        {
+                                       if (substr($tkey,-1)==".")      {
+                                               $tkey=substr($tkey,0,-1);
+                                       }
+                                       if ($theSetup[$tkey."."] && $tkey!="types" && $tkey!="TSConstantEditor")        {
+                                               $this->pObj->MOD_MENU["ts_browser_toplevel_".$bType][$tkey]=$tkey;
+                                       }
+                               }
+                       }*/
+
+                       $theOutput.=$this->pObj->doc->spacer(5);
+                       $theOutput.=$this->pObj->doc->section('Object tree:','',0,1);
+
+                       $menu = 'Browse: '.t3lib_BEfunc::getFuncMenu($this->pObj->id,'SET[ts_browser_type]',$bType,$this->pObj->MOD_MENU['ts_browser_type']);
+                       $menu.= '&nbsp;&nbsp;OL: '.t3lib_BEfunc::getFuncMenu($this->pObj->id,'SET[ts_browser_toplevel_'.$bType.']',$this->pObj->MOD_SETTINGS['ts_browser_toplevel_'.$bType],$this->pObj->MOD_MENU['ts_browser_toplevel_'.$bType]);
+                       $theOutput.=$this->pObj->doc->section('','<NOBR>'.$menu.'</NOBR>');
+
+
+                       $theKey=$this->pObj->MOD_SETTINGS["ts_browser_toplevel_".$bType];
+                       if (!$theKey || !str_replace("-","",$theKey))   {$theKey="";}
+                       list($theSetup,$theSetupValue) = $tmpl->ext_getSetup($theSetup, ($this->pObj->MOD_SETTINGS['ts_browser_toplevel_'.$bType]?$this->pObj->MOD_SETTINGS['ts_browser_toplevel_'.$bType]:''));
+                       $tree = $tmpl->ext_getObjTree($theSetup, $theKey, "", "", $theSetupValue);
+                       $tree = $tmpl->substituteCMarkers($tree);
+
+
+
+                               // Parser Errors:
+                       $pEkey = ($bType=="setup"?"config":"constants");
+                       if (count($tmpl->parserErrors[$pEkey])) {
+                               reset($tmpl->parserErrors[$pEkey]);
+                               $errMsg=array();
+                               while(list(,$inf)=each($tmpl->parserErrors[$pEkey]))    {
+                                       $errMsg[]=($inf[1]).": &nbsp; &nbsp;".$inf[0];
+                               }
+                               $theOutput.=$this->pObj->doc->spacer(10);
+                               $theOutput.=$this->pObj->doc->section($GLOBALS["TBE_TEMPLATE"]->rfw("Errors and warnings"),implode($errMsg,"<br>"),0,1,0,1);
+                       }
+
+
+
+                       if (isset($this->pObj->MOD_SETTINGS["ts_browser_TLKeys_".$bType][$theKey]))     {
+                               $remove='<td width="1%" nowrap><a href="index.php?id='.$this->pObj->id.'&addKey['.$theKey.']=0&SET[ts_browser_toplevel_'.$bType.']=0"><b>Remove key from OL</b></a></td>';
+                       } else {
+                               $remove='';
+                       }
+                       $label = $theKey ? $theKey : ($bType=="setup"?"SETUP ROOT":"CONSTANTS ROOT");
+                       $theOutput.=$this->pObj->doc->spacer(15);
+                       $theOutput.=$this->pObj->doc->sectionEnd();
+                       $theOutput.='<table border=0 cellpadding=1 cellspacing=0 id="typo3-objectBrowser">
+                                       <tr>
+                                               <td><img src=clear.gif width=4 height=1></td>
+                                               <td class="bgColor2">
+                                                       <table border=0 cellpadding=0 cellspacing=0 class="bgColor5" width="100%"><tr><td nowrap width="99%"><b>'.$label.'</b></td>'.$remove.'</tr></table>
+                                               </td>
+                                       </tr>
+                                       <tr>
+                                               <td><img src=clear.gif width=4 height=1></td>
+                                               <td class="bgColor2">
+                                                       <table border=0 cellpadding=0 cellspacing=0 bgcolor="#D9D5C9" width="100%"><tr><td nowrap>'.$tree.'</td></tr></table><img src=clear.gif width=465 height=1></td>
+                                       </tr>
+                               </table>
+                       ';
+
+
+                               // Conditions:
+                       if (is_array($tmpl->sections))  {
+                               $theOutput.=$this->pObj->doc->divider(15);
+
+                               $out="";
+                               reset($tmpl->sections);
+                               while(list($key,$val)=each($tmpl->sections))    {
+                                       $out.='<tr><td><input type="Checkbox" name="conditions['.$key.']" value="'.htmlspecialchars($val).'"'.($this->pObj->MOD_SETTINGS["tsbrowser_conditions"][$key]?" checked":"").'></td><td nowrap>'.$tmpl->substituteCMarkers(htmlspecialchars($val)).'&nbsp;&nbsp;</td></tr>';
+                               }
+                               $theOutput.='
+                                       <table border=0 cellpadding=1 cellspacing=0>
+                                               <tr>
+                                                       <td><img src=clear.gif width=4 height=1></td>
+                                                       <td class="bgColor2">
+                                                               <table border=0 cellpadding=0 cellspacing=0 bgcolor="#D9D5C9">'.$out.'
+                                                               <tr>
+                                                                       <td>&nbsp;</td>
+                                                                       <td><img src=clear.gif height=10 width=240><BR><input type="Submit" name="Submit" value="Set conditions"><BR></td>
+                                                               </tr>
+                                                               </table>
+                                                       </td>
+                                               </tr>
+                                       </table>
+
+                               ';
+                       }
+
+                               // Search:
+                       $theOutput.='<br>
+
+                               <table border=0 cellpadding=1 cellspacing=0>
+                                       <tr>
+                                               <td><img src=clear.gif width=4 height=1></td>
+                                               <td class="bgColor2">
+                                                       <table border=0 cellpadding=0 cellspacing=0 bgcolor="#D9D5C9">
+                                                       <tr>
+                                                               <td>&nbsp;Enter search phrase:&nbsp;&nbsp;<input type="Text" name="search_field" value="'.htmlspecialchars($POST["search_field"]).'"'.$GLOBALS["TBE_TEMPLATE"]->formWidth(20).'></td>
+                                                               <td><input type="Submit" name="search" value="Search"></td>
+                                                       </tr>
+                                                       <tr>
+                                                               <td>&nbsp;Use ereg(), not stristr():&nbsp;&nbsp;'.t3lib_BEfunc::getFuncCheck($this->pObj->id,"SET[ts_browser_regexsearch]",$this->pObj->MOD_SETTINGS["ts_browser_regexsearch"]).'</td>
+                                                               <td>&nbsp;</td>
+                                                       </tr>
+                                                       </table>
+                                               </td>
+                                       </tr>
+                               </table>
+                       <br>
+                       ';
+
+                               // Menu in the bottom:
+                       $menu= "Crop lines".t3lib_BEfunc::getFuncCheck($this->pObj->id,"SET[ts_browser_fixedLgd]",$this->pObj->MOD_SETTINGS["ts_browser_fixedLgd"]);
+                       #$menu.= "&nbsp;&nbsp;Enable object links".t3lib_BEfunc::getFuncCheck($this->pObj->id,"SET[ts_browser_linkObjects]",$this->pObj->MOD_SETTINGS["ts_browser_linkObjects"]);
+                       if ($bType=="setup" && !$this->pObj->MOD_SETTINGS["ts_browser_fixedLgd"])       {
+                               $menu.= "<BR>Constants display: ".t3lib_BEfunc::getFuncMenu($this->pObj->id,"SET[ts_browser_const]",$this->pObj->MOD_SETTINGS["ts_browser_const"],$this->pObj->MOD_MENU["ts_browser_const"]);
+                       }
+                       $theOutput.=$this->pObj->doc->section("",'<NOBR>'.$menu.'</NOBR>');
+
+                       $theOutput.=$this->pObj->doc->spacer(10);
+                       $theOutput.=$this->pObj->doc->section("Cache",'Click here to <a href="index.php?id='.$this->pObj->id.'&clear_all_cache=1"><strong>clear all cache</strong></a>',0,1);
+
+                               // Ending section:
+                       $theOutput.=$this->pObj->doc->sectionEnd();
+               }
+               return $theOutput;
+       }
+}
+
+if (defined("TYPO3_MODE") && $TYPO3_CONF_VARS[TYPO3_MODE]["XCLASS"]["ext/tstemplate_objbrowser/class.tx_tstemplateobjbrowser.php"])    {
+       include_once($TYPO3_CONF_VARS[TYPO3_MODE]["XCLASS"]["ext/tstemplate_objbrowser/class.tx_tstemplateobjbrowser.php"]);
+}
+
+?>
diff --git a/typo3/sysext/tstemplate_objbrowser/doc/TODO.txt b/typo3/sysext/tstemplate_objbrowser/doc/TODO.txt
new file mode 100644 (file)
index 0000000..5ce971a
--- /dev/null
@@ -0,0 +1,8 @@
+- The mode "UN-substituted constants" will show conditions like this:          [globalVar=LIT:0<##3f523e_B##{$content.RTE_compliant}##3f523e_E##] AND it will not work either according to Christian Jul (Message-ID: <Pine.LNX.4.44L0.0209261144060.12124-100000@ask.diku.dk>) (has been reported for "[globalVar=LIT:0<1]" as well!)
+- BUG: Object Browser cannot use other "OL"'s than the "ALL" (notify Ben when fixed)
+
+Johannes Reichardt:
+- objectlinks on by default.
+- highlighted value in the tree after update (so i know where i have been).
+- more intuitive search function - small hint that its case-sensitive, automatic fold out if found..
+- smart insertion of setup values - right now it just gets all added but never replaced --> big mess.
diff --git a/typo3/sysext/tstemplate_objbrowser/ext_emconf.php b/typo3/sysext/tstemplate_objbrowser/ext_emconf.php
new file mode 100644 (file)
index 0000000..c9c65dd
--- /dev/null
@@ -0,0 +1,42 @@
+<?php
+
+########################################################################
+# Extension Manager/Repository config file for ext: "tstemplate_objbrowser"
+# 
+# Auto generated 07-10-2005 15:56
+# 
+# Manual updates:
+# Only the data in the array - anything else is removed by next write
+########################################################################
+
+$EM_CONF[$_EXTKEY] = Array (
+       'title' => 'Web>Template, Object Browser',
+       'description' => 'The Object Browser writes out the TypoScript configuration in an object tree style.',
+       'category' => 'module',
+       'shy' => 1,
+       'dependencies' => 'tstemplate',
+       'conflicts' => '',
+       'priority' => '',
+       'loadOrder' => '',
+       'TYPO3_version' => '-',
+       'PHP_version' => '-',
+       'module' => '',
+       'state' => 'stable',
+       'internal' => 0,
+       'uploadfolder' => 0,
+       'createDirs' => '',
+       'modify_tables' => '',
+       'clearCacheOnLoad' => 0,
+       'lockType' => '',
+       'author' => 'Kasper Skårhøj',
+       'author_email' => 'kasperYYYY@typo3.com',
+       'author_company' => 'Curby Soft Multimedia',
+       'CGLcompliance' => '',
+       'CGLcompliance_note' => '',
+       'private' => 0,
+       'download_password' => '',
+       'version' => '0.0.4',   // Don't modify this! Managed automatically during upload to repository.
+       '_md5_values_when_last_written' => 'a:4:{s:33:"class.tx_tstemplateobjbrowser.php";s:4:"d831";s:12:"ext_icon.gif";s:4:"4226";s:14:"ext_tables.php";s:4:"7ff6";s:12:"doc/TODO.txt";s:4:"6bb0";}',
+);
+
+?>
\ No newline at end of file
diff --git a/typo3/sysext/tstemplate_objbrowser/ext_icon.gif b/typo3/sysext/tstemplate_objbrowser/ext_icon.gif
new file mode 100644 (file)
index 0000000..08819a7
Binary files /dev/null and b/typo3/sysext/tstemplate_objbrowser/ext_icon.gif differ
diff --git a/typo3/sysext/tstemplate_objbrowser/ext_tables.php b/typo3/sysext/tstemplate_objbrowser/ext_tables.php
new file mode 100644 (file)
index 0000000..5bba420
--- /dev/null
@@ -0,0 +1,12 @@
+<?php
+if (!defined ('TYPO3_MODE'))   die ('Access denied.');
+
+if (TYPO3_MODE=='BE')  {
+       t3lib_extMgm::insertModuleFunction(
+               'web_ts',
+               'tx_tstemplateobjbrowser',
+               t3lib_extMgm::extPath($_EXTKEY).'class.tx_tstemplateobjbrowser.php',
+               'TypoScript Object Browser'
+       );
+}
+?>
\ No newline at end of file