You've already forked joomla_test
first commit
This commit is contained in:
1
components/com_mailto/views/mailto/index.html
Normal file
1
components/com_mailto/views/mailto/index.html
Normal file
@ -0,0 +1 @@
|
||||
<!DOCTYPE html><title></title>
|
2
components/com_mailto/views/mailto/metadata.xml
Normal file
2
components/com_mailto/views/mailto/metadata.xml
Normal file
@ -0,0 +1,2 @@
|
||||
<?xml version="1.0"?>
|
||||
<metadata />
|
76
components/com_mailto/views/mailto/tmpl/default.php
Normal file
76
components/com_mailto/views/mailto/tmpl/default.php
Normal file
@ -0,0 +1,76 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Site
|
||||
* @subpackage com_mailto
|
||||
*
|
||||
* @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
JHtml::_('behavior.keepalive');
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
Joomla.submitbutton = function(pressbutton)
|
||||
{
|
||||
var form = document.getElementById('mailtoForm');
|
||||
|
||||
// do field validation
|
||||
if (form.mailto.value == "" || form.from.value == "")
|
||||
{
|
||||
alert('<?php echo JText::_('COM_MAILTO_EMAIL_ERR_NOINFO'); ?>');
|
||||
return false;
|
||||
}
|
||||
form.submit();
|
||||
}
|
||||
</script>
|
||||
<?php
|
||||
$data = $this->get('data');
|
||||
?>
|
||||
|
||||
<div id="mailto-window">
|
||||
<h2>
|
||||
<?php echo JText::_('COM_MAILTO_EMAIL_TO_A_FRIEND'); ?>
|
||||
</h2>
|
||||
<div class="mailto-close">
|
||||
<a href="javascript: void window.close()" title="<?php echo JText::_('COM_MAILTO_CLOSE_WINDOW'); ?>">
|
||||
<span><?php echo JText::_('COM_MAILTO_CLOSE_WINDOW'); ?> </span></a>
|
||||
</div>
|
||||
|
||||
<form action="<?php echo JUri::base() ?>index.php" id="mailtoForm" method="post">
|
||||
<div class="formelm">
|
||||
<label for="mailto_field"><?php echo JText::_('COM_MAILTO_EMAIL_TO'); ?></label>
|
||||
<input type="text" id="mailto_field" name="mailto" class="inputbox" size="25" value="<?php echo $this->escape($data->mailto); ?>"/>
|
||||
</div>
|
||||
<div class="formelm">
|
||||
<label for="sender_field">
|
||||
<?php echo JText::_('COM_MAILTO_SENDER'); ?></label>
|
||||
<input type="text" id="sender_field" name="sender" class="inputbox" value="<?php echo $this->escape($data->sender); ?>" size="25" />
|
||||
</div>
|
||||
<div class="formelm">
|
||||
<label for="from_field">
|
||||
<?php echo JText::_('COM_MAILTO_YOUR_EMAIL'); ?></label>
|
||||
<input type="text" id="from_field" name="from" class="inputbox" value="<?php echo $this->escape($data->from); ?>" size="25" />
|
||||
</div>
|
||||
<div class="formelm">
|
||||
<label for="subject_field">
|
||||
<?php echo JText::_('COM_MAILTO_SUBJECT'); ?></label>
|
||||
<input type="text" id="subject_field" name="subject" class="inputbox" value="<?php echo $this->escape($data->subject); ?>" size="25" />
|
||||
</div>
|
||||
<p>
|
||||
<button class="button" onclick="return Joomla.submitbutton('send');">
|
||||
<?php echo JText::_('COM_MAILTO_SEND'); ?>
|
||||
</button>
|
||||
<button class="button" onclick="window.close();return false;">
|
||||
<?php echo JText::_('COM_MAILTO_CANCEL'); ?>
|
||||
</button>
|
||||
</p>
|
||||
<input type="hidden" name="layout" value="<?php echo $this->getLayout();?>" />
|
||||
<input type="hidden" name="option" value="com_mailto" />
|
||||
<input type="hidden" name="task" value="send" />
|
||||
<input type="hidden" name="tmpl" value="component" />
|
||||
<input type="hidden" name="link" value="<?php echo $data->link; ?>" />
|
||||
<?php echo JHtml::_('form.token'); ?>
|
||||
|
||||
</form>
|
||||
</div>
|
1
components/com_mailto/views/mailto/tmpl/index.html
Normal file
1
components/com_mailto/views/mailto/tmpl/index.html
Normal file
@ -0,0 +1 @@
|
||||
<!DOCTYPE html><title></title>
|
75
components/com_mailto/views/mailto/view.html.php
Normal file
75
components/com_mailto/views/mailto/view.html.php
Normal file
@ -0,0 +1,75 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Site
|
||||
* @subpackage com_mailto
|
||||
*
|
||||
* @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
/**
|
||||
* @package Joomla.Site
|
||||
* @subpackage com_mailto
|
||||
* @since 1.5
|
||||
*/
|
||||
class MailtoViewMailto extends JViewLegacy
|
||||
{
|
||||
/**
|
||||
* @since 1.5
|
||||
*/
|
||||
public function display($tpl = null)
|
||||
{
|
||||
$data = $this->getData();
|
||||
if ($data === false)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
$this->set('data', $data);
|
||||
|
||||
parent::display($tpl);
|
||||
}
|
||||
|
||||
/**
|
||||
* @since 1.5
|
||||
*/
|
||||
function &getData()
|
||||
{
|
||||
$user = JFactory::getUser();
|
||||
$app = JFactory::getApplication();
|
||||
$data = new stdClass;
|
||||
|
||||
$data->link = urldecode(JRequest::getVar('link', '', 'method', 'base64'));
|
||||
|
||||
if ($data->link == '')
|
||||
{
|
||||
JError::raiseError(403, JText::_('COM_MAILTO_LINK_IS_MISSING'));
|
||||
$false = false;
|
||||
return $false;
|
||||
}
|
||||
|
||||
// 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;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user