[ Index ]

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

title

Body

[close]

/include/inc_tmpl/content/ -> cnt29.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  //images
  32  
  33  $caption_box    = array();
  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      
  65          );
  66  
  67  }
  68  if(empty($content['image_list']['center_image'])) {
  69      $content['image_list']['center_image'] = 0;
  70  }
  71  
  72  $img_count = isset($content["image_list"]['images']) && is_array($content["image_list"]['images']) ? count($content["image_list"]['images']) : 0;
  73  
  74  ?>
  75  
  76  <tr><td colspan="2" class="rowspacer0x7"><img src="img/leer.gif" alt="" width="1" height="1" /></td></tr>
  77  
  78  <tr>
  79      <td align="right" class="chatlist"><?php echo $BL['be_admin_struct_template']; ?>:&nbsp;</td>
  80      <td><table border="0" cellpadding="0" cellspacing="0" summary="">
  81          <tr>
  82              <td><select name="template" id="template" class="f11b width150">
  83  <?php
  84      
  85      echo '<option value="">'.$BL['be_admin_tmpl_default'].'</option>'.LF;
  86  
  87  // templates for frontend login
  88  $tmpllist = get_tmpl_files(PHPWCMS_TEMPLATE.'inc_cntpart/images');
  89  if(is_array($tmpllist) && count($tmpllist)) {
  90      foreach($tmpllist as $val) {
  91          $selected_val = (isset($content["image_template"]) && $val == $content["image_template"]) ? ' selected="selected"' : '';
  92          $val = html_specialchars($val);
  93          echo '    <option value="' . $val . '"' . $selected_val . '>' . $val . '</option>' . LF;
  94      }
  95  }
  96  
  97  ?>                  
  98          </select></td>
  99          
 100          <td class="chatlist">&nbsp;&nbsp;&nbsp;<?php echo $BL['be_image_align'] ?>:&nbsp;</td>
 101          
 102           <td>
 103              <select name="cimage_center" id="cimage_center" class="v11 width150">
 104              
 105                  <option value="0"<?php is_selected(0, $content['image_list']['center_image']); ?>><?php echo $BL['be_cnt_imagenocenter'] ?></option>
 106                  <option value="1"<?php is_selected(1, $content['image_list']['center_image']); ?>><?php echo $BL['be_cnt_imagecenter'] ?></option>
 107                  <option value="2"<?php is_selected(2, $content['image_list']['center_image']); ?>><?php echo $BL['be_cnt_imagecenterh'] ?></option>
 108                  <option value="3"<?php is_selected(3, $content['image_list']['center_image']); ?>><?php echo $BL['be_cnt_imagecenterv'] ?></option>
 109                  
 110              </select>
 111          </td>
 112          
 113          </tr>
 114          
 115      </table></td>        
 116          
 117  </tr>
 118  
 119  <tr><td colspan="2"><img src="img/leer.gif" alt="" width="1" height="8" /></td></tr>
 120  
 121  <tr>
 122      <td align="right" class="chatlist"><?php echo $BL['be_cnt_maxw'] ?>:&nbsp;</td>
 123      <td valign="top"><table border="0" cellpadding="0" cellspacing="0" summary="">
 124          <tr>
 125  
 126              <td><input name="cimage_width" type="text" class="f11b" id="cimage_width" style="width: 50px;" size="4" maxlength="4" onkeyup="setCimageCenterInactive();" value="<?php echo empty($content['image_list']['width']) ? $template_default['imagegallery_default_width'] : $content['image_list']['width']; ?>" /></td>
 127              <td class="chatlist">&nbsp;&nbsp;<?php echo $BL['be_cnt_maxh'] ?>:&nbsp;</td>
 128  
 129              <td><input name="cimage_height" type="text" class="f11b" id="cimage_height" style="width: 50px;" size="4" maxlength="4" onkeyup="setCimageCenterInactive();" value="<?php echo empty($content['image_list']['height']) ? $template_default['imagegallery_default_height'] : $content['image_list']['height']; ?>" /></td>
 130              <td class="chatlist">&nbsp;px&nbsp;&nbsp;&nbsp;</td>
 131              
 132              <td><input type="checkbox" name="cimage_crop" id="cimage_crop" value="1" <?php is_checked(1, $content['image_list']['crop']); ?> /></td>
 133              <td class="v10"><label for="cimage_crop" class="checkbox"><?php echo $BL['be_image_crop'] ?></label></td>
 134          
 135          </tr>
 136      </table></td>
 137  </tr>
 138  
 139  <tr><td colspan="2"><img src="img/leer.gif" alt="" width="1" height="5" /></td></tr>
 140  
 141  <tr>
 142      <td align="right" class="chatlist"><?php echo $BL['be_cnt_column'] ?>:&nbsp;</td>
 143      <td valign="top"><table border="0" cellpadding="0" cellspacing="0" summary="">
 144          <tr>
 145              <td><select name="cimage_col" class="f11b" id="cimage_col">
 146  <?php
 147  
 148  // list select menu for max image columns
 149  for($max_image_col = 1; $max_image_col <= 25; $max_image_col++) {
 150  
 151      echo '<option value="'.$max_image_col.'" ';
 152      is_selected($max_image_col, $content['image_list']['col']);
 153      echo '>'.$max_image_col."</option>\n";
 154    
 155  }
 156  
 157  ?>
 158                    </select></td>
 159                    <td class="chatlist">&nbsp;&nbsp;<?php echo $BL['be_cnt_imagespace'] ?>:&nbsp;</td>
 160                    <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>
 161                    <td class="chatlist">&nbsp;px&nbsp;&nbsp;&nbsp;</td>
 162                    
 163                    
 164                  </tr>
 165                </table></td>
 166                </tr>
 167  
 168  <tr><td colspan="2"><img src="img/leer.gif" alt="" width="1" height="8" /><script language="javascript" type="text/javascript">
 169      <!--
 170      //if(!parseInt(this.value*1)) this.value='';
 171  	function setCimageCenterInactive() {
 172          var cih = getObjectById('cimage_width');
 173          var ciw = getObjectById('cimage_height');
 174          var cic = getObjectById('cimage_center');
 175          //var cil = getObjectById('cimage_center_label');
 176          var ccp = getObjectById('cimage_crop');
 177          var dis = false;
 178          if(!parseInt(cih.value*1)) {
 179              cih.value = '';
 180              dis = true;
 181          }
 182          if(!parseInt(ciw.value*1)) {
 183              ciw.value = '';
 184              dis = true;
 185          }
 186          if(dis) {
 187              cic.disabled = true;
 188              ccp.disabled = true;
 189              //cil.className = 'checkbox inactive';
 190          } else {
 191              cic.disabled = false;
 192              ccp.disabled = false;
 193              //cil.className = 'checkbox';
 194          }
 195      }
 196      setCimageCenterInactive();
 197      //-->
 198      </script></td></tr>
 199  
 200  <tr>
 201      <td align="right" class="chatlist"><?php echo $BL['be_cnt_behavior'] ?>:&nbsp;</td>
 202      <td valign="top"><table border="0" cellpadding="0" cellspacing="0" summary="">
 203              <tr>
 204                  <td><input name="cimage_zoom" type="checkbox" id="cimage_zoom" value="1" <?php is_checked(1, $content['image_list']['zoom']); ?> /></td>
 205                  <td class="v10"><label for="cimage_zoom" class="checkbox"><?php echo $BL['be_cnt_enlarge'] ?></label></td>
 206                  
 207                  <td>&nbsp;</td>
 208                  <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>
 209                  <td class="v10"><label for="cimage_lightbox" class="checkbox"><?php echo $BL['be_cnt_lightbox'] ?></label></td>
 210                  
 211                  <td>&nbsp;</td>
 212                  <td><input name="cimage_nocaption" type="checkbox" id="cimage_nocaption" value="1" <?php is_checked(1, $content['image_list']['nocaption']); ?> /></td>
 213                  <td class="v10"><label for="cimage_nocaption" class="checkbox"><?php echo $BL['be_cnt_imglist_nocaption'] ?></label></td>
 214  
 215              </tr>
 216          </table>
 217      </td>
 218  </tr>
 219  
 220  
 221  <tr><td colspan="2" class="rowspacer7x7"><img src="img/leer.gif" alt="" width="1" height="1" /></td></tr>
 222  
 223  
 224  
 225  <tr>
 226      <td align="right" valign="top" class="chatlist tdtop4"><?php echo $BL['be_cnt_image'] ?>:&nbsp;</td>
 227      <td valign="top"><table border="0" cellpadding="0" cellspacing="0" summary="">
 228      <tr>
 229          <td valign="top">
 230          <select name="cimage_list[]" size="<?php echo $img_count+5 ?>" multiple="multiple" class="f11" id="cimage_list" style="width: 360px;">
 231  <?php
 232  if($img_count) {
 233  
 234      // browse images and list available
 235      // will be visible only when aceessible
 236      foreach($content['image_list']['images'] as $key => $value) {
 237      
 238          // 0   :1       :2   :3        :4    :5     :6      :7       :8
 239          // dbid:filename:hash:extension:width:height:caption:position:zoom
 240          $thumb_image = get_cached_image(
 241                          array(    "target_ext"    =>    $content['image_list']['images'][$key][3],
 242                                  "image_name"    =>    $content['image_list']['images'][$key][2] . '.' . $content['image_list']['images'][$key][3],
 243                                  "thumb_name"    =>    md5(    $content['image_list']['images'][$key][2].
 244                                                              $phpwcms["img_list_width"].
 245                                                              $phpwcms["img_list_height"].
 246                                                              $phpwcms["sharpen_level"]
 247                                                          )
 248                                )
 249                              );
 250  
 251          if($thumb_image != false) {
 252          
 253              // image found
 254              echo '<option value="' . $content['image_list']['images'][$key][0] . '">';
 255              $img_name = html_specialchars($content['image_list']['images'][$key][1]);
 256              echo $img_name . '</option>'.LF;
 257  
 258              if($imgx == 4) {
 259                  $img_thumbs .= '<br /><img src="img/leer.gif" alt="" border="0" width="1" height="2" /><br />';
 260                  $imgx = 0;
 261              }
 262              if($imgx) {
 263                  $img_thumbs .= '<img src="img/leer.gif" alt="" border="0" width="2" height="1" />';
 264              }
 265              $img_thumbs .= '<img src="'.PHPWCMS_IMAGES . $thumb_image[0] .'" border="0" '.$thumb_image[3].' alt="'.$img_name.'" title="'.$img_name.'" />';
 266  
 267              $caption_box[] = html_specialchars($content['image_list']['images'][$key][6]);
 268  
 269              $imgx++;
 270          }
 271  
 272      }
 273  
 274  }
 275  
 276  ?>
 277            </select></td>
 278                    <td valign="top"><img src="img/leer.gif" alt="" width="5" height="1" /></td>
 279                    <td valign="top">
 280                    <a href="#" title="<?php echo $BL['be_cnt_openimagebrowser'] ?>" onclick="tmt_winOpen('filebrowser.php?opt=1&amp;target=nolist','imageBrowser','width=450,height=450,left=8,top=8,scrollbars=yes,resizable=yes',1);return false;"><img src="img/button/open_image_button.gif" alt="" width="20" height="15" border="0" /></a>
 281                    <br /><img src="img/leer.gif" alt="" width="1" height="4" /><br /><a href="#" title="<?php echo $BL['be_cnt_sortup'] ?>" onclick="moveOptionUp(document.articlecontent.cimage_list);return false;"><img src="img/button/image_pos_up.gif" alt="" width="10" height="9" border="0" /></a><a href="#" title="<?php echo $BL['be_cnt_sortdown'] ?>" onclick="moveOptionDown(document.articlecontent.cimage_list);return false;"><img src="img/button/image_pos_down.gif" alt="" width="10" height="9" border="0" /></a>
 282                    <br /><img src="img/leer.gif" alt="" width="1" height="4" /><br /><a href="#" onclick="removeSelectedOptions(document.articlecontent.cimage_list);return false;" title="<?php echo $BL['be_cnt_delimage'] ?>"><img src="img/button/del_image_button1.gif" alt="" width="20" height="15" border="0" /></a></td>
 283        </tr>
 284                </table>
 285  <?php
 286  
 287      if($img_thumbs) { 
 288          echo '
 289          <table border="0" cellspacing="0" cellpadding="0" summary="">
 290          <tr>
 291                  <td style="padding:5px 0 5px 0;">'.$img_thumbs.'</td>
 292              </tr>
 293          </table>';
 294      }
 295  
 296  ?></td>
 297                </tr>
 298                
 299  <tr>
 300      <td align="right" valign="top" class="chatlist tdtop4"><?php echo $BL['be_cnt_caption'] ?>:&nbsp;</td>
 301      <td valign="top"><textarea name="cimage_caption" cols="40" rows="<?php echo $img_count+5 ?>" wrap="off" class="f11" id="cimage_caption" style="width: 440px;"><?php echo implode(' '.LF, $caption_box) ?></textarea></td>
 302  </tr>
 303  <tr><td colspan="2" class="rowspacer7x7"><img src="img/leer.gif" alt="" width="1" height="1" /></td></tr>
 304  
 305  <tr><td colspan="2" align="center"><?php
 306  
 307  $wysiwyg_editor = array(
 308      'value'        => isset($content["text"]) ? $content["text"] : '',
 309      'field'        => 'ctext',
 310      'height'    => '250px',
 311      'width'        => '536px',
 312      'rows'        => '15',
 313      'editor'    => $_SESSION["WYSIWYG_EDITOR"],
 314      'lang'        => 'en'
 315  );
 316  
 317  include (PHPWCMS_ROOT.'/include/inc_lib/wysiwyg.editor.inc.php');
 318  
 319  
 320  ?></td></tr>
 321  
 322  <tr><td colspan="2" class="rowspacer7x7"><img src="img/leer.gif" alt="" width="1" height="1" /></td></tr>


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