tutto cho che serve attachments

This commit is contained in:
2025-01-01 12:22:03 +01:00
parent d6f07ccdb2
commit 934dd6bf52
210 changed files with 5186 additions and 0 deletions

View File

@ -0,0 +1,43 @@
<?php
/**
* Attachments component attachments view
*
* @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 attachments admin CSS files
$document = JFactory::getDocument();
$uri = JFactory::getURI();
// load tooltip behavior
JHtml::_('behavior.tooltip');
$listOrder = $this->escape($this->state->get('list.ordering'));
$listDirn = $this->escape($this->state->get('list.direction'));
?>
<form action="<?php echo JRoute::_('index.php?option=com_attachments'); ?>" method="post" name="adminForm" id="adminForm">
<?php echo $this->loadTemplate('filter');?>
<table class="adminlist" id="attachmentsList">
<thead><?php echo $this->loadTemplate('head');?></thead>
<tbody><?php echo $this->loadTemplate('body');?></tbody>
<tfoot><?php echo $this->loadTemplate('foot');?></tfoot>
</table>
<div>
<input type="hidden" name="task" value="" />
<input type="hidden" name="boxchecked" value="0" />
<input type="hidden" name="filter_order" value="<?php echo $listOrder; ?>" />
<input type="hidden" name="filter_order_Dir" value="<?php echo $listDirn; ?>" />
<?php echo JHtml::_('form.token'); ?>
</div>
</form>

View File

@ -0,0 +1,164 @@
<?php
/**
* Attachments component attachments view
*
* @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 to this file
defined('_JEXEC') or die('Restricted Access');
// Set up a few convenience items
$app = JFactory::getApplication();
$user = JFactory::getUser();
$uri = JFactory::getURI();
$params = $this->params;
$secure = $params->get('secure',false);
$superimpose_link_icons = $params->get('superimpose_url_link_icons', true);
$icon_dir = $uri->root(true) . '/components/com_attachments/media/icons/';
// Loop through all the attachments
$k = 0;
$last_parent_id = null;
$last_parent_type = null;
$last_parent_entity = null;
for ($i=0, $n=count( $this->items ); $i < $n; $i++)
{
$item = $this->items[$i];
if ( $item->uri_type == 'file' ) {
if ( $secure ) {
$url = JRoute::_("index.php?option=com_attachments&amp;task=attachment.download&amp;id=" . (int)$item->id);
}
else {
$url = $uri->root(true) . '/' . $item->url;
}
}
else {
$url = $item->url;
}
$checked = JHtml::_('grid.id', $i, $item->id );
$published = JHtml::_('jgrid.published', $item->state, $i, 'attachments.' );
$access = $this->level_name[$item->access];
$size_kb = (int)(10 * $item->file_size / 1024) / 10.0;
$link = JFilterOutput::ampReplace( 'index.php?option=com_attachments&amp;task=attachment.edit&amp;cid[]='. (int)$item->id );
$view_parent_title = JText::_('ATTACH_VIEW_ARTICLE_TITLE');
if ( JString::strlen($item->icon_filename) > 0 )
$icon = $item->icon_filename;
else
$icon = 'generic.gif';
$add_attachment_title = JText::_('ATTACH_ADD_ATTACHMENT_TITLE');
$edit_attachment_title = JText::_('ATTACH_EDIT_THIS_ATTACHMENT_TITLE');
$access_attachment_title = JText::_('ATTACH_ACCESS_THIS_ATTACHMENT_TITLE');
// Set up the create/modify dates
jimport( 'joomla.utilities.date' );
$tz = new DateTimeZone( $user->getParam('timezone', $app->getCfg('offset')) );
$cdate = JFactory::getDate($item->created);
$cdate->setTimeZone($tz);
$created = $cdate->format("Y-m-d H:i", true);
$mdate = JFactory::getDate($item->modified);
$mdate->setTimeZone($tz);
$modified = $mdate->format("Y-m-d H:i", true);
$add_attachment_txt = JText::_('ATTACH_ADD_ATTACHMENT');
if ( ($item->parent_id != $last_parent_id) || ($item->parent_type != $last_parent_type)
|| ($item->parent_entity != $last_parent_entity) ) {
$parent_type = $item->parent_type;
if ( $item->parent_entity != 'default' ) {
$parent_type .= '.' . $item->parent_entity;
}
if ( ($item->parent_id == null) || !$item->parent_exists ) {
$artLine = '<tr><td class="at_parentsep" colspan="'.$this->num_columns.'">';
$artLine .= '<b>'.$item->parent_entity_type.':</b> <span class="error">'.$item->parent_title.'</span>';
$artLine .= '</td></tr>';
}
else {
$addAttachLink = 'index.php?option=com_attachments&amp;task=attachment.add&amp;parent_id='. $item->parent_id .
'&amp;parent_type=' . $parent_type . '&amp;editor=add_to_parent';
$addAttachLink = JFilterOutput::ampReplace($addAttachLink);
$artLine = "<tr><td class=\"at_parentsep\" colspan=\"$this->num_columns\">";
$artLine .= "<b>" . $item->parent_entity_type.":</b> <a title=\"$view_parent_title\" " .
"href=\"".$item->parent_url."\" target=\"_blank\">" . $item->parent_title . "</a>";
$artLine .= JFilterOutput::ampReplace('&nbsp;&nbsp;&nbsp;&nbsp;');
$artLine .= "<a class=\"addAttach\" href=\"$addAttachLink\" title=\"$add_attachment_title\">";
$artLine .= JHtml::image('com_attachments/add_attachment.gif', $add_attachment_txt, null, true);
$artLine .= "</a>&nbsp;<a class=\"addAttach\" href=\"$addAttachLink\" title=\"$add_attachment_title\">" .
"$add_attachment_txt</a>";
$artLine .= "</td></tr>";
}
echo $artLine;
$k = 0;
}
$last_parent_id = $item->parent_id;
$last_parent_type = $item->parent_type;
$last_parent_entity = $item->parent_entity;
$download_verb = JText::_('ATTACH_DOWNLOAD_VERB');
?>
<tr class="<?php echo "row$k"; ?>">
<td class="at_checked hidden-phone"><?php echo $checked; ?></td>
<td class="at_published" align="center"><?php echo $published;?></td>
<td class="at_filename">
<a href="<?php echo $link; ?>" title="<?php echo $edit_attachment_title; ?>"
><?php echo JHtml::image('com_attachments/file_icons/'.$icon, $download_verb, null, true);
if ( ($item->uri_type == 'url') && $superimpose_link_icons ) {
if ( $item->url_valid ) {
echo JHtml::image('com_attachments/file_icons/link_arrow.png', '', 'class="link_overlay"', true);
}
else {
echo JHtml::image('com_attachments/file_icons/link_broken.png', '', 'class="link_overlay"', true);
}
}
?></a>&nbsp;<a
href="<?php echo $link; ?>" title="<?php echo $edit_attachment_title; ?>"
><?php if ( $item->uri_type == 'file' ) {
echo $item->filename;
}
else {
if ( $item->filename ) {
echo $item->filename;
}
else {
echo $item->url;
}
}
?></a>&nbsp;&nbsp;<a class="downloadAttach" href="<?php echo $url; ?>" target="_blank"
title="<?php echo $access_attachment_title; ?>"><?php echo $download_verb;
?></a><a class="downloadAttach" href="<?php echo $url; ?>" target="_blank"
title="<?php echo $access_attachment_title; ?>"
><?php echo JHtml::image('com_attachments/download.gif', $download_verb, null, true); ?></a>
</td>
<td class="at_description"><?php echo htmlspecialchars(stripslashes($item->description)); ?></td>
<td class="at_access" align="center"><?php echo $access; ?></td>
<?php if ( $params->get('user_field_1_name', '') != '' ): ?>
<td class="at_user_field"><?php echo stripslashes($item->user_field_1); ?></td>
<?php endif; ?>
<?php if ( $params->get('user_field_2_name', '') != '' ): ?>
<td class="at_user_field"><?php echo stripslashes($item->user_field_2); ?></td>
<?php endif; ?>
<?php if ( $params->get('user_field_3_name', '') != '' ): ?>
<td class="at_user_field"><?php echo stripslashes($item->user_field_3); ?></td>
<?php endif; ?>
<td class="at_file_type"><?php echo $item->file_type; ?></td>
<td class="at_file_size"><?php echo $size_kb; ?></td>
<td class="at_creator_name"><?php echo $item->creator_name; ?></td>
<td class="at_created_date"><?php echo $created; ?></td>
<td class="at_mod_date"><?php echo $modified ?></td>
<?php if ( $secure ): ?>
<td class="at_downloads"><?php echo $item->download_count; ?></td>
<?php endif; ?>
</tr>
<?php
$k = 1 - $k;
}

View File

@ -0,0 +1,40 @@
<?php
/**
* Attachments component attachments view
*
* @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 to this file
defined('_JEXEC') or die('Restricted Access');
$lists = $this->lists;
?>
<div class="attachments_filter">
<table>
<tbody>
<tr>
<td width="100%">
<label class="filter-search-lbl" for="filter_search"><?php echo JText::_( 'JSEARCH_FILTER_LABEL' ); ?></label>
<input type="text" name="filter_search" id="filter_search" value="<?php echo $this->escape($this->state->get('filter.search')); ?>"
class="text_area" onchange="this.form.submit();" />
<button class="filter_button" onclick="this.form.submit();"><?php echo JText::_( 'JSEARCH_FILTER_SUBMIT' ); ?></button>
<button class="filter_button" onclick="document.id('filter_search').value='';this.form.submit();">
<?php echo JText::_( 'JSEARCH_FILTER_CLEAR' ); ?></button>
<button class="filter_button" id="reset_order" onclick="Joomla.tableOrdering('','asc','');">
<?php echo JText::_( 'ATTACH_RESET_ORDER' ); ?></button>
</td>
<td nowrap="nowrap">
<?php echo JText::_('ATTACH_LIST_ATTACHMENTS_FOR_COLON') ?>
<?php echo $lists['filter_parent_state_menu'] ?> &nbsp; <?php echo $lists['filter_entity_menu'] ?>
</tr>
</tbody>
</table>
</div>

View File

@ -0,0 +1,21 @@
<?php
/**
* Attachments component attachments view
*
* @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 to this file
defined('_JEXEC') or die('Restricted Access');
?>
<tr>
<td colspan="<?php echo $this->num_columns-3; ?>"><?php echo $this->pagination->getListFooter(); ?></td>
<td colspan="3"><div id="componentVersion"><a target="_blank" title="<?php echo JText::_('ATTACH_ATTACHMENTS_PROJECT_URL_DESCRIPTION'); ?>" href="<?php echo $this->project_url ?>"><?php echo JText::sprintf('ATTACH_ATTACHMENTS_VERSION_S', $this->version); ?></a></div></td>
</tr>

View File

@ -0,0 +1,67 @@
<?php
/**
* Attachments component attachments view
*
* @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 to this file
defined('_JEXEC') or die('Restricted Access');
// Set up a few convenience items
$params = $this->params;
$secure = $params->get('secure',false);
$lists = $this->lists;
$list_for_parents = $lists['list_for_parents'];
$listOrder = $this->escape($this->state->get('list.ordering'));
$listDirn = $this->escape($this->state->get('list.direction'));
?>
<tr>
<th class="at_checked hidden-phone">
<input type="checkbox" name="checkall-toggle" value="" onclick="Joomla.checkAll(this)" />
</th>
<th class="at_published" width="5%" nowrap="nowrap"><?php echo JHtml::_('grid.sort', 'ATTACH_PUBLISHED',
'a.state', $listDirn, $listOrder ) ?></th>
<th class="at_filename"><?php echo JHtml::_('grid.sort', 'ATTACH_ATTACHMENT_FILENAME_URL',
'a.filename', $listDirn, $listOrder ) ?></th>
<th class="at_description"><?php echo JHtml::_('grid.sort', 'ATTACH_DESCRIPTION',
'a.description', $listDirn, $listOrder ) ?></th>
<th class="at_access" width="5%" nowrap="nowrap"><?php echo JHtml::_('grid.sort', 'JFIELD_ACCESS_LABEL',
'a.access', $listDirn, $listOrder ) ?></th>
<?php if ($params->get('user_field_1_name')): ?>
<th class="at_user_field"><?php echo JHtml::_('grid.sort', $params->get('user_field_1_name', ''),
'a.user_field_1', $listDirn, $listOrder ) ?></th>
<?php endif; ?>
<?php if ($params->get('user_field_2_name')): ?>
<th class="at_user_field"><?php echo JHtml::_('grid.sort', $params->get('user_field_2_name', ''),
'a.user_field_2', $listDirn, $listOrder ) ?></th>
<?php endif; ?>
<?php if ($params->get('user_field_3_name')): ?>
<th class="at_user_field"><?php echo JHtml::_('grid.sort', $params->get('user_field_3_name', ''),
'a.user_field_3', $listDirn, $listOrder ) ?></th>
<?php endif; ?>
<th class="at_file_type"><?php echo JHtml::_('grid.sort', 'ATTACH_FILE_TYPE',
'a.file_type', $listDirn, $listOrder ) ?></th>
<th class="at_file_size"><?php echo JHtml::_('grid.sort', 'ATTACH_FILE_SIZE_KB',
'a.file_size', $listDirn, $listOrder ) ?></th>
<th class="at_creator_name"><?php echo JHtml::_('grid.sort', 'ATTACH_CREATOR',
'u1.name', $listDirn, $listOrder ) ?></th>
<th class="at_created_date"><?php echo JHtml::_('grid.sort', 'JGLOBAL_CREATED',
'a.created', $listDirn, $listOrder ) ?></th>
<th class="at_mod_date"><?php echo JHtml::_('grid.sort', 'ATTACH_LAST_MODIFIED',
'a.modified', $listDirn, $listOrder ) ?></th>
<?php if ( $secure ): ?>
<th class="at_downloads"><?php echo JHtml::_('grid.sort', 'ATTACH_DOWNLOADS',
'a.download_count', $listDirn, $listOrder ) ?></th>
<?php endif; ?>
</tr>

View File

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