[ Index ]

PHP Cross Reference of phpwcms V1.4.3 _r380 (23.11.09)

title

Body

[close]

/include/inc_tmpl/content/ -> cnt21.inc.php (source)

   1  <?php
   2  /*************************************************************************************
   3     Copyright notice
   4     
   5     (c) 2002-2009 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  
  31  // Page / ext. Content
  32  
  33  if(!isset($content["page_file"])) {
  34  
  35      $content["page_file"]["source"] = 0;
  36      $content["page_file"]["pfile"] = '';
  37  
  38  }
  39  
  40  ?>
  41  <tr>
  42    <td align="right" class="chatlist"><?php echo $BL['be_cnt_pages_from'] ?>:&nbsp;</td>
  43    <td valign="top"><table border="0" cellpadding="0" cellspacing="0" bgcolor="#E7E8EB" summary="">
  44    <tr>
  45        <td><input name="cpage_source" type="radio" value="0" <?php is_checked(0, $content["page_file"]["source"]) ?>></td>
  46      <td><?php echo $BL['be_cnt_pages_fromfile'] ?>&nbsp;&nbsp;</td>
  47      <td><input name="cpage_source" type="radio" value="1" <?php is_checked(1, $content["page_file"]["source"]) ?>></td>
  48      <td><?php echo $BL['be_cnt_pages_manually'] ?>&nbsp;&nbsp;&nbsp;</td>
  49    </tr></table></td>
  50  </tr>
  51  <tr><td colspan="2"><img src="img/leer.gif" alt="" width="1" height="5"></td></tr>
  52  <tr>
  53    <td align="right" class="chatlist"><?php echo $BL['be_cnt_pages_cust'] ?>:&nbsp;</td>
  54    <td><input name="cpage_custom" type="text" class="f11" id="cpage_custom" style="width: 440px" value="<?php echo  html_specialchars($content["page_file"]["pfile"]) ?>" size="40"></td>
  55  </tr>
  56  <tr><td colspan="2"><img src="img/leer.gif" alt="" width="1" height="3"></td></tr>
  57  <tr>
  58      <td align="right" valign="top" class="chatlist"><img src="img/leer.gif" alt="" width="1" height="15" /><?php echo $BL['be_cnt_pages_select'] ?>:&nbsp;</td>
  59      <td valign="top"><div style="width:440px;height:200px;overflow:auto;border: 1px solid #7F9DB9;"><?php
  60  
  61  echo '<table cellspacing="0" cellpadding="0" border="0" width="100%">';
  62  
  63  // browse pages subdirectory
  64  
  65  browse_pages_dir($phpwcms['content_path'].'pages');
  66  
  67  function browse_pages_dir($dir) {
  68  
  69      $pc = 0;
  70      $da = array(); //directory array
  71      $fa = array(); //file array
  72      if(is_dir($dir)) {
  73          $ph = opendir($dir);
  74          while($pf = readdir($ph)) {
  75                 if($pf != '.' && $pf != '..') {
  76              
  77                  if(is_dir($dir.'/'.$pf)) {
  78                  
  79                      $da[] = $pf; //add $pf to folder array for current dir                
  80                  
  81                  } else {
  82                      
  83                      if( preg_match('/(\.html|\.htm|\.txt|\.php|\.inc|\.tmpl)$/', strtolower($pf)) ) {
  84                          $fa[] = $pf; //add $pf to file array for current dir
  85                      }
  86                  
  87                  }
  88              }
  89          }
  90          closedir($ph);
  91          
  92          // list files
  93          if(count($fa)) {
  94              $x = 0;
  95              foreach($fa as $value) {
  96                  if(!$x) {
  97                      echo "\n<tr bgcolor=\"#E7E8EB\" style=\"height:19px;\"><td colspan=\"2\" class=\"chatlist\">";
  98                      echo '&nbsp;&nbsp;<strong>'.html_specialchars($dir);
  99                      echo "</strong></td></tr>\n";
 100                      echo '<tr><td colspan="2"><img src="img/leer.gif" width="1" height="2" alt="" /></td></tr>';
 101                  }
 102                  echo "\n<tr><td align=\"center\">";
 103                  echo '<input name="cpage_file" type="radio" value="'.html_specialchars($dir.'/'.$value).'" ';
 104                  
 105                  if($GLOBALS['content']['page_file']['pfile'] == ($dir.'/'.$value)) {
 106                      echo 'checked="checked" ';
 107                  }                
 108                  echo '/>';
 109                  echo '</td><td><strong>';
 110                  echo str_replace(' ', '&nbsp;', html_specialchars($value));
 111                  echo '</strong></td></tr>';
 112                  $x++;
 113              }
 114              echo '<tr><td colspan="2"><img src="img/leer.gif" width="1" height="2" alt="" /></td></tr>';
 115          }
 116          
 117          // check all subdirs
 118          if(count($da)) {
 119              foreach($da as $value) browse_pages_dir($dir.'/'.$value);
 120          }
 121          
 122      }
 123  }
 124  
 125  echo "\n<tr><td width=\"25\">";
 126  echo '<img src="img/leer.gif" width="26" height="1" alt="" /></td><td width="99%"><img src="img/leer.gif" width="1" height="1" alt="" /></td></tr>';
 127  echo "\n</table>";
 128  
 129  ?></div></td>
 130  </tr>


Generated: Wed Dec 30 05:55:15 2009 Cross-referenced by PHPXref 0.7