linea21-core
[ class tree: linea21-core ] [ index: linea21-core ] [ all elements ]

Source for file tpl_message.php

Documentation is available at tpl_message.php

  1. <?php
  2. /**
  3.  * @package linea21.core
  4.  * @subpackage public
  5.  * @author linea21 <info@linea21.com>
  6.  * @version $id SVN
  7.  * @access public
  8.  * @license http://opensource.org/licenses/gpl-3.0.html
  9.  */
  10. ?>
  11.  
  12. <?php
  13. ifActiveItemKey($GLOBALS['activeitem']=='comment-unsubscribe'{
  14.   // set HTML Title
  15.   SetHTMLTitle(_t('comment','unsubscribe_title'));
  16.   setBreadcrumb(array(_t('comment','unsubscribe_title'=> false));
  17.   $a['module']$_GET['name'];
  18.   $a['module_id']$_GET['id'];
  19.   $a['email']$_GET['email'];
  20.   include_once('../class/class.comment.php');
  21.   $comm new comment;
  22.   $r $comm->unsubsribe($a$GLOBALS['sql_object']);
  23.   
  24.   $item $comm->getCommentItem($a$GLOBALS['sql_object']);
  25.   $itemM itemMapping($a['module']);
  26.  
  27.   $full_item $item[0]['item_title'.' ('.$itemM['name'].')';
  28.   
  29.   echo '<h1>'._t('comment','unsubscribe_title').'</h1>'.END_LINE;
  30.   if($r === true{
  31.     echo '<div class="confirm">'.END_LINE;
  32.     echo $full_item ' : ' ._t('comment','unsubscribe_successful').END_LINE;
  33.     echo '</div>'.END_LINE;
  34.   }
  35.  
  36. }
  37.  
  38.  
  39. ifActiveItemKey($GLOBALS['activeitem']=='subscribe-newsletter'{
  40.   // set HTML Title
  41.   SetHTMLTitle(_t('newsletter','subscribe_title'));
  42.   setBreadcrumb(array(_t('newsletter','subscribe_title'=> false));
  43.   include_once('../newsletter/subscribe.php');
  44.   echo '<h1>'._t('newsletter','subscribe_title').'</h1>'.END_LINE;
  45.   echo '<div class="sub-title">'.END_LINE;
  46.   echo _t('divers','newsletter_public_comment').END_LINE;
  47.   echo '</div>'.END_LINE;
  48.   if(isset($msg)) {
  49.     echo '<div class="'.$msg['code'].'">'.END_LINE;
  50.     echo $msg['string'].END_LINE;
  51.     echo '</div>'.END_LINE;
  52.   }
  53.  
  54. }
  55.  
  56. ifActiveItemKey($GLOBALS['activeitem']=='contact'{
  57.   // set HTML Title
  58.   SetHTMLTitle(_t('contact','contact_us'));
  59.   setBreadcrumb(array(_t('contact','contact_us'=> false));
  60.   include_once('../class/system/class.form.php');
  61.  
  62.   $name='';
  63.   $email='';
  64.   $subject='';
  65.   $body='';
  66.  
  67.   if(isset($_POST['name'])) {
  68.     $passed true;
  69.     $name=$_POST['name'];
  70.     $email=$_POST['email'];
  71.     $subject=$_POST['subject'];
  72.     $body=$_POST['body'];
  73.  
  74.     if(strlen($body)8{
  75.       $msg=sprintf(_t('contact','str_error')_t('contact''body'));
  76.       $class='error';
  77.       $passed false;
  78.     }
  79.     if(strlen($subject)3{
  80.       $msg=sprintf(_t('contact','str_error')_t('contact''subject'));
  81.       $class='error';
  82.       $passed false;
  83.     }
  84.     if(!validEmail($email)) {
  85.       $msg=sprintf(_t('contact','email_error')$email);
  86.       $class='error';
  87.       $passed false;
  88.     }
  89.     if(strlen($email)3{
  90.       $msg=sprintf(_t('contact','str_error')_t('contact''email'));
  91.       $class='error';
  92.       $passed false;
  93.     }
  94.     if(strlen($name)3{
  95.       $msg=sprintf(_t('contact','str_error')_t('contact''name'));
  96.       $class='error';
  97.       $passed false;
  98.     }
  99.     if($passed == true{
  100.       $class 'info';
  101.       $msg _t('contact''message_sent');
  102.       $email_dest SITE_MAIL;
  103.       $email_fromname $name;
  104.       $email_from $email;
  105.       $email_subject formatText($subject'2HTML'' - 'SITE_NAME;
  106.       $email_html_body formatText($body'2HTML');
  107.       $email_text_body strip_tags($email_html_body);
  108.       include_once(themePath('../mail/template.php'));
  109.     }
  110.   }
  111.  
  112.   echo '<h1>'._t('contact','contact_us').'</h1>'.END_LINE;
  113.   if(isset($passed)) echo '<div class="'.$class.'">'.$msg.'</div>'.END_LINE;
  114.  
  115.   if(!isset($passed|| $passed == false{
  116.     $form new genForm;
  117.     $form->startForm('index.php''#contactform');
  118.     $form->textInput('name'_t('contact''name')' : ''shorttextfield''labelised''title'10030false$namefalse);
  119.     $form->insertBR();
  120.     $form->textInput('email'_t('contact''email')' : ''shorttextfield''labelised''title'15030false$emailfalse);
  121.     $form->insertBR();
  122.     $form->textInput('subject'_t('contact''subject')' : ''shorttextfield''labelised''title'15030false$subjectfalse);
  123.     $form->insertBR();
  124.     $form->textareaInput('body',ucfirst(_t('contact''body')) .' : ',false,'labelised'false$body6010);
  125.     $form->insertBR();
  126.     $form->submitButton(false_t('btn''valid')true'submitbut');
  127.     $form->hiddenInput('rub'$_REQUEST['rub']);
  128.     $form->closeForm();
  129.     if(!$output $form->getForm()) die("error: " $form->error)}
  130.     else echo $output}
  131.   }
  132. }
  133.  
  134. if(ActiveItemKey($GLOBALS['activeitem']=='css-switch'{
  135.   include_once(themePath('../lib/styleswitcher.php'));
  136.   if(isset($msg)) {
  137.     echo '<div class="'.$msg['code'].'">';
  138.     echo $msg['string'];
  139.     echo '</div>';
  140.   }
  141. }
  142. ?>

Documentation generated on Thu, 03 May 2012 15:07:56 +0200 by phpDocumentor 1.4.1