primo commit

This commit is contained in:
2024-12-17 17:34:10 +01:00
commit e650f8df99
16435 changed files with 2451012 additions and 0 deletions

View File

@ -0,0 +1 @@
<html><body bgcolor="#FFFFFF"></body></html>

View File

@ -0,0 +1 @@
<html><body bgcolor="#FFFFFF"></body></html>

View File

@ -0,0 +1,26 @@
<?php
/**
* Attachments component
*
* @package Attachments
* @subpackage Attachments_Component
*
* @copyright Copyright (C) 2007-2018 Jonathan M. Cameron, All Rights Reserved
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU/GPL
* @link http://joomlacode.org/gf/project/attachments/frs/
* @author Jonathan M. Cameron
*/
// No direct access
defined('_JEXEC') or die('Restricted access');
?>
<div class="requestLogin">
<?php if ($this->logged_in): ?>
<h1><?php echo JText::_('ATTACH_WARNING_YOU_ARE_ALREADY_LOGGED_IN'); ?></h1>
<?php else: ?>
<h1><?php echo $this->must_be_logged_in; ?></h1>
<h2><a href="<?php echo $this->login_url; ?>"><?php echo $this->login_label; ?></a></h2>
<h2><a href="<?php echo $this->register_url; ?>"><?php echo $this->register_label; ?></a></h2>
<?php endif; ?>
</div>

View File

@ -0,0 +1 @@
<html><body bgcolor="#FFFFFF"></body></html>

View File

@ -0,0 +1,75 @@
<?php
/**
* Attachments component
*
* @package Attachments
* @subpackage Attachments_Component
*
* @copyright Copyright (C) 2007-2018 Jonathan M. Cameron, All Rights Reserved
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU/GPL
* @link http://joomlacode.org/gf/project/attachments/frs/
* @author Jonathan M. Cameron
*/
// no direct access
defined( '_JEXEC' ) or die('Restricted access');
/** Define the legacy classes, if necessary */
require_once(JPATH_SITE.'/components/com_attachments/legacy/view.php');
/**
* HTML View class for asking the user to log in
*
* @package Attachments
*/
class AttachmentsViewLogin extends JViewLegacy
{
/**
* Display the login view
*/
public function display($tpl = null)
{
// Add the stylesheets
JHtml::stylesheet('com_attachments/attachments_frontend_form.css', array(), true);
$lang = JFactory::getLanguage();
if ( $lang->isRTL() ) {
JHtml::stylesheet('com_attachments/attachments_frontend_form_rtl.css', array(), true);
}
// Is the user already logged in?
$user = JFactory::getUser();
$this->logged_in = $user->get('username') <> '';
// Get the component parameters for the registration and login URL
jimport('joomla.application.component.helper');
$params = JComponentHelper::getParams('com_attachments');
$base_url = JFactory::getURI()->base(false);
$register_url = $params->get('register_url', 'index.php?option=com_users&view=registration');
$register_url = JRoute::_($base_url . $register_url);
$this->register_url = $register_url;
// Construct the login URL
$return = '';
if ( $this->return_url ) {
$return = '&return=' . $this->return_url;
}
$base_url = JFactory::getURI()->base(false);
$login_url = $params->get('login_url', 'index.php?option=com_users&view=login') . $return;
$this->login_url = JRoute::_($base_url . $login_url);
// Get the warning message
$this->must_be_logged_in = JText::_('ATTACH_WARNING_MUST_LOGIN_TO_DOWNLOAD_ATTACHMENT');
// Get a phrase from the login module to create the account
$lang->load('com_users');
$register = JText::_('COM_USERS_REGISTER_DEFAULT_LABEL');
$this->register_label = $register;
$login = JText::_('JLOGIN');
$this->login_label = $login;
parent::display($tpl);
}
}

View File

@ -0,0 +1 @@
<html><body bgcolor="#FFFFFF"></body></html>

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8" ?>
<metadata>
<view title="ATTACH_UPDATE_DO_NOT_ATTACH_TO_MENU_ITEM" hidden="true">
</view>
</metadata>

View File

@ -0,0 +1,262 @@
<?php
/**
* Attachments component
*
* @package Attachments
* @subpackage Attachments_Component
*
* @copyright Copyright (C) 2007-2018 Jonathan M. Cameron, All Rights Reserved
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU/GPL
* @link http://joomlacode.org/gf/project/attachments/frs/
* @author Jonathan M. Cameron
*/
// No direct access
defined('_JEXEC') or die('Restricted access');
// Add the plugins stylesheet to style the list of attachments
$user = JFactory::getUser();
$document = JFactory::getDocument();
$app = JFactory::getApplication();
$uri = JFactory::getURI();
$lang = JFactory::getLanguage();
// For convenience
$attachment = $this->attachment;
$params = $this->params;
$update = $this->update;
$parent_id = $attachment->parent_id;
if ( $parent_id === null ) {
$parent_id = 0;
}
// set up URL redisplay in case of errors
$old_url = '';
if ( $this->error_msg && ($update == 'url') ) {
$old_url = $attachment->url;
}
// Decide what type of update to do
if ( $update == 'file' ) {
$enctype = "enctype=\"multipart/form-data\"";
}
else {
$enctype = '';
}
// Prepare for error displays
$update_id = 'upload';
$filename = $attachment->filename;
if ( $this->error ) {
switch ( $this->error ) {
case 'no_file':
$update_id = 'upload_warning';
$filename = '';
break;
case 'file_too_big':
$upload_id = 'upload_warning';
break;
case 'file_already_on_server':
$upload_id = 'upload_warning';
break;
}
}
// Format modified date
jimport( 'joomla.utilities.date' );
$tz = new DateTimeZone( $user->getParam('timezone', $app->getCfg('offset')) );
$mdate = JFactory::getDate($attachment->modified);
$mdate->setTimezone($tz);
$date_format = $params->get('date_format', 'Y-m-d H:i');
$last_modified = $mdate->format($date_format, true);
// If this is an error re-display, display the CSS links directly
$echo_css = $this->error;
/** Load the Attachments helper */
require_once(JPATH_SITE.'/components/com_attachments/helper.php');
require_once(JPATH_SITE.'/components/com_attachments/javascript.php');
// Add the stylesheets
$uri = JFactory::getURI();
AttachmentsJavascript::setupJavascript();
if ( $attachment->uri_type == 'file' ) {
$header_msg = JText::sprintf('ATTACH_UPDATE_ATTACHMENT_FILE_S', $filename);
}
else {
$header_msg = JText::sprintf('ATTACH_UPDATE_ATTACHMENT_URL_S', $attachment->url);
}
// If this is an error re-display, display the CSS links directly
if ( $this->error )
{
echo $this->startHTML();
}
?>
<div id="uploadAttachmentsPage">
<h1><?php echo $header_msg; ?></h1>
<form class="attachments" <?php echo $enctype ?> name="upload_form"
action="<?php echo $this->save_url; ?>" method="post">
<fieldset>
<legend><?php echo JText::sprintf('ATTACH_UPDATE_ATTACHMENT_FOR_PARENT_S_COLON_S',
$attachment->parent_entity_name, $attachment->parent_title); ?></legend>
<?php if ( $this->error_msg ): ?>
<div class="formWarning" id="formWarning"><?php echo $this->error_msg; ?></div>
<?php endif; ?>
<?php if ( $update == 'file' ): ?>
<p><label for="<?php echo $update_id; ?>"><?php
echo JText::_('ATTACH_SELECT_NEW_FILE_IF_YOU_WANT_TO_UPDATE_ATTACHMENT_FILE') ?></label>
<a class="changeButton" href="<?php echo $this->normal_update_url ?>"
title="<?php echo JText::_('ATTACH_NORMAL_UPDATE_TOOLTIP'); ?>"
><?php echo JText::_('ATTACH_NORMAL_UPDATE') ?></a> <br />
<input type="file" name="upload" id="<?php echo $update_id; ?>"
size="78" maxlength="1024" />
</p>
<?php elseif ( $update == 'url' ): ?>
<p><label for="<?php echo $update_id; ?>"><?php echo JText::_('ATTACH_ENTER_URL') ?></label>
&nbsp;&nbsp;&nbsp;&nbsp;
<label for="verify_url"><?php echo JText::_('ATTACH_VERIFY_URL_EXISTENCE') ?></label>
<input type="checkbox" name="verify_url" value="verify" <?php echo $this->verify_url_checked ?>
title="<?php echo JText::_('ATTACH_VERIFY_URL_EXISTENCE_TOOLTIP'); ?>" />
&nbsp;&nbsp;&nbsp;&nbsp;
<label for="relative_url"><?php echo JText::_('ATTACH_RELATIVE_URL') ?></label>
<input type="checkbox" name="relative_url" value="relative" <?php echo $this->relative_url_checked ?>
title="<?php echo JText::_('ATTACH_RELATIVE_URL_TOOLTIP'); ?>" />
<a class="changeButton" href="<?php echo $this->normal_update_url ?>"
title="<?php echo JText::_('ATTACH_NORMAL_UPDATE_TOOLTIP'); ?>"
><?php echo JText::_('ATTACH_NORMAL_UPDATE') ?></a> <br />
<input type="text" name="url" id="<?php echo $update_id; ?>"
size="80" maxlength="255" title="<?php echo JText::_('ATTACH_ENTER_URL_TOOLTIP'); ?>"
value="<?php echo $old_url; ?>" /><br /><?php
echo JText::_('ATTACH_NOTE_ENTER_URL_WITH_HTTP'); ?>
</p>
<?php else: ?>
<?php if ( $attachment->uri_type == 'file' ): ?>
<p><label><?php echo JText::_('ATTACH_FILENAME_COLON'); ?></label> <?php echo $filename; ?>
<a class="changeButton" href="<?php echo $this->change_file_url ?>"
title="<?php echo JText::_('ATTACH_CHANGE_FILE_TOOLTIP'); ?>"
><?php echo JText::_('ATTACH_CHANGE_FILE') ?></a>
<a class="changeButton" href="<?php echo $this->change_url_url ?>"
title="<?php echo JText::_('ATTACH_CHANGE_TO_URL_TOOLTIP'); ?>"
><?php echo JText::_('ATTACH_CHANGE_TO_URL') ?></a>
</p>
<?php elseif ( $attachment->uri_type == 'url' ): ?>
<p><label for="<?php echo $update_id; ?>"><?php echo JText::_('ATTACH_ENTER_NEW_URL_COLON') ?></label>
&nbsp;&nbsp;&nbsp;&nbsp;
<label for="verify_url"><?php echo JText::_('ATTACH_VERIFY_URL_EXISTENCE') ?></label>
<input type="checkbox" name="verify_url" value="verify" <?php echo $this->verify_url_checked ?>
title="<?php echo JText::_('ATTACH_VERIFY_URL_EXISTENCE_TOOLTIP'); ?>" />
&nbsp;&nbsp;&nbsp;&nbsp;
<label for="relative_url"><?php echo JText::_('ATTACH_RELATIVE_URL') ?></label>
<input type="checkbox" name="relative_url" value="relative" <?php echo $this->relative_url_checked ?>
title="<?php echo JText::_('ATTACH_RELATIVE_URL_TOOLTIP'); ?>" />
<a class="changeButton" href="<?php echo $this->change_file_url ?>"
title="<?php echo JText::_('ATTACH_CHANGE_TO_FILE_TOOLTIP'); ?>"
><?php echo JText::_('ATTACH_CHANGE_TO_FILE') ?></a> </p>
<p><label for="url_valid"><?php echo JText::_('ATTACH_URL_IS_VALID') ?></label>
<?php echo $this->lists['url_valid']; ?>
</p>
<p>
<input type="text" name="url" id="<?php echo $update_id ?>"
size="80" maxlength="255" title="<?php echo JText::_('ATTACH_ENTER_URL_TOOLTIP'); ?>"
value="<?php echo $attachment->url; ?>" /><br /><?php
echo JText::_('ATTACH_NOTE_ENTER_URL_WITH_HTTP'); ?>
<input type="hidden" name="old_url" value="<?php echo $old_url; ?>" />
</p>
<?php endif; ?>
<?php endif; ?>
<?php if ( (($attachment->uri_type == 'file') AND ($update == '') ) OR ($update == 'file') ): ?>
<p class="display_name"><label for="display_name"
title="<?php echo JText::_('ATTACH_DISPLAY_FILENAME_TOOLTIP'); ?>"
><?php echo JText::_('ATTACH_DISPLAY_FILENAME_OPTIONAL_COLON'); ?></label>
<input type="text" name="display_name" id="display_name"
size="70" maxlength="80"
title="<?php echo JText::_('ATTACH_DISPLAY_FILENAME_TOOLTIP'); ?>"
value="<?php echo $attachment->display_name; ?>" />
<input type="hidden" name="old_display_name" value="<?php echo $attachment->display_name; ?>" />
</p>
<?php elseif ( (($attachment->uri_type == 'url') AND ($update == '')) OR ($update == 'url') ): ?>
<p class="display_name"><label for="display_name"
title="<?php echo JText::_('ATTACH_DISPLAY_URL_TOOLTIP'); ?>"
><?php echo JText::_('ATTACH_DISPLAY_URL_COLON'); ?></label>
<input type="text" name="display_name" id="display_name"
size="70" maxlength="80"
title="<?php echo JText::_('ATTACH_DISPLAY_URL_TOOLTIP'); ?>"
value="<?php echo $attachment->display_name; ?>" />
<input type="hidden" name="old_display_name" value="<?php echo $attachment->display_name; ?>" />
</p>
<?php endif; ?>
<p><label for="description"><?php echo JText::_('ATTACH_DESCRIPTION_COLON'); ?></label>
<input type="text" name="description" id="description"
size="70" maxlength="255" value="<?php echo stripslashes($attachment->description) ?>" /></p>
<?php if ( $this->may_publish ): ?>
<div class="at_control"><label><?php echo JText::_('ATTACH_PUBLISHED'); ?></label><?php echo $this->lists['published']; ?></div>
<?php endif; ?>
<?php if ( $params->get('allow_frontend_access_editing', false) ): ?>
&nbsp;&nbsp;&nbsp;&nbsp;
<div class="at_control"><label for="access" title="<?php echo $this->access_level_tooltip; ?>"><? echo JText::_('ATTACH_ACCESS_COLON'); ?></label> <?php echo $this->access_level; ?></div>
<?php endif; ?>
<?php if ( $params->get('user_field_1_name') ): ?>
<p><label for="user_field_1"><?php echo $params->get('user_field_1_name'); ?>:</label>
<input type="text" name="user_field_1" id="user_field_1" size="70" maxlength="100"
value="<?php echo stripslashes($attachment->user_field_1); ?>" /></p>
<?php endif; ?>
<?php if ( $params->get('user_field_2_name') ): ?>
<p><label for="user_field_2"><?php echo $params->get('user_field_2_name'); ?>:</label>
<input type="text" name="user_field_2" id="user_field_2" size="70" maxlength="100"
value="<?php echo stripslashes($attachment->user_field_2); ?>" /></p>
<?php endif; ?>
<?php if ( $params->get('user_field_3_name') ): ?>
<p><label for="user_field_3"><?php echo $params->get('user_field_3_name'); ?>:</label>
<input type="text" name="user_field_3" id="user_field_3" size="70" maxlength="100"
value="<?php echo stripslashes($attachment->user_field_3); ?>" /></p>
<?php endif; ?>
<p><?php echo JText::sprintf('ATTACH_LAST_MODIFIED_ON_D_BY_S',
$last_modified, $attachment->modifier_name); ?></p>
</fieldset>
<input type="hidden" name="MAX_FILE_SIZE" value="524288" />
<input type="hidden" name="submitted" value="TRUE" />
<input type="hidden" name="id" value="<?php echo $attachment->id; ?>" />
<input type="hidden" name="save_type" value="update" />
<input type="hidden" name="update" value="<?php echo $update; ?>" />
<input type="hidden" name="uri_type" value="<?php echo $attachment->uri_type; ?>" />
<input type="hidden" name="new_parent" value="<?php echo $this->new_parent; ?>" />
<input type="hidden" name="parent_id" value="<?php echo $parent_id; ?>" />
<input type="hidden" name="parent_type" value="<?php echo $attachment->parent_type; ?>" />
<input type="hidden" name="parent_entity" value="<?php echo $attachment->parent_entity; ?>" />
<input type="hidden" name="from" value="<?php echo $this->from; ?>" />
<input type="hidden" name="Itemid" value="<?php echo $this->Itemid; ?>" />
<?php echo JHtml::_( 'form.token' ); ?>
<div class="form_buttons">
<input type="submit" name="submit" value="<?php echo JText::_('ATTACH_UPDATE'); ?>" />
<span class="right">
<input type="button" name="cancel" value="<?php echo JText::_('ATTACH_CANCEL'); ?>"
onClick="window.parent.SqueezeBox.close();" />
</span>
</div>
</form>
<?php
// Generate the list of existing attachments
if ( ($update == 'file') || ($attachment->uri_type == 'file') ) {
require_once(JPATH_SITE.'/components/com_attachments/controllers/attachments.php');
$controller = new AttachmentsControllerAttachments();
$controller->display($parent_id, $attachment->parent_type, $attachment->parent_entity,
'ATTACH_EXISTING_ATTACHMENTS',
false, false, true, $this->from);
}
echo '</div>';
if ( $this->error ) {
echo $this->endHTML();
}

View File

@ -0,0 +1 @@
<html><body bgcolor="#FFFFFF"></body></html>

View File

@ -0,0 +1,88 @@
<?php
/**
* Attachments component
*
* @package Attachments
* @subpackage Attachments_Component
*
* @copyright Copyright (C) 2007-2018 Jonathan M. Cameron, All Rights Reserved
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU/GPL
* @link http://joomlacode.org/gf/project/attachments/frs/
* @author Jonathan M. Cameron
*/
// No direct access
defined('_JEXEC') or die();
/** Define the legacy classes, if necessary */
require_once(JPATH_SITE.'/components/com_attachments/views/view.php');
/** Load the Attachments helper */
require_once(JPATH_SITE.'/components/com_attachments/helper.php');
/**
* View for the uploads
*
* @package Attachments
*/
class AttachmentsViewUpdate extends AttachmentsFormView
{
/**
* Display the view
*/
public function display($tpl=null)
{
// Access check.
if ( !(JFactory::getUser()->authorise('core.edit', 'com_attachments') OR
JFactory::getUser()->authorise('core.edit.own', 'com_attachments')) ) {
return JError::raiseError(404, JText::_('JERROR_ALERTNOAUTHOR') . ' (ERR 62)');
}
// For convenience
$attachment = $this->attachment;
$parent = $this->parent;
// Construct derived data
$attachment->parent_entity_name = JText::_('ATTACH_' . $attachment->parent_entity);
$attachment->parent_title = $parent->getTitle($attachment->parent_id, $attachment->parent_entity);
if (!isset($attachment->modifier_name))
{
AttachmentsHelper::addAttachmentUserNames($attachment);
}
$this->relative_url_checked = $attachment->url_relative ? 'checked="yes"' : '';
$this->verify_url_checked = $attachment->url_verify ? 'checked="yes"' : '';
$this->may_publish = $parent->userMayChangeAttachmentState($attachment->parent_id,
$attachment->parent_entity,
$attachment->created_by
);
// Set up some HTML for display in the form
$this->lists = Array();
$this->lists['published'] = JHtml::_('select.booleanlist', 'state',
'class="inputbox"', $attachment->state);
$this->lists['url_valid'] = JHtml::_('select.booleanlist', 'url_valid',
'class="inputbox" title="' . JText::_('ATTACH_URL_IS_VALID_TOOLTIP') . '"',
$attachment->url_valid);
// Set up for editing the access level
if ( $this->params->get('allow_frontend_access_editing', false) ) {
require_once(JPATH_COMPONENT_ADMINISTRATOR.'/models/fields/accesslevels.php');
$this->access_level = JFormFieldAccessLevels::getAccessLevels('access', 'access', $attachment->access);
$this->access_level_tooltip = JText::_('ATTACH_ACCESS_LEVEL_TOOLTIP');
}
// Add the stylesheets
JHtml::stylesheet('com_attachments/attachments_frontend_form.css', array(), true);
$lang = JFactory::getLanguage();
if ( $lang->isRTL() ) {
JHtml::stylesheet('com_attachments/attachments_frontend_form_rtl.css', array(), true);
}
// Display the form
parent::display($tpl);
}
}

View File

@ -0,0 +1 @@
<html><body bgcolor="#FFFFFF"></body></html>

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8" ?>
<metadata>
<view title="ATTACH_UPLOAD_DO_NOT_ATTACH_TO_MENU_ITEM" hidden="true">
</view>
</metadata>

View File

@ -0,0 +1,211 @@
<?php
/**
* Attachments component
*
* @package Attachments
* @subpackage Attachments_Component
*
* @copyright Copyright (C) 2007-2018 Jonathan M. Cameron, All Rights Reserved
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU/GPL
* @link http://joomlacode.org/gf/project/attachments/frs/
* @author Jonathan M. Cameron
*/
// No direct access
defined('_JEXEC') or die('Restricted access');
// Load the Attachments helper
require_once(JPATH_SITE.'/components/com_attachments/helper.php');
require_once(JPATH_SITE.'/components/com_attachments/javascript.php');
// Add the plugins stylesheet to style the list of attachments
$uri = JFactory::getURI();
// Add javascript
AttachmentsJavascript::setupJavascript();
AttachmentsJavascript::setupModalJavascript();
// For convenience
$attachment = $this->attachment;
$params = $this->params;
// Get the parent id and a few other convenience items
$parent_id = $attachment->parent_id;
if ( $parent_id === null ) {
$parent_id = 0;
}
// Set up to toggle between uploading file/urls
if ( $attachment->uri_type == 'file' ) {
$upload_toggle_button_text = JText::_('ATTACH_ENTER_URL_INSTEAD');
$upload_toggle_url = $this->upload_url_url;
$upload_button_text = JText::_('ATTACH_UPLOAD_VERB');
}
else {
$upload_toggle_button_text = JText::_('ATTACH_SELECT_FILE_TO_UPLOAD_INSTEAD');
$upload_toggle_url = $this->upload_file_url;
$upload_button_text = JText::_('ATTACH_ADD_URL');
}
// If this is for an existing content item, modify the URL appropriately
if ( $this->new_parent ) {
$upload_toggle_url .= "&amp;parent_id=0,new";
}
if ( JRequest::getWord('editor') ) {
$upload_toggle_url .= "&amp;editor=" . JRequest::getWord('editor');
}
// Needed URLs
$save_url = JRoute::_($this->save_url);
$base_url = $uri->root(true) . '/';
// Prepare for error displays
$upload_id = 'upload';
switch ( $this->error ) {
case 'no_file':
$upload_id = 'upload_warning';
break;
case 'file_too_big':
$upload_id = 'upload_warning';
break;
case 'file_already_on_server':
$upload_id = 'upload_warning';
break;
}
// If this is an error re-display, display the CSS links directly
if ( $this->error )
{
echo $this->startHTML();
}
// Display the form
?>
<div id="uploadAttachmentsPage">
<h1><?php echo JText::sprintf('ATTACH_FOR_PARENT_S_COLON_S', $attachment->parent_entity_name, $attachment->parent_title) ?></h1>
<form class="attachments" enctype="multipart/form-data" name="upload_form"
action="<?php echo $this->save_url; ?>" method="post">
<fieldset>
<legend><?php echo JText::_('ATTACH_UPLOAD_ATTACHMENT'); ?></legend>
<?php if ( $this->error_msg ): ?>
<div class="formWarning" id="formWarning"><?php echo $this->error_msg; ?></div>
<?php endif; ?>
<?php if ( $attachment->uri_type == 'file' ): ?>
<p><label for="<?php echo $upload_id ?>"><?php
echo JText::_('ATTACH_ATTACH_FILE_COLON') ?></label>
<a class="changeButton" href="<?php echo $upload_toggle_url ?>"><?php
echo $upload_toggle_button_text;?></a></p>
<p><input type="file" name="upload" id="<?php echo $upload_id; ?>"
size="78" maxlength="1024" /></p>
<p class="display_name"><label for="display_name"
title="<?php echo JText::_('ATTACH_DISPLAY_FILENAME_TOOLTIP'); ?>"
><?php echo JText::_('ATTACH_DISPLAY_FILENAME_OPTIONAL_COLON'); ?></label>
<input type="text" name="display_name" id="display_name"
size="70" maxlength="80"
title="<?php echo JText::_('ATTACH_DISPLAY_FILENAME_TOOLTIP'); ?>"
value="<?php echo $attachment->display_name; ?>" /></p>
<?php else: ?>
<p><label for="<?php echo $upload_id ?>"><?php
echo JText::_('ATTACH_ENTER_URL') ?></label>
&nbsp;&nbsp;&nbsp;&nbsp;
<label for="verify_url"><?php echo JText::_('ATTACH_VERIFY_URL_EXISTENCE') ?></label>
<input type="checkbox" name="verify_url" value="verify" <?php echo $this->verify_url_checked ?>
title="<?php echo JText::_('ATTACH_VERIFY_URL_EXISTENCE_TOOLTIP'); ?>" />
&nbsp;&nbsp;&nbsp;&nbsp;
<label for="relative_url"><?php echo JText::_('ATTACH_RELATIVE_URL') ?></label>
<input type="checkbox" name="relative_url" value="relative" <?php echo $this->relative_url_checked ?>
title="<?php echo JText::_('ATTACH_RELATIVE_URL_TOOLTIP'); ?>" />
<a class="changeButton" href="<?php echo $upload_toggle_url ?>"><?php
echo $upload_toggle_button_text;?></a><br />
<input type="text" name="url" id="<?php echo $upload_id; ?>"
size="80" maxlength="255" title="<?php echo JText::_('ATTACH_ENTER_URL_TOOLTIP'); ?>"
value="<?php echo $attachment->url; ?>" /><br /><?php
echo JText::_('ATTACH_NOTE_ENTER_URL_WITH_HTTP'); ?></p>
<p class="display_name"><label for="display_name"
title="<?php echo JText::_('ATTACH_DISPLAY_URL_TOOLTIP'); ?>"
><?php echo JText::_('ATTACH_DISPLAY_URL_COLON'); ?></label>
<input type="text" name="display_name" id="display_name"
size="70" maxlength="80"
title="<?php echo JText::_('ATTACH_DISPLAY_URL_TOOLTIP'); ?>"
value="<?php echo $attachment->display_name; ?>" /></p>
<?php endif; ?>
<p><label for="description"><?php echo JText::_('ATTACH_DESCRIPTION_COLON'); ?></label>
<input type="text" name="description" id="description"
size="70" maxlength="255"
value="<?php echo stripslashes($attachment->description); ?>" /></p>
<?php if ( $this->may_publish ): ?>
<div class="at_control"><label><?php echo JText::_('ATTACH_PUBLISHED'); ?></label><?php echo $this->publish; ?></div>
<?php endif; ?>
<?php if ( $params->get('allow_frontend_access_editing', false) ): ?>
&nbsp;&nbsp;&nbsp;&nbsp;
<div class="at_control"><label for="access" title="<?php echo $this->access_level_tooltip; ?>"><? echo JText::_('ATTACH_ACCESS_COLON'); ?></label> <?php echo $this->access_level; ?></div>
<?php endif; ?>
<?php if ( $params->get('user_field_1_name', false) ): ?>
<p><label for="user_field_1"><?php echo $params->get('user_field_1_name'); ?>:</label>
<input type="text" name="user_field_1" id="user_field_1" size="70" maxlength="100"
value="<?php echo stripslashes($attachment->user_field_1); ?>" /></p>
<?php endif; ?>
<?php if ( $params->get('user_field_2_name', false) ): ?>
<p><label for="user_field_2"><?php echo $params->get('user_field_2_name'); ?>:</label>
<input type="text" name="user_field_2" id="user_field_2" size="70" maxlength="100"
value="<?php echo stripslashes($attachment->user_field_2); ?>" /></p>
<?php endif; ?>
<?php if ( $params->get('user_field_3_name', false) ): ?>
<p><label for="user_field_3"><?php echo $params->get('user_field_3_name'); ?>:</label>
<input type="text" name="user_field_3" id="user_field_3" size="70" maxlength="100"
value="<?php echo stripslashes($attachment->user_field_3); ?>" /></p>
<?php endif; ?>
</fieldset>
<input type="hidden" name="MAX_FILE_SIZE" value="524288" />
<input type="hidden" name="submitted" value="TRUE" />
<input type="hidden" name="save_type" value="upload" />
<input type="hidden" name="uri_type" value="<?php echo $attachment->uri_type; ?>" />
<input type="hidden" name="update_file" value="TRUE" />
<input type="hidden" name="parent_id" value="<?php echo $parent_id; ?>" />
<input type="hidden" name="parent_type" value="<?php echo $attachment->parent_type; ?>" />
<input type="hidden" name="parent_entity" value="<?php echo $attachment->parent_entity; ?>" />
<input type="hidden" name="new_parent" value="<?php echo $this->new_parent; ?>" />
<input type="hidden" name="from" value="<?php echo $this->from; ?>" />
<input type="hidden" name="Itemid" value="<?php echo $this->Itemid; ?>" />
<?php echo JHtml::_( 'form.token' ); ?>
<br/><div class="form_buttons">
<input type="submit" name="submit" value="<?php echo $upload_button_text ?>" />
<span class="right">
<input type="button" name="cancel" value="<?php echo JText::_('ATTACH_CANCEL'); ?>"
onClick="window.parent.SqueezeBox.close();" />
</span>
</div>
</form>
<?php
// Display the auto-publish warning, if appropriate
if ( !$params->get('publish_default', false) && !$this->may_publish ) {
$msg = $params->get('auto_publish_warning', '');
if ( JString::strlen($msg) == 0 ) {
$msg = JText::_('ATTACH_WARNING_ADMIN_MUST_PUBLISH');
}
else {
$msg = JText::_($msg);
}
echo "<h2>$msg</h2>";
}
// Show the existing attachments (if any)
if ( $parent_id || ($parent_id === 0) ) {
require_once(JPATH_SITE.'/components/com_attachments/controllers/attachments.php');
$controller = new AttachmentsControllerAttachments();
$controller->displayString($parent_id, $attachment->parent_type, $attachment->parent_entity,
'ATTACH_EXISTING_ATTACHMENTS',
false, false, true, $this->from);
}
echo "</div>";
if ( $this->error ) {
echo $this->endHTML();
}

View File

@ -0,0 +1 @@
<html><body bgcolor="#FFFFFF"></body></html>

View File

@ -0,0 +1,77 @@
<?php
/**
* Attachments component
*
* @package Attachments
* @subpackage Attachments_Component
*
* @copyright Copyright (C) 2007-2018 Jonathan M. Cameron, All Rights Reserved
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU/GPL
* @link http://joomlacode.org/gf/project/attachments/frs/
* @author Jonathan M. Cameron
*/
// No direct access
defined('_JEXEC') or die();
/** Define the legacy classes, if necessary */
require_once(JPATH_SITE.'/components/com_attachments/views/view.php');
/**
* View for the uploads
*
* @package Attachments
*/
class AttachmentsViewUpload extends AttachmentsFormView
{
/**
* Display the view
*/
public function display($tpl=null)
{
// Access check.
if (!JFactory::getUser()->authorise('core.create', 'com_attachments')) {
return JError::raiseError(404, JText::_('JERROR_ALERTNOAUTHOR') . ' (ERR 64)' );
}
// For convenience below
$attachment = $this->attachment;
$parent = $this->parent;
// Set up for editing the access level
if ( $this->params->get('allow_frontend_access_editing', false) ) {
require_once(JPATH_COMPONENT_ADMINISTRATOR.'/models/fields/accesslevels.php');
$this->access_level = JFormFieldAccessLevels::getAccessLevels('access', 'access', null);
$this->access_level_tooltip = JText::_('ATTACH_ACCESS_LEVEL_TOOLTIP');
}
// Set up publishing info
$user = JFactory::getUser();
$this->may_publish = $parent->userMayChangeAttachmentState($attachment->parent_id,
$attachment->parent_entity, $user->id);
if ( $this->may_publish ) {
$this->publish = JHtml::_('select.booleanlist', 'state', 'class="inputbox"', $attachment->state);
}
// Construct derived data
$attachment->parent_entity_name = JText::_('ATTACH_' . $attachment->parent_entity);
$attachment->parent_title = $parent->getTitle($attachment->parent_id, $attachment->parent_entity);
$this->relative_url_checked = $attachment->url_relative ? 'checked="yes"' : '';
$this->verify_url_checked = $attachment->url_verify ? 'checked="yes"' : '';
// Add the stylesheets for the form
JHtml::stylesheet('com_attachments/attachments_frontend_form.css', array(), true);
$lang = JFactory::getLanguage();
if ( $lang->isRTL() ) {
JHtml::stylesheet('com_attachments/attachments_frontend_form_rtl.css', array(), true);
}
// Display the upload form
parent::display($tpl);
}
}

View File

@ -0,0 +1,90 @@
<?php
/**
* Attachments component
*
* @package Attachments
* @subpackage Attachments_Component
*
* @copyright Copyright (C) 2007-2018 Jonathan M. Cameron, All Rights Reserved
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU/GPL
* @link http://joomlacode.org/gf/project/attachments/frs/
* @author Jonathan M. Cameron
*/
// No direct access
defined('_JEXEC') or die();
/** Define the legacy classes, if necessary */
require_once(JPATH_SITE.'/components/com_attachments/legacy/view.php');
/**
* View for the uploads
*
* @package Attachments
*/
class AttachmentsFormView extends JViewLegacy
{
/**
* Return the starting HTML for the page
*
* Note: When displaying a View directly from user code (not a conroller),
* it does not automatically create the HTML <html>, <body> and
* <head> tags. This code fixes that.
*
* There is probably a better way to do this!
*/
protected function startHTML()
{
jimport('joomla.filesystem.file');
require_once JPATH_BASE.'/libraries/joomla/document/html/renderer/head.php';
$document = JFactory::getDocument();
$this->assignRef('document', $document);
$app = JFactory::getApplication();
$this->template = $app->getTemplate(true)->template;
$template_dir = $this->baseurl.'/templates/'.$this->template;
$file ='/templates/system/css/system.css';
if (JFile::exists(JPATH_SITE.$file)) {
$document->addStyleSheet($this->baseurl.$file);
}
// Try to add the typical template stylesheets
$files = Array('template.css', 'position.css', 'layout.css', 'general.css');
foreach($files as $file) {
$path = JPATH_SITE.'/templates/'.$this->template.'/css/'.$file;
if (JFile::exists($path)) {
$document->addStyleSheet($this->baseurl.'/templates/'.$this->template.'/css/'.$file);
}
}
// Add the CSS for the attachments list (whether we need it or not)
JHtml::stylesheet('com_attachments/attachments_list.css', array(), true);
$head_renderer = new JDocumentRendererHead($document);
$html = '';
$html .= "<html>\n";
$html .= "<head>\n";
$html .= $head_renderer->fetchHead($document);
$html .= "</head>\n";
$html .= "<body id=\"attachments_iframe\">\n";
return $html;
}
/**
* Return the ending HTML tags for the page
*/
protected function endHTML()
{
$html = "\n";
$html .= "</body>\n";
$html .= "</html>\n";
return $html;
}
}

View File

@ -0,0 +1 @@
<html><body bgcolor="#FFFFFF"></body></html>

View File

@ -0,0 +1,56 @@
<?php
/**
* Attachments component
*
* @package Attachments
* @subpackage Attachments_Component
*
* @copyright Copyright (C) 2007-2018 Jonathan M. Cameron, All Rights Reserved
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU/GPL
* @link http://joomlacode.org/gf/project/attachments/frs/
* @author Jonathan M. Cameron
*/
// Check to ensure this file is included in Joomla!
defined('_JEXEC') or die();
$template = JFactory::getApplication()->getTemplate();
// Load the tooltip behavior.
JHtml::_('behavior.tooltip');
$uri = JFactory::getURI();
$document = JFactory::getDocument();
/** Load the Attachments helper */
require_once(JPATH_SITE.'/components/com_attachments/helper.php');
require_once(JPATH_SITE.'/components/com_attachments/javascript.php');
// Add the regular css file
AttachmentsJavascript::setupJavascript(false);
// Hide the vertical scrollbar using javascript
$hide_scrollbar = "window.addEvent('domready', function() {
document.documentElement.style.overflow = \"hidden\";
document.body.scroll = \"no\";});";
$document->addScriptDeclaration($hide_scrollbar);
?>
<div class="attachmentsWarning">
<h1><?php echo $this->warning_title; ?></h1>
<h2 id="warning_msg"><?php echo $this->warning_question ?></h2>
<form action="<?php echo $this->action_url; ?>" name="warning_form" method="post">
<div class="form_buttons">
<span class="left">&nbsp;</span>
<input type="submit" name="submit" value="<?php echo $this->action_button_label ?>" />
<span class="right">
<input type="button" name="cancel" value="<?php echo JText::_('ATTACH_CANCEL'); ?>"
onClick="window.parent.SqueezeBox.close();" />
</span>
</div>
<input type="hidden" name="option" value="<?php echo $this->option;?>" />
<input type="hidden" name="from" value="<?php echo $this->from;?>" />
<?php echo JHtml::_( 'form.token' ); ?>
</form>
</div>

View File

@ -0,0 +1 @@
<html><body bgcolor="#FFFFFF"></body></html>

View File

@ -0,0 +1,42 @@
<?php
/**
* Attachments component
*
* @package Attachments
* @subpackage Attachments_Component
*
* @copyright Copyright (C) 2007-2018 Jonathan M. Cameron, All Rights Reserved
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU/GPL
* @link http://joomlacode.org/gf/project/attachments/frs/
* @author Jonathan M. Cameron
*/
// Check to ensure this file is included in Joomla!
defined('_JEXEC') or die();
/** Define the legacy classes, if necessary */
require_once(JPATH_SITE.'/components/com_attachments/legacy/view.php');
/**
* View for warnings
*
* @package Attachments
*/
class AttachmentsViewWarning extends JViewLegacy
{
/**
* Display the view
*/
public function display($tpl = null)
{
// Add the stylesheets
JHtml::stylesheet('com_attachments/attachments_frontend_form.css', array(), true);
$lang = JFactory::getLanguage();
if ( $lang->isRTL() ) {
JHtml::stylesheet('com_attachments/attachments_frontend_form_rtl.css', array(), true);
}
parent::display($tpl);
}
}