[ Index ]

PHP Cross Reference of phpwcms V1.4.7 _r403 (01.11.10)

title

Body

[close]

/include/inc_tmpl/ -> admin.templates.tmpl.php (source)

   1  <?php
   2  /*************************************************************************************
   3     Copyright notice
   4     
   5     (c) 2002-2010 Oliver Georgi (oliver@phpwcms.de) // All rights reserved.
   6   
   7     This script is part of PHPWCMS. The PHPWCMS web content management system is
   8     free software; you can redistribute it and/or modify it under the terms of
   9     the GNU General Public License as published by the Free Software Foundation;
  10     either version 2 of the License, or (at your option) any later version.
  11    
  12     The GNU General Public License can be found at http://www.gnu.org/copyleft/gpl.html
  13     A copy is found in the textfile GPL.txt and important notices to the license 
  14     from the author is found in LICENSE.txt distributed with these scripts.
  15    
  16     This script is distributed in the hope that it will be useful, but WITHOUT ANY 
  17     WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
  18     PARTICULAR PURPOSE.  See the GNU General Public License for more details.
  19   
  20     This copyright notice MUST APPEAR in all copies of the script!
  21  *************************************************************************************/
  22  
  23  // ----------------------------------------------------------------
  24  // obligate check for phpwcms constants
  25  if (!defined('PHPWCMS_ROOT')) {
  26     die("You Cannot Access This Script Directly, Have a Nice Day.");
  27  }
  28  // ----------------------------------------------------------------
  29  
  30  reset($phpwcms['js_lib']);    // reset $phpwcms['js_lib'] to get first element as default
  31  
  32  $template = array(    "name" => '', "default" => 0, "layout" => '', "css" => array(), "htmlhead" => '',
  33                      "jsonload" => '', "headertext" => '', "maintext" => '', "footertext" => '', 
  34                      "lefttext" => '', "righttext" => '', "errortext" => '', 'feloginurl' => '',
  35                      'jslib'    => key($phpwcms['js_lib']), 'jslibload' => 0, 'frontendjs' => 0, 'googleapi' => 1 );
  36  
  37  if(!isset($_GET["s"])) { 
  38  // check if template should be edited
  39  ?>
  40  <table width="538" border="0" cellpadding="0" cellspacing="0" summary="">
  41      <tr><td colspan="3" class="title"><?php echo $BL['be_admin_tmpl_title'] ?></td></tr>
  42      <tr><td colspan="3"><img src="img/leer.gif" alt="" width="1" height="6" /></td>
  43      </tr>
  44      <tr><td colspan="3" bgcolor="#92A1AF"><img src="img/leer.gif" alt="" width="1" height="1" /></td>
  45      </tr>
  46  <?php
  47  // loop listing available templates 
  48  $sql = "SELECT * FROM ".DB_PREPEND."phpwcms_template WHERE template_trash=0 ORDER BY template_default DESC, template_name"; //AND template_type=0 
  49  if($result = mysql_query($sql, $db) or die("error while listing templates")) {
  50      $row_count = 0;
  51      while($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
  52      
  53          $edit_link = 'do=admin&amp;p=11&amp;s='.$row["template_id"].'&amp;t='.$row["template_type"];
  54      
  55          echo "<tr".( ($row_count % 2) ? " bgcolor=\"#F3F5F8\"" : "" ).">\n<td width=\"28\">"; //#F9FAFB
  56          echo '<img src="img/symbole/template_list_icon.gif" width="28" height="18"></td>'."\n";
  57          echo '<td width="470" class="dir"><a href="phpwcms.php?'.$edit_link;
  58          echo '"><strong>'.html_specialchars($row["template_name"])."</strong>";
  59          echo ($row["template_default"]) ? " (".$BL['be_admin_tmpl_default'].")" : "";
  60          echo "</a></td>\n".'<td width="60" align="right">';
  61          echo '<a href="phpwcms.php?'.$edit_link;
  62          echo '"><img src="img/button/edit_22x11.gif" width="22" height="11" border="0"></a>';
  63          echo '<img src="img/leer.gif" width="2" height="1">';
  64  
  65                 // ERICH COPY TEMPLATE 7.6.2005
  66          echo '<a href="phpwcms.php?'.$edit_link.'&amp;c=1'; // c=1 -> do copy
  67          echo '" title="copy template"><img src="img/button/copy_11x11_0.gif" width="11" height="11" border="0"></a>';
  68          echo '<img src="img/leer.gif" width="2" height="1">';
  69                  // ERICH COPY TEMPLATE END 7.6.2005
  70  
  71          echo '<a href="include/inc_act/act_frontendsetup.php?do=2|'.$row["template_id"].'" ';
  72          echo 'title="delete template: '.html_specialchars($row["template_name"]).'">';
  73          echo '<img src="img/button/del_11x11.gif" width="11" height="11" border="0"></a>';
  74          echo '<img src="img/leer.gif" width="2" height="1">'."</td>\n</tr>\n";
  75          $row_count++;
  76      }
  77      mysql_free_result($result);
  78  } // end listing
  79          
  80  ?>
  81      <tr><td colspan="3" bgcolor="#92A1AF"><img src="img/leer.gif" alt="" width="1" height="1" /></td>
  82      </tr>
  83      <tr><td colspan="3"><img src="img/leer.gif" alt="" width="1" height="8" /></td>
  84      </tr>
  85      <tr><td colspan="3"><form action="phpwcms.php?do=admin&amp;p=11&amp;s=0" method="post">
  86        <input type="submit" value="<?php echo $BL['be_admin_tmpl_add'] ?>" class="button10" title="<?php echo $BL['be_admin_tmpl_add'] ?>" />
  87      </form></td>
  88      </tr>
  89  </table>
  90  <?php
  91  
  92  } else {
  93  
  94  // should the edit template dialog
  95      $template["id"] = intval($_GET["s"]);
  96  
  97      $createcopy = isset($_GET["c"]) ? intval($_GET["c"]) : 0;
  98      
  99      if(isset($_POST["template_id"])) {
 100          
 101          
 102          $createcopy = empty($_POST["c"]) ? 0 : intval($_POST["c"]); // ERICH COPY TEMPLATE 08.06.2005
 103          
 104          // read the create or edit template form data
 105          $template["id"]            = intval($_POST["template_id"]);
 106          $template["default"]    = empty($_POST["template_setdefault"]) ? 0 : 1;
 107          $template["layout"]        = intval($_POST["template_layout"]);
 108          $template["name"]        = clean_slweg($_POST["template_name"], 150);
 109          if(empty($template["name"])) {
 110              $template["name"] = "template_".randpassword(3);
 111          }
 112          if(is_array($_POST["template_css"])) {
 113              $template["css"] = $_POST["template_css"];
 114          } else {
 115              $template["css"] = array();
 116          }
 117          $template["htmlhead"]    = slweg($_POST["template_htmlhead"]);
 118          $template["jsonload"]    = slweg($_POST["template_jsonload"]);        
 119          $template["headertext"]    = slweg($_POST["template_block_header"]);
 120          $template["maintext"]    = slweg($_POST["template_block_main"]);
 121          $template["footertext"]    = slweg($_POST["template_block_footer"]);
 122          $template["lefttext"]    = slweg($_POST["template_block_left"]);
 123          $template["righttext"]    = slweg($_POST["template_block_right"]);
 124          $template["errortext"]    = slweg($_POST["template_block_error"]);
 125          $template["feloginurl"]    = slweg($_POST["template_felogin_url"]);
 126          $template["overwrite"]    = clean_slweg($_POST["template_overwrite"]);
 127          $template['jslib']        = clean_slweg($_POST["template_jslib"]);
 128          $template['jslibload']    = empty($_POST["template_jslibload"]) ? 0 : 1;
 129          $template['frontendjs']    = empty($_POST["template_frontendjs"]) ? 0 : 1;
 130          $template['googleapi']    = empty($_POST["template_googleapi"]) ? 0 : 1;
 131          
 132          // now browse custom blocks if available
 133          if(!empty($_POST['customblock'])) {
 134          
 135              $template['customblock'] = clean_slweg($_POST["customblock"]);
 136              $temp_customblock = explode(',', $template['customblock']);
 137              foreach($temp_customblock as $value) {
 138              
 139                  $template['customblock_'.$value] = slweg($_POST['template_customblock_'.$value]);
 140      
 141              }
 142          }
 143  
 144          if($template["id"] && empty($createcopy)) {
 145          // if ID <> 0 then get template info from database
 146              $sql =  "UPDATE ".DB_PREPEND."phpwcms_template SET ".
 147                      "template_name='".aporeplace($template["name"])."', ".
 148                      "template_default=".$template["default"].", ".
 149                      "template_var='".aporeplace(serialize($template))."' ".
 150                      "WHERE template_id=".$template["id"];    
 151          } else {
 152          // if ID = 0 then show create new template form
 153              $sql =  "INSERT INTO ".DB_PREPEND."phpwcms_template (".
 154                      "template_name, template_default, template_var) VALUES ('".
 155                      aporeplace($template["name"])."', ".$template["default"].", '".
 156                      aporeplace(serialize($template))."')";
 157          }
 158          // update or insert data entry
 159          @mysql_query($sql, $db) or die("error while updating or inserting template datas");
 160  
 161          if(empty($template["id"]) || $createcopy == 1) {
 162              $template["id"] = mysql_insert_id($db);
 163          }
 164  
 165          //now proof for default template definition
 166          if($template["default"]) {
 167              mysql_query("UPDATE ".DB_PREPEND."phpwcms_template SET template_default=0 ".
 168                          "WHERE template_id != ".$template["id"], $db);
 169          }
 170          update_cache();
 171          headerRedirect(PHPWCMS_URL."phpwcms.php?do=admin&p=11&s=".$template["id"]);
 172      }
 173  
 174      if($template["id"]) {
 175      // read the given template datas from db
 176          $sql = "SELECT * FROM ".DB_PREPEND."phpwcms_template WHERE template_id=".$template["id"]." LIMIT 1";
 177          if($result = mysql_query($sql, $db)) {
 178              if($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
 179                  unset($template);
 180                  $template = unserialize($row["template_var"]);
 181                  $template["id"] = $row["template_id"];
 182                  $template["default"] = $row["template_default"];
 183                  // compatibility for older releases where only 
 184                  // 1 css file could be stored per template
 185                  if(is_string($template['css'])) {
 186                      $template['css'] = array($template['css']);
 187                  }
 188                  if(empty($template['jslib'])) {
 189                      $template['jslib'] = key($phpwcms['js_lib']);
 190                  }
 191                  if(empty($template['jslibload'])) {
 192                      $template['jslibload'] = 0;
 193                  }
 194                  if(empty($template['frontendjs'])) {
 195                      $template['frontendjs'] = 0;
 196                  }
 197                  if(!isset($template['googleapi'])) {
 198                      $template['googleapi'] = 1;
 199                  } elseif(empty($template['googleapi'])) {
 200                      $template['googleapi'] = 0;
 201                  }
 202                  
 203              }
 204              mysql_free_result($result);
 205          }
 206      }
 207  
 208      // show form
 209  ?><script language="JavaScript" type="text/javascript">
 210  <!--
 211  function doPageLayoutChange() {
 212      var returnValue = confirm('<?php echo $BL['be_admin_template_jswarning'] ?>');
 213      if(returnValue) {
 214          document.blocks.submit();
 215          return true;
 216      } else {
 217          return false;
 218      }
 219  }
 220  //-->
 221  </script><form action="phpwcms.php?do=admin&amp;p=11&amp;s=<?php echo $template["id"] ?>" method="post" name="blocks" target="_self" id="blocks">
 222    <table width="100%" border="0" cellpadding="0" cellspacing="0" summary="">
 223      
 224      <tr><td colspan="2" class="title"><?php echo (empty($createcopy) ? $BL['be_admin_tmpl_edit'] : $BL['be_admin_tmpl_copy']) ?>: <?php echo ($template["id"]) ? html_specialchars($template["name"]) : $BL['be_admin_tmpl_new']; ?>
 225          <input type="hidden" name="c" value="<?php echo $createcopy; ?>" /></td></tr>
 226      <tr><td colspan="2"><img src="img/lines/l538_70.gif" alt="" width="538" height="1" /></td>
 227      </tr>
 228      <tr bgcolor="#E6EAED"><td colspan="2"><img src="img/leer.gif" alt="" width="1" height="8" /></td>
 229      </tr>
 230      <tr bgcolor="#E6EAED">
 231          <td align="right" class="chatlist"><?php echo $BL['be_admin_tmpl_name'] ?>:&nbsp;</td>
 232          <td><table border="0" cellpadding="0" cellspacing="0" summary="">
 233            <tr>
 234              <td><?php
 235  // ERICH COPY TEMPLATE 08.06.2005
 236  if(empty($createcopy)) {
 237      echo '<input name="template_name" type="text" class="f11b width350" id="template_name" value="'.html_specialchars($template["name"]).'" size="50" maxlength="150">';
 238  } else {    
 239      echo '<img src="img/symbole/achtung.gif" width="13" height="11" alt="" border="0" style="margin-right:2px;" /><input name="template_name" type="text" class="f11b width350" id="template_name" style="color:FF3300" value="'.html_specialchars($template["name"]).'_'.randpassword(2).'" size="50" maxlength="150">';
 240  }
 241  ?></td>
 242              <td>&nbsp;</td>
 243              <td><input name="template_setdefault" id="template_setdefault" type="checkbox" value="1" <?php is_checked(empty($createcopy) ? $template["default"] : 0, 1) ?> /></td>
 244              <td class="v10"><label for="template_setdefault"><?php echo $BL['be_admin_tmpl_default'] ?></label></td>
 245            </tr>
 246            </table></td>
 247      </tr>
 248      <tr bgcolor="#E6EAED"><td colspan="2"><img src="img/leer.gif" alt="" width="1" height="3" /></td></tr>
 249      <tr bgcolor="#E6EAED">
 250          <td align="right" class="chatlist"><?php echo $BL['be_admin_tmpl_layout'] ?>:&nbsp;</td>
 251          <td><?php
 252  // get available page layout list
 253  $jsOnChange = '';
 254  $opt = "";
 255  $sql = "SELECT * FROM ".DB_PREPEND."phpwcms_pagelayout ".
 256         "WHERE pagelayout_trash=0 ORDER BY pagelayout_default DESC";
 257  if($result = mysql_query($sql, $db) or die("error while listing pagelayouts")) {
 258      while($row = mysql_fetch_assoc($result)) {
 259          $opt .= '<option value="'.$row['pagelayout_id'].'"';
 260          if($row['pagelayout_id'] == $template["layout"]) {
 261              $opt .= ' selected';
 262              // try to get additional custom blocks from selected page layout
 263              $custom_blocks = unserialize($row['pagelayout_var']);
 264              $custom_blocks = explode(', ', trim($custom_blocks['layout_customblocks']));
 265  
 266              if(is_array($custom_blocks) && count($custom_blocks) && $custom_blocks[0] != '') {
 267                  $jsOnChange = ' onChange="doPageLayoutChange();"';
 268              } else {
 269                  $jsOnChange = '';
 270              }
 271          }
 272          $opt .= '>'.html_specialchars($row['pagelayout_name']).'</option>'."\n";    
 273      }
 274      mysql_free_result($result);
 275  }
 276  
 277  if($opt) {
 278      echo '<select name="template_layout" class="f11b width350" id="template_layout"'.$jsOnChange.'>'.LF;
 279      echo $opt;
 280      echo '</select>';
 281  } else {
 282      echo $BL['be_admin_tmpl_nolayout'].' (<a href="phpwcms.php?do=admin&p=8&s=0">'.$BL['be_admin_page_add'].'</a>)';
 283  }
 284  
 285  ?></td>
 286      </tr>
 287  
 288      
 289      <tr bgcolor="#E6EAED"><td colspan="2" class="rowspacer7x7"><img src="img/leer.gif" alt="" width="1" height="1" /></td></tr>
 290  
 291      <tr bgcolor="#E6EAED">
 292          <td>&nbsp;</td>
 293          <td class="chatlist tdbottom3"><?php echo $BL['be_overwrite_default'] ?>
 294          <br  /><strong>config/phpwcms/conf.template_default.inc.php</strong></td>    
 295      </tr>
 296  
 297  
 298      <tr bgcolor="#E6EAED">
 299          <td align="right" class="chatlist" style="padding-left:2px"><?php echo $BL['be_settings'] ?>:&nbsp;</td>
 300          <td><select name="template_overwrite" id="template_overwrite" class="f11b">
 301              <option value="" style="font-weight:normal;font-style:italic;"><?php echo $BL['be_admin_tmpl_default']; ?></option>
 302  <?php
 303      
 304  // templates for frontend login
 305  $tmpllist = get_tmpl_files(PHPWCMS_TEMPLATE.'inc_settings/template_default', 'php');
 306  if(is_array($tmpllist) && count($tmpllist)) {
 307      foreach($tmpllist as $val) {
 308          $selected_val = (isset($template["overwrite"]) && $val == $template["overwrite"]) ? ' selected="selected"' : '';
 309          $val = html_specialchars($val);
 310          echo '    <option value="' . $val . '"' . $selected_val . '>' . $val . '</option>' . LF;
 311      }
 312  }
 313  
 314  ?>                  
 315          </select></td>
 316      </tr>
 317  
 318  
 319      <tr bgcolor="#E6EAED"><td colspan="2"><img src="img/leer.gif" alt="" width="1" height="8" /></td></tr>
 320      <tr><td colspan="2"><img src="img/lines/l538_70.gif" alt="" width="538" height="1" /></td></tr>
 321      <tr bgcolor="#F3F5F8"><td colspan="2"><img src="img/leer.gif" alt="" width="1" height="8" /></td></tr>
 322      
 323      
 324      <tr bgcolor="#F3F5F8">
 325          <td align="right" class="chatlist" valign="top"><?php echo $BL['be_admin_tmpl_css'] ?>:<img src="img/leer.gif" alt="" width="4" height="14" /></td>
 326          <td><table border="0" cellpadding="0" cellspacing="0" summary="">
 327              <tr>
 328              <td valign="top"><select name="template_css[]" size="6" multiple="multiple" class="code" id="template_css">
 329  <?php
 330  
 331  $unselected_css = array();
 332  
 333  // get css file list
 334  if(is_dir(PHPWCMS_TEMPLATE."inc_css")) {
 335      
 336      $css_handle         = opendir(PHPWCMS_TEMPLATE."inc_css" );
 337  
 338      // browse template CSS diretory and list all available CSS files
 339      while($css_file = readdir( $css_handle )) {
 340           
 341          if( $css_file != "." && $css_file != ".." && preg_match('/^[a-z0-9\. \-_]+\.css$/i', $css_file) ) {
 342  
 343              $unselected_css[$css_file] = $css_file;
 344                  
 345          }
 346      }
 347      closedir( $css_handle );
 348  }
 349  
 350  // now run the css information
 351  foreach($template["css"] as $value) {
 352      if(isset($unselected_css[$value])) {
 353          $css_file = html_entities($value);
 354          echo '        <option value="'.$css_file.'" selected="selected" style="font-weight: bold;">'.$css_file.'&nbsp;&nbsp;</option>'.LF;
 355          unset($unselected_css[$value]);
 356      }
 357  }
 358  foreach($unselected_css as $value) {
 359      $css_file = html_entities($value);
 360      echo '        <option value="'.$css_file.'">'.$css_file.'&nbsp;&nbsp;</option>'.LF;
 361  }
 362  
 363  ?>
 364              </select></td>
 365            
 366            <td valign="top" align="center">
 367          <img src="img/button/list_pos_up.gif" alt="" width="15" height="15" border="0" onclick="moveOptionUp(document.blocks.template_css);" /><br />
 368          <img src="img/leer.gif" width="23" height="3" alt="" /><br />
 369          <img src="img/button/list_pos_down.gif" alt="" width="15" height="15" border="0" onclick="moveOptionDown(document.blocks.template_css);" /></td>
 370            <td valign="top">&nbsp;</td>
 371            
 372            </tr>
 373            </table></td>
 374      </tr>
 375  
 376      <tr bgcolor="#F3F5F8"><td colspan="2"><img src="img/leer.gif" alt="" width="1" height="4" /></td></tr>
 377      
 378      <tr bgcolor="#F3F5F8">
 379          <td align="right" valign="top" class="chatlist tdtop4"><?php echo $BL['be_admin_tmpl_head'] ?>:&nbsp;<br />&lt;head&gt; &nbsp;</td>
 380          <td><textarea name="template_htmlhead" cols="35" rows="5" class="code width440" id="template_htmlhead"><?php echo html_entities($template["htmlhead"]); ?></textarea></td>
 381      </tr>
 382      <tr bgcolor="#F3F5F8"><td colspan="2"><img src="img/leer.gif" alt="" width="1" height="3" /></td></tr>
 383      
 384      
 385      <tr bgcolor="#F3F5F8">
 386        <td align="right" class="chatlist"><?php echo $BL['js_lib'] ?>:&nbsp;</td>
 387        <td><table cellpadding="0" cellspacing="0" border="0" summary="">
 388        
 389            <tr>
 390                <td><select name="template_jslib" id="template_jslib" class="f11b">
 391  <?php
 392  foreach($phpwcms['js_lib'] as $key => $value) {
 393      
 394      echo '        <option value="' . $key . '"';
 395      is_selected($template['jslib'], $key);
 396      echo '>' . html_specialchars($value) . '</option>' . LF;
 397  
 398  }
 399  ?>
 400              </select></td>
 401              <td>&nbsp;</td>
 402              <td><input type="checkbox" name="template_jslibload" id="template_jslibload" value="1"<?php is_checked($template['jslibload'], 1); ?> /></td>
 403              <td class="v10"><label for="template_jslibload"><?php echo $BL['js_lib_alwaysload'] ?></label></td>
 404              <td>&nbsp;&nbsp;</td>
 405              <td><input type="checkbox" name="template_googleapi" id="template_googleapi" value="1"<?php is_checked($template['googleapi'], 1); ?> /></td>
 406              <td class="v10"><label for="template_googleapi"><?php echo $BL['googleapi_load'] ?></label></td>
 407          </tr>
 408      </table></td>
 409      </tr>
 410      
 411      <tr bgcolor="#F3F5F8"><td colspan="2"><img src="img/leer.gif" alt="" width="1" height="3" /></td></tr>
 412      
 413      <tr bgcolor="#F3F5F8">
 414        <td align="right" class="chatlist">&nbsp;</td>
 415        <td><table cellpadding="0" cellspacing="0" border="0" summary="">
 416        
 417            <tr>
 418              <td><input type="checkbox" name="template_frontendjs" id="template_frontendjs" value="1"<?php is_checked($template['frontendjs'], 1); ?> /></td>
 419              <td class="v10"><label for="template_frontendjs"><?php echo $BL['frontendjs_load'] ?></label></td>
 420          </tr>
 421      </table></td>
 422      </tr>    
 423      
 424      
 425      <tr bgcolor="#F3F5F8"><td colspan="2"><img src="img/leer.gif" alt="" width="1" height="3" /></td></tr>
 426      
 427      <tr bgcolor="#F3F5F8">
 428        <td align="right" class="chatlist"><?php echo $BL['be_admin_tmpl_js'] ?>:&nbsp;</td>
 429        <td><input name="template_jsonload" type="text" class="code width440" id="template_jsonload" value="<?php echo html_entities($template["jsonload"]) ?>" size="50" /></td>
 430      </tr>
 431      
 432      
 433      <tr bgcolor="#F3F5F8"><td colspan="2"><img src="img/leer.gif" alt="" width="1" height="3" /></td></tr>
 434      
 435      
 436      <tr bgcolor="#F3F5F8">
 437        <td align="right" class="chatlist" nowrap="nowrap">&nbsp;<?php echo $BL['be_fe_login_url'] ?>:&nbsp;</td>
 438        <td><input name="template_felogin_url" type="text" class="code width440" id="template_felogin_url" value="<?php echo empty($template["feloginurl"]) ? '' : html_entities($template["feloginurl"]) ?>" size="50" /></td>
 439      </tr>
 440      <tr bgcolor="#F3F5F8"><td colspan="2"><img src="img/leer.gif" alt="" width="1" height="8" /></td>
 441      </tr>
 442      <tr><td colspan="2"><img src="img/lines/l538_70.gif" alt="" width="538" height="1" /></td></tr>
 443      
 444      <tr>
 445          <td>&nbsp;</td>
 446          <td style="padding:7px 0 7px 0">
 447              <input name="Submit" type="submit" class="button10" value="<?php echo $BL['be_admin_tmpl_button'] ?>" />
 448              &nbsp;&nbsp;
 449              <input type="button" class="button10" value="<?php echo $BL['be_admin_struct_close'] ?>" onclick="location.href='phpwcms.php?do=admin&amp;p=11';" />
 450          </td>
 451      </tr>
 452      <tr><td colspan="2"><img src="img/lines/l538_70.gif" alt="" width="538" height="1" /></td>
 453      </tr>
 454      <tr><td colspan="2"><img src="img/leer.gif" alt="" width="1" height="10" /></td>
 455      </tr>
 456      <tr>
 457          <td align="right" valign="top" class="chatlist tdtop4"><?php echo $BL['be_admin_page_header'] ?>:&nbsp;</td>
 458          <td><textarea name="template_block_header" cols="35" rows="8" class="code width440" id="template_block_header"><?php echo html_entities($template["headertext"]); ?></textarea></td>
 459      </tr>
 460      <tr><td colspan="2"><img src="img/leer.gif" alt="" width="1" height="3" /></td>
 461      </tr>
 462      <tr>
 463          <td align="right" valign="top" class="chatlist tdtop4"><?php echo $BL['be_admin_page_main'] ?>:&nbsp;</td>
 464          <td><textarea name="template_block_main" cols="35" rows="20" class="code width440" id="template_block_main"><?php echo html_entities($template["maintext"]); ?></textarea></td>
 465      </tr>
 466      <tr><td colspan="2"><img src="img/leer.gif" alt="" width="1" height="3" /></td>
 467      </tr>
 468      <tr>
 469          <td align="right" valign="top" class="chatlist tdtop4"><?php echo $BL['be_admin_page_footer'] ?>:&nbsp;</td>
 470          <td><textarea name="template_block_footer" cols="35" rows="8" class="code width440" id="template_block_footer"><?php echo html_entities($template["footertext"]); ?></textarea></td>
 471      </tr>
 472      <tr><td colspan="2"><img src="img/leer.gif" alt="" width="1" height="3" /></td>
 473      </tr>
 474      <tr>
 475          <td align="right" valign="top" class="chatlist tdtop4"><?php echo $BL['be_admin_page_left'] ?>:&nbsp;</td>
 476          <td><textarea name="template_block_left" cols="35" rows="8" class="code" id="template_block_left" style="width:440px"><?php echo html_entities($template["lefttext"]); ?></textarea></td>
 477      </tr>
 478      <tr><td colspan="2"><img src="img/leer.gif" alt="" width="1" height="3" /></td>
 479      </tr>
 480      <tr>
 481          <td align="right" valign="top" class="chatlist tdtop4"><?php echo $BL['be_admin_page_right'] ?>:&nbsp;</td>
 482          <td><textarea name="template_block_right" cols="35" rows="8" class="code width440" id="template_block_right"><?php echo html_entities($template["righttext"]); ?></textarea></td>
 483      </tr>
 484      <tr><td colspan="2"><img src="img/leer.gif" alt="" width="1" height="3" /></td>
 485      </tr>
 486      
 487  <?php    
 488  if(!empty($jsOnChange))  {
 489  
 490      echo '<tr><td colspan="2"><img src="img/leer.gif" width="1" height="5" alt="" /></td></tr>';
 491      echo '<tr><td colspan="2"><img src="img/lines/l538_70.gif" width="538" height="1" alt="" /></td></tr>';    
 492      echo '<tr bgcolor="#F3F5F8"><td colspan="2"><img src="img/leer.gif" width="1" height="8" alt="" />';
 493      echo '<input type="hidden" name="customblock" value="'.html_specialchars(implode(',', $custom_blocks)).'" />';
 494      echo "</td></tr>\n";
 495      // list custom blocks    
 496      foreach($custom_blocks as $value) {
 497      
 498          $custom_block = html_specialchars($value);
 499          
 500          echo '<tr bgcolor="#F3F5F8"><td><img src="img/leer.gif" width="1" height="14" alt="" /></td>';
 501          echo '<td class="chatlist" valign="top">'.$custom_block." {".$custom_block."}</td>\n</tr>\n";
 502          echo '<tr bgcolor="#F3F5F8"><td>&nbsp;</td>';
 503          echo '<td><textarea name="template_customblock_'.$custom_block;
 504          echo '" cols="35" rows="8" class="code width440">';
 505          echo isset($template['customblock_'.$value]) ? html_entities($template['customblock_'.$value]) : '';
 506          echo "</textarea></td>\n</tr>\n";
 507          echo '<tr bgcolor="#F3F5F8"><td colspan="2"><img src="img/leer.gif" width="1" height="3" alt="" /></td></tr>'."\n";
 508  
 509      }
 510      
 511      echo '<tr bgcolor="#F3F5F8"><td colspan="2"><img src="img/leer.gif" width="1" height="5" alt="" /></td></tr>
 512      <tr><td colspan="2"><img src="img/lines/l538_70.gif" width="538" height="1" alt="" /></td></tr>
 513      <tr><td colspan="2"><img src="img/leer.gif" width="1" height="8" alt="" /></td></tr>';
 514      
 515  } 
 516  ?>
 517      <tr>
 518        <td align="right" valign="top" class="chatlist tdtop4"><?php echo $BL['be_admin_tmpl_error'] ?>:&nbsp;</td>
 519        <td><textarea name="template_block_error" cols="35" rows="5" class="code width440" id="template_block_error"><?php echo html_entities($template["errortext"]); ?></textarea></td>
 520      </tr>
 521      
 522      <tr><td colspan="2" class="rowspacer7x7"><img src="img/leer.gif" alt="" width="1" height="1" /></td></tr>
 523      
 524      <tr>
 525          <td>&nbsp;<input name="template_id" type="hidden" value="<?php echo $template["id"] ?>" /></td>
 526          <td style="padding-bottom:10px;">
 527          <input name="Submit" type="submit" class="button10" value="<?php echo $BL['be_admin_tmpl_button'] ?>" />
 528          &nbsp;&nbsp;
 529          <input type="button" class="button10" value="<?php echo $BL['be_admin_struct_close'] ?>" onclick="location.href='phpwcms.php?do=admin&amp;p=11';" /></td>
 530      </tr>
 531      
 532  </table></form><?php    
 533  }
 534  ?>


Generated: Tue Nov 16 22:51:00 2010 Cross-referenced by PHPXref 0.7