Documentation TYPO3 par Ameos

class.tx_tstemplateobjbrowser.php

00001 <?php
00002 /***************************************************************
00003 *  Copyright notice
00004 *
00005 *  (c) 1999-2004 Kasper Skaarhoj (kasperYYYY@typo3.com)
00006 *  All rights reserved
00007 *
00008 *  This script is part of the TYPO3 project. The TYPO3 project is
00009 *  free software; you can redistribute it and/or modify
00010 *  it under the terms of the GNU General Public License as published by
00011 *  the Free Software Foundation; either version 2 of the License, or
00012 *  (at your option) any later version.
00013 *
00014 *  The GNU General Public License can be found at
00015 *  http://www.gnu.org/copyleft/gpl.html.
00016 *  A copy is found in the textfile GPL.txt and important notices to the license
00017 *  from the author is found in LICENSE.txt distributed with these scripts.
00018 *
00019 *
00020 *  This script is distributed in the hope that it will be useful,
00021 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00022 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00023 *  GNU General Public License for more details.
00024 *
00025 *  This copyright notice MUST APPEAR in all copies of the script!
00026 ***************************************************************/
00031 require_once(PATH_t3lib."class.t3lib_extobjbase.php");
00032 
00033 class tx_tstemplateobjbrowser extends t3lib_extobjbase {
00034         function modMenu()      {
00035                 global $LANG;
00036 
00037                 return Array (
00038                         "ts_browser_type" => array(
00039                                 "setup" => "Setup",
00040                                 "const" => "Constants"
00041                         ),
00042                         "ts_browser_toplevel_setup" => array(
00043                                 "0" => "ALL"
00044                         ),
00045                         "ts_browser_toplevel_const" => array(
00046                                 "0" => "ALL"
00047                         ),
00048                         "ts_browser_const" => array(
00049                                 "0" => "Plain substitution (default)",
00050                                 "subst" => "Substituted constants in green",
00051                                 "const" => "UN-substituted constants in green"
00052                         ),
00053                         "ts_browser_regexsearch" => "",
00054                         "ts_browser_fixedLgd" => "1",
00055                         "ts_browser_linkObjects" => "1",
00056                 );
00057         }
00058         function verify_TSobjects($propertyArray,$parentType,$parentValue)      {
00059                 $TSobjTable = array(
00060                         "PAGE" => array(
00061                                 "prop" => array (
00062                                         "typeNum" => "int",
00063                                         "1,2,3" => "COBJ",
00064                                         "bodyTag" => "string"
00065                                 )
00066                         ),
00067                         "TEXT" => array(
00068                                 "prop" => array (
00069                                         "value" => "string"
00070                                 )
00071                         ),
00072                         "HTML" => array(
00073                                 "prop" => array (
00074                                         "value" => "stdWrap"
00075                                 )
00076                         ),
00077                         "stdWrap" => array(
00078                                 "prop" => array (
00079                                         "field" => "string",
00080                                         "current" => "boolean"
00081                                 )
00082                         ),
00083                 );
00084                 $TSobjDataTypes = array(
00085                         "COBJ" => "TEXT,CONTENT",
00086                         "PAGE" => "PAGE",
00087                         "stdWrap" => ""
00088                 );
00089                 debug($propertyArray);
00090 
00091                 if ($parentType)        {
00092                         if (isset($TSobjDataTypes[$parentType]) && (!$TSobjDataTypes[$parentType] || t3lib_div::inlist($TSobjDataTypes[$parentType],$parentValue)))     {
00093                                 $ObjectKind = $parentValue;
00094                         } else {
00095                                 $ObjectKind = "";       // Object kind is "" if it should be known.
00096                         }
00097                 } else {
00098                         $ObjectKind = $parentValue;     // If parentType is not given, then it can be anything. Free.
00099                 }
00100 
00101                 if ($ObjectKind && is_array($TSobjTable[$ObjectKind]))  {
00102                         $result=array();
00103                         if (is_array($propertyArray))           {
00104                                 reset($propertyArray);
00105                                 while(list($key,$val)=each($propertyArray))     {
00106                                         if (t3lib_div::testInt($key))   {       // If num-arrays
00107                                                 $result[$key]=$TSobjTable[$ObjectKind]["prop"]["1,2,3"];
00108                                         } else {        // standard
00109                                                 $result[$key]=$TSobjTable[$ObjectKind]["prop"][$key];
00110                                         }
00111                                 }
00112                         }
00113                         return $result;
00114                 }
00115         }
00116         function initialize_editor($pageId,$template_uid=0)     {
00117                         // Initializes the module. Done in this function because we may need to re-initialize if data is submitted!
00118                 global $tmpl,$tplRow,$theConstants;
00119 
00120                 $tmpl = t3lib_div::makeInstance("t3lib_tsparser_ext");  // Defined global here!
00121                 $tmpl->tt_track = 0;    // Do not log time-performance information
00122                 $tmpl->init();
00123 
00124                                 // Gets the rootLine
00125                 $sys_page = t3lib_div::makeInstance("t3lib_pageSelect");
00126                 $rootLine = $sys_page->getRootLine($pageId);
00127                 $tmpl->runThroughTemplates($rootLine,$template_uid);    // This generates the constants/config + hierarchy info for the template.
00128 
00129                 $tplRow = $tmpl->ext_getFirstTemplate($pageId,$template_uid);   // Get the row of the first VISIBLE template of the page. whereclause like the frontend.
00130                 if (is_array($tplRow))  {       // IF there was a template...
00131                         return 1;
00132                 }
00133         }
00134         function main() {
00135                 global $SOBE,$BE_USER,$LANG,$BACK_PATH,$TCA_DESCR,$TCA,$CLIENT,$TYPO3_CONF_VARS;
00136                 global $tmpl,$tplRow,$theConstants;
00137 
00138                 $POST = t3lib_div::_POST();
00139 
00140                 // **************************
00141                 // Checking for more than one template an if, set a menu...
00142                 // **************************
00143                 $manyTemplatesMenu = $this->pObj->templateMenu();
00144                 $template_uid = 0;
00145                 if ($manyTemplatesMenu) {
00146                         $template_uid = $this->pObj->MOD_SETTINGS["templatesOnPage"];
00147                 }
00148 
00149 
00150 
00151 
00152 
00153                 // **************************
00154                 // Main
00155                 // **************************
00156 
00157                 // BUGBUG: Should we check if the uset may at all read and write template-records???
00158                 $bType= $this->pObj->MOD_SETTINGS["ts_browser_type"];
00159                 $existTemplate = $this->initialize_editor($this->pObj->id,$template_uid);               // initialize
00160                 if ($existTemplate)     {
00161                         $theOutput.=$this->pObj->doc->divider(5);
00162                         $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);
00163                         if ($manyTemplatesMenu) {
00164                                 $theOutput.=$this->pObj->doc->section("",$manyTemplatesMenu);
00165                                 $theOutput.=$this->pObj->doc->divider(5);
00166                         }
00167 
00168                         if ($POST["add_property"] || $POST["update_value"] || $POST["clear_object"])    {
00169                                         // add property
00170                                 $line="";
00171                 //              debug($POST);
00172                                 if (is_array($POST["data"]))    {
00173                                         if ($POST["add_property"])      {
00174                                                 reset($POST["data"]);
00175                                                 $name = key($POST["data"]);
00176                                                 $property = trim($POST["data"][$name]["name"]);
00177                                                 if (ereg_replace("[^a-zA-Z0-9_\.]*","",$property)!=$property)   {
00178                                                         $theOutput.=$this->pObj->doc->spacer(10);
00179                                                         $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);
00180                                                 } else {
00181                                                         $pline= $name.".".$property." = ".trim($POST["data"][$name]["propertyValue"]);
00182                                                         $theOutput.=$this->pObj->doc->spacer(10);
00183                                                         $theOutput.=$this->pObj->doc->section($GLOBALS["TBE_TEMPLATE"]->rfw("PROPERTY ADDED"),htmlspecialchars($pline),0,0,0,1);
00184                                                         $line.=chr(10).$pline;
00185                                                 }
00186                                         }
00187                                         if ($POST["update_value"])      {
00188                                                 reset($POST["data"]);
00189                                                 $name = key($POST["data"]);
00190                                                 $pline= $name." = ".trim($POST["data"][$name]["value"]);
00191                                                 $theOutput.=$this->pObj->doc->spacer(10);
00192                                                 $theOutput.=$this->pObj->doc->section($GLOBALS["TBE_TEMPLATE"]->rfw("VALUE UPDATED"),htmlspecialchars($pline),0,0,0,1);
00193                                                 $line.=chr(10).$pline;
00194                                         }
00195                                         if ($POST["clear_object"])      {
00196                                                 reset($POST["data"]);
00197                                                 $name = key($POST["data"]);
00198                                                 if ($POST["data"][$name]["clearValue"]) {
00199                                                         $pline= $name." >";
00200                                                         $theOutput.=$this->pObj->doc->spacer(10);
00201                                                         $theOutput.=$this->pObj->doc->section($GLOBALS["TBE_TEMPLATE"]->rfw("Object cleared"),htmlspecialchars($pline),0,0,0,1);
00202                                                         $line.=chr(10).$pline;
00203                                                 }
00204                                         }
00205                                 }
00206                                 if ($line)      {
00207                                         require_once (PATH_t3lib."class.t3lib_tcemain.php");
00208                                                 // Set the data to be saved
00209                                         $recData=array();
00210                                         $field =$bType=="setup"?"config":"constants";
00211                                         $recData["sys_template"][$tplRow[uid]][$field] = $tplRow[$field].$line;
00212                                                 // Create new  tce-object
00213                                         $tce = t3lib_div::makeInstance("t3lib_TCEmain");
00214                                         $tce->stripslashes_values=0;
00215                                                 // Initialize
00216                                         $tce->start($recData,Array());
00217                                                 // Saved the stuff
00218                                         $tce->process_datamap();
00219                                                 // Clear the cache (note: currently only admin-users can clear the cache in tce_main.php)
00220                                         $tce->clear_cacheCmd("all");
00221 
00222                                                 // re-read the template ...
00223                                         $this->initialize_editor($this->pObj->id,$template_uid);
00224                                 }
00225                         }
00226                 }
00227 
00228                 $tsbr = t3lib_div::_GET("tsbr");
00229                 $update=0;
00230                 if (is_array($tsbr))    {               // If any plus-signs were clicked, it's registred.
00231                         $this->pObj->MOD_SETTINGS["tsbrowser_depthKeys_".$bType] = $tmpl->ext_depthKeys($tsbr, $this->pObj->MOD_SETTINGS["tsbrowser_depthKeys_".$bType]);
00232                         $update=1;
00233                 }
00234 
00235                 $addKey = t3lib_div::_GET("addKey");
00236                 if (is_array($addKey))  {               // If any plus-signs were clicked, it's registred.
00237                         reset($addKey);
00238                         if (current($addKey))   {
00239                                 $this->pObj->MOD_SETTINGS["ts_browser_TLKeys_".$bType][key($addKey)] = key($addKey);
00240                         } else {
00241                                 unset($this->pObj->MOD_SETTINGS["ts_browser_TLKeys_".$bType][key($addKey)]);
00242                         }
00243                         $update=1;
00244                 }
00245                 if ($POST["Submit"])    {               // If any POST-vars are send, update the condition array
00246                         $this->pObj->MOD_SETTINGS["tsbrowser_conditions"] = $POST["conditions"];
00247                         $update=1;
00248                 }
00249                 if ($update){   $GLOBALS["BE_USER"]->pushModuleData($this->pObj->MCONF["name"],$this->pObj->MOD_SETTINGS);}
00250 
00251 
00252                 $tmpl->matchAlternative = $this->pObj->MOD_SETTINGS["tsbrowser_conditions"];
00253                 $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.
00254 
00255                 $tmpl->constantMode = $this->pObj->MOD_SETTINGS["ts_browser_fixedLgd"] ? "" : $this->pObj->MOD_SETTINGS["ts_browser_const"];
00256                 if ($this->pObj->sObj && $tmpl->constantMode)   {$tmpl->constantMode = "untouched";}
00257 
00258                 $tmpl->regexMode = $this->pObj->MOD_SETTINGS["ts_browser_regexsearch"];
00259                 $tmpl->fixedLgd=$this->pObj->MOD_SETTINGS["ts_browser_fixedLgd"];
00260 #               $tmpl->linkObjects=$this->pObj->MOD_SETTINGS["ts_browser_linkObjects"];
00261                 $tmpl->linkObjects = TRUE;
00262                 $tmpl->ext_regLinenumbers = TRUE;
00263                 $tmpl->bType=$bType;
00264                 $tmpl->resourceCheck=1;
00265                 $tmpl->uplPath = PATH_site.$tmpl->uplPath;
00266                 $tmpl->removeFromGetFilePath = PATH_site;
00267                 //debug($tmpl->uplPath);
00268 
00269                 if ($this->pObj->MOD_SETTINGS["ts_browser_type"]=="const")      {
00270                         $tmpl->ext_constants_BRP=intval(t3lib_div::_GP("breakPointLN"));
00271                 } else {
00272                         $tmpl->ext_config_BRP=intval(t3lib_div::_GP("breakPointLN"));
00273                 }
00274                 $tmpl->generateConfig();
00275 
00276                 if ($bType=="setup")    {
00277                         $theSetup = $tmpl->setup;
00278                 } else {
00279                         $theSetup = $tmpl->setup_constants;
00280                 }
00281 
00282                         // EDIT A VALUE:
00283                 if ($this->pObj->sObj)  {
00284                         list($theSetup,$theSetupValue) = $tmpl->ext_getSetup($theSetup, ($this->pObj->sObj?$this->pObj->sObj:""));
00285                         $theOutput.=$this->pObj->doc->divider(5);
00286                         if ($existTemplate)     {
00287                                         // Value
00288                                 $out="";
00289                                 $out=$this->pObj->sObj." =<BR>";
00290                                 $out.='<input type="Text" name="data['.$this->pObj->sObj.'][value]" value="'.htmlspecialchars($theSetupValue).'"'.$GLOBALS["TBE_TEMPLATE"]->formWidth(40).'>';
00291                                 $out.='<input type="Submit" name="update_value" value="Update">';
00292                                 $theOutput.=$this->pObj->doc->section("Edit object/property value:",$out,0,0);
00293 
00294                                         // Property
00295                                 if (t3lib_extMgm::isLoaded("tsconfig_help"))    {
00296                                         $url=$BACK_PATH."wizard_tsconfig.php?mode=tsref&onlyProperty=1";
00297                                         $params=array();
00298                                         $params["formName"]="editForm";
00299                                         $params["itemName"]="data[".$this->pObj->sObj."][name]";
00300                                         $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>';
00301                                 } else $TSicon="";
00302                                 $out="";
00303                                 $out="<nobr>".$this->pObj->sObj.".";
00304                                 $out.='<input type="Text" name="data['.$this->pObj->sObj.'][name]"'.$GLOBALS["TBE_TEMPLATE"]->formWidth(20).'>'.$TSicon.' = </nobr><BR>';
00305                                 $out.='<input type="Text" name="data['.$this->pObj->sObj.'][propertyValue]"'.$GLOBALS["TBE_TEMPLATE"]->formWidth(40).'>';
00306                                 $out.='<input type="Submit" name="add_property" value="Add">';
00307 
00308 
00309 
00310                                 $theOutput.=$this->pObj->doc->spacer(20);
00311                                 $theOutput.=$this->pObj->doc->section("Add object property:",$out,0,0);
00312 
00313                                         // clear
00314                                 $out="";
00315                                 $out=$this->pObj->sObj." <b>CLEAR?</b> &nbsp;&nbsp;";
00316                                 $out.='<input type="Checkbox" name="data['.$this->pObj->sObj.'][clearValue]" value="1">';
00317                                 $out.='<input type="Submit" name="clear_object" value="Clear">';
00318                                 $theOutput.=$this->pObj->doc->spacer(20);
00319                                 $theOutput.=$this->pObj->doc->section("Clear object:",$out,0,0);
00320 
00321                                 $theOutput.=$this->pObj->doc->spacer(10);
00322                         } else {
00323                                 $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);
00324                         }
00325                                 // Links:
00326                         $out="";
00327                         if (!$this->pObj->MOD_SETTINGS["ts_browser_TLKeys_".$bType][$this->pObj->sObj]) {
00328                                 if (count($theSetup))   {
00329                                         $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)';
00330                                 }
00331                         } else {
00332                                 $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)';
00333                         }
00334                         if ($out)       {
00335                                 $theOutput.=$this->pObj->doc->divider(5);
00336                                 $theOutput.=$this->pObj->doc->section("",$out);
00337                         }
00338 
00339                                 // back
00340                         $out = "< Back";
00341                         $out = '<a href="index.php?id='.$this->pObj->id.'"><b>'.$out.'</b></a>';
00342                         $theOutput.=$this->pObj->doc->divider(5);
00343                         $theOutput.=$this->pObj->doc->section("",$out);
00344 
00345                 } else {
00346                         $tmpl->tsbrowser_depthKeys=$this->pObj->MOD_SETTINGS["tsbrowser_depthKeys_".$bType];
00347                 //      debug($tmpl->tsbrowser_depthKeys);
00348 
00349                         if ($POST["search"] && $POST["search_field"])   {               // If any POST-vars are send, update the condition array
00350                                 $tmpl->tsbrowser_depthKeys=$tmpl->ext_getSearchKeys($theSetup, "",      $POST["search_field"], array());
00351                 //              debug($tmpl->tsbrowser_depthKeys);
00352                 //              debug($tmpl->tsbrowser_searchKeys);
00353                         }
00354 
00355 
00356 
00357                         // Expanding menu
00358                 /*      if (is_array($theSetup))        {
00359                                 reset($theSetup);
00360                                 while(list($tkey,$tval)=each($theSetup))        {
00361                                         if (substr($tkey,-1)==".")      {
00362                                                 $tkey=substr($tkey,0,-1);
00363                                         }
00364                                         if ($theSetup[$tkey."."] && $tkey!="types" && $tkey!="TSConstantEditor")        {
00365                                                 $this->pObj->MOD_MENU["ts_browser_toplevel_".$bType][$tkey]=$tkey;
00366                                         }
00367                                 }
00368                         }*/
00369                         if (count($this->pObj->MOD_SETTINGS["ts_browser_TLKeys_".$bType]))      {
00370                 //              $this->pObj->MOD_MENU["ts_browser_toplevel_".$bType]["-"]="---";
00371                                 $this->pObj->MOD_MENU["ts_browser_toplevel_".$bType] = $this->pObj->MOD_MENU["ts_browser_toplevel_".$bType] + $this->pObj->MOD_SETTINGS["ts_browser_TLKeys_".$bType];
00372                         }
00373 
00374                 //      debug($this->pObj->MOD_MENU["ts_browser_toplevel"]);
00375 
00376                         $theOutput.=$this->pObj->doc->spacer(5);
00377                         $theOutput.=$this->pObj->doc->section("Object tree:","",0,1);
00378 
00379                         $menu = "Browse: ".t3lib_BEfunc::getFuncMenu($this->pObj->id,"SET[ts_browser_type]",$bType,$this->pObj->MOD_MENU["ts_browser_type"]);
00380                         $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]);
00381                         $theOutput.=$this->pObj->doc->section("",'<NOBR>'.$menu.'</NOBR>');
00382 
00383 
00384                         $theKey=$this->pObj->MOD_SETTINGS["ts_browser_toplevel_".$bType];
00385                         if (!$theKey || !str_replace("-","",$theKey))   {$theKey="";}
00386                         list($theSetup,$theSetupValue) = $tmpl->ext_getSetup($theSetup, ($this->pObj->MOD_SETTINGS["ts_browser_toplevel_".$bType]?$this->pObj->MOD_SETTINGS["ts_browser_toplevel_".$bType]:""));
00387                         $tree = $tmpl->ext_getObjTree($theSetup, $theKey, "", "", $theSetupValue);
00388                         $tree = $tmpl->substituteCMarkers($tree);
00389 
00390 
00391 
00392                                 // Parser Errors:
00393                         $pEkey = ($bType=="setup"?"config":"constants");
00394                         if (count($tmpl->parserErrors[$pEkey])) {
00395                                 reset($tmpl->parserErrors[$pEkey]);
00396                                 $errMsg=array();
00397                                 while(list(,$inf)=each($tmpl->parserErrors[$pEkey]))    {
00398                                         $errMsg[]=($inf[1]).": &nbsp; &nbsp;".$inf[0];
00399                                 }
00400                                 $theOutput.=$this->pObj->doc->spacer(10);
00401                                 $theOutput.=$this->pObj->doc->section($GLOBALS["TBE_TEMPLATE"]->rfw("Errors and warnings"),implode($errMsg,"<br>"),0,1,0,1);
00402                         }
00403 
00404 
00405 
00406                         if (isset($this->pObj->MOD_SETTINGS["ts_browser_TLKeys_".$bType][$theKey]))     {
00407                                 $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>';
00408                         } else {
00409                                 $remove="";
00410                         }
00411                         $label = $theKey ? $theKey : ($bType=="setup"?"SETUP ROOT":"CONSTANTS ROOT");
00412                         $theOutput.=$this->pObj->doc->spacer(15);
00413                         $theOutput.=$this->pObj->doc->sectionEnd();
00414                         $theOutput.='<table border=0 cellpadding=1 cellspacing=0 id="typo3-objectBrowser">';
00415                         $theOutput.='<tr>
00416                                                 <td><img src=clear.gif width=4 height=1></td>
00417                                                 <td class="bgColor2">
00418                                                         <table border=0 cellpadding=0 cellspacing=0 class="bgColor5" width="100%"><tr><td nowrap width="99%"><b>'.$label.'</b></td>'.$remove.'</tr></table>
00419                                                 </td>
00420                                         </tr>';
00421                         $theOutput.='<tr>
00422                                                 <td><img src=clear.gif width=4 height=1></td>
00423                                                 <td class="bgColor2">
00424                                                         <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>
00425                                         </tr>
00426                                 </table>
00427                         ';
00428 
00429 
00430                                 // Conditions:
00431                         if (is_array($tmpl->sections))  {
00432                                 $theOutput.=$this->pObj->doc->divider(15);
00433 
00434                                 $out="";
00435                                 reset($tmpl->sections);
00436                                 while(list($key,$val)=each($tmpl->sections))    {
00437                                         $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>';
00438                                 }
00439                                 $theOutput.='
00440                                         <table border=0 cellpadding=1 cellspacing=0>
00441                                                 <tr>
00442                                                         <td><img src=clear.gif width=4 height=1></td>
00443                                                         <td class="bgColor2">
00444                                                                 <table border=0 cellpadding=0 cellspacing=0 bgcolor="#D9D5C9">'.$out.'
00445                                                                 <tr>
00446                                                                         <td>&nbsp;</td>
00447                                                                         <td><img src=clear.gif height=10 width=240><BR><input type="Submit" name="Submit" value="Set conditions"><BR></td>
00448                                                                 </tr>
00449                                                                 </table>
00450                                                         </td>
00451                                                 </tr>
00452                                         </table>
00453 
00454                                 ';
00455                         }
00456 
00457                                 // Search:
00458                         $theOutput.='<br>
00459 
00460                                 <table border=0 cellpadding=1 cellspacing=0>
00461                                         <tr>
00462                                                 <td><img src=clear.gif width=4 height=1></td>
00463                                                 <td class="bgColor2">
00464                                                         <table border=0 cellpadding=0 cellspacing=0 bgcolor="#D9D5C9">
00465                                                         <tr>
00466                                                                 <td>&nbsp;Enter search phrase:&nbsp;&nbsp;<input type="Text" name="search_field" value="'.htmlspecialchars($POST["search_field"]).'"'.$GLOBALS["TBE_TEMPLATE"]->formWidth(20).'></td>
00467                                                                 <td><input type="Submit" name="search" value="Search"></td>
00468                                                         </tr>
00469                                                         <tr>
00470                                                                 <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>
00471                                                                 <td>&nbsp;</td>
00472                                                         </tr>
00473                                                         </table>
00474                                                 </td>
00475                                         </tr>
00476                                 </table>
00477                         <br>
00478                         ';
00479 
00480                                 // Menu in the bottom:
00481                         $menu= "Crop lines".t3lib_BEfunc::getFuncCheck($this->pObj->id,"SET[ts_browser_fixedLgd]",$this->pObj->MOD_SETTINGS["ts_browser_fixedLgd"]);
00482                         #$menu.= "&nbsp;&nbsp;Enable object links".t3lib_BEfunc::getFuncCheck($this->pObj->id,"SET[ts_browser_linkObjects]",$this->pObj->MOD_SETTINGS["ts_browser_linkObjects"]);
00483                         if ($bType=="setup" && !$this->pObj->MOD_SETTINGS["ts_browser_fixedLgd"])       {
00484                                 $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"]);
00485                         }
00486                         $theOutput.=$this->pObj->doc->section("",'<NOBR>'.$menu.'</NOBR>');
00487 
00488                         $theOutput.=$this->pObj->doc->spacer(10);
00489                         $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);
00490 
00491                                 // Ending section:
00492                         $theOutput.=$this->pObj->doc->sectionEnd();
00493                 }
00494                 return $theOutput;
00495         }
00496 }
00497 
00498 if (defined("TYPO3_MODE") && $TYPO3_CONF_VARS[TYPO3_MODE]["XCLASS"]["ext/tstemplate_objbrowser/class.tx_tstemplateobjbrowser.php"])     {
00499         include_once($TYPO3_CONF_VARS[TYPO3_MODE]["XCLASS"]["ext/tstemplate_objbrowser/class.tx_tstemplateobjbrowser.php"]);
00500 }
00501 
00502 ?>


Généré par TYPO3 Ameos avec  doxygen 1.4.6