[ Index ]
 

Code source de eGroupWare 1.2.106-2

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/sitemgr/modules/ -> class.module_notify.inc.php (source)

   1  <?php
   2      /**************************************************************************\
   3      * eGroupWare SiteMgr - Web Content Management                              *
   4      * http://www.egroupware.org                                                *
   5      * --------------------------------------------                             *
   6      *  This program is free software; you can redistribute it and/or modify it *
   7      *  under the terms of the GNU General Public License as published by the   *
   8      *  Free Software Foundation; either version 2 of the License, or (at your  *
   9      *  option) any later version.                                              *
  10      \**************************************************************************/
  11  
  12      /* $Id: class.module_notify.inc.php 20295 2006-02-15 12:31:25Z  $ */
  13  
  14      class module_notify extends Module
  15      {
  16  		function module_notify()
  17          {
  18              $this->post = array(
  19                  'email' => array('type' => 'textfield'),
  20                  'unsubscribe' => array('type'=>'checkbox'),
  21                  'all_langs' => array('type'=>'checkbox')
  22              );
  23  
  24              $this->properties = array();
  25              $this->arguments = array();
  26              $this->title = lang('Update Notification');
  27              $this->description = lang('Enter the email to be notified about changes of the website.');
  28          }
  29  
  30  		function prepare(&$data)
  31          {
  32              if (isset($data['email']))
  33              {
  34                  $bo=CreateObject("sitemgr.notification_bo");
  35                  if (isset($data['unsubscribe'])) {
  36                      $bo->delete_notifications($data['email']);
  37                      return $data['email']." has been successfully unsubscribed from notifications about changes of this site.";
  38                  }
  39                  $bo->create_notification($data['email'],isset($data['all_langs']));
  40                  
  41                  return $data['email']." has been successfully subscribed to notifications about changes of this site.";
  42              }
  43              return FALSE;
  44          }
  45          
  46  		function get_content(&$arguments,$properties)
  47          {
  48  
  49              $content=$this->prepare($arguments);
  50              if (!$content) {
  51                  $content = '<form method="post">'."\n";
  52                  $content .= lang('Enter the email to be notified about changes of the website:').'<br />'."\n";
  53                  $content .= $this->build_post_element('email','')."\n";
  54                  $content .= '<div style="margin-top: 5px;">'."\n";
  55                  $content .= $this->build_post_element('unsubscribe','').lang('Unsubscribe')."\n";  
  56  
  57                  //allow subscribing to all languages only if there are more of them
  58                  if (strpos($GLOBALS['sitemgr_info']['site_languages'],',')!=FALSE) {
  59                      $content .= "<br/>".$this->build_post_element('all_langs','').lang('All languages')."\n";  
  60                  }
  61                  $content .= '</div>'."\n";
  62                  $content .= '</form>'."\n";
  63              }
  64              
  65              return $content;
  66          }
  67      }


Généré le : Sun Feb 25 17:20:01 2007 par Balluche grâce à PHPXref 0.7