[ Index ]

PHP Cross Reference of Joomla 1.5.26 DE

title

Body

[close]

/components/com_mailto/views/mailto/ -> view.html.php (source)

   1  <?php
   2  /**
   3   * @version        $Id: view.html.php 14401 2010-01-26 14:10:00Z louis $
   4   * @package        Joomla
   5   * @subpackage    MailTo
   6   * @copyright    Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved.
   7   * @license        GNU/GPL, see LICENSE.php
   8   * Joomla! is free software. This version may have been modified pursuant to the
   9   * GNU General Public License, and as distributed it includes or is derivative
  10   * of works licensed under the GNU General Public License or other free or open
  11   * source software licenses. See COPYRIGHT.php for copyright notices and
  12   * details.
  13   */
  14  
  15  // Check to ensure this file is included in Joomla!
  16  defined('_JEXEC') or die( 'Restricted access' );
  17  
  18  jimport('joomla.application.component.view');
  19  
  20  class MailtoViewMailto extends JView
  21  {
  22  	function display($tpl = null)
  23      {
  24          $data = $this->getData();
  25          if ($data === false) {
  26              return false;
  27          }
  28  
  29          $this->set('data'  , $data);
  30  
  31          parent::display($tpl);
  32      }
  33  
  34      function &getData()
  35      {
  36          $user =& JFactory::getUser();
  37          $data = new stdClass();
  38  
  39          $data->link = urldecode( JRequest::getVar( 'link', '', 'method', 'base64' ) );
  40  
  41          if ($data->link == '') {
  42              JError::raiseError( 403, 'Link is missing' );
  43              $false = false;
  44              return $false;
  45          }
  46  
  47          // Load with previous data, if it exists
  48          $mailto                = JRequest::getString('mailto', '', 'post');
  49          $sender             = JRequest::getString('sender', '', 'post');
  50          $from                 = JRequest::getString('from', '', 'post');
  51          $subject             = JRequest::getString('subject', '', 'post');
  52  
  53          if ($user->get('id') > 0) {
  54              $data->sender    = $user->get('name');
  55              $data->from        = $user->get('email');
  56          }
  57          else
  58          {
  59              $data->sender    = $sender;
  60              $data->from        = $from;
  61          }
  62  
  63          $data->subject    = $subject;
  64          $data->mailto    = $mailto;
  65  
  66          return $data;
  67      }
  68  }


Generated: Wed Mar 28 15:54:07 2012 Cross-referenced by PHPXref 0.7.1