[ Index ]

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

title

Body

[close]

/include/inc_tmpl/content/ -> cnt2.inc.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  
  31  //images
  32  
  33  $caption_box    = '';
  34  $img_thumbs        = '';
  35  $imgx            = 0;
  36  
  37  if(empty($template_default['imagegallery_default_column'])) {
  38      $template_default['imagegallery_default_column'] = 1;
  39  } else {
  40      $template_default['imagegallery_default_column'] = intval($template_default['imagegallery_default_column']);
  41      if(empty($template_default['imagegallery_default_column'])) {
  42          $template_default['imagegallery_default_column'] = 1;
  43      }
  44  }
  45  
  46  $template_default['imagegallery_default_width']     = isset($template_default['imagegallery_default_width']) ? $template_default['imagegallery_default_width'] : '' ;
  47  $template_default['imagegallery_default_height'] = isset($template_default['imagegallery_default_height']) ? $template_default['imagegallery_default_height'] : '' ;
  48  $template_default['imagegallery_default_space']     = isset($template_default['imagegallery_default_space']) ? $template_default['imagegallery_default_space'] : '' ;
  49  
  50  if(!isset($content['image_list'])) {
  51  
  52      $content['image_list'] = array(
  53      
  54              'pos'        => 0,
  55              'width'        => $template_default['imagegallery_default_width'],
  56              'height'    => $template_default['imagegallery_default_height'],
  57              'col'        => $template_default['imagegallery_default_column'],
  58              'space'        => $template_default['imagegallery_default_space'],
  59              'zoom'        => 0,
  60              'caption'    => '',
  61              'lightbox'    => 0,
  62              'nocaption'    => 0,
  63              'crop'        => 0,
  64              'random'    => 0,
  65              'limit'        => 0
  66      
  67          );
  68  
  69  }
  70  
  71  if(!isset($content['image_list']['limit'])) {
  72      $content['image_list']['limit'] = 0;
  73  }
  74  
  75  ?><tr>
  76      <td align="right" valign="top" class="chatlist"><img src="img/leer.gif" alt="" width="1" height="13"><?php echo $BL['be_cnt_image'] ?>:&nbsp;</td>
  77      <td valign="top"><table border="0" cellpadding="0" cellspacing="0" summary="">
  78      <tr>
  79          <td valign="top"><select name="cimage_list[]" size="<?php echo isset($content["image_list"]) && count($content["image_list"]) ? count($content["image_list"])+5 : 5 ?>" multiple class="f11" id="cimage_list" style="width: 300px;">
  80  <?php
  81  if(isset($content['image_list']['images']) && is_array($content['image_list']['images']) && count($content['image_list']['images'])) {
  82  
  83      // browse images and list available
  84      // will be visible only when aceessible
  85      foreach($content['image_list']['images'] as $key => $value) {
  86      
  87          $caption_box .= html_specialchars($content['image_list']['images'][$key][6])."\n";
  88      
  89          // 0   :1       :2   :3        :4    :5     :6      :7       :8
  90          // dbid:filename:hash:extension:width:height:caption:position:zoom
  91          $thumb_image = get_cached_image(
  92                          array(    "target_ext"    =>    $content['image_list']['images'][$key][3],
  93                                  "image_name"    =>    $content['image_list']['images'][$key][2] . '.' . $content['image_list']['images'][$key][3],
  94                                  "thumb_name"    =>    md5(    $content['image_list']['images'][$key][2].
  95                                                              $phpwcms["img_list_width"].
  96                                                              $phpwcms["img_list_height"].
  97                                                              $phpwcms["sharpen_level"]
  98                                                          )
  99                                )
 100                              );
 101  
 102          if($thumb_image != false) {
 103          
 104              // image found
 105              echo '<option value="' . $content['image_list']['images'][$key][0] . '">';
 106              $img_name = html_specialchars($content['image_list']['images'][$key][1]);
 107              echo $img_name . "</option>\n";
 108  
 109              if($imgx == 4) {
 110                  $img_thumbs .= '<br><img src="img/leer.gif" alt="" border="0" width="1" height="2"><br>';
 111                  $imgx = 0;
 112              }
 113              if($imgx) {
 114                  $img_thumbs .= '<img src="img/leer.gif" alt="" border="0" width="2" height="1">';
 115              }
 116              $img_thumbs .= '<img src="'.PHPWCMS_IMAGES . $thumb_image[0] .'" border="0" '.$thumb_image[3].' alt="'.$img_name.'" title="'.$img_name.'">';
 117  
 118              $imgx++;
 119          }
 120  
 121      }
 122  
 123  }
 124  
 125  ?>
 126                    </select></td>
 127                    <td valign="top"><img src="img/leer.gif" alt="" width="5" height="1"></td>
 128                    <td valign="top"><a href="javascript:;" title="<?php echo $BL['be_cnt_openimagebrowser'] ?>" 
 129                    onclick="tmt_winOpen('filebrowser.php?opt=1&amp;target=nolist','imageBrowser','width=380,height=300,left=8,top=8,scrollbars=yes,resizable=yes',1)"><img src="img/button/open_image_button.gif" alt="" width="20" height="15" border="0"></a><br /><img src="img/leer.gif" alt="" width="1" height="4"><br /><a href="javascript:;" 
 130                    title="<?php echo $BL['be_cnt_sortup'] ?>" onclick="moveOptionUp(document.articlecontent.cimage_list);"><img src="img/button/image_pos_up.gif" alt="" width="10" height="9" border="0"></a><a href="javascript:;" 
 131                    title="<?php echo $BL['be_cnt_sortdown'] ?>" onclick="moveOptionDown(document.articlecontent.cimage_list);"><img src="img/button/image_pos_down.gif" alt="" width="10" height="9" border="0"></a><br /><img src="img/leer.gif" alt="" width="1" height="4"><br /><a href="javascript:;" 
 132                    onclick="removeSelectedOptions(document.articlecontent.cimage_list);" title="<?php echo $BL['be_cnt_delimage'] ?>"><img src="img/button/del_image_button1.gif" alt="" width="20" height="15" border="0"></a></td>
 133                  </tr>
 134                </table><?php
 135  
 136  if($img_thumbs) { 
 137      echo '<table border="0" cellspacing="0" cellpadding="0">
 138          <tr><td style="padding-bottom:3px;"><img src="img/leer.gif" width="1" height="5"><br>'.$img_thumbs.'</td></tr>
 139          </table>';
 140  }
 141  
 142  ?></td>
 143                </tr>
 144                <tr><td colspan="2"><img src="img/leer.gif" alt="" width="1" height="5"></td></tr>
 145              <tr>
 146                <td align="right" class="chatlist"><?php echo $BL['be_cnt_position'] ?>:&nbsp;</td>
 147                <td valign="top"><table border="0" cellpadding="0" cellspacing="0" summary="">
 148                  <tr>
 149                    <td><select name="cimage_pos" class="f10" id="cimage_pos" onChange="changeImagePosMenu();">
 150                  <option value="0" <?php is_selected(0, $content['image_list']['pos']) ?>><?php echo $BL['be_cnt_pos0'] ?></option>
 151                  <option value="1" <?php is_selected(1, $content['image_list']['pos']) ?>><?php echo $BL['be_cnt_pos1'] ?></option>
 152                  <option value="2" <?php is_selected(2, $content['image_list']['pos']) ?>><?php echo $BL['be_cnt_pos2'] ?></option>
 153                  <option value="3" <?php is_selected(3, $content['image_list']['pos']) ?>><?php echo $BL['be_cnt_pos3'] ?></option>
 154                  <option value="4" <?php is_selected(4, $content['image_list']['pos']) ?>><?php echo $BL['be_cnt_pos4'] ?></option>
 155                  <option value="5" <?php is_selected(5, $content['image_list']['pos']) ?>><?php echo $BL['be_cnt_pos5'] ?></option>
 156                  <option value="6" <?php is_selected(6, $content['image_list']['pos']) ?>><?php echo $BL['be_cnt_pos6'] ?></option>
 157                  <option value="7" <?php is_selected(7, $content['image_list']['pos']) ?>><?php echo $BL['be_cnt_pos7'] ?></option>
 158                </select></td>
 159                    <td><img src="img/leer.gif" alt="" width="3" height="1"></td>
 160                    <td><img src="img/symbole/content_selected.gif" alt="" name="imgpos0" width="7" height="10" id="imgpos0"></td>
 161                    <td><a href="javascript:;" onclick="changeImagePos(0);this.blur();return false;" title="<?php echo $BL['be_cnt_pos0i'] ?>"><img src="img/button/image_pos0.gif" alt="" width="15" height="15" border="0"></a></td>
 162                    <td><img src="img/leer.gif" alt="" name="imgpos1" width="7" height="10" id="imgpos1"></td>
 163                    <td><a href="javascript:;" onclick="changeImagePos(1);this.blur();return false;" title="<?php echo $BL['be_cnt_pos1i'] ?>"><img src="img/button/image_pos1.gif" alt="" width="15" height="15" border="0"></a></td>
 164                    <td><img src="img/leer.gif" alt="" name="imgpos2" width="7" height="10" id="imgpos2"></td>
 165                    <td><a href="javascript:;" onclick="changeImagePos(2);this.blur();return false;" title="<?php echo $BL['be_cnt_pos2i'] ?>"><img src="img/button/image_pos2.gif" alt="" width="15" height="15" border="0"></a></td>
 166                    <td><img src="img/leer.gif" alt="" name="imgpos3" width="7" height="10" id="imgpos3"></td>
 167                    <td><a href="javascript:;" onclick="changeImagePos(3);this.blur();return false;" title="<?php echo $BL['be_cnt_pos3i'] ?>"><img src="img/button/image_pos3.gif" alt="" width="15" height="15" border="0"></a></td>
 168                    <td><img src="img/leer.gif" alt="" name="imgpos4" width="7" height="10" id="imgpos4"></td>
 169                    <td><a href="javascript:;" onclick="changeImagePos(4);this.blur();return false;" title="<?php echo $BL['be_cnt_pos4i'] ?>"><img src="img/button/image_pos4.gif" alt="" width="15" height="15" border="0"></a></td>
 170                    <td><img src="img/leer.gif" alt="" name="imgpos5" width="7" height="10" id="imgpos5"></td>
 171                    <td><a href="javascript:;" onclick="changeImagePos(5);this.blur();return false;" title="<?php echo $BL['be_cnt_pos5i'] ?>"><img src="img/button/image_pos5.gif" alt="" width="15" height="15" border="0"></a></td>
 172                    <td><img src="img/leer.gif" alt="" name="imgpos6" width="7" height="10" id="imgpos6"></td>
 173                    <td><a href="javascript:;" onclick="changeImagePos(6);this.blur();return false;" title="<?php echo $BL['be_cnt_pos6i'] ?>"><img src="img/button/image_pos6.gif" alt="" width="15" height="15" border="0"></a></td>
 174                    <td><img src="img/leer.gif" alt="" name="imgpos7" width="7" height="10" id="imgpos7"></td>
 175                    <td><a href="javascript:;" onclick="changeImagePos(7);this.blur();return false;" title="<?php echo $BL['be_cnt_pos7i'] ?>"><img src="img/button/image_pos7.gif" alt="" width="15" height="15" border="0"></a></td>
 176                  </tr>
 177                </table><script language="JavaScript" type="text/javascript">
 178                <!--
 179                changeImagePos(<?php echo intval($content['image_list']['pos']); ?>);
 180                //-->
 181                </script></td>
 182                </tr>
 183                
 184              <tr><td colspan="2"><img src="img/leer.gif" alt="" width="1" height="5"></td></tr>
 185              <tr>
 186                <td align="right" class="chatlist"><?php echo $BL['be_cnt_maxw'] ?>:&nbsp;</td>
 187                <td valign="top"><table border="0" cellpadding="0" cellspacing="0" summary="">
 188                  <tr>
 189                    <td><input name="cimage_width" type="text" class="f11b" id="cimage_width" style="width: 50px;" size="4" maxlength="4" onKeyUp="if(!parseInt(this.value*1)) this.value='';" value="<?php echo empty($content['image_list']['width']) ? $template_default['imagegallery_default_width'] : $content['image_list']['width']; ?>"></td>
 190                    <td class="chatlist">&nbsp;&nbsp;<?php echo $BL['be_cnt_maxh'] ?>:&nbsp;</td>
 191                    <td><input name="cimage_height" type="text" class="f11b" id="cimage_height" style="width: 50px;" size="4" maxlength="4" onKeyUp="if(!parseInt(this.value*1)) this.value='';" value="<?php echo empty($content['image_list']['height']) ? $template_default['imagegallery_default_height'] : $content['image_list']['height']; ?>"></td>
 192                    <td class="chatlist">&nbsp;px&nbsp;&nbsp;&nbsp;</td>
 193              
 194                  <td><input type="checkbox" name="cimage_crop" id="cimage_crop" value="1" <?php is_checked(1, $content['image_list']['crop']); ?> /></td>
 195                  <td class="v10"><label for="cimage_crop" class="checkbox"><?php echo $BL['be_image_crop'] ?></label></td>
 196                    
 197                  </tr>
 198                </table></td>
 199                </tr>
 200              <tr><td colspan="2"><img src="img/leer.gif" alt="" width="1" height="5" /></td></tr>
 201              
 202  <tr>
 203     <td align="right" class="chatlist"><?php echo $BL['limit_image_from_list'] ?>:&nbsp;</td>
 204     <td valign="top"><table border="0" cellpadding="0" cellspacing="0" summary="">
 205           <tr>
 206              <td><select name="cimage_limit" class="f10" id="cimage_limit">
 207          <option value="0"<?php is_selected(0, $content['image_list']['limit']); ?>><?php echo $BL['be_ftptakeover_all'] ?></option>
 208  <?php
 209  // take max images from list
 210  if($imgx) {
 211      $max_limit = $imgx + 10;
 212  } else {
 213      $max_limit = 20;    
 214  }
 215  for($max_image_limit = 1; $max_image_limit <= $max_limit; $max_image_limit++) {
 216  
 217      echo '<option value="'.$max_image_limit.'" ';
 218      is_selected($max_image_limit, $content['image_list']['limit']);
 219      echo '>'.$max_image_limit."</option>\n";
 220  }
 221  ?>            </select></td>
 222              <td>&nbsp;&nbsp;</td>
 223              <td><input name="cimage_random" type="checkbox" id="cimage_random" value="1" <?php is_checked(1, $content['image_list']['random']); ?> /></td>
 224              <td class="v10"><label for="cimage_random" class="checkbox"><?php echo $BL['random_image'] ?></label></td>
 225           </tr>
 226        </table>
 227     </td>
 228  </tr>            
 229              <tr><td colspan="2"><img src="img/leer.gif" alt="" width="1" height="5" /></td></tr>
 230              
 231              <tr>
 232                <td align="right" class="chatlist"><?php echo $BL['be_cnt_column'] ?>:&nbsp;</td>
 233                <td valign="top"><table border="0" cellpadding="0" cellspacing="0" summary="">
 234                  <tr>
 235                    <td><select name="cimage_col" class="f10" id="cimage_col">
 236  <?php
 237  
 238  // list select menu for max image columns
 239  for($max_image_col = 1; $max_image_col <= 25; $max_image_col++) {
 240  
 241      echo '<option value="'.$max_image_col.'" ';
 242      is_selected($max_image_col, $content['image_list']['col']);
 243      echo '>'.$max_image_col."</option>\n";
 244    
 245  }
 246  
 247  ?>
 248                    </select></td>
 249                    <td class="chatlist">&nbsp;&nbsp;<?php echo $BL['be_cnt_imagespace'] ?>:&nbsp;</td>
 250                    <td><input name="cimage_space" type="text" class="f11b" id="cimage_space" style="width: 50px;" size="2" maxlength="3" onKeyUp="if(!parseInt(this.value*1)) this.value='';" value="<?php echo empty($content['image_list']['space']) ? $template_default['imagegallery_default_space'] : $content['image_list']['space']; ?>" /></td>
 251                    <td class="chatlist">&nbsp;px</td>
 252                  </tr>
 253                </table></td>
 254                </tr>
 255  
 256  <tr><td colspan="2"><img src="img/leer.gif" alt="" width="1" height="8"></td></tr>
 257  
 258  <tr>
 259      <td align="right" class="chatlist"><?php echo $BL['be_cnt_behavior'] ?>:&nbsp;</td>
 260      <td valign="top"><table border="0" cellpadding="0" cellspacing="0" summary="">
 261              <tr>
 262                  <td><input name="cimage_zoom" type="checkbox" id="cimage_zoom" value="1" <?php is_checked(1, $content['image_list']['zoom']); ?> /></td>
 263                  <td class="v10"><label for="cimage_zoom" class="checkbox"><?php echo $BL['be_cnt_enlarge'] ?></label></td>
 264                  
 265                  <td>&nbsp;</td>
 266                  <td><input name="cimage_lightbox" type="checkbox" id="cimage_lightbox" value="1" <?php is_checked(1, $content['image_list']['lightbox']); ?> onchange="if(this.checked){getObjectById('cimage_zoom').checked=true;}" /></td>
 267                  <td class="v10"><label for="cimage_lightbox" class="checkbox"><?php echo $BL['be_cnt_lightbox'] ?></label></td>
 268                  
 269                  <td>&nbsp;</td>
 270                  <td><input name="cimage_nocaption" type="checkbox" id="cimage_nocaption" value="1" <?php is_checked(1, $content['image_list']['nocaption']); ?> /></td>
 271                  <td class="v10"><label for="cimage_nocaption" class="checkbox"><?php echo $BL['be_cnt_imglist_nocaption'] ?></label></td>
 272  
 273              </tr>
 274          </table>
 275      </td>
 276  </tr>
 277  
 278  <tr><td colspan="2"><img src="img/leer.gif" alt="" width="1" height="8"></td></tr>
 279  <tr>
 280      <td align="right" valign="top" class="chatlist"><img src="img/leer.gif" alt="" width="1" height="13"><?php echo $BL['be_cnt_caption'] ?>:&nbsp;</td>
 281      <td valign="top"><textarea name="cimage_caption" cols="40" rows="<?php echo (($imgx+2 >= 6) ? $imgx+4 : 6); ?>" wrap="off" class="f11" id="cimage_caption" style="width: 440px;"><?php echo $caption_box; ?></textarea></td>
 282  </tr>
 283  <tr><td colspan="2"><img src="img/leer.gif" alt="" width="1" height="8"></td></tr>
 284  <tr><td colspan="2"><img src="img/lines/l538_70.gif" alt=""></td></tr>


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