[ Index ]

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

title

Body

[close]

/include/inc_tmpl/ -> newsletter.form.tmpl.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  // show newsletter form
  32  
  33  ?>
  34  <div class="title" style="margin-bottom:10px"><?php echo $BL['be_newsletter_titleeditnl'] ?></div>
  35  <form action="phpwcms.php?do=messages&amp;p=3&amp;s=<?php echo $newsletter["newsletter_id"] ?>&amp;edit=1" method="post" name="newsletter" target="_self" id="newsletter" onsubmit="hideLayer('newsletterButtons');enableStatusMessage('statusMessage', true, false);">
  36  <table border="0" cellpadding="0" cellspacing="0" summary="" width="100%">
  37      <tr><td colspan="2" bgcolor="#92A1AF"><img src="img/leer.gif" alt="" width="1" height="1" /></td></tr>
  38      <tr bgcolor="#F3F5F8"><td colspan="2"><img src="img/leer.gif" alt="" width="1" height="9" /></td></tr>
  39      <tr bgcolor="#F3F5F8">
  40          <td align="right" class="chatlist"><?php 
  41          
  42          echo $BL['be_msg_subject'];
  43          if(!empty($newsletter['error']['subject'])) {
  44              echo '<img src="img/symbole/error_9x9.gif" width="9" height="9" alt="" />';
  45          }
  46          
  47          
  48      ?>:&nbsp;</td>
  49          <td><input name="newsletter_subject" type="text" class="f11b" id="newsletter_subject" style="width:400px" value="<?php echo html_specialchars($newsletter["newsletter_subject"]) ?>" size="50" maxlength="250" onchange="hideLayer('messagesend');" /></td>
  50      </tr>
  51      <tr bgcolor="#F3F5F8"><td colspan="2"><img src="img/leer.gif" alt="" width="1" height="5" /></td></tr>
  52  
  53  <?php
  54      if(!empty($newsletter["newsletter_created"])) {
  55          echo '<tr bgcolor="#F3F5F8"><td align="right" class="chatlist">' .$BL['be_fprivedit_created']. ':&nbsp;</td><td><strong>';
  56          echo @date($BL['be_fprivedit_dateformat'], strtotime($newsletter["newsletter_created"]));        
  57          echo '</strong></td></tr>';
  58          echo '<tr bgcolor="#F3F5F8"><td colspan="2"><img src="img/leer.gif" alt="" width="1" height="3" /></td></tr>';
  59      }
  60  
  61      
  62  ?>
  63      <tr bgcolor="#F3F5F8">
  64          <td align="right" class="chatlist"><?php echo $BL['be_newsletter_changed'] ?>:&nbsp;</td>
  65          <td><strong><?php 
  66          
  67          if(isset($newsletter['error'])) $newsletter["newsletter_date"] = time();
  68          echo @date($BL['be_fprivedit_dateformat'], $newsletter["newsletter_date"]);
  69          
  70          ?></strong></td>
  71      </tr>    
  72      <tr bgcolor="#F3F5F8"><td colspan="2"><img src="img/leer.gif" alt="" width="1" height="8" /></td></tr>
  73      <tr><td colspan="2" bgcolor="#d9dee3"><img src="img/leer.gif" alt="" width="1" height="1" /></td></tr>
  74      <tr><td colspan="2"><img src="img/leer.gif" alt="" width="1" height="8" /></td></tr>
  75      <tr>
  76          <td align="right" class="chatlist"><?php echo $BL['be_newsletter_fromname'] ?>:&nbsp;</td>
  77          <td><input name="newsletter_fromname" type="text" class="f11" id="newsletter_fromname" style="width:400px" value="<?php echo html_specialchars($newsletter["newsletter_vars"]['from_name']) ?>" size="50" maxlength="250" /></td>
  78      </tr>
  79      <tr><td colspan="2"><img src="img/leer.gif" alt="" width="1" height="2" /></td></tr>
  80      <tr>
  81          <td align="right" class="chatlist"><?php 
  82          
  83          echo $BL['be_newsletter_fromemail'];
  84          if(isset($newsletter['error']) && isset($newsletter['error']['from_email'])) {
  85              echo '<img src="img/symbole/error_9x9.gif" width="9" height="9" alt="" />';
  86          }
  87          
  88          ?>:&nbsp;</td>
  89          <td><input name="newsletter_fromemail" type="text" class="f11" id="newsletter_fromemail" style="width:400px" value="<?php echo html_specialchars($newsletter["newsletter_vars"]['from_email']) ?>" size="50" maxlength="250" /></td>
  90      </tr>
  91      <tr><td colspan="2"><img src="img/leer.gif" alt="" width="1" height="2" /></td></tr>
  92      <tr>
  93          <td align="right" class="chatlist"><?php 
  94          
  95          echo $BL['be_newsletter_replyto'];
  96          if(isset($newsletter['error']) && isset($newsletter['error']['replyto'])) {
  97              echo '<img src="img/symbole/error_9x9.gif" width="9" height="9" alt="" />';
  98          }
  99          
 100          ?>:&nbsp;</td>
 101          <td><input name="newsletter_replyto" type="text" class="f11" id="newsletter_replyto" style="width:400px" value="<?php echo html_specialchars($newsletter["newsletter_vars"]['replyto']) ?>" size="50" maxlength="250" /></td>
 102      </tr>
 103      <tr><td colspan="2"><img src="img/leer.gif" alt="" width="1" height="5" /></td></tr>
 104      <tr>
 105          <td align="right" class="chatlist" valign="top"><img src="img/leer.gif" alt="" width="1" height="14" /><?php echo $BL['be_cnt_subscription'] ?>:&nbsp;</td>
 106          <td valign="top"><table border="0" cellpadding="0" cellspacing="0" summary="">
 107          
 108          <tr>
 109              <td><input name="newsletter_subscription[0]" id="nls0" type="checkbox" value="0" <?php if(isset($newsletter["newsletter_vars"]["subscription"][0]) && $newsletter["newsletter_vars"]["subscription"][0] == 0) echo ' checked="checked"'; ?> /></td>
 110              <td><label for="nls0"><?php echo $BL['be_newsletter_allsubscriptions']; ?></label></td>
 111          </tr>
 112          
 113  <?php
 114      //retrieve available subscription lists/channels
 115      
 116      $sql = "SELECT * FROM ".DB_PREPEND."phpwcms_subscription ORDER BY subscription_name";
 117      if($result = mysql_query($sql, $db)) {
 118          $i = '';
 119          while($row = mysql_fetch_row($result)) {
 120          
 121              $i .= '<tr><td><input name="newsletter_subscription['.$row[0].']" id="nls'.$row[0].'" type="checkbox" value="'.$row[0].'"';
 122              if(!empty($newsletter["newsletter_vars"]["subscription"]) && count($newsletter["newsletter_vars"]["subscription"])) {
 123                  foreach($newsletter["newsletter_vars"]["subscription"] as $value) {
 124                      if($value == $row[0]) {
 125                          $i .= ' checked="checked"';
 126                          break;
 127                      }
 128                  }
 129              }
 130              $i .= ' /></td><td><label for="nls'.$row[0].'">'.html_specialchars($row[1])."</label></td>\n</tr>\n";
 131          }
 132          mysql_free_result($result);
 133          echo $i;
 134      }
 135  ?>    
 136          
 137          </table></td>
 138      </tr>
 139      
 140      <tr><td colspan="2"><img src="img/leer.gif" alt="" width="1" height="8" /></td></tr>
 141  
 142  <?php
 143  
 144      // newsletter templates
 145      
 146      $BE['HEADER']['newsletter.form.js']        = getJavaScriptSourceLink('include/inc_js/newsletter.form.js');
 147      
 148      
 149      $tmpllist        = returnSubdirListAsArray(PHPWCMS_TEMPLATE.'inc_newsletter');
 150      $tmpldata        = array('options' => array(), 'js' => array(), 'files' => array() );
 151      $value3            = '';
 152      if(is_array($tmpllist) && count($tmpllist)) {
 153          if(empty($newsletter["newsletter_vars"]['template'])) {
 154              $newsletter["newsletter_vars"]['template'] = '';
 155          }
 156          $i = 0;
 157          foreach($tmpllist as $value) {
 158              $value1 = html_specialchars($value);
 159              $tmpldata['options'][$i]  = '<option value="'.$value1.'"';
 160              if($value == $newsletter["newsletter_vars"]['template']) {
 161                  $tmpldata['options'][$i] .= ' selected="selected"';
 162                  $value3 = $value;
 163              }
 164              $tmpldata['options'][$i] .= '>'.$value1.'</option>'.LF;
 165              $tmpldata['files'][$i] = returnFileListAsArray(PHPWCMS_TEMPLATE.'inc_newsletter/'.$value);
 166              
 167              // chech against tmpl file
 168              if(isset($tmpldata['files'][$i]['newsletter.tmpl'])) {
 169                  $value2 = @file_get_contents(PHPWCMS_TEMPLATE.'inc_newsletter/'.$value.'/newsletter.tmpl');
 170                  $value2 = get_tmpl_section('NEWSLETTER_SETTINGS', $value2);
 171                  $value2 = parse_ini_str($value2, false);
 172                  if(empty($value2['title']))         $value2['title'] = '';
 173                  if(empty($value2['description']))     $value2['description'] = '';
 174              } else {
 175                  $value2 = array('title'=>'', 'description'=>'');
 176              }
 177              
 178              $tmpldata['js'][] = '  nltemplate["'.$value.'"] = new Array();';
 179              $tmpldata['js'][] = '  nltemplate["'.$value.'"]["title"] = "'.js_singlequote($value2['title']).'";';
 180              $tmpldata['js'][] = '  nltemplate["'.$value.'"]["description"] = "'.js_singlequote($value2['description']).'";';
 181              
 182              $value2 = '';
 183              // set preview image
 184              if(isset($tmpldata['files'][$i]['preview.gif'])) {
 185                  $value2 = 'preview.gif';
 186              } elseif(isset($tmpldata['files'][$i]['preview.jpg'])) {
 187                  $value2 = 'preview.jpg';
 188              } elseif(isset($tmpldata['files'][$i]['preview.png'])) {
 189                  $value2 = 'preview.png';
 190              }
 191              if($value2) {
 192                  $tmpldata['js'][] = '  nltemplate["'.$value.'"]["imgsrc"] = "'.js_singlequote(TEMPLATE_PATH.'inc_newsletter/'.$value.'/'.$value2).'";';
 193              }
 194              
 195              $i++;
 196          }
 197      }
 198  
 199  ?>                      
 200      <tr>
 201          <td align="right" class="chatlist"><?php echo $BL['be_admin_struct_template'] ?>:&nbsp;</td>
 202          <td><select name="newsletter_template" id="newsletter_template" class="f11" onchange="showNewsletterTemplateData(this.options[this.selectedIndex].value);">
 203              <option value=""<?php if(empty($newsletter["newsletter_vars"]['template'])) echo ' selected="selected"' ?>><?php echo $BL['be_admin_tmpl_default'].' ('.$BL['be_func_struct_empty'].')' ?></option>
 204              <?php echo implode($tmpldata['options']) ?>
 205          </select></td>
 206      </tr>
 207      
 208      <tr>
 209          <td><img src="img/leer.gif" alt="" width="1" height="3" /></td>
 210          <td id="newsletterTemplateInfo" style="padding:4px 0 4px 0"><img src="img/leer.gif" alt="" width="1" height="3" /></td>
 211      </tr>
 212      
 213      <tr><td colspan="2"><img src="img/leer.gif" alt="" width="1" height="4" /></td></tr>
 214      <tr><td colspan="2" bgcolor="#d9dee3"><img src="img/leer.gif" alt="" width="1" height="1" /></td></tr>
 215      <tr><td colspan="2"><img src="img/leer.gif" alt="" width="1" height="5" /></td></tr>
 216  
 217      <tr><td colspan="2" style="padding-left:2px">
 218  <script language="javascript" type="text/javascript">
 219  <!--
 220  
 221    nltemplate = new Array();
 222  <?php
 223      echo implode(LF, $tmpldata['js']).LF;
 224      echo '  showNewsletterTemplateData("'.$value3.'");';    
 225  ?>
 226  
 227  //-->
 228  </script>
 229  <!--
 230  <div id="messageclose" class="chatlist">
 231      <a href="#" onclick="hideLayer('messageclose');showLayer('messageopen'); return false;"><img src="img/symbols/icon_minicategory_12x9_1.gif" alt="<?php echo $BL['be_func_struct_open'] ?>" name="switchit" border="0" id="switchit" /><strong style="margin-left:5px"><?php echo $BL['be_newsletter_open'] ?></strong></a> <?php echo $BL['be_newsletter_open1'] ?>
 232  </div>
 233      
 234  <div id="messageopen" style="display:none">
 235      <div class="chatlist">
 236          <a href="#" onclick="hideLayer('messageopen');showLayer('messageclose');return false;"><img src="img/symbols/icon_minicategory_12x9_2.gif" alt="<?php echo $BL['be_func_struct_close'] ?>" name="switchit" border="0" id="switchit" /><strong style="margin-left:5px"><?php echo $BL['be_newsletter_open'] ?></strong></a> <?php echo $BL['be_newsletter_open1'] ?>
 237      </div>
 238  //-->
 239  <table width="100%" border="0" cellpadding="0" cellspacing="0" summary="">
 240      <tr><td class="chatlist"><?php echo $BL['be_newsletter_htmlpart'] ?>:</td></tr>
 241      <tr><td><img src="img/leer.gif" alt="" width="1" height="1" /></td></tr>
 242      <tr>
 243          <td><?php
 244  
 245  $wysiwyg_editor = array(
 246      'value'        => $newsletter["newsletter_vars"]['html'],
 247      'field'        => 'newsletter_html',
 248      'height'    => '350px',
 249      'width'        => '536px',
 250      'rows'        => '20',
 251      'editor'    => $_SESSION["WYSIWYG_EDITOR"],
 252      'lang'        => 'en'
 253  );
 254  include (PHPWCMS_ROOT.'/include/inc_lib/wysiwyg.editor.inc.php');
 255  
 256  ?></td></tr>
 257  
 258      <tr><td><img src="img/leer.gif" alt="" width="1" height="5" /></td>
 259      </tr>
 260      <tr><td class="chatlist"><?php echo $BL['be_newsletter_textpart'] ?>:</td></tr>
 261      <tr><td><img src="img/leer.gif" alt="" width="1" height="1" /></td></tr>
 262      <tr><td><textarea name="newsletter_text" rows="25" wrap="off" class="code" style="width:536px;height:200px;background-color:#ffffff;"><?php echo html_specialchars($newsletter["newsletter_vars"]['text']) ?></textarea></td></tr>
 263  
 264      </table>
 265      <!-- </div> --></td>
 266      </tr>
 267      
 268      <tr><td colspan="2"><img src="img/leer.gif" alt="" width="1" height="4" /></td></tr>
 269      <tr>
 270          <td colspan="2" class="v10"><span class="chatlist"><?php echo $BL['be_newsletter_placeholder'] ?>:</span> 
 271              ###RECIPIENT_NAME###, 
 272              ###RECIPIENT_EMAIL###,
 273              ###VERIFY_LINK###, 
 274              ###DELETE_LINK###, 
 275              ###SITE_URL###
 276          </td>
 277      </tr>
 278  
 279      <tr><td colspan="2"><img src="img/leer.gif" alt="" width="1" height="5" /></td></tr>
 280      <tr><td colspan="2" bgcolor="#d9dee3"><img src="img/leer.gif" alt="" width="1" height="1" /></td></tr>
 281      <tr><td colspan="2"><img src="img/leer.gif" alt="" width="1" height="8" /></td></tr>
 282      
 283      <tr>
 284          <td align="right" class="chatlist" valign="top" style="padding-top: 3px;"><?php echo $BL['be_ftptakeover_status'] ?>:&nbsp;</td>
 285          <td valign="top"><table border="0" cellpadding="0" cellspacing="0" summary="">
 286          
 287          <tr>
 288              <td valign="top"><input name="newsletter_active" id="newsletter_active" type="checkbox" value="1"<?php is_checked(1, $newsletter["newsletter_active"]); ?> /></td>
 289              <td style="padding-top: 2px;"><label for="newsletter_active"><strong><?php echo $BL['be_cnt_newsletter_prepare'] ?></strong><br /><span class="v10"><?php echo $BL['be_cnt_newsletter_prepare1'] ?></span></label></td>
 290          </tr>
 291  
 292          </table></td>
 293      </tr>
 294  
 295  
 296  
 297      <tr><td colspan="2"><img src="img/leer.gif" alt="" width="1" height="15" /></td></tr>
 298      <tr>
 299          <td>&nbsp;</td>
 300          <td>
 301          <input name="newsletter_id" type="hidden" value="<?php echo $newsletter["newsletter_id"] ?>" />
 302          <div id="newsletterButtons">
 303          <input name="submit" type="submit" class="button10" value="<?php echo empty($newsletter["newsletter_id"]) ? $BL['be_article_cnt_button2'] : $BL['be_article_cnt_button1'] ?>" />
 304          &nbsp;
 305          <input name="close" type="submit" class="button10" value="<?php echo $BL['be_article_cnt_button3'] ?>" />
 306          &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 307          <input type="button" class="button10" value="<?php echo $BL['be_newsletter_button_cancel'] ?>" onclick="location.href='phpwcms.php?do=messages&amp;p=3';" />
 308          </div>
 309          <div id="statusMessage"><img src="img/indicator/indicator_arrows_green.gif" alt="Indicator" width="16" height="16" class="icon" /><p><?php echo $BL['be_cnt_newsletter_prepare2'] ?></p></div></td></tr>
 310      <tr><td colspan="2"><img src="img/leer.gif" alt="" width="1" height="8" /></td>
 311      </tr>
 312  
 313  
 314  </table>
 315  </form>


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