- md5
- da00bea3f11bce85f263024bf1529ef5
- sha1
- a2aae7689c0741015fc98d3b38ff1741f2191a66
- sha256
- 767873a38f030ea10e19c07d16f5287a468e867637ae45913e057c00586db630
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
<?php
/**
* @package Joomla.Site
* @subpackage com_mailto
*
* @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace Joomla\Component\Mailto\Site\View\Mailto;
defined('_JEXEC') or die;
use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView;
/**
* Class for Mail.
*
* @since 1.5
*/
class HtmlView extends BaseHtmlView
{
/**
* Execute and display a template script.
*
* @param string $tpl The name of the template file to parse; automatically searches through the template paths.
*
* @return mixed A string if successful, otherwise an Error object.
*
* @since 1.5
*/
public function display($tpl = null)
{
$data = $this->getData();
if ($data === false)
{
return false;
}
$this->set('data', $data);
return parent::display($tpl);
}
/**
* Get the form data
*
* @return object|false
*
* @since 1.5
*/
protected function getData()
{
$user = \JFactory::getUser();
$app = \JFactory::getApplication();
$data = new \stdClass;
$input = $app->input;
$method = $input->getMethod();
$data->link = urldecode($input->$method->get('link', '', 'BASE64'));
if ($data->link == '')
{
throw new \Exception(\JText::_('COM_MAILTO_LINK_IS_MISSING'), 400);
}
// Load with previous data, if it exists
$mailto = $app->input->post->getString('mailto', '');
$sender = $app->input->post->getString('sender', '');
$from = $app->input->post->getString('from', '');
$subject = $app->input->post->getString('subject', '');
if ($user->get('id') > 0)
{
$data->sender = $user->get('name');
$data->from = $user->get('email');
}
else
{
$data->sender = $sender;
$data->from = \JStringPunycode::emailToPunycode($from);
}
$data->subject = $subject;
$data->mailto = \JStringPunycode::emailToPunycode($mailto);
return $data;
}
}
No other release has this exact content. See every version of this file.