primo commit
This commit is contained in:
263
administrator/components/com_attachments/Changelog.php
Normal file
263
administrator/components/com_attachments/Changelog.php
Normal file
@ -0,0 +1,263 @@
|
||||
<?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
|
||||
*/
|
||||
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
?>
|
||||
<pre>
|
||||
Attachments 3.x Extension for Joomla 2.5+ and 3.x
|
||||
|
||||
2018-03-26: Release 3.2.6
|
||||
- 2017-05-27 Fixed category attachments for 3.7+ changes
|
||||
- 2017-05-28 Another fix for category article list menu item
|
||||
- 2017-07-12 Fixed issue with article selection
|
||||
- 2017-07-13 Fixed issue with admin attachment list popups not working
|
||||
- 2018-03-25 Added fixes to clean user inputs (fix SQL injection vulnerability)
|
||||
- Tested with Joomla 3.8.6
|
||||
|
||||
2017-04-30: Release 3.2.5
|
||||
- 2016-05-13 Fix for problem with delete buttons
|
||||
- 2017-04-27 Fix for Jooma 3.7.0
|
||||
- Tested with Joomla 3.6.5 and 3.7.0
|
||||
|
||||
2016-05-07: Release 3.2.4
|
||||
- 2015-09-05 Fixed admin [Reset Order] button
|
||||
- 2015-10-11 Fixed issue with uploads in Joomla 3.4.4
|
||||
- 2016-04-15 Fixed showing attachments in TinyMCE editor
|
||||
- 2016-04-20 Fixed modal issue with TinyMCE on J3.5.1 on backend
|
||||
- 2016-04-24 Fixed modal issue with TinyMCE on J3.5.1 on frontend
|
||||
- Tested on Joomla 3.4.8 and 3.5.1
|
||||
|
||||
2015-03-20: Release 3.2.3
|
||||
- Fixed issue with category blog lists for Joomla 3.4
|
||||
- Fixed article com_media confusion issue for Joomla 3.4
|
||||
- Tested with Joomla 2.5.28 and 3.4.0
|
||||
|
||||
2015-03-02: Release 3.2.2
|
||||
- 2015-02-20 Fixed some small issues related to supporting Attachments for JEvents
|
||||
- 2015-02-22 Fixes for add/insert attachments editor button icons
|
||||
- Tested with Joomla 2.5.28 and 3.4.0
|
||||
|
||||
2015-02-15: Release 3.2.1
|
||||
- Fixed problem with filenames of the downloaded files
|
||||
|
||||
2015-02-01: Release 3.2.0
|
||||
- 2014-01-18 Adjustment to migration importer to better handle UTF-8
|
||||
- 2014-01-19 Fix to disable attachments display on category list title (J3)
|
||||
- 2014-01-26 Fix to migration importer to strip of any leading BOM
|
||||
- 2014-01-26 Fix for icon on editor-xtd add attachment button (J3)
|
||||
- 2014-05-30 Fixes to be more robust to partial/failed uninstalls
|
||||
- 2015-06-08 Disable all attachments plugins if component is uninstalled.
|
||||
This should prevent problems when incorrectly uninstalling only the
|
||||
component. To uninstall correctly, uninstall the Attachments Package;
|
||||
it will uninstall the component and all plugins.
|
||||
- 2014-08-22 Refactored displaying attachments lists in editors
|
||||
- 2014-08-23 Disable all attachments plugins if uninstalling
|
||||
the Attachments content plugin, the Attachments plugin framework
|
||||
plugin, and the Attachments for content plugin. See 2014-06-08 note.
|
||||
- 2014-08-23 Added checking for supported databases during installation.
|
||||
- 2014-09-14 Refactor of Attachments plugin API to better support
|
||||
other components.
|
||||
- 2014-09-17 Fixed bug in joomfish/lanternfish handling
|
||||
- 2014-09-18 More updates for joomfish/lanternfish handling
|
||||
- 2014-10-14 Cleaned up Javascript of refresh function
|
||||
- 2014-11-04 Fix for editor add-attachments button issue
|
||||
- 2014-11-16 Fixed bug when creating article from front end
|
||||
- 2014-11-28 Fix to better handle PDF mime type
|
||||
- 2014-12-12 Fix for missing 'Add Attachment' button for Joomla 3.4
|
||||
- 2015-01-24 Fixed missing admin utils icon in Joomla 3.3.6
|
||||
- 2015-02-01 Moved repos from joomlacode.org to github.com
|
||||
- 2015-02-01 Switched to semver-compatible version numbering
|
||||
(This version is not quite semver compliant but future ones will be)
|
||||
- 2015-02-01 Tested with Joomla 3.3.6 and 2.5.28 on Ubuntu
|
||||
|
||||
2013-11-15: Release 3.1.3 (Joomla 3.2 Compatibility Release)
|
||||
- 2013-09-21 Allow display of attachments lists in editors for non-article
|
||||
- 2013-10-13 Fixed migration importer handle obsolete 'section' attachments
|
||||
- 2013-10-27 Fixed bug in 'Show attachments to non logged-in users' option
|
||||
- 2013-11-11 Fixed issue with displaying options with Joomla 3.2.
|
||||
|
||||
2013-08-14: Release 3.1.2 (Security Release)
|
||||
- 2013-07-24 Fixed bug in max_attachments_size handling.
|
||||
- 2013-07-25 Added line numbers to error messages for import (for migration).
|
||||
- 2013-07-26 Fixed issue in main attachments plugin that may have caused
|
||||
warnings (although it operated correctly).
|
||||
- 2013-07-26 Fixed issue with add-attachment button not showing correctly
|
||||
in Joomla 3.x.
|
||||
- 2013-07-26 Robustness fixes for attachment plugins.
|
||||
- 2013-07-27 Enabled scrolling on upload forms to ensure that all existing
|
||||
attachments can be seen, even when there are many.
|
||||
- 2013-07-27 Fixed issue with missing 'KB' language item in attachments list.
|
||||
Changed 'KB' to 'kB' to match Wikipedia 'kilobyte' article
|
||||
- 2013-07-30 Minor fixes for robustness
|
||||
- 2013-07-31 Added fix to display attachments for non-menu category blog views.
|
||||
- 2013-08-02 Fix to return user logging in to the prior page.
|
||||
- 2013-08-14 Fix security issue with PHP files qqq.php. (note trailing period)
|
||||
|
||||
2013-07-11: Release 3.1.1 (Security Release)
|
||||
- 2013-07-11 Prevent uploading image file exploits (Security Fix for VEL)
|
||||
|
||||
2013-06-08: Release 3.1
|
||||
- 2012-08-18 Added attachments list sort option: description (reversed, z-a).
|
||||
- 2012-09-08 Several updates to support upgrade to Joomla 3.0:
|
||||
- Updated deprecated classes/functions (JRules->JAccessRules,
|
||||
user->authorisedLevels(), user->getAuthorisedViewLevels()).
|
||||
- Converted all 'X' toolbar items to non-X versions (eg, addNewX->addNew,
|
||||
editListX->editList, deleteListX->deleteList) for future compatibility with
|
||||
Joomla 3.0.
|
||||
- Converted several Joomal classes to legacy version for future compatibility
|
||||
for Joomla 3.0 (JModel->JModelLegacy, JController->JControllerLegacy,
|
||||
JView->JViewLegacy).
|
||||
- NOTE that these legacy classes only work with Joomla 2.5 or later, so
|
||||
earlier versions of Joomla are not longer supported (including Joomla 1.7).
|
||||
- 2012-10-13 Added in missing translation term for error messages.
|
||||
- 2012-10-17 Fixed issue in display of insert_attachments_editor editor button.
|
||||
(Primarily affected joomlaCK editor.)
|
||||
- 2012-10-25 Added optional display of 'Created' date in front end displays
|
||||
of attachments lists. Changed modification date format to be date format
|
||||
since it now applies to both creation and modification dates.
|
||||
- 2012-11-10 Fixed many permissions issues for backend users with limited
|
||||
permissions.
|
||||
- 2012-11-10 Renumbered all error numbers.
|
||||
- 2012-11-10 Added extra code to handle legacy classes for Joomla version 2.5+
|
||||
and earlier. (The new legacy classes were introduced in Joomla version 2.5.6)
|
||||
- 2012-11-11 Cleaned up some permissions issues with adding/editing attachments
|
||||
in the backend by non-super-user.
|
||||
- 2012-11-11 Changed all JError::raiseWarning() to JError::raiseError().
|
||||
Apparently, raiseWarning is not well supported by Joomla. Switched the
|
||||
permissions related errors to 403 in the backend for nicer error handling.
|
||||
- 2012-11-12 Improved config variable (show_creator --> show_creator_name).
|
||||
- 2012-11-12 Fixed stylesheet issue in editor by moving stylesheet additions
|
||||
from show_attachments::contentAfterRender() to add_attachment::onDisplay()
|
||||
since afterRender is too late to add stylesheets.
|
||||
- 2012-11-12 Fix to show_attachments to handle various article editors better.
|
||||
- 2012-11-16 Added maximum attachment file size limit option. Check actual file size
|
||||
when uploaded to ensure that is not larger than the attachments limit or the PHP
|
||||
upload size limit.
|
||||
- 2012-11-22 Cosmetic code cleanups in attachments_plugi/attachments.php.
|
||||
- 2012-11-30 Added support for downloading files with mod_xsendfile (if available).
|
||||
- 2012-12-05 Implemented fix for downloading large files by send the file in 8K chunks.
|
||||
- 2012-12-16 Various updates, fixes, updates and tweaks for Joomla 3.0 compatibility.
|
||||
Updated date display format string to use JDate::format function syntax.
|
||||
(This is a work in progress; still some rough edges.)
|
||||
- 2012-12-16 Switched all JHTML to JHtml everywhere.
|
||||
- 2012-12-30 Added options for sorting my 'filename descending' and 'display name descending'.
|
||||
- 2013-01-05 Updated documentation for date display format string.
|
||||
- 2013-01-24 Fix bug that cased problems when there are spaces in the site base URL.
|
||||
- 2013-02-22 Updates to catch up with Joomla deprecations (eg JRequest::checkToken()).
|
||||
- 2013-02-22 Fixed display of Attachments options in Joomla 3.x.
|
||||
- 2013-02-22 Got rid of old references to Joomla 1.7 (no longer compatible).
|
||||
- 2013-02-22 Cosmetic improvements to frontend update/update dialogs.
|
||||
- 2013-03-01 Added ability to display non-public attachments to non-logged in users
|
||||
but require they log in before actually being able to access the attachments.
|
||||
- 2013-03-05 Fixed issue creating attachment for an article being created in Joomla 3.x.
|
||||
- 2013-03-06 Fixed improper handling of legacy classes in Joomla 2.5.x.
|
||||
- 2013-03-06 Split legacy.php into separate files for each class (for efficiency).
|
||||
- 2013-03-19 Better handling of downloads for MS IE browsers.
|
||||
- 2013-03-29 Safer db storage and html display for display_filename and description.
|
||||
- 2013-03-30 Abort installation if debris from failed install exists
|
||||
(to make installation more robust for Joomla 3.x)
|
||||
- 2013-03-31 Handle URLs in secure mode better (do not expose URL).
|
||||
Thanks to Daniel Guidry for the idea for this fix!
|
||||
- 2012-04-02 Added paperclip icon in backend Attachments manager page for Joomle 3.x.
|
||||
- 2012-04-05 Refactored css/js files to use central media/com_attachments folder.
|
||||
- 2012-04-05 Fixed bug that was exposing registered attachments in non-secure mode.
|
||||
(Introduced in the 2013-03-01 mod to display links for non-public attachments.)
|
||||
- 2012-04-05 Minor cosmetic adjustments to form displays in frontend and backend.
|
||||
- 2012-04-06 Refactored handling of image files to use central media folder
|
||||
to allow template overrides of images.
|
||||
- 2012-04-12 Converted admin utils view to use template (so it can be overridden).
|
||||
- 2012-04-12 Removed several unnecessary imports (for views and controllers).
|
||||
- 2012-04-13 In admin edit form, only show attachments if updating file.
|
||||
- 2012-04-13 Fixed missing editor add-attachment/insert-token button icons for Joomla 3.
|
||||
Other small tweaks to the CSS files for the 'add attachment' link.
|
||||
- 2012-04-13 Added quickicon plugin for both Joomla 2.5 and 3.x.
|
||||
- 2012-04-19 Converted help page to use a view with template and translation tokens.
|
||||
- 2012-05-03 Refactored/cleaned up add/edit/update/upload views and controller/helper
|
||||
code that invokes the views.
|
||||
- 2012-05-04 Refactored and straightened out onPrepareContent callbacks to use fixes
|
||||
in Joomla 2.5.10+ and Joomla 3.1+.
|
||||
- 2012-05-05 Small improvements to help view coding.
|
||||
- 2013-05-14 In admin add dialog, moved alt parents selector to top right.
|
||||
- 2013-05-15 Policy change: let super-user see attachments for all access levels.
|
||||
- 2013-05-17 Updated help page for Attachments 3.1 release.
|
||||
- 2013-05-19 Cleaned up code for attachments plugin framework and attachments_for_content.
|
||||
- 2013-05-31 Fixed a few minor issues that came up in testing.
|
||||
Tested on Joomla 2.5.11 on Linux (Firefox), Windows (Firefox, IE, Chrome).
|
||||
|
||||
2012-09-07: Release 3.0.4
|
||||
- 2012-09-07 Fixed bug causing crashes when component (only) is uninstalled.
|
||||
|
||||
2012-08-11: Release 3.0.3
|
||||
- 2011-09-27 Fixed errors in the English version of the help file
|
||||
- 2011-10-30 Changes access/view level dialog to show all access levels to Super-User.
|
||||
- 2011-10-30 Fixed issue that caused the backend to crash when users disabled the framework plugin.
|
||||
- 2011-10-31 More updates to make things fail more gracefully if the framework plugin is disabled.
|
||||
- 2011-12-01 Fix to prevent incorrectly displaying attachments for creating article from category layout.
|
||||
- 2012-02-10 Added trim() function to import code to clean field names from CSV files.
|
||||
- 2012-02-10 Minor translation fix to search plugin code.
|
||||
- 2012-02-11 Fix pagination so that is remembers the limit start.
|
||||
- 2012-02-14 Fixed bug in handling errors when checking URLs.
|
||||
- 2012-02-23 Cleaned up quoting in DB calls.
|
||||
- 2012-03-08 Added jimports for JController to a few files.
|
||||
- 2012-03-09 IE-specific fix for downloading filenames with special characters in Internet Explorer.
|
||||
Thanks to crassus168 (chris@gamehit.net) for suggestions for this fix.
|
||||
- 2012-03-10 Fixed handling of showing attachments for editing articles
|
||||
from category blog and category list.
|
||||
- 2012-03-10 Updated minor translation fix to search plugin code to resolve issues in Joomla 2.5+.
|
||||
- 2012-03-19 Fixed issue with displayString refactor (front end upload failing).
|
||||
- 2012-03-23 Fixed bug in sorting by Creator name in backend attachments list.
|
||||
- 2012-03-23 Fixed issue with redisplay after editing/deleting attachments from
|
||||
category blog view on front end.
|
||||
- 2012-03-23 Suppress extra info messages during installation.
|
||||
- 2012-04-01 Fixed bug when adding URLs during creating an article from front end.
|
||||
- 2012-04-03 Fix to make sure that pre-existing orphaned attachments are displayed
|
||||
when creating an article.
|
||||
- 2012-04-06 Removed code to translate access levels. Apparently they are not translated!
|
||||
- 2012-04-06 Added code to warn user there are bad attachments (eg, ones whose parents are uninstalled).
|
||||
- 2012-04-17 Fixed several 'strict PHP' issues.
|
||||
- 2012-04-20 Fixed issue with the display of attachments for categories.
|
||||
- 2012-04-20 Fixed issue with attachments list display in editor displaying badly when the
|
||||
'toggle editor' button is used.
|
||||
- 2012-05-07 Fixed issue with missing translation items.
|
||||
- 2012-05-11 Added trunction of filenames if longer than the filename field in the database.
|
||||
- 2012-05-13 Added warning messages when a filename is truncated.
|
||||
- 2012-05-13 Updated behavior: Do not kill display-name when updating/replacing a file.
|
||||
- 2012-05-14 Fixed issue with adding attachments while editing an article (in category list/blog)
|
||||
- 2012-05-15 Updated most of the error numbers, added a warning about potential templates
|
||||
problems in the category blog view
|
||||
- 2012-05-16 Updated the CSS rules for the attachments display to be more robust.
|
||||
- 2012-08-04 Fixed frontend display of category attachments using regular onContentPrepare event.
|
||||
- 2012-08-10 Updated minimum supported version of Joomla to 1.7.
|
||||
Generalized error message when trying to install Attachments on an old/unsupported
|
||||
version of Joomla.
|
||||
- 2012-08-11 Tested with Joomla 2.5+.6 on Linux and Windows.
|
||||
|
||||
2011-09-17: Release 3.0.2
|
||||
- 2011-09-12 Improved display of frontend upload/update forms
|
||||
- 2011-09-17 Fixed bug in delete dialog while editing article on front end
|
||||
- 2011-09-17 Fixed save2New issue for Joomla 1.6.x
|
||||
|
||||
2011-09-09: Release 3.0.1
|
||||
- 2011-09-06 Fixed bug in migration import code that prevented proper error
|
||||
messages when imports fail (eg, file not found, etc). Changed the dry_run
|
||||
success message to show number of attachments found in CSV file
|
||||
- 2011-09-07 Fixed error in token IDs for admin unpublish messages
|
||||
- 2011-09-08 Added Save+New button in admin form to add attachments
|
||||
- 2011-09-09 Added missing error numbers in import code
|
||||
|
||||
2011-08-28: Release 3.0
|
||||
- Derived from unreleased 2.3
|
||||
- Significant refactoring, reimplementing, new features, cleanups, etc.
|
||||
- Testing several RC versions by over 140 testers
|
||||
|
||||
</pre>
|
||||
40
administrator/components/com_attachments/access.xml
Normal file
40
administrator/components/com_attachments/access.xml
Normal file
@ -0,0 +1,40 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<access component="com_attachments">
|
||||
<section name="component">
|
||||
<action name="core.admin" title="ATTACH_PERMISSION_ADMIN_COMPONENT"
|
||||
description="ATTACH_PERMISSION_ADMIN_COMPONENT_DESC" />
|
||||
|
||||
<action name="core.manage" title="ATTACH_PERMISSION_MANAGE_COMPONENT"
|
||||
description="ATTACH_PERMISSION_MANAGE_COMPONENT_DESC" />
|
||||
|
||||
<action name="core.create" title="ATTACH_PERMISSION_CREATE"
|
||||
description="ATTACH_PERMISSION_CREATE_DESC" />
|
||||
|
||||
<action name="core.delete" title="ATTACH_PERMISSION_DELETE"
|
||||
description="ATTACH_PERMISSION_DELETE_DESC" />
|
||||
|
||||
<action name="core.edit" title="ATTACH_PERMISSION_EDIT"
|
||||
description="ATTACH_PERMISSION_EDIT_DESC" />
|
||||
|
||||
<action name="core.edit.state" title="ATTACH_PERMISSION_EDITSTATE"
|
||||
description="ATTACH_PERMISSION_EDITSTATE_DESC" />
|
||||
|
||||
<action name="core.edit.own" title="ATTACH_PERMISSION_EDITOWN"
|
||||
description="ATTACH_PERMISSION_EDITOWN_DESC" />
|
||||
|
||||
<action name="attachments.edit.state.own" title="ATTACH_PERMISSION_EDITSTATE_OWN"
|
||||
description="ATTACH_PERMISSION_EDITSTATE_OWN_DESC" />
|
||||
|
||||
<action name="attachments.delete.own" title="ATTACH_PERMISSION_DELETEOWN"
|
||||
description="ATTACH_PERMISSION_DELETEOWN_DESC" />
|
||||
|
||||
<action name="attachments.edit.ownparent" title="ATTACH_PERMISSION_EDIT_OWNPARENT"
|
||||
description="ATTACH_PERMISSION_EDIT_OWNPARENT_DESC" />
|
||||
|
||||
<action name="attachments.edit.state.ownparent" title="ATTACH_PERMISSION_EDITSTATE_OWNPARENT"
|
||||
description="ATTACH_PERMISSION_EDITSTATE_OWNPARENT_DESC" />
|
||||
|
||||
<action name="attachments.delete.ownparent" title="ATTACH_PERMISSION_DELETE_OWNPARENT"
|
||||
description="ATTACH_PERMISSION_DELETE_OWNPARENT_DESC" />
|
||||
</section>
|
||||
</access>
|
||||
23
administrator/components/com_attachments/attachments.php
Normal file
23
administrator/components/com_attachments/attachments.php
Normal file
@ -0,0 +1,23 @@
|
||||
<?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
|
||||
*/
|
||||
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
/** Define the legacy classes, if necessary */
|
||||
require_once(JPATH_SITE.'/components/com_attachments/legacy/controller.php');
|
||||
|
||||
|
||||
// Execute the requested task
|
||||
$controller = JControllerLegacy::getInstance('Attachments');
|
||||
$controller->execute(JFactory::getApplication()->input->get('task'));
|
||||
$controller->redirect();
|
||||
214
administrator/components/com_attachments/attachments.xml
Normal file
214
administrator/components/com_attachments/attachments.xml
Normal file
@ -0,0 +1,214 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<extension type="component" version="2.5.7" method="upgrade">
|
||||
<name>com_attachments</name>
|
||||
<version>3.2.6</version>
|
||||
<creationDate>March 26, 2018</creationDate>
|
||||
<author>Jonathan M. Cameron</author>
|
||||
<authorEmail>jmcameron@jmcameron.net</authorEmail>
|
||||
<authorUrl>http://joomlacode.org/gf/project/attachments3/</authorUrl>
|
||||
<copyright>(C) 2007-2018 Jonathan M. Cameron. All rights reserved.</copyright>
|
||||
<license>http://www.gnu.org/licenses/gpl-3.0.html GNU/GPL</license>
|
||||
<description>ATTACH_ATTACHMENTS_COMPONENT_DESCRIPTION</description>
|
||||
|
||||
<scriptfile>install.attachments.php</scriptfile>
|
||||
|
||||
<install>
|
||||
<sql>
|
||||
<file driver="mysql" charset="utf8">sql/install.mysql.sql</file>
|
||||
</sql>
|
||||
</install>
|
||||
|
||||
<update>
|
||||
<schemas>
|
||||
<schemapath type="mysql">sql/updates/mysql</schemapath>
|
||||
</schemas>
|
||||
</update>
|
||||
|
||||
<uninstall>
|
||||
<sql>
|
||||
<file driver="mysql" charset="utf8">sql/uninstall.mysql.sql</file>
|
||||
</sql>
|
||||
</uninstall>
|
||||
|
||||
<files folder="site">
|
||||
<filename>attachments.php</filename>
|
||||
<filename>controller.php</filename>
|
||||
<filename>controllers/attachments.php</filename>
|
||||
<filename>controllers/index.html</filename>
|
||||
<filename>defines.php</filename>
|
||||
<filename>file_types.php</filename>
|
||||
<filename>helper.php</filename>
|
||||
<filename>javascript.php</filename>
|
||||
<filename>legacy/controller.php</filename>
|
||||
<filename>legacy/controller_form.php</filename>
|
||||
<filename>legacy/model.php</filename>
|
||||
<filename>legacy/view.php</filename>
|
||||
<filename>legacy/index.html</filename>
|
||||
<filename>index.html</filename>
|
||||
<filename>models/attachment.php</filename>
|
||||
<filename>models/attachments.php</filename>
|
||||
<filename>models/index.html</filename>
|
||||
<filename>router.php</filename>
|
||||
<filename>views/attachments/index.html</filename>
|
||||
<filename>views/attachments/metadata.xml</filename>
|
||||
<filename>views/attachments/tmpl/default.php</filename>
|
||||
<filename>views/attachments/tmpl/default.xml</filename>
|
||||
<filename>views/attachments/tmpl/index.html</filename>
|
||||
<filename>views/attachments/view.html.php</filename>
|
||||
<filename>views/attachments/view.raw.php</filename>
|
||||
<filename>views/index.html</filename>
|
||||
<filename>views/login/index.html</filename>
|
||||
<filename>views/login/view.html.php</filename>
|
||||
<filename>views/login/tmpl/index.html</filename>
|
||||
<filename>views/login/tmpl/default.php</filename>
|
||||
<filename>views/update/index.html</filename>
|
||||
<filename>views/update/metadata.xml</filename>
|
||||
<filename>views/update/view.html.php</filename>
|
||||
<filename>views/update/tmpl/default.php</filename>
|
||||
<filename>views/update/tmpl/index.html</filename>
|
||||
<filename>views/upload/index.html</filename>
|
||||
<filename>views/upload/metadata.xml</filename>
|
||||
<filename>views/upload/view.html.php</filename>
|
||||
<filename>views/upload/tmpl/default.php</filename>
|
||||
<filename>views/upload/tmpl/index.html</filename>
|
||||
<filename>views/warning/index.html</filename>
|
||||
<filename>views/warning/tmpl/default.php</filename>
|
||||
<filename>views/warning/tmpl/index.html</filename>
|
||||
<filename>views/warning/view.html.php</filename>
|
||||
<filename>views/view.php</filename>
|
||||
<folder>language</folder>
|
||||
</files>
|
||||
|
||||
<administration>
|
||||
<menu img="../media/com_attachments/images/attachments.png">ATTACH_ATTACHMENTS</menu>
|
||||
<submenu>
|
||||
<menu link="option=com_attachments&task=attachment.add" img="class:newarticle">ATTACH_ADD_NEW_ATTACHMENT</menu>
|
||||
<menu link="option=com_attachments&task=params.edit" img="class:config">JTOOLBAR_OPTIONS</menu>
|
||||
</submenu>
|
||||
|
||||
<files folder="admin">
|
||||
<filename>attachments.php</filename>
|
||||
<filename>access.xml</filename>
|
||||
<filename>config.xml</filename>
|
||||
<filename>controller.php</filename>
|
||||
<filename>controllers/attachment.php</filename>
|
||||
<filename>controllers/attachments.php</filename>
|
||||
<filename>controllers/index.html</filename>
|
||||
<filename>controllers/list.php</filename>
|
||||
<filename>controllers/params.php</filename>
|
||||
<filename>controllers/special.php</filename>
|
||||
<filename>controllers/utils.php</filename>
|
||||
<filename>import.php</filename>
|
||||
<filename>index.html</filename>
|
||||
<filename>models/attachment.php</filename>
|
||||
<filename>models/attachments.php</filename>
|
||||
<filename>models/fields/accesslevels.php</filename>
|
||||
<filename>models/fields/iconfilenames.php</filename>
|
||||
<filename>models/fields/index.html</filename>
|
||||
<filename>models/forms/attachment.xml</filename>
|
||||
<filename>models/forms/index.html</filename>
|
||||
<filename>models/index.html</filename>
|
||||
<filename>permissions.php</filename>
|
||||
<filename>sql/index.html</filename>
|
||||
<filename>sql/install.mysql.sql</filename>
|
||||
<filename>sql/uninstall.mysql.sql</filename>
|
||||
<filename>tables/attachment.php</filename>
|
||||
<filename>tables/index.html</filename>
|
||||
<filename>update.php</filename>
|
||||
<filename>views/add/index.html</filename>
|
||||
<filename>views/add/tmpl/default.php</filename>
|
||||
<filename>views/add/tmpl/index.html</filename>
|
||||
<filename>views/add/view.html.php</filename>
|
||||
<filename>views/attachments/index.html</filename>
|
||||
<filename>views/attachments/tmpl/default_body.php</filename>
|
||||
<filename>views/attachments/tmpl/default_filter.php</filename>
|
||||
<filename>views/attachments/tmpl/default_foot.php</filename>
|
||||
<filename>views/attachments/tmpl/default_head.php</filename>
|
||||
<filename>views/attachments/tmpl/default.php</filename>
|
||||
<filename>views/attachments/tmpl/index.html</filename>
|
||||
<filename>views/attachments/view.html.php</filename>
|
||||
<filename>views/edit/index.html</filename>
|
||||
<filename>views/edit/tmpl/default.php</filename>
|
||||
<filename>views/edit/tmpl/index.html</filename>
|
||||
<filename>views/edit/view.html.php</filename>
|
||||
<filename>views/entity/index.html</filename>
|
||||
<filename>views/entity/tmpl/default.php</filename>
|
||||
<filename>views/entity/tmpl/index.html</filename>
|
||||
<filename>views/entity/view.html.php</filename>
|
||||
<filename>views/help/index.html</filename>
|
||||
<filename>views/help/helpview.php</filename>
|
||||
<filename>views/help/tmpl/default.php</filename>
|
||||
<filename>views/help/tmpl/index.html</filename>
|
||||
<filename>views/help/view.html.php</filename>
|
||||
<filename>views/index.html</filename>
|
||||
<filename>views/params/index.html</filename>
|
||||
<filename>views/params/view.html.php</filename>
|
||||
<filename>views/params/tmpl/default.php</filename>
|
||||
<filename>views/params/tmpl/index.html</filename>
|
||||
<filename>views/utils/index.html</filename>
|
||||
<filename>views/utils/view.html.php</filename>
|
||||
<filename>views/utils/tmpl/default.php</filename>
|
||||
<filename>views/utils/tmpl/index.html</filename>
|
||||
<filename>views/warning/index.html</filename>
|
||||
<filename>views/warning/tmpl/default.php</filename>
|
||||
<filename>views/warning/tmpl/index.html</filename>
|
||||
<filename>views/warning/view.html.php</filename>
|
||||
<filename>Changelog.php</filename>
|
||||
<folder>sql/updates</folder>
|
||||
<folder>language</folder>
|
||||
</files>
|
||||
</administration>
|
||||
|
||||
<media destination="com_attachments" folder="media">
|
||||
<filename>index.html</filename>
|
||||
<filename>css/index.html</filename>
|
||||
<filename>css/add_attachment_button.css</filename>
|
||||
<filename>css/add_attachment_button_rtl.css</filename>
|
||||
<filename>css/attachments_admin.css</filename>
|
||||
<filename>css/attachments_admin_form.css</filename>
|
||||
<filename>css/attachments_admin_form_rtl.css</filename>
|
||||
<filename>css/attachments_admin_rtl.css</filename>
|
||||
<filename>css/attachments_admin_utils.css</filename>
|
||||
<filename>css/attachments_admin_utils_rtl.css</filename>
|
||||
<filename>css/attachments_frontend_form.css</filename>
|
||||
<filename>css/attachments_frontend_form_rtl.css</filename>
|
||||
<filename>css/attachments_hide.css</filename>
|
||||
<filename>css/attachments_help.css</filename>
|
||||
<filename>css/attachments_list.css</filename>
|
||||
<filename>css/attachments_list_rtl.css</filename>
|
||||
<filename>css/attachments_quickicon.css</filename>
|
||||
<filename>css/insert_attachments_token_button.css</filename>
|
||||
<filename>css/insert_attachments_token_button_rtl.css</filename>
|
||||
<filename>images/index.html</filename>
|
||||
<filename>images/add_attachment.gif</filename>
|
||||
<filename>images/add_attachment_button.png</filename>
|
||||
<filename>images/add_attachment_button_rtl.png</filename>
|
||||
<filename>images/add_attachment_button_small.png</filename>
|
||||
<filename>images/add_attachment_button_small_rtl.png</filename>
|
||||
<filename>images/attachment.gif</filename>
|
||||
<filename>images/attachments.png</filename>
|
||||
<filename>images/attachments_help_logo32.png</filename>
|
||||
<filename>images/attachments_logo32.png</filename>
|
||||
<filename>images/attachments_logo48.png</filename>
|
||||
<filename>images/attachments_utils32.png</filename>
|
||||
<filename>images/delete.gif</filename>
|
||||
<filename>images/download.gif</filename>
|
||||
<filename>images/insert_attachments_token_button.png</filename>
|
||||
<filename>images/insert_attachments_token_button_rtl.png</filename>
|
||||
<filename>images/insert_attachments_token_button_small.png</filename>
|
||||
<filename>images/insert_attachments_token_button_small_rtl.png</filename>
|
||||
<filename>images/pencil.gif</filename>
|
||||
<filename>images/update.gif</filename>
|
||||
<filename>js/index.html</filename>
|
||||
<filename>js/attachments_caching.js</filename>
|
||||
<filename>js/attachments_refresh.js</filename>
|
||||
<folder>images/file_icons</folder>
|
||||
<folder>images/help</folder>
|
||||
</media>
|
||||
|
||||
<!-- Install the package language file this way since it is not clear how to install it directly with the package installer -->
|
||||
<languages folder="site">
|
||||
<language tag="en-GB">en-GB.pkg_attachments.sys.ini</language>
|
||||
</languages>
|
||||
|
||||
</extension>
|
||||
257
administrator/components/com_attachments/config.xml
Normal file
257
administrator/components/com_attachments/config.xml
Normal file
@ -0,0 +1,257 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<config>
|
||||
<fieldset name="basic" id="attachments-fieldset"
|
||||
label="ATTACH_CONFIG_BASIC_SETTINGS_LABEL"
|
||||
addfieldpath="/administrator/components/com_attachments/models/fields"
|
||||
>
|
||||
<field name="publish_default" type="radio" default="0" class="btn-group"
|
||||
label="ATTACH_ATTACHMENTS_PUBLISHED_BY_DEFAULT"
|
||||
description="ATTACH_ATTACHMENTS_PUBLISHED_BY_DEFAULT_DESCRIPTION">
|
||||
<option value="1">JYES</option>
|
||||
<option value="0">JNO</option>
|
||||
</field>
|
||||
<field name="auto_publish_warning" type="textarea" default=""
|
||||
label="ATTACH_AUTO_PUBLISH_WARNING" rows="2" cols="60"
|
||||
description="ATTACH_AUTO_PUBLISH_WARNING_DESCRIPTION">
|
||||
</field>
|
||||
<field name="default_access_level" type="accesslevels" default="2"
|
||||
label="ATTACH_DEFAULT_ACCESS_LEVEL"
|
||||
description="ATTACH_DEFAULT_ACCESS_LEVEL_DESCRIPTION"
|
||||
/>
|
||||
<field name="user_field_1_name" type="text" default=""
|
||||
label="ATTACH_USER_DEFINED_FIELD_1_NAME" size="40"
|
||||
description="ATTACH_USER_DEFINED_FIELD_NAME_DESCRIPTION">
|
||||
</field>
|
||||
<field name="user_field_2_name" type="text" default=""
|
||||
label="ATTACH_USER_DEFINED_FIELD_2_NAME" size="40"
|
||||
description="ATTACH_USER_DEFINED_FIELD_NAME_DESCRIPTION">
|
||||
</field>
|
||||
<field name="user_field_3_name" type="text" default=""
|
||||
label="ATTACH_USER_DEFINED_FIELD_3_NAME" size="40"
|
||||
description="ATTACH_USER_DEFINED_FIELD_NAME_DESCRIPTION">
|
||||
</field>
|
||||
<field name="max_filename_length" type="text" default="0"
|
||||
label="ATTACH_MAX_FILENAME_URL_LENGTH" size="2" filter="integer"
|
||||
description="ATTACH_MAX_FILENAME_URL_LENGTH_DESCRIPTION">
|
||||
</field>
|
||||
<field name="attachments_placement" type="list" default="end"
|
||||
label="ATTACH_WHERE_SHOULD_ATTACHMENTS_BE_PLACED"
|
||||
description="ATTACH_WHERE_SHOULD_ATTACHMENTS_BE_PLACED_DESCRIPTION">
|
||||
<option value="beginning">ATTACH_AT_THE_BEGINNING</option>
|
||||
<option value="end">ATTACH_AT_THE_END</option>
|
||||
<option value="custom">ATTACH_CUSTOM_PLACEMENT</option>
|
||||
<option value="disabled_filter">ATTACH_DISABLED_FILTER</option>
|
||||
<option value="disabled_nofilter">ATTACH_DISABLED_NOFILTER</option>
|
||||
</field>
|
||||
<field name="allow_frontend_access_editing" type="radio" default="0" class="btn-group"
|
||||
label="ATTACH_ALLOW_FRONTEND_ACCESS_LEVEL_EDITING"
|
||||
description="ATTACH_ALLOW_FRONTEND_ACCESS_LEVEL_EDITING_DESCRIPTION">
|
||||
<option value="1">JYES</option>
|
||||
<option value="0">JNO</option>
|
||||
</field>
|
||||
</fieldset>
|
||||
|
||||
<fieldset name="formatting"
|
||||
label="ATTACH_CONFIG_FORMATTING_SETTINGS_LABEL">
|
||||
<field name="show_column_titles" type="radio" default="0" class="btn-group"
|
||||
label="ATTACH_SHOW_COLUMN_TITLES"
|
||||
description="ATTACH_SHOW_COLUMN_TITLES_DESCRIPTION">
|
||||
<option value="1">JYES</option>
|
||||
<option value="0">JNO</option>
|
||||
</field>
|
||||
<field name="show_description" type="radio" default="1" class="btn-group"
|
||||
label="ATTACH_SHOW_ATTACHMENT_DESCRIPTION"
|
||||
description="ATTACH_SHOW_ATTACHMENT_DESCRIPTION_DESCRIPTION">
|
||||
<option value="1">JYES</option>
|
||||
<option value="0">JNO</option>
|
||||
</field>
|
||||
<field name="show_creator_name" type="radio" default="0" class="btn-group"
|
||||
label="ATTACH_SHOW_ATTACHMENT_CREATOR"
|
||||
description="ATTACH_SHOW_ATTACHMENT_CREATOR_DESCRIPTION">
|
||||
<option value="1">JYES</option>
|
||||
<option value="0">JNO</option>
|
||||
</field>
|
||||
<field name="show_file_size" type="radio" default="1" class="btn-group"
|
||||
label="ATTACH_SHOW_ATTACHMENT_FILE_SIZE"
|
||||
description="ATTACH_SHOW_ATTACHMENT_FILE_SIZE_DESCRIPTION">
|
||||
<option value="1">JYES</option>
|
||||
<option value="0">JNO</option>
|
||||
</field>
|
||||
<field name="show_downloads" type="radio" default="0" class="btn-group"
|
||||
label="ATTACH_SHOW_NUMBER_OF_DOWNLOADS"
|
||||
description="ATTACH_SHOW_NUMBER_OF_DOWNLOADS_DESCRIPTION">
|
||||
<option value="1">JYES</option>
|
||||
<option value="0">JNO</option>
|
||||
</field>
|
||||
<field name="show_created_date" type="radio" default="0" class="btn-group"
|
||||
label="ATTACH_SHOW_CREATION_DATE"
|
||||
description="ATTACH_SHOW_CREATION_DATE_DESCRIPTION">
|
||||
<option value="1">JYES</option>
|
||||
<option value="0">JNO</option>
|
||||
</field>
|
||||
<field name="show_modified_date" type="radio" default="0" class="btn-group"
|
||||
label="ATTACH_SHOW_MODIFICATION_DATE"
|
||||
description="ATTACH_SHOW_MODIFICATION_DATE_DESCRIPTION">
|
||||
<option value="1">JYES</option>
|
||||
<option value="0">JNO</option>
|
||||
</field>
|
||||
<field name="date_format" type="text" default="Y-m-d H:i"
|
||||
label="ATTACH_FORMAT_STRING_FOR_DATES" size="30"
|
||||
description="ATTACH_FORMAT_STRING_FOR_DATES_DESCRIPTION">
|
||||
</field>
|
||||
<field name="sort_order" type="list" default="filename"
|
||||
label="ATTACH_ATTACHMENTS_LIST_ORDER"
|
||||
description="ATTACH_ATTACHMENTS_LIST_ORDER_DESCRIPTION">
|
||||
<option value="filename">ATTACH_SORT_FILENAME</option>
|
||||
<option value="filename_desc">ATTACH_SORT_FILENAME_DESCENDING</option>
|
||||
<option value="file_size">ATTACH_SORT_FILE_SIZE</option>
|
||||
<option value="file_size_desc">ATTACH_SORT_FILE_SIZE_DESCENDING</option>
|
||||
<option value="description">ATTACH_SORT_DESCRIPTION</option>
|
||||
<option value="description_desc">ATTACH_SORT_DESCRIPTION_DESCENDING</option>
|
||||
<option value="display_name">ATTACH_SORT_DISPLAY_FILENAME_OR_URL</option>
|
||||
<option value="display_name_desc">ATTACH_SORT_DISPLAY_FILENAME_OR_URL_DESCENDING</option>
|
||||
<option value="creator">ATTACH_CREATOR</option>
|
||||
<option value="created">ATTACH_SORT_CREATED_DATE</option>
|
||||
<option value="created_desc">ATTACH_SORT_CREATED_DATE_DESCENDING</option>
|
||||
<option value="modified">ATTACH_SORT_MODIFICATION_DATE</option>
|
||||
<option value="modified_desc">ATTACH_SORT_MODIFICATION_DATE_DESCENDING</option>
|
||||
<option value="id">ATTACH_SORT_ATTACHMENT_ID</option>
|
||||
<option value="user_field_1">ATTACH_USER_DEFINED_FIELD_1</option>
|
||||
<option value="user_field_1_desc">ATTACH_SORT_USER_DEFINED_FIELD_1_DESC</option>
|
||||
<option value="user_field_2">ATTACH_USER_DEFINED_FIELD_2</option>
|
||||
<option value="user_field_2_desc">ATTACH_SORT_USER_DEFINED_FIELD_2_DESC</option>
|
||||
<option value="user_field_3">ATTACH_USER_DEFINED_FIELD_3</option>
|
||||
<option value="user_field_3_desc">ATTACH_SORT_USER_DEFINED_FIELD_3_DESC</option>
|
||||
</field>
|
||||
</fieldset>
|
||||
|
||||
<fieldset name="visibility"
|
||||
label="ATTACH_CONFIG_VISIBILITY_SETTINGS_LABEL">
|
||||
<field name="hide_on_frontpage" type="radio" default="0" class="btn-group"
|
||||
label="ATTACH_HIDE_ATTACHMENTS_ON_FRONTPAGE"
|
||||
description="ATTACH_HIDE_ATTACHMENTS_ON_FRONTPAGE_DESCRIPTION">
|
||||
<option value="1">JYES</option>
|
||||
<option value="0">JNO</option>
|
||||
</field>
|
||||
<field name="hide_with_readmore" type="radio" default="0" class="btn-group"
|
||||
label="ATTACH_HIDE_ATTACHMENTS_WITH_READMORE"
|
||||
description="ATTACH_HIDE_ATTACHMENTS_WITH_READMORE_DESCRIPTION">
|
||||
<option value="1">JYES</option>
|
||||
<option value="0">JNO</option>
|
||||
</field>
|
||||
<field name="hide_on_blogs" type="radio" default="0" class="btn-group"
|
||||
label="ATTACH_HIDE_ATTACHMENTS_ON_BLOGS"
|
||||
description="ATTACH_HIDE_ATTACHMENTS_ON_BLOGS_DESCRIPTION">
|
||||
<option value="1">JYES</option>
|
||||
<option value="0">JNO</option>
|
||||
</field>
|
||||
<field name="hide_except_article_views" type="radio" default="0" class="btn-group"
|
||||
label="ATTACH_HIDE_ATTACHMENTS_EXCEPT_ON_ARTICLE_VIEWS"
|
||||
description="ATTACH_HIDE_ATTACHMENTS_EXCEPT_ON_ARTICLE_VIEWS_DESCRIPTION">
|
||||
<option value="1">JYES</option>
|
||||
<option value="0">JNO</option>
|
||||
</field>
|
||||
<field name="always_show_category_attachments" type="radio" default="0" class="btn-group"
|
||||
label="ATTACH_ALWAYS_SHOW_CATEGORY_ATTACHMENTS"
|
||||
description="ATTACH_ALWAYS_SHOW_CATEGORY_ATTACHMENTS_DESCRIPTION">
|
||||
<option value="1">JYES</option>
|
||||
<option value="0">JNO</option>
|
||||
</field>
|
||||
<field name="hide_attachments_for_categories" type="category" default=""
|
||||
label="ATTACH_HIDE_ATTACHMENTS_FOR_CATEGORIES" size="8"
|
||||
extension="com_content" multiple="multiple"
|
||||
description="ATTACH_HIDE_ATTACHMENTS_FOR_CATEGORIES_DESCRIPTION">
|
||||
</field>
|
||||
<field name="show_guest_access_levels" type="accesslevels" default="[1]"
|
||||
extension="com_attachments" multiple="multiple" size="3"
|
||||
label="ATTACH_SHOW_GUEST_ACCESS_LEVELS"
|
||||
description="ATTACH_SHOW_GUEST_ACCESS_LEVELS_DESCRIPTION"
|
||||
/>
|
||||
<field name="hide_add_attachments_link" type="radio" default="0" class="btn-group"
|
||||
label="ATTACH_HIDE_ADD_ATTACHMENTS_LINK"
|
||||
description="ATTACH_HIDE_ADD_ATTACHMENTS_LINK_DESCRIPTION">
|
||||
<option value="1">JYES</option>
|
||||
<option value="0">JNO</option>
|
||||
</field>
|
||||
</fieldset>
|
||||
|
||||
<fieldset name="advanced"
|
||||
label="ATTACH_CONFIG_ADVANCED_SETTINGS_LABEL">
|
||||
<field name="max_attachment_size" type="text" size="50" default="0" filter="integer"
|
||||
label="ATTACH_MAX_ATTACHMENT_SIZE"
|
||||
description="ATTACH_MAX_ATTACHMENT_SIZE_DESCRIPTION" />
|
||||
<field name="forbidden_filename_characters" type="text" default="#=?%&"
|
||||
label="ATTACH_FORBIDDEN_FILENAME_CHARACTERS" size="40"
|
||||
description="ATTACH_FORBIDDEN_FILENAME_CHARACTERS_DESCRIPTION">
|
||||
</field>
|
||||
<field name="attachments_table_style" type="text" default="attachmentsList"
|
||||
label="ATTACH_CSS_STYLE_FOR_ATTACHMENTS_TABLES" size="40"
|
||||
description="ATTACH_CSS_STYLE_FOR_ATTACHMENTS_TABLES_DESCRIPTION">
|
||||
</field>
|
||||
<field name="file_link_open_mode" type="radio" default="in_same_window" class="btn-group"
|
||||
label="ATTACH_FILE_LINK_OPEN_MODE"
|
||||
description="ATTACH_FILE_LINK_OPEN_MODE_DESCRIPTION">
|
||||
<option value="in_same_window">ATTACH_IN_SAME_WINDOW</option>
|
||||
<option value="new_window">ATTACH_IN_NEW_WINDOW</option>
|
||||
</field>
|
||||
<field name="attachments_titles" type="textarea" default=""
|
||||
label="ATTACH_CUSTOM_TITLES_FOR_ATTACHMENTS_LISTS" rows="3" cols="60"
|
||||
description="ATTACH_CUSTOM_TITLES_FOR_ATTACHMENTS_LISTS_DESCRIPTION">
|
||||
</field>
|
||||
<field name="link_check_timeout" type="text" default="10"
|
||||
label="ATTACH_TIMEOUT_FOR_CHECKING_LINKS" size="3"
|
||||
description="ATTACH_TIMEOUT_FOR_CHECKING_LINKS_DESCRIPTION">
|
||||
</field>
|
||||
<field name="superimpose_url_link_icons" type="radio" default="1" class="btn-group"
|
||||
label="ATTACH_SUPERIMPOSE_URL_LINK_ICONS"
|
||||
description="ATTACH_SUPERIMPOSE_URL_LINK_ICONS_DESCRIPTION">
|
||||
<option value="1">JYES</option>
|
||||
<option value="0">JNO</option>
|
||||
</field>
|
||||
<field name="suppress_obsolete_attachments" type="radio" default="0" class="btn-group"
|
||||
label="ATTACH_SUPPRESS_OBSOLETE_ATTACHMENTS"
|
||||
description="ATTACH_SUPPRESS_OBSOLETE_ATTACHMENTS_DESCRIPTION">
|
||||
<option value="1">JYES</option>
|
||||
<option value="0">JNO</option>
|
||||
</field>
|
||||
<field name="login_url" type="text"
|
||||
default="index.php?option=com_users&view=login"
|
||||
label="ATTACH_URL_TO_LOGIN" size="65"
|
||||
description="ATTACH_URL_TO_LOGIN_DESCRIPTION">
|
||||
</field>
|
||||
<field name="register_url" type="text"
|
||||
default="index.php?option=com_users&view=registration"
|
||||
label="ATTACH_URL_TO_REGISTER" size="65"
|
||||
description="ATTACH_URL_TO_REGISTER_DESCRIPTION">
|
||||
</field>
|
||||
|
||||
</fieldset>
|
||||
|
||||
<fieldset name="security"
|
||||
label="ATTACH_CONFIG_SECURITY_SETTINGS_LABEL">
|
||||
<field name="secure" type="radio" default="0" class="btn-group"
|
||||
label="ATTACH_SECURE_ATTACHMENT_DOWNLOADS"
|
||||
description="ATTACH_SECURE_ATTACHMENT_DOWNLOADS_DESCRIPTION">
|
||||
<option value="1">JYES</option>
|
||||
<option value="0">JNO</option>
|
||||
</field>
|
||||
<field name="download_mode" type="radio" default="inline" class="btn-group"
|
||||
label="ATTACH_DOWNLOAD_MODE_FOR_SECURE_DOWNLOADS"
|
||||
description="ATTACH_DOWNLOAD_MODE_FOR_SECURE_DOWNLOADS_DESCRIPTION">
|
||||
<option value="inline">ATTACH_INLINE</option>
|
||||
<option value="attachment">ATTACH_ATTACHMENT</option>
|
||||
</field>
|
||||
</fieldset>
|
||||
|
||||
<fieldset name="permissions"
|
||||
label="JCONFIG_PERMISSIONS_LABEL"
|
||||
description="ATTACH_PERMISSIONS_DESC">
|
||||
<field name="rules" type="rules"
|
||||
component="com_attachments"
|
||||
filter="rules"
|
||||
validate="rules"
|
||||
label="JCONFIG_PERMISSIONS_LABEL"
|
||||
section="component" />
|
||||
</fieldset>
|
||||
|
||||
</config>
|
||||
275
administrator/components/com_attachments/controller.php
Normal file
275
administrator/components/com_attachments/controller.php
Normal file
@ -0,0 +1,275 @@
|
||||
<?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
|
||||
*/
|
||||
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
/** Define the legacy classes, if necessary */
|
||||
require_once(JPATH_SITE.'/components/com_attachments/legacy/controller.php');
|
||||
|
||||
|
||||
/**
|
||||
* Define the main attachments controller class
|
||||
*
|
||||
* @package Attachments
|
||||
*/
|
||||
class AttachmentsController extends JControllerLegacy
|
||||
{
|
||||
|
||||
/** List the attachments
|
||||
*
|
||||
* @param bool $cachable If true, the view output will be cached
|
||||
* @param array $urlparams (ignored)
|
||||
* @return void
|
||||
*/
|
||||
public function display($cachable = false, $urlparams = false)
|
||||
{
|
||||
// Set the default view (if not specified)
|
||||
JRequest::setVar('view', JRequest::getCmd('view', 'Attachments'));
|
||||
|
||||
// Call parent to display
|
||||
parent::display($cachable);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Set up to display the entity selection view
|
||||
*
|
||||
* This allows users to select entities (sections, categories, and other
|
||||
* content items that are supported with Attachments plugins).
|
||||
*/
|
||||
public function selectEntity()
|
||||
{
|
||||
// Get the parent type
|
||||
$parent_type = JRequest::getCmd('parent_type');
|
||||
if ( !$parent_type ) {
|
||||
$errmsg = JText::sprintf('ATTACH_ERROR_INVALID_PARENT_TYPE_S', $parent_type) .
|
||||
$db->getErrorMsg() . ' (ERR 65)';
|
||||
JError::raiseError(500, $errmsg);
|
||||
}
|
||||
|
||||
// Parse the parent type and entity
|
||||
$parent_entity = JRequest::getCmd('parent_entity', 'default');
|
||||
if ( strpos($parent_type, '.') ) {
|
||||
$parts = explode('.', $parent_type);
|
||||
$parent_type = $parts[0];
|
||||
$parent_entity = $parts[1];
|
||||
}
|
||||
|
||||
// Get the content parent object
|
||||
JPluginHelper::importPlugin('attachments');
|
||||
$apm = getAttachmentsPluginManager();
|
||||
$parent = $apm->getAttachmentsPlugin($parent_type);
|
||||
$parent_entity = $parent->getCanonicalEntityId($parent_entity);
|
||||
$parent_entity_name = JText::_('ATTACH_' . $parent_entity);
|
||||
|
||||
// Get the URL to repost (for filtering)
|
||||
$post_url = $parent->getSelectEntityURL($parent_entity);
|
||||
|
||||
// Set up the display lists
|
||||
$lists = Array();
|
||||
|
||||
// table ordering
|
||||
$app = JFactory::getApplication();
|
||||
$filter_order =
|
||||
$app->getUserStateFromRequest('com_attachments.selectEntity.filter_order',
|
||||
'filter_order', '', 'cmd');
|
||||
$filter_order_Dir =
|
||||
$app->getUserStateFromRequest('com_attachments.selectEntity.filter_order_Dir',
|
||||
'filter_order_Dir','', 'word');
|
||||
$lists['order_Dir'] = $filter_order_Dir;
|
||||
$lists['order'] = $filter_order;
|
||||
|
||||
// search filter
|
||||
$search_filter = $app->getUserStateFromRequest('com_attachments.selectEntity.search',
|
||||
'search', '', 'string' );
|
||||
$lists['search'] = $search_filter;
|
||||
|
||||
// Get the list of items to display
|
||||
$items = $parent->getEntityItems($parent_entity, $search_filter);
|
||||
|
||||
// Set up the view
|
||||
require_once(JPATH_COMPONENT_ADMINISTRATOR.'/views/entity/view.html.php');
|
||||
$view = new AttachmentsViewEntity( );
|
||||
$view->option = JRequest::getCmd('option');
|
||||
$view->from = 'closeme';
|
||||
$view->post_url = $post_url;
|
||||
$view->parent_type = $parent_type;
|
||||
$view->parent_entity = $parent_entity;
|
||||
$view->parent_entity_name = $parent_entity_name;
|
||||
$view->lists = $lists;
|
||||
$view->items = $items;
|
||||
|
||||
$view->display();
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Display links for the admin Utility functions
|
||||
*/
|
||||
public function adminUtils()
|
||||
{
|
||||
// Access check
|
||||
if (!JFactory::getUser()->authorise('core.admin', 'com_attachments')) {
|
||||
return JError::raiseError(404, JText::_('JERROR_ALERTNOAUTHOR') . ' (ERR 66)');
|
||||
}
|
||||
|
||||
// Set up the tooltip behavior
|
||||
$opts = Array( 'hideDelay' => 0, 'showDelay' => 0 );
|
||||
JHtml::_('behavior.tooltip', '.hasTip', $opts);
|
||||
|
||||
// Set up url/link/tooltip for each command
|
||||
$uri = JFactory::getURI();
|
||||
$url_top = $uri->base(true) . "/index.php?option=com_attachments&controller=special";
|
||||
$closeme = '&tmpl=component&close=1';
|
||||
|
||||
// Set up the array of entries
|
||||
$entries = Array();
|
||||
|
||||
// Set up the HTML for the 'Disable MySQL uninstallation' command
|
||||
$disable_mysql_uninstall_url =
|
||||
"$url_top&task=utils.disable_sql_uninstall" . $closeme;
|
||||
$disable_mysql_uninstall_tooltip =
|
||||
JText::_('ATTACH_DISABLE_MYSQL_UNINSTALLATION') . '::' . JText::_('ATTACH_DISABLE_MYSQL_UNINSTALLATION_TOOLTIP');
|
||||
$entries[] = JHtml::_('tooltip', $disable_mysql_uninstall_tooltip, null, null,
|
||||
JText::_('ATTACH_DISABLE_MYSQL_UNINSTALLATION'),
|
||||
$disable_mysql_uninstall_url );
|
||||
|
||||
// Set up the HTML for the 'Reinstall Attachments Permissions' command
|
||||
$reinstall_permissions_url = "$url_top&task=utils.reinstall_permissions" . $closeme;
|
||||
$reinstall_permissions_tooltip = JText::_('ATTACH_REINSTALL_PERMISSIONS') . '::' . JText::_('ATTACH_REINSTALL_PERMISSIONS_TOOLTIP');
|
||||
$entries[] = JHtml::_('tooltip', $reinstall_permissions_tooltip, null, null,
|
||||
JText::_('ATTACH_REINSTALL_PERMISSIONS'), $reinstall_permissions_url);
|
||||
|
||||
// Set up the HTML for the 'Regenerate attachment system filenames' command
|
||||
$regenerate_system_filenames_url =
|
||||
"$url_top&task=utils.regenerate_system_filenames" . $closeme;
|
||||
$regenerate_system_filenames_tooltip =
|
||||
JText::_('ATTACH_REGENERATE_ATTACHMENT_SYSTEM_FILENAMES') . '::' .
|
||||
JText::_('ATTACH_REGENERATE_ATTACHMENT_SYSTEM_FILENAMES_TOOLTIP');
|
||||
$entries[] = JHtml::_('tooltip', $regenerate_system_filenames_tooltip, null, null,
|
||||
JText::_('ATTACH_REGENERATE_ATTACHMENT_SYSTEM_FILENAMES'),
|
||||
$regenerate_system_filenames_url);
|
||||
|
||||
// Set up the HTML for the 'Remove spaces from system filenames' command
|
||||
$unspacify_system_filenames_url =
|
||||
"$url_top&task=utils.remove_spaces_from_system_filenames" . $closeme;
|
||||
$unspacify_system_filenames_tooltip =
|
||||
JText::_('ATTACH_DESPACE_ATTACHMENT_SYSTEM_FILENAMES') . '::' .
|
||||
JText::_('ATTACH_DESPACE_ATTACHMENT_SYSTEM_FILENAMES_TOOLTIP');
|
||||
$entries[] = JHtml::_('tooltip', $unspacify_system_filenames_tooltip, null, null,
|
||||
JText::_('ATTACH_DESPACE_ATTACHMENT_SYSTEM_FILENAMES'),
|
||||
$unspacify_system_filenames_url);
|
||||
|
||||
// Set up the HTML for the 'Update attachment file sizes' command
|
||||
$update_file_sizes_url =
|
||||
"$url_top&task=utils.update_file_sizes" . $closeme;
|
||||
$update_file_sizes_tooltip =
|
||||
JText::_('ATTACH_UPDATE_ATTACHMENT_FILE_SIZES') . '::' .
|
||||
JText::_('ATTACH_UPDATE_ATTACHMENT_FILE_SIZES_TOOLTIP');
|
||||
$entries[] = JHtml::_('tooltip', $update_file_sizes_tooltip, null, null,
|
||||
JText::_('ATTACH_UPDATE_ATTACHMENT_FILE_SIZES'),
|
||||
$update_file_sizes_url);
|
||||
|
||||
// Set up the HTML for the 'Check Files' command
|
||||
$check_files_url = "$url_top&task=utils.check_files" . $closeme;
|
||||
$check_files_tooltip = JText::_('ATTACH_CHECK_FILES') . '::' . JText::_('ATTACH_CHECK_FILES_TOOLTIP');
|
||||
$entries[] = JHtml::_('tooltip', $check_files_tooltip, null, null,
|
||||
JText::_('ATTACH_CHECK_FILES'), $check_files_url);
|
||||
|
||||
// Set up the HTML for the 'Validate URLs' command
|
||||
$validate_urls_url = "$url_top&task=utils.validate_urls" . $closeme;
|
||||
$validate_urls_tooltip = JText::_('ATTACH_VALIDATE_URLS') . '::' . JText::_('ATTACH_VALIDATE_URLS_TOOLTIP');
|
||||
$entries[] = JHtml::_('tooltip', $validate_urls_tooltip, null, null,
|
||||
JText::_('ATTACH_VALIDATE_URLS'), $validate_urls_url);
|
||||
|
||||
// Test ???
|
||||
// $utils_test_url = "$url_top&task=utils.test" . $closeme;
|
||||
// $utils_test_tooltip = 'Test';
|
||||
// $entries[] = JHtml::_('tooltip', $utils_test_tooltip, null, null, 'TEST', $utils_test_url);
|
||||
|
||||
// Get the view
|
||||
require_once(JPATH_COMPONENT_ADMINISTRATOR.'/views/utils/view.html.php');
|
||||
$view = new AttachmentsViewUtils();
|
||||
$view->entries = $entries;
|
||||
|
||||
$view->display();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return the attachments list as HTML (for use by Ajax)
|
||||
*/
|
||||
public function attachmentsList()
|
||||
{
|
||||
$parent_id = JRequest::getInt('parent_id', false);
|
||||
$parent_type = JRequest::getWord('parent_type', '');
|
||||
$parent_entity = JRequest::getWord('parent_entity', 'default');
|
||||
$show_links = JRequest::getBool('show_links', true);
|
||||
$allow_edit = JRequest::getBool('allow_edit', true);
|
||||
$from = JRequest::getWord('from', 'closeme');
|
||||
$title = '';
|
||||
|
||||
$response = '';
|
||||
|
||||
if ( ($parent_id === false) || ($parent_type == '') ) {
|
||||
return '';
|
||||
}
|
||||
|
||||
// Allow remapping of parent ID (eg, for Joomfish)
|
||||
$lang = JRequest::getWord('lang', '');
|
||||
if ($lang and jimport('attachments_remapper.remapper'))
|
||||
{
|
||||
$parent_id = AttachmentsRemapper::remapParentID($parent_id, $parent_type, $parent_entity);
|
||||
}
|
||||
|
||||
require_once(JPATH_ADMINISTRATOR.'/components/com_attachments/controllers/list.php');
|
||||
$controller = new AttachmentsControllerList();
|
||||
$response = $controller->displayString($parent_id, $parent_type, $parent_entity,
|
||||
$title, $show_links, $allow_edit, false, $from);
|
||||
echo $response;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/** Show the help page
|
||||
*/
|
||||
public function help()
|
||||
{
|
||||
// Set up the view
|
||||
require_once(JPATH_COMPONENT_ADMINISTRATOR . '/views/help/view.html.php');
|
||||
$view = new AttachmentsViewHelp();
|
||||
|
||||
// Load language(s)
|
||||
$view->lang = JFactory::getLanguage();
|
||||
|
||||
// Now load the help page file
|
||||
// (Load the component file first since the help pages share some items)
|
||||
if ( $view->lang->getTag() != 'en-GB' )
|
||||
{
|
||||
// First load English for any untranslated items
|
||||
$view->lang->load('com_attachments', dirname(__FILE__), 'en-GB');
|
||||
$view->lang->load('com_attachments.help', dirname(__FILE__), 'en-GB');
|
||||
}
|
||||
|
||||
// Load current language
|
||||
$view->lang->load('com_attachments', dirname(__FILE__), null, true);
|
||||
$view->lang->load('com_attachments.help', dirname(__FILE__), null, true);
|
||||
|
||||
// Call parent to display
|
||||
$view->display();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
1167
administrator/components/com_attachments/controllers/attachment.php
Normal file
1167
administrator/components/com_attachments/controllers/attachment.php
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,325 @@
|
||||
<?php
|
||||
/**
|
||||
* Attachments component attachments controller
|
||||
*
|
||||
* @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');
|
||||
|
||||
// import Joomla controlleradmin library
|
||||
jimport('joomla.application.component.controlleradmin');
|
||||
|
||||
/**
|
||||
* Attachments Controller
|
||||
*
|
||||
* @package Attachments
|
||||
*/
|
||||
class AttachmentsControllerAttachments extends JControllerAdmin
|
||||
{
|
||||
|
||||
/**
|
||||
* Method to get a model object, loading it if required.
|
||||
*
|
||||
* @param string The model name. Optional.
|
||||
* @param string The class prefix. Optional.
|
||||
* @param array Configuration array for model. Optional.
|
||||
*
|
||||
* @return object The model.
|
||||
*/
|
||||
public function getModel($name = 'Attachments', $prefix = 'AttachmentsModel', $config = array())
|
||||
{
|
||||
$model = parent::getModel($name, $prefix, array('ignore_request' => true));
|
||||
return $model;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Display the attachments list
|
||||
*
|
||||
* @param int $parent_id the id of the parent
|
||||
* @param string $parent_type the type of parent
|
||||
* @param string $parent_entity the type entity of the parent
|
||||
* @param string $title title to be shown above the list of articles. If null, use system defaults.
|
||||
* @param bool $show_file_links enable showing links for the filenames
|
||||
* @param bool $allow_edit enable showing edit/delete links (if permissions are okay)
|
||||
* @param bool $echo if true the output will be echoed; otherwise the results are returned.
|
||||
* @param string $from The 'from' info
|
||||
*
|
||||
* @return the string (if $echo is false)
|
||||
*/
|
||||
public function displayString($parent_id, $parent_type, $parent_entity,
|
||||
$title=null, $show_file_links=true, $allow_edit=true,
|
||||
$echo=true, $from=null)
|
||||
{
|
||||
$document = JFactory::getDocument();
|
||||
|
||||
// Get an instance of the model
|
||||
$this->addModelPath(JPATH_SITE.'/components/com_attachments/models');
|
||||
$model = $this->getModel('Attachments');
|
||||
if ( !$model ) {
|
||||
$errmsg = JText::_('ATTACH_ERROR_UNABLE_TO_FIND_MODEL') . ' (ERR 164)';
|
||||
JError::raiseError(500, $errmsg);
|
||||
}
|
||||
|
||||
$model->setParentId($parent_id, $parent_type, $parent_entity);
|
||||
|
||||
// Get the component parameters
|
||||
jimport('joomla.application.component.helper');
|
||||
$params = JComponentHelper::getParams('com_attachments');
|
||||
|
||||
// Set up to list the attachments for this artticle
|
||||
$sort_order = $params->get('sort_order', 'filename');
|
||||
$model->setSortOrder($sort_order);
|
||||
|
||||
// If none of the attachments should be visible, exit now
|
||||
if ( ! $model->someVisible() ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Get the view
|
||||
$this->addViewPath(JPATH_SITE.'/components/com_attachments/views');
|
||||
$viewType = $document->getType();
|
||||
$view = $this->getView('Attachments', $viewType);
|
||||
if ( !$view ) {
|
||||
$errmsg = JText::_('ATTACH_ERROR_UNABLE_TO_FIND_VIEW') . ' (ERR 165)';
|
||||
JError::raiseError(500, $errmsg);
|
||||
}
|
||||
$view->setModel($model);
|
||||
|
||||
// Construct the update URL template
|
||||
$update_url = "index.php?option=com_attachments&task=edit&cid[]=%d";
|
||||
$update_url .= "&from=$from&tmpl=component";
|
||||
$view->update_url = $update_url;
|
||||
|
||||
// Construct the delete URL template
|
||||
$delete_url = "index.php?option=com_attachments&task=attachment.delete_warning&id=%d";
|
||||
$delete_url .= "&parent_type=$parent_type&parent_entity=$parent_entity&parent_id=" . (int)$parent_id;
|
||||
$delete_url .= "&from=$from&tmpl=component";
|
||||
$view->delete_url = $delete_url;
|
||||
|
||||
// Set some display settings
|
||||
$view->title = $title;
|
||||
$view->show_file_links = $show_file_links;
|
||||
$view->allow_edit = $allow_edit;
|
||||
$view->from = $from;
|
||||
|
||||
// Get the view to generate the display output from the template
|
||||
if ( $view->display() === true ) {
|
||||
|
||||
// Display or return the results
|
||||
if ( $echo ) {
|
||||
echo $view->getOutput();
|
||||
}
|
||||
else {
|
||||
return $view->getOutput();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Delete attachment(s)
|
||||
*/
|
||||
public function delete()
|
||||
{
|
||||
// Check for request forgeries
|
||||
JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
|
||||
|
||||
// Get ready
|
||||
$app = JFactory::getApplication();
|
||||
jimport('joomla.filesystem.file');
|
||||
require_once(JPATH_SITE.'/components/com_attachments/helper.php');
|
||||
|
||||
// Get the attachments parent manager
|
||||
JPluginHelper::importPlugin('attachments');
|
||||
$apm = getAttachmentsPluginManager();
|
||||
|
||||
// Get attachments to remove from the request
|
||||
$cid = JRequest::getVar('cid', array(), '', 'array');
|
||||
$deleted_ids = Array();
|
||||
|
||||
if (count($cid))
|
||||
{
|
||||
$model = $this->getModel('Attachment');
|
||||
$attachment = $model->getTable();
|
||||
|
||||
|
||||
// Loop through the attachments and delete them one-by-one
|
||||
foreach ($cid as $attachment_id)
|
||||
{
|
||||
// Load the attachment object
|
||||
$id = (int)$attachment_id;
|
||||
if ( ($id == 0) OR !$attachment->load($id) ) {
|
||||
$errmsg = JText::sprintf('ATTACH_ERROR_CANNOT_DELETE_INVALID_ATTACHMENT_ID_N', $id) . ' (ERR 166)';
|
||||
JError::raiseError(500, $errmsg);
|
||||
}
|
||||
$parent_id = $attachment->parent_id;
|
||||
$parent_type = $attachment->parent_type;
|
||||
$parent_entity = $attachment->parent_entity;
|
||||
|
||||
// Get the article/parent handler
|
||||
JPluginHelper::importPlugin('attachments');
|
||||
$apm = getAttachmentsPluginManager();
|
||||
if ( !$apm->attachmentsPluginInstalled($parent_type) ) {
|
||||
$errmsg = JText::sprintf('ATTACH_ERROR_INVALID_PARENT_TYPE_S', $parent_type) . ' (ERR 167)';
|
||||
JError::raiseError(500, $errmsg);
|
||||
}
|
||||
$parent = $apm->getAttachmentsPlugin($parent_type);
|
||||
|
||||
// If we may not delete it, complain!
|
||||
if ( $parent->userMayDeleteAttachment($attachment) )
|
||||
{
|
||||
// Delete the actual file
|
||||
if ( JFile::exists($attachment->filename_sys) )
|
||||
{
|
||||
JFile::delete($attachment->filename_sys);
|
||||
AttachmentsHelper::clean_directory($attachment->filename_sys);
|
||||
}
|
||||
$deleted_ids[] = $id;
|
||||
}
|
||||
else
|
||||
{
|
||||
$parent_entity = $parent->getCanonicalEntityId($parent_entity);
|
||||
$errmsg = JText::sprintf('ATTACH_ERROR_NO_PERMISSION_TO_DELETE_S_ATTACHMENT_S_ID_N',
|
||||
$parent_entity, $attachment->filename, $id);
|
||||
$app->enqueueMessage($errmsg, 'warning');
|
||||
}
|
||||
}
|
||||
|
||||
// Delete entries in the attachments table for deleted attachments
|
||||
if (!empty($deleted_ids))
|
||||
{
|
||||
$db = JFactory::getDBO();
|
||||
$query = $db->getQuery(true);
|
||||
$query->delete('#__attachments')->where("id IN (".implode(',', $deleted_ids).")");
|
||||
$db->setQuery($query);
|
||||
if (!$db->query()) {
|
||||
$errmsg = $db->getErrorMsg() . ' (ERR 168)';
|
||||
JError::raiseError(500, $errmsg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Figure out how to redirect
|
||||
$from = JRequest::getWord('from');
|
||||
$known_froms = array('frontpage', 'article', 'editor', 'closeme');
|
||||
if ( in_array( $from, $known_froms ) )
|
||||
{
|
||||
// Get the parent info from the last attachment
|
||||
$parent_id = $attachment->parent_id;
|
||||
$parent_type = $attachment->parent_type;
|
||||
$parent_entity = $attachment->parent_entity;
|
||||
|
||||
// Get the article/parent handler
|
||||
if ( !$apm->attachmentsPluginInstalled($parent_type) ) {
|
||||
$errmsg = JText::sprintf('ATTACH_ERROR_INVALID_PARENT_TYPE_S', $parent_type) . ' (ERR 169)';
|
||||
JError::raiseError(500, $errmsg);
|
||||
}
|
||||
$parent = $apm->getAttachmentsPlugin($parent_type);
|
||||
$parent_entity = $parent->getCanonicalEntityId($parent_entity);
|
||||
|
||||
// Make sure the parent exists
|
||||
// NOTE: $parent_id===null means the parent is being created
|
||||
if ( ($parent_id !== null) && !$parent->parentExists($parent_id, $parent_entity) ) {
|
||||
$parent_entity_name = JText::_('ATTACH_' . $parent_entity);
|
||||
$errmsg = JText::sprintf('ATTACH_ERROR_CANNOT_DELETE_INVALID_S_ID_N',
|
||||
$parent_entity_name, $parent_id) . ' (ERR 170)';
|
||||
JError::raiseError(500, $errmsg);
|
||||
}
|
||||
|
||||
// If there is no parent_id, the parent is being created, use the username instead
|
||||
if ( !$parent_id ) {
|
||||
$pid = 0;
|
||||
}
|
||||
else {
|
||||
$pid = (int)$parent_id;
|
||||
}
|
||||
|
||||
// Close the iframe and refresh the attachments list in the parent window
|
||||
require_once(JPATH_SITE.'/components/com_attachments/javascript.php');
|
||||
$uri = JFactory::getURI();
|
||||
$base_url = $uri->base(true);
|
||||
$lang = JRequest::getCmd('lang', '');
|
||||
AttachmentsJavascript::closeIframeRefreshAttachments($base_url, $parent_type, $parent_entity, $pid, $lang, $from);
|
||||
exit();
|
||||
}
|
||||
|
||||
$this->setRedirect( 'index.php?option=' . $this->option);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Method to publish a list of items
|
||||
* (Adapted from JControllerAdmin)
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @since 11.1
|
||||
*/
|
||||
public function publish()
|
||||
{
|
||||
// Check for request forgeries
|
||||
JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
|
||||
|
||||
// Get items to publish from the request.
|
||||
$cid = JRequest::getVar('cid', array(), '', 'array');
|
||||
$data = array('publish' => 1, 'unpublish' => 0, 'archive' => 2, 'trash' => -2, 'report' => -3);
|
||||
$task = $this->getTask();
|
||||
$value = JArrayHelper::getValue($data, $task, 0, 'int');
|
||||
|
||||
if (empty($cid))
|
||||
{
|
||||
JError::raiseError(500, JText::_($this->text_prefix . '_NO_ITEM_SELECTED'));
|
||||
}
|
||||
else
|
||||
{
|
||||
// Get the model.
|
||||
$model = $this->getModel();
|
||||
|
||||
// Make sure the item ids are integers
|
||||
JArrayHelper::toInteger($cid);
|
||||
|
||||
// Publish the items.
|
||||
$att_published = $model->publish($cid, $value);
|
||||
if (($att_published == false) OR ($att_published == 0))
|
||||
{
|
||||
JError::raiseError(500, $model->getError());
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($value == 1)
|
||||
{
|
||||
$ntext = $this->text_prefix . '_N_ITEMS_PUBLISHED';
|
||||
}
|
||||
elseif ($value == 0)
|
||||
{
|
||||
$ntext = $this->text_prefix . '_N_ITEMS_UNPUBLISHED';
|
||||
}
|
||||
elseif ($value == 2)
|
||||
{
|
||||
$ntext = $this->text_prefix . '_N_ITEMS_ARCHIVED';
|
||||
}
|
||||
else
|
||||
{
|
||||
$ntext = $this->text_prefix . '_N_ITEMS_TRASHED';
|
||||
}
|
||||
$this->setMessage(JText::plural($ntext, $att_published));
|
||||
}
|
||||
}
|
||||
$extension = JRequest::getCmd('extension');
|
||||
$extensionURL = ($extension) ? '&extension=' . JRequest::getCmd('extension') : '';
|
||||
$this->setRedirect(JRoute::_('index.php?option=' . $this->option . '&view=' . $this->view_list . $extensionURL, false));
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
132
administrator/components/com_attachments/controllers/list.php
Normal file
132
administrator/components/com_attachments/controllers/list.php
Normal file
@ -0,0 +1,132 @@
|
||||
<?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
|
||||
*/
|
||||
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
/** Define the legacy classes, if necessary */
|
||||
require_once(JPATH_SITE.'/components/com_attachments/legacy/controller.php');
|
||||
|
||||
|
||||
/**
|
||||
* Class for a controller for dealing with lists of attachments
|
||||
*
|
||||
* @package Attachments
|
||||
*/
|
||||
class AttachmentsControllerList extends JControllerLegacy
|
||||
{
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param array An optional associative array of configuration settings.
|
||||
*
|
||||
* @return JControllerForm
|
||||
*/
|
||||
public function __construct( $default = array('default_task' => 'noop') )
|
||||
{
|
||||
parent::__construct( $default );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* A noop function so this controller does not have a usable default
|
||||
*/
|
||||
public function noop()
|
||||
{
|
||||
$errmsg = JText::_('ATTACH_ERROR_NO_FUNCTION_SPECIFIED') . ' (ERR 119)';
|
||||
JError::raiseError(500, $errmsg);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Display the attachments list
|
||||
*
|
||||
* @param int $parent_id the id of the parent
|
||||
* @param string $parent_type the type of parent
|
||||
* @param string $parent_entity the type entity of the parent
|
||||
* @param string $title title to be shown above the list of articles. If null, use system defaults.
|
||||
* @param bool $show_file_links enable showing links for the filenames
|
||||
* @param bool $allow_edit enable showing edit/delete links (if permissions are okay)
|
||||
* @param bool $echo if true the output will be echoed; otherwise the results are returned.
|
||||
* @param string $from The 'from' info
|
||||
*
|
||||
* @return the string (if $echo is false)
|
||||
*/
|
||||
public function displayString($parent_id, $parent_type, $parent_entity,
|
||||
$title=null, $show_file_links=true, $allow_edit=true,
|
||||
$echo=true, $from=null)
|
||||
{
|
||||
$document = JFactory::getDocument();
|
||||
|
||||
// Get an instance of the model
|
||||
require_once(JPATH_SITE.'/components/com_attachments/models/attachments.php');
|
||||
$model = new AttachmentsModelAttachments();
|
||||
$model->setParentId($parent_id, $parent_type, $parent_entity);
|
||||
|
||||
// Get the component parameters
|
||||
jimport('joomla.application.component.helper');
|
||||
$params = JComponentHelper::getParams('com_attachments');
|
||||
|
||||
// Set up to list the attachments for this artticle
|
||||
$sort_order = $params->get('sort_order', 'filename');
|
||||
$model->setSortOrder($sort_order);
|
||||
|
||||
// If none of the attachments should be visible, exit now
|
||||
if ( ! $model->someVisible() ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Get the view
|
||||
$this->addViewPath(JPATH_SITE.'/components/com_attachments/views');
|
||||
$viewType = $document->getType();
|
||||
$view = $this->getView('Attachments', $viewType);
|
||||
if ( !$view ) {
|
||||
$errmsg = JText::_('ATTACH_ERROR_UNABLE_TO_FIND_VIEW') . ' (ERR 120)';
|
||||
JError::raiseError(500, $errmsg);
|
||||
}
|
||||
$view->setModel($model);
|
||||
|
||||
// Construct the update URL template
|
||||
$update_url = "index.php?option=com_attachments&task=attachment.edit&cid[]=%d";
|
||||
$update_url .= "&from=$from&tmpl=component";
|
||||
$view->update_url = $update_url;
|
||||
|
||||
// Construct the delete URL template
|
||||
$delete_url = "index.php?option=com_attachments&task=attachment.delete_warning&id=%d";
|
||||
$delete_url .= "&parent_type=$parent_type&parent_entity=$parent_entity&parent_id=" . (int)$parent_id;
|
||||
$delete_url .= "&from=$from&tmpl=component";
|
||||
$view->delete_url = $delete_url;
|
||||
|
||||
// Set some display settings
|
||||
$view->title = $title;
|
||||
$view->show_file_links = $show_file_links;
|
||||
$view->allow_edit = $allow_edit;
|
||||
$view->from = $from;
|
||||
|
||||
// Get the view to generate the display output from the template
|
||||
if ( $view->display() === true ) {
|
||||
|
||||
// Display or return the results
|
||||
if ( $echo ) {
|
||||
echo $view->getOutput();
|
||||
}
|
||||
else {
|
||||
return $view->getOutput();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
205
administrator/components/com_attachments/controllers/params.php
Normal file
205
administrator/components/com_attachments/controllers/params.php
Normal file
@ -0,0 +1,205 @@
|
||||
<?php
|
||||
/**
|
||||
* Attachments component param controller
|
||||
*
|
||||
* @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');
|
||||
|
||||
/** Define the legacy classes, if necessary */
|
||||
require_once(JPATH_SITE.'/components/com_attachments/legacy/controller_form.php');
|
||||
|
||||
/** Load the class for the model component form and make it work for both 3.2 and less */
|
||||
if (version_compare(JVERSION, '3.2', 'ge'))
|
||||
{
|
||||
require_once(JPATH_SITE . '/components/com_config/model/cms.php');
|
||||
require_once(JPATH_SITE . '/components/com_config/model/form.php');
|
||||
}
|
||||
require_once(JPATH_ADMINISTRATOR.'/components/com_config/models/component.php');
|
||||
|
||||
|
||||
/**
|
||||
* Attachment Controller
|
||||
*
|
||||
* @package Attachments
|
||||
*/
|
||||
class AttachmentsControllerParams extends JControllerFormLegacy
|
||||
{
|
||||
|
||||
/**
|
||||
* Edit the component parameters
|
||||
*/
|
||||
public function edit($key = null, $urlVar = null)
|
||||
{
|
||||
// Access check.
|
||||
if (!JFactory::getUser()->authorise('core.admin', 'com_attachments')) {
|
||||
return JError::raiseError(404, JText::_('JERROR_ALERTNOAUTHOR') . ' (ERR 117)');
|
||||
}
|
||||
|
||||
// Get the component parameters
|
||||
jimport('joomla.application.component.helper');
|
||||
$params = JComponentHelper::getParams('com_attachments');
|
||||
|
||||
// Get the component model/table
|
||||
$model = new ConfigModelComponent();
|
||||
$state = $model->getState();
|
||||
$state->set('component.option', 'com_attachments');
|
||||
$state->set('component.path', JPATH_ADMINISTRATOR.'/components/com_attachments');
|
||||
$model->setState($state);
|
||||
$form = $model->getForm();
|
||||
$component = JComponentHelper::getComponent('com_attachments');
|
||||
|
||||
// Check for errors.
|
||||
if (count($errors = $this->get('Errors'))) {
|
||||
JError::raiseError(500, implode("\n", $errors) . ' (ERR 118)');
|
||||
return false;
|
||||
}
|
||||
|
||||
// Bind the form to the data.
|
||||
if ($form && $component->params) {
|
||||
$form->bind($component->params);
|
||||
}
|
||||
|
||||
// Set up the view
|
||||
require_once(JPATH_COMPONENT_ADMINISTRATOR.'/views/params/view.html.php');
|
||||
$view = new AttachmentsViewParams( );
|
||||
$view->setModel($model);
|
||||
$view->params = $params;
|
||||
|
||||
$view->form = $form;
|
||||
$view->component = $component;
|
||||
|
||||
$view->display();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Save the parameters
|
||||
*/
|
||||
public function save($key = null, $urlVar = null)
|
||||
{
|
||||
// Check for request forgeries.
|
||||
JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));
|
||||
|
||||
$app = JFactory::getApplication();
|
||||
|
||||
// Get the old component parameters
|
||||
jimport('joomla.application.component.helper');
|
||||
$old_params = JComponentHelper::getParams('com_attachments');
|
||||
$old_secure = JRequest::getInt('old_secure');
|
||||
|
||||
// Set FTP credentials, if given.
|
||||
jimport('joomla.client.helper');
|
||||
JClientHelper::setCredentialsFromRequest('ftp');
|
||||
|
||||
// Initialise variables.
|
||||
$model = new ConfigModelComponent();
|
||||
$form = $model->getForm();
|
||||
$data = JRequest::getVar('jform', array(), 'post', 'array');
|
||||
$id = JRequest::getInt('id');
|
||||
$option = JRequest::getCmd('component');
|
||||
|
||||
// Get the new component parameters
|
||||
$new_secure = $data['secure'];
|
||||
|
||||
// Check if the user is authorized to do this.
|
||||
if (!JFactory::getUser()->authorise('core.admin', $option))
|
||||
{
|
||||
JFactory::getApplication()->redirect('index.php', JText::_('JERROR_ALERTNOAUTHOR'));
|
||||
return;
|
||||
}
|
||||
|
||||
// Validate the posted data.
|
||||
$return = $model->validate($form, $data);
|
||||
|
||||
// Check for validation errors.
|
||||
if ($return === false) {
|
||||
|
||||
// Get the validation messages.
|
||||
$errors = $model->getErrors();
|
||||
|
||||
// Push up to three validation messages out to the user.
|
||||
for ($i = 0, $n = count($errors); $i < $n && $i < 3; $i++) {
|
||||
if ($errors[$i] instanceof Exception) {
|
||||
$app->enqueueMessage($errors[$i]->getMessage(), 'warning');
|
||||
} else {
|
||||
$app->enqueueMessage($errors[$i], 'warning');
|
||||
}
|
||||
}
|
||||
|
||||
// Save the data in the session.
|
||||
$app->setUserState('com_config.config.global.data', $data);
|
||||
|
||||
// Redirect back to the edit screen.
|
||||
$this->setRedirect(JRoute::_('index.php?option=com_attachments&task=params.edit', false));
|
||||
return false;
|
||||
}
|
||||
|
||||
// Attempt to save the configuration.
|
||||
$data = array(
|
||||
'params' => $return,
|
||||
'id' => $id,
|
||||
'option' => $option
|
||||
);
|
||||
$return = $model->save($data);
|
||||
|
||||
// Check the return value.
|
||||
if ($return === false)
|
||||
{
|
||||
// Save the data in the session.
|
||||
$app->setUserState('com_config.config.global.data', $data);
|
||||
|
||||
// Save failed, go back to the screen and display a notice.
|
||||
$message = JText::sprintf('JERROR_SAVE_FAILED', $model->getError());
|
||||
$this->setRedirect(JRoute::_('index.php?option=com_attachments&task=params.edit'), $message, 'error');
|
||||
return false;
|
||||
}
|
||||
|
||||
// Deal with any changes in the 'secure mode' (or upload directories)
|
||||
if ( $new_secure != $old_secure ) {
|
||||
|
||||
// Check/update the security status
|
||||
require_once(JPATH_SITE.'/components/com_attachments/helper.php');
|
||||
$attach_dir = JPATH_SITE.'/'.AttachmentsDefines::$ATTACHMENTS_SUBDIR;
|
||||
AttachmentsHelper::setup_upload_directory($attach_dir, $new_secure == 1);
|
||||
|
||||
$msg = JText::_('ATTACH_UPDATED_ATTACHMENTS_PARAMETERS_AND_SECURITY_SETTINGS');
|
||||
}
|
||||
else {
|
||||
$msg = JText::_( 'ATTACH_UPDATED_ATTACHMENTS_PARAMETERS' );
|
||||
}
|
||||
|
||||
// Set the redirect based on the task.
|
||||
switch ($this->getTask())
|
||||
{
|
||||
case 'apply':
|
||||
$this->setRedirect('index.php?option=com_attachments&task=params.edit', $msg, 'message');
|
||||
break;
|
||||
|
||||
case 'save':
|
||||
default:
|
||||
$this->setRedirect('index.php?option=com_attachments', $msg, 'message');
|
||||
break;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Save parameters and go back to the main listing display
|
||||
*/
|
||||
public function cancel($key = null)
|
||||
{
|
||||
$this->setRedirect('index.php?option=com_attachments');
|
||||
}
|
||||
|
||||
}
|
||||
150
administrator/components/com_attachments/controllers/special.php
Normal file
150
administrator/components/com_attachments/controllers/special.php
Normal file
@ -0,0 +1,150 @@
|
||||
<?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
|
||||
*/
|
||||
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
// Access check.
|
||||
if (!JFactory::getUser()->authorise('core.admin', 'com_attachments')) {
|
||||
return JError::raiseError(404, JText::_('JERROR_ALERTNOAUTHOR') . ' (ERR 147)');
|
||||
}
|
||||
|
||||
/** Define the legacy classes, if necessary */
|
||||
require_once(JPATH_SITE.'/components/com_attachments/legacy/controller.php');
|
||||
|
||||
|
||||
/**
|
||||
* The controller for special requests
|
||||
* (adapted from administrator/components/com_config/controllers/component.php)
|
||||
*
|
||||
* @package Attachments
|
||||
*/
|
||||
class AttachmentsControllerSpecial extends JControllerLegacy
|
||||
{
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param array An optional associative array of configuration settings.
|
||||
*/
|
||||
public function __construct( $default = array())
|
||||
{
|
||||
$default['default_task'] = 'noop';
|
||||
parent::__construct( $default );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* A noop function so this controller does not have a usable default
|
||||
*/
|
||||
public function noop()
|
||||
{
|
||||
echo "<h1>" . JText::_('ATTACH_ERROR_NO_SPECIAL_FUNCTION_SPECIFIED') . "</h1>";
|
||||
exit();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Show the current SEF mode
|
||||
*
|
||||
* This is for system testing purposes only
|
||||
*/
|
||||
public function showSEF()
|
||||
{
|
||||
$app = JFactory::getApplication();
|
||||
echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">';
|
||||
echo "<html><head><title>SEF Status</title></head><body>";
|
||||
echo "SEF: " . $app->getCfg('sef') . "<br />";
|
||||
echo "</body></html>";
|
||||
exit();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Show a list of all attachment IDs
|
||||
*
|
||||
* This is for system testing purposes only
|
||||
*/
|
||||
public function listAttachmentIDs()
|
||||
{
|
||||
// Get the article IDs
|
||||
$db = JFactory::getDBO();
|
||||
$query = $db->getQuery(true);
|
||||
$query->select('att.id,parent_id,parent_type,parent_entity,art.catid');
|
||||
$query->from('#__attachments as att');
|
||||
$query->leftJoin('#__content as art ON att.parent_id = art.id');
|
||||
$query->where('att.parent_entity=' . $db->quote('article'));
|
||||
$query->order('art.id');
|
||||
$db->setQuery($query);
|
||||
$attachments = $db->loadObjectList();
|
||||
if ( $db->getErrorNum() ) {
|
||||
$errmsg = $db->stderr() . ' (ERR 148)';
|
||||
JError::raiseError(500, $errmsg);
|
||||
}
|
||||
|
||||
// Get the category IDs
|
||||
$query = $db->getQuery(true);
|
||||
$query->select('att.id,att.parent_id,parent_type,parent_entity');
|
||||
$query->from('#__attachments as att');
|
||||
$query->leftJoin('#__categories as c ON att.parent_id = c.id');
|
||||
$query->where('att.parent_entity=' . $db->quote('category'));
|
||||
$query->order('c.id');
|
||||
$db->setQuery($query);
|
||||
$crows = $db->loadObjectList();
|
||||
if ( $db->getErrorNum() ) {
|
||||
$errmsg = $db->stderr() . ' (ERR 149)';
|
||||
JError::raiseError(500, $errmsg);
|
||||
}
|
||||
|
||||
echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">';
|
||||
echo '<html><head><title>Attachment IDs</title></head><body>';
|
||||
echo 'Attachment IDs:<br/>';
|
||||
|
||||
// Do the article attachments
|
||||
foreach ($attachments as $attachment) {
|
||||
if ( empty($attachment->id) ) {
|
||||
$attachment->id = '0';
|
||||
}
|
||||
if ( empty($attachment->catid) ) {
|
||||
$attachment->catid = '0';
|
||||
}
|
||||
$parent_entity = JString::strtolower($attachment->parent_entity);
|
||||
echo ' ' . $attachment->id . '/' . $attachment->parent_id . '/' .
|
||||
$attachment->parent_type . '/' . $parent_entity . '/' . $attachment->catid . '<br/>';
|
||||
}
|
||||
foreach ($crows as $attachment) {
|
||||
if ( empty($attachment->id) ) {
|
||||
$attachment->id = '0';
|
||||
}
|
||||
$parent_entity = JString::strtolower($attachment->parent_entity);
|
||||
echo ' ' . $attachment->id . '/' . $attachment->parent_id . '/' .
|
||||
$attachment->parent_type . '/' . $parent_entity . '/' . $attachment->parent_id . '<br/>';
|
||||
}
|
||||
echo '</body></html>';
|
||||
exit();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Show a list of all attachment IDs
|
||||
*
|
||||
* This is for system testing purposes only
|
||||
*/
|
||||
public function listKnownParentTypes()
|
||||
{
|
||||
// Get the article/parent handler
|
||||
JPluginHelper::importPlugin('attachments');
|
||||
$apm = getAttachmentsPluginManager();
|
||||
|
||||
$ptypes = $apm->getInstalledParentTypes();
|
||||
echo implode($ptypes, '<br/>');
|
||||
}
|
||||
}
|
||||
377
administrator/components/com_attachments/controllers/utils.php
Normal file
377
administrator/components/com_attachments/controllers/utils.php
Normal file
@ -0,0 +1,377 @@
|
||||
<?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
|
||||
*/
|
||||
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
// Access check.
|
||||
if (!JFactory::getUser()->authorise('core.admin', 'com_attachments')) {
|
||||
return JError::raiseError(404, JText::_('JERROR_ALERTNOAUTHOR') . ' (ERR 150)');
|
||||
}
|
||||
|
||||
/** Define the legacy classes, if necessary */
|
||||
require_once(JPATH_SITE.'/components/com_attachments/legacy/controller.php');
|
||||
|
||||
// Load the helper functions
|
||||
require_once(JPATH_SITE.'/components/com_attachments/javascript.php');
|
||||
|
||||
|
||||
/**
|
||||
* The controller for utils requests
|
||||
* (adapted from administrator/components/com_config/controllers/component.php)
|
||||
*
|
||||
* @package Attachments
|
||||
*/
|
||||
class AttachmentsControllerUtils extends JControllerLegacy
|
||||
{
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param array An optional associative array of configuration settings.
|
||||
*/
|
||||
public function __construct( $default = array())
|
||||
{
|
||||
$default['default_task'] = 'noop';
|
||||
parent::__construct( $default );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* A noop function so this controller does not have a usable default
|
||||
*/
|
||||
public function noop()
|
||||
{
|
||||
echo "<h1>" . JText::_('ATTACH_ERROR_NO_UTILS_FUNCTION_SPECIFIED') . "</h1>";
|
||||
exit();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* Enqueue a system message.
|
||||
*
|
||||
* @param string $msg The message to enqueue.
|
||||
* @param string $type The message type. Default is message.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function enqueueSystemMessage($msg, $type = 'message')
|
||||
{
|
||||
$app = JFactory::getApplication();
|
||||
$app->enqueueMessage($msg, $type);
|
||||
|
||||
// Not sure why I need the extra saving to the session below,
|
||||
// but it it seems necessary because I'm doing it from an iframe.
|
||||
$session = JFactory::getSession();
|
||||
$session->set('application.queue', $app->getMessageQueue());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Add icon filenames for attachments missing an icon
|
||||
* (See AttachmentsUpdate::add_icon_filenames() in update.php for details )
|
||||
*/
|
||||
public function add_icon_filenames()
|
||||
{
|
||||
// Access check.
|
||||
if (!JFactory::getUser()->authorise('core.admin', 'com_attachments')) {
|
||||
return JError::raiseError(404, JText::_('JERROR_ALERTNOAUTHOR') . ' (ERR 151)');
|
||||
}
|
||||
|
||||
require_once(JPATH_ADMINISTRATOR.'/components/com_attachments/update.php');
|
||||
$msg = AttachmentsUpdate::add_icon_filenames();
|
||||
$this->setRedirect('index.php?option=' . $this->option, $msg);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Update any null dates in any attachments
|
||||
* (See AttachmentsUpdate::update_null_dates() in update.php for details )
|
||||
*/
|
||||
public function update_null_dates()
|
||||
{
|
||||
// Access check.
|
||||
if (!JFactory::getUser()->authorise('core.admin', 'com_attachments')) {
|
||||
return JError::raiseError(404, JText::_('JERROR_ALERTNOAUTHOR') . ' (ERR 152)');
|
||||
}
|
||||
|
||||
require_once(JPATH_ADMINISTRATOR.'/components/com_attachments/update.php');
|
||||
|
||||
$numUpdated = AttachmentsUpdate::update_null_dates();
|
||||
$msg = JText::sprintf( 'ATTACH_UPDATED_N_ATTACHMENTS', $numUpdated );
|
||||
$this->setRedirect('index.php?option=' . $this->option, $msg);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Disable SQL uninstall of existing attachments (when Attachments is uninstalled)
|
||||
* (See AttachmentsUpdate::disable_sql_uninstall() in update.php for details )
|
||||
*/
|
||||
public function disable_sql_uninstall()
|
||||
{
|
||||
// Access check.
|
||||
if (!JFactory::getUser()->authorise('core.admin', 'com_attachments')) {
|
||||
return JError::raiseError(404, JText::_('JERROR_ALERTNOAUTHOR') . ' (ERR 153)');
|
||||
}
|
||||
|
||||
require_once(JPATH_ADMINISTRATOR.'/components/com_attachments/update.php');
|
||||
|
||||
$msg = AttachmentsUpdate::disable_sql_uninstall();
|
||||
|
||||
if ( JRequest::getBool('close') ) {
|
||||
|
||||
$this->enqueueSystemMessage($msg);
|
||||
|
||||
// Close this window and refesh the parent window
|
||||
AttachmentsJavascript::closeModal();
|
||||
}
|
||||
else {
|
||||
$this->setRedirect('index.php?option=com_attachments', $msg);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Regenerate system filenames
|
||||
* (See AttachmentsUpdate::regenerate_system_filenames() in update.php for details )
|
||||
*/
|
||||
public function regenerate_system_filenames()
|
||||
{
|
||||
// Access check.
|
||||
if (!JFactory::getUser()->authorise('core.admin', 'com_attachments')) {
|
||||
return JError::raiseError(404, JText::_('JERROR_ALERTNOAUTHOR') . ' (ERR 154)');
|
||||
}
|
||||
|
||||
require_once(JPATH_ADMINISTRATOR.'/components/com_attachments/update.php');
|
||||
|
||||
$msg = AttachmentsUpdate::regenerate_system_filenames();
|
||||
|
||||
if ( JRequest::getBool('close') ) {
|
||||
|
||||
$this->enqueueSystemMessage($msg);
|
||||
|
||||
// Close this window and refesh the parent window
|
||||
AttachmentsJavascript::closeModal();
|
||||
}
|
||||
else {
|
||||
$this->setRedirect('index.php?option=' . $this->option, $msg);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Remove spaces from system filenames for all attachments
|
||||
* (See AttachmentsUpdate::remove_spaces_from_system_filenames() in update.php for details )
|
||||
*/
|
||||
public function remove_spaces_from_system_filenames()
|
||||
{
|
||||
// Access check.
|
||||
if (!JFactory::getUser()->authorise('core.admin', 'com_attachments')) {
|
||||
return JError::raiseError(404, JText::_('JERROR_ALERTNOAUTHOR') . ' (ERR 155)');
|
||||
}
|
||||
|
||||
require_once(JPATH_ADMINISTRATOR.'/components/com_attachments/update.php');
|
||||
|
||||
$msg = AttachmentsUpdate::remove_spaces_from_system_filenames();
|
||||
|
||||
if ( JRequest::getBool('close') ) {
|
||||
|
||||
$this->enqueueSystemMessage($msg);
|
||||
|
||||
// Close this window and refesh the parent window
|
||||
AttachmentsJavascript::closeModal();
|
||||
}
|
||||
else {
|
||||
$this->setRedirect('index.php?option=' . $this->option, $msg);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Update file sizes for all attachments
|
||||
* (See AttachmentsUpdate::update_file_sizes() in update.php for details )
|
||||
*/
|
||||
public function update_file_sizes()
|
||||
{
|
||||
// Access check.
|
||||
if (!JFactory::getUser()->authorise('core.admin', 'com_attachments')) {
|
||||
return JError::raiseError(404, JText::_('JERROR_ALERTNOAUTHOR') . ' (ERR 156)');
|
||||
}
|
||||
|
||||
require_once(JPATH_ADMINISTRATOR.'/components/com_attachments/update.php');
|
||||
|
||||
$msg = AttachmentsUpdate::update_file_sizes();
|
||||
|
||||
if ( JRequest::getBool('close') ) {
|
||||
|
||||
$this->enqueueSystemMessage($msg);
|
||||
|
||||
// Close this window and refesh the parent window
|
||||
AttachmentsJavascript::closeModal();
|
||||
}
|
||||
else {
|
||||
$this->setRedirect('index.php?option=' . $this->option, $msg);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Check all files in any attachments
|
||||
* (See AttachmentsUpdate::check_files() in update.php for details )
|
||||
*/
|
||||
public function check_files()
|
||||
{
|
||||
// Access check.
|
||||
if (!JFactory::getUser()->authorise('core.admin', 'com_attachments')) {
|
||||
return JError::raiseError(404, JText::_('JERROR_ALERTNOAUTHOR') . ' (ERR 157)');
|
||||
}
|
||||
|
||||
require_once(JPATH_ADMINISTRATOR.'/components/com_attachments/update.php');
|
||||
|
||||
$msg = AttachmentsUpdate::check_files_existance();
|
||||
|
||||
if ( JRequest::getBool('close') ) {
|
||||
|
||||
$this->enqueueSystemMessage($msg);
|
||||
|
||||
// Close this window and refesh the parent window
|
||||
AttachmentsJavascript::closeModal();
|
||||
}
|
||||
else {
|
||||
$this->setRedirect('index.php?option=' . $this->option, $msg);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate all URLS in any attachments
|
||||
* (See AttachmentsUpdate::validate_urls() in update.php for details )
|
||||
*/
|
||||
public function validate_urls()
|
||||
{
|
||||
// Access check.
|
||||
if (!JFactory::getUser()->authorise('core.admin', 'com_attachments')) {
|
||||
return JError::raiseError(404, JText::_('JERROR_ALERTNOAUTHOR') . ' (ERR 158)');
|
||||
}
|
||||
|
||||
require_once(JPATH_ADMINISTRATOR.'/components/com_attachments/update.php');
|
||||
|
||||
$msg = AttachmentsUpdate::validate_urls();
|
||||
|
||||
if ( JRequest::getBool('close') ) {
|
||||
|
||||
$this->enqueueSystemMessage($msg);
|
||||
|
||||
// Close this window and refesh the parent window
|
||||
AttachmentsJavascript::closeModal();
|
||||
}
|
||||
else {
|
||||
$this->setRedirect('index.php?option=' . $this->option, $msg);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Validate all URLS in any attachments
|
||||
* (See AttachmentsUpdate::reinstall_permissions() in update.php for details )
|
||||
*/
|
||||
public function reinstall_permissions()
|
||||
{
|
||||
// Access check.
|
||||
if (!JFactory::getUser()->authorise('core.admin', 'com_attachments')) {
|
||||
return JError::raiseError(404, JText::_('JERROR_ALERTNOAUTHOR') . ' (ERR 159)');
|
||||
}
|
||||
|
||||
require_once(JPATH_ADMINISTRATOR.'/components/com_attachments/update.php');
|
||||
|
||||
$msg = AttachmentsUpdate::installAttachmentsPermissions();
|
||||
|
||||
if ( JRequest::getBool('close') ) {
|
||||
|
||||
$this->enqueueSystemMessage($msg);
|
||||
|
||||
// Close this window and refesh the parent window
|
||||
AttachmentsJavascript::closeModal();
|
||||
}
|
||||
else {
|
||||
$this->setRedirect('index.php?option=' . $this->option, $msg);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Install attachments data from CSV file
|
||||
*/
|
||||
public function installAttachmentsFromCsvFile()
|
||||
{
|
||||
// Access check.
|
||||
if (!JFactory::getUser()->authorise('core.admin', 'com_attachments')) {
|
||||
return JError::raiseError(404, JText::_('JERROR_ALERTNOAUTHOR') . ' (ERR 160)');
|
||||
}
|
||||
|
||||
require_once(JPATH_ADMINISTRATOR.'/components/com_attachments/import.php');
|
||||
|
||||
$filename = JRequest::getString('filename', null);
|
||||
if ( $filename == null ) {
|
||||
$errmsg = JText::_('ATTACH_ERROR_MUST_ADD_FILENAME_TO_URL') . ' (ERR 161)';
|
||||
return JError::raiseError(500, $errmsg);
|
||||
}
|
||||
$verify_parent = JRequest::getBool('verify_parent', true);
|
||||
$update = JRequest::getBool('update', false);
|
||||
$dry_run = JRequest::getBool('dry_run', false);
|
||||
|
||||
$status = AttachmentsImport::importAttachmentsFromCSVFile($filename, $verify_parent,
|
||||
$update, $dry_run);
|
||||
|
||||
// Abort if it is an error message
|
||||
if ( is_string($status) ) {
|
||||
return JError::raiseError(500, $status);
|
||||
}
|
||||
|
||||
// Otherwise, report the results
|
||||
if ( is_array($status) ) {
|
||||
$msg = JText::sprintf('ATTACH_ADDED_DATA_FOR_N_ATTACHMENTS', count($status));
|
||||
$this->setRedirect('index.php?option=com_attachments', $msg);
|
||||
}
|
||||
else {
|
||||
if ( $dry_run ) {
|
||||
$msg = JText::sprintf('ATTACH_DATA_FOR_N_ATTACHMENTS_OK', $status) . ' (ERR 162)';
|
||||
return JError::raiseNotice(200, $msg);
|
||||
}
|
||||
else {
|
||||
$errmsg = JText::sprintf('ATTACH_ERROR_IMPORTING_ATTACHMENTS_S', $status) . ' (ERR 163)';
|
||||
return JError::raiseError(500, $errmsg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Test function
|
||||
*/
|
||||
public function test()
|
||||
{
|
||||
// Access check.
|
||||
if (!JFactory::getUser()->authorise('core.admin', 'com_attachments')) {
|
||||
return JError::raiseError(404, JText::_('JERROR_ALERTNOAUTHOR'));
|
||||
}
|
||||
|
||||
echo "Test!";
|
||||
|
||||
exit();
|
||||
}
|
||||
|
||||
}
|
||||
306
administrator/components/com_attachments/import.php
Normal file
306
administrator/components/com_attachments/import.php
Normal file
@ -0,0 +1,306 @@
|
||||
<?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
|
||||
*/
|
||||
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
|
||||
/** Load the Attachements defines */
|
||||
require_once(JPATH_SITE.'/components/com_attachments/defines.php');
|
||||
|
||||
/**
|
||||
* A class for importing attachments data from files
|
||||
*
|
||||
* @package Attachments
|
||||
*/
|
||||
class AttachmentsImport
|
||||
{
|
||||
static $field_names =
|
||||
Array( 'id',
|
||||
'filename',
|
||||
'filename_sys',
|
||||
'file_type',
|
||||
'file_size',
|
||||
'url',
|
||||
'uri_type',
|
||||
'url_valid',
|
||||
'url_relative',
|
||||
'display_name',
|
||||
'description',
|
||||
'icon_filename',
|
||||
'access',
|
||||
'state',
|
||||
'user_field_1',
|
||||
'user_field_2',
|
||||
'user_field_3',
|
||||
'parent_type',
|
||||
'parent_entity',
|
||||
'parent_id',
|
||||
'parent_title',
|
||||
'created',
|
||||
'created_by',
|
||||
'created_by_username',
|
||||
'modified',
|
||||
'modified_by',
|
||||
'modified_by_username',
|
||||
'download_count' );
|
||||
|
||||
static $extra_field_names =
|
||||
Array( 'parent_title',
|
||||
'created_by_username',
|
||||
'modified_by_username' );
|
||||
|
||||
/**
|
||||
* Compare two UTF-8 strings
|
||||
* (disregards leading and trailing whitespace and case differences)
|
||||
*
|
||||
* @param string $ustr1 UTF-8 string 1
|
||||
* @param string $ustr2 UTF-8 string 2
|
||||
* @return true if the strings match
|
||||
*/
|
||||
static function utf8StringsEqual($ustr1, $ustr2)
|
||||
{
|
||||
return strncasecmp(trim($ustr1), trim($ustr2), 4096) == 0;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Import attachment data from a CSV file
|
||||
*
|
||||
* The CSV file must have the field names in the first row
|
||||
*
|
||||
* @param string $filename the filename of the CSV file
|
||||
* @param bool $verify_parent if true, each attachments parent must exist
|
||||
* @param bool $update if true, if the attachment exists, update it (or create a new one)
|
||||
* @param bool $dry_run do everything except actually add entries to attachment table in the database
|
||||
*
|
||||
* @return array of IDs of the imported attachemnts (if $dry_run, number that would have been imported), or error message
|
||||
*/
|
||||
public static function importAttachmentsFromCSVFile($filename,
|
||||
$verify_parent=true,
|
||||
$update=false,
|
||||
$dry_run=false)
|
||||
{
|
||||
$db = JFactory::getDBO();
|
||||
|
||||
// Open the CSV file
|
||||
$line_num = 0;
|
||||
$f = @fopen($filename, 'r');
|
||||
if ( !$f ) {
|
||||
return JText::sprintf('ATTACH_ERROR_UNABLE_TO_OPEN_CSV_FILE_S', $filename) . ' (ERR 85)';
|
||||
}
|
||||
|
||||
// Parse the first row to process field names and indeces
|
||||
$field = AttachmentsImport::_parseFieldNames($f);
|
||||
$line_num += 1;
|
||||
if ( !is_array($field) ) {
|
||||
return $field;
|
||||
}
|
||||
|
||||
// Get the default access level from the Attachments options
|
||||
jimport('joomla.application.component.helper');
|
||||
$params = JComponentHelper::getParams('com_attachments');
|
||||
$default_access_level = $params->get('default_access_level', AttachmentsDefines::$DEFAULT_ACCESS_LEVEL_ID);
|
||||
|
||||
// Load the attachents parent manager
|
||||
JPluginHelper::importPlugin('attachments');
|
||||
$apm = getAttachmentsPluginManager();
|
||||
|
||||
// Process the CSV data
|
||||
if ( $dry_run ) {
|
||||
$ids_ok = 0;
|
||||
}
|
||||
else {
|
||||
$ids_ok = Array();
|
||||
}
|
||||
|
||||
iconv_set_encoding("internal_encoding", "UTF-8");
|
||||
setlocale(LC_ALL, 'en_US.UTF-8');
|
||||
|
||||
while ( !feof($f) ) {
|
||||
|
||||
// Read the next line
|
||||
$adata = fgetcsv($f);
|
||||
$line_num += 1;
|
||||
$line_str = ' [LINE: ' . $line_num . '] ';
|
||||
|
||||
// Skip blank lines
|
||||
if ( !$adata ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// get the attachment ID
|
||||
$attachment_id = $adata[$field['id']];
|
||||
if ( !is_numeric($attachment_id) ) {
|
||||
return JText::sprintf('ATTACH_ERROR_BAD_ATTACHMENT_ID_S', $attachment_id) . $line_str . ' (ERR 86)';
|
||||
}
|
||||
$attachment_id = (int)$attachment_id;
|
||||
|
||||
$parent_type = $adata[$field['parent_type']];
|
||||
$parent_entity = strtolower($adata[$field['parent_entity']]);
|
||||
$parent_id = (int)$adata[$field['parent_id']];
|
||||
|
||||
// Make sure it is not a 'section' attachment
|
||||
if ($parent_entity == 'section') {
|
||||
return JText::sprintf('ATTACH_ERROR_SECTION_ATTACHMENT_NOT_ALLOWED_ID', $attachment_id) . $line_str . ' (ERR 86B)';
|
||||
}
|
||||
|
||||
// Get the attachment parent object
|
||||
if ( !$apm->attachmentsPluginInstalled($parent_type) ) {
|
||||
return JText::sprintf('ATTACH_ERROR_UNKNOWN_PARENT_TYPE_S', $parent_type) . $line_str . ' (ERR 87)';
|
||||
}
|
||||
$parent = $apm->getAttachmentsPlugin($parent_type);
|
||||
|
||||
// Does the parent exist?
|
||||
if ( $verify_parent ) {
|
||||
|
||||
// Make sure a parent with the specified ID exists
|
||||
if ( !$parent->parentExists($parent_id, $parent_entity) ) {
|
||||
return JText::sprintf('ATTACH_ERROR_UNKNOWN_PARENT_ID_N', $parent_id) . $line_str . ' (ERR 88)';
|
||||
}
|
||||
|
||||
// Double-check by comparing the title
|
||||
$attachment_parent_title = $adata[$field['parent_title']];
|
||||
$parent_title = $parent->getTitle($parent_id, $parent_entity);
|
||||
if ( !AttachmentsImport::utf8StringsEqual($parent_title, $attachment_parent_title) ) {
|
||||
return JText::sprintf('ATTACH_ERROR_PARENT_TITLE_MISMATCH_ID_N_TITLE_S_S', $parent_id,
|
||||
$parent_title, $attachment_parent_title) . $line_str . ' (ERR 89)';
|
||||
}
|
||||
}
|
||||
|
||||
// Check the creator username
|
||||
$creator_id = (int)$adata[$field['created_by']];
|
||||
$attachment_creator_username = $adata[$field['created_by_username']];
|
||||
$query = $db->getQuery(true);
|
||||
$query->select('username')->from('#__users')->where('id = ' . (int)$creator_id);
|
||||
$db->setQuery($query, 0, 1);
|
||||
$creator_username = $db->loadResult();
|
||||
if ( empty($creator_username) || $db->getErrorNum() ) {
|
||||
return JText::sprintf('ATTACH_ERROR_UNABLE_TO_FIND_CREATOR_ID_S',
|
||||
$creator_id, $attachment_creator_username) . $line_str . ' (ERR 90)';
|
||||
}
|
||||
if ( !AttachmentsImport::utf8StringsEqual($creator_username, $attachment_creator_username) ) {
|
||||
return JText::sprintf('ATTACH_ERROR_CREATOR_USERNAME_MISMATCH_ID_S_S',
|
||||
$creator_id, $attachment_creator_username, $creator_username) . $line_str . ' (ERR 91)';
|
||||
}
|
||||
|
||||
// Check the modifier name
|
||||
$modifier_id = (int)$adata[$field['modified_by']];
|
||||
$attachment_modifier_username = $adata[$field['modified_by_username']];
|
||||
$query = $db->getQuery(true);
|
||||
$query->select('username')->from('#__users')->where('id = ' . (int)$modifier_id);
|
||||
$db->setQuery($query, 0, 1);
|
||||
$modifier_username = $db->loadResult();
|
||||
if ( empty($modifier_username) || $db->getErrorNum() ) {
|
||||
return JText::sprintf('ATTACH_ERROR_UNABLE_TO_FIND_MODIFIER_ID_S',
|
||||
$modifier_id, $attachment_modifier_username) . $line_str . ' (ERR 92)';
|
||||
}
|
||||
if ( !AttachmentsImport::utf8StringsEqual($modifier_username, $attachment_modifier_username) ) {
|
||||
return JText::sprintf('ATTACH_ERROR_MODIFIER_USERNAME_MISMATCH_ID_S_S',
|
||||
$modifier_id, $attachment_modifier_username, $modifier_username) . $line_str . ' (ERR 93)';
|
||||
}
|
||||
|
||||
// Construct an attachments entry
|
||||
JTable::addIncludePath(JPATH_ADMINISTRATOR.'/components/com_attachments/tables');
|
||||
$attachment = JTable::getInstance('Attachment', 'AttachmentsTable');
|
||||
|
||||
if ( $update ) {
|
||||
|
||||
// The attachment ID cannot be 0 for updating!
|
||||
if ( $attachment_id == 0 ) {
|
||||
return JText::_('ATTACH_ERROR_CANNOT_MODIFY_ATTACHMENT_ZERO_ID') . $line_str . ' (ERR 94)';
|
||||
}
|
||||
|
||||
// Load the data from the attachment to be updated (or create new one)
|
||||
if ( !$attachment->load($attachment_id) ) {
|
||||
$attachment->reset();
|
||||
}
|
||||
}
|
||||
else {
|
||||
// Create new attachment
|
||||
$attachment->reset();
|
||||
}
|
||||
|
||||
// Copy in the data from the CSV file
|
||||
foreach (AttachmentsImport::$field_names as $fname) {
|
||||
if ( ($fname != 'id') && !in_array($fname, AttachmentsImport::$extra_field_names) ) {
|
||||
$attachment->$fname = $adata[$field[$fname]];
|
||||
}
|
||||
}
|
||||
|
||||
// Do any necessary overrides
|
||||
$attachment->parent_entity = $parent_entity; // ??? what about parent_entity_name?
|
||||
$attachment->access = $default_access_level;
|
||||
$attachment->file_size = (int)$adata[$field['file_size']];
|
||||
|
||||
if ( $dry_run ) {
|
||||
$ids_ok++;
|
||||
}
|
||||
else {
|
||||
// Store the new/updated attachment
|
||||
if ( $attachment->store() ) {
|
||||
$ids_ok[] = $attachment->getDbo()->insertid();
|
||||
}
|
||||
else {
|
||||
return JText::sprintf('ATTACH_ERROR_STORING_ATTACHMENT_S', $attachment->getError()) . ' (ERR 95)';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fclose($f);
|
||||
|
||||
return $ids_ok;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Parse the field names from the first(next) line of the CSV file
|
||||
*
|
||||
* @param file $file the handle for the opened file object
|
||||
*
|
||||
* @return the associative array (fieldname => index) or error message
|
||||
*/
|
||||
protected static function _parseFieldNames($file)
|
||||
{
|
||||
// Load the field names from the file
|
||||
$field = Array();
|
||||
$header_line = fgetcsv($file);
|
||||
// Strip of the leading BOM, if present
|
||||
$header_line = preg_replace('/[\x00-\x1F\x80-\xFF]/', '', $header_line);
|
||||
for ($i=0; $i < count($header_line); $i++) {
|
||||
$field_name = trim(strtolower($header_line[$i]));
|
||||
if ( in_array($field_name, AttachmentsImport::$field_names) ) {
|
||||
$field[$field_name] = $i;
|
||||
}
|
||||
else {
|
||||
return JText::sprintf('ATTACH_ERROR_UNRECOGNIZED_FIELD_S', $field_name) . ' (ERR 96)';
|
||||
}
|
||||
}
|
||||
|
||||
// Make sure all field names were found
|
||||
if ( count($field) != count(AttachmentsImport::$field_names) ) {
|
||||
// Figure out which fields are missing
|
||||
$missing = Array();
|
||||
foreach (AttachmentsImport::$field_names as $fname) {
|
||||
if (!array_key_exists($fname, $field)) {
|
||||
$missing[] = $fname;
|
||||
}
|
||||
}
|
||||
return JText::sprintf('ATTACH_ERROR_MISSING_FIELDS_S', implode(',',$missing)) . ' (ERR 97)';
|
||||
}
|
||||
|
||||
return $field;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
4
administrator/components/com_attachments/index.html
Normal file
4
administrator/components/com_attachments/index.html
Normal file
@ -0,0 +1,4 @@
|
||||
<html>
|
||||
<body>
|
||||
</body>
|
||||
</html>
|
||||
535
administrator/components/com_attachments/install.attachments.php
Normal file
535
administrator/components/com_attachments/install.attachments.php
Normal file
@ -0,0 +1,535 @@
|
||||
<?php
|
||||
/**
|
||||
* Attachments component installation script
|
||||
*
|
||||
* @package Attachments
|
||||
* @subpackage Attachments_Component
|
||||
*
|
||||
* @author Jonathan M. Cameron
|
||||
* @copyright Copyright (C) 2007-2018 Jonathan M. Cameron
|
||||
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU/GPL
|
||||
* @link http://joomlacode.org/gf/project/attachments/frs/
|
||||
*/
|
||||
|
||||
// No direct access
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
jimport('joomla.filesystem.folder');
|
||||
|
||||
// Define some global variables to help figure out whether log messages.
|
||||
//
|
||||
// Note: Apparently with Joomala 2.5+, the installer behavior has changed.
|
||||
// If the extension is being installed the first time, it first does the
|
||||
// install() method and the the update() method of this install script class.
|
||||
// Similarly when upgrading a previously installed component, it does the
|
||||
// update() method twice. Not sure if this is a bug in Joomla or a config
|
||||
// error in this extension. In any case, these flags are used to eliminate
|
||||
// the duplicate user information messages (about enabled plugins, etc).
|
||||
// The second time through the postFlight() function does not hurt anything,
|
||||
// so there is no point in repeating the inforamtional messages to the user.
|
||||
|
||||
/** Flag whether the informational messages should be emitted (warnings always go).
|
||||
*/
|
||||
$attachments_install_verbose = true;
|
||||
|
||||
/** Name of the last executed install method (install or upgrade)
|
||||
*/
|
||||
$attachments_install_last_method = null;
|
||||
|
||||
|
||||
/**
|
||||
* The main attachments installation class
|
||||
*
|
||||
* @package Attachments
|
||||
*/
|
||||
class com_AttachmentsInstallerScript
|
||||
{
|
||||
/**
|
||||
* An array of supported database types
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $dbKnown = array('mysql' => 'MySQL',
|
||||
'mysqli' => 'MySQLi',
|
||||
'pdomysql' => 'PDO MySql',
|
||||
'postgresql' => 'PostgreSQL',
|
||||
'sqlsrv' => 'MS SQL Server',
|
||||
'sqlazure' => 'MS SQL Azure');
|
||||
|
||||
/**
|
||||
* An array of supported database types
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $dbSupported = array('mysql', 'mysqli', 'pdomysql');
|
||||
|
||||
|
||||
/**
|
||||
* name of moved attachments directory (if present)
|
||||
*/
|
||||
var $moved_attachments_dir = null;
|
||||
|
||||
/**
|
||||
* List of the plugins
|
||||
*/
|
||||
var $plugins = Array('plg_content_attachments',
|
||||
'plg_search_attachments',
|
||||
'plg_attachments_plugin_framework',
|
||||
'plg_attachments_for_content',
|
||||
'plg_editors-xtd_add_attachment_btn',
|
||||
'plg_editors-xtd_insert_attachments_token_btn',
|
||||
'plg_system_show_attachments_in_editor',
|
||||
'plg_quickicon_attachments'
|
||||
);
|
||||
|
||||
|
||||
/**
|
||||
* Attachments component install function
|
||||
*
|
||||
* @param $parent : the installer parent
|
||||
*/
|
||||
public function install($parent)
|
||||
{
|
||||
global $attachments_install_verbose, $attachments_install_last_method;
|
||||
$attachments_install_verbose = true;
|
||||
$attachments_install_last_method = 'install';
|
||||
|
||||
$app = JFactory::getApplication();
|
||||
$app->enqueueMessage(JText::sprintf('ATTACH_ATTACHMENTS_COMPONENT_SUCCESSFULLY_INSTALLED'), 'message');
|
||||
|
||||
com_AttachmentsInstallerScript::installPermissions();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Attachments component update function
|
||||
*
|
||||
* @param $parent : the installer parent
|
||||
*/
|
||||
public function update($parent)
|
||||
{
|
||||
global $attachments_install_verbose, $attachments_install_last_method;
|
||||
$attachments_install_last_method = 'update';
|
||||
|
||||
if ( $attachments_install_verbose ) {
|
||||
$app = JFactory::getApplication();
|
||||
$app->enqueueMessage(JText::sprintf('ATTACH_ATTACHMENTS_COMPONENT_SUCCESSFULLY_UPGRADED'), 'message');
|
||||
}
|
||||
|
||||
com_AttachmentsInstallerScript::installPermissions();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Attachments component uninstall function
|
||||
*
|
||||
* @param $parent : the installer parent
|
||||
*/
|
||||
public function uninstall($parent)
|
||||
{
|
||||
// disable all the plugins
|
||||
foreach ($this->plugins as $plugin_name)
|
||||
{
|
||||
// Make the query to enable the plugin
|
||||
$db = JFactory::getDBO();
|
||||
$query = $db->getQuery(true);
|
||||
$query->update('#__extensions')
|
||||
->set("enabled = 0")
|
||||
->where('type=' . $db->quote('plugin') . ' AND name=' . $db->quote($plugin_name));
|
||||
$db->setQuery($query);
|
||||
$db->query();
|
||||
|
||||
// NOTE: Do NOT complain if there was an error
|
||||
// (in case any plugin is already uninstalled and this query fails)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Attachments component preflight function
|
||||
*
|
||||
* @param $type : type of installation
|
||||
* @param $parent : the installer parent
|
||||
*/
|
||||
public function preflight($type, $parent)
|
||||
{
|
||||
global $attachments_install_verbose, $attachments_install_last_method;
|
||||
|
||||
$app = JFactory::getApplication();
|
||||
|
||||
if ( $attachments_install_last_method == 'update' ) {
|
||||
$attachments_install_verbose = false;
|
||||
}
|
||||
if ( $attachments_install_last_method == null ) {
|
||||
$attachments_install_verbose = true;
|
||||
}
|
||||
|
||||
// Load the installation language
|
||||
$lang = JFactory::getLanguage();
|
||||
|
||||
// First load the English version
|
||||
$lang->load('com_attachments.sys', dirname(__FILE__), 'en-GB');
|
||||
$lang->load('pkg_attachments.sys', dirname(__FILE__), 'en-GB');
|
||||
|
||||
// Now load the current language (if not English)
|
||||
if ( $lang->getTag() != 'en-GB' ) {
|
||||
// (Double-loading to fall back to Engish if a new term is missing)
|
||||
$lang->load('com_attachments.sys', dirname(__FILE__), null, true);
|
||||
$lang->load('pkg_attachments.sys', dirname(__FILE__), null, true);
|
||||
}
|
||||
|
||||
$app->enqueueMessage('<br/>', 'message');
|
||||
|
||||
// Check to see if the database type is supported
|
||||
if (!in_array(JFactory::getDbo()->name, $this->dbSupported))
|
||||
{
|
||||
$db_name = $this->dbKnown[JFactory::getDbo()->name];
|
||||
if (empty($db_name)) {
|
||||
$db_name = JFactory::getDbo()->name;
|
||||
}
|
||||
$errmsg = JText::sprintf('ATTACH_ATTACHMENTS_ERROR_UNSUPPORTED_DB_S', $db_name);
|
||||
$app->enqueueMessage($errmsg, 'error');
|
||||
return false;
|
||||
}
|
||||
|
||||
// Verify that the Joomla version is adequate for this version of the Attachments extension
|
||||
$this->minimum_joomla_release = $parent->get( 'manifest' )->attributes()->version;
|
||||
if ( version_compare(JVERSION, $this->minimum_joomla_release, 'lt') ) {
|
||||
$msg = JText::sprintf('ATTACH_ATTACHMENTS_ONLY_WORKS_FOR_VERSION_S_UP', $this->minimum_joomla_release);
|
||||
if ( $msg == 'ATTACH_ATTACHMENTS_ONLY_WORKS_FOR_VERSION_S_UP' ) {
|
||||
// Handle unupdated languages
|
||||
$msg = JText::_('ATTACH_ATTACHMENTS_ONLY_WORKS_FOR_VERSION_16UP');
|
||||
$msg = str_replace('1.6', $this->minimum_joomla_release, $msg);
|
||||
}
|
||||
$app->enqueueMessage($msg, 'error');
|
||||
return false;
|
||||
}
|
||||
|
||||
// If there is debris from a previous failed attempt to install Attachments, delete it
|
||||
// NOTE: Creating custom query because using JComponentHelper::isEnabled insists on
|
||||
// printing a warning if the component is not installed
|
||||
$db = JFactory::getDbo();
|
||||
$query = $db->getQuery(true);
|
||||
$query->select('extension_id AS id, enabled');
|
||||
$query->from('#__extensions');
|
||||
$query->where($query->qn('type') . ' = ' . $db->quote('component'));
|
||||
$query->where($query->qn('element') . ' = ' . $db->quote('com_attachments'));
|
||||
$db->setQuery($query);
|
||||
if ( $db->loadResult() == 0 )
|
||||
{
|
||||
if (JFolder::exists(JPATH_ROOT . '/components/com_attachments') OR
|
||||
JFolder::exists(JPATH_ROOT . '/administrator/components/com_attachments'))
|
||||
{
|
||||
$msg = JText::_('ATTACH_ERROR_UINSTALL_OLD_VERSION');
|
||||
$app->enqueueMessage($msg, 'error');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Temporarily move the attachments directory out of the way to avoid conflicts
|
||||
$attachdir = JPATH_ROOT.'/attachments';
|
||||
if ( JFolder::exists($attachdir) ) {
|
||||
|
||||
// Move the attachments directory out of the way temporarily
|
||||
$this->moved_attachments_dir = JPATH_ROOT.'/temporarily_renamed_attachments_folder';
|
||||
if ( JFolder::move($attachdir, $this->moved_attachments_dir) !== true ) {
|
||||
$msg = JText::sprintf('ATTACH_ERROR_MOVING_ATTACHMENTS_DIR');
|
||||
$app->enqueueMessage($msg, 'error');
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( $attachments_install_verbose ) {
|
||||
$msg = JText::sprintf('ATTACH_TEMPORARILY_RENAMED_ATTACHMENTS_DIR_TO_S', $this->moved_attachments_dir);
|
||||
$app->enqueueMessage($msg, 'message');
|
||||
}
|
||||
}
|
||||
|
||||
// ??? Joomla! 2.5x+ bugfix for "Can not build admin menus"
|
||||
if(in_array($type, array('install','discover_install'))) {
|
||||
$this->_bugfixDBFunctionReturnedNoError('com_attachments');
|
||||
}
|
||||
else {
|
||||
$this->_bugfixCantBuildAdminMenus('com_attachments');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Attachments component postflight function
|
||||
*
|
||||
* @param $type : type of installation
|
||||
* @param $parent : the installer parent
|
||||
*/
|
||||
public function postflight($type, $parent)
|
||||
{
|
||||
global $attachments_install_verbose, $attachments_install_last_method;
|
||||
|
||||
$app = JFactory::getApplication();
|
||||
$db = JFactory::getDBO();
|
||||
|
||||
// Make sure the translations are available
|
||||
$lang = JFactory::getLanguage();
|
||||
$lang->load('com_attachments', JPATH_ADMINISTRATOR);
|
||||
|
||||
// Enable all the plugins
|
||||
foreach ($this->plugins as $plugin_name)
|
||||
{
|
||||
// Make the query to enable the plugin
|
||||
$plugin_title = JText::_($plugin_name);
|
||||
$query = $db->getQuery(true);
|
||||
$query->update('#__extensions');
|
||||
$query->set("enabled = 1");
|
||||
$query->where('type=' . $db->quote('plugin') . ' AND name=' . $db->quote($plugin_name));
|
||||
$db->setQuery($query);
|
||||
$db->query();
|
||||
|
||||
// Complain if there was an error
|
||||
if ( $db->getErrorNum() ) {
|
||||
$errmsg = JText::sprintf('ATTACH_WARNING_FAILED_ENABLING_PLUGIN_S', $plugin_title);
|
||||
$errmsg .= $db->getErrorMsg();
|
||||
$app->enqueueMessage($errmsg, 'error');
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( $attachments_install_verbose ) {
|
||||
$app->enqueueMessage(JText::sprintf('ATTACH_ENABLED_ATTACHMENTS_PLUGIN_S', $plugin_title), 'message');
|
||||
}
|
||||
}
|
||||
|
||||
if ( $attachments_install_verbose ) {
|
||||
$app->enqueueMessage(JText::_('ATTACH_ALL_ATTACHMENTS_PLUGINS_ENABLED'), 'message');
|
||||
}
|
||||
|
||||
// Restore the attachments directory (if renamed)
|
||||
$attachdir = JPATH_ROOT.'/attachments';
|
||||
if ( $this->moved_attachments_dir && JFolder::exists($this->moved_attachments_dir) ) {
|
||||
JFolder::move($this->moved_attachments_dir, $attachdir);
|
||||
if ( $attachments_install_verbose ) {
|
||||
$app->enqueueMessage(JText::sprintf('ATTACH_RESTORED_ATTACHMENTS_DIR_TO_S', $attachdir), 'message');
|
||||
}
|
||||
}
|
||||
|
||||
// If needed, add the 'url_verify' column (may be needed because of SQL update issues)
|
||||
$attachments_table = '#__attachments';
|
||||
$cols = $db->getTableColumns($attachments_table);
|
||||
if ( !array_key_exists('url_verify', $cols))
|
||||
{
|
||||
$query = "ALTER TABLE " . $db->quoteName($attachments_table);
|
||||
$query .= " ADD COLUMN " . $db->quoteName('url_verify');
|
||||
$query .= " TINYINT(1) UNSIGNED NOT NULL DEFAULT '1'";
|
||||
$query .= " AFTER " . $db->quoteName('url_relative');
|
||||
$db->setQuery($query);
|
||||
if ( !$db->query() ) {
|
||||
// Ignore any DB errors (may require manual DB mods)
|
||||
// ??? $errmsg = $db->stderr();
|
||||
}
|
||||
}
|
||||
|
||||
// Check to see if we should be in secure mode
|
||||
jimport('joomla.filesystem.file');
|
||||
$htaccess_file = $attachdir . '/.htaccess';
|
||||
if ( JFile::exists($htaccess_file) ) {
|
||||
if ( com_AttachmentsInstallerScript::setSecureMode() ) {
|
||||
if ( $attachments_install_verbose ) {
|
||||
$app->enqueueMessage(JText::_('ATTACH_RESTORED_SECURE_MODE'), 'message');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Add warning message about how to uninstall properly
|
||||
$emphasis = 'font-size: 125%; font-weight: bold;';
|
||||
$padding = 'padding: 0.5em 0;';
|
||||
$pkg_name = JText::_('ATTACH_PACKAGE_ATTACHMENTS_FOR_JOOMLA_16PLUS');
|
||||
$pkg_uninstall = JText::sprintf('ATTACH_PACKAGE_NOTICE_UNINSTALL_PACKAGE_S', $pkg_name);
|
||||
$app->enqueueMessage("<div style=\"$emphasis $padding\">$pkg_uninstall</div>", 'notice');
|
||||
|
||||
// Ask the user for feedback
|
||||
if ( $attachments_install_verbose ) {
|
||||
$msg = JText::sprintf('ATTACH_PLEASE_REPORT_BUGS_AND_SUGGESTIONS_TO_S',
|
||||
'<a href="mailto:jmcameron@jmcameron.net">jmcameron@jmcameron.net</a>');
|
||||
$app->enqueueMessage("<div style=\"$emphasis $padding\">$msg</div>", 'message');
|
||||
}
|
||||
|
||||
// Once postflight has run once, don't repeat the message if it runs again (eg, upgrade after install)
|
||||
$attachments_install_verbose = false;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Install the default ACL/permissions rules for the new attachments privileges in the root rule
|
||||
*/
|
||||
protected function installPermissions()
|
||||
{
|
||||
global $attachments_install_verbose;
|
||||
|
||||
/** Load the Attachments defines */
|
||||
require_once(JPATH_ADMINISTRATOR.'/components/com_attachments/update.php');
|
||||
AttachmentsUpdate::installAttachmentsPermissions($attachments_install_verbose);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Enforce secure mode if attachments/.htaccess file exists and it is a fresh install
|
||||
*
|
||||
* @return true if the secure mode was updated
|
||||
*/
|
||||
protected function setSecureMode()
|
||||
{
|
||||
$db = JFactory::getDBO();
|
||||
$query = $db->getQuery(true);
|
||||
$query->select('*')->from('#__extensions');
|
||||
$query->where('type=' . $db->quote('component') . ' AND name=' . $db->quote('com_attachments'));
|
||||
$db->setQuery($query, 0, 1);
|
||||
$component = $db->loadObject();
|
||||
if ( $db->getErrorNum() ) {
|
||||
return false;
|
||||
}
|
||||
if ( $component->params == '{}' ) {
|
||||
// Fresh install, update the DB directly (otherwise, this should not be necessary)
|
||||
$query = $db->getQuery(true);
|
||||
$query->update('#__extensions');
|
||||
$query->set('params=' . $db->quote('{\"secure\":\"1\"}'));
|
||||
$query->where('type=' . $db->quote('component') . ' AND name=' . $db->quote('com_attachments'));
|
||||
$db->setQuery($query);
|
||||
$db->query();
|
||||
if ( $db->getErrorNum() ) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Joomla! 1.6+ bugfix for "DB function returned no error"
|
||||
*
|
||||
* Adapted from Akeeba Backup install script (https://www.akeebabackup.com/)
|
||||
* with permission of Nicholas Dionysopoulos (Thanks Nick!)
|
||||
*
|
||||
* @param $extension_name string The name of the extension
|
||||
*/
|
||||
private function _bugfixDBFunctionReturnedNoError($extension_name)
|
||||
{
|
||||
$db = JFactory::getDbo();
|
||||
|
||||
// Fix broken #__assets records
|
||||
$query = $db->getQuery(true);
|
||||
$query->select('id')
|
||||
->from('#__assets')
|
||||
->where('name = '.$db->quote($extension_name));
|
||||
// ??? Removed unneeded db->quote('name') since it failed in Joomla 3.0 Beta
|
||||
$db->setQuery($query);
|
||||
$ids = $db->loadResultArray();
|
||||
if(!empty($ids)) foreach($ids as $id) {
|
||||
$query = $db->getQuery(true);
|
||||
$query->delete('#__assets')
|
||||
->where($db->nameQuote('id').' = '.$db->quote($id));
|
||||
$db->setQuery($query);
|
||||
$db->query();
|
||||
}
|
||||
|
||||
// Fix broken #__extensions records
|
||||
$query = $db->getQuery(true);
|
||||
$query->select('extension_id')
|
||||
->from('#__extensions')
|
||||
->where($db->nameQuote('element').' = '.$db->quote($extension_name));
|
||||
$db->setQuery($query);
|
||||
$ids = $db->loadResultArray();
|
||||
if(!empty($ids)) foreach($ids as $id) {
|
||||
$query = $db->getQuery(true);
|
||||
$query->delete('#__extensions')
|
||||
->where($db->nameQuote('extension_id').' = '.$db->quote($id));
|
||||
$db->setQuery($query);
|
||||
$db->query();
|
||||
}
|
||||
|
||||
// Fix broken #__menu records
|
||||
$query = $db->getQuery(true);
|
||||
$query->select('id')
|
||||
->from('#__menu')
|
||||
->where($db->nameQuote('type').' = '.$db->quote('component'))
|
||||
->where($db->nameQuote('menutype').' = '.$db->quote('main'))
|
||||
->where($db->nameQuote('link').' LIKE '.$db->quote('index.php?option='.$extension_name.'%'));
|
||||
$db->setQuery($query);
|
||||
$ids = $db->loadResultArray();
|
||||
if(!empty($ids)) foreach($ids as $id) {
|
||||
$query = $db->getQuery(true);
|
||||
$query->delete('#__menu')
|
||||
->where($db->nameQuote('id').' = '.$db->quote($id));
|
||||
$db->setQuery($query);
|
||||
$db->query();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Joomla! 1.6+ bugfix for "Can not build admin menus"
|
||||
*
|
||||
* Adapted from Akeeba Backup install script (https://www.akeebabackup.com/)
|
||||
* with permission of Nicholas Dionysopoulos (Thanks Nick!)
|
||||
*
|
||||
*/
|
||||
private function _bugfixCantBuildAdminMenus($extension_name)
|
||||
{
|
||||
$db = JFactory::getDbo();
|
||||
|
||||
// If there are multiple #__extensions record, keep one of them
|
||||
$query = $db->getQuery(true);
|
||||
$query->select('extension_id')
|
||||
->from('#__extensions')
|
||||
->where($db->nameQuote('element').' = '.$db->quote($extension_name));
|
||||
$db->setQuery($query);
|
||||
$ids = $db->loadResultArray();
|
||||
if(count($ids) > 1) {
|
||||
asort($ids);
|
||||
$extension_id = array_shift($ids); // Keep the oldest id
|
||||
|
||||
foreach($ids as $id) {
|
||||
$query = $db->getQuery(true);
|
||||
$query->delete('#__extensions')
|
||||
->where($db->nameQuote('extension_id').' = '.$db->quote($id));
|
||||
$db->setQuery($query);
|
||||
$db->query();
|
||||
}
|
||||
}
|
||||
|
||||
// If there are multiple assets records, delete all except the oldest one
|
||||
$query = $db->getQuery(true);
|
||||
$query->select('id')
|
||||
->from('#__assets')
|
||||
->where('name = '.$db->quote($extension_name));
|
||||
// ??? Removed unneeded db->quote('name') since it failed in Joomla 3.0 Beta
|
||||
$db->setQuery($query);
|
||||
$ids = $db->loadObjectList();
|
||||
if(count($ids) > 1) {
|
||||
asort($ids);
|
||||
$asset_id = array_shift($ids); // Keep the oldest id
|
||||
|
||||
foreach($ids as $id) {
|
||||
$query = $db->getQuery(true);
|
||||
$query->delete('#__assets')
|
||||
->where($db->nameQuote('id').' = '.$db->quote($id));
|
||||
$db->setQuery($query);
|
||||
$db->query();
|
||||
}
|
||||
}
|
||||
|
||||
// Remove #__menu records for good measure!
|
||||
$query = $db->getQuery(true);
|
||||
$query->select('id')
|
||||
->from('#__menu')
|
||||
->where($db->nameQuote('type').' = '.$db->quote('component'))
|
||||
->where($db->nameQuote('menutype').' = '.$db->quote('main'))
|
||||
->where($db->nameQuote('link').' LIKE '.$db->quote('index.php?option='.$extension_name.'%'));
|
||||
$db->setQuery($query);
|
||||
$ids = $db->loadResultArray();
|
||||
if(!empty($ids)) foreach($ids as $id) {
|
||||
$query = $db->getQuery(true);
|
||||
$query->delete('#__menu')
|
||||
->where($db->nameQuote('id').' = '.$db->quote($id));
|
||||
$db->setQuery($query);
|
||||
$db->query();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,286 @@
|
||||
; en-GB.com_attachments.help.ini (Help page)
|
||||
; Attachments for Joomla! extension
|
||||
; Copyright (C) 2013-2018 Jonathan M. Cameron, All rights reserved.
|
||||
; License http://www.gnu.org/licenses/gpl-3.0.html GNU/GPL
|
||||
; Note : All ini files need to be saved as UTF-8 - No BOM
|
||||
|
||||
; NOTES TO TRANSLATORS:
|
||||
; * Do not remove or change any items in curly brackets like this: {LINK}
|
||||
; * Please do not translate any html tags (such as <strong> or <em>).
|
||||
; * please do not add any extra html tags if possible.
|
||||
|
||||
; English translation
|
||||
|
||||
ATTACH_HELP_000000_MAIN_TITLE="Attachments Documentation"
|
||||
ATTACH_HELP_000100_MAIN_VERSION="This version is for Joomla 2.5+ or 3.x"
|
||||
ATTACH_HELP_000200_MAIN_CONTENTS="Contents"
|
||||
ATTACH_HELP_010000_SECTION_TITLE="Introduction"
|
||||
ATTACH_HELP_010100_TEXT="The 'Attachments' extension for Joomla! allows files to be uploaded and attached to articles, categories, or other types of content items. The 'Attachments' extension includes a plugin to display the attachments and a component for uploading and managing attachments, as well as other plugins. There are options to control who can see the attachments and who can upload them, along with many options to increase its flexibility and usefulness. Note: all options are controlled through the component manager."
|
||||
ATTACH_HELP_010200_WARNING="This version of the <em>Attachments</em> extension only works for Joomla! 2.5.7 or greater. Joomla 1.7 is no longer supported."
|
||||
ATTACH_HELP_010300_NOTE="In the rest of this document, the term <strong>content item</strong> is sometimes used. Normally we think of attaching files to articles. Attachments supports attaching files and URLs to articles or category descriptions by default. But it is possible to attach to other types of content types (this requires special 'Attachments' plugins). All of these are referred to as <strong>content items.</strong>."
|
||||
ATTACH_HELP_010400_TEXT="The 'Attachments' extension has been translated into many different languages. Please see the {SECT_TRANS} section for the list of available translations."
|
||||
ATTACH_HELP_010500_TEXT="If you wish to subscribe to an email list for announcements about this extension, please subscribe using this web page:"
|
||||
ATTACH_HELP_010600_TEXT="Attachments Email List (%s)"
|
||||
ATTACH_HELP_020000_SECTION_TITLE="Main new features in Attachments 3.1"
|
||||
ATTACH_HELP_020100_TEXT="Attachments 3.1 now runs on Joomla 3.0 and greater."
|
||||
ATTACH_HELP_020200_TEXT="Attachments 3.1 fixes several issues for non Super-users who have limited backend access."
|
||||
ATTACH_HELP_020300_TEXT="Attachments 3.1 adds the ability to display attachments on the frontend that require logging in before access is allowed."
|
||||
ATTACH_HELP_020400_TEXT="Attachments 3.1 adds an Attachments 'quickicon' in the main Joomla control panel for convenience."
|
||||
ATTACH_HELP_030000_SECTION_TITLE="Major features of the Attachments Extension"
|
||||
ATTACH_HELP_030100_TEXT="Full support for the ACL/permissions system of Joomla 2.5+. This gives you significant flexibility to control who can create, edit, or delete attachments. See the {SECT_PERMS} section for more details."
|
||||
ATTACH_HELP_030200_TEXT="Full support for viewing access levels. This means you can set some of your attachments to be visible by anyone, and some to be visible only to users in certain groups (as defined by the Access Levels). See the {SECT_ACCESS} section for more details."
|
||||
ATTACH_HELP_030300_TEXT="You can manage attachments from the article editor, including adding, editing, and deleting attachments."
|
||||
ATTACH_HELP_030400_TEXT="You can create attachments while an article is being created."
|
||||
ATTACH_HELP_030500_TEXT="All attachments lists on the front end are updated by Ajax and do not require full page reloads."
|
||||
ATTACH_HELP_030600_TEXT="You can "attach" URLs as well as files to content items."
|
||||
ATTACH_HELP_030700_TEXT="You can show the attachments list anywhere in an article (or content item)."
|
||||
ATTACH_HELP_030800_TEXT="In the administrative back end:"
|
||||
ATTACH_HELP_030900_TEXT="There are options to filter the listed attachments to unpublished or trashed articles or content items."
|
||||
ATTACH_HELP_031000_TEXT="Filtering of the list of articles"
|
||||
ATTACH_HELP_031100_TEXT="Sorting the list of attachments by any of the column headers."
|
||||
ATTACH_HELP_031200_TEXT="Useful administrative utility commands"
|
||||
ATTACH_HELP_031300_TEXT="The Attachments extension supports "Attachments plugins". These plugins allow attaching files to any content item that invokes the {ONCONTENTPREPARE} plugin. For example, you can attach files to Category descriptions. With a bit of work, an extension developer can create a new 'Attachments' plugin to support adding attachments to things like CB personal info displays, Virtuemart product descriptions, etc. See the {SECT_FILES} section for more details."
|
||||
ATTACH_HELP_040000_SECTION_TITLE="Uploading Restrictions"
|
||||
ATTACH_HELP_040100_TEXT="Not all types of attachment files can be uploaded. The 'Attachments' extension will not allow uploading of file types that are not permitted by the Joomla! Media Manager. To see (or change) what file types are allowed, go to the <strong>Media manager</strong> item under the <strong>Content</strong> menu. Click on the <strong>Options</strong> button on the right end of the toolbar and select the <em>Component</em> tab. There you will see the options for controlling what types of file extensions and mime types are permitted for uploads. The 'Attachments' extension respects the file type limitations in the 'Legal Extensions (File Types)'. Add extensions for any file type that you require in the 'Legal Extensions (File Types)' field. You may also add appropriate MIME types in the 'Legal MIME Types'; field. Note that the upload file size limit in the Media Manage is ignored by the Attachments extension (as well as the other options on this page)."
|
||||
ATTACH_HELP_040200_WARNING="If you add items to the "Legal Extensions" or "Legal MIME Types" fields, do not add any spaces between items!"
|
||||
ATTACH_HELP_050000_SECTION_TITLE="Attachments Settings"
|
||||
ATTACH_HELP_050100_TEXT="All of the settings for 'Attachments' are controlled via the component manager. To access these settings, go to the administrative back end and select "Attachments" under the "Component" menu. Click on the "Options" button on the right end of the tool bar and you will see options grouped under several tabs."
|
||||
ATTACH_HELP_050150_NOTE="In the following sections, the screenshot images of options will look a little different on Joomla 3 but the options are identical."
|
||||
ATTACH_HELP_050200_SUBSECTION_TITLE="Basic Options"
|
||||
ATTACH_HELP_050300_TEXT="This 'auto publish' feature controls whether new attachments are published by default when they are added. If 'Yes' is selected, when attachments are added, they will be published immediately and will be visible to users. If 'No' is selected, new attachments will not be published by default. An administrator or someone with appropriate permissions will need to publish them before the attachments will be available to users."
|
||||
ATTACH_HELP_050400_TEXT="If the auto-publish option is disabled (see the previous option), you may wish to inform those adding attachments how they can get their attachment published. You can insert an appropriate message here. If this field is empty, a general system message will be added suggesting that they contact their system administrator to publish any newly uploaded attachments."
|
||||
ATTACH_HELP_050600_TEXT="<strong>Name for user-defined field 1-3:</strong> If you have some additional information about each attachment that you wish to add, the 'Attachments' extension allows you to defined up to three optional user-defined fields. To create a new field, insert the name for it in one of the three entries. Clear the name to disable the display and editing of this field. The user-defined fields will be shown in the order listed here. The maximum length of each user-defined field name is 40 characters. The data in these fields may be up to 255 characters long."
|
||||
ATTACH_HELP_050700_HINT_TEXT="If you add an asterisk to the end of the name of a user-defined field, it will not be displayed on the front end. It will be visible when an attachment is edited on the front end and always be visible in the back end. This hidden user-defined field can be used to order attachments in an arbitrary order by putting appropriate integer values in the field."
|
||||
ATTACH_HELP_050800_TEXT="The maximum filename or URL length for attachments list. Filenames or URLs longer than this will be truncated and put into the display name (for display purposes only, the actual filename or URL will not be changed). A value of 0 means the filename length is unlimited by this option (the display_name field in the attachments database table is limited to 80 characters). Note: If display filenames or URLs are truncated by this option, the truncated name will be inserted into the "Display Filename / URL" field. This option only affects attachments added after this option is set."
|
||||
ATTACH_HELP_050900_TEXT="This option controls the location in the article (or content item) where the list of attachments will be placed. This option applies to all attachments lists:"
|
||||
ATTACH_HELP_051000_TEXT="<em>At the beginning</em>"
|
||||
ATTACH_HELP_051100_TEXT="<em>At the end</em>"
|
||||
ATTACH_HELP_051200_TEXT="<em>Custom placement</em>' - With this option, the attachments list will appear in the article (or content item) where ever the special tag: {attachments} occurs."
|
||||
ATTACH_HELP_051300_WARNING="In custom placement mode, any article (or content item) that does not include this tag will display its the attachments list at its end."
|
||||
ATTACH_HELP_051400_TEXT="In this mode, when editing an article in the back end, an extra button will be displayed below the edit area: [Insert {attachments} token]. Position the cursor where you want the custom placement token inserted and use this button to insert the token. This button will add surrounding HTML tags to hide the token when it is not replaced (for example when the attachments list is not supposed to be visible). In HTML, the token looks like this with the surrounding tags to hide it:"
|
||||
ATTACH_HELP_051500_TEXT="In the back end editors, you will see the {attachments} tag but not the HTML 'span' tags unless you switch to HTML mode. In the front end, you will never see the {attachments} tag unless the insert_attachments_tag plugin is disabled. If you wish to remove the {attachments} token, you may want to use the "HTML" view mode in the editor to make sure that you also delete the surrounding span tags."
|
||||
ATTACH_HELP_051600_WARNING="The custom placement mode does not currently work for attachments on category descriptions for Joomla versions before 2.5.10. This is a good reason to upgrade your version of Joomla!"
|
||||
ATTACH_HELP_051700_TEXT="'<em>Disabled (filter)</em>' - This option will disable the display of attachments lists and suppress the display of any {attachments} tags in articles or content items."
|
||||
ATTACH_HELP_051800_TEXT="'<em>Disabled (no filter)</em>' - This option will disable the display of attachments lists and will not suppress the display of any {attachments} tags in articles (or content items)."
|
||||
ATTACH_HELP_052000_SUBSECTION_TITLE="Formatting Options"
|
||||
ATTACH_HELP_052100_TEXT="<strong>Show titles:</strong> If set to 'Yes', a row of titles will be added above the list of attachments describing what is in each column."
|
||||
ATTACH_HELP_052200_TEXT="<strong>Show attachment description:</strong> This setting controls whether the attachment description is shown in the list of attachments."
|
||||
ATTACH_HELP_052300_TEXT="<strong>Show attachment creator:</strong> Show the username of the one who created (uploaded) the attachment."
|
||||
ATTACH_HELP_052400_TEXT="<strong>Show file size:</strong> This setting controls whether the attachment file size is shown in the list of attachments."
|
||||
ATTACH_HELP_052500_TEXT="<strong>Show number of downloads:</strong> This setting controls whether the number of downloads is shown in the list of attachments."
|
||||
ATTACH_HELP_052600_WARNING="This option only works for file attachments in secure mode! In non-secure mode, files are maintained as static files and accessed directly, without going through Joomla! code. Therefore it is impossible to update the number of downloads for a file when it is accessed this way. So the display of the number of file or URL downloads will only work in secure mode when this option is set to 'Yes'."
|
||||
ATTACH_HELP_052650_TEXT="<strong>Show attachment creation date:</strong> If this setting is 'Yes', the creation date for the attachment will be added to the attachment list for articles that have attachments. If 'No' is selected, no date will be added to the attachment list."
|
||||
ATTACH_HELP_052700_TEXT="<strong>Show attachment modification date:</strong> If this setting is 'Yes', the modification date for the attachment will be added to the attachment list for articles that have attachments. If 'No' is selected, no date will be added to the attachment list."
|
||||
ATTACH_HELP_052800_TEXT="<strong>Format string for dates:</strong> You may select the format for the displayed creation and modification dates by giving a format string like ones used by the Joomla <cite>JDate::format()</cite> function (which is based on the PHP DateTime::format function). Search the web with 'PHP DateTime' for examples. Note that JDate handles translation of month/day names as necessary. The default format string (Y-m-d H:i) gives dates with 24-hour time like 2013-01-05 16:21. To remove the time-of-day part, leave out the 'H:i' part."
|
||||
ATTACH_HELP_052900_TEXT="<strong>Attachments list order:</strong> This option allows you to specify the order in which attachments will be listed in the attachments lists. Most of the options are self-explanatory:"
|
||||
ATTACH_HELP_053000_TEXT="'<em>{LABEL}</em>' - If this option is selected, the attachments will be sorted alphabetically by the filename. "
|
||||
ATTACH_HELP_053100_TEXT="'<em>{LABEL}</em>'"
|
||||
ATTACH_HELP_053200_TEXT="'<em>{LABEL}</em>'"
|
||||
ATTACH_HELP_053300_TEXT="'<em>{LABEL}</em>'"
|
||||
ATTACH_HELP_053400_TEXT="'<em>{LABEL}</em>'"
|
||||
ATTACH_HELP_053500_TEXT="'<em>{LABEL}</em>'"
|
||||
ATTACH_HELP_053600_TEXT="'<em>{LABEL}</em>' - Sort the attachments by their filenames or URLs. All attachments that have blank display filenames/URLs will appear before the ones with display filenames. "
|
||||
ATTACH_HELP_053700_TEXT="'<em>{LABEL}</em>'"
|
||||
ATTACH_HELP_053800_TEXT="'<em>{LABEL}</em>' - Sort by the name of the user who uploaded the attachment."
|
||||
ATTACH_HELP_053900_TEXT="'<em>{LABEL}</em>'"
|
||||
ATTACH_HELP_054000_TEXT="'<em>{LABEL}</em>'"
|
||||
ATTACH_HELP_054100_TEXT="'<em>{LABEL}</em>'"
|
||||
ATTACH_HELP_054200_TEXT="'<em>{LABEL}</em>'"
|
||||
ATTACH_HELP_054300_TEXT="'<em>{LABEL}</em>' - If this option is selected, the attachments will be sorted by the attachment ID. This usually has the effect of ordering the attachments in the order they were created. "
|
||||
ATTACH_HELP_054400_TEXT="'<em>{LABEL}</em>'"
|
||||
ATTACH_HELP_054500_TEXT="'<em>{LABEL}</em>'"
|
||||
ATTACH_HELP_054600_TEXT="'<em>{LABEL}</em>'"
|
||||
ATTACH_HELP_055000_SUBSECTION_TITLE="Visibility Options"
|
||||
ATTACH_HELP_055100_TEXT="These options control when attachments will be visible on the front page, assuming the user is in the appropriate groups to see the attachments."
|
||||
ATTACH_HELP_055200_TEXT="<strong>Hide attachments on the front page:</strong> Select this option to prevent any attachments from being shown on the front page of your website."
|
||||
ATTACH_HELP_055300_TEXT="<strong>Hide attachments before 'Read More' breaks:</strong> Select this option to prevent attachments from being displayed on the front end if they are before 'Read More' breaks in articles. If you click on the link to read the full article, the attachments will be shown."
|
||||
ATTACH_HELP_055400_TEXT="<strong>Hide attachments on blog pages:</strong> Select this option to prevent attachments from being shown on any page with 'blog' layouts."
|
||||
ATTACH_HELP_055500_TEXT="<strong>Hide attachments except on article views:</strong> Select this option to prevent attachments from being shown on any page on the front page except for views for single specific articles."
|
||||
ATTACH_HELP_055600_TEXT="<strong>Always show attachments on category views:</strong> Select this option to always show attachments on category views -- regardless of other options."
|
||||
ATTACH_HELP_055700_TEXT="<strong>Hide attachments for categories:</strong> Hide attachments on any category views for the selected categories. Note that attachments will be displayed for children categories unless they are explicitly selected. To select or deselect categories without affecting other categories, hold the Control-key when left mouse-clicking on the category. In the figure, only one category is selected."
|
||||
ATTACH_HELP_055800_TEXT="<strong>Show attachments to non-logged in users:</strong> {DESCRIPTION} The URL to login or register can be specified on the 'Advanced' options tab."
|
||||
ATTACH_HELP_055900_TEXT="<strong>Hide 'Add Attachments' link:</strong> Always hide the 'Add Attachments' link on the front page. This requires attachments to be added to articles, etc, by editing them in the front page (where an 'Add Attachments' button will be available under the editing area)."
|
||||
ATTACH_HELP_057000_SUBSECTION_TITLE="Advanced Options"
|
||||
ATTACH_HELP_057050_TEXT="<strong>Maximum attachment size (MB):</strong> {DESCRIPTION}. For information on increasing the upload size limit on your sever, see the {SECT_WARN} section."
|
||||
ATTACH_HELP_057100_TEXT="<strong>Characters forbidden in uploaded filenames:</strong> Filenames containing these characters will not be allowed to be uploaded. These characters are problematic in the URL presented to the user for file attachments in 'non-secure' mode so they are forbidden. These characters are generally not an issue when using 'secure' mode since the filename is not used as part of the URL presented to the user."
|
||||
ATTACH_HELP_057200_TEXT="<strong>CSS style for attachments tables:</strong> To override the CSS styling of attachments lists, specify your own style name here. The default style name is 'attachmentsList'. For more information about customizing the display of attachments lists, see the section {SECT_STYLE}."
|
||||
ATTACH_HELP_057300_TEXT="<strong>File link open mode:</strong> This mode how the links to attachment files will be opened. 'In same window' means the file will be opened in the same browser window. 'In new window' means the file will be opened in a new window. In some browsers, using the 'In new window' option will actually open the attachment in a new tab."
|
||||
ATTACH_HELP_057400_TEXT="<strong>Custom titles for attachments lists:</strong> By default, the 'Attachments' extension inserts the title "Attachments:" above the list of attachments for each article or content item (if it has attachments). In some cases, you may prefer using some other term for specific articles or content items. You may specify the exact term you would like to use on an item-by-item basis. For example, if you would like article 211 to use the custom title "Downloads:", then add this to this setting: '211 Downloads' (without the quotes). Use one entry per line. For other types of content items, use the form: 'category:23 This is the title for category 23' where 'category' can be replaced by the name of the content item entity. The example for articles above could have been done with 'article:211 Downloads'. Note that an entry without a numeric ID at the beginning will be applied to all content items. So it is good practice to put such global overrides first in the list and then override the item-by-item custom titles afterward."
|
||||
ATTACH_HELP_057500_NOTE="If you wish to change the titles used for attachments lists globally, you may copy the translations entry 'ATTACH_ATTACHMENTS_TITLE' from the translation file: {BLOCK1} into the global override file: {BLOCK2}"
|
||||
ATTACH_HELP_057600_NOTE="where qq-QQ refers to the language designator code such as en-GB for English. (If you are not familiar with Joomla! translation files, find the line that has 'ATTACH_ATTACHMENTS_TITLE' on left side of the '=' sign and the translation on the right in double-quotes. Edit anything to the right of the '=' sign. Do not change anything to the left of the '=' sign.). The reason to put your translation modifications into the global override file is because the first translation file listed above is part of the Attachments extension and will be updated if the Attachments extensions is upgraded (meaning that any changes you do to it will be lost)."
|
||||
ATTACH_HELP_057700_TEXT="<strong>Timeout for checking links:</strong>Timeout for checking links (seconds). Whenever a link is added as an attachment, the link is checked directly (you can disable this check in the form). If the link can be accessed before the timeout, the file size and other information about the link is retrieved. If not, generic information is used. To disable the check, enter 0."
|
||||
ATTACH_HELP_057800_TEXT="<strong>Superimpose URL link icons:</strong>Superimpose URL link icons over the file attachment icon for each attachment to indicate it is a URL. Valid URLs are shown with arrows and invalid URLs are shown with a red line across the file type icon (bottom left to top right)."
|
||||
ATTACH_HELP_057900_TEXT="<strong>Suppress obsolete attachments (in back end):</strong>Set the default for suppressing <em>obsolete</em> attachments in the administrative back end. In this context, <em>obsolete</em> attachments are ones attached to unpublished or trashed parents. You can override this using the 'Show attachments for' drop-down menu on the right just above the list of attachments (on the same line as the filter). When you use the drop-down menu to control which attachments are visible, the system remembers that setting until you log out as administrator. So changing this parameter may not seem to have an effect. This parameter setting will come into effect the next time you log in as administrator."
|
||||
ATTACH_HELP_057940_TEXT="<strong>URL to log in:</strong> {DESCRIPTION}"
|
||||
ATTACH_HELP_057960_TEXT="<strong>URL to register:</strong> {DESCRIPTION}"
|
||||
ATTACH_HELP_058000_SUBSECTION_TITLE="Security Options"
|
||||
ATTACH_HELP_058100_TEXT="<strong>Secure attachment downloads:</strong> By default, the 'Attachments' extension saves attachment files in a publicly accessible sub-directory. If you choose the <em>secure</em> option, the directory in which the attachments are saved will be made publicly inaccessible. The download links for the attachments in the front end will download the attachment files but will not be direct links. This will prevent access unless users have appropriate permissions. If <em>secure</em> downloads are not selected, the links to the attachments will be shown as the options above indicate, but the files will still be accessible to anyone if they know the full URL (even if they are not logged in), since the sub-directory is public."
|
||||
ATTACH_HELP_058200_TEXT="The <em>secure</em> option prevents access to uploaded files to users without appropriate permissions even if they know the full URL, since this option prevents public access to the attachments sub-directory. For URL 'attachments', the 'display name' for the URL is shown but not the full URL. When a user with appropriate permissions tries to access a URL attachment, they will be redirected to the desired URL. So for URL 'attachments', the display name must be set if the actual URL is not to be exposed."
|
||||
ATTACH_HELP_058300_TEXT="In <em>secure</em> mode, any attachment set to the 'Public' access level can be seen and downloaded by anyone."
|
||||
ATTACH_HELP_058400_HINT="If you have problems with filenames with Unicode characters, you should enable the <strong>Secure attachment downloads</strong> option (especially on Windows servers)."
|
||||
ATTACH_HELP_058500_TEXT="<strong>Download mode for secure downloads:</strong> This option controls whether files should be downloaded as separate files or displayed in the browser (if the browser can handle that type of file). There are two options:"
|
||||
ATTACH_HELP_058600_TEXT="<em>'inline'</em> - In this mode, files that can be displayed by the browser will be displayed in the browser (such as text files and images)."
|
||||
ATTACH_HELP_058700_TEXT="<em>'attachment'</em> - With the 'attachment' mode, files will always be downloaded as separate files."
|
||||
ATTACH_HELP_058800_TEXT="In either case, files that can't be displayed in the browser will be downloaded as external files."
|
||||
ATTACH_HELP_059000_SUBSECTION_TITLE="Permissions Options"
|
||||
ATTACH_HELP_059100_TEXT="The permissions options are explained in the following {SECT_PERMS} section (next)."
|
||||
ATTACH_HELP_060000_SECTION_TITLE="Attachments Permissions"
|
||||
ATTACH_HELP_060100_TEXT="The attachments extension takes full advantage of the new Joomla! ACL/permissions system introduced in Joomla! 1.6. This gives websites that use Attachments a lot of flexibility to control who can create, edit, delete and manage attachments."
|
||||
ATTACH_HELP_060200_TEXT="Before describing the ACL permissions related to Attachments, it is important to understand a key underlying principle:"
|
||||
ATTACH_HELP_060300_IMPORTANT="All attachments are attached to a parent article, category, or other content item. Creating, editing, deleting, or changing the state of an attachment is considered to be a form of editing the parent content item. So the user must first have permission to edit the parent content item before any Attachments-specific permissions are checked."
|
||||
ATTACH_HELP_060400_TEXT="To change the permissions for various user groups, go to the administrative back end and select "Attachments" under the "Component" menu. Click on the "Options" button on the right end of the tool bar and then select the permissions tab. You will see something like this:"
|
||||
ATTACH_HELP_060500_TEXT="Permission Options"
|
||||
ATTACH_HELP_060600_TEXT="The attachments permissions options. The permissions for the Public group are shown."
|
||||
ATTACH_HELP_060700_TEXT="Here is a brief description of permissions related to Attachments that are available:"
|
||||
ATTACH_HELP_060800_TEXT="Permission"
|
||||
ATTACH_HELP_060900_TEXT="Description / Notes"
|
||||
ATTACH_HELP_061000_TEXT="ACL Action"
|
||||
ATTACH_HELP_062000_SUBSECTION_TITLE="Default Permissions"
|
||||
ATTACH_HELP_062100_TEXT="When the attachments extension is installed, it installs these basic permissions:"
|
||||
ATTACH_HELP_062200_IMPORTANT="<strong>Basic Behavior Of Default Permissions</strong>"
|
||||
ATTACH_HELP_062300_TEXT="Authors (and Managers) or above can add attachments to any article/parent they can edit"
|
||||
ATTACH_HELP_062400_TEXT="Authors (and Managers) or above can edit or delete any attachments on any article/parent they can edit"
|
||||
ATTACH_HELP_062500_TEXT="Editors (and Managers) or above can publish/unpublish attachments from the front end."
|
||||
ATTACH_HELP_062600_TEXT="Authors cannot publish their own attachments."
|
||||
ATTACH_HELP_062700_TEXT="If you want different defaults, you will need to edit the permissions using the "Permissions" tab on the Attachments options."
|
||||
ATTACH_HELP_063000_SUBSECTION_TITLE="Permissions Settings for Common Scenarios"
|
||||
ATTACH_HELP_063100_TEXT="Here are some suggestions about how to set the permissions to achieve the desired behaviors:"
|
||||
ATTACH_HELP_063200_TEXT="<strong>Scenario 1 - Authors can publish their own Attachments</strong>"
|
||||
ATTACH_HELP_063300_TEXT="In the permissions options, click on the 'Author' entry. Locate the 'Edit State of Own Attachments' line and set it to 'Allowed' and click on 'Save' to verify the changes."
|
||||
ATTACH_HELP_063400_TEXT="Permissions setting for scenario1"
|
||||
ATTACH_HELP_063500_TEXT="<strong>Scenario 2 - Authors can edit/delete their own attachments but no one else's</strong>"
|
||||
ATTACH_HELP_063600_TEXT="In the permissions options, click on the 'Author' entry. Locate the 'Edit State Of Attachments For Owned Article/Parent' and 'Delete Attachments For Owned Article/Parent' and set them both to 'Denied'. Click on 'Save' to verify the changes."
|
||||
ATTACH_HELP_063700_TEXT="Permissions setting for scenario2"
|
||||
ATTACH_HELP_063800_TEXT="Since Author still has permissions to edit/delete their own attachments this effectively prevents them from editing/deleting attachments that they did not create, even if they can edit the article."
|
||||
ATTACH_HELP_063900_TEXT="Note that all user groups derived from Author (e.g., Editor, Publisher, etc) will also be denied from editing or deleting attachments for articles/parents that they did not create (from this permission). Fortunately, they generally have the higher level permissions 'Edit Attachments' and 'Delete Attachments' which means they can edit or delete any attachments on any article that they can edit (assuming their permissions have not been changed)."
|
||||
ATTACH_HELP_064000_TEXT="If you have other common scenarios that you feel should be documented, please feel free to contact me so I can update this documentation (see the end of this page for contact information)."
|
||||
ATTACH_HELP_065000_SUBSECTION_TITLE="Other Notes on Permissions"
|
||||
ATTACH_HELP_065100_TEXT="If a user has permissions to edit the state of their attachments, they will see the 'Publish: Yes/No' options on forms to add or edit attachments. If they select 'No' and save the attachment, the attachment will still be visible to them in the front end (while they are logged in) but the row for that attachment will be shaded a dark gray as cue that the attachment is not public. No one else will see the unpublished attachments on the front end. If the user wants to change the Published state, they can edit the attachment (even though it is grayed out) and change the states."
|
||||
ATTACH_HELP_070000_SECTION_TITLE="Access Levels Visibility Control"
|
||||
ATTACH_HELP_070100_TEXT="The Attachments extension now supports the Joomla 'Access Levels'. Each attachment can be assigned to specific access levels such as 'Public', 'Registered', and 'Special', as well as any other access levels created on your site. The two basic levels are:"
|
||||
ATTACH_HELP_070200_TEXT="<strong>'Public'</strong> - Anyone visiting the website will be able to see and download attachments with 'access level' set to 'Public' if the article/parent is visible and no other Attachments visibility settings prevent the attachments from being shown."
|
||||
ATTACH_HELP_070300_TEXT="<strong>'Registered'</strong> - Anyone that is logged into the website will be able to see and download attachments with 'access level' set to 'Registered' if the article/parent is visible and no other Attachments visibility settings prevent the attachments from being shown."
|
||||
ATTACH_HELP_070400_TEXT="The effect of other access levels depends on the groups associated with the access level."
|
||||
ATTACH_HELP_070500_TEXT="The ability to set the 'Access Level' for individual attachments gives extensive control on who is able to see and download attachments."
|
||||
ATTACH_HELP_070600_NOTE="Suppose you create a new access level on your site. Users who are not explicitly members of the groups associated with the new access level will not be able to set their attachments for that access level. If you edit an attachment as the Super User, you might be surprised that the new access level does not show up in the access level options. If you have just created the new access level, you may need to log out of the back end and log in again for the changes to be completely visible (due to caching)."
|
||||
ATTACH_HELP_080000_SECTION_TITLE="Display Filename or URL"
|
||||
ATTACH_HELP_080100_TEXT="Normally, when files are uploaded (or URLs are installed) and listed in a list of attachments, the full filename (or URL) is shown as a link to download the attachment. In some cases, the filename (or URL) may be too long for this to work nicely. In the upload form, there is another field called "Display Filename or URL" in which the person uploading the file can insert an alternative filename (or URL) or label to display instead of the full filename (or URL). For instance, some abbreviation of the filename could be added in this field. The field may be edited in the administrative back end when attachments are edited. Note: There is an option called "Maximum Filename or URL Length" in the 'Attachments' extension options. It can be set to automatically truncate uploaded displayed filenames; the resulting truncated filename will be inserted into the "Display Filename or URL" field."
|
||||
ATTACH_HELP_090000_SECTION_TITLE="Attaching URLs"
|
||||
ATTACH_HELP_090100_TEXT="Besides files, the 'Attachments' extension has is the ability to "attach" URLs to content items. When you bring up one of the "Add attachment" dialog boxes, you will see a button labeled as "Enter URL instead". If you click on it you will get an entry field for the URL and see two options:"
|
||||
ATTACH_HELP_090200_TEXT="<strong>Verify URL existence?</strong> - In order to determine the file type of the URL (to pick a suitable icon), the code queries the server for basic information about the file including the file type and size. In some cases, the server will not respond to these requests even though the URL is valid. By default, Attachment will not accept URLs that have not been validated by the server. But if you know the URL is valid, you can uncheck this option and force the 'Attachments' extension to take the URL--but there are no guarantees the file type or file size will be correct. Note that the server will be queried whether or not this option is selected."
|
||||
ATTACH_HELP_090300_TEXT="<strong>Relative URL?</strong> - Normally you will enter URLs prefixed with 'http...' to indicate an full website URL. If you wish to point to files/commands relative to your Joomla installation, use the 'relative' option. In this case, you should set the 'Verify URL existence' option to No."
|
||||
ATTACH_HELP_090400_TEXT="The URLs are shown with the file-type icon and overlaid with an arrow (indicating that it is a good link) or an red diagonal slash (indicating that it could not be validated). When you edit a URL, you can change whether the link is valid or not to get the overlay you wish. Also note that URL overlays can be disabled entirely using the main <strong>Superimpose URL link icons</strong> parameter. There are several useful commands relating to URLs (and files) in the "Utilities" command in the back end."
|
||||
ATTACH_HELP_100000_SECTION_TITLE="What Can Files Be Attached To?"
|
||||
ATTACH_HELP_100100_TEXT="Besides attaching files or URLs to articles, it is possible to attach files or URLs to other types of content items such as Category descriptions (see below). If appropriate 'Attachments' plugins are installed, it may be possible to attach files or URLs to a wide variety of content items such as user profiles, shopping cart product descriptions, etc. Basically any content item that is displayed on the front end and uses the content event {ONCONTENTPREPARE} can host attachments (if a suitable 'Attachments' plugin is installed). Content items that invoke content events are typically items that have content to be displayed (such as articles) or have descriptions that will be displayed."
|
||||
ATTACH_HELP_100200_WARNING="Attachments for categories will only show the category basic parameter 'description' is set to <em>Show</em> (via the Menu Editor) AND the category description is not empty."
|
||||
ATTACH_HELP_100300_TEXT="If you wish to learn more about how to develop a new Attachment plugin, there is a manual that is available at the Attachments website:"
|
||||
ATTACH_HELP_100400_TEXT="Attachments Website (http://jmcameron.net/attachments)"
|
||||
ATTACH_HELP_100500_WARNING="The Attachment Plugin Creation Manual has been updated for Joomla 2.5 and 3.x but has not been thoroughly tested or reviewed. Please email me suggestions about how to improve the manual!"
|
||||
ATTACH_HELP_110000_SECTION_TITLE="CSS Styling of Attachment Lists"
|
||||
ATTACH_HELP_110100_TEXT="The lists of attachments on the front end are done using a special 'div' that contains a table for the attachments. The table has several different CSS classes associated with it to allow the website developer the flexibility to customize the appearance of the table. Look in the attachments plugin file CSS file (in <strong>media/com_attachments/css/attachments_list.css</strong> for examples. If you wish to change the style, consider copying the original styles into the end of the same file and renaming 'attachmentsList' in the copied section to something of your choice. Edit the 'Attachments' parameter (in the component manager) and change the parameter <em>attachments table style</em> to the new class name. Then modify the class definitions in your copied section appropriately. This approach will allow you to quickly revert to the original style by changing the plugin parameter <em>attachments table style</em> back to its default, 'attachmentsList'. This also has the advantage that the section of modified styles can be copied to a file and easily brought back in when the version of 'Attachments' is upgraded. This could also be done via a CSS @import command. Note that these changes will be lost the next time you upgrade Attachments."
|
||||
ATTACH_HELP_110200_TEXT="<strong>Changing CSS styling with template overrides:</strong> A better way to change the CSS styling is to use template overrides. Copy the CSS file you wish to modify to the template CSS override area. For instance, for the formatting for the basic attachments list, copy:"
|
||||
ATTACH_HELP_110300_TEXT="where 'TEMPLATE' should be replaced with the directory name of your template. Then you can edit the copied CSS file as you wish. The advantage of this approach is that when you update the Attachments extension, you will not lose the changes to this file (since it is not a file that the Attachments extension controls). You can override any of the CSS files using this technique."
|
||||
ATTACH_HELP_120000_SECTION_TITLE="File Type Icons"
|
||||
ATTACH_HELP_120100_TEXT="The 'Attachments' extension adds an icon in front of each attachment in the list of attachments. If you wish to add a new icon type, follow these steps:"
|
||||
ATTACH_HELP_120200_TEXT="Add an appropriate icon in the directory 'media/com_attachments/images/file_icons/', if an appropriate icon is not already there."
|
||||
ATTACH_HELP_120300_TEXT="Edit the file 'components/com_attachments/file_types.php' and add an appropriate line to the static array <strong>attachments_icon_from_file_extension</strong> which maps a file extension to an icon name (all in the 'media/com_attachments/images/file_icons/' directory). If this does not work, you may need to add an appropriate line to the array 'attachments_icon_from_mime_type'."
|
||||
ATTACH_HELP_120400_TEXT="Do not forget to make copies of the icon file and the updated 'file_types.php' to some directory outside of the website directories before upgrading the version of 'Attachments' in the future."
|
||||
ATTACH_HELP_120500_TEXT="<strong>NOTE:</strong>. If you wish to preserve your customized file type icon files when the Attachments extension gets upgraded, you can copy them to the template image override area ('templates/TEMPLATE/images/com_attachments/file_types' where 'TEMPLATE' should be replaced with the folder name for your template.). This can be used to keep new or customized image icon files as well as replacing them with versions you prefer."
|
||||
ATTACH_HELP_130000_SECTION_TITLE="Administrative Utility Commands"
|
||||
ATTACH_HELP_130100_TEXT="There are several utility commands in the back end that are available for Administrators. These include:"
|
||||
ATTACH_HELP_130200_TEXT="<strong>Disable uninstallation of MySQL Attachments Table:</strong> Normally, when the Attachments extension is uninstalled, the database table is deleted that contains information about the attachments. If you wish to retain this data when uninstalling Attachments, execute this command. After you uninstall Attachments the attachments database table will remain."
|
||||
ATTACH_HELP_130300_TEXT="<strong>Reinstall Default Asset Rules or Attachments Permissions:</strong> When the Attachments extension is installed, the installer adds several default asset rules so that the custom permissions added in the Attachments extension behave logically and similarly to the standard permissions. If you reinstall or update Joomla, these asset rules may be lost. You can restore them by executing this command."
|
||||
ATTACH_HELP_130400_TEXT="<strong>Regenerate attachment system filenames:</strong> This command is very useful when you move (migrate) your attachments from one computer to another. The full path each file attachment is kept in the database and called the "system filename". If you move attachments from one computer to another, it is very likely this path information will be incorrect. You may execute this command to regenerate all of the system filenames for all file attachments."
|
||||
ATTACH_HELP_130500_TEXT="The Utility command to "Regenerate system filenames" works for migration from windows to Linux servers. It also works for migration from Linux to Windows servers with a couple of potential problems:"
|
||||
ATTACH_HELP_130600_TEXT="When you copy your files to your Windows server, you need to verify that the attachments directory (usually 'attachments') and all files within it are writable by the Joomla web server."
|
||||
ATTACH_HELP_130700_TEXT="You may have problems porting files that have Unicode characters in their filenames because the archiving/unarchiving software has problems with the Unicode filenames (on the Windows side). You may need to save those files, delete the corresponding attachments, and then re-attach them."
|
||||
ATTACH_HELP_130800_TEXT="<strong>Remove spaces from filenames:</strong> You may execute this command to replace all spaces with underscores in the filename for all file attachments. This may be necessary on some systems. In 'Secure' mode, this should not be necessary."
|
||||
ATTACH_HELP_130900_TEXT="<strong>Update attachment file sizes:</strong> This command will recompute the file sizes for all file attachments."
|
||||
ATTACH_HELP_131000_TEXT="<strong>Check existence of attachment files:</strong> This command may be used to verify that the file exists for all file attachments. Missing files will be listed."
|
||||
ATTACH_HELP_131100_TEXT="<strong>Validate URLs:</strong> The URL attachments retain information about the validity of the URL given. This command will check each URL attachment and check the validity of the URL and update the validity information for the attachment."
|
||||
ATTACH_HELP_131200_NOTE="Sometimes when you execute one of the Utility commands, you may get a warning that the browser needs to resend the request. This is harmless, so click [OK] and the command will execute."
|
||||
ATTACH_HELP_140000_SECTION_TITLE="Warnings and Trouble-Shooting"
|
||||
ATTACH_HELP_140100_TEXT="<strong>If you have attachment files that are sensitive or private, use the *Secure attachment downloads* option!</strong> If you do not use the secure option, the attachment files are saved in a public sub-directory and are accessible to anyone that knows the full URL (even if they are not logged in). The <em>secure</em> option prevents access by anyone that does not have appropriate permissions (as determined by the options above). See the discussion of the <em>Secure attachment downloads</em> option above for more detail."
|
||||
ATTACH_HELP_140200_TEXT="Every time a file is uploaded, the existence of the upload sub-directory is checked and it will be created if if it does not exist. By default the sub-directory for uploaded files is 'attachments' in the root directory of your web site files. The name of the sub-directory can be changed using the 'Sub-directory for uploads' option. If the 'Attachments' extension is unable to create the sub-directory for uploads, you must create it yourself (and you may have problems uploading files). Make sure to give the sub-directory suitable permissions for uploading files. In the Unix/Linux world, that is probably something like 775. Note the process of creating the upload sub-directory may fail if the top level directory of your website has permissions that prevent the web server (and PHP) from creating sub-directories. You may need to loosen the permissions temporarily to allow the sub-directory to be created by uploading attachments."
|
||||
ATTACH_HELP_140300_TEXT="If this extension does not permit you to upload specific types of files (such as zip files), be aware that the extension respects the restrictions placed by the Media Manager on types of files permitted to be uploaded. This is to prevent uploading of potentially harmful types of files such as html or php files. The administrator can update the Media Manager settings to add specific file types by going to the "Global Settings" item under the "Site" menu, selecting the "System" tab, and added the appropriate file extension in lower and upper case and Mime type to the lists under the "Media Manager" section."
|
||||
ATTACH_HELP_140400_TEXT="If you cannot see the attachments in the front end, there are several possible reasons:"
|
||||
ATTACH_HELP_140500_TEXT="The attachment is not published. You can change this in Attachments manager page in the back end."
|
||||
ATTACH_HELP_140600_TEXT="The parent article or content item is not published."
|
||||
ATTACH_HELP_140700_TEXT="The attachment access level is set to 'Registered' (or some other access level than 'Public') and you are not logged in on the front end. Or the attachment access level is set to 'Special' (or some other non-standard access level) and the users accessing the page do not have permission to see items with that access level. Fix this by editing the attachments involved and changing their access level to an appropriate value. You may want to check the '{DEFACCLEVEL}' option in the Attachments options to make sure that new attachments are created with an appropriate access level."
|
||||
ATTACH_HELP_140800_TEXT="The 'Content - Attachments' plugin is not enabled. Use the plugin manager to enable it."
|
||||
ATTACH_HELP_140900_TEXT="In the 'Content - Attachments' (via the plugin manager), the access level is not set to 'Public'."
|
||||
ATTACH_HELP_141000_TEXT="If your site uses caching, try clearing the caches and refreshing the page."
|
||||
ATTACH_HELP_141100_TEXT="If you not seeing attachments for a category description in a category blog view and you are using a custom template, it may be necessary to make a small modification to the template in order to see the category attachments. Feel free to contact the author for help with this issue (see the contact info at the bottom of this page). This is no longer an issue with Joomla 2.5.10 and higher."
|
||||
ATTACH_HELP_141200_TEXT="If you encounter limits on the sizes of files that you attempt to upload, try adding the following lines to the .htaccess file in the root of your Joomla! website:"
|
||||
ATTACH_HELP_141300_TEXT="where you may change the 32M (megabytes) value to whatever you wish as the maximum upload file size."
|
||||
ATTACH_HELP_141400_TEXT="'Attachments' now supports "attaching" URLs to content items. If your server is Windows Vista and you encounter problems attaching URLs that involve {LOCALHOST}, this is a known problem related to IPv4 and IPv6 conflicts. To fix it, edit the file:"
|
||||
ATTACH_HELP_141500_TEXT="Comment out the line that has {IPV6HOST1} on it. Note that {HOSTS} is a hidden system file and you may need to modify your folder options to show hidden files to see and edit it."
|
||||
ATTACH_HELP_141600_TEXT="If you have difficulties attaching files that have Unicode characters (such as Russian/Cyrillic characters), set the <em>Secure Attachments Downloads</em> option to 'Yes'. Filenames with Unicode characters should work properly on Linux servers in secure or non-secure modes, but do not always work correctly on Windows servers in non-secure mode."
|
||||
ATTACH_HELP_141700_TEXT="'Attachments' now supports attaching files to articles while they are being created in the Article editor. There is one limitation to this. New attachments are in a state of "limbo" after the file is uploaded and before the article is actually saved for the first time. During this (hopefully brief) limbo period, the new attachments are identified by user id only. So if more than one person is using the same user account and they create articles at the same time and add attachments at the same time, there is no guarantee that the attached files will end up with the correct article."
|
||||
ATTACH_HELP_141800_TEXT="There is a 'Help' forum and a 'Frequently Asked Questions' forum for the 'Attachments' 3 extension that is hosted on the joomlacode.org website. If you encounter a problem that is not covered in this help page, please consult the forums. (Please post questions on the 'Help' form. I will post commonly asked questions on the 'Frequently Asked Questions'):"
|
||||
ATTACH_HELP_141900_TEXT="Attachments Forums at {FORUMS}"
|
||||
ATTACH_HELP_150000_SECTION_TITLE="Upgrading"
|
||||
ATTACH_HELP_150100_TEXT="Upgrading is very easy. You have two choices:"
|
||||
ATTACH_HELP_150200_TEXT="Simply install the new version of 'Attachments'. There is no need to uninstall the previous version. You do not need to do anything to retain your old attachments. Simply install the new version and it will update everything appropriately."
|
||||
ATTACH_HELP_150300_TEXT="<strong>Preferred:</strong> One of the excellent features in Joomla 2.5 and later is the extension updater. Go to the Extension Manager in the back end and click on the 'Update' tab. Click 'Purge Cache' and then 'Find Updates' on the toolbar. If there is a new release of Attachments, it will be shown. You can select the release and then click on the 'Update' button on the toolbar to install the new release. This makes keeping the Attachments extension updated very simple!"
|
||||
ATTACH_HELP_160000_SECTION_TITLE="Uninstalling"
|
||||
ATTACH_HELP_160100_TEXT="If you wish to retain your attachments, make a copy of the '{ATTACH_DIR}' directory at the top of the Joomla installation and copy the '{ATTACH_TBL}' table in the database (where you will need to determine the table name prefix '#_' on your system). If you intend to reinstall soon, see the <strong>'{DISABLE_SQL}'</strong> command in the {SECT_UTILS} to prevent the attachments database table from being deleted on uninstallation of the Attachments extension."
|
||||
ATTACH_HELP_160200_TEXT="If you do not wish to keep existing attachments, delete them all first (in the administrative back end). Once you have uninstalled the Attachments extension, delete the 'attachments' directory at the top of your Joomla installation."
|
||||
ATTACH_HELP_160300_TEXT="To uninstall the Attachments extension, go to the 'Manage' tab on the Extension Manager page (under the 'Extensions' menu). <strong>Select ONLY the item</strong>:"
|
||||
ATTACH_HELP_160400_TEXT="Package: Attachments for Joomla 2.5+"
|
||||
ATTACH_HELP_160500_TEXT="and click on the 'Uninstall' button on the toolbar. (The Joomla version number may vary.) This will uninstall the attachments component and all the associated plugins."
|
||||
ATTACH_HELP_170000_SECTION_TITLE="Migration Attachments from Joomla 1.5 to Joomla 2.5+ or 3.x"
|
||||
ATTACH_HELP_170100_TEXT="To migrate your attachments from a Joomla 1.5 site to a Joomla 2.5 (or 3.x) site, follow the procedure outlined here in the migrations links:"
|
||||
ATTACH_HELP_180000_SECTION_TITLE="Translations"
|
||||
ATTACH_HELP_180100_TEXT="This extension provides translation capabilities and supports the following languages (besides English). Note that some of these languages packs are in the process of being updated for 'Attachments' version 3.0 and not available."
|
||||
ATTACH_HELP_180200_TEXT="Thanks to these translators (available versions shown in parentheses):"
|
||||
ATTACH_HELP_181000_TEXT="<strong>Bulgarian:</strong> by Martin Hristov (3.1-3.2), Stefan Ilivanov (1.3.4)"
|
||||
ATTACH_HELP_181100_TEXT="<strong>Catalan:</strong> by Jaume Jorba (2.2, 3.0)"
|
||||
ATTACH_HELP_181200_TEXT="<strong>Chinese:</strong> Traditional and simplified Chinese translations by baijianpeng (白建鹏) (1.3.4)"
|
||||
ATTACH_HELP_181300_TEXT="<strong>Croatian:</strong> Tanja Dragisic (3.0, 1.3.4)"
|
||||
ATTACH_HELP_181400_TEXT="<strong>Czech:</strong> by Tomas Udrzal (1.3.4)"
|
||||
ATTACH_HELP_181500_TEXT="<strong>Danish:</strong> by Sune Folkmann (3.0), Villy Feltmann (2.2), Bo Urskov (1.3.4)"
|
||||
ATTACH_HELP_181600_TEXT="<strong>Dutch:</strong> by Parvus (2.2, 3.0)"
|
||||
ATTACH_HELP_181700_TEXT="<strong>Finnish:</strong> by Tapani Lehtonen (2.2)"
|
||||
ATTACH_HELP_181800_TEXT="<strong>French:</strong> by Didier Lan (3.1 and 3.1 help page), Maël Boureux (3.1), Marc-André Ladouceur (2.2, 3.0), Yann Kerviel (3.0), and Pascal Adalian (1.3.4)"
|
||||
ATTACH_HELP_181900_TEXT="<strong>German:</strong> by Rolf Pohl (3.0-3.2 and help page), Pierre Corell (2.0-3.1), Bernhard Alois Gassner (2.2), and Michael Scherer (1.3.4)"
|
||||
ATTACH_HELP_182000_TEXT="<strong>Greek:</strong> by Harry Nakos (1.3.4, 2.0-3.1), Antonis Mylonopoulos (3.0)"
|
||||
ATTACH_HELP_182100_TEXT="<strong>Hungarian:</strong> Formal and informal translations by Szabolcs Gáspár (1.3.4)"
|
||||
ATTACH_HELP_182200_TEXT="<strong>Indonesian:</strong> by Moh. Arif (3.0)"
|
||||
ATTACH_HELP_182300_TEXT="<strong>Italian:</strong> by Piero Mattirolo (2.2-3.1) and Lemminkainen and Alessandro Bianchi (1.3.4)"
|
||||
ATTACH_HELP_182400_TEXT="<strong>Norwegian:</strong> by Roar Jystad (2.2, 3.0) and Espen Gjelsvik (1.3.4)"
|
||||
ATTACH_HELP_182500_TEXT="<strong>Persian:</strong> by Hossein Moradgholi and Mahmood Amintoosi (2.2)"
|
||||
ATTACH_HELP_182600_TEXT="<strong>Polish:</strong> by Piotr Gręźlikowski (3.2), Sebastian Konieczny (2.2, 3.0), Stefan Wajda (3.0), and Piotr Wójcik (1.3.4)"
|
||||
ATTACH_HELP_182700_TEXT="<strong>Portuguese (Brazilian):</strong> by Nelson Teixeira (3.0), Arnaldo Giacomitti and Cauan Cabral (1.3.4)"
|
||||
ATTACH_HELP_182800_TEXT="<strong>Portuguese (Portugal):</strong> by Paulo Pereira (3.2), José Paulo Tavares (2.2, 3.0) and Bruno Moreira (1.3.4)"
|
||||
ATTACH_HELP_182900_TEXT="<strong>Romanian:</strong> by Alex Cojocaru (2.2, 3.0)"
|
||||
ATTACH_HELP_183000_TEXT="<strong>Russian:</strong> by Sergey Litvintsev (2.2-3.2) and евгений панчев (Yarik Sharoiko) (1.3.4)"
|
||||
ATTACH_HELP_183100_TEXT="<strong>Serbian:</strong> by Vlada Jerkovic (1.3.4)"
|
||||
ATTACH_HELP_183200_TEXT="<strong>Slovak:</strong> by Luboslav Moza (3.1), Miroslav Bystriansky (1.3.4)"
|
||||
ATTACH_HELP_183300_TEXT="<strong>Slovenian:</strong> by Matej Badalič (2.2, 3.0)"
|
||||
ATTACH_HELP_183400_TEXT="<strong>Spanish:</strong> by Manuel María Pérez Ayala (2.2-3.2) and Carlos Alfaro (1.3.4)"
|
||||
ATTACH_HELP_183500_TEXT="<strong>Swedish:</strong> by Jonas Hedberg (3.0), Linda Maltanski (2.0) and Mats Elfström (1.3.4)"
|
||||
ATTACH_HELP_183600_TEXT="<strong>Turkish:</strong> by Kaya Zeren (3.0-3.2, 2.0)"
|
||||
ATTACH_HELP_183700_TEXT="<strong>Ukrainian:</strong> by Sergey Litvintsev (3.0-3.2)"
|
||||
ATTACH_HELP_185000_TEXT="Many thanks to these translators! If you would like to help translate the extension to any other language, please contact the author (see the {SECT_CONTCT} section at the end)."
|
||||
ATTACH_HELP_190000_SECTION_TITLE="Acknowledgments"
|
||||
ATTACH_HELP_190100_TEXT="Many thanks for the following contributors or resources:"
|
||||
ATTACH_HELP_190200_TEXT="The book <em>Learning Joomla! 1.5 Extension Development: Creating Modules, Components, and Plugins with PHP</em> by Joseph L. LeBlanc was very helpful in creating the 'Attachments' extension."
|
||||
ATTACH_HELP_191000_TEXT="The icons for the file types were derived from several sources, including:"
|
||||
ATTACH_HELP_191100_TEXT="The Silk icons by Mark James ({LINK})"
|
||||
ATTACH_HELP_191200_TEXT="File-Type Icons 1.2 by John Zaitseff ({LINK})"
|
||||
ATTACH_HELP_191300_TEXT="Doctype Icons 2 by Timothy Groves ({LINK})"
|
||||
ATTACH_HELP_191400_TEXT="OpenDocument icons by Ken Baron ({LINK})"
|
||||
ATTACH_HELP_191500_TEXT="Sweeties Base Pack by Joseph North ({LINK})"
|
||||
ATTACH_HELP_191600_TEXT="Note that many of the 'Attachments' icons were modified from the original icon images from these websites. If you would like the original versions, please download them from the websites listed above."
|
||||
ATTACH_HELP_192000_TEXT="Many thanks to Paul McDermott for generously donating the search plugin!"
|
||||
ATTACH_HELP_192100_TEXT="Thanks to Mohammad Samini for donating some PHP code and CSS files to improve 'Attachments' displays in right-to-left languages."
|
||||
ATTACH_HELP_192200_TEXT="Thanks to Ewout Weirda for many helpful discussions and suggestions in the development of the 'Attachments' extension."
|
||||
ATTACH_HELP_192300_TEXT="Thanks to Daniel Guidry for suggesting changes that allow the download counter to work for URLs."
|
||||
ATTACH_HELP_200000_SECTION_TITLE="Contact"
|
||||
ATTACH_HELP_200100_TEXT="Please report Attachments bugs and suggestions to {LINK}"
|
||||
ATTACH_HELP_HINT="Hint"
|
||||
ATTACH_HELP_IMPORTANT="Important"
|
||||
ATTACH_HELP_NOTE="Note"
|
||||
ATTACH_HELP_TOGGLE_LANGUAGE_CODES="Toggle Language Code Tooltips"
|
||||
ATTACH_HELP_WARNING="Warning"
|
||||
@ -0,0 +1,380 @@
|
||||
; en-GB.com_attachments.ini (admin component)
|
||||
; Attachments for Joomla! extension
|
||||
; Copyright (C) 2007-2018 Jonathan M. Cameron, All rights reserved.
|
||||
; License http://www.gnu.org/licenses/gpl-3.0.html GNU/GPL
|
||||
; Note : All ini files need to be saved as UTF-8 - No BOM
|
||||
|
||||
; English translation
|
||||
|
||||
; For the main display list and parameters editor in the administrative back end
|
||||
|
||||
ATTACH_ACCESS_THIS_ATTACHMENT_TITLE="Access/download this attachment"
|
||||
ATTACH_ADDED_DATA_FOR_N_ATTACHMENTS="Added data for %d attachments!"
|
||||
ATTACH_ADDED_ICON_FILENAMES_TO_N_ATTACHMENTS="Added icon filenames to %d attachment(s)."
|
||||
ATTACH_ADD_ATTACHMENT="Add attachment"
|
||||
ATTACH_ADD_ATTACHMENT_TITLE="Add attachment to this article or content item"
|
||||
ATTACH_ADD_ATTACHMENT_TO_S_INSTEAD_OF_S_TOOLTIP="Add the attachment to a %s (instead of %s)"
|
||||
ATTACH_ADD_URL="Add URL"
|
||||
ATTACH_ALLOW_FRONTEND_ACCESS_LEVEL_EDITING="Allow frontend editing of the access level?"
|
||||
ATTACH_ALLOW_FRONTEND_ACCESS_LEVEL_EDITING_DESCRIPTION="Allow setting the access level for an attachment from the front end when editing an attachment or creating a new attachment. The 'access level' controls which groups may view (or access) the attachment. Note that the no one editing an attachment will ever be able to set the access level for it to a level for which they are not authorized."
|
||||
ATTACH_ALL_PARENTS="All Parents"
|
||||
ATTACH_ALL_TYPES="All types"
|
||||
ATTACH_ALWAYS_SHOW_CATEGORY_ATTACHMENTS="Always show attachments on category views"
|
||||
ATTACH_ALWAYS_SHOW_CATEGORY_ATTACHMENTS_DESCRIPTION="Always show attachments on category views -- regardless of other options."
|
||||
ATTACH_ARCHIVED_PARENTS="Archived parents"
|
||||
ATTACH_ATTACHED_TO="Attached to <br />%s"
|
||||
ATTACH_ATTACHMENT="Attachment"
|
||||
ATTACH_ATTACHMENTS="Attachments"
|
||||
ATTACH_ATTACHMENTS_ADMINISTRATIVE_UTILITY_COMMANDS="Attachments Administrative Utility Commands"
|
||||
ATTACH_ATTACHMENTS_DEFAULT_LAYOUT_DO_NOT_ATTACH_TO_MENU_ITEM="You may not create layout for Attachments"
|
||||
ATTACH_ATTACHMENTS_DO_NOT_ATTACH_TO_MENU_ITEM="You may not create menu item for Attachments"
|
||||
ATTACH_ATTACHMENTS_LIST_ORDER="Attachments list order"
|
||||
ATTACH_ATTACHMENTS_LIST_ORDER_DESCRIPTION="Select the desired order for listing attachments in the front end."
|
||||
ATTACH_ATTACHMENTS_PROJECT_URL_DESCRIPTION="Visit this URL for the latest version of Attachments"
|
||||
ATTACH_ATTACHMENTS_PUBLISHED_BY_DEFAULT="Attachments published by default?"
|
||||
ATTACH_ATTACHMENTS_PUBLISHED_BY_DEFAULT_DESCRIPTION="Sets whether attachments should be published by default."
|
||||
ATTACH_ATTACHMENTS_VERSION_S="Attachments Version %s"
|
||||
ATTACH_ATTACHMENT_FILENAME_URL="Attachment Filename / URL"
|
||||
ATTACH_ATTACHMENT_ID="Attachment ID"
|
||||
ATTACH_ATTACHMENT_ID_DESCRIPTION="Record number in the attachments table in the database"
|
||||
ATTACH_ATTACHMENT_SAVED="Attachment saved!"
|
||||
ATTACH_ATTACHMENT_TYPE="Attachment Type"
|
||||
ATTACH_ATTACHMENT_UPDATED="Attachment updated!"
|
||||
ATTACH_ATTACH_FILE_COLON="Attach file:"
|
||||
ATTACH_AT_THE_BEGINNING="At the beginning"
|
||||
ATTACH_AT_THE_END="At the end"
|
||||
ATTACH_AUTO_PUBLISH_WARNING="Auto Publish Warning"
|
||||
ATTACH_AUTO_PUBLISH_WARNING_DESCRIPTION="Users will see this warning message when uploading attachments if attachments are not published by default. Your warning message may include HTML. (Uses warning from translation files if not given.)"
|
||||
ATTACH_CANCEL="Cancel"
|
||||
ATTACH_CHANGES_TO_ATTACHMENT_SAVED="Changes to attachment saved"
|
||||
ATTACH_CHANGE_ENTITY_S="Change %s"
|
||||
ATTACH_CHANGE_ENTITY_S_TOOLTIP="Move this attachment to another %s"
|
||||
ATTACH_CHANGE_ENTITY_TOOLTIP2="(Other changes on this form will be lost.)"
|
||||
ATTACH_CHANGE_FILE="Update File"
|
||||
ATTACH_CHANGE_FILE_TOOLTIP="Update the file for this attachment. (Other changes on this form will be lost.)"
|
||||
ATTACH_CHANGE_TO_FILE="Change to File"
|
||||
ATTACH_CHANGE_TO_FILE_TOOLTIP="Attach a file for this attachment. (Other changes on this form will be lost.)"
|
||||
ATTACH_CHANGE_TO_URL="Change to URL"
|
||||
ATTACH_CHANGE_TO_URL_TOOLTIP="Change uploaded file to a URL/link. (Other changes on this form will be lost.)"
|
||||
ATTACH_CHECKED_N_ATTACHMENT_FILES_M_MISSING="Checked %d attachments with files, %d files missing"
|
||||
ATTACH_CHECK_FILES="Check existence of attachment files"
|
||||
ATTACH_CHECK_FILES_TOOLTIP="Check all attachment files and make sure they exist."
|
||||
ATTACH_CONFIGURATION="Attachments Configuration Options"
|
||||
ATTACH_CONFIG_ADVANCED_SETTINGS_LABEL="Advanced"
|
||||
ATTACH_CONFIG_BASIC_SETTINGS_LABEL="Basic"
|
||||
ATTACH_CONFIG_FORMATTING_SETTINGS_LABEL="Formatting"
|
||||
ATTACH_CONFIG_SECURITY_SETTINGS_LABEL="Security"
|
||||
ATTACH_CONFIG_VISIBILITY_SETTINGS_LABEL="Visibility"
|
||||
ATTACH_CREATOR="Creator"
|
||||
ATTACH_CREATOR_ID="Creator ID"
|
||||
ATTACH_CSS_STYLE_FOR_ATTACHMENTS_TABLES="CSS style for attachments tables"
|
||||
ATTACH_CSS_STYLE_FOR_ATTACHMENTS_TABLES_DESCRIPTION="To override the CSS styling of attachments lists (tables), specify your own style name here. The default style name is 'attachmentsList'. See plugin attachments.css file for examples. Consult help for the Attachments component for suggestions on how to implement your own styling."
|
||||
ATTACH_CUSTOM_PLACEMENT="Custom placement"
|
||||
ATTACH_CUSTOM_TITLES_FOR_ATTACHMENTS_LISTS="Custom titles for attachments lists"
|
||||
ATTACH_CUSTOM_TITLES_FOR_ATTACHMENTS_LISTS_DESCRIPTION="Custom titles to use for attachments lists. To rename the 'Attachments' title above the list of attachments for a specific article or content item, use this format (one entry per line, where id number is the number of the article, e.g.: '23 New title:'). Omit the item number to change the default title for attachments lists for all articles. Note that this may or may not be supported for any type of content items other than articles. For non-articles, prepend item ID with parent entity name and colon to avoid ambiguity, eg: 'category:23 Category downloads:'."
|
||||
ATTACH_DATA_FOR_N_ATTACHMENTS_OK="Data for %d attachments is okay. Rerun without 'dry_run' option to add attachments."
|
||||
ATTACH_DATE_CREATED="Date created"
|
||||
ATTACH_DATE_LAST_MODIFIED="Last modified"
|
||||
ATTACH_DEFAULT_ACCESS_LEVEL="Default Access Level"
|
||||
ATTACH_DEFAULT_ACCESS_LEVEL_DESCRIPTION="The default access level for new attachments. Each attachment has an 'access level' which controls who can see or download that attachment. When an attachment is created, its access level is set to this default value initially (if the attachment creator is in appropriate groups). A site administrator or someone with appropriate permissions may change the attachment's access level to control who can see that specific attachment."
|
||||
ATTACH_DELETE="Delete"
|
||||
ATTACH_DESCRIPTION="Description"
|
||||
ATTACH_DESCRIPTION_COLON="Description:"
|
||||
ATTACH_DESCRIPTION_DESCRIPTION="Description of the file or URL that will be displayed in the 'description' column."
|
||||
ATTACH_DESPACE_ATTACHMENT_SYSTEM_FILENAMES="Remove spaces from filenames"
|
||||
ATTACH_DESPACE_ATTACHMENT_SYSTEM_FILENAMES_TOOLTIP="Replace all spaces in each filename with the underscore character. This updates the URLs and display filenames as well as the names of the files as stored on the file-system."
|
||||
ATTACH_DISABLED_FILTER="Disabled (filter)"
|
||||
ATTACH_DISABLED_NOFILTER="Disabled (no filter)"
|
||||
ATTACH_DISABLED_UNINSTALLING_MYSQL_ATTACHMENTS_TABLE="Disabled uninstalling of MySQL Attachments table"
|
||||
ATTACH_DISABLE_MYSQL_UNINSTALLATION="Disable uninstallation of MySQL Attachments Table"
|
||||
ATTACH_DISABLE_MYSQL_UNINSTALLATION_TOOLTIP="If you wish to uninstall the Attachments extension without loosing your attachments, press here to disable the uninstallation of the MySQL Attachments table. For this to be successful, you must not delete the attachments upload directory at the top of your Joomla installation (usually 'attachments')."
|
||||
ATTACH_DISPLAY_FILENAME="Display Filename"
|
||||
ATTACH_DISPLAY_FILENAME_TOOLTIP="Optional: Enter an alternate filename or label to display instead of the full filename."
|
||||
ATTACH_DISPLAY_NAME="Display name"
|
||||
ATTACH_DISPLAY_NAME_DESCRIPTION="Name to be displayed for filename or URL (link still points to actual filename or URL)."
|
||||
ATTACH_DISPLAY_URL="Display URL"
|
||||
ATTACH_DISPLAY_URL_TOOLTIP="Optional: Enter an alternate URL or label to display instead of the full URL."
|
||||
ATTACH_DOWNLOADS="Downloads"
|
||||
ATTACH_DOWNLOAD_MODE_FOR_SECURE_DOWNLOADS="Download mode for secure downloads"
|
||||
ATTACH_DOWNLOAD_MODE_FOR_SECURE_DOWNLOADS_DESCRIPTION="Controls how downloads are performed in secure mode. With the 'inline' mode, files that can be displayed by the browser will be displayed in the browser (such as text files and images). With the 'attachment' mode, files will always be downloaded as separate files. The default is the 'attachment' mode. In either case, files that cannot be displayed in the browser will be downloaded as external files."
|
||||
ATTACH_DOWNLOAD_VERB="Download"
|
||||
ATTACH_EDIT_ATTACHMENT="Edit attachment"
|
||||
ATTACH_EDIT_THIS_ATTACHMENT_TITLE="Edit this attachment"
|
||||
ATTACH_ENTER_NEW_URL_COLON="Enter new URL:"
|
||||
ATTACH_ENTER_URL="Enter URL"
|
||||
ATTACH_ENTER_URL_INSTEAD="Enter URL instead"
|
||||
ATTACH_ENTER_URL_INSTEAD_TOOLTIP="Enter URL instead. (Other changes will be lost.)"
|
||||
ATTACH_ENTER_URL_TOOLTIP="Enter a URL here. The resource pointed to by the URL will not be uploaded; only the URL itself will be saved. NOTE: When entering relative URLs, unselect 'verify URL' and select 'relative URL'."
|
||||
ATTACH_ERROR_ADDING_HTACCESS_S="Please add an '.htaccess' file to your upload directory (%s) to prevent access to the directory."
|
||||
ATTACH_ERROR_ADDING_ICON_FILENAME_FOR_ATTACHMENT_S="Error adding icon filename for attachment '%s'."
|
||||
ATTACH_ERROR_ADDING_INDEX_HTML_IN_S="Please add an 'index.html' file to your upload directory (%s) to prevent browsing of the directory."
|
||||
ATTACH_ERROR_BAD_ATTACHMENT_ID_S="Error importing attachments CSV file; attachment ID is not an integer! (%s)"
|
||||
ATTACH_ERROR_BAD_CHARACTER_S_IN_FILENAME_S="ERROR: Bad character (%s) in filename (%s), please rename it and try again!"
|
||||
ATTACH_ERROR_CANNOT_DELETE_INVALID_ATTACHMENT_ID_N="ERROR: Cannot delete attachment: Unable to get valid attachment ID (%d)!"
|
||||
ATTACH_ERROR_CANNOT_MODIFY_ATTACHMENT_ZERO_ID="Error importing attachments CSV file; cannot modify attachment with id=0!"
|
||||
ATTACH_ERROR_CANNOT_SWITCH_PARENT_S_NEW_FILE_S_ALREADY_EXISTS="ERROR: Cannot switch %s; new file '%s' already exists!"
|
||||
ATTACH_ERROR_CANNOT_UPDATE_ATTACHMENT_INVALID_ID_N="ERROR: Cannot update attachment; invalid attachment ID (%d)!"
|
||||
ATTACH_ERROR_CATEGORY_TITLE_MISMATCH_ID_S_S="Error importing attachments CSV file; title for category ID=%d is '%s' not '%s' as specified in the CSV file!"
|
||||
ATTACH_ERROR_CHANGE_IN_MEDIA_MANAGER="(Change this in the Media Manager settings.)"
|
||||
ATTACH_ERROR_CHECKING_ARTICLE_OWNERSHIP="Error checking article ownership!"
|
||||
ATTACH_ERROR_CHECKING_ARTICLE_PERMISSIONS="Error checking article permissions!"
|
||||
ATTACH_ERROR_CHECKING_CATEGORY_OWNERSHIP="Error checking category ownership!"
|
||||
ATTACH_ERROR_CHECKING_CATEGORY_PERMISSIONS="Error checking category permissions!"
|
||||
ATTACH_ERROR_CHECKING_URL_S="Error checking URL: '%s'! <br/>(You may wish to disable the 'Verify URL existence' option and try again.)"
|
||||
ATTACH_ERROR_CONNECTING_TO_URL_S="Error connecting to URL '%s'! <br/>(You may wish to disable the 'Verify URL existence' option and try again.)"
|
||||
ATTACH_ERROR_COULD_NOT_ACCESS_URL_S="ERROR: Could not access URL '%s'! <br/>(You may wish to disable the 'Verify URL existence' option and try again.)"
|
||||
ATTACH_ERROR_CREATOR_USERNAME_MISMATCH_ID_S_S="Error importing attachments CSV file; attachment creator user with id=%d has username '%s', but CSV file expected '%s'!"
|
||||
ATTACH_ERROR_FILE_S_ALREADY_ON_SERVER="ERROR: File '%s' already exists on the server. Please select another file or rename your file!"
|
||||
ATTACH_ERROR_FILE_S_NOT_FOUND_ON_SERVER="ERROR: File '%s' not found on server!"
|
||||
ATTACH_ERROR_FILE_S_TOO_BIG_N_N_N="File '%s' is too big at %.1f MB (max attachment size=%d MB, max PHP upload size=%d MB)"
|
||||
ATTACH_ERROR_GETTING_LIST_OF_ENTITY_S_ITEMS="ERROR: Unable to get list of %s!"
|
||||
ATTACH_ERROR_ILLEGAL_FILE_EXTENSION="Illegal file extension:"
|
||||
ATTACH_ERROR_ILLEGAL_FILE_MIME_TYPE="Illegal file Mime type:"
|
||||
ATTACH_ERROR_IMPORTING_ATTACHMENTS_S="ERROR: Error importing attachments (%s)!"
|
||||
ATTACH_ERROR_INVALID_ATTACHMENT_ID_N="ERROR: Invalid attachment ID (%s)!"
|
||||
ATTACH_ERROR_INVALID_PARENT_ID_S="ERROR: Invalid Parent ID: '%s'"
|
||||
ATTACH_ERROR_INVALID_PARENT_S_ID_N="ERROR: Invalid %s parent ID (%d)!"
|
||||
ATTACH_ERROR_INVALID_PARENT_TYPE_S="ERROR: Invalid parent type ('%s')!"
|
||||
ATTACH_ERROR_IN_URL_SYNTAX_S="Error in URL syntax: '%s'!"
|
||||
ATTACH_ERROR_MAY_BE_LARGER_THAN_LIMIT="Perhaps your file is larger than the size limit of"
|
||||
ATTACH_ERROR_MISSING_ATTACHMENT_FILE_S=" ERROR: Missing attachment file: %s"
|
||||
ATTACH_ERROR_MISSING_EXTRA_FIELDS_S="Error importing attachments CSV file; missing extra field(s): %s"
|
||||
ATTACH_ERROR_MISSING_FIELDS_S="Error importing attachments CSV file; missing field(s): %s"
|
||||
ATTACH_ERROR_MISSING_PARENT_FOR_ATTACHMENT_S=" ERROR: Missing parent: %s "
|
||||
ATTACH_ERROR_MODIFIER_USERNAME_MISMATCH_ID_S_S="Error importing attachments CSV file; attachment modifier user with id=%d has username '%s', but CSV file expected '%s'!"
|
||||
ATTACH_ERROR_MOVING_FILE="Error uploading (error moving file)"
|
||||
ATTACH_ERROR_MUST_ADD_FILENAME_TO_URL="ERROR: You must specify the attachments CSV filename in the URL! (Eg: &file=/path/to/file)"
|
||||
ATTACH_ERROR_MUST_BE_LOGGED_IN_TO_UPLOAD_ATTACHMENT="ERROR: Must be logged in to upload an attachment!"
|
||||
ATTACH_ERROR_MUST_SELECT_PARENT="ERROR: You must select a new parent to attach to!"
|
||||
ATTACH_ERROR_MUST_SELECT_PARENT_S="ERROR: You must select %s to attach to!"
|
||||
ATTACH_ERROR_NEW_SYSTEM_FILENAME_S_NOT_FOUND="ERROR: New system filename '%s' not found!"
|
||||
ATTACH_ERROR_NO_PERMISSION_TO_DELETE_S="ERROR: You do not have permission to delete an attachment for this %s!"
|
||||
ATTACH_ERROR_NO_PERMISSION_TO_DELETE_S_ATTACHMENT_S_ID_N="ERROR: You do not have permission to delete %s attachment '%s'! (ID %d)"
|
||||
ATTACH_ERROR_NO_PERMISSION_TO_EDIT="ERROR: You do not have permission to edit this attachment!"
|
||||
ATTACH_ERROR_NO_PERMISSION_TO_PUBLISH_S_ATTACHMENT_S_ID_N="ERROR: You do not have permission to publish or unpublish %s attachment '%s'! (ID %d)"
|
||||
ATTACH_ERROR_NO_PERMISSION_TO_UPLOAD_S="ERROR: You do not have permission to add an attachment to this %s! "
|
||||
ATTACH_ERROR_NO_SPECIAL_FUNCTION_SPECIFIED="ERROR: No special function specified!"
|
||||
ATTACH_ERROR_NO_UTILS_FUNCTION_SPECIFIED="ERROR: No utility function specified!"
|
||||
ATTACH_ERROR_N_FILES_MISSING="ERROR: %d file(s) missing:"
|
||||
ATTACH_ERROR_PARENT_TITLE_MISMATCH_ID_N_TITLE_S_S="Error importing attachments CSV file; title for article/parent ID=%d is '%s' not '%s' as specified in the CSV file!"
|
||||
ATTACH_ERROR_RENAMING_FILE_S_TO_S="Error renaming file '%s' to '%s'!"
|
||||
ATTACH_ERROR_SECTION_ATTACHMENT_NOT_ALLOWED_ID="Error importing attachments CSV file; 'section' attachments are not allowed (ID %d)! It must be deleted or converted to a 'category' attachment."
|
||||
ATTACH_ERROR_STORING_ATTACHMENT_S="Error importing attachments CSV file; error storing attachment (%s)!"
|
||||
ATTACH_ERROR_UNABLE_TO_FIND_CATEGORY_ID_S="Error importing attachments CSV file; unable to find category with ID=%d (title='%s')!"
|
||||
ATTACH_ERROR_UNABLE_TO_FIND_CREATOR_ID_S="Error importing attachments CSV file; unable to find creator with ID=%d (username='%s')!"
|
||||
ATTACH_ERROR_UNABLE_TO_FIND_MODIFIER_ID_S="Error importing attachments CSV file; unable to find modifier with ID=%d (username='%s')!"
|
||||
ATTACH_ERROR_UNABLE_TO_FIND_USER_S_ID_N="ERROR: Unable to find user '%s' with ID=%d!"
|
||||
ATTACH_ERROR_UNABLE_TO_OPEN_CSV_FILE_S="ERROR: Unable to open attachments CSV file '%s'!"
|
||||
ATTACH_ERROR_UNABLE_TO_SETUP_UPLOAD_DIR_S="ERROR: Unable create or setup upload directory (%s)!"
|
||||
ATTACH_ERROR_UNKNOWN_PARENT_ID_N="Error importing attachments CSV file; unknown article/parent ID=%d!"
|
||||
ATTACH_ERROR_UNKNOWN_PARENT_TYPE_S="ERROR: Unknown parent type '%s'!"
|
||||
ATTACH_ERROR_UNKNOWN_PROTCOL_S_IN_URL_S="ERROR: Unknown protocol '%s' in URL: '%s'!"
|
||||
ATTACH_ERROR_UNRECOGNIZED_FIELD_S="Error importing attachments CSV file; unrecognized field: %s"
|
||||
ATTACH_ERROR_UPDATING_FILE="Error updating file"
|
||||
ATTACH_ERROR_UPDATING_NULL_DATE_FOR_ATTACHMENT_FILE_S="Error updating null date for attachment '%s'."
|
||||
ATTACH_ERROR_UPLOADING_FILE_S="Error uploading file '%s'!"
|
||||
ATTACH_ERROR_USERNAME_MISMATCH_ID_N_S_S="ERROR: Username mismatch for ID=%d, expected '%s' but found '%s' on this system."
|
||||
ATTACH_FILE="File"
|
||||
ATTACH_FILENAME="Filename"
|
||||
ATTACH_FILENAME_COLON="Filename:"
|
||||
ATTACH_FILENAME_DESCRIPTION="The filename of the attached (uploaded) file"
|
||||
ATTACH_FILE_LINK_OPEN_MODE="File link open mode"
|
||||
ATTACH_FILE_LINK_OPEN_MODE_DESCRIPTION="Determines how the links to attachment files will be opened. 'In same window' means the file will be opened in the same browser window. 'In new window' means the file will be opened in a new window (or tab)."
|
||||
ATTACH_FILE_SIZE="File size"
|
||||
ATTACH_FILE_SIZE_KB="Size(kB)"
|
||||
ATTACH_FILE_TYPE="File type"
|
||||
ATTACH_FILE_TYPE_DESCRIPTION="Mime file type"
|
||||
ATTACH_FILTER="Filter"
|
||||
ATTACH_FILTER_ENTITY_TOOLTIP="Use this option to limit the list of attachments to parents of a particular type."
|
||||
ATTACH_FORBIDDEN_FILENAME_CHARACTERS="Characters forbidden in uploaded filenames"
|
||||
ATTACH_FORBIDDEN_FILENAME_CHARACTERS_DESCRIPTION="Filenames containing these characters will not be allowed to be uploaded. These characters are problematic in the URL presented to the user for file attachments in 'non-secure' mode so they are forbidden. These characters are generally not an issue when using 'secure' mode since the filename is not used as part of the URL presented to the user."
|
||||
ATTACH_FORMAT_STRING_FOR_DATES="Format string for dates"
|
||||
ATTACH_FORMAT_STRING_FOR_DATES_DESCRIPTION="The format string for the creation and modification dates. Enter a format string like ones used by the Joomla JDate class format() function (which is based on the PHP class DateTime::format function). Search the web with 'PHP DateTime' for examples. Note that JDate handles translation of month/day names as necessary. The default format string (Y-m-d H:M) gives dates with 24-hour time like 2013-01-05 16:21."
|
||||
ATTACH_FOR_PARENT_S_COLON_S="For %s: <i>'%s'</i>"
|
||||
ATTACH_GO="Go"
|
||||
ATTACH_HIDE_ADD_ATTACHMENTS_LINK="Hide 'Add Attachments' link"
|
||||
ATTACH_HIDE_ADD_ATTACHMENTS_LINK_DESCRIPTION="Always hide the 'Add Attachments' link on the front page. This requires attachments to be added to articles, etc, by editing them in the front page (where an 'Add Attachments' button will be available under the editing area)."
|
||||
ATTACH_HIDE_ATTACHMENTS_EXCEPT_ON_ARTICLE_VIEWS="Hide attachments except on article views"
|
||||
ATTACH_HIDE_ATTACHMENTS_EXCEPT_ON_ARTICLE_VIEWS_DESCRIPTION="Hide attachments on all views except for single article views."
|
||||
ATTACH_HIDE_ATTACHMENTS_FOR_CATEGORIES="Hide attachments for categories"
|
||||
ATTACH_HIDE_ATTACHMENTS_FOR_CATEGORIES_DESCRIPTION="Hide attachments on any category views for the selected categories. To select or deselect categories without affecting other categories, hold the Control-key when mouse-clicking on the category. Note that attachments will be displayed for children categories unless they are explicitly selected here."
|
||||
ATTACH_HIDE_ATTACHMENTS_ON_BLOGS="Hide attachments on blog pages"
|
||||
ATTACH_HIDE_ATTACHMENTS_ON_BLOGS_DESCRIPTION="Hide attachments on pages (menu items) that are blog layouts."
|
||||
ATTACH_HIDE_ATTACHMENTS_ON_FRONTPAGE="Hide attachments on the front page"
|
||||
ATTACH_HIDE_ATTACHMENTS_ON_FRONTPAGE_DESCRIPTION="Hide attachments on the frontpage. This suppresses all displays of attachments on the front page."
|
||||
ATTACH_HIDE_ATTACHMENTS_WITH_READMORE="Hide attachments before 'Read More' breaks"
|
||||
ATTACH_HIDE_ATTACHMENTS_WITH_READMORE_DESCRIPTION="Hide attachments for content items that include a 'Read More' break. When the full item is viewed (without ReadMore breaks), attachments will be shown."
|
||||
ATTACH_ICON_FILENAME="Icon Filename"
|
||||
ATTACH_ICON_FILENAME_DESCRIPTION="Select an icon to display to convey the type of file."
|
||||
ATTACH_INLINE="Inline"
|
||||
ATTACH_INSTALLED_DEFAULT_ATTACHMENTS_ASSET_RULES="Installed default asset rules for new attachments permissions."
|
||||
ATTACH_INSTALLING_DEFAULT_ATTACHMENTS_ASSET_RULES_FAILED="Warning: Installing default asset rules for new attachments permissions failed."
|
||||
ATTACH_IN_NEW_WINDOW="In new window"
|
||||
ATTACH_IN_SAME_WINDOW="In same window"
|
||||
ATTACH_KB="kB"
|
||||
ATTACH_LAST_MODIFIED="Last modified"
|
||||
ATTACH_LIST_ATTACHMENTS_FOR_COLON="List attachments for:"
|
||||
ATTACH_MAX_ATTACHMENT_SIZE="Maximum attachment size (MB)"
|
||||
ATTACH_MAX_ATTACHMENT_SIZE_DESCRIPTION="The maximum size for an attachment (in megabytes). Use 0 for the maximum upload size allowed by your server and your site configuration. NOTE: your server has a maximum upload size limit."
|
||||
ATTACH_MAX_FILENAME_URL_LENGTH="Maximum filename or URL length"
|
||||
ATTACH_MAX_FILENAME_URL_LENGTH_DESCRIPTION="Maximum filename or URL length for attachments list. Filenames or URLs longer than this will be truncated and put into the 'display filename' (for display purposes only, the actual filename or URL will not be changed). A value of 0 means the filename or URL length is unlimited. Note that this option only affects attachments added after this option is set."
|
||||
ATTACH_NORMAL_UPDATE="Normal update"
|
||||
ATTACH_NORMAL_UPDATE_TOOLTIP="Normal update (edit attachment info only)"
|
||||
ATTACH_NOTE_ENTER_URL_WITH_HTTP="NOTE: Enter URL with 'http...' prefix; otherwise the URL is presumed to be relative."
|
||||
ATTACH_NO_ATTACHMENTS_WITH_FILES="No attachments found that have files."
|
||||
ATTACH_NO_ATTACHMENTS_WITH_URLS="No attachments found that have URLs."
|
||||
ATTACH_NO_FILE_TYPE_FIELDS_NEED_UPDATING="No file_type fields need updating."
|
||||
ATTACH_NO_PARENTS="No parents"
|
||||
ATTACH_NO_PARENT_S="No parent %s!"
|
||||
ATTACH_NUMBER_OF_DOWNLOADS="Number of downloads"
|
||||
ATTACH_NUMBER_OF_DOWNLOADS_TOOLTIP="The number of times this file or URL has been downloaded in secure mode. WARNING: This count is only updated for attachments in secure mode!"
|
||||
ATTACH_OPTIONAL="(Optional)"
|
||||
ATTACH_PARENT_ENTITY="Parent entity"
|
||||
ATTACH_PARENT_ENTITY_DESCRIPTION="Subtype of content for a particular parent type. The com_content parent_type can have two types of content entities: articles or categories."
|
||||
ATTACH_PARENT_ID="Parent ID"
|
||||
ATTACH_PARENT_ID_DESCRIPTION="Record number in the parent table in the database"
|
||||
ATTACH_PARENT_S_COLON_S="<b>%s:</b> '%s'"
|
||||
ATTACH_PARENT_TYPE="Parent type"
|
||||
ATTACH_PARENT_TYPE_DESCRIPTION="Component of the parent (eg, com_content for articles)"
|
||||
ATTACH_PERMISSIONS_DESC="Default permissions used for all Attachments."
|
||||
ATTACH_PERMISSION_ADMIN_COMPONENT="Configure Attachments Options"
|
||||
ATTACH_PERMISSION_ADMIN_COMPONENT_DESC="Allows users in the group to edit the Attachments options."
|
||||
ATTACH_PERMISSION_CREATE="Create Attachments"
|
||||
ATTACH_PERMISSION_CREATE_DESC="Allows users in the group to create attachments (if they may edit the parent)."
|
||||
ATTACH_PERMISSION_DELETE="Delete Attachments"
|
||||
ATTACH_PERMISSION_DELETEOWN="Delete Own Attachments"
|
||||
ATTACH_PERMISSION_DELETEOWN_DESC="Allows users in this group to delete their own attachments (if they may edit the parent)."
|
||||
ATTACH_PERMISSION_DELETE_DESC="Allows users in the group to delete attachments (if they may edit the parent)."
|
||||
ATTACH_PERMISSION_DELETE_OWNPARENT="Delete Attachments For Owned Article/Parent."
|
||||
ATTACH_PERMISSION_DELETE_OWNPARENT_DESC="Allows users in this group to delete any attachment for articles/parents they they own (and may edit the parent)."
|
||||
ATTACH_PERMISSION_EDIT="Edit Attachments"
|
||||
ATTACH_PERMISSION_EDITOWN="Edit Own Attachments"
|
||||
ATTACH_PERMISSION_EDITOWN_DESC="Allows users in the group to edit attachments they created (if they may edit the parent)."
|
||||
ATTACH_PERMISSION_EDITSTATE="Edit Attachment State"
|
||||
ATTACH_PERMISSION_EDITSTATE_DESC="Allows users in the group to change the state of any attachment."
|
||||
ATTACH_PERMISSION_EDITSTATE_OWN="Edit State Of Own Attachments"
|
||||
ATTACH_PERMISSION_EDITSTATE_OWNPARENT="Edit State Of Attachments For Owned Article/Parent"
|
||||
ATTACH_PERMISSION_EDITSTATE_OWNPARENT_DESC="Allows users in this group to edit the state of any attachment for articles/parents they own (if they may edit the parent)."
|
||||
ATTACH_PERMISSION_EDITSTATE_OWN_DESC="Allows users in the group to change the state of any attachment they created (if they may edit the parent)."
|
||||
ATTACH_PERMISSION_EDIT_DESC="Allows users in the group to edit attachments (if they may edit the parent)."
|
||||
ATTACH_PERMISSION_EDIT_OWNPARENT="Edit Attachments For Owned Article/Parent"
|
||||
ATTACH_PERMISSION_EDIT_OWNPARENT_DESC="Allows users in this group to edit any attachment for articles/parents they they own (and may edit the parent)."
|
||||
ATTACH_PERMISSION_MANAGE_COMPONENT="Access Attachments Component"
|
||||
ATTACH_PERMISSION_MANAGE_COMPONENT_DESC="Allows users in the group to access the Attachments extension in the administrative back end."
|
||||
ATTACH_PUBLISHED="Published"
|
||||
ATTACH_PUBLISHED_PARENTS="Published parents"
|
||||
ATTACH_REALLY_DELETE_ATTACHMENT="Really delete attachment?"
|
||||
ATTACH_REGENERATED_SYSTEM_FILENAMES_FOR_N_ATTACHMENTS="Regenerated system filenames for %d attachment(s)."
|
||||
ATTACH_REGENERATE_ATTACHMENT_SYSTEM_FILENAMES="Regenerate attachment system filenames"
|
||||
ATTACH_REGENERATE_ATTACHMENT_SYSTEM_FILENAMES_TOOLTIP="Use this function if you have moved or renamed the attachments directory to correct the server filenames for the change. This is particularly helpful if you move attachments from a Windows computer to or from a Unix/Linux computer (due to the difference in server filename formats)."
|
||||
ATTACH_REINSTALL_PERMISSIONS="Reinstall Default Asset Rules or Attachments Permissions"
|
||||
ATTACH_REINSTALL_PERMISSIONS_TOOLTIP="Reinstall the default asset rules for attachments custom permissions in the Joomla ACL permissions system (for example to delete your own attachments). Your previous permissions overrides should not be affected. NOTE: These default asset rules are installed when you install the Attachments extensions but may be necessary to reinstall after upgrading Joomla itself."
|
||||
ATTACH_RELATIVE_URL="Relative URL?"
|
||||
ATTACH_RELATIVE_URL_TOOLTIP="Check this box to enter a URL relative to this Joomla! website. You will probably also need to unselect 'Verify URL' to add a relative URL."
|
||||
ATTACH_RESET="Reset"
|
||||
ATTACH_RESET_ORDER="Reset Order"
|
||||
ATTACH_SAVE="Save"
|
||||
ATTACH_SECURE_ATTACHMENT_DOWNLOADS="Secure attachment downloads"
|
||||
ATTACH_SECURE_ATTACHMENT_DOWNLOADS_DESCRIPTION="Use secure attachment downloads. When secure downloads are used, only users with appropriate permissions will be able to download the attachments. Note: In 'secure' mode, the attachments list is not displayed when the user is not logged in (unless the 'List attachments in secure mode' option is set to 'True')."
|
||||
ATTACH_SELECT_ENTITY_S="Select %s"
|
||||
ATTACH_SELECT_ENTITY_S_COLON="Select %s:"
|
||||
ATTACH_SELECT_ENTITY_S_TOOLTIP="Select %s (required first!)"
|
||||
ATTACH_SELECT_FILE_COLON="Select File:"
|
||||
ATTACH_SELECT_FILE_TO_UPLOAD_INSTEAD="Select file to upload instead"
|
||||
ATTACH_SELECT_FILE_TO_UPLOAD_INSTEAD_TOOLTIP="Select file to upload instead. (Other changes will be lost.)"
|
||||
ATTACH_SELECT_NEW_FILE_IF_YOU_WANT_TO_UPDATE_ATTACHMENT_FILE="Select new file (if you want to update the attachment file):"
|
||||
ATTACH_SHOW_ATTACHMENT_CREATOR="Show attachment creator?"
|
||||
ATTACH_SHOW_ATTACHMENT_CREATOR_DESCRIPTION="Show the name of the one who uploaded the attachment."
|
||||
ATTACH_SHOW_ATTACHMENT_DESCRIPTION="Show attachment description?"
|
||||
ATTACH_SHOW_ATTACHMENT_DESCRIPTION_DESCRIPTION="Sets whether the description for each attachment should be shown."
|
||||
ATTACH_SHOW_ATTACHMENT_FILE_SIZE="Show attachment file size?"
|
||||
ATTACH_SHOW_ATTACHMENT_FILE_SIZE_DESCRIPTION="Sets whether the file size for each attachment should be shown."
|
||||
ATTACH_SHOW_COLUMN_TITLES="Show titles?"
|
||||
ATTACH_SHOW_COLUMN_TITLES_DESCRIPTION="If set to 'Yes', a row of titles will be added above the list of attachments describing what is in each column."
|
||||
ATTACH_SHOW_CREATION_DATE="Show attachment creation date?"
|
||||
ATTACH_SHOW_CREATION_DATE_DESCRIPTION="Sets whether the creation date for the attachment should be shown."
|
||||
ATTACH_SHOW_FOR_PARENTS_TOOLTIP="Select whether to list attachments that are attached to parents that are published or unpublished."
|
||||
ATTACH_SHOW_GUEST_ACCESS_LEVELS="Show attachments to non logged-in users"
|
||||
ATTACH_SHOW_GUEST_ACCESS_LEVELS_DESCRIPTION="Show links to attachments with the selected access levels to non logged-in users. However, in order to actually access these attachments, the user will be prompted to log in. Note: Public attachments will always be shown."
|
||||
ATTACH_SHOW_MODIFICATION_DATE="Show attachment modification date?"
|
||||
ATTACH_SHOW_MODIFICATION_DATE_DESCRIPTION="Sets whether the modification date for the attachment should be shown."
|
||||
ATTACH_SHOW_NUMBER_OF_DOWNLOADS="Show number of downloads?"
|
||||
ATTACH_SHOW_NUMBER_OF_DOWNLOADS_DESCRIPTION="Show the number of downloads. WARNING: This option only works in secure mode."
|
||||
ATTACH_SORT_ATTACHMENT_ID="Attachment ID (order of attachment)"
|
||||
ATTACH_SORT_CREATED_DATE="Creation date (oldest first)"
|
||||
ATTACH_SORT_CREATED_DATE_DESCENDING="Creation date (newest first)"
|
||||
ATTACH_SORT_DESCRIPTION="Description"
|
||||
ATTACH_SORT_DESCRIPTION_DESCENDING="Description (reverse, z-a)"
|
||||
ATTACH_SORT_DISPLAY_FILENAME_OR_URL="Display filename or URL"
|
||||
ATTACH_SORT_DISPLAY_FILENAME_OR_URL_DESCENDING="Display filename or URL (reverse, z-a)"
|
||||
ATTACH_SORT_FILENAME="Filename"
|
||||
ATTACH_SORT_FILENAME_DESCENDING="Filename (reverse, z-a)"
|
||||
ATTACH_SORT_FILE_SIZE="File size (smallest first)"
|
||||
ATTACH_SORT_FILE_SIZE_DESCENDING="File size (largest first)"
|
||||
ATTACH_SORT_MODIFICATION_DATE="Modification date (oldest first)"
|
||||
ATTACH_SORT_MODIFICATION_DATE_DESCENDING="Modification date (newest first)"
|
||||
ATTACH_SORT_USER_DEFINED_FIELD_1_DESC="User-defined field 1 (reverse, z-a)"
|
||||
ATTACH_SORT_USER_DEFINED_FIELD_2_DESC="User-defined field 2 (reverse, z-a)"
|
||||
ATTACH_SORT_USER_DEFINED_FIELD_3_DESC="User-defined field 3 (reverse, z-a)"
|
||||
ATTACH_SUPERIMPOSE_URL_LINK_ICONS="Superimpose URL link icons"
|
||||
ATTACH_SUPERIMPOSE_URL_LINK_ICONS_DESCRIPTION="Superimpose URL link icons over the file attachment icon for each attachment to indicate it is a URL. Valid URLs are shown with arrows and invalid URLs are shown with a red line across the file type icon (bottom left to top right)."
|
||||
ATTACH_SUPPRESS_OBSOLETE_ATTACHMENTS="Suppress obsolete attachments (in back end)"
|
||||
ATTACH_SUPPRESS_OBSOLETE_ATTACHMENTS_DESCRIPTION="Set the default for suppressing obsolete attachments (attachments for unpublished parents) in the administrative back end. You can override this using the 'Show attachments for' drop-down menu just above the list of attachments on the right."
|
||||
ATTACH_SWITCH_ATTACHMENT_TO_S_TOOLTIP="Switch attachment to a %s."
|
||||
ATTACH_SWITCH_ATTACHMENT_TO_TOOLTIP2="(Other changes on this form will be lost.)"
|
||||
ATTACH_SWITCH_TO_COLON="Switch to:"
|
||||
ATTACH_SYSTEM_FILENAME="System Filename"
|
||||
ATTACH_SYSTEM_FILENAME_DESCRIPTION="The full path for the filename on the server"
|
||||
ATTACH_TIMEOUT_FOR_CHECKING_LINKS="Timeout for checking links"
|
||||
ATTACH_TIMEOUT_FOR_CHECKING_LINKS_DESCRIPTION="Timeout for checking links (seconds). Whenever a link is added as an attachment, the link is checked directly. If the link can be accessed before the timeout, the file size and other information about the link is retrieved. If not, generic information is used. To disable the check, enter 0."
|
||||
ATTACH_TITLE="Title"
|
||||
ATTACH_TRASHED_PARENTS="Trashed parents"
|
||||
ATTACH_UNKNOWN="Unknown"
|
||||
ATTACH_UNPUBLISHED_PARENTS="Unpublished parents"
|
||||
ATTACH_UPDATE="Update"
|
||||
ATTACH_UPDATED_ATTACHMENT="Updated Attachment"
|
||||
ATTACH_UPDATED_ATTACHMENTS_PARAMETERS="Updated attachments parameters"
|
||||
ATTACH_UPDATED_ATTACHMENTS_PARAMETERS_AND_SECURITY_SETTINGS="Updated attachments parameters and security settings"
|
||||
ATTACH_UPDATED_FILE_SIZES_FOR_N_ATTACHMENTS="Updated file sizes for %d attachment(s)."
|
||||
ATTACH_UPDATED_N_ATTACHMENTS="Updated %d attachments"
|
||||
ATTACH_UPDATE_ATTACHMENT_COLON="Update Attachment:"
|
||||
ATTACH_UPDATE_ATTACHMENT_FILE_SIZES="Update attachment file sizes"
|
||||
ATTACH_UPDATE_ATTACHMENT_FILE_SIZES_TOOLTIP="Use this function to update the file sizes for all attachments."
|
||||
ATTACH_UPDATE_DO_NOT_ATTACH_TO_MENU_ITEM="Update View - Do not attach to a menu item!"
|
||||
ATTACH_UPLOADED_ATTACHMENT="Uploaded attachment"
|
||||
ATTACH_UPLOAD_DO_NOT_ATTACH_TO_MENU_ITEM="Upload View - Do not attach to a menu item!"
|
||||
ATTACH_UPLOAD_VERB="Upload"
|
||||
ATTACH_URL="URL"
|
||||
ATTACH_URL_COLON="URL:"
|
||||
ATTACH_URL_DESCRIPTION="The URL for the attachment (partial; append to base URL)"
|
||||
ATTACH_URL_IS_VALID="URL is valid"
|
||||
ATTACH_URL_IS_VALID_TOOLTIP="Use this checkbox to manually change whether the link is valid. Ignored for new or edited links."
|
||||
ATTACH_URL_TO_LOGIN="URL to log in"
|
||||
ATTACH_URL_TO_LOGIN_DESCRIPTION="URL for user to log in. In secure mode, guests who are not logged in will encounter a link to this URL when they try to download a non-public attachment. NOTE: Use URL with ampersands (like default: 'index.php?option=com_user&view=login'). Do not use SEO version of the URL; JRoute will be applied to convert appropriately."
|
||||
ATTACH_URL_TO_REGISTER="URL to register"
|
||||
ATTACH_URL_TO_REGISTER_DESCRIPTION="URL to use for user registration. In secure mode, guests who are not logged in will encounter a link to this URL when they try to download a non-public attachment. NOTE: Use URL with ampersands (like default: 'index.php?option=com_user&view=registration'). Do not use SEO version of the URL; JRoute will be applied to convert appropriately."
|
||||
ATTACH_USER_DEFINED_FIELD_1="User-defined field 1"
|
||||
ATTACH_USER_DEFINED_FIELD_1_NAME="Name for user-defined field 1"
|
||||
ATTACH_USER_DEFINED_FIELD_2="User-defined field 2"
|
||||
ATTACH_USER_DEFINED_FIELD_2_NAME="Name for user-defined field 2"
|
||||
ATTACH_USER_DEFINED_FIELD_3="User-defined field 3"
|
||||
ATTACH_USER_DEFINED_FIELD_3_NAME="Name for user-defined field 3"
|
||||
ATTACH_USER_DEFINED_FIELD_NAME_DESCRIPTION="If you want to add a new user-defined field to be displayed in the attachments list, insert the name for it here. Clear the name to disable the display and editing of this field. The user-defined fields will be shown in the order listed here. The maximum length of each user-defined field name is 40 characters. The data in these fields may be up to 255 characters long. Append an asterisk '*' at the end of the field name to hide it on the front end."
|
||||
ATTACH_UTILITIES="Utilities"
|
||||
ATTACH_VALIDATED_N_URL_ATTACHMENTS_M_CHANGED="Validated %d URL attachment(s), %d changed!"
|
||||
ATTACH_VALIDATE_URLS="Validate URLs"
|
||||
ATTACH_VALIDATE_URLS_TOOLTIP="Check all URLS and validate their existence, size, and MIME type."
|
||||
ATTACH_VERIFY_URL_EXISTENCE="Verify URL existence?"
|
||||
ATTACH_VERIFY_URL_EXISTENCE_TOOLTIP="Check this box to verify that the URL works (only for new or edited URLs). Unselecting this will still validate the URL correctness."
|
||||
ATTACH_VIEW_ARTICLE_TITLE="View this article (in the front end)"
|
||||
ATTACH_WARNING="Warning!"
|
||||
ATTACH_WARNING_ATTACHMENTS_PLUGIN_FRAMEWORK_DISABLED="WARNING: The Attachments Plugin Framework plugin is disabled!"
|
||||
ATTACH_WARNING_FAILED_ENABLING_PLUGIN_S="WARNING: Failed enabling plugin %s!"
|
||||
ATTACH_WARNING_FILENAME_TRUNCATED="Warning: Filename was too long! Truncated to:"
|
||||
ATTACH_WHERE_SHOULD_ATTACHMENTS_BE_PLACED="Where should attachments be placed?"
|
||||
ATTACH_WHERE_SHOULD_ATTACHMENTS_BE_PLACED_DESCRIPTION="Select where the attachments should be placed. To place attachments at an arbitrary location in the article (or other supported entity), select the 'Custom placement' option and insert the following tag text where you want the attachments to appear: {attachments}. It will get replaced with the attachments. If you add the {attachments} tag anywhere in an article and you want to disable inserting attachments, use one of the 'Disabled' options here instead of disabling the attachments plugin. The 'Disabled (filter)' option will filter out any attachments tags. The 'Disabled (no filter)' option will leave the articles unaltered and is equivalent to disabling the attachments plugin."
|
||||
ATTACH_YOU_MUST_SELECT_A_FILE_TO_UPLOAD="You must select a file to upload!"
|
||||
COM_ATTACHMENTS_N_ITEMS_PUBLISHED="%d Attachments successfully published"
|
||||
COM_ATTACHMENTS_N_ITEMS_PUBLISHED_1="Attachment successfully published"
|
||||
COM_ATTACHMENTS_N_ITEMS_UNPUBLISHED="%d Attachments successfully unpublished"
|
||||
COM_ATTACHMENTS_N_ITEMS_UNPUBLISHED_1="Attachment successfully unpublished"
|
||||
@ -0,0 +1,15 @@
|
||||
; en-GB.com_attachments.sys.ini (admin component menu)
|
||||
; Attachments for Joomla! extension
|
||||
; Copyright (C) 2007-2018 Jonathan M. Cameron, All rights reserved.
|
||||
; License http://www.gnu.org/licenses/gpl-3.0.html GNU/GPL
|
||||
; Note : All ini files need to be saved as UTF-8 - No BOM
|
||||
|
||||
; English translation
|
||||
|
||||
ATTACH_ADD_NEW_ATTACHMENT="Add new attachment"
|
||||
ATTACH_ATTACHMENTS="Attachments"
|
||||
ATTACH_ATTACHMENTS_COMPONENT_DESCRIPTION="Attachments component"
|
||||
ATTACH_PACKAGE_ATTACHMENTS_FOR_JOOMLA_16PLUS="Attachments for Joomla 2.5+/3.x"
|
||||
ATTACH_PLEASE_REPORT_BUGS_AND_SUGGESTIONS_TO_S="Please report Attachments bugs and suggestions to %s"
|
||||
COM_ATTACHMENTS="Attachments"
|
||||
COM_ATTACHMENTS_CONFIGURATION="Attachments Manager Options"
|
||||
@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
@ -0,0 +1,379 @@
|
||||
; it-IT.com_attachments.ini (admin component)
|
||||
; Attachments for Joomla! extension
|
||||
; Copyright (C) 2007-2013 Jonathan M. Cameron, All rights reserved.
|
||||
; License GNU GPL 3: http://www.gnu.org/licenses/gpl-3.0.html
|
||||
; Note : All ini files need to be saved as UTF-8 - No BOM
|
||||
|
||||
; Italian translation by: Piero Mattirolo (2.0, 3.0), Lemminkainen (version 1.3.4)
|
||||
|
||||
; For the main display list and parameters editor in the administrative back end
|
||||
|
||||
ATTACH_ACCESS_THIS_ATTACHMENT_TITLE="Accedi/Scarica questo allegato"
|
||||
ATTACH_ADDED_DATA_FOR_N_ATTACHMENTS="Dati aggiunti per %d allegati!"
|
||||
ATTACH_ADDED_ICON_FILENAMES_TO_N_ATTACHMENTS="Aggiunti nomi file icone a %d allegato(i)."
|
||||
ATTACH_ADD_ATTACHMENT="Aggiungi Allegato"
|
||||
ATTACH_ADD_ATTACHMENT_TITLE="Aggiungi un allegato a questo articolo o elemento di contenuto"
|
||||
ATTACH_ADD_ATTACHMENT_TO_S_INSTEAD_OF_S_TOOLTIP="Aggiungi l'allegato a %s (invece di %s)"
|
||||
ATTACH_ADD_URL="Aggiungi URL"
|
||||
ATTACH_ALLOW_FRONTEND_ACCESS_LEVEL_EDITING="Permetti modifiche a livello di accesso frontend?"
|
||||
ATTACH_ALLOW_FRONTEND_ACCESS_LEVEL_EDITING_DESCRIPTION="Permetti di impostare il livello di accesso frontend per un allegato quando si modifica un allegato o se ne crea uno nuovo. Il 'livello di accesso' controlla quali gruppi possono vedere (o accedere) l'allegato. Notare che nessuno che modifichi un allegato potrà mai essere in grado di impostare il livello di accesso per un livello per il quale non è abilitato."
|
||||
ATTACH_ALL_PARENTS="Tutti genitori"
|
||||
ATTACH_ALL_TYPES="Tutti i tipi"
|
||||
ATTACH_ALWAYS_SHOW_CATEGORY_ATTACHMENTS="Visualizza sempre gli allegati nella visualizzazione delle categorie"
|
||||
ATTACH_ALWAYS_SHOW_CATEGORY_ATTACHMENTS_DESCRIPTION="Visualizza sempre gli allegati nella visualizzazione delle categorie -- indipendentemente dalle altre opzioni."
|
||||
ATTACH_ARCHIVED_PARENTS="Genitori archiviati"
|
||||
ATTACH_ATTACHED_TO="Allegato a <br />%s"
|
||||
ATTACH_ATTACHMENT="Allegato"
|
||||
ATTACH_ATTACHMENTS="Allegati"
|
||||
ATTACH_ATTACHMENTS_ADMINISTRATIVE_UTILITY_COMMANDS="Comandi Utilità Amministrativa Allegati"
|
||||
ATTACH_ATTACHMENTS_DEFAULT_LAYOUT_DO_NOT_ATTACH_TO_MENU_ITEM="Potrebbe non essere possibile creare layout per gli allegati"
|
||||
ATTACH_ATTACHMENTS_DO_NOT_ATTACH_TO_MENU_ITEM="Non allegare all'elemento del menu"
|
||||
ATTACH_ATTACHMENTS_LIST_ORDER="Ordinamento lista allegati"
|
||||
ATTACH_ATTACHMENTS_LIST_ORDER_DESCRIPTION="Selezionare l'ordine desiderato per la lista di allegati nel front-end"
|
||||
ATTACH_ATTACHMENTS_PROJECT_URL_DESCRIPTION="Visitare questo URL per l'ultima versione di Allegati"
|
||||
ATTACH_ATTACHMENTS_PUBLISHED_BY_DEFAULT="Allegati pubblicati automaticamente"
|
||||
ATTACH_ATTACHMENTS_PUBLISHED_BY_DEFAULT_DESCRIPTION="Decide se in default gli allegati devono essere pubblicati "
|
||||
ATTACH_ATTACHMENTS_VERSION_S="Versione Allegati %s"
|
||||
ATTACH_ATTACHMENT_FILENAME_URL="Nome/URL del file allegato"
|
||||
ATTACH_ATTACHMENT_ID="ID dell'allegato"
|
||||
ATTACH_ATTACHMENT_ID_DESCRIPTION="Numero del record nella tabella allegati del database"
|
||||
ATTACH_ATTACHMENT_SAVED="Allegato Salvato"
|
||||
ATTACH_ATTACHMENT_TYPE="Tipo di allegato"
|
||||
ATTACH_ATTACHMENT_UPDATED="Allegato aggiornato!"
|
||||
ATTACH_ATTACH_FILE_COLON="Allega File"
|
||||
ATTACH_AT_THE_BEGINNING="All'inizio"
|
||||
ATTACH_AT_THE_END="Alla fine"
|
||||
ATTACH_AUTO_PUBLISH_WARNING="Avviso di Pubblicazione Automatica"
|
||||
ATTACH_AUTO_PUBLISH_WARNING_DESCRIPTION="Gli utenti vedranno questo avviso al caricamento di un allegato se il file non verrà pubblicato automaticamente. Il messaggio può includere codice HTML. (Utilizza il messaggio dai file di traduzione se non è¨ specificato nulla qui)."
|
||||
ATTACH_CANCEL="Annulla"
|
||||
ATTACH_CHANGES_TO_ATTACHMENT_SAVED="Modifiche all'Allegato Salvato"
|
||||
ATTACH_CHANGE_ENTITY_S="Modifica%s"
|
||||
ATTACH_CHANGE_ENTITY_S_TOOLTIP="Sposta questo allegato da un'altra parte %s. (Le altre modifiche a questo form andranno perse.)"
|
||||
ATTACH_CHANGE_ENTITY_TOOLTIP2="(Le altre modifiche in questo form andranno perdute.)"
|
||||
ATTACH_CHANGE_FILE="Sostituisci il File"
|
||||
ATTACH_CHANGE_FILE_TOOLTIP="Sostituisci il File per questo allegato (Le altre modifiche a questo form andranno perse.)"
|
||||
ATTACH_CHANGE_TO_FILE="Cambia File"
|
||||
ATTACH_CHANGE_TO_FILE_TOOLTIP="Allega un file a questo allegato (Le altre modifiche a questo form andranno perse)"
|
||||
ATTACH_CHANGE_TO_URL="Cambia con URL"
|
||||
ATTACH_CHANGE_TO_URL_TOOLTIP="Modifica URL/link del file caricati (Le altre modifiche a questo form andranno perse)"
|
||||
ATTACH_CHECKED_N_ATTACHMENT_FILES_M_MISSING="Verificato %d allegati con file, %d file mancanti"
|
||||
ATTACH_CHECK_FILES="Verifica esistenza di file allegati"
|
||||
ATTACH_CHECK_FILES_TOOLTIP="Verifica tutti i file allegati e controlla che esistano"
|
||||
ATTACH_CONFIGURATION="Opzioni di configurazione allegati"
|
||||
ATTACH_CONFIG_ADVANCED_SETTINGS_LABEL="Avanzato"
|
||||
ATTACH_CONFIG_BASIC_SETTINGS_LABEL="Base"
|
||||
ATTACH_CONFIG_FORMATTING_SETTINGS_LABEL="Formattazione"
|
||||
ATTACH_CONFIG_SECURITY_SETTINGS_LABEL="Sicurezza"
|
||||
ATTACH_CONFIG_VISIBILITY_SETTINGS_LABEL="Visibilità"
|
||||
ATTACH_CREATOR="Autore"
|
||||
ATTACH_CREATOR_ID="ID Autore"
|
||||
ATTACH_CSS_STYLE_FOR_ATTACHMENTS_TABLES="Stile CSS per le tabelle degli allegati"
|
||||
ATTACH_CSS_STYLE_FOR_ATTACHMENTS_TABLES_DESCRIPTION="Per ignorare lo stile CSS delle liste di allegati (tabelle), specificare qui il nome dello stile personalizzato. Lo stile di default è 'attachmentsList'. Vedere il file attachments.css del plugin per un esempio. Consultare il file di aiuto del componente per suggerimenti su come implementare gli stili."
|
||||
ATTACH_CUSTOM_PLACEMENT="Disposizione personalizzata"
|
||||
ATTACH_CUSTOM_TITLES_FOR_ATTACHMENTS_LISTS="Titoli personalizzati per le liste di allegati"
|
||||
ATTACH_CUSTOM_TITLES_FOR_ATTACHMENTS_LISTS_DESCRIPTION="Titoli personalizzati da usare per le liste di allegati. Per rinominare il titolo 'Allegati' sopra la lista di allegati per uno specifico articolo, usare questo formato (un elemento per linea, dove id# è il numero dell'articolo), esempio: 23 Nuovo Titolo Omettere il numero dell'elemento per modificare il titolo predefinito per la lista allegati di tutti gli articoli. NB questo può essere o non essere supportato per qualunque tipo di elemento di contenuto diverso dagli articoli. Per elementi diversi da articoli, aggiungere il numero ID con il nome dell'entità genitore e due punti (:) per evitare ambiguità , es: 'categoria:23 Categoria download:'.)"
|
||||
ATTACH_DATA_FOR_N_ATTACHMENTS_OK="Dati per %d allegati OK. Eseguire senza l'opzione 'dry_run' per aggiungere allegati"
|
||||
ATTACH_DATE_CREATED="Data di creazione"
|
||||
ATTACH_DATE_LAST_MODIFIED="Ultima modifica"
|
||||
ATTACH_DEFAULT_ACCESS_LEVEL="Livello Accesso di default"
|
||||
ATTACH_DEFAULT_ACCESS_LEVEL_DESCRIPTION="Il livello di accesso di default per nuovi allegati. Ogni allegato ha un 'livello di accesso' che controlla chi potrà visualizzare o scaricare lo specifico allegato. Quando viene creato un allegato, il suo livello di accesso è impostato inizialmente a questo livello di default (se l'autore fa parte del gruppo appropriato). L'autore dell'allegato o l'amministratore del sito possono modificare il livello di accesso dell'allegato per controllare chi potrà vedere quello specifico allegato."
|
||||
ATTACH_DELETE="Elimina"
|
||||
ATTACH_DESCRIPTION="Descrizione"
|
||||
ATTACH_DESCRIPTION_COLON="Descrizione:"
|
||||
ATTACH_DESCRIPTION_DESCRIPTION="Descrizione del file o dell'URL che comparirà nella colonna 'descrizione'."
|
||||
ATTACH_DESPACE_ATTACHMENT_SYSTEM_FILENAMES="Elimina spazi nei nomi dei file"
|
||||
ATTACH_DESPACE_ATTACHMENT_SYSTEM_FILENAMES_TOOLTIP="Sostituisci tutti gli spazi in ogni nome di file con il carattere trattino basso. Questo aggiorna gli URL e mostra i nomi dei file, come pure i nomi dei file archiviati nel filesystem."
|
||||
ATTACH_DISABLED_FILTER="Disabilitato (filtro)"
|
||||
ATTACH_DISABLED_NOFILTER="Disabilitato (senza filtro)"
|
||||
ATTACH_DISABLED_UNINSTALLING_MYSQL_ATTACHMENTS_TABLE="La disinstallazione della tabella MySQL Allegati è disabilitata"
|
||||
ATTACH_DISABLE_MYSQL_UNINSTALLATION="Disabilita la disinstallazione della tabella MySQL Allegati"
|
||||
ATTACH_DISABLE_MYSQL_UNINSTALLATION_TOOLTIP="Se desideri aggiornare questo modulo senza perdere gli allegati esistenti, clicca per disabilitare la disinstallazione dellatavola MySQL. Ricordati di NON cancellare la directory Attachments"
|
||||
ATTACH_DISPLAY_FILENAME="Visualizza nome file"
|
||||
ATTACH_DISPLAY_FILENAME_TOOLTIP="Facoltativo: Inserire un nome o un'etichetta per il file da mostrare in alternativa al nome del file completo."
|
||||
ATTACH_DISPLAY_NAME="Visualizza nome"
|
||||
ATTACH_DISPLAY_NAME_DESCRIPTION="Nome da visualizzare per nome file o URL (il link continua a puntare sul nome effettivo o l'URL del file)."
|
||||
ATTACH_DISPLAY_URL="Visualizza URL"
|
||||
ATTACH_DISPLAY_URL_TOOLTIP="Opzionale: Inserisci URL alternativo o etichetta da mostrare al posto dell'URL completo."
|
||||
ATTACH_DOWNLOADS="Downloads"
|
||||
ATTACH_DOWNLOAD_MODE_FOR_SECURE_DOWNLOADS="Modalità di download sicuro"
|
||||
ATTACH_DOWNLOAD_MODE_FOR_SECURE_DOWNLOADS_DESCRIPTION="Controlla come i download sono gestiti in modalità sicura. Con la modalità 'inline' i file che possono essere mostrati nel browser vengono mostrati nel browser (per esempio testi o immagini). Con la modalità 'allegato' i file vengono sempre mostrati come file separati. La modalità in default è 'allegato'. In entrambi i casi, i file che non possono essere mostrati nel browser verranno scaricati come file esterni."
|
||||
ATTACH_DOWNLOAD_VERB="Download"
|
||||
ATTACH_EDIT_ATTACHMENT="Modifica l'allegato"
|
||||
ATTACH_EDIT_THIS_ATTACHMENT_TITLE="Modifica le informazioni dell'allegato"
|
||||
ATTACH_ENTER_NEW_URL_COLON="Inserisci nuovo URL:"
|
||||
ATTACH_ENTER_URL="Inserisci URL"
|
||||
ATTACH_ENTER_URL_INSTEAD="Inserisci URL alternativo"
|
||||
ATTACH_ENTER_URL_INSTEAD_TOOLTIP="Inserisci invece URL . (Le altre modifiche verranno perse.)"
|
||||
ATTACH_ENTER_URL_TOOLTIP="Inserisci un URL. La risorsa indicata dall'URL non sarà uploadata ma sarà salvata soltanto la stessa URL. NOTA: Se l' URL è relativo, deseleziona 'verifica URL'."
|
||||
ATTACH_ERROR_ADDING_HTACCESS_S="Ricorda di inserire un file '.htaccess' nella directory di upload (%s) per prevenire l'accesso alla directory."
|
||||
ATTACH_ERROR_ADDING_ICON_FILENAME_FOR_ATTACHMENT_S="Errore nell'aggiunta dell'icona con nome file per l'allegato'%s'."
|
||||
ATTACH_ERROR_ADDING_INDEX_HTML_IN_S="Ricorda di inserire un file 'index.html' nella directory di upload (%s) per prevenire il browsing della directory."
|
||||
ATTACH_ERROR_BAD_ATTACHMENT_ID_S="Errore nell'importazione del file CSV degli allegati; l'ID dell'allegato non è un numero intero! (%s)"
|
||||
ATTACH_ERROR_BAD_CHARACTER_S_IN_FILENAME_S="ERRORE: Carattere non consentito (%s) nel nome file(%s), rinominare e riprovare!"
|
||||
ATTACH_ERROR_CANNOT_DELETE_INVALID_ATTACHMENT_ID_N="ERRORE: Impossibile cancellare l'allegato: Impossibile ottenere l'ID dell'allegato (%d)!"
|
||||
ATTACH_ERROR_CANNOT_MODIFY_ATTACHMENT_ZERO_ID="Errore nell'importazione del file CSV degli allegati;non è possibile modificare un allegato con id=0!"
|
||||
ATTACH_ERROR_CANNOT_SWITCH_PARENT_S_NEW_FILE_S_ALREADY_EXISTS="ERRORE: Impossibile scambiare %s; Il nuovo file '%s' esiste!"
|
||||
ATTACH_ERROR_CANNOT_UPDATE_ATTACHMENT_INVALID_ID_N="ERRORE: Impossibile aggiornare l'allegato. ID allegato non valido ID (%d)!"
|
||||
ATTACH_ERROR_CATEGORY_TITLE_MISMATCH_ID_S_S="Errore nell'importazione del file CSV degli allegati; Il titolo dell'ID della categoria =%d non '%s' è '%s' quello specificato nel file CSV!"
|
||||
ATTACH_ERROR_CHANGE_IN_MEDIA_MANAGER="(Questa modifica deve essere effettuata dal Media Manager.)"
|
||||
ATTACH_ERROR_CHECKING_ARTICLE_OWNERSHIP="Errore nella verifica dell'autore dell'articolo!"
|
||||
ATTACH_ERROR_CHECKING_ARTICLE_PERMISSIONS="Errore nella verifica delle autorizzazioni dell'articolo!"
|
||||
ATTACH_ERROR_CHECKING_CATEGORY_OWNERSHIP="Errore nella verifica dell'autore della categoria!"
|
||||
ATTACH_ERROR_CHECKING_CATEGORY_PERMISSIONS="Errore nella verifica dei permessi della categoria!"
|
||||
ATTACH_ERROR_CHECKING_URL_S="Errore durante la verifica URL: '%s'!"
|
||||
ATTACH_ERROR_CONNECTING_TO_URL_S="Errore impossibile connettersi a URL '%s'!"
|
||||
ATTACH_ERROR_COULD_NOT_ACCESS_URL_S="ERRORE: Impossibile accedere a URL '%s'! (Potresti disabilitare l'opzione 'Verifica esistenza URL' e riprovare)."
|
||||
ATTACH_ERROR_CREATOR_USERNAME_MISMATCH_ID_S_S="Errore nell'importazione del file CSV degli allegati;l'autore dell'allegato con id=%d ha nome utente'%s', ma è richiesto il file CSV'%s'!"
|
||||
ATTACH_ERROR_FILE_S_ALREADY_ON_SERVER="ERRORE: Il File '%s' è già presente sul server. Seleziona un'altro file o rinominalo!"
|
||||
ATTACH_ERROR_FILE_S_NOT_FOUND_ON_SERVER="ERROR: Il File o i file '%s' non esistono sul server!"
|
||||
ATTACH_ERROR_FILE_S_TOO_BIG_N_N_N="File %s' troppo grande di %.1f MB (massima dimensione dell'allegato =%d MB, massima dimensione di upload PHP =%d MB) "
|
||||
ATTACH_ERROR_GETTING_LIST_OF_ENTITY_S_ITEMS="ERRORE: Impossibile ottenere la lista di %s!"
|
||||
ATTACH_ERROR_ILLEGAL_FILE_EXTENSION="Estensione del file non consentita:"
|
||||
ATTACH_ERROR_ILLEGAL_FILE_MIME_TYPE="Tipo MIME del file non consentito:"
|
||||
ATTACH_ERROR_IMPORTING_ATTACHMENTS_S="ERRORE: Errore nell'importazione degli allegati(%s)!"
|
||||
ATTACH_ERROR_INVALID_ATTACHMENT_ID_N="ERRORE: ID allegato non valida (%e)!"
|
||||
ATTACH_ERROR_INVALID_PARENT_ID_S="ERRORE: ID genitore non valida: '%s'"
|
||||
ATTACH_ERROR_INVALID_PARENT_S_ID_N="ERROR: ID genitore %(i) non valida (%e)!"
|
||||
ATTACH_ERROR_INVALID_PARENT_TYPE_S="ERRORE: Tipo genitore non valido ('%s')!"
|
||||
ATTACH_ERROR_IN_URL_SYNTAX_S="Errore nella sintassi URL: '%s'!"
|
||||
ATTACH_ERROR_MAY_BE_LARGER_THAN_LIMIT="Probabilmente il tuo file è più grande del limite consentito di"
|
||||
ATTACH_ERROR_MISSING_ATTACHMENT_FILE_S=" ERRORE: File allegato mancante: %s"
|
||||
ATTACH_ERROR_MISSING_EXTRA_FIELDS_S="Errore nell'importazione file CSV allegati; mancano campi aggiuntivi: %s"
|
||||
ATTACH_ERROR_MISSING_FIELDS_S="Errore nell'importazione del file CSV degli allegati; mancano i campi): %s"
|
||||
ATTACH_ERROR_MISSING_PARENT_FOR_ATTACHMENT_S=" ERRORE: Manca genitore: %s"
|
||||
ATTACH_ERROR_MODIFIER_USERNAME_MISMATCH_ID_S_S="Errore nell'importazione file CSV allegati; l'autore delle modifiche con id=%d ha nome utente'%s', ma il file CSV file si attendeva '%s'!"
|
||||
ATTACH_ERROR_MOVING_FILE="Errore nel caricamento (errore nello spostamento del file)"
|
||||
ATTACH_ERROR_MUST_ADD_FILENAME_TO_URL="ERRORE: è necessario specificare il nome del file CSV degli allegati nell'URL! (Es: &file=/path/to/file)"
|
||||
ATTACH_ERROR_MUST_BE_LOGGED_IN_TO_UPLOAD_ATTACHMENT="ERRORE: Occorre essere autenticati per caricare un allegato!"
|
||||
ATTACH_ERROR_MUST_SELECT_PARENT="ERRORE: Occorre selezionare un nuovo genitore a cui allegare!"
|
||||
ATTACH_ERROR_MUST_SELECT_PARENT_S="ERRORE: Occorre selezionare %s a cui allegare!"
|
||||
ATTACH_ERROR_NEW_SYSTEM_FILENAME_S_NOT_FOUND="ERRORE: Nuovo nome file di sistema '%s' non trovato !"
|
||||
ATTACH_ERROR_NO_PERMISSION_TO_DELETE_S="ERRORE: Non disponi delle autorizzaioni necessarie per cancellare un allegato per questo %s!"
|
||||
ATTACH_ERROR_NO_PERMISSION_TO_DELETE_S_ATTACHMENT_S_ID_N="ERRORE: non hai l'autorizzazione a eliminare %s attachment '%s'! (ID %d)"
|
||||
ATTACH_ERROR_NO_PERMISSION_TO_EDIT="ERRORE: non hai l'autorizzazione per modificare questo allegato"
|
||||
ATTACH_ERROR_NO_PERMISSION_TO_PUBLISH_S_ATTACHMENT_S_ID_N="ERRORE: non hai l'autorizzazione per pubblicare o non pubblicare %s attachment '%s'! (ID %d)"
|
||||
ATTACH_ERROR_NO_PERMISSION_TO_UPLOAD_S="ERRORE: non hai l'autorizzazione per aggiungere un allegato a questo %s!"
|
||||
ATTACH_ERROR_NO_SPECIAL_FUNCTION_SPECIFIED="ERRORE: Non è stata specificata alcuna funzione speciale!"
|
||||
ATTACH_ERROR_NO_UTILS_FUNCTION_SPECIFIED="ERRORE: Nessuna funzione di utilità specificata!"
|
||||
ATTACH_ERROR_N_FILES_MISSING="ERRORE: %d file mancanti:"
|
||||
ATTACH_ERROR_PARENT_TITLE_MISMATCH_ID_N_TITLE_S_S="Errore nell'importazione del file CSV allegati; il titolo dell'articolo/genitore =%d è '%s' non '%s' come specificato nel file CSV!"
|
||||
ATTACH_ERROR_RENAMING_FILE_S_TO_S="Errore nel rinominare file '%s' in '%s'!"
|
||||
ATTACH_ERROR_STORING_ATTACHMENT_S="Errore nell'importazione del file CSV allegati; errore nell'archiviazione dell'allegato(%s)!"
|
||||
ATTACH_ERROR_UNABLE_TO_FIND_CATEGORY_ID_S="Errore nell'importazione del file CSV degli allegati; impossibile trovare categoria con ID=%d (title='%s')!"
|
||||
ATTACH_ERROR_UNABLE_TO_FIND_CREATOR_ID_S="Errore nell'importazione del file CSV allegati; impossibile trovare l'autore con ID=%d (nome='%s')!"
|
||||
ATTACH_ERROR_UNABLE_TO_FIND_MODIFIER_ID_S="Errore nell'importazione del file CSV allegati; impossibile trovare l'autore della modifica con ID=%d (nome='%s')!"
|
||||
ATTACH_ERROR_UNABLE_TO_FIND_USER_S_ID_N="ERRORE: impossibile trovare utente '%s' con ID=%d!"
|
||||
ATTACH_ERROR_UNABLE_TO_OPEN_CSV_FILE_S="ERRORE: Impossibile aprire il file CSV allegati '%s'!"
|
||||
ATTACH_ERROR_UNABLE_TO_SETUP_UPLOAD_DIR_S="ERRORW: Impossibile creare o modificare la directory di upload (%s)!"
|
||||
ATTACH_ERROR_UNKNOWN_PARENT_ID_N="Errore nell'importazione del file CSV allegati; ID=%d articolo/genitore sconosciuto!"
|
||||
ATTACH_ERROR_UNKNOWN_PARENT_TYPE_S="ERRORE: Tipo genitore sconosciuto '%s'!"
|
||||
ATTACH_ERROR_UNKNOWN_PROTCOL_S_IN_URL_S="ERRORE: Protocollo sconosciuto '%s' in URL: '%s'!"
|
||||
ATTACH_ERROR_UNRECOGNIZED_FIELD_S="Errore nell'importazione del file CSV allegati; campo non riconosciuto field: %s"
|
||||
ATTACH_ERROR_UPDATING_FILE="Errore durante l'aggiornamento del file"
|
||||
ATTACH_ERROR_UPDATING_NULL_DATE_FOR_ATTACHMENT_FILE_S="Errore nell'aggiornamento di una data nulla per l'allegato '%s'."
|
||||
ATTACH_ERROR_UPLOADING_FILE_S="Errore durante il caricamento del file '%s'!"
|
||||
ATTACH_ERROR_USERNAME_MISMATCH_ID_N_S_S="ERRORE: Nome utente non corrispondente per ID=%d, atteso '%s' ma trovato '%s' in questo sistema."
|
||||
ATTACH_FILE="File"
|
||||
ATTACH_FILENAME="Nome file"
|
||||
ATTACH_FILENAME_COLON="Nome del File:"
|
||||
ATTACH_FILENAME_DESCRIPTION="Nome del file allegato(caricato)"
|
||||
ATTACH_FILE_LINK_OPEN_MODE="Modalità di apertura del link al file"
|
||||
ATTACH_FILE_LINK_OPEN_MODE_DESCRIPTION="Determina come il link al file allegato viene aperto. 'Nella stessa finestra' significa che il file sarà aperto nella stessa finestra del browser. 'In una nuova finestra' significa che il file sarà aperto in una nuova finestra (o scheda)."
|
||||
ATTACH_FILE_SIZE="Dimensione del File"
|
||||
ATTACH_FILE_SIZE_KB="Dimensione(KB)"
|
||||
ATTACH_FILE_TYPE="Tipo di File"
|
||||
ATTACH_FILE_TYPE_DESCRIPTION="Tipo file Mime "
|
||||
ATTACH_FILTER="Filtro"
|
||||
ATTACH_FILTER_ENTITY_TOOLTIP="Utilizzare questa opzione per limitare la lista degli allegati per genitori di tipo particolare."
|
||||
ATTACH_FORBIDDEN_FILENAME_CHARACTERS="Caratteri non consentiti nei nomi dei file caricati"
|
||||
ATTACH_FORBIDDEN_FILENAME_CHARACTERS_DESCRIPTION="I nomi di file contenenti questi caratteri non potranno essere caricati. Questi caratteri sono problematici nell'URL presentato all'utente per file allegati in modalità 'non sicura', pertanto essi sono proibiti. Questi caratteri non costituiscono di solito un problema quando si usi la modalità 'sicura' poiché il nome del file non viene utilizzato come parte dell'URL presentato all'utente."
|
||||
ATTACH_FORMAT_STRING_FOR_DATES="Formato stringa per data"
|
||||
ATTACH_FORMAT_STRING_FOR_DATES_DESCRIPTION="La stringa di formattazione per la creazione e modifica di date. Inserire una stringa di formattazione del tipo utilizzato dalla funzione Joomla JDate class format() (che si basa sulla classe PHP DateTime::format function). Cercate su web 'PHP DateTime' per esempi. Notare che JDate gestisce la traduzione opportuna di mese/anno. La stringa di formato di default (Y-m-d H:M) trasforma le date con tempo in 24 ore, come 2013-01-05 16:21."
|
||||
ATTACH_FOR_PARENT_S_COLON_S="Per %s: <i>'%s'</i>"
|
||||
ATTACH_GO="Vai"
|
||||
ATTACH_HIDE_ADD_ATTACHMENTS_LINK="Nascondi il link 'aggiungi allegati'"
|
||||
ATTACH_HIDE_ADD_ATTACHMENTS_LINK_DESCRIPTION="Nascondi sempre il link 'aggiungi allegati' nel frontend. Questo necessità che gli allegati vengano o aggiunti agli articoli, etc, modificandoli nel frontend (tramite un pulsante 'aggiungi allegati', che sarà disponibile nell'area modifiche)."
|
||||
ATTACH_HIDE_ATTACHMENTS_EXCEPT_ON_ARTICLE_VIEWS="Nascondi gli allegati, tranne nell'area di visualizzazione dell''articolo."
|
||||
ATTACH_HIDE_ATTACHMENTS_EXCEPT_ON_ARTICLE_VIEWS_DESCRIPTION="Nascondi gli allegati in tutte le visualizzazioni, tranne per la visualizzazione di singoli articoli."
|
||||
ATTACH_HIDE_ATTACHMENTS_FOR_CATEGORIES="Nascondi gli allegati per le categorie"
|
||||
ATTACH_HIDE_ATTACHMENTS_FOR_CATEGORIES_DESCRIPTION="Nascondi gli allegati per qualunque visualizzazione delle categorie, per le categorie selezionate. Per selezionare o deselezionare delle categorie, senza effetti sulle categorie restanti, tenere premuto il tasto Control nel cliccare con il mouse sulle categorie. Notare che gli allegati verranno visualizzati per le categorie figlie, salvo se esplicitamente selezionate qui."
|
||||
ATTACH_HIDE_ATTACHMENTS_ON_BLOGS="Nascondere gli allegati sulle pagine blog."
|
||||
ATTACH_HIDE_ATTACHMENTS_ON_BLOGS_DESCRIPTION="Nascondi gli allegati nelle pagine (voci menu) che hanno layout di blog."
|
||||
ATTACH_HIDE_ATTACHMENTS_ON_FRONTPAGE="Nascondi gli allegati in prima pagina"
|
||||
ATTACH_HIDE_ATTACHMENTS_ON_FRONTPAGE_DESCRIPTION="Nascondi gli allegati in prima pagina. Questo esclude la visualizzazione di tutti gli allegati nella prima pagina."
|
||||
ATTACH_HIDE_ATTACHMENTS_WITH_READMORE="Nascondi gli allegati prima delle interruzioni di 'Leggi tutto'"
|
||||
ATTACH_HIDE_ATTACHMENTS_WITH_READMORE_DESCRIPTION="Nascondi gli allegati per articoli che includano un'interruzione di 'Leggi tutto'. Quando viene visualizzato l'intero articolo (senza interruzioni di 'Leggi tutto', gli allegati saranno visibili."
|
||||
ATTACH_ICON_FILENAME="Icona nome file"
|
||||
ATTACH_ICON_FILENAME_DESCRIPTION="Selezionare un'icona da visualizzare per l'indicazione del tipo di file."
|
||||
ATTACH_INLINE="Inline"
|
||||
ATTACH_INSTALLED_DEFAULT_ATTACHMENTS_ASSET_RULES="Installate nuove regole di default per gli asset di nuove autorizzazioni per allegati."
|
||||
ATTACH_INSTALLING_DEFAULT_ATTACHMENTS_ASSET_RULES_FAILED="Attenzione: l'installazione di regole di default degli asset per nuove autorizzazioni per allegati non è andata a buon fine."
|
||||
ATTACH_IN_NEW_WINDOW="In una nuova finestra"
|
||||
ATTACH_IN_SAME_WINDOW="Nella stessa finestra"
|
||||
ATTACH_KB="KB"
|
||||
ATTACH_LAST_MODIFIED="Modificato il"
|
||||
ATTACH_LIST_ATTACHMENTS_FOR_COLON="Elenca gli allegati per:"
|
||||
ATTACH_MAX_ATTACHMENT_SIZE="Massima dimensione allegato (MB)"
|
||||
ATTACH_MAX_ATTACHMENT_SIZE_DESCRIPTION="Dimensione massima di un allegato (in megabyte). Usare 0 per la massima dimensione consentita dal server e dalla configurazione del sito. NOTA: il vostro server ha un limite massimo di dimensione di upload."
|
||||
ATTACH_MAX_FILENAME_URL_LENGTH="Lunghezza massima del nome del file o dell'URL"
|
||||
ATTACH_MAX_FILENAME_URL_LENGTH_DESCRIPTION="Lunghezza massima del nome del file o della lunghezza dell'URL per la lista degli allegati. Nomi di file o URL di lunghezza maggiore verranno troncati ed inseriti in 'Visualizza nome del file' (soltanto a scopo di visualizzazione, il vero nome del file o l'URL non verranno cambiati). Un valore di 0 significa che il nome del file o la lunghezza dell'URL sono illimitati. NB questa opzione riguarda solamente gli allegati aggiunti dopo che questa opzione sia stata impostata."
|
||||
ATTACH_NORMAL_UPDATE="Aggiornamento normale"
|
||||
ATTACH_NORMAL_UPDATE_TOOLTIP="Aggiornamento normale (modifica delle sole info dell'allegato)"
|
||||
ATTACH_NOTE_ENTER_URL_WITH_HTTP="NOTA: Inseriere URL con il prefisso 'http...' ; diversamente URL è ritenuto relativo."
|
||||
ATTACH_NO_ATTACHMENTS_WITH_FILES="Nessun allegato trovato con file."
|
||||
ATTACH_NO_ATTACHMENTS_WITH_URLS="Nessun allegato trovato con URL"
|
||||
ATTACH_NO_FILE_TYPE_FIELDS_NEED_UPDATING="Nessuno dei campi tipo di file richiede aggiornamento"
|
||||
ATTACH_NO_PARENTS="Senza genitori"
|
||||
ATTACH_NO_PARENT_S="Nessun genitore %s!"
|
||||
ATTACH_NUMBER_OF_DOWNLOADS="Numero di download"
|
||||
ATTACH_NUMBER_OF_DOWNLOADS_TOOLTIP="Numero di volte in cui il file o l'URL è stato scaricato in modalità sicura. ATTENZIONE: questo contatore viene aggiornato soltanto in modalità sicura!"
|
||||
ATTACH_OPTIONAL="(Facoltativo)"
|
||||
ATTACH_PARENT_ENTITY="Entità genitore"
|
||||
ATTACH_PARENT_ENTITY_DESCRIPTION="Sottotipo di contenuto per un particolare tipo di genitore. Il com_content parent_type può avere due tipo di entità di contenuto: articoli e categorie."
|
||||
ATTACH_PARENT_ID="ID genitore"
|
||||
ATTACH_PARENT_ID_DESCRIPTION="Numero del record nella tabella genitore nel database"
|
||||
ATTACH_PARENT_S_COLON_S="<b>%s:</b> '%s'"
|
||||
ATTACH_PARENT_TYPE="Tipo genitore"
|
||||
ATTACH_PARENT_TYPE_DESCRIPTION="Componente del genitore(es. com_content per articoli)"
|
||||
ATTACH_PERMISSIONS_DESC="Autorizzazioni di default per tutti gli allegati."
|
||||
ATTACH_PERMISSION_ADMIN_COMPONENT="Configura le opzioni per gli allegati"
|
||||
ATTACH_PERMISSION_ADMIN_COMPONENT_DESC="Permette agli utenti del gruppo di modificare le opzioni per gli allegati."
|
||||
ATTACH_PERMISSION_CREATE="Crea allegati"
|
||||
ATTACH_PERMISSION_CREATE_DESC="Permette agli utenti del gruppo di creare allegati (se autorizzati a modificare il genitore)."
|
||||
ATTACH_PERMISSION_DELETE="Elimina gli allegati"
|
||||
ATTACH_PERMISSION_DELETEOWN="Elimina i tuoi allegati"
|
||||
ATTACH_PERMISSION_DELETEOWN_DESC="Permette agli utenti del gruppo di cancellare i loro allegati(se autorizzati a modificare il genitore)"
|
||||
ATTACH_PERMISSION_DELETE_DESC="Permette agli utenti del gruppo di cancellare gli allegati(se autorizzati a modificare il genitore)."
|
||||
ATTACH_PERMISSION_DELETE_OWNPARENT="Cancellare allegati per un articolo/genitore propri."
|
||||
ATTACH_PERMISSION_DELETE_OWNPARENT_DESC="Permette agli utenti del gruppo di cancellare qualunque allegato di articoli/genitori di loro proprietà(se autorizzait a modifiche)."
|
||||
ATTACH_PERMISSION_EDIT="Modifica gli allegati"
|
||||
ATTACH_PERMISSION_EDITOWN="Modifica i propri allegati"
|
||||
ATTACH_PERMISSION_EDITOWN_DESC="Permette agli utenti dello stesso gruppo di modificare gli allegati che hanno creato (se autorizzati a modificare il genitore)."
|
||||
ATTACH_PERMISSION_EDITSTATE="Modifica lo stato degli allegati"
|
||||
ATTACH_PERMISSION_EDITSTATE_DESC="Permette agli utenti del gruppo di modificare lo stato di qualunque allegato."
|
||||
ATTACH_PERMISSION_EDITSTATE_OWN="Modifica lo stato dei propri allegati"
|
||||
ATTACH_PERMISSION_EDITSTATE_OWNPARENT="Modifica lo stato degli allegati per il proprio articolo/genitore"
|
||||
ATTACH_PERMISSION_EDITSTATE_OWNPARENT_DESC="Permette agli utenti del gruppo di modificare lo stato di qualunque allegato degli articoli/genitori di cui sono proprietari (e di cui possono modificare il genitore)."
|
||||
ATTACH_PERMISSION_EDITSTATE_OWN_DESC="Permette agli utenti del gruppo di modificare lo stato di qualunque allegato da essi creato (se autorizzati a modificare il genitore)."
|
||||
ATTACH_PERMISSION_EDIT_DESC="Permette agli utenti del gruppo di modificare gli allegati (se autorizzati a modificare il genitore)."
|
||||
ATTACH_PERMISSION_EDIT_OWNPARENT="Modificare gli allegati per il proprio articolo/genitore"
|
||||
ATTACH_PERMISSION_EDIT_OWNPARENT_DESC="Permette agli utenti del gruppo di modificare qualunque allegato per articoli/genitori di loro proprietà(se autorizzati a modifiche)."
|
||||
ATTACH_PERMISSION_MANAGE_COMPONENT="Accedi al componente allegati"
|
||||
ATTACH_PERMISSION_MANAGE_COMPONENT_DESC="Permette agli utenti del gruppo di accedere all'extension Allegati."
|
||||
ATTACH_PUBLISHED="Pubblicato"
|
||||
ATTACH_PUBLISHED_PARENTS="Genitori pubblicati"
|
||||
ATTACH_REALLY_DELETE_ATTACHMENT="Confermi la cancellazione dell'allegato?"
|
||||
ATTACH_REGENERATED_SYSTEM_FILENAMES_FOR_N_ATTACHMENTS="Rigenerato nomi file di sistema per %d allegato(i)."
|
||||
ATTACH_REGENERATE_ATTACHMENT_SYSTEM_FILENAMES="Rigenera i nomi dei file sul sistema"
|
||||
ATTACH_REGENERATE_ATTACHMENT_SYSTEM_FILENAMES_TOOLTIP="Utilizza questa opzione se hai rinominato o spostato la directory Attachments per allineare i nomi sul server. Questo è particolarmente utile se sono stati spostati files da/su piattaforma Windows a Unix/Linux ."
|
||||
ATTACH_REINSTALL_PERMISSIONS="Reinstallare le regole di default per gli asset o i permessi per gli allegati"
|
||||
ATTACH_REINSTALL_PERMISSIONS_TOOLTIP="Reinstallare le regole di default per gli allegati con permessi personalizzati nel sistema di permessi ACL di Joomla(per esempio, per cancellare i propri allegati). Le precedenti impostazioni per i permessi specifici non dovrebbero essere influenzate. NOTARE: queste regole di default per gli asset vengono installate con l'installazione dell'extension Allegati, ma potrebbe essere necessario reinstallarle dopo un upgrade di Joomla."
|
||||
ATTACH_RELATIVE_URL="URL relativo"
|
||||
ATTACH_RELATIVE_URL_TOOLTIP="Spunta questo box per inserire una URL relativa a questo sito Joomla!. Probabilmente dovrai anche desiabilitare 'Verifica URL' per inserire una URL relativa."
|
||||
ATTACH_RESET="Reimposta"
|
||||
ATTACH_RESET_ORDER="Reimposta l'ordine"
|
||||
ATTACH_SAVE="Salva"
|
||||
ATTACH_SECURE_ATTACHMENT_DOWNLOADS="Download allegati in modalità sicura"
|
||||
ATTACH_SECURE_ATTACHMENT_DOWNLOADS_DESCRIPTION="Utilizza la modalità di download sicura. Quando viene utilizzata, soltanto gli utenti con i permessi adeguati possono scaricare gli allegati. Nota: in modalità sicura, la lista di allegati non è visualizzata se l'utente non è autenticato."
|
||||
ATTACH_SELECT_ENTITY_S="Seleziona %s"
|
||||
ATTACH_SELECT_ENTITY_S_COLON="Seleziona %s:"
|
||||
ATTACH_SELECT_ENTITY_S_TOOLTIP="Seleziona %s (richiesto preliminarmente!)"
|
||||
ATTACH_SELECT_FILE_COLON="Selezionare File:"
|
||||
ATTACH_SELECT_FILE_TO_UPLOAD_INSTEAD="Seleziona il file da caricare"
|
||||
ATTACH_SELECT_FILE_TO_UPLOAD_INSTEAD_TOOLTIP="Seleziona i file da caricare in sostituzione. (Altre modifiche andranno perse.)"
|
||||
ATTACH_SELECT_NEW_FILE_IF_YOU_WANT_TO_UPDATE_ATTACHMENT_FILE="Seleziona un nuovo file (se desideri aggiornare il file allegato):"
|
||||
ATTACH_SHOW_ATTACHMENT_CREATOR="Visualizza l'autore dell'allegato?"
|
||||
ATTACH_SHOW_ATTACHMENT_CREATOR_DESCRIPTION="Mostra il nome di chi ha caricato l'allegato"
|
||||
ATTACH_SHOW_ATTACHMENT_DESCRIPTION="Visualizza la descrizione dell'allegato?"
|
||||
ATTACH_SHOW_ATTACHMENT_DESCRIPTION_DESCRIPTION="Indica se la descrizione di ciascun allegato debba essere mostrata"
|
||||
ATTACH_SHOW_ATTACHMENT_FILE_SIZE="Visualizza la dimensione dell'allegato?"
|
||||
ATTACH_SHOW_ATTACHMENT_FILE_SIZE_DESCRIPTION="Determina se la dimensione di ogni allegato deve essere mostrata"
|
||||
ATTACH_SHOW_COLUMN_TITLES="Visualizza titoli?"
|
||||
ATTACH_SHOW_COLUMN_TITLES_DESCRIPTION="Se ipostata su Sì, una colonna di titoli saràaggiunta sopra la lista degli allegati, per descrivere il contenuto delle colonne."
|
||||
ATTACH_SHOW_CREATION_DATE="Mostra la data di creazione?"
|
||||
ATTACH_SHOW_CREATION_DATE_DESCRIPTION="Determina se la data di creazione dell'allegato debba essere mostrata"
|
||||
ATTACH_SHOW_FOR_PARENTS_TOOLTIP="Seleziona se visualizzare gli allegati che sono associati a genitori pubblicati o non pubblicati."
|
||||
ATTACH_SHOW_GUEST_ACCESS_LEVELS="Mostra gli allegati a utenti che non hanno fatto l'accesso"
|
||||
ATTACH_SHOW_GUEST_ACCESS_LEVELS_DESCRIPTION="Mostra i link agli allegati con i livelli di accesso per utenti che non hanno fatto l'accesso. Tuttavia, per accedere effettivamente a questi allegati, agli utenti sarà richiesto di fare il lob in. Nota: gli allegati pubbici saranno sempre mostrati."
|
||||
ATTACH_SHOW_MODIFICATION_DATE="Visualizza la data di modifica dell'allegato?"
|
||||
ATTACH_SHOW_MODIFICATION_DATE_DESCRIPTION="Determina se la data di modifica debba essere mostrata"
|
||||
ATTACH_SHOW_NUMBER_OF_DOWNLOADS="Visualizza il numero di download?"
|
||||
ATTACH_SHOW_NUMBER_OF_DOWNLOADS_DESCRIPTION="Visualizza il numero dei download. ATTENZIONE questa opzione funziona solo in modalità sicura."
|
||||
ATTACH_SORT_ATTACHMENT_ID="ID Allegato (ordine di inserimento)"
|
||||
ATTACH_SORT_CREATED_DATE="Data creazione (a partire dalla meno recente)"
|
||||
ATTACH_SORT_CREATED_DATE_DESCENDING="Data di creazione (a partire dalla più recente)"
|
||||
ATTACH_SORT_DESCRIPTION="Descrizione"
|
||||
ATTACH_SORT_DESCRIPTION_DESCENDING="Descrizione (all'inverso, z-a)"
|
||||
ATTACH_SORT_DISPLAY_FILENAME_OR_URL="Mostra nome del file o URL"
|
||||
ATTACH_SORT_DISPLAY_FILENAME_OR_URL_DESCENDING="Mostra nome del file o URL (all'inverso, z-a)"
|
||||
ATTACH_SORT_FILENAME="Nome del File"
|
||||
ATTACH_SORT_FILENAME_DESCENDING="Nome file (all'inverso, z-a)"
|
||||
ATTACH_SORT_FILE_SIZE="Dimensione del file (dal pù piccolo)"
|
||||
ATTACH_SORT_FILE_SIZE_DESCENDING="Dimensione del file (dal pù grande)"
|
||||
ATTACH_SORT_MODIFICATION_DATE="Data di modifica (dal meno recente)"
|
||||
ATTACH_SORT_MODIFICATION_DATE_DESCENDING="Data di modifica (dal più recente)"
|
||||
ATTACH_SORT_USER_DEFINED_FIELD_1_DESC="Campo 1 definito dall'utente (all'inverso, z-a)"
|
||||
ATTACH_SORT_USER_DEFINED_FIELD_2_DESC="Campo 2 definito dall'utente (all'inverso, z-a)"
|
||||
ATTACH_SORT_USER_DEFINED_FIELD_3_DESC="Campo 3 definito dall'utente (all'inverso, z-a)"
|
||||
ATTACH_SUPERIMPOSE_URL_LINK_ICONS="Sovrapponi le icone con i link degli URL"
|
||||
ATTACH_SUPERIMPOSE_URL_LINK_ICONS_DESCRIPTION="Sovrapponi le icone con i link degli URL sull'icona del file allegato, per indicare che si tratta di un URL. Gli URL validi sono mostrati con frecce, mentre quelli non validi sono indicati con un linea rossa che attraversa l'icona del tipo di file (in basso da sinistra fino in alto a destra."
|
||||
ATTACH_SUPPRESS_OBSOLETE_ATTACHMENTS="Elimina gli allegati obsoleti (nel back end)"
|
||||
ATTACH_SUPPRESS_OBSOLETE_ATTACHMENTS_DESCRIPTION="Imposta la soppressione degli allegati obsoleti di default (allegati per genitori non pubblicati) nel back end amministrativo. Questo può essere ignorato utilizzando il menu a discesa 'Visualizza allegati per' immediatamente sopra la lista degli allegati sulla sinistra."
|
||||
ATTACH_SWITCH_ATTACHMENT_TO_S_TOOLTIP="Passa l'allegato a %s. (Altre modifiche andranno perse.)"
|
||||
ATTACH_SWITCH_ATTACHMENT_TO_TOOLTIP2="(Le altre modifiche di questo form andranno perdute.)"
|
||||
ATTACH_SWITCH_TO_COLON="Passa a:"
|
||||
ATTACH_SYSTEM_FILENAME="Nome file di sistema:"
|
||||
ATTACH_SYSTEM_FILENAME_DESCRIPTION="Il percorso completo del nome del file sul server"
|
||||
ATTACH_TIMEOUT_FOR_CHECKING_LINKS="Timeout per la verifica dei link"
|
||||
ATTACH_TIMEOUT_FOR_CHECKING_LINKS_DESCRIPTION="Timeout per la verifica dei link (secondi). Ogni qualvolta si un aggiunge un link ad un allegato, il lik viene verificato direttamente. Se il link non viene raggiunto prima del timeout, vengono recuperate le dimensioni del file ed altre informazioni sul link. Altrimenti, vengono utilizzate informazioni generiche. Per disabilitare la verifica, inserire 0."
|
||||
ATTACH_TITLE="Titolo"
|
||||
ATTACH_TRASHED_PARENTS="Genitori cestinati"
|
||||
ATTACH_UNKNOWN="Sconosciuto"
|
||||
ATTACH_UNPUBLISHED_PARENTS="Genitori non pubblicati"
|
||||
ATTACH_UPDATE="Aggiorna"
|
||||
ATTACH_UPDATED_ATTACHMENT="Allegato aggiornato"
|
||||
ATTACH_UPDATED_ATTACHMENTS_PARAMETERS="Aggiornato i parametri degli allegati"
|
||||
ATTACH_UPDATED_ATTACHMENTS_PARAMETERS_AND_SECURITY_SETTINGS="Aggiornati i parametri degli allegati e le impostazioni di sicurezza"
|
||||
ATTACH_UPDATED_FILE_SIZES_FOR_N_ATTACHMENTS="Aggiornate le dimensioni dei file per %d allegato(i)."
|
||||
ATTACH_UPDATED_N_ATTACHMENTS="Sono stati aggiornati %d allegati"
|
||||
ATTACH_UPDATE_ATTACHMENT_COLON="Aggiorna l'allegato:"
|
||||
ATTACH_UPDATE_ATTACHMENT_FILE_SIZES="Aggiorna le dimensioni dei file allegati"
|
||||
ATTACH_UPDATE_ATTACHMENT_FILE_SIZES_TOOLTIP="Usa questa funzione per aggiornare le dimiensioni dei file per tutti gli allegati.."
|
||||
ATTACH_UPDATE_DO_NOT_ATTACH_TO_MENU_ITEM="Vista di Aggiornamento - Non collegare ad elemento di menu!"
|
||||
ATTACH_UPLOADED_ATTACHMENT="Allegato Caricato"
|
||||
ATTACH_UPLOAD_DO_NOT_ATTACH_TO_MENU_ITEM="Vista di Upload: Da non collegare a un elemento di menu!"
|
||||
ATTACH_UPLOAD_VERB="Carica"
|
||||
ATTACH_URL="URL:"
|
||||
ATTACH_URL_COLON="URL:"
|
||||
ATTACH_URL_DESCRIPTION="URL per gli allegati (parziale; unito all'URL di base)"
|
||||
ATTACH_URL_IS_VALID="URL è valido"
|
||||
ATTACH_URL_IS_VALID_TOOLTIP="Usa questo checkbox per indicare manualmente se il link è valido. Ignorato nel caso di links nuovi o modificati."
|
||||
ATTACH_URL_TO_LOGIN="URL per il lob in"
|
||||
ATTACH_URL_TO_LOGIN_DESCRIPTION="URL per log in utente. In modalità sicura, i visitatori che non hanno fatto l'accesso troveranno un link per questo URL, quando cercheranno di scaricare un allegato non pubblico. NOTA: scrivere URL con & (come in default: 'index.php?option=com_user&view=login') Non utilizzare la versione SEO dell'URL; verrà utilizzato JRoute per convertire l'URL correttamente"
|
||||
ATTACH_URL_TO_REGISTER="URL per registrarsi"
|
||||
ATTACH_URL_TO_REGISTER_DESCRIPTION="URL da utilizzare per la registrazione utenti. In modalità sicura, i visitatori che non hanno fatto l'accesso troveranno un link a questo URL quando cercheranno di scaricare un allegato non pubblico. NOTA: scrivere URL con & (come in default: 'index.php?option=com_user&view=login') Non utilizzare la versione SEO dell'URL; verrà utilizzato JRoute per convertire l'URL correttamente"
|
||||
ATTACH_USER_DEFINED_FIELD_1="Campo definito dall'utente 1"
|
||||
ATTACH_USER_DEFINED_FIELD_1_NAME="Nome per campo definito dall'utente 1"
|
||||
ATTACH_USER_DEFINED_FIELD_2="Campo definito dall'utente 2"
|
||||
ATTACH_USER_DEFINED_FIELD_2_NAME="Nome per campo definito dall'utente 2"
|
||||
ATTACH_USER_DEFINED_FIELD_3="Campo definito dall'utente 3"
|
||||
ATTACH_USER_DEFINED_FIELD_3_NAME="Nome per campo definito dall'utente 3"
|
||||
ATTACH_USER_DEFINED_FIELD_NAME_DESCRIPTION="Se si desidera aggiunger un nuovo campo definito dall'utente da mostrare nella lista allegat, inserirne il nome qui. Cancellare il nome per dis abilitare la visualizzazione e la modifica del campo. I campi definiti dall'utente saranno mostrati nell'ordine indicato qui. La lunghezza massima di ciascun campo definito dall'utente è di 40 caratteri. I dati in questi campi devono avere una lunghezza massima di 255 caratteri. Aggiungere un asterisco '*' alla fine del nome del campo per nasconderlo sul front end."
|
||||
ATTACH_UTILITIES="Utilità "
|
||||
ATTACH_VALIDATED_N_URL_ATTACHMENTS_M_CHANGED="Lista %d URL allegato(i), %d modificata!"
|
||||
ATTACH_VALIDATE_URLS="Convalida gli URL"
|
||||
ATTACH_VALIDATE_URLS_TOOLTIP="Verifica tutti gli URL e convalida la loro esistenza, dimensione e tipo MIME."
|
||||
ATTACH_VERIFY_URL_EXISTENCE="Verifca esistenza URL?"
|
||||
ATTACH_VERIFY_URL_EXISTENCE_TOOLTIP="Seleziona questo check per verificare se l'URL è corretto (solo per URL nuovi o editati). Disabilitandlo sarè solo verificata la correttezza dell'URL."
|
||||
ATTACH_VIEW_ARTICLE_TITLE="Visualizza l'articolo (sul front end)"
|
||||
ATTACH_WARNING="Attenzione!"
|
||||
ATTACH_WARNING_ATTACHMENTS_PLUGIN_FRAMEWORK_DISABLED="Attenzione il Plugin Attachments Framework è disabilitato!"
|
||||
ATTACH_WARNING_FAILED_ENABLING_PLUGIN_S="ATTENZIONE: Non è stato abilitato il plugin %!"
|
||||
ATTACH_WARNING_FILENAME_TRUNCATED="Attenzione: Nome del file era troppo lungo! Troncato a:"
|
||||
ATTACH_WHERE_SHOULD_ATTACHMENTS_BE_PLACED="Dove devono essere collocati gli allegati"
|
||||
ATTACH_WHERE_SHOULD_ATTACHMENTS_BE_PLACED_DESCRIPTION="Seleziona dove dovrebbero essere collocati gli allegati Per collocare gli allegati in qualunque posizione nell'articolo (o altra entità supportata), selezionare l'opzione 'Collocamento personalizzato' ed inserire il tag di testo seguente dove si vuole che compaia l'allegato{i}. Verrà sostituito dagli allegati. Se si colloca il tag {attachments} da qualunque parte nell'articolo e si desidera disabilitare l'inserimento degli allegati, utilizzare una delle opzioni 'Disabilitato' qui, anzich disabilitare il plugin allegati. L'opzione 'Disabilitato (filtro)' filtrerà qualsiasi tag di allegati. L'opzione Disabilitato (senza filtro)' lascerà invariati tutti gli articoli ed equivale a disabilitare il plugin degli allegati"
|
||||
ATTACH_YOU_MUST_SELECT_A_FILE_TO_UPLOAD="Devi selezionare un file da caricare!"
|
||||
COM_ATTACHMENTS_N_ITEMS_PUBLISHED="Allegati pubblicati con successo"
|
||||
COM_ATTACHMENTS_N_ITEMS_PUBLISHED_1="Allegati pubblicati con successo"
|
||||
COM_ATTACHMENTS_N_ITEMS_UNPUBLISHED="%d allegati non pubblicati con successo"
|
||||
COM_ATTACHMENTS_N_ITEMS_UNPUBLISHED_1="Allegati non pubblicati con successo"
|
||||
@ -0,0 +1,15 @@
|
||||
; it-IT.com_attachments.sys.ini (admin component menu)
|
||||
; Attachments for Joomla! extension
|
||||
; Copyright (C) 2007-2013 Jonathan M. Cameron, All rights reserved.
|
||||
; License GNU GPL 3: http://www.gnu.org/licenses/gpl-3.0.html
|
||||
; Note : All ini files need to be saved as UTF-8 - No BOM
|
||||
|
||||
; Italian translation by: Piero Mattirolo (2.0, 3.0), Lemminkainen (version 1.3.4)
|
||||
|
||||
ATTACH_ADD_NEW_ATTACHMENT="Aggiungi nuovo allegato"
|
||||
ATTACH_ATTACHMENTS="Allegati"
|
||||
ATTACH_ATTACHMENTS_COMPONENT_DESCRIPTION="Componente allegati"
|
||||
ATTACH_PACKAGE_ATTACHMENTS_FOR_JOOMLA_16PLUS="Allegati per Joomla 2.5+"
|
||||
ATTACH_PLEASE_REPORT_BUGS_AND_SUGGESTIONS_TO_S="Segnalare bug e suggerimenti a%s"
|
||||
COM_ATTACHMENTS="Allegati"
|
||||
COM_ATTACHMENTS_CONFIGURATION="Gestione opzioni allegati"
|
||||
131
administrator/components/com_attachments/models/attachment.php
Normal file
131
administrator/components/com_attachments/models/attachment.php
Normal file
@ -0,0 +1,131 @@
|
||||
<?php
|
||||
/**
|
||||
* Attachments component attachment model
|
||||
*
|
||||
* @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');
|
||||
|
||||
// import Joomla modelform library
|
||||
jimport('joomla.application.component.modeladmin');
|
||||
|
||||
/**
|
||||
* Attachment Model
|
||||
*
|
||||
* @package Attachments
|
||||
*/
|
||||
class AttachmentsModelAttachment extends JModelAdmin
|
||||
{
|
||||
/**
|
||||
* Returns a reference to the a Table object, always creating it.
|
||||
*
|
||||
* @param type The table type to instantiate
|
||||
* @param string A prefix for the table class name. Optional.
|
||||
* @param array Configuration array for model. Optional.
|
||||
* @return JTable A database object
|
||||
* @since 1.6
|
||||
*/
|
||||
public function getTable($type = 'Attachment', $prefix = 'AttachmentsTable', $config = array())
|
||||
{
|
||||
return JTable::getInstance($type, $prefix, $config);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Override the getItem() command to get some extra info
|
||||
*
|
||||
* @param integer $pk The id of the primary key.
|
||||
*
|
||||
* @return mixed Object on success, false on failure.
|
||||
*/
|
||||
public function getItem($pk = null)
|
||||
{
|
||||
$item = parent::getItem($pk);
|
||||
|
||||
if ( $item->id != 0 ) {
|
||||
|
||||
// If the item exists, get more info
|
||||
$db = $this->getDbo();
|
||||
|
||||
// Get the creator name
|
||||
$query = $db->getQuery(true);
|
||||
$query->select('name')->from('#__users')->where('id = ' . (int)$item->created_by);
|
||||
$db->setQuery($query, 0, 1);
|
||||
$item->creator_name = $db->loadResult();
|
||||
if ( $db->getErrorNum() ) {
|
||||
$errmsg = $db->stderr() . ' (ERR 112)';
|
||||
JError::raiseError(500, $errmsg);
|
||||
}
|
||||
|
||||
// Get the modifier name
|
||||
$query = $db->getQuery(true);
|
||||
$query->select('name')->from('#__users')->where('id = ' . (int)$item->modified_by);
|
||||
$db->setQuery($query, 0, 1);
|
||||
$item->modifier_name = $db->loadResult();
|
||||
if ( $db->getErrorNum() ) {
|
||||
$errmsg = $db->stderr() . ' (ERR 113)';
|
||||
JError::raiseError(500, $errmsg);
|
||||
}
|
||||
|
||||
// Get the parent info (??? Do we really need this?)
|
||||
$parent_type = $item->parent_type;
|
||||
$parent_entity = $item->parent_entity;
|
||||
JPluginHelper::importPlugin('attachments');
|
||||
$apm = getAttachmentsPluginManager();
|
||||
if ( !$apm->attachmentsPluginInstalled($parent_type) ) {
|
||||
$errmsg = JText::sprintf('ATTACH_ERROR_INVALID_PARENT_TYPE_S', $parent_type) . ' (ERR 114)';
|
||||
JError::raiseError(500, $errmsg);
|
||||
}
|
||||
$item->parent = $apm->getAttachmentsPlugin($parent_type);
|
||||
|
||||
}
|
||||
|
||||
return $item;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to get the record form.
|
||||
*
|
||||
* @param array $data Data for the form.
|
||||
* @param boolean $loadData True if the form is to load its own data (default case), false if not.
|
||||
* @return mixed A JForm object on success, false on failure
|
||||
* @since 1.6
|
||||
*/
|
||||
public function getForm($data = array(), $loadData = true)
|
||||
{
|
||||
// Get the form.
|
||||
$form = $this->loadForm('com_attachments.attachment', 'attachment',
|
||||
array('control' => 'jform', 'load_data' => $loadData));
|
||||
if (empty($form))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return $form;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Method to get the data that should be injected in the form.
|
||||
*
|
||||
* @return mixed The data for the form.
|
||||
* @since 1.6
|
||||
*/
|
||||
protected function loadFormData()
|
||||
{
|
||||
// Check the session for previously entered form data.
|
||||
$data = JFactory::getApplication()->getUserState('com_attachments.edit.attachment.data', array());
|
||||
if (empty($data))
|
||||
{
|
||||
$data = $this->getItem();
|
||||
}
|
||||
return $data;
|
||||
}
|
||||
}
|
||||
370
administrator/components/com_attachments/models/attachments.php
Normal file
370
administrator/components/com_attachments/models/attachments.php
Normal file
@ -0,0 +1,370 @@
|
||||
<?php
|
||||
/**
|
||||
* Attachments component attachments model
|
||||
*
|
||||
* @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');
|
||||
|
||||
// import the Joomla modellist library
|
||||
jimport('joomla.application.component.modellist');
|
||||
|
||||
|
||||
/**
|
||||
* Attachments Model
|
||||
*
|
||||
* @package Attachments
|
||||
*/
|
||||
class AttachmentsModelAttachments extends JModelList
|
||||
{
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param array An optional associative array of configuration settings.
|
||||
* @see JControllerLegacy
|
||||
* @since 1.6
|
||||
*/
|
||||
public function __construct($config = array())
|
||||
{
|
||||
if (empty($config['filter_fields'])) {
|
||||
$config['filter_fields'] = array(
|
||||
'id',
|
||||
'a.state',
|
||||
'a.access',
|
||||
'a.filename',
|
||||
'a.description',
|
||||
'a.user_field_1',
|
||||
'a.user_field_2',
|
||||
'a.user_field_3',
|
||||
'a.file_type',
|
||||
'a.file_size',
|
||||
'creator_name',
|
||||
'modifier_name',
|
||||
'u1.name',
|
||||
'a.created',
|
||||
'a.modified',
|
||||
'a.download_count'
|
||||
);
|
||||
}
|
||||
|
||||
parent::__construct($config);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Method to build an SQL query to load the attachments data.
|
||||
*
|
||||
* @return JDatabaseQuery An SQL query
|
||||
*/
|
||||
protected function getListQuery()
|
||||
{
|
||||
|
||||
// Create a new query object.
|
||||
$db = JFactory::getDBO();
|
||||
$query = $db->getQuery(true);
|
||||
|
||||
$query->select('a.*, a.id as id');
|
||||
$query->from('#__attachments as a');
|
||||
|
||||
$query->select('u1.name as creator_name');
|
||||
$query->leftJoin('#__users AS u1 ON u1.id = a.created_by');
|
||||
|
||||
$query->select('u2.name as modifier_name');
|
||||
$query->leftJoin('#__users AS u2 ON u2.id = a.modified_by');
|
||||
|
||||
// Add the where clause
|
||||
$where = $this->_buildContentWhere($query);
|
||||
if ($where) {
|
||||
$query->where($where);
|
||||
}
|
||||
|
||||
// Add the order-by clause
|
||||
$order_by = $this->_buildContentOrderBy();
|
||||
if ($order_by) {
|
||||
$query->order($db->escape($order_by));
|
||||
}
|
||||
|
||||
return $query;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Method to build the where clause of the query for the Items
|
||||
*
|
||||
* @access private
|
||||
* @return string
|
||||
* @since 1.0
|
||||
*/
|
||||
private function _buildContentWhere($query)
|
||||
{
|
||||
$where = Array();
|
||||
|
||||
// Set up the search
|
||||
$search = $this->getState('filter.search');
|
||||
|
||||
if ( $search ) {
|
||||
if ( ($search != '') && is_numeric($search) ) {
|
||||
$where[] = 'a.id = ' . (int) $search . '';
|
||||
}
|
||||
else {
|
||||
$db = $this->getDBO();
|
||||
$where[] = '(LOWER( a.filename ) LIKE ' .
|
||||
$db->quote( '%'.$db->escape( $search, true ).'%', false ) .
|
||||
' OR LOWER( a.description ) LIKE ' .
|
||||
$db->quote( '%'.$db->escape( $search, true ).'%', false ) .
|
||||
' OR LOWER( a.display_name ) LIKE ' .
|
||||
$db->quote( '%'.$db->escape( $search, true ).'%', false ) . ')';
|
||||
}
|
||||
}
|
||||
|
||||
// Get the entity filter info
|
||||
$filter_entity = $this->getState('filter.entity');
|
||||
if ( $filter_entity != 'ALL' ) {
|
||||
$where[] = "a.parent_entity = '$filter_entity'";
|
||||
}
|
||||
|
||||
// Get the parent_state filter
|
||||
jimport('joomla.application.component.helper');
|
||||
$params = JComponentHelper::getParams('com_attachments');
|
||||
|
||||
// Get the desired state
|
||||
$filter_parent_state_default = 'ALL';
|
||||
$suppress_obsolete_attachments = $params->get('suppress_obsolete_attachments', false);
|
||||
if ( $suppress_obsolete_attachments ) {
|
||||
$filter_parent_state_default = 'PUBLISHED';
|
||||
}
|
||||
$filter_parent_state = $this->getState('filter.parent_state', $filter_parent_state_default);
|
||||
if ( $filter_parent_state != 'ALL' ) {
|
||||
|
||||
$fps_wheres = array();
|
||||
|
||||
// Get the contributions for all the known content types
|
||||
JPluginHelper::importPlugin('attachments');
|
||||
$apm = getAttachmentsPluginManager();
|
||||
$known_parent_types = $apm->getInstalledParentTypes();
|
||||
foreach ($known_parent_types as $parent_type) {
|
||||
$parent = $apm->getAttachmentsPlugin($parent_type);
|
||||
$pwheres = $parent->getParentPublishedFilter($filter_parent_state, $filter_entity);
|
||||
foreach ($pwheres as $pw) {
|
||||
$fps_wheres[] = $pw;
|
||||
}
|
||||
}
|
||||
|
||||
if ( $filter_parent_state == 'NONE' ) {
|
||||
$basic = '';
|
||||
$fps_wheres = '( (a.parent_id = 0) OR (a.parent_id IS NULL) ' .
|
||||
(count($fps_wheres) ?
|
||||
' OR (' . implode(' AND ', $fps_wheres) . ')' : '') . ')';
|
||||
}
|
||||
else {
|
||||
$fps_wheres = (count($fps_wheres) ? '(' . implode(' OR ', $fps_wheres) . ')' : '');
|
||||
}
|
||||
|
||||
// Copy the new where clauses into our main list
|
||||
if ($fps_wheres) {
|
||||
$where[] = $fps_wheres;
|
||||
}
|
||||
}
|
||||
|
||||
// Make sure the user can only see the attachments they may access
|
||||
$user = JFactory::getUser();
|
||||
if ( !$user->authorise('core.admin') ) {
|
||||
$user_levels = implode(',', array_unique($user->getAuthorisedViewLevels()));
|
||||
$where[] = 'a.access in ('.$user_levels.')';
|
||||
}
|
||||
|
||||
// Construct the WHERE clause
|
||||
$where = (count($where) ? implode(' AND ', $where) : '');
|
||||
|
||||
return $where;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Method to build the orderby clause of the query for the Items
|
||||
*
|
||||
* @access private
|
||||
* @return string
|
||||
* @since 1.0
|
||||
*/
|
||||
private function _buildContentOrderBy()
|
||||
{
|
||||
// Get the ordering information
|
||||
$orderCol = $this->state->get('list.ordering');
|
||||
$orderDirn = $this->state->get('list.direction');
|
||||
|
||||
// Construct the ORDER BY clause
|
||||
$order_by = "a.parent_type, a.parent_entity, a.parent_id";
|
||||
if ( $orderCol ) {
|
||||
$order_by = "$orderCol $orderDirn, a.parent_entity, a.parent_id";
|
||||
}
|
||||
|
||||
return $order_by;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Method to auto-populate the model state.
|
||||
*
|
||||
* Note. Calling getState in this method will result in recursion.
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
protected function populateState($ordering = null, $direction = null)
|
||||
{
|
||||
// Initialise variables.
|
||||
$app = JFactory::getApplication('administrator');
|
||||
|
||||
// Set up the list limits (not sure why the base class version of this does not work)
|
||||
$value = $app->getUserStateFromRequest($this->context.'.list.limit', 'limit', $app->getCfg('list_limit'), 'uint');
|
||||
$limit = $value;
|
||||
$this->setState('list.limit', $limit);
|
||||
|
||||
$value = $app->getUserStateFromRequest($this->context.'.limitstart', 'limitstart', 0, 'uint');
|
||||
$limitstart = ($limit != 0 ? (floor($value / $limit) * $limit) : 0);
|
||||
$this->setState('list.start', $limitstart);
|
||||
|
||||
// Load the filter state.
|
||||
$search = $this->getUserStateFromRequest($this->context.'.filter.search', 'filter_search', null, 'string');
|
||||
$this->setState('filter.search', $search);
|
||||
|
||||
$entity = $this->getUserStateFromRequest($this->context.'.filter.entity', 'filter_entity', 'ALL', 'word');
|
||||
$this->setState('filter.entity', $entity);
|
||||
|
||||
$parent_state = $this->getUserStateFromRequest($this->context.'.filter.parent_state', 'filter_parent_state', null, 'string');
|
||||
$this->setState('filter.parent_state', $parent_state);
|
||||
|
||||
$state = $this->getUserStateFromRequest($this->context.'.filter.state', 'filter_state', '', 'string');
|
||||
$this->setState('filter.state', $state);
|
||||
|
||||
// Check if the ordering field is in the white list, otherwise use the incoming value.
|
||||
$value = $app->getUserStateFromRequest($this->context.'.ordercol', 'filter_order', $ordering, 'string');
|
||||
if (!in_array($value, $this->filter_fields)) {
|
||||
$value = $ordering;
|
||||
$app->setUserState($this->context.'.ordercol', $value);
|
||||
}
|
||||
$this->setState('list.ordering', $value);
|
||||
|
||||
// Check if the ordering direction is valid, otherwise use the incoming value.
|
||||
$value = $app->getUserStateFromRequest($this->context.'.orderdirn', 'filter_order_Dir', $direction, 'cmd');
|
||||
if (!in_array(strtoupper($value), array('ASC', 'DESC', ''))) {
|
||||
$value = $direction;
|
||||
$app->setUserState($this->context.'.orderdirn', $value);
|
||||
}
|
||||
$this->setState('list.direction', $value);
|
||||
|
||||
// Load the parameters.
|
||||
$params = JComponentHelper::getParams('com_attachments');
|
||||
$this->setState('params', $params);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Method to get an array of data items.
|
||||
*
|
||||
* @return mixed An array of data items on success, false on failure.
|
||||
* @since 1.6
|
||||
*/
|
||||
public function getItems()
|
||||
{
|
||||
$items = parent::getItems();
|
||||
if ( $items === false )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
$good_items = Array();
|
||||
|
||||
// Update the attachments with information about thier parents
|
||||
JPluginHelper::importPlugin('attachments');
|
||||
$apm = getAttachmentsPluginManager();
|
||||
foreach ($items as $item) {
|
||||
$parent_id = $item->parent_id;
|
||||
$parent_type = $item->parent_type;
|
||||
$parent_entity = $item->parent_entity;
|
||||
if ( !$apm->attachmentsPluginInstalled($parent_type) ) {
|
||||
$errmsg = JText::sprintf('ATTACH_ERROR_INVALID_PARENT_TYPE_S',
|
||||
$parent_type . ':' . $parent_entity .
|
||||
' (ID ' .(string)$item->id . ')') . ' (ERR 115)';
|
||||
$app = JFactory::getApplication();
|
||||
$app->enqueueMessage($errmsg, 'warning');
|
||||
continue;
|
||||
}
|
||||
$parent = $apm->getAttachmentsPlugin($parent_type);
|
||||
|
||||
if ( $parent ) {
|
||||
|
||||
// Handle the normal case
|
||||
$item->parent_entity_type = JText::_('ATTACH_' . $parent_entity);
|
||||
$title = $parent->getTitle($parent_id, $parent_entity);
|
||||
$item->parent_exists = $parent->parentExists($parent_id, $parent_entity);
|
||||
if ( $item->parent_exists && $title ) {
|
||||
$item->parent_title = $title;
|
||||
$item->parent_url =
|
||||
JFilterOutput::ampReplace( $parent->getEntityViewURL($parent_id, $parent_entity) );
|
||||
}
|
||||
else {
|
||||
$item->parent_title = JText::sprintf('ATTACH_NO_PARENT_S', $item->parent_entity_type);
|
||||
$item->parent_url = '';
|
||||
}
|
||||
}
|
||||
|
||||
else {
|
||||
// Handle pathalogical case where there is no parent handler
|
||||
// (eg, deleted component)
|
||||
$item->parent_exists = false;
|
||||
$item->parent_entity_type = $parent_entity;
|
||||
$item->parent_title = JText::_('ATTACH_UNKNOWN');
|
||||
$item->parent_published = false;
|
||||
$item->parent_archived = false;
|
||||
$item->parent_url = '';
|
||||
}
|
||||
|
||||
$good_items[] = $item;
|
||||
}
|
||||
|
||||
// Return from the cache
|
||||
return $good_items;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns a reference to the a Table object, always creating it.
|
||||
*
|
||||
* @param type The table type to instantiate
|
||||
* @param string A prefix for the table class name. Optional.
|
||||
* @param array Configuration array for model. Optional.
|
||||
* @return JTable A database object
|
||||
* @since 1.6
|
||||
*/
|
||||
public function getTable($type = 'Attachment', $prefix = 'AttachmentsTable', $config = array())
|
||||
{
|
||||
return JTable::getInstance($type, $prefix, $config);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Publish attachment(s)
|
||||
*
|
||||
* Applied to any selected attachments
|
||||
*/
|
||||
public function publish($cid, $value)
|
||||
{
|
||||
// Get the ids and make sure they are integers
|
||||
$attachmentTable = $this->getTable();
|
||||
$attachmentTable = JTable::getInstance('Attachment', 'AttachmentsTable');
|
||||
|
||||
return $attachmentTable->publish($cid, $value);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,163 @@
|
||||
<?php
|
||||
/**
|
||||
* Attachments component attachments model
|
||||
*
|
||||
* @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
|
||||
*/
|
||||
|
||||
defined('JPATH_BASE') or die;
|
||||
|
||||
jimport('joomla.html.html');
|
||||
jimport('joomla.form.formfield');
|
||||
|
||||
/** Load the Attachements defines */
|
||||
require_once(JPATH_SITE.'/components/com_attachments/defines.php');
|
||||
|
||||
/**
|
||||
* Form Field class list of access levels the user has access to
|
||||
*
|
||||
* @package Attachments
|
||||
* @subpackage Attachments_Component
|
||||
*/
|
||||
class JFormFieldAccessLevels extends JFormField
|
||||
{
|
||||
/**
|
||||
* The form field type.
|
||||
*
|
||||
* @var string
|
||||
* @since 1.6
|
||||
*/
|
||||
public $type = 'AccessLevels';
|
||||
|
||||
|
||||
/**
|
||||
* Method to get the field input markup.
|
||||
*
|
||||
* TODO: Add access check.
|
||||
*
|
||||
* @return string The field input markup.
|
||||
* @since 1.6
|
||||
*/
|
||||
protected function getInput()
|
||||
{
|
||||
$options = new JObject();
|
||||
$options->element = $this->element;
|
||||
$options->multiple = $this->multiple;
|
||||
$options->always_public = $this->fieldname == 'show_guest_access_levels';
|
||||
return $this->getAccessLevels($this->name, 'jform_'.$this->fieldname, $this->value, $options);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get the access levels HTML selector
|
||||
*
|
||||
* @param string $for_id the id for the select input
|
||||
* @param string $fieldname the name of the field
|
||||
* @param int $level_value the value of the level(s) to be initially selected
|
||||
*/
|
||||
public static function getAccessLevels($for_id, $fieldname, $level_value=null, $options=null)
|
||||
{
|
||||
$user = JFactory::getUser();
|
||||
$user_access_levels = array_unique($user->getAuthorisedViewLevels());
|
||||
|
||||
$db = JFactory::getDbo();
|
||||
$query = $db->getQuery(true);
|
||||
|
||||
// Get the access levels this user is permitted
|
||||
$query->select('a.*');
|
||||
$query->from('#__viewlevels AS a');
|
||||
if ( !$user->authorise('core.admin') ) {
|
||||
// Users that are not super-users can ONLY see the the view levels that they are authorized for
|
||||
$query->where('a.id in ('.implode(',', $user_access_levels).')');
|
||||
}
|
||||
$query->order('a.ordering ASC');
|
||||
$query->order($query->qn('title') . ' ASC');
|
||||
$db->setQuery($query);
|
||||
$levels = $db->loadObjectList();
|
||||
if ( $db->getErrorNum() ) {
|
||||
$errmsg = $db->stderr() . ' (ERR 116)';
|
||||
JError::raiseError(500, $errmsg);
|
||||
}
|
||||
|
||||
// Make sure there is a $level_value
|
||||
if ( $level_value === null ) {
|
||||
jimport('joomla.application.component.helper');
|
||||
$params = JComponentHelper::getParams('com_attachments');
|
||||
$level_value = $params->get('default_access_level', AttachmentsDefines::$DEFAULT_ACCESS_LEVEL_ID);
|
||||
}
|
||||
|
||||
// Make sure the $level_value is in an array
|
||||
if (!is_array($level_value)) {
|
||||
$level_value = Array($level_value);
|
||||
}
|
||||
|
||||
// Make sure the $level_value is in the user's authorised levels (except for super-user)
|
||||
if ( !$user->authorise('core.admin') ) {
|
||||
|
||||
// Filter out any non-permitted access levels
|
||||
$ok_access_levels = Array();
|
||||
foreach ($level_value as $lval) {
|
||||
if (in_array($lval, $user_access_levels)) {
|
||||
$ok_access_levels[] = $lval;
|
||||
}
|
||||
}
|
||||
|
||||
// Make sure there is at least one access level left
|
||||
if (empty($ok_access_levels)) {
|
||||
// pick one arbitrarily
|
||||
$sorted_access_levels = sort($user_access_levels, SORT_NUMERIC);
|
||||
$level_value = Array($sorted_access_levels[0]);
|
||||
}
|
||||
else {
|
||||
$level_value = $ok_access_levels;
|
||||
}
|
||||
}
|
||||
|
||||
// Deal with multiple vs non-multiple selections
|
||||
if (isset($options->multiple) and $options->multiple) {
|
||||
|
||||
// Make sure Public is always selected, if desired
|
||||
$public = AttachmentsDefines::$PUBLIC_ACCESS_LEVEL_ID;
|
||||
if ($options->always_public) {
|
||||
if ( !in_array($public, $level_value) ) {
|
||||
array_unshift($level_value, $public);
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (count($level_value) > 1) {
|
||||
// If not multiple, only one selection is allowed, arbitrarily pick the first one
|
||||
// (Not sure this will ever be necessary)
|
||||
$level_value = Array($level_value[0]);
|
||||
}
|
||||
}
|
||||
|
||||
// Construct the attributes for the list
|
||||
$attr = '';
|
||||
if ( $options === null ) {
|
||||
$attr = 'class="inputbox" size="1"';
|
||||
}
|
||||
else {
|
||||
$attr .= $options->element['class'] ? ' class="' . (string) $options->element['class'] . '"' : '';
|
||||
$attr .= ((string) $options->element['disabled'] == 'true') ? ' disabled="disabled"' : '';
|
||||
$attr .= $options->element['size'] ? ' size="' . (int) $options->element['size'] . '"' : '';
|
||||
$attr .= $options->multiple ? ' multiple="multiple"' : '';
|
||||
}
|
||||
|
||||
// Construct the list
|
||||
$level_options = Array();
|
||||
foreach ( $levels as $level ) {
|
||||
// NOTE: We do not translate the access level titles
|
||||
$level_options[] = JHtml::_('select.option', $level->id, $level->title);
|
||||
}
|
||||
return JHtml::_('select.genericlist', $level_options, $for_id,
|
||||
$attr, 'value', 'text', $level_value, $fieldname
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,69 @@
|
||||
<?php
|
||||
/**
|
||||
* Attachments component icon filenames selector
|
||||
*
|
||||
* @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
|
||||
*/
|
||||
|
||||
defined('JPATH_BASE') or die;
|
||||
|
||||
jimport('joomla.html.html');
|
||||
jimport('joomla.form.formfield');
|
||||
|
||||
/**
|
||||
* Supports an HTML select list of icon filenames
|
||||
*
|
||||
* @package Attachments
|
||||
*/
|
||||
class JFormFieldIconfilenames extends JFormField
|
||||
{
|
||||
/**
|
||||
* The form field type.
|
||||
*
|
||||
* @var string
|
||||
* @since 1.6
|
||||
*/
|
||||
protected $type = 'Iconfilenames';
|
||||
|
||||
/**
|
||||
* Method to get the field input markup.
|
||||
*
|
||||
* @return string The field input markup.
|
||||
* @since 1.6
|
||||
*/
|
||||
public function getInput()
|
||||
{
|
||||
// Initialize variables.
|
||||
$html = array();
|
||||
|
||||
// Construct the list of legal icon filenames
|
||||
$icon_filenames = array();
|
||||
require_once(JPATH_COMPONENT_SITE.'/file_types.php');
|
||||
foreach ( AttachmentsFileTypes::unique_icon_filenames() as $ifname) {
|
||||
$icon_filenames[] = JHtml::_('select.option', $ifname);
|
||||
}
|
||||
$icon_list = JHtml::_('select.genericlist', $icon_filenames, 'jform[icon_filename]',
|
||||
'class="inputbox" size="1"', 'value', 'text', $this->value,
|
||||
'jform_icon_filename'
|
||||
);
|
||||
|
||||
// Is it readonly?
|
||||
if ((string) $this->element['readonly'] == 'true') {
|
||||
// Create a read-only list (no name) with a hidden input to store the value.
|
||||
$html[] = $icon_list;
|
||||
$html[] = '<input type="hidden" name="'.$this->name.'" value="'.$this->value.'"/>';
|
||||
}
|
||||
else {
|
||||
// Create a regular list.
|
||||
$html[] = $icon_list;
|
||||
}
|
||||
|
||||
return implode($html);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
@ -0,0 +1,110 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<form>
|
||||
<fieldset>
|
||||
<field name="id" type="text" default="0"
|
||||
label="ATTACH_ATTACHMENT_ID" description="ATTACH_ATTACHMENT_ID_DESCRIPTION"
|
||||
readonly="true" class="readonly"
|
||||
/>
|
||||
<field name="state" type="radio" default="0"
|
||||
label="JPUBLISHED" description="" >
|
||||
<option value="0">JNO</option>
|
||||
<option value="1">JYES</option>
|
||||
</field>
|
||||
<field name="parent_type" type="text"
|
||||
label="ATTACH_PARENT_TYPE" description="ATTACH_PARENT_TYPE_DESCRIPTION"
|
||||
readonly="true" class="readonly"
|
||||
/>
|
||||
<field name="parent_entity" type="text"
|
||||
label="ATTACH_PARENT_ENTITY" description="ATTACH_PARENT_ENTITY_DESCRIPTION"
|
||||
readonly="true" class="readonly"
|
||||
/>
|
||||
<field name="parent_id" type="text"
|
||||
label="ATTACH_PARENT_ID" description="ATTACH_PARENT_ID_DESCRIPTION"
|
||||
readonly="true" class="readonly"
|
||||
/>
|
||||
<field name="filename" type="file"
|
||||
label="ATTACH_FILENAME" description="ATTACH_FILENAME_DESCRIPTION"
|
||||
/>
|
||||
<field name="filename_sys" type="text"
|
||||
label="ATTACH_SYSTEM_FILENAME" description="ATTACH_SYSTEM_FILENAME_DESCRIPTION"
|
||||
readonly="true" class="readonly"
|
||||
/>
|
||||
<field name="file_type" type="text"
|
||||
label="ATTACH_FILE_TYPE" description="ATTACH_FILE_TYPE_DESCRIPTION"
|
||||
readonly="true" class="readonly"
|
||||
size="70"
|
||||
/>
|
||||
<field name="file_size" type="text"
|
||||
label="ATTACH_FILE_SIZE_KB" description=""
|
||||
readonly="true" class="readonly"
|
||||
/>
|
||||
<field name="icon_filename" type="Iconfilenames"
|
||||
label="ATTACH_ICON_FILENAME" description="ATTACH_ICON_FILENAME_DESCRIPTION"
|
||||
/>
|
||||
<field name="uri_type" type="text"
|
||||
label="ATTACH_ATTACHMENT_TYPE" description=""
|
||||
readonly="true" class="readonly"
|
||||
size="10"
|
||||
/>
|
||||
<field name="url" type="text"
|
||||
readonly="true" class="readonly"
|
||||
label="ATTACH_URL" description="ATTACH_URL_DESCRIPTION"
|
||||
size="70"
|
||||
/>
|
||||
<field name="url_valid" type="radio"
|
||||
label="ATTACH_URL_IS_VALID" description="ATTACH_URL_IS_VALID_TOOLTIP"
|
||||
default="1" >
|
||||
<option value="0">JNO</option>
|
||||
<option value="1">JYES</option>
|
||||
</field>
|
||||
<field name="url_relative" type="radio"
|
||||
label="ATTACH_RELATIVE_URL" description="ATTACH_RELATIVE_URL_TOOLTIP"
|
||||
default="0" >
|
||||
<option value="0">JNO</option>
|
||||
<option value="1">JYES</option>
|
||||
</field>
|
||||
<field name="display_name" type="text" class="inputbox"
|
||||
label="ATTACH_DISPLAY_NAME" description="ATTACH_DISPLAY_NAME_DESCRIPTION"
|
||||
size="80" maxlength="255"
|
||||
default=""
|
||||
/>
|
||||
<field name="user_field_1" type="text" class="inputbox"
|
||||
label="ATTACH_USER_DEFINED_FIELD_1" description=""
|
||||
size="80" maxlength="100"
|
||||
default=""
|
||||
/>
|
||||
<field name="user_field_2" type="text" class="inputbox"
|
||||
label="ATTACH_USER_DEFINED_FIELD_2" description=""
|
||||
size="80" maxlength="100"
|
||||
default=""
|
||||
/>
|
||||
<field name="user_field_3" type="text" class="inputbox"
|
||||
label="ATTACH_USER_DEFINED_FIELD_3" description=""
|
||||
size="80" maxlength="100"
|
||||
default=""
|
||||
/>
|
||||
<field name="description" type="text" class="inputbox"
|
||||
label="ATTACH_DESCRIPTION" description="ATTACH_DESCRIPTION_DESCRIPTION"
|
||||
size="80" maxlength="255"
|
||||
default=""
|
||||
/>
|
||||
<field name="created" type="Date"
|
||||
label="ATTACH_DATE_CREATED" description=""
|
||||
readonly="true" class="readonly"
|
||||
/>
|
||||
<field name="modified" type="Date"
|
||||
label="ATTACH_LAST_MODIFIED" description=""
|
||||
readonly="true" class="readonly"
|
||||
/>
|
||||
<field name="download_count" type="text"
|
||||
label="ATTACH_NUMBER_OF_DOWNLOADS" description="ATTACH_NUMBER_OF_DOWNLOADS_TOOLTIP"
|
||||
readonly="true" class="readonly"
|
||||
size="10"
|
||||
/>
|
||||
<field name="created_by" type="text"
|
||||
label="ATTACH_CREATOR_ID" description=""
|
||||
readonly="true" class="readonly"
|
||||
size="10"
|
||||
/>
|
||||
</fieldset>
|
||||
</form>
|
||||
@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
159
administrator/components/com_attachments/permissions.php
Normal file
159
administrator/components/com_attachments/permissions.php
Normal file
@ -0,0 +1,159 @@
|
||||
<?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
|
||||
*/
|
||||
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
|
||||
/**
|
||||
* A class for attachments permissions functions
|
||||
*
|
||||
* @package Attachments
|
||||
*/
|
||||
class AttachmentsPermissions
|
||||
{
|
||||
|
||||
/**
|
||||
* Get the actions
|
||||
*
|
||||
* @return an array of which actions are permitted for this user
|
||||
*/
|
||||
public static function getActions($user_id = null)
|
||||
{
|
||||
$user = JFactory::getUser($user_id);
|
||||
$result = new JObject;
|
||||
|
||||
$assetName = 'com_attachments';
|
||||
|
||||
$actions = array( 'core.admin',
|
||||
'core.manage',
|
||||
'core.create',
|
||||
'core.delete',
|
||||
'core.edit',
|
||||
'core.edit.state',
|
||||
'core.edit.own',
|
||||
'attachments.edit.state.own',
|
||||
'attachments.delete.own',
|
||||
'attachments.edit.state.ownparent',
|
||||
'attachments.delete.ownparent'
|
||||
);
|
||||
|
||||
foreach ($actions as $action) {
|
||||
$result->set($action, $user->authorise($action, $assetName));
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Determine if a user can edit a specified category
|
||||
*
|
||||
* Partially based on allowEdit() in com_categories/controllers/category.php
|
||||
*
|
||||
* @param integer $category_id the ID for the category to be tested
|
||||
* @param integer $id The id of the user to load (defaults to null)
|
||||
*/
|
||||
public static function userMayEditCategory($category_id, $user_id = null)
|
||||
{
|
||||
$user = JFactory::getUser($user_id);
|
||||
|
||||
// Check general edit permission first.
|
||||
if ($user->authorise('core.edit', 'com_content')) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Check specific edit permission.
|
||||
if ($user->authorise('core.edit', 'com_content.category.'.$category_id)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// No general permissions, see if 'edit own' is permitted for this category
|
||||
if ( $user->authorise('core.edit.own', 'com_content') ||
|
||||
$user->authorise('core.edit.own', 'com_content.category.'.$category_id) ) {
|
||||
|
||||
// Yes user can 'edit.own', Find out if the user created the category
|
||||
$db = JFactory::getDBO();
|
||||
$query = $db->getQuery(true);
|
||||
$query->select('id')->from('#__categories');
|
||||
$query->where('id = '.(int)$category_id.' AND created_user_id = '.(int)$user->id);
|
||||
$db->setQuery($query, 0, 1);
|
||||
$results = $db->loadObject();
|
||||
if ($db->getErrorNum()) {
|
||||
$errmsg = JText::_('ATTACH_ERROR_CHECKING_CATEGORY_OWNERSHIP') . ' (ERR 106)';
|
||||
JError::raiseError(500, $errmsg);
|
||||
}
|
||||
|
||||
if ( !empty($results) ) {
|
||||
// The user did actually create the category
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Determine if a user can edit a specified article
|
||||
*
|
||||
* Partially based on allowEdit() in com_content/controllers/article.php
|
||||
*
|
||||
* @param integer $article_id the ID for the article to be tested
|
||||
* @param integer $id The id of the user to load (defaults to null)
|
||||
*/
|
||||
public static function userMayEditArticle($article_id, $user_id = null)
|
||||
{
|
||||
$user = JFactory::getUser($user_id);
|
||||
|
||||
// Check general edit permission first.
|
||||
if ($user->authorise('core.edit', 'com_content')) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Check specific edit permission.
|
||||
if ($user->authorise('core.edit', 'com_content.article.'.$article_id)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Check for article being created.
|
||||
// NOTE: we must presume that the article is being created by this user!
|
||||
if ( ((int)$article_id == 0) && $user->authorise('core.edit.own', 'com_content') ) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// No general permissions, see if 'edit own' is permitted for this article
|
||||
if ( $user->authorise('core.edit.own', 'com_content') ||
|
||||
$user->authorise('core.edit.own', 'com_content.article.'.$article_id) ) {
|
||||
|
||||
// Yes user can 'edit.own', Find out if the user created the article
|
||||
$db = JFactory::getDBO();
|
||||
$query = $db->getQuery(true);
|
||||
$query->select('id')->from('#__content');
|
||||
$query->where('id = '.(int)$article_id.' AND created_by = '.(int)$user->id);
|
||||
$db->setQuery($query, 0, 1);
|
||||
$results = $db->loadObject();
|
||||
if ($db->getErrorNum()) {
|
||||
$errmsg = JText::_('ATTACH_ERROR_CHECKING_ARTICLE_OWNERSHIP') . ' (ERR 107)';
|
||||
JError::raiseError(500, $errmsg);
|
||||
}
|
||||
|
||||
if ( !empty($results) ) {
|
||||
// The user did actually create the article
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
4
administrator/components/com_attachments/sql/index.html
Normal file
4
administrator/components/com_attachments/sql/index.html
Normal file
@ -0,0 +1,4 @@
|
||||
<html>
|
||||
<body>
|
||||
</body>
|
||||
</html>
|
||||
@ -0,0 +1,32 @@
|
||||
CREATE TABLE IF NOT EXISTS `#__attachments`
|
||||
(
|
||||
`id` INT(11) NOT NULL AUTO_INCREMENT,
|
||||
`filename` VARCHAR(256) NOT NULL,
|
||||
`filename_sys` VARCHAR(512) NOT NULL,
|
||||
`file_type` VARCHAR(128) NOT NULL,
|
||||
`file_size` INT(11) UNSIGNED NOT NULL,
|
||||
`url` VARCHAR(1024) NOT NULL DEFAULT '',
|
||||
`uri_type` ENUM('file', 'url') DEFAULT 'file',
|
||||
`url_valid` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0',
|
||||
`url_relative` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0',
|
||||
`url_verify` TINYINT(1) UNSIGNED NOT NULL DEFAULT '1',
|
||||
`display_name` VARCHAR(80) NOT NULL DEFAULT '',
|
||||
`description` VARCHAR(255) NOT NULL DEFAULT '',
|
||||
`icon_filename` VARCHAR(20) NOT NULL,
|
||||
`access` INT(11) NOT NULL DEFAULT '1',
|
||||
`state` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0',
|
||||
`user_field_1` VARCHAR(255) NOT NULL DEFAULT '',
|
||||
`user_field_2` VARCHAR(255) NOT NULL DEFAULT '',
|
||||
`user_field_3` VARCHAR(255) NOT NULL DEFAULT '',
|
||||
`parent_type` VARCHAR(100) NOT NULL DEFAULT 'com_content',
|
||||
`parent_entity` VARCHAR(100) NOT NULL DEFAULT 'article',
|
||||
`parent_id` INT(11) UNSIGNED DEFAULT NULL,
|
||||
`created` DATETIME DEFAULT NULL,
|
||||
`created_by` INT(11) NOT NULL,
|
||||
`modified` DATETIME DEFAULT NULL,
|
||||
`modified_by` INT(11) NOT NULL,
|
||||
`download_count` INT(11) UNSIGNED DEFAULT '0',
|
||||
|
||||
PRIMARY KEY (`id`)
|
||||
|
||||
) DEFAULT CHARSET=utf8;
|
||||
@ -0,0 +1 @@
|
||||
DROP TABLE `#__attachments`;
|
||||
@ -0,0 +1,4 @@
|
||||
<html>
|
||||
<body>
|
||||
</body>
|
||||
</html>
|
||||
@ -0,0 +1 @@
|
||||
# Dummy file to initialize sequence
|
||||
@ -0,0 +1,2 @@
|
||||
ALTER TABLE `#__attachments` MODIFY `filename` VARCHAR(256) NOT NULL;
|
||||
ALTER TABLE `#__attachments` MODIFY `filename_sys` VARCHAR(512) NOT NULL;
|
||||
@ -0,0 +1 @@
|
||||
ALTER TABLE `#__attachments` ADD COLUMN `url_verify` TINYINT(1) UNSIGNED NOT NULL DEFAULT '1' AFTER `url_relative`;
|
||||
@ -0,0 +1 @@
|
||||
# Dummy file to initialize sequence
|
||||
@ -0,0 +1,4 @@
|
||||
<html>
|
||||
<body>
|
||||
</body>
|
||||
</html>
|
||||
205
administrator/components/com_attachments/tables/attachment.php
Normal file
205
administrator/components/com_attachments/tables/attachment.php
Normal file
@ -0,0 +1,205 @@
|
||||
<?php
|
||||
/**
|
||||
* Attachments component attachment table
|
||||
*
|
||||
* @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');
|
||||
|
||||
// import Joomla table library
|
||||
jimport('joomla.database.table');
|
||||
|
||||
/** Load the Attachments helper */
|
||||
require_once(JPATH_SITE.'/components/com_attachments/helper.php');
|
||||
|
||||
|
||||
/**
|
||||
* Attachments table class
|
||||
*
|
||||
* @package Attachments
|
||||
*/
|
||||
class AttachmentsTableAttachment extends JTable
|
||||
{
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param object Database connector object
|
||||
*/
|
||||
public function __construct(&$db)
|
||||
{
|
||||
parent::__construct('#__attachments', 'id', $db);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Method to set the publishing state for a row or list of rows in the database
|
||||
* table. The method respects checked out rows by other users and will attempt
|
||||
* to checkin rows that it can after adjustments are made.
|
||||
*
|
||||
* @param mixed An optional array of primary key values to update. If not
|
||||
* set the instance property value is used.
|
||||
* @param integer The publishing state. eg. [0 = unpublished, 1 = published]
|
||||
* @param integer The user id of the user performing the operation.
|
||||
* @return int Number of attachments published ( false if 0 )
|
||||
* @since 1.0.4
|
||||
* @link http://docs.joomla.org/JTable/publish
|
||||
*/
|
||||
public function publish($pks = null, $state = 1, $userId = 0)
|
||||
{
|
||||
// Initialise variables.
|
||||
$k = $this->_tbl_key;
|
||||
|
||||
// Sanitize input.
|
||||
JArrayHelper::toInteger($pks);
|
||||
$userId = (int) $userId;
|
||||
$state = (int) $state;
|
||||
|
||||
// If there are no primary keys set check to see if the instance key is set.
|
||||
if (empty($pks)) {
|
||||
if ($this->$k) {
|
||||
$pks = array($this->$k);
|
||||
}
|
||||
// Nothing to set publishing state on, return false.
|
||||
else {
|
||||
$e = new JException(JText::_('JLIB_DATABASE_ERROR_NO_ROWS_SELECTED'));
|
||||
$this->setError($e);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Get the article/parent handler
|
||||
JPluginHelper::importPlugin('attachments');
|
||||
$apm = getAttachmentsPluginManager();
|
||||
|
||||
// Remove any attachments that the user may not publish/unpublish
|
||||
$bad_ids = Array();
|
||||
foreach ($pks as $id)
|
||||
{
|
||||
// Get the info about this attachment
|
||||
$query = $this->_db->getQuery(true);
|
||||
$query->select('*')->from($this->_tbl);
|
||||
$query->where('id='.(int)$id);
|
||||
$this->_db->setQuery($query);
|
||||
$attachment = $this->_db->loadObject();
|
||||
if ( $this->_db->getErrorNum() ) {
|
||||
$errmsg = $db->stderr() . ' (ERR 108)';
|
||||
JError::raiseError(500, $errmsg);
|
||||
}
|
||||
|
||||
$parent_id = $attachment->parent_id;
|
||||
$parent_type = $attachment->parent_type;
|
||||
$parent_entity = $attachment->parent_entity;
|
||||
|
||||
if ( !$apm->attachmentsPluginInstalled($parent_type) ) {
|
||||
$errmsg = JText::sprintf('ATTACH_ERROR_INVALID_PARENT_TYPE_S', $parent_type) . ' (ERR 109)';
|
||||
JError::raiseError(500, $errmsg);
|
||||
}
|
||||
$parent = $apm->getAttachmentsPlugin($parent_type);
|
||||
|
||||
// If we may not change it's state, complain!
|
||||
if ( !$parent->userMayChangeAttachmentState($parent_id, $parent_entity,
|
||||
$attachment->created_by) )
|
||||
{
|
||||
// Note the bad ID
|
||||
$bad_ids[] = $id;
|
||||
|
||||
// If the user is not authorized, complain
|
||||
$app = JFactory::getApplication();
|
||||
$parent_entity = $parent->getCanonicalEntityId($parent_entity);
|
||||
$errmsg = JText::sprintf('ATTACH_ERROR_NO_PERMISSION_TO_PUBLISH_S_ATTACHMENT_S_ID_N',
|
||||
$parent_entity, $attachment->filename, $id) . ' (ERR 110)';
|
||||
$app->enqueueMessage($errmsg, 'error');
|
||||
}
|
||||
}
|
||||
|
||||
// Remove any offending attachments
|
||||
$pks = array_diff($pks, $bad_ids);
|
||||
|
||||
// Exit if there are no attachments the user can change the state of
|
||||
if ( empty($pks) )
|
||||
{
|
||||
// No warning needed because warnings already issued for attachments user cannot change
|
||||
return false;
|
||||
}
|
||||
|
||||
// Update the publishing state for rows with the given primary keys.
|
||||
$query = $this->_db->getQuery(true);
|
||||
$query->update($this->_tbl);
|
||||
$query->set('state = '.(int) $state);
|
||||
|
||||
// Determine if there is checkin support for the table.
|
||||
if (property_exists($this, 'checked_out') || property_exists($this, 'checked_out_time')) {
|
||||
$query->where('(checked_out = 0 OR checked_out = '.(int) $userId.')');
|
||||
$checkin = true;
|
||||
}
|
||||
else {
|
||||
$checkin = false;
|
||||
}
|
||||
|
||||
// Build the WHERE clause for the primary keys.
|
||||
$query->where($k.' = '.implode(' OR '.$k.' = ', $pks));
|
||||
|
||||
$this->_db->setQuery($query);
|
||||
|
||||
// Check for a database error.
|
||||
if (!$this->_db->query()) {
|
||||
$e = new JException(JText::sprintf('JLIB_DATABASE_ERROR_PUBLISH_FAILED',
|
||||
get_class($this), $this->_db->getErrorMsg()) . ' (ERR 111)');
|
||||
$this->setError($e);
|
||||
return false;
|
||||
}
|
||||
|
||||
// If checkin is supported and all rows were adjusted, check them in.
|
||||
if ($checkin && (count($pks) == $this->_db->getAffectedRows())) {
|
||||
// Checkin the rows.
|
||||
foreach($pks as $pk)
|
||||
{
|
||||
$this->checkin($pk);
|
||||
}
|
||||
}
|
||||
|
||||
// If the JTable instance value is in the list of primary keys that were set, set the instance.
|
||||
if (in_array($this->$k, $pks)) {
|
||||
$this->state = $state;
|
||||
}
|
||||
|
||||
$this->setError('');
|
||||
return count($pks);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Store the attachment into the database
|
||||
*
|
||||
* Extend base class function to encode description and display_name safely
|
||||
*
|
||||
* @param boolean $updateNulls True to update fields even if they are null.
|
||||
*
|
||||
* @return boolean True on success.
|
||||
*
|
||||
* @link http://docs.joomla.org/JTable/store
|
||||
*/
|
||||
public function store($updateNulls = false)
|
||||
{
|
||||
// make sure the display name and description are escaped since they may contain quotes
|
||||
$this->display_name = $this->_db->escape($this->display_name);
|
||||
$this->description = $this->_db->escape($this->description);
|
||||
|
||||
$this->user_field_1 = $this->_db->escape($this->user_field_1);
|
||||
$this->user_field_2 = $this->_db->escape($this->user_field_2);
|
||||
$this->user_field_3 = $this->_db->escape($this->user_field_3);
|
||||
|
||||
// Let the parent class do the real work!
|
||||
return parent::store($updateNulls);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
714
administrator/components/com_attachments/update.php
Normal file
714
administrator/components/com_attachments/update.php
Normal file
@ -0,0 +1,714 @@
|
||||
<?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
|
||||
*/
|
||||
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
// Access check.
|
||||
if (!JFactory::getUser()->authorise('core.admin', 'com_attachments')) {
|
||||
return JError::raiseError(404, JText::_('JERROR_ALERTNOAUTHOR') . ' (ERR 67)');
|
||||
}
|
||||
|
||||
/** Load the Attachments defines */
|
||||
require_once(JPATH_SITE.'/components/com_attachments/defines.php');
|
||||
|
||||
/**
|
||||
* A class for update functions
|
||||
*
|
||||
* @package Attachments
|
||||
*/
|
||||
class AttachmentsUpdate
|
||||
{
|
||||
/**
|
||||
* Add icon filenames for all attachments missing an icon
|
||||
*/
|
||||
public static function add_icon_filenames()
|
||||
{
|
||||
require_once(JPATH_COMPONENT_SITE.'/file_types.php');
|
||||
|
||||
// Get all the attachment IDs
|
||||
$db = JFactory::getDBO();
|
||||
$query = $db->getQuery(true);
|
||||
$query->select('id, filename, file_type, icon_filename')->from('#__attachments');
|
||||
$query->where('file_type IS NULL');
|
||||
$db->setQuery($query);
|
||||
$attachments = $db->loadObjectList();
|
||||
if ( $db->getErrorNum() ) {
|
||||
$errmsg = $db->stderr() . ' (ERR 68)';
|
||||
JError::raiseError(500, $errmsg);
|
||||
}
|
||||
if ( count($attachments) == 0 ) {
|
||||
return JText::_('ATTACH_NO_FILE_TYPE_FIELDS_NEED_UPDATING');
|
||||
}
|
||||
$IDs = array();
|
||||
foreach ($attachments as $attachment) {
|
||||
$IDs[] = $attachment->id;
|
||||
}
|
||||
|
||||
// Update the icon file_types all the attachments (that do not have one already)
|
||||
JTable::addIncludePath(JPATH_ADMINISTRATOR.'/components/com_attachments/tables');
|
||||
$attachment = JTable::getInstance('Attachment', 'AttachmentsTable');
|
||||
$numUpdated = 0;
|
||||
foreach ($IDs as $id) {
|
||||
|
||||
$attachment->load($id);
|
||||
|
||||
// Only update those attachment records that don't already have an icon_filename
|
||||
if ( JString::strlen( $attachment->icon_filename ) == 0 ) {
|
||||
$new_icon_filename = AttachmentsFileTypes::icon_filename($attachment->filename,
|
||||
$attachment->file_type);
|
||||
if ( JString::strlen( $new_icon_filename) > 0 ) {
|
||||
$attachment->icon_filename = $new_icon_filename;
|
||||
if (!$attachment->store()) {
|
||||
$errmsg = JText::sprintf('ATTACH_ERROR_ADDING_ICON_FILENAME_FOR_ATTACHMENT_S', $attachment->filename) .
|
||||
' ' . $attachment->getError() . ' (ERR 69)';
|
||||
JError::raiseError(500, $errsmg);
|
||||
}
|
||||
$numUpdated++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return JText::sprintf( 'ATTACH_ADDED_ICON_FILENAMES_TO_N_ATTACHMENTS', $numUpdated );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Update dates for all attachments with null dates
|
||||
*/
|
||||
public static function update_null_dates()
|
||||
{
|
||||
$app = JFactory::getApplication();
|
||||
|
||||
// Get all the attachment IDs
|
||||
$db = JFactory::getDBO();
|
||||
$query = $db->getQuery(true);
|
||||
$query->select('*')->from('#__attachments');
|
||||
$db->setQuery($query);
|
||||
$attachments = $db->loadObjectList();
|
||||
if ( $db->getErrorNum() ) {
|
||||
$errmsg = $db->stderr() . ' (ERR 70)';
|
||||
JError::raiseError(500, $errmsg);
|
||||
}
|
||||
if ( count($attachments) == 0 ) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Update the dates for all the attachments
|
||||
$numUpdated = 0;
|
||||
foreach ($attachments as $attachment) {
|
||||
|
||||
// Update the new create and update dates if they are null
|
||||
$updated = false;
|
||||
$created = $attachment->created;
|
||||
if ( is_null($created) || ($created == '') ) {
|
||||
$cdate = JFactory::getDate(filemtime($attachment->filename_sys));
|
||||
$created = $cdate->toSql();
|
||||
$updated = true;
|
||||
}
|
||||
$mod_date = $attachment->modified;
|
||||
if ( is_null($mod_date) || ($mod_date == '') ) {
|
||||
$mdate = JFactory::getDate(filemtime($attachment->filename_sys));
|
||||
$mod_date = $mdate->toSql();
|
||||
$updated = true;
|
||||
}
|
||||
|
||||
// Update the record
|
||||
if ( $updated ) {
|
||||
$query = $db->getQuery(true);
|
||||
$query->update('#__attachments');
|
||||
$query->set('modified=' . $db->quote($mod_date) . ', created=' . $db->quote($created));
|
||||
$query->where('id = ' . (int)$attachment->id);
|
||||
$db->setQuery($query);
|
||||
if (!$db->query()) {
|
||||
$errmsg = JText::sprintf('ATTACH_ERROR_UPDATING_NULL_DATE_FOR_ATTACHMENT_FILE_S',
|
||||
$attachment->filename);
|
||||
JError::raiseError(500, $errmsg . $db->stderr() . ' (ERR 71)');
|
||||
}
|
||||
$numUpdated++;
|
||||
}
|
||||
}
|
||||
|
||||
return $numUpdated;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Disable uninstallation of attachments when the Attachments component is
|
||||
* uninstalled.
|
||||
*
|
||||
* This is accomplished by modifying the uninstall.mysql.sql table to
|
||||
* comment out the line that deletes the attachments table. Note that
|
||||
* this only affects the table, not the attachments files.
|
||||
*/
|
||||
public static function disable_sql_uninstall($dbtype = 'mysql')
|
||||
{
|
||||
jimport('joomla.filesystem.file');
|
||||
|
||||
// Construct the filenames
|
||||
if ( $dbtype == 'mysqli' ) {
|
||||
// Use the same MYSQL installation file for mysqli
|
||||
$dbtype = 'mysql';
|
||||
}
|
||||
$filename = JPATH_COMPONENT_ADMINISTRATOR."/sql/uninstall.$dbtype.sql";
|
||||
$tempfilename = $filename.'.tmp';
|
||||
$msg = '';
|
||||
|
||||
// Read the content of the old version of the uninstall sql file
|
||||
$contents = JFile::read($filename);
|
||||
$lines = explode("\n", $contents);
|
||||
$new_lines = Array();
|
||||
for ($i=0; $i < count($lines); $i++) {
|
||||
$line = JString::trim($lines[$i]);
|
||||
if ( JString::strlen($line) != 0 ) {
|
||||
if ( $line[0] != '#' ) {
|
||||
$line = '# ' . $line;
|
||||
}
|
||||
$new_lines[] = $line;
|
||||
}
|
||||
}
|
||||
|
||||
// Overwrite the old file with a commented out version
|
||||
$new_contents = implode("\n", $new_lines) . "\n";
|
||||
JFile::write($tempfilename, $new_contents);
|
||||
if ( ! JFile::copy( $tempfilename, $filename) ) {
|
||||
$msg = JText::_('ATTACH_ERROR_UPDATING_FILE') . ": $filename!";
|
||||
}
|
||||
|
||||
// Let the user know what happened
|
||||
if ( $msg == '' ) {
|
||||
$msg = JText::_('ATTACH_DISABLED_UNINSTALLING_MYSQL_ATTACHMENTS_TABLE');
|
||||
}
|
||||
|
||||
return $msg;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Check an attachment filename and return relevant info
|
||||
*/
|
||||
private static function checkFilename($filename)
|
||||
{
|
||||
$finfo = new JObject();
|
||||
|
||||
// If it is a windows filename, convert to Linux format for analysis
|
||||
$winfile = false;
|
||||
$win_file_re = "|^(?P<drive>[a-zA-Z]{1}):(?P<filename>.*)$|";
|
||||
if ( preg_match($win_file_re, $filename, $match) ) {
|
||||
$winfile = true;
|
||||
$filename = str_replace("\\", '/', $match['drive'] . ':' . $match['filename']);
|
||||
}
|
||||
$finfo->winfile = $winfile;
|
||||
|
||||
// Split the file into parts
|
||||
$parts = explode('/', $filename);
|
||||
$finfo->parts = $parts;
|
||||
|
||||
// See if it is old-style (pre Attachments 2.0)
|
||||
$finfo->oldstyle = false;
|
||||
$attachments_dir_name = 'attachments';
|
||||
if ( $parts[count($parts)-2] == $attachments_dir_name ) {
|
||||
$finfo->oldstyle = true;
|
||||
}
|
||||
|
||||
// Get the path info
|
||||
$pathinfo = pathinfo($filename);
|
||||
$finfo->basename = $pathinfo['basename'];
|
||||
$finfo->extension = $pathinfo['extension'];
|
||||
|
||||
// Construct the relative path for the current OS
|
||||
$start = array_search($attachments_dir_name, $parts);
|
||||
$relfile = '';
|
||||
for ($i = $start; $i < count($parts); $i++) {
|
||||
$relfile .= $parts[$i];
|
||||
if ( $i < count($parts) - 1 ) {
|
||||
$relfile .= '/';
|
||||
}
|
||||
}
|
||||
$finfo->relfile = $relfile;
|
||||
|
||||
// Construct the non-prefix version of the filename (if oldstyle)
|
||||
if ( $finfo->oldstyle ) {
|
||||
$finfo->prefix = false;
|
||||
if ( preg_match('|^[0-9]{3}_(?P<filename>.+\..+$)|', $finfo->basename, $match) ) {
|
||||
$finfo->prefix = true;
|
||||
$finfo->basename_no_prefix = $match['filename'];
|
||||
}
|
||||
}
|
||||
|
||||
return $finfo;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Regenerate the system filenames for all attachments.
|
||||
*
|
||||
* This function may need to run if the admin has moved the attachments
|
||||
* from one computer to another and the actual file paths need to be
|
||||
* updated.
|
||||
*/
|
||||
public static function regenerate_system_filenames()
|
||||
{
|
||||
require_once(JPATH_SITE.'/components/com_attachments/helper.php');
|
||||
|
||||
// Get the component parameters
|
||||
jimport('joomla.application.component.helper');
|
||||
$params = JComponentHelper::getParams('com_attachments');
|
||||
|
||||
// Define where the attachments go
|
||||
$upload_url = AttachmentsDefines::$ATTACHMENTS_SUBDIR;
|
||||
$upload_dir = JPATH_SITE . '/' . $upload_url;
|
||||
|
||||
// Get all the attachment IDs
|
||||
$db = JFactory::getDBO();
|
||||
$query = $db->getQuery(true);
|
||||
$query->select('id')->from('#__attachments')->where('uri_type=' . $db->quote('file'));
|
||||
$db->setQuery($query);
|
||||
$attachments = $db->loadObjectList();
|
||||
if ( $db->getErrorNum() ) {
|
||||
$errmsg = $db->stderr() . ' (ERR 72)';
|
||||
JError::raiseError(500, $errmsg);
|
||||
}
|
||||
if ( count($attachments) == 0 ) {
|
||||
return JText::_('ATTACH_NO_ATTACHMENTS_WITH_FILES');
|
||||
}
|
||||
$IDs = array();
|
||||
foreach ($attachments as $attachment) {
|
||||
$IDs[] = $attachment->id;
|
||||
}
|
||||
|
||||
// Get the parent plugin manager
|
||||
JPluginHelper::importPlugin('attachments');
|
||||
$apm = getAttachmentsPluginManager();
|
||||
|
||||
// Update the system filenames for all the attachments
|
||||
jimport('joomla.filesystem.file');
|
||||
jimport('joomla.filesystem.folder');
|
||||
|
||||
JTable::addIncludePath(JPATH_ADMINISTRATOR.'/components/com_attachments/tables');
|
||||
$attachment = JTable::getInstance('Attachment', 'AttachmentsTable');
|
||||
|
||||
$msg = '';
|
||||
|
||||
$numUpdated = 0;
|
||||
$numMissing = 0;
|
||||
foreach ($IDs as $id) {
|
||||
|
||||
$attachment->load($id);
|
||||
|
||||
// Get the actual parent id for this attachment
|
||||
// (Needed because orphaned parent_id is null, which the Table loads as 1)
|
||||
$query = $db->getQuery(true);
|
||||
$query->select('parent_id')->from('#__attachments')->where('id = ' . (int)$id);
|
||||
$db->setQuery($query, 0, 1);
|
||||
$parent_id = $db->loadResult();
|
||||
if ( $db->getErrorNum() ) {
|
||||
$errmsg = JText::sprintf('ATTACH_ERROR_INVALID_PARENT_S_ID_N',
|
||||
$attachment->parent_entity, $parent_id) . ' (ERR 73)';
|
||||
JError::raiseError(500, $errmsg);
|
||||
}
|
||||
|
||||
// Construct the updated system filename
|
||||
$old_filename_sys = $attachment->filename_sys;
|
||||
|
||||
// Get info about the system filename
|
||||
$finfo = AttachmentsUpdate::checkFilename($old_filename_sys);
|
||||
$basename = $finfo->basename;
|
||||
|
||||
// Reconstruct the current system filename (in case of migrations)
|
||||
$current_filename_sys = JPATH_SITE.'/'.$finfo->relfile;
|
||||
|
||||
// Get the parent object
|
||||
$parent = $apm->getAttachmentsPlugin($attachment->parent_type);
|
||||
|
||||
if ( !JFile::exists($current_filename_sys) ) {
|
||||
$msg .= JText::sprintf('ATTACH_ERROR_MISSING_ATTACHMENT_FILE_S',
|
||||
$current_filename_sys) . "<br/>";
|
||||
$numMissing++;
|
||||
}
|
||||
elseif ( !is_numeric($parent_id) ||
|
||||
!$parent->parentExists($attachment->parent_id, $attachment->parent_entity ) ) {
|
||||
$msg .= JText::sprintf('ATTACH_ERROR_MISSING_PARENT_FOR_ATTACHMENT_S',
|
||||
$current_filename_sys) . "<br/>";
|
||||
$numMissing++;
|
||||
}
|
||||
else {
|
||||
|
||||
// Construct the new system filename and url (based on entities, etc)
|
||||
$newdir = $parent->getAttachmentPath($attachment->parent_entity, $attachment->parent_id, null);
|
||||
$new_path = $upload_dir.'/'.$newdir;
|
||||
|
||||
if ( $finfo->oldstyle && $finfo->prefix ) {
|
||||
$new_filename_sys = $new_path . $finfo->basename_no_prefix;
|
||||
$attachment->filename = $finfo->basename_no_prefix;
|
||||
$new_url = str_replace(DIRECTORY_SEPARATOR, '/', $upload_url . '/' . $newdir . $finfo->basename_no_prefix);
|
||||
}
|
||||
else {
|
||||
$new_filename_sys = $new_path . $basename;
|
||||
$new_url = str_replace(DIRECTORY_SEPARATOR, '/', $upload_url . '/' . $newdir . $basename);
|
||||
}
|
||||
|
||||
|
||||
// If we are on windows, fix the filename and URL
|
||||
if ( DIRECTORY_SEPARATOR != '/' ) {
|
||||
$new_filename_sys = str_replace('/', DIRECTORY_SEPARATOR, $new_filename_sys);
|
||||
$new_url = str_replace(DIRECTORY_SEPARATOR, '/', $new_url);
|
||||
}
|
||||
|
||||
// Make sure the target directory exists
|
||||
if ( !JFile::exists($new_path) ) {
|
||||
if ( !JFolder::create($new_path) ) {
|
||||
$errmsg = JText::sprintf('ATTACH_ERROR_UNABLE_TO_SETUP_UPLOAD_DIR_S', $new_path) . ' (ERR 74)';
|
||||
JError::raiseError(500, $errmsg);
|
||||
}
|
||||
AttachmentsHelper::write_empty_index_html($new_path);
|
||||
}
|
||||
|
||||
// Move the file!
|
||||
if ( !JFile::move($current_filename_sys, $new_filename_sys) ) {
|
||||
$errmsg = JText::sprintf('ATTACH_ERROR_RENAMING_FILE_S_TO_S',
|
||||
$old_filename_sys, $new_filename_sys) . ' (ERR 75)';
|
||||
JError::raiseError(500, $errmsg);
|
||||
}
|
||||
|
||||
// Verify the new system filename exists!
|
||||
if ( !JFile::exists($new_filename_sys) ) {
|
||||
$errmsg = JText::sprintf('ATTACH_ERROR_NEW_SYSTEM_FILENAME_S_NOT_FOUND',
|
||||
$new_filename_sys) . ' (ERR 76)';
|
||||
JError::raiseError(500, $errmsg);
|
||||
}
|
||||
|
||||
// Update the record
|
||||
$attachment->filename_sys = $new_filename_sys;
|
||||
$attachment->url = $new_url;
|
||||
if (!$attachment->store()) {
|
||||
$errmsg = $attachment->getError() . ' (ERR 77)';
|
||||
JError::raiseError(500, $errmsg);
|
||||
}
|
||||
|
||||
$numUpdated++;
|
||||
}
|
||||
}
|
||||
|
||||
// Add warning if there are problem files
|
||||
if ( $numMissing > 0 ) {
|
||||
$msg = JText::sprintf('ATTACH_ERROR_N_FILES_MISSING', $numMissing) . "<br/>" . $msg . " <br/>";
|
||||
}
|
||||
|
||||
return $msg . JText::sprintf( 'ATTACH_REGENERATED_SYSTEM_FILENAMES_FOR_N_ATTACHMENTS',
|
||||
$numUpdated );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Remove spaces from the system filenames for all attachments
|
||||
*
|
||||
* The spaces are replaces with underscores '_'
|
||||
*/
|
||||
public static function remove_spaces_from_system_filenames()
|
||||
{
|
||||
// Get the component parameters
|
||||
jimport('joomla.application.component.helper');
|
||||
$params = JComponentHelper::getParams('com_attachments');
|
||||
|
||||
// Define where the attachments go
|
||||
$upload_dir = JPATH_SITE.'/'.AttachmentsDefines::$ATTACHMENTS_SUBDIR;
|
||||
|
||||
// Get all the attachment IDs
|
||||
$db = JFactory::getDBO();
|
||||
$query = $db->getQuery(true);
|
||||
$query->select('id')->from('#__attachments')->where('uri_type=' . $db->quote('file'));
|
||||
$db->setQuery($query);
|
||||
$attachments = $db->loadObjectList();
|
||||
if ( $db->getErrorNum() ) {
|
||||
$errmsg = $db->stderr() . ' (ERR 78)';
|
||||
JError::raiseError(500, $errmsg);
|
||||
}
|
||||
if ( count($attachments) == 0 ) {
|
||||
return JText::_('ATTACH_NO_ATTACHMENTS_WITH_FILES');
|
||||
}
|
||||
$IDs = array();
|
||||
foreach ($attachments as $attachment) {
|
||||
$IDs[] = $attachment->id;
|
||||
}
|
||||
|
||||
// Get ready to rename files
|
||||
jimport( 'joomla.filesystem.file' );
|
||||
|
||||
// Update the system filenames for all the attachments
|
||||
JTable::addIncludePath(JPATH_ADMINISTRATOR.'/components/com_attachments/tables');
|
||||
$attachment = JTable::getInstance('Attachment', 'AttachmentsTable');
|
||||
$numUpdated = 0;
|
||||
|
||||
foreach ($IDs as $id) {
|
||||
|
||||
$attachment->load($id);
|
||||
|
||||
// Make sure the file exists
|
||||
$old_filename_sys = $attachment->filename_sys;
|
||||
if ( !JFile::exists( $old_filename_sys ) ) {
|
||||
echo JText::sprintf('ATTACH_ERROR_FILE_S_NOT_FOUND_ON_SERVER', $old_filename_sys);
|
||||
exit();
|
||||
}
|
||||
|
||||
// Construct the new system filename
|
||||
$filename_info = pathinfo($old_filename_sys);
|
||||
$basename = $filename_info['basename'];
|
||||
$filename_sys = $upload_dir.'/'.$basename;
|
||||
$new_basename = str_replace(' ', '_', $basename);
|
||||
$new_filename_sys = $filename_info['dirname'].'/'.$new_basename;
|
||||
|
||||
// If the filename has not changed, do not change anything
|
||||
if ( $new_filename_sys == $old_filename_sys ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Rename the file
|
||||
if ( !JFile::move($old_filename_sys, $new_filename_sys) ) {
|
||||
echo JText::sprintf('ATTACH_ERROR_RENAMING_FILE_S_TO_S',
|
||||
$old_filename_sys, $new_filename_sys);
|
||||
exit();
|
||||
}
|
||||
|
||||
// Construct the new URL (figuire it out from the system filename)
|
||||
$attachments_dir = str_replace(JPATH_SITE, '', $filename_info['dirname']);
|
||||
$dirend_chars = DIRECTORY_SEPARATOR.'/';
|
||||
$attachments_dir = JString::trim($attachments_dir, $dirend_chars);
|
||||
$attachments_dir = str_replace(DIRECTORY_SEPARATOR, '/', $attachments_dir);
|
||||
$new_url = $attachments_dir . '/' . $new_basename;
|
||||
|
||||
// Update the record
|
||||
$attachment->filename_sys = $new_filename_sys;
|
||||
$attachment->filename = $new_basename;
|
||||
$attachment->url = $new_url;
|
||||
|
||||
if (!$attachment->store()) {
|
||||
$errmsg = $attachment->getError() . ' (ERR 79)';
|
||||
JError::raiseError(500, $errmsg);
|
||||
}
|
||||
|
||||
$numUpdated++;
|
||||
}
|
||||
|
||||
return JText::sprintf( 'ATTACH_UPDATED_N_ATTACHMENTS', $numUpdated );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Update the file sizes for all attachments (only applies to files)
|
||||
*/
|
||||
public static function update_file_sizes()
|
||||
{
|
||||
// Get the component parameters
|
||||
jimport('joomla.application.component.helper');
|
||||
$params = JComponentHelper::getParams('com_attachments');
|
||||
|
||||
// Define where the attachments go
|
||||
$upload_dir = JPATH_SITE.'/'.AttachmentsDefines::$ATTACHMENTS_SUBDIR;
|
||||
|
||||
// Get all the attachment IDs
|
||||
$db = JFactory::getDBO();
|
||||
$query = $db->getQuery(true);
|
||||
$query->select('id')->from('#__attachments')->where('uri_type=' . $db->quote('file'));
|
||||
$db->setQuery($query);
|
||||
$attachments = $db->loadObjectList();
|
||||
if ( $db->getErrorNum() ) {
|
||||
$errmsg = $db->stderr() . ' (ERR 80)';
|
||||
JError::raiseError(500, $errmsg);
|
||||
}
|
||||
if ( count($attachments) == 0 ) {
|
||||
return JText::_('ATTACH_NO_ATTACHMENTS_WITH_FILES');
|
||||
}
|
||||
$IDs = array();
|
||||
foreach ($attachments as $attachment) {
|
||||
$IDs[] = $attachment->id;
|
||||
}
|
||||
|
||||
// Update the system filenames for all the attachments
|
||||
JTable::addIncludePath(JPATH_ADMINISTRATOR.'/components/com_attachments/tables');
|
||||
$attachment = JTable::getInstance('Attachment', 'AttachmentsTable');
|
||||
$numUpdated = 0;
|
||||
foreach ($IDs as $id) {
|
||||
|
||||
$attachment->load($id);
|
||||
|
||||
// Update the file size
|
||||
$attachment->file_size = filesize($attachment->filename_sys);
|
||||
|
||||
// Update the record
|
||||
if (!$attachment->store()) {
|
||||
$errmsg = $attachment->getError() . ' (ERR 81)';
|
||||
JError::raiseError(500, $errmsg);
|
||||
}
|
||||
|
||||
$numUpdated++;
|
||||
}
|
||||
|
||||
return JText::sprintf( 'ATTACH_UPDATED_FILE_SIZES_FOR_N_ATTACHMENTS', $numUpdated );
|
||||
}
|
||||
|
||||
/**
|
||||
* Check all files and make sure they exist
|
||||
*/
|
||||
public static function check_files_existance()
|
||||
{
|
||||
jimport('joomla.filesystem.file');
|
||||
|
||||
$msg = '';
|
||||
|
||||
// Get the component parameters
|
||||
jimport('joomla.application.component.helper');
|
||||
$params = JComponentHelper::getParams('com_attachments');
|
||||
|
||||
// Get all the attachment IDs
|
||||
$db = JFactory::getDBO();
|
||||
$query = $db->getQuery(true);
|
||||
$query->select('id')->from('#__attachments')->where('uri_type=' . $db->quote('file'));
|
||||
$db->setQuery($query);
|
||||
$attachments = $db->loadObjectList();
|
||||
if ( $db->getErrorNum() ) {
|
||||
$errmsg = $db->stderr() . ' (ERR 82)';
|
||||
JError::raiseError(500, $errmsg);
|
||||
}
|
||||
if ( count($attachments) == 0 ) {
|
||||
return JText::_('ATTACH_NO_ATTACHMENTS_WITH_FILES');
|
||||
}
|
||||
$IDs = array();
|
||||
foreach ($attachments as $attachment) {
|
||||
$IDs[] = $attachment->id;
|
||||
}
|
||||
|
||||
// Update the system filenames for all the attachments
|
||||
JTable::addIncludePath(JPATH_ADMINISTRATOR.'/components/com_attachments/tables');
|
||||
$attachment = JTable::getInstance('Attachment', 'AttachmentsTable');
|
||||
$numMissing = 0;
|
||||
$numChecked = 0;
|
||||
foreach ($IDs as $id) {
|
||||
|
||||
$attachment->load($id);
|
||||
|
||||
if ( !JFile::exists($attachment->filename_sys) ) {
|
||||
$msg .= ' ' .
|
||||
$attachment->filename_sys . '<br >';
|
||||
$numMissing++;
|
||||
}
|
||||
|
||||
$numChecked++;
|
||||
}
|
||||
|
||||
if ( $msg ) {
|
||||
$msg = ':<br />' . $msg;
|
||||
}
|
||||
$msg = JText::sprintf( 'ATTACH_CHECKED_N_ATTACHMENT_FILES_M_MISSING', $numChecked, $numMissing ) . $msg;
|
||||
|
||||
return $msg;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Validate all URLS and update their "valid" status
|
||||
*/
|
||||
public static function validate_urls()
|
||||
{
|
||||
// Get the component parameters
|
||||
jimport('joomla.application.component.helper');
|
||||
$params = JComponentHelper::getParams('com_attachments');
|
||||
|
||||
// Get all the attachment IDs
|
||||
$db = JFactory::getDBO();
|
||||
$query = $db->getQuery(true);
|
||||
$query->select('id')->from('#__attachments')->where('uri_type=' . $db->quote('url'));
|
||||
$db->setQuery($query);
|
||||
$attachments = $db->loadObjectList();
|
||||
if ( $db->getErrorNum() ) {
|
||||
$errmsg = $db->stderr() . ' (ERR 83)';
|
||||
JError::raiseError(500, $errmsg);
|
||||
}
|
||||
if ( count($attachments) == 0 ) {
|
||||
return JText::_('ATTACH_NO_ATTACHMENTS_WITH_URLS');
|
||||
}
|
||||
$IDs = array();
|
||||
foreach ($attachments as $attachment) {
|
||||
$IDs[] = $attachment->id;
|
||||
}
|
||||
|
||||
// Update the system filenames for all the attachments
|
||||
require_once(JPATH_SITE.'/components/com_attachments/helper.php');
|
||||
JTable::addIncludePath(JPATH_ADMINISTRATOR.'/components/com_attachments/tables');
|
||||
$attachment = JTable::getInstance('Attachment', 'AttachmentsTable');
|
||||
$numUpdated = 0;
|
||||
$numChecked = 0;
|
||||
foreach ($IDs as $id) {
|
||||
|
||||
$attachment->load($id);
|
||||
|
||||
$a = new JObject();
|
||||
|
||||
AttachmentsHelper::get_url_info($attachment->url, $a, false, false);
|
||||
|
||||
if ( $attachment->url_valid != $a->url_valid ) {
|
||||
$attachment->url_valid = $a->url_valid;
|
||||
|
||||
// Maybe update the file info with fresh info
|
||||
if ( $a->url_valid ) {
|
||||
$attachment->file_size = $a->file_size;
|
||||
$attachment->file_type = $a->file_type;
|
||||
}
|
||||
|
||||
// Update the record
|
||||
if (!$attachment->store()) {
|
||||
$errmsg = $attachment->getError() . ' (ERR 84)';
|
||||
JError::raiseError(500, $errmsg);
|
||||
}
|
||||
$numUpdated++;
|
||||
}
|
||||
$numChecked++;
|
||||
}
|
||||
|
||||
return JText::sprintf( 'ATTACH_VALIDATED_N_URL_ATTACHMENTS_M_CHANGED', $numChecked, $numUpdated );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Validate all URLS and update their "valid" status
|
||||
*/
|
||||
public static function installAttachmentsPermissions($verbose = true)
|
||||
{
|
||||
jimport('joomla.access.rules');
|
||||
$app = JFactory::getApplication();
|
||||
|
||||
// Get the root rules
|
||||
$root = JTable::getInstance('asset');
|
||||
$root->loadByName('root.1');
|
||||
$root_rules = new JAccessRules($root->rules);
|
||||
|
||||
// Define the new rules
|
||||
$new_rules = new JAccessRules(AttachmentsDefines::$DEFAULT_ATTACHMENTS_ACL_PERMISSIONS);
|
||||
|
||||
// Merge the rules into default rules and save it
|
||||
$root_rules->merge($new_rules);
|
||||
$root->rules = (string)$root_rules;
|
||||
if ( $root->store() ) {
|
||||
if ( $verbose ) {
|
||||
$app->enqueueMessage(JText::_('ATTACH_INSTALLED_DEFAULT_ATTACHMENTS_ASSET_RULES'), 'message');
|
||||
}
|
||||
}
|
||||
else {
|
||||
if ( $verbose ) {
|
||||
$app->enqueueMessage(JText::_('ATTACH_INSTALLING_DEFAULT_ATTACHMENTS_ASSET_RULES_FAILED'), 'message');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
@ -0,0 +1,223 @@
|
||||
<?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 tooltip behavior.
|
||||
JHtml::_('behavior.tooltip');
|
||||
|
||||
// Add the plugins stylesheet to style the list of attachments
|
||||
$document = JFactory::getDocument();
|
||||
$uri = JFactory::getURI();
|
||||
|
||||
$attachment = $this->attachment;
|
||||
|
||||
$upload_id = 'upload';
|
||||
|
||||
|
||||
// Show buttons for adding the attachments to other entitites (if appropriate)
|
||||
$alt_parent_html = '';
|
||||
$editor = JRequest::getWord('editor');
|
||||
$exceptions = Array('article', 'category', 'add_to_parent');
|
||||
if ( !in_array($editor, $exceptions) ) {
|
||||
|
||||
$base_url = $uri->base(true) . "/index.php?option=com_attachments&task=attachment.add";
|
||||
|
||||
// Add a footer section with buttons to attach files to the supported content types/entities
|
||||
$alt_parent_html .= '<div id="attachmentsPotentialParents">';
|
||||
$alt_parent_html .= '<p>';
|
||||
|
||||
// For normal LTR, put the label on the left
|
||||
if ( !$lang->isRTL() ) {
|
||||
$alt_parent_html .= '<span>' . JText::_('ATTACH_ADD_ATTACHMENT_TO') . '</span> ';
|
||||
}
|
||||
|
||||
// Create all the buttons
|
||||
foreach ($this->entity_info as $einfo) {
|
||||
$parent_type = $einfo['parent_type'];
|
||||
$centity = $einfo['id'];
|
||||
$cename = $einfo['name'];
|
||||
if ( ($parent_type != $attachment->parent_type) || ($centity != $attachment->parent_entity) ) {
|
||||
$url = $base_url . "&parent_type=" . $parent_type;
|
||||
$tooltip = JText::sprintf('ATTACH_ADD_ATTACHMENT_TO_S_INSTEAD_OF_S_TOOLTIP',
|
||||
$cename, $attachment->parent_entity_name);
|
||||
if ( $centity != 'default' ) {
|
||||
$url .= '.' . $centity;
|
||||
}
|
||||
if ( $attachment->uri_type == 'url' ) {
|
||||
$url .= '&uri=url';
|
||||
}
|
||||
$alt_parent_html .= " <a class=\"changeButton\" href=\"$url\" title=\"$tooltip\">$cename</a>";
|
||||
}
|
||||
}
|
||||
|
||||
// For normal RTL, put the label on the right
|
||||
if ( $lang->isRTL() ) {
|
||||
$alt_parent_html .= '<span>' . JText::_('ATTACH_ADD_ATTACHMENT_TO') . '</span>';
|
||||
}
|
||||
|
||||
$alt_parent_html .= '</p>';
|
||||
$alt_parent_html .= '</div>';
|
||||
}
|
||||
|
||||
|
||||
if ( $attachment->parent_title ) {
|
||||
echo "<h1>" . JText::sprintf('ATTACH_PARENT_S_COLON_S', $attachment->parent_entity_name, $attachment->parent_title) . "</h1>";
|
||||
}
|
||||
|
||||
?>
|
||||
<form class="attachmentsBackend" enctype="multipart/form-data"
|
||||
name="adminForm" id="adminForm"
|
||||
action="<?php echo $this->save_url; ?>" method="post">
|
||||
<fieldset class="adminform">
|
||||
<legend><?php echo JText::_('ATTACH_ADD_ATTACHMENT'); ?></legend>
|
||||
<table class="admintable">
|
||||
<?php if ( !$this->new_parent && !$attachment->parent_id ): ?>
|
||||
<tr>
|
||||
<td class="key"><label for="parent_title"><?php echo $this->selpar_label ?></label></td>
|
||||
<td><?php echo $alt_parent_html; ?>
|
||||
<input id="parent_title" value="<?php echo $attachment->parent_title ?>" disabled="disabled" type="text" size="60" />
|
||||
<a class="modal-button" type="button"
|
||||
href="<?php echo $this->selpar_btn_url ?>" title="<?php echo $this->selpar_btn_tooltip ?>"
|
||||
rel="{handler: 'iframe', size: {x: 800, y: 450}}"><?php echo $this->selpar_btn_text ?></a>
|
||||
<input id="parent_id" name="parent_id" value="-1" type="hidden" />
|
||||
</td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
<?php if ( $attachment->uri_type == 'file' ): ?>
|
||||
<tr>
|
||||
<td class="key"><label for="upload" id="upload_file_label"><?php echo JText::_('ATTACH_ATTACH_FILE_COLON') ?></label></td>
|
||||
<td>
|
||||
<a class="changeButton" href="<?php echo $this->upload_toggle_url ?>"
|
||||
title="<?php echo $this->upload_toggle_tooltip; ?>"><?php
|
||||
echo $this->upload_toggle_button_text;?></a><br />
|
||||
<input type="file" name="upload" id="<?php echo $upload_id; ?>"
|
||||
size="74" maxlength="1024" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="key"><label for="display_name" class="hasTip" title="<?php echo $this->display_filename_tooltip; ?>"
|
||||
><?php echo JText::_('ATTACH_DISPLAY_FILENAME'); ?></label></td>
|
||||
<td>
|
||||
<input type="text" name="display_name" id="display_name" size="75" maxlength="80"
|
||||
title="<?php echo $this->display_filename_tooltip; ?>" class="hasTip"
|
||||
value="<?php echo $attachment->display_name ?>" /><span class="optional"><?php echo JText::_('ATTACH_OPTIONAL'); ?></span>
|
||||
</td>
|
||||
<?php else: ?>
|
||||
<tr>
|
||||
<td class="key"><label for="upload" class="hasTip"
|
||||
title="<?php echo $this->enter_url_tooltip ?>"><?php echo JText::_('ATTACH_ENTER_URL') ?></label></td>
|
||||
<td>
|
||||
<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'); ?>" />
|
||||
<label for="url_relative"><?php echo JText::_('ATTACH_RELATIVE_URL') ?></label>
|
||||
<input type="checkbox" name="url_relative" value="relative" <?php echo $this->relative_url_checked ?>
|
||||
title="<?php echo JText::_('ATTACH_RELATIVE_URL_TOOLTIP'); ?>" />
|
||||
<a class="changeButton" href="<?php echo $this->upload_toggle_url ?>"
|
||||
title="<?php echo $this->upload_toggle_tooltip; ?>"><?php
|
||||
echo $this->upload_toggle_button_text;?></a><br />
|
||||
|
||||
<input type="text" name="url" id="<?php echo $upload_id; ?>"
|
||||
size="86" title="<?php echo JText::_('ATTACH_ENTER_URL_TOOLTIP'); ?>"
|
||||
value="<?php echo $attachment->url; ?>" /><br /><?php
|
||||
echo JText::_('ATTACH_NOTE_ENTER_URL_WITH_HTTP'); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="key"><label for="display_name" title="<?php echo $this->display_url_tooltip; ?>" class="hasTip"
|
||||
><?php echo JText::_('ATTACH_DISPLAY_URL'); ?></label></td>
|
||||
<td>
|
||||
<input type="text" name="display_name" id="display_name" size="75" maxlength="80"
|
||||
title="<?php echo $this->display_url_tooltip; ?>" class="hasTip"
|
||||
value="<?php echo $attachment->display_name ?>" /> <?php echo JText::_('ATTACH_OPTIONAL'); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
<tr>
|
||||
<td class="key"><label for="description"
|
||||
title="<?php echo JText::_('ATTACH_DESCRIPTION_DESCRIPTION'); ?>"
|
||||
><?php echo JText::_('ATTACH_DESCRIPTION'); ?></label></td>
|
||||
<td>
|
||||
<input type="text" name="description" id="description"
|
||||
title="<?php echo JText::_('ATTACH_DESCRIPTION_DESCRIPTION'); ?>"
|
||||
size="75" maxlength="255" value="<?php echo stripslashes($attachment->description) ?>" />
|
||||
</td>
|
||||
</tr>
|
||||
<?php if ( $this->may_publish ): ?>
|
||||
<tr>
|
||||
<td class="key"><label><?php echo JText::_('ATTACH_PUBLISHED'); ?></label></td>
|
||||
<td><?php echo $this->lists['published']; ?></td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
<tr>
|
||||
<td class="key"><label for="access" class="hasTip" title="<?php echo $this->access_level_tooltip ?>"><?php echo JText::_('JFIELD_ACCESS_LABEL'); ?></label></td>
|
||||
<td><?php echo $this->access_level; ?></td>
|
||||
</tr>
|
||||
<?php if ( $this->show_user_field_1 ): ?>
|
||||
<tr>
|
||||
<td class="key"><label for="user_field_1"><?php echo $this->user_field_1_name; ?></label></td>
|
||||
<td><input type="text" name="user_field_1" id="user_field_1" size="75" maxlength="100" value="" /></td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
<?php if ( $this->show_user_field_2 ): ?>
|
||||
<tr>
|
||||
<td class="key"><label for="user_field_2"><?php echo $this->user_field_2_name; ?></label></td>
|
||||
<td><input type="text" name="user_field_2" id="user_field_2" size="75" maxlength="100" value="" /></td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
<?php if ( $this->show_user_field_3 ): ?>
|
||||
<tr>
|
||||
<td class="key"><label for="user_field_3"><?php echo $this->user_field_3_name; ?></label></td>
|
||||
<td><input type="text" name="user_field_3" id="user_field_3" size="75" maxlength="100" value="" /></td>
|
||||
<tr>
|
||||
<?php endif; ?>
|
||||
</table>
|
||||
</fieldset>
|
||||
<?php if ( $this->new_parent ): ?>
|
||||
<input type="hidden" name="new_parent" value="1" />
|
||||
<?php elseif ( $attachment->parent_id ): ?>
|
||||
<input type="hidden" name="parent_id" value="<?php echo $attachment->parent_id; ?>" />
|
||||
<?php endif; ?>
|
||||
<input type="hidden" name="MAX_FILE_SIZE" value="524288" />
|
||||
<input type="hidden" name="save_type" value="upload" />
|
||||
<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="uri_type" value="<?php echo $attachment->uri_type; ?>" />
|
||||
<input type="hidden" name="option" value="<?php echo $this->option;?>" />
|
||||
<input type="hidden" name="task" value="attachment.add" />
|
||||
<input type="hidden" name="from" value="<?php echo $this->from; ?>" />
|
||||
<?php if ( $this->from == 'closeme' ): ?>
|
||||
<div class="form_buttons" align="center">
|
||||
<input type="submit" name="Submit" class="button"
|
||||
onclick="javascript: submitbutton('attachment.saveNew')"
|
||||
value="<?php echo JText::_('ATTACH_UPLOAD_VERB'); ?>" />
|
||||
<span class="right">
|
||||
<input type="button" name="cancel" value="<?php echo JText::_('ATTACH_CANCEL'); ?>"
|
||||
onClick="window.parent.SqueezeBox.close();" />
|
||||
</span>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php echo JHtml::_( 'form.token' ); ?>
|
||||
</form>
|
||||
<?php
|
||||
|
||||
// Show the existing attachments
|
||||
if ( ($attachment->uri_type == 'file') && $attachment->parent_id ) {
|
||||
/** Get the Attachments controller class */
|
||||
require_once(JPATH_ADMINISTRATOR.'/components/com_attachments/controllers/list.php');
|
||||
$controller = new AttachmentsControllerList();
|
||||
$controller->displayString($attachment->parent_id, $attachment->parent_type, $attachment->parent_entity,
|
||||
'ATTACH_EXISTING_ATTACHMENTS', false, false, true, $this->from);
|
||||
}
|
||||
@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
183
administrator/components/com_attachments/views/add/view.html.php
Normal file
183
administrator/components/com_attachments/views/add/view.html.php
Normal file
@ -0,0 +1,183 @@
|
||||
<?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');
|
||||
|
||||
// Access check.
|
||||
if (!JFactory::getUser()->authorise('core.create', 'com_attachments')) {
|
||||
return JError::raiseError(404, JText::_('JERROR_ALERTNOAUTHOR') . ' (ERR 172)');
|
||||
}
|
||||
|
||||
/** Define the legacy classes, if necessary */
|
||||
require_once(JPATH_SITE.'/components/com_attachments/legacy/view.php');
|
||||
|
||||
/** Include the Attachments javascript classes */
|
||||
require_once(JPATH_SITE.'/components/com_attachments/javascript.php');
|
||||
|
||||
|
||||
/**
|
||||
* HTML View class for adding new attachments
|
||||
*
|
||||
* @package Attachments
|
||||
*/
|
||||
class AttachmentsViewAdd extends JViewLegacy
|
||||
{
|
||||
/**
|
||||
* Display the add/create view
|
||||
*/
|
||||
public function display($tpl = null)
|
||||
{
|
||||
// For convenience below
|
||||
$attachment = $this->attachment;
|
||||
$parent_id = $attachment->parent_id;
|
||||
$parent_type = $attachment->parent_type;
|
||||
$parent_entity = $attachment->parent_entity;
|
||||
$attachment->parent_entity_name = JText::_('ATTACH_' . $attachment->parent_entity);
|
||||
$parent_entity_name = $attachment->parent_entity_name;
|
||||
$params = $this->params;
|
||||
|
||||
// Prevent unallowed editing PID PE
|
||||
if (!$this->parent->userMayAddAttachment($parent_id, $parent_entity, $this->new_parent))
|
||||
{
|
||||
$errmsg = JText::sprintf('ATTACH_ERROR_NO_PERMISSION_TO_UPLOAD_S',
|
||||
$attachment->parent_entity_name);
|
||||
return JError::raiseError(403, $errmsg . ' (ERR 173)');
|
||||
}
|
||||
|
||||
// Construct derived data
|
||||
$this->relative_url_checked = $attachment->url_relative ? 'checked="yes"' : '';
|
||||
$this->verify_url_checked = $attachment->url_verify ? 'checked="yes"' : '';
|
||||
|
||||
// Construct some tooltips
|
||||
$this->enter_url_tooltip = JText::_('ATTACH_ENTER_URL') . '::' . JText::_('ATTACH_ENTER_URL_TOOLTIP');
|
||||
$this->display_filename_tooltip = JText::_('ATTACH_DISPLAY_FILENAME') . '::' . JText::_('ATTACH_DISPLAY_FILENAME_TOOLTIP');
|
||||
$this->display_url_tooltip = JText::_('ATTACH_DISPLAY_URL') . '::' . JText::_('ATTACH_DISPLAY_URL_TOOLTIP');
|
||||
|
||||
// Add the published selection
|
||||
$this->lists = Array();
|
||||
$this->lists['published'] = JHtml::_('select.booleanlist', 'state',
|
||||
'class="inputbox"', $attachment->state);
|
||||
|
||||
// Set up the access field
|
||||
require_once(JPATH_COMPONENT_ADMINISTRATOR.'/models/fields/accesslevels.php');
|
||||
$this->access_level = JFormFieldAccessLevels::getAccessLevels('access', 'access', null);
|
||||
$this->access_level_tooltip = JText::_('JFIELD_ACCESS_LABEL') . '::' . JText::_('JFIELD_ACCESS_DESC');
|
||||
|
||||
// Handle user field 1
|
||||
$show_user_field_1 = false;
|
||||
$user_field_1_name = $params->get('user_field_1_name', '');
|
||||
if ( $user_field_1_name != '' ) {
|
||||
$show_user_field_1 = true;
|
||||
$this->user_field_1_name = $user_field_1_name;
|
||||
}
|
||||
$this->show_user_field_1 = $show_user_field_1;
|
||||
|
||||
// Handle user field 2
|
||||
$show_user_field_2 = false;
|
||||
$user_field_2_name = $params->get('user_field_2_name', '');
|
||||
if ( $user_field_2_name != '' ) {
|
||||
$show_user_field_2 = true;
|
||||
$this->user_field_2_name = $user_field_2_name;
|
||||
}
|
||||
$this->show_user_field_2 = $show_user_field_2;
|
||||
|
||||
// Handle user field 3
|
||||
$show_user_field_3 = false;
|
||||
$user_field_3_name = $params->get('user_field_3_name', '');
|
||||
if ( $user_field_3_name != '' ) {
|
||||
$show_user_field_3 = true;
|
||||
$this->user_field_3_name = $user_field_3_name;
|
||||
}
|
||||
$this->show_user_field_3 = $show_user_field_3;
|
||||
|
||||
// Set up to toggle between uploading file/urls
|
||||
if ( $attachment->uri_type == 'file' ) {
|
||||
$upload_toggle_button_text = JText::_('ATTACH_ENTER_URL_INSTEAD');
|
||||
$upload_toggle_tooltip = JText::_('ATTACH_ENTER_URL_INSTEAD_TOOLTIP');
|
||||
$upload_toggle_url = 'index.php?option=com_attachments&task=attachment.add&uri=url';
|
||||
}
|
||||
else {
|
||||
$upload_toggle_button_text = JText::_('ATTACH_SELECT_FILE_TO_UPLOAD_INSTEAD');
|
||||
$upload_toggle_tooltip = JText::_('ATTACH_SELECT_FILE_TO_UPLOAD_INSTEAD_TOOLTIP');
|
||||
$upload_toggle_url = 'index.php?option=com_attachments&task=attachment.add&uri=file';
|
||||
}
|
||||
if ( $this->from == 'closeme' ) {
|
||||
$upload_toggle_url .= '&tmpl=component';
|
||||
}
|
||||
if ( $this->from ) {
|
||||
$upload_toggle_url .= '&from=' . $this->from;
|
||||
}
|
||||
|
||||
// Update the toggle URL to not forget if the parent is not simply an article
|
||||
if ( !( ($parent_type == 'com_content') && ($parent_entity == 'default')) ) {
|
||||
$upload_toggle_url .= "&parent_type=$parent_type";
|
||||
if ( $parent_entity != 'default' ) {
|
||||
$upload_toggle_url .= ".$parent_entity";
|
||||
}
|
||||
}
|
||||
|
||||
// If this is for an existing content item, modify the URL appropriately
|
||||
if ( $this->new_parent ) {
|
||||
$upload_toggle_url .= "&parent_id=0,new";
|
||||
}
|
||||
elseif ( $parent_id && ($parent_id != -1) ) {
|
||||
$upload_toggle_url .= "&parent_id=$parent_id";
|
||||
}
|
||||
if ( JRequest::getWord('editor') ) {
|
||||
$upload_toggle_url .= "&editor=" . JRequest::getWord('editor');
|
||||
}
|
||||
|
||||
$this->upload_toggle_button_text = $upload_toggle_button_text;
|
||||
$this->upload_toggle_url = $upload_toggle_url;
|
||||
$this->upload_toggle_tooltip = $upload_toggle_tooltip;
|
||||
|
||||
// Set up the 'select parent' button
|
||||
$this->selpar_label = JText::sprintf('ATTACH_SELECT_ENTITY_S_COLON', $parent_entity_name);
|
||||
$this->selpar_btn_text = ' ' . JText::sprintf('ATTACH_SELECT_ENTITY_S', $parent_entity_name) . ' ';
|
||||
$this->selpar_btn_tooltip = JText::sprintf('ATTACH_SELECT_ENTITY_S_TOOLTIP', $parent_entity_name);
|
||||
$this->selpar_btn_url = $this->parent->getSelectEntityURL($parent_entity);
|
||||
|
||||
// Add the style sheets
|
||||
JHtml::stylesheet('com_attachments/attachments_admin_form.css', Array(), true);
|
||||
$lang = JFactory::getLanguage();
|
||||
if ( $lang->isRTL() ) {
|
||||
JHtml::stylesheet('com_attachments/attachments_admin_form_rtl.css', Array(), true);
|
||||
}
|
||||
|
||||
// Set up mootools/modal
|
||||
AttachmentsJavascript::setupModalJavascript();
|
||||
|
||||
// Set the toolbar
|
||||
$this->addToolBar();
|
||||
|
||||
// Display the form
|
||||
parent::display($tpl);
|
||||
}
|
||||
|
||||
/**
|
||||
* Setting the toolbar
|
||||
*/
|
||||
protected function addToolBar()
|
||||
{
|
||||
JRequest::setVar('hidemainmenu', true);
|
||||
JToolBarHelper::title(JText::_('ATTACH_ADD_ATTACHMENT'));
|
||||
|
||||
JToolBarHelper::apply('attachment.applyNew');
|
||||
JToolBarHelper::save('attachment.saveNew');
|
||||
JToolBarHelper::save2new('attachment.save2New');
|
||||
|
||||
JToolBarHelper::cancel('attachment.cancel', 'JTOOLBAR_CANCEL');
|
||||
}
|
||||
}
|
||||
@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
@ -0,0 +1,342 @@
|
||||
<?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 tooltip behavior.
|
||||
JHtml::_('behavior.tooltip');
|
||||
|
||||
// Add the plugins stylesheet to style the list of attachments
|
||||
$user = JFactory::getUser();
|
||||
$document = JFactory::getDocument();
|
||||
$app = JFactory::getApplication();
|
||||
$uri = JFactory::getURI();
|
||||
|
||||
// Get the component parameters
|
||||
jimport('joomla.application.component.helper');
|
||||
$params = JComponentHelper::getParams('com_attachments');
|
||||
$secure = $params->get('secure',false);
|
||||
|
||||
$attachment = $this->attachment;
|
||||
|
||||
if ( $this->change_parent ) {
|
||||
$parent_id = $this->selpar_parent_id;
|
||||
}
|
||||
else {
|
||||
$parent_id = $attachment->parent_id;
|
||||
}
|
||||
|
||||
// Set up the create/modify dates
|
||||
jimport( 'joomla.utilities.date' );
|
||||
$tz = new DateTimeZone( $user->getParam('timezone', $app->getCfg('offset')) );
|
||||
|
||||
$cdate = JFactory::getDate($attachment->created);
|
||||
$cdate->setTimezone($tz);
|
||||
$created = $cdate->format("Y-m-d H:i", true);
|
||||
|
||||
$mdate = JFactory::getDate($attachment->modified);
|
||||
$mdate->setTimezone($tz);
|
||||
$modified = $mdate->format("Y-m-d H:i", true);
|
||||
|
||||
$update = $this->update;
|
||||
|
||||
$change_entity_tooltip = JText::sprintf('ATTACH_CHANGE_ENTITY_S_TOOLTIP',$attachment->parent_entity_name) . '::' .
|
||||
JText::_('ATTACH_CHANGE_ENTITY_TOOLTIP2');
|
||||
|
||||
if ( $update == 'file' )
|
||||
$enctype = "enctype=\"multipart/form-data\"";
|
||||
else
|
||||
$enctype = '';
|
||||
|
||||
?>
|
||||
<?php if ( $this->in_popup ): ?>
|
||||
<div class="attachmentsBackendTitle">
|
||||
<h1><?php echo JText::_('ATTACH_UPDATE_ATTACHMENT_COLON') . " " . $attachment->filename; ?></h1>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<form class="attachmentsBackend" action="<?php echo $this->save_url; ?>" method="post" <?php echo $enctype ?>
|
||||
name="adminForm" id="adminForm">
|
||||
<fieldset class="adminform">
|
||||
<table class="admintable">
|
||||
<tbody>
|
||||
<tr>
|
||||
<?php if ( $this->change_parent ): ?>
|
||||
<td class="key"><label for="parent_id"><b><?php
|
||||
echo $this->selpar_label ?></b></label></td>
|
||||
<td colspan="5"><input id="parent_title" value="<?php echo $this->selpar_parent_title; ?>"
|
||||
disabled="disabled" type="text" size="60" />
|
||||
<a class="modal-button hasTip" type="button" title="<?php echo $this->selpar_btn_tooltip ?>"
|
||||
href="<?php echo $this->selpar_btn_url ?>"
|
||||
rel="{handler: 'iframe', size: {x: 700, y: 375}}"><?php echo $this->selpar_btn_text ?></a>
|
||||
</td>
|
||||
<?php else: ?>
|
||||
<td class="key"><label><?php echo
|
||||
JText::sprintf('ATTACH_ATTACHED_TO', $attachment->parent_entity_name); ?></label></td>
|
||||
<td class="at_title" colspan="3"><?php
|
||||
if ( $attachment->parent_id == null ) {
|
||||
echo '<span class="error">' . $attachment->parent_title . '</span>';
|
||||
}
|
||||
else {
|
||||
echo $attachment->parent_title;
|
||||
} ?>
|
||||
<div class="right">
|
||||
<a class="changeButton hasTip" href="<?php echo $this->change_parent_url; ?>"
|
||||
title="<?php echo $change_entity_tooltip; ?>"
|
||||
><?php echo JText::sprintf('ATTACH_CHANGE_ENTITY_S', $attachment->parent_entity_name) ?></a></div>
|
||||
</td>
|
||||
<td class="switch" colspan="2"> <?php echo JText::_('ATTACH_SWITCH_TO_COLON') ?>
|
||||
<?php
|
||||
// Create all the buttons to switch to other types of parents
|
||||
foreach ($this->entity_info as $einfo) {
|
||||
$parent_type = $einfo['parent_type'];
|
||||
$centity = $einfo['id'];
|
||||
$cename = $einfo['name'];
|
||||
if ( ($parent_type != $attachment->parent_type) || ($centity != $attachment->parent_entity) ) {
|
||||
$url = $this->change_parent_url . "&new_parent_type=" . $parent_type;
|
||||
$tooltip = JText::sprintf('ATTACH_SWITCH_ATTACHMENT_TO_S_TOOLTIP', $cename) . '::' .
|
||||
JText::_('ATTACH_SWITCH_ATTACHMENT_TO_TOOLTIP2');
|
||||
if ( $centity != 'default' ) {
|
||||
$url .= '.' . $centity;
|
||||
}
|
||||
if ( $update == 'file' ) {
|
||||
$url .= '&update=file';
|
||||
}
|
||||
if ( $update == 'url' ) {
|
||||
$url .= '&update=url';
|
||||
}
|
||||
echo "<a class=\"changeButton hasTip\" href=\"$url\" title=\"$tooltip\">$cename</a>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
|
||||
<?php endif; ?>
|
||||
<tr><td class="key"><label><?php echo JText::_('ATTACH_ATTACHMENT_TYPE'); ?></label></td>
|
||||
<td colspan="5"><?php echo JText::_('ATTACH_' . JString::strtoupper($attachment->uri_type));?>
|
||||
<?php if ( ($attachment->uri_type == 'file') && ( $update != 'url' ) ): ?>
|
||||
<a class="changeButton hasTip" href="<?php echo $this->change_url_url ?>"
|
||||
title="<?php echo JText::_('ATTACH_CHANGE_TO_URL') . '::' . JText::_('ATTACH_CHANGE_TO_URL_TOOLTIP'); ?>"
|
||||
><?php echo JText::_('ATTACH_CHANGE_TO_URL') ?></a>
|
||||
<?php elseif ( ($attachment->uri_type == 'url') && ($update != 'file') ): ?>
|
||||
<a class="changeButton hasTip" href="<?php echo $this->change_file_url ?>"
|
||||
title="<?php echo JText::_('ATTACH_CHANGE_TO_FILE') . '::' . JText::_('ATTACH_CHANGE_TO_FILE_TOOLTIP'); ?>"
|
||||
><?php echo JText::_('ATTACH_CHANGE_TO_FILE') ?></a>
|
||||
<?php elseif ( (($attachment->uri_type == 'file') && ($update != 'file')) ||
|
||||
(($attachment->uri_type == 'url') && ($update != 'url')) ): ?>
|
||||
<a class="changeButton hasTip" href="<?php echo $this->normal_update_url ?>"
|
||||
title="<?php echo JText::_('ATTACH_NORMAL_UPDATE') . '::' . JText::_('ATTACH_NORMAL_UPDATE_TOOLTIP'); ?>"
|
||||
><?php echo JText::_('ATTACH_NORMAL_UPDATE') ?></a>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<?php if ( $update == 'file' ): ?>
|
||||
<tr>
|
||||
<td class="key"><label for="upload"><?php echo JText::_('ATTACH_SELECT_FILE_COLON') ?></label></td>
|
||||
<td colspan="5"><b><?php echo JText::_('ATTACH_SELECT_NEW_FILE_IF_YOU_WANT_TO_UPDATE_ATTACHMENT_FILE') ?></b><br />
|
||||
<input type="file" name="upload" id="upload" size="68" maxlength="1024" />
|
||||
</td>
|
||||
</tr>
|
||||
<?php elseif ( $update == 'url' ): ?>
|
||||
<tr>
|
||||
<td class="key"><label for="upload" class="hasTip"
|
||||
title="<?php echo $this->enter_url_tooltip ?>"><?php echo JText::_('ATTACH_ENTER_URL') ?></label></td>
|
||||
<td colspan="5">
|
||||
<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'); ?>" />
|
||||
|
||||
<label for="url_relative"><?php echo JText::_('ATTACH_RELATIVE_URL') ?></label>
|
||||
<input type="checkbox" name="url_relative" value="relative" <?php echo $this->relative_url_checked ?>
|
||||
title="<?php echo JText::_('ATTACH_RELATIVE_URL_TOOLTIP'); ?>" />
|
||||
<br />
|
||||
<input type="text" name="url" id="upload"
|
||||
size="70" title="<?php echo JText::_('ATTACH_ENTER_URL_TOOLTIP'); ?>"
|
||||
value="<?php if ( $attachment->uri_type == 'url' ) { echo $attachment->url; } ?>" />
|
||||
<br />
|
||||
<?php echo JText::_('ATTACH_NOTE_ENTER_URL_WITH_HTTP'); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php else: ?>
|
||||
<?php if ( $attachment->uri_type == 'file' ): ?>
|
||||
<tr>
|
||||
<td class="key"><label><?php echo JText::_('ATTACH_FILENAME'); ?></label></td>
|
||||
<td colspan="5"><?php echo $attachment->filename; ?>
|
||||
<a class="changeButton hasTip" href="<?php echo $this->change_file_url ?>"
|
||||
title="<?php echo JText::_('ATTACH_CHANGE_FILE') . '::' . JText::_('ATTACH_CHANGE_FILE_TOOLTIP'); ?>"
|
||||
><?php echo JText::_('ATTACH_CHANGE_FILE') ?></a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td class="key"><label><?php echo JText::_('ATTACH_SYSTEM_FILENAME'); ?></label></td>
|
||||
<td colspan="5"><?php echo $attachment->filename_sys; ?></td>
|
||||
</tr>
|
||||
<tr><td class="key"><label><?php echo JText::_('ATTACH_URL_COLON'); ?></label></td>
|
||||
<td colspan="5"><?php echo $attachment->url; ?></td>
|
||||
</tr>
|
||||
<?php elseif ( $attachment->uri_type == 'url' ): ?>
|
||||
<tr>
|
||||
<td class="key"><label for="upload"><?php
|
||||
if ( $attachment->uri_type == 'file' ) {
|
||||
echo JText::_('ATTACH_ENTER_NEW_URL_COLON');
|
||||
}
|
||||
else {
|
||||
echo JText::_('ATTACH_URL_COLON');
|
||||
}
|
||||
?></label></td>
|
||||
<td colspan="5">
|
||||
<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'); ?>" />
|
||||
|
||||
<label for="url_relative"><?php echo JText::_('ATTACH_RELATIVE_URL') ?></label>
|
||||
<input type="checkbox" name="url_relative" value="relative" <?php echo $this->relative_url_checked ?>
|
||||
title="<?php echo JText::_('ATTACH_RELATIVE_URL_TOOLTIP'); ?>" />
|
||||
<br />
|
||||
<input type="text" name="url" id="upload" value="<?php echo $attachment->url; ?>"
|
||||
size="70" title="<?php echo JText::_('ATTACH_ENTER_URL_TOOLTIP'); ?>" />
|
||||
<input type="hidden" name="old_url" value="<?php echo $attachment->url; ?>" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="key"><label for="url_valid"><?php echo JText::_('ATTACH_URL_IS_VALID') ?></label></td>
|
||||
<td colspan="5"><?php echo $this->lists['url_valid']; ?></td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( (($attachment->uri_type == 'file') AND ($update == '')) OR ($update == 'file') ): ?>
|
||||
<tr><td class="key"><label class="hasTip" for="display_name"
|
||||
title="<?php echo $this->display_filename_tooltip; ?>"
|
||||
><?php echo JText::_('ATTACH_DISPLAY_FILENAME'); ?></label></td>
|
||||
<td colspan="5"><input class="text hasTip" type="text" name="display_name"
|
||||
id="display_name" size="80" maxlength="80"
|
||||
title="<?php echo JText::_('ATTACH_DISPLAY_FILENAME_TOOLTIP'); ?>"
|
||||
value="<?php echo $attachment->display_name;?>"
|
||||
/> <?php echo JText::_('ATTACH_OPTIONAL'); ?></td>
|
||||
</tr>
|
||||
<?php elseif ( (($attachment->uri_type == 'url') AND ($update == '')) OR ($update == 'url') ): ?>
|
||||
<tr><td class="key"><label class="hasTip" for="display_name"
|
||||
title="<?php echo $this->display_url_tooltip; ?>"
|
||||
><?php echo JText::_('ATTACH_DISPLAY_URL'); ?></label></td>
|
||||
<td colspan="5"><input class="text hasTip" type="text" name="display_name"
|
||||
id="display_name" size="80" maxlength="80"
|
||||
title="<?php echo JText::_('ATTACH_DISPLAY_URL_TOOLTIP'); ?>"
|
||||
value="<?php echo $attachment->display_name;?>"
|
||||
/> <?php echo JText::_('ATTACH_OPTIONAL'); ?></td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
|
||||
<tr><td class="key"><label class="hasTip" for="description"
|
||||
title="<?php echo JText::_('ATTACH_DESCRIPTION') . '::' . JText::_('ATTACH_DESCRIPTION_DESCRIPTION'); ?>"><?php
|
||||
echo JText::_('ATTACH_DESCRIPTION'); ?></label></td>
|
||||
<td colspan="5"><input class="text hasTip" type="text" name="description"
|
||||
title="<?php echo JText::_('ATTACH_DESCRIPTION_DESCRIPTION'); ?>"
|
||||
id="description" size="80" maxlength="255"
|
||||
value="<?php echo stripslashes($attachment->description);?>" /></td>
|
||||
</tr>
|
||||
<?php if ( $this->may_publish ): ?>
|
||||
<tr><td class="key"><label><?php echo JText::_('ATTACH_PUBLISHED'); ?></label></td>
|
||||
<td colspan="5"><?php echo $this->lists['published']; ?></td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
<tr><td class="key"><label for="access" class="hasTip" title="<?php echo $this->access_level_tooltip ?>"><?php echo JText::_('JFIELD_ACCESS_LABEL'); ?></label></td>
|
||||
<td colspan="5"><?php echo $this->access_level; ?></td>
|
||||
</tr>
|
||||
<?php if ( $params->get('user_field_1_name', '') != '' ): ?>
|
||||
<tr><td class="key"><label for="user_field_1"><?php echo $params->get('user_field_1_name'); ?></label></td>
|
||||
<td colspan="5"><input class="text" type="text" name="user_field_1"
|
||||
id="user_field_1" size="80" maxlength="100"
|
||||
value="<?php echo stripslashes($attachment->user_field_1); ?>" /></td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
<?php if ( $params->get('user_field_2_name', '') != '' ): ?>
|
||||
<tr><td class="key"><label for="user_field_2"><?php echo $params->get('user_field_2_name'); ?></label></td>
|
||||
<td colspan="5"><input class="text" type="text" name="user_field_2"
|
||||
id="user_field_2" size="80" maxlength="100"
|
||||
value="<?php echo stripslashes($attachment->user_field_2); ?>" /></td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
<?php if ( $params->get('user_field_3_name', '') != '' ): ?>
|
||||
<tr><td class="key"><label for="user_field_3"><?php echo $params->get('user_field_3_name'); ?></label></td>
|
||||
<td colspan="5"><input class="text" type="text" name="user_field_3"
|
||||
id="user_field_3" size="80" maxlength="100"
|
||||
value="<?php echo stripslashes($attachment->user_field_3); ?>" /></td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
<tr>
|
||||
<td class="key"><label for="icon_filename"><?php echo JText::_('ATTACH_ICON_FILENAME'); ?></label></td>
|
||||
<td><?php echo $this->lists['icon_filenames']; ?></td>
|
||||
<td class="key2"><label><?php echo JText::_('ATTACH_FILE_TYPE'); ?></label></td>
|
||||
<?php if ($secure) { $ncols = 1; } else { $ncols = 3; }; ?>
|
||||
<td colspan="<?php echo $ncols ?>"><?php echo $attachment->file_type; ?></td>
|
||||
<?php if ($secure): ?>
|
||||
<td class="key hasTip" title="<?php echo $this->download_count_tooltip; ?>">
|
||||
<label for="download_count"><?php echo JText::_('ATTACH_NUMBER_OF_DOWNLOADS'); ?></label></td>
|
||||
<td class="hasTip" name="download_count" title="<?php echo $this->download_count_tooltip; ?>"><?php echo $attachment->download_count ?></td>
|
||||
<?php endif; ?>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="key"><label><?php echo JText::_('ATTACH_FILE_SIZE'); ?></label></td?>
|
||||
<td><?php echo $attachment->size_kb; ?> <?php echo JText::_('ATTACH_KB'); ?></td?>
|
||||
<td class="key2"><label><?php echo JText::_('ATTACH_DATE_CREATED'); ?></label></td>
|
||||
<td><?php echo $created; ?></td>
|
||||
<td class="key2"><label><?php echo JText::_('ATTACH_DATE_LAST_MODIFIED'); ?></label></td>
|
||||
<td><?php echo $modified; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="key"><label><?php echo JText::_('ATTACH_ATTACHMENT_ID'); ?></label></td>
|
||||
<td><?php echo $attachment->id; ?></td>
|
||||
<td class="key2"><label><?php echo JText::_('JGLOBAL_FIELD_CREATED_BY_LABEL'); ?></label></td>
|
||||
<td><?php echo $attachment->creator_name;?></td>
|
||||
<td class="key2"><label><?php echo JText::_('JGLOBAL_FIELD_MODIFIED_BY_LABEL'); ?></label></td>
|
||||
<td><?php echo $attachment->modifier_name;?></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</fieldset>
|
||||
<input type="hidden" name="id" value="<?php echo $attachment->id; ?>" />
|
||||
<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="parent_id" id="parent_id" value="<?php echo $parent_id; ?>" />
|
||||
<input type="hidden" name="parent_type" id="parent_type" value="<?php echo $attachment->parent_type; ?>" />
|
||||
<input type="hidden" name="parent_entity" id="parent_entity" value="<?php echo $attachment->parent_entity; ?>" />
|
||||
<input type="hidden" name="old_parent_id" value="<?php echo $attachment->parent_id ?>" />
|
||||
<input type="hidden" name="old_parent_type" value="<?php echo $attachment->parent_type ?>" />
|
||||
<input type="hidden" name="old_parent_entity" value="<?php echo $attachment->parent_entity ?>" />
|
||||
<input type="hidden" name="new_parent_type" id="new_parent_type" value="<?php echo $this->new_parent_type; ?>" />
|
||||
<input type="hidden" name="new_parent_entity" id="new_parent_entity" value="<?php echo $this->new_parent_entity; ?>" />
|
||||
<input type="hidden" name="old_display_name" value="<?php echo $attachment->display_name; ?>" />
|
||||
<input type="hidden" name="option" value="<?php echo $this->option;?>" />
|
||||
<input type="hidden" name="from" value="<?php echo $this->from;?>" />
|
||||
<input type="hidden" name="task" value="attachment.edit" />
|
||||
<?php if ( $this->in_popup ): ?>
|
||||
<div class="form_buttons" align="center">
|
||||
<input type="submit" name="submit" onclick="javascript: submitbutton('attachment.save')" value="<?php echo JText::_('ATTACH_SAVE'); ?>" />
|
||||
<span class="right"><input type="button" name="cancel" value="<?php echo JText::_('ATTACH_CANCEL'); ?>"
|
||||
onClick="window.parent.SqueezeBox.close();" /></span>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php echo JHtml::_( 'form.token' ); ?>
|
||||
</form>
|
||||
<?php
|
||||
|
||||
// Show the existing attachments (if any)
|
||||
if ( $attachment->parent_id AND ($update == 'file') )
|
||||
{
|
||||
/** Get the attachments controller class */
|
||||
require_once(JPATH_ADMINISTRATOR.'/components/com_attachments/controllers/list.php');
|
||||
$controller = new AttachmentsControllerList();
|
||||
$controller->displayString($attachment->parent_id, $attachment->parent_type, $attachment->parent_entity,
|
||||
'ATTACH_EXISTING_ATTACHMENTS', false, false, true, $this->from);
|
||||
}
|
||||
@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
@ -0,0 +1,129 @@
|
||||
<?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');
|
||||
|
||||
// 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 177)');
|
||||
}
|
||||
|
||||
/** Define the legacy classes, if necessary */
|
||||
require_once(JPATH_SITE.'/components/com_attachments/legacy/view.php');
|
||||
|
||||
/** Load the Attachments helper */
|
||||
require_once(JPATH_SITE.'/components/com_attachments/helper.php');
|
||||
|
||||
/** Include the Attachments javascript classes */
|
||||
require_once(JPATH_SITE.'/components/com_attachments/javascript.php');
|
||||
|
||||
|
||||
/**
|
||||
* HTML View class for editing new attachments
|
||||
*
|
||||
* @package Attachments
|
||||
*/
|
||||
class AttachmentsViewEdit extends JViewLegacy
|
||||
{
|
||||
/**
|
||||
* Display the edit view
|
||||
*/
|
||||
public function display($tpl = null)
|
||||
{
|
||||
// For convenience
|
||||
$attachment = $this->attachment;
|
||||
|
||||
// Prevent unallowed editing
|
||||
if (!$this->attachment->parent->userMayEditAttachment($attachment))
|
||||
{
|
||||
$errmsg = JText::_('ATTACH_ERROR_NO_PERMISSION_TO_EDIT');
|
||||
return JError::raiseError(403, $errmsg . ' (ERR 178)');
|
||||
}
|
||||
|
||||
// Construct derived data
|
||||
$attachment->parent_entity_name = JText::_('ATTACH_' . $attachment->parent_entity);
|
||||
if (!isset($attachment->modifier_name))
|
||||
{
|
||||
AttachmentsHelper::addAttachmentUserNames($attachment);
|
||||
}
|
||||
|
||||
// Compute the attachment size in kB
|
||||
$attachment->size_kb = (int)( 10 * $attachment->file_size / 1024.0 ) / 10.0;
|
||||
|
||||
// set up lists for form controls
|
||||
$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);
|
||||
|
||||
// Construct the drop-down list for legal icon filenames
|
||||
$icon_filenames = array();
|
||||
require_once(JPATH_COMPONENT_SITE.'/file_types.php');
|
||||
foreach ( AttachmentsFileTypes::unique_icon_filenames() as $ifname)
|
||||
{
|
||||
$icon_filenames[] = JHtml::_('select.option', $ifname);
|
||||
}
|
||||
$this->lists['icon_filenames'] =JHtml::_('select.genericlist', $icon_filenames,
|
||||
'icon_filename', 'class="inputbox" size="1"', 'value', 'text',
|
||||
$attachment->icon_filename);
|
||||
|
||||
// If switching from article to URL default url_verify to true
|
||||
if (($attachment->uri_type == 'file') AND ($this->update == 'url')) {
|
||||
$attachment->url_verify = true;
|
||||
}
|
||||
|
||||
// Set up for checkboxes
|
||||
$this->relative_url_checked = $attachment->url_relative ? 'checked="yes"' : '';
|
||||
$this->verify_url_checked = $attachment->url_verify ? 'checked="yes"' : '';
|
||||
|
||||
// Set up some tooltips
|
||||
$this->enter_url_tooltip = JText::_('ATTACH_ENTER_URL') . '::' . JText::_('ATTACH_ENTER_URL_TOOLTIP');
|
||||
$this->display_filename_tooltip = JText::_('ATTACH_DISPLAY_FILENAME') . '::' . JText::_('ATTACH_DISPLAY_FILENAME_TOOLTIP');
|
||||
$this->display_url_tooltip = JText::_('ATTACH_DISPLAY_URL') . '::' . JText::_('ATTACH_DISPLAY_URL_TOOLTIP');
|
||||
$this->download_count_tooltip = JText::_('ATTACH_NUMBER_OF_DOWNLOADS') . '::' . JText::_('ATTACH_NUMBER_OF_DOWNLOADS_TOOLTIP');
|
||||
|
||||
// Set up mootools/modal
|
||||
AttachmentsJavascript::setupModalJavascript();
|
||||
|
||||
// Add the style sheets
|
||||
JHtml::stylesheet('com_attachments/attachments_admin_form.css', Array(), true);
|
||||
$lang = JFactory::getLanguage();
|
||||
if ( $lang->isRTL() ) {
|
||||
JHtml::stylesheet('com_attachments/attachments_admin_form_rtl.css', Array(), true);
|
||||
}
|
||||
|
||||
// Set the toolbar
|
||||
$this->addToolBar();
|
||||
|
||||
// Display the form
|
||||
parent::display($tpl);
|
||||
}
|
||||
|
||||
/**
|
||||
* Setting the toolbar
|
||||
*/
|
||||
protected function addToolBar()
|
||||
{
|
||||
JRequest::setVar('hidemainmenu', true);
|
||||
JToolBarHelper::title(JText::_('ATTACH_EDIT_ATTACHMENT'));
|
||||
|
||||
JToolBarHelper::apply('attachment.apply');
|
||||
JToolBarHelper::save('attachment.save');
|
||||
JToolBarHelper::cancel('attachment.cancel', 'JTOOLBAR_CLOSE');
|
||||
}
|
||||
}
|
||||
@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
@ -0,0 +1,87 @@
|
||||
<?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
|
||||
$document = JFactory::getDocument();
|
||||
$uri = JFactory::getURI();
|
||||
|
||||
$lists = $this->lists;
|
||||
|
||||
// Handle both 2.5 and 3.x
|
||||
$row_num = JText::_( 'JGRID_HEADING_ROW_NUMBER' );
|
||||
if ($row_num == 'JGRID_HEADING_ROW_NUMBER') {
|
||||
$row_num = '#';
|
||||
}
|
||||
|
||||
?>
|
||||
<form class="attachmentsBackend" enctype="multipart/form-data"
|
||||
name="adminForm" id="adminForm"
|
||||
action="<?php echo $this->post_url ?>" method="post">
|
||||
|
||||
<fieldset class="adminform">
|
||||
<legend><?php echo JText::sprintf('ATTACH_SELECT_ENTITY_S', $this->parent_entity_name) ?></legend>
|
||||
<div class="attachments_filter">
|
||||
<?php echo JText::_( 'ATTACH_FILTER' ); ?>:
|
||||
<input type="text" name="search" id="search" value="<?php echo $lists['search'];?>"
|
||||
class="text_area" onchange="document.adminForm.submit();" />
|
||||
<button onclick="this.form.submit();"><?php echo JText::_( 'ATTACH_GO' ); ?></button>
|
||||
<button onclick="document.getElementById('search').value='';this.form.submit();"><?php echo JText::_('ATTACH_RESET') ?></button>
|
||||
</div>
|
||||
<table class="adminlist" cellspacing="1">
|
||||
<thead>
|
||||
<tr>
|
||||
<th width="5"><?php echo $row_num ?></th>
|
||||
<th class="title">
|
||||
<?php echo JHtml::_('grid.sort', 'ATTACH_TITLE', 'title', @$lists['order_Dir'], @$lists['order'] ); ?>
|
||||
</th>
|
||||
<th width="2%" class="title">
|
||||
<?php echo JHtml::_('grid.sort', 'JGRID_HEADING_ID', 'id', @$lists['order_Dir'], @$lists['order'] ); ?>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
<?php
|
||||
$k = 0;
|
||||
for ($i=0, $n=count( $this->items ); $i < $n; $i++) {
|
||||
$item = $this->items[$i];
|
||||
?>
|
||||
<tr class="<?php echo "row$k" ?>">
|
||||
<td><?php echo $i ?></td>
|
||||
<td>
|
||||
<a style="cursor: pointer;" onclick="window.parent.jSelectParentArticle('<?php echo $item->id; ?>', '<?php echo str_replace(array("'", "\""), array("\\'", ""),$item->title); ?>', '<?php echo JRequest::getVar('object'); ?>');">
|
||||
<?php echo htmlspecialchars($item->title, ENT_QUOTES, 'UTF-8'); ?></a>
|
||||
</td>
|
||||
<td><?php echo $item->id; ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
$k = 1 - $k;
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
</fieldset>
|
||||
<input type="hidden" name="parent_type" value="<?php echo $this->parent_type ?>" />
|
||||
<input type="hidden" name="parent_entity" value="<?php echo $this->parent_entity ?>" />
|
||||
<input type="hidden" name="option" value="<?php echo $this->option;?>" />
|
||||
<input type="hidden" name="task" value="selectEntity" />
|
||||
<input type="hidden" name="from" value="<?php echo $this->from; ?>" />
|
||||
|
||||
<input type="hidden" name="filter_order" value="<?php echo $lists['order']; ?>" />
|
||||
<input type="hidden" name="filter_order_Dir" value="<?php echo $lists['order_Dir']; ?>" />
|
||||
|
||||
<?php echo JHtml::_( 'form.token' ); ?>
|
||||
</form>
|
||||
@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
@ -0,0 +1,43 @@
|
||||
<?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 adding new attachments
|
||||
*
|
||||
* @package Attachments
|
||||
*/
|
||||
class AttachmentsViewEntity extends JViewLegacy
|
||||
{
|
||||
/**
|
||||
* Display the entity view
|
||||
*/
|
||||
public function display($tpl = null)
|
||||
{
|
||||
// Add the style sheets
|
||||
JHtml::stylesheet('com_attachments/attachments_admin.css', Array(), true);
|
||||
$lang = JFactory::getLanguage();
|
||||
if ( $lang->isRTL() ) {
|
||||
JHtml::stylesheet('com_attachments/attachments_admin_rtl.css', Array(), true);
|
||||
}
|
||||
|
||||
parent::display($tpl);
|
||||
}
|
||||
}
|
||||
661
administrator/components/com_attachments/views/help/helpview.php
Normal file
661
administrator/components/com_attachments/views/help/helpview.php
Normal file
@ -0,0 +1,661 @@
|
||||
<?php
|
||||
/**
|
||||
* Attachments component
|
||||
*
|
||||
* @package Attachments
|
||||
* @subpackage Attachments_Component
|
||||
*
|
||||
* @author Jonathan M. Cameron <jmcameron@jmcameron.net>
|
||||
* @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/
|
||||
*/
|
||||
|
||||
// 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 the help pages
|
||||
*
|
||||
* The goal is to provide a PHP programmatic interface to create a help page
|
||||
* using primarily PHP function calls in the view/template. The styling is
|
||||
* base on styling of Restructured Text documents rendered into HTML using
|
||||
* converion tools such as docutils.
|
||||
*
|
||||
* @package Attachments
|
||||
* @since 3.1
|
||||
*/
|
||||
class HelpView extends JViewLegacy
|
||||
{
|
||||
/**
|
||||
* Data about each of the document section headers
|
||||
*
|
||||
* Should be initialized in the view or templage to contain an array of
|
||||
* arrays of information about the sections like this:
|
||||
*
|
||||
* $this->sections = Array( 1 => Array( 'id' => 'introduction',
|
||||
* 'code' => 'SECTION_TITLE_1',
|
||||
* 'title' => JText::_('SECTION_TITLE_1'),
|
||||
* ...
|
||||
* ),
|
||||
*
|
||||
* where the 'SECTION_TITLE_1' is the language token for the title of
|
||||
* section 1.
|
||||
*/
|
||||
protected $sections = null;
|
||||
|
||||
/**
|
||||
* Flag to show codes
|
||||
*
|
||||
*/
|
||||
protected $show_codes = null;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param array $config An optional associative array of configuration settings.
|
||||
*/
|
||||
public function __construct($config = array())
|
||||
{
|
||||
parent::__construct($config);
|
||||
|
||||
// Save the plugin type
|
||||
$this->show_codes = JRequest::getCmd('show') == 'codes';
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the information about a section to the $sections data
|
||||
*
|
||||
* @param int $sectnum the section number (constant)
|
||||
* @param string $id the section ID string (unique name to be used as anchor target)
|
||||
* @param string $code the language code for this section title
|
||||
*
|
||||
* @return nothing
|
||||
*/
|
||||
protected function saveSectionInfo($sectnum, $id, $code)
|
||||
{
|
||||
$this->sections[$sectnum] = Array('id' => $id, 'code' => $code, 'title' => JText::_($code));
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a tooltip if tooltips are supposed to be shown
|
||||
*
|
||||
* @param string $code Language code for the tooltip
|
||||
*
|
||||
* @return the tooltip to insert in the html
|
||||
*/
|
||||
protected function constructTooltip($code)
|
||||
{
|
||||
$tooltip = '';
|
||||
|
||||
if ($this->show_codes)
|
||||
{
|
||||
$tooltip = " title=\"$code\"";
|
||||
}
|
||||
|
||||
return $tooltip;
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct the URL with show=codes toggled
|
||||
*
|
||||
* @return the URL
|
||||
*/
|
||||
protected function toggledURL()
|
||||
{
|
||||
$uri = JRequest::getURI();
|
||||
|
||||
if ($this->show_codes)
|
||||
{
|
||||
$uri = str_replace('&show=codes', '', $uri);
|
||||
}
|
||||
else
|
||||
{
|
||||
$uri .= '&show=codes';
|
||||
}
|
||||
|
||||
return $uri;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a link for the specified section
|
||||
*
|
||||
* @param int $sect_num The section number to link to
|
||||
*
|
||||
* @return string an html link for the specified section
|
||||
*/
|
||||
protected function sectionLink($sect_num)
|
||||
{
|
||||
$id = $this->sections[$sect_num]['id'];
|
||||
$title = $this->sections[$sect_num]['title'];
|
||||
|
||||
return "<a class=\"reference internal\" href=\"#$id\">$title</a>";
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a link
|
||||
*
|
||||
* @param string $url The URL for the link
|
||||
* @param string $label_code The code for the link label
|
||||
* @param string $class The class for the link
|
||||
*
|
||||
* @return string an html link
|
||||
*/
|
||||
protected function link($url, $label_code, $class='')
|
||||
{
|
||||
$label = JText::_($label_code);
|
||||
|
||||
return "<a $class href=\"$url\">$label</a>";
|
||||
}
|
||||
|
||||
/**
|
||||
* Replace a series of items from the html using an array of replacements
|
||||
*
|
||||
* For example:
|
||||
* replace('<span>{TEST}-{NUM}</span>', Array('{TEST}' => 'MyTest', '{NUM}' => '23'))
|
||||
* returns:
|
||||
* <span>MyTest-23</span>
|
||||
*
|
||||
* @param string $html The original HTML string to be modified
|
||||
* @param array $replacements Array of textual replacments
|
||||
*
|
||||
* @return string the original HTML with the replacements performed
|
||||
*/
|
||||
protected function replace($html, $replacements)
|
||||
{
|
||||
if ( is_array($replacements) )
|
||||
{
|
||||
foreach ($replacements as $tag => $replace)
|
||||
{
|
||||
$html = str_replace($tag, $replace, $html);
|
||||
}
|
||||
}
|
||||
|
||||
return $html;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a table of contents
|
||||
*
|
||||
* @param string $title_code The language code for the title of the table of contents
|
||||
* @param sting $class The class for the table of contents (default: contents topic)
|
||||
*
|
||||
* @return nothing
|
||||
*/
|
||||
protected function tableOfContents($title_code, $class = 'contents topic')
|
||||
{
|
||||
$title = JText::_($title_code);
|
||||
$tooltip = $this->constructTooltip($title_code);
|
||||
|
||||
$html = "<div class=\"$class\" id=\"contents\">\n";
|
||||
$html .= " <p class=\"topic-title first\" $tooltip>$title</p>\n";
|
||||
$html .= " <ul class=\"$class\">\n";
|
||||
|
||||
foreach ($this->sections as $sect_num => $sdata)
|
||||
{
|
||||
$html .= ' ' . $this->sectionTOC($sect_num);
|
||||
}
|
||||
|
||||
$html .= " </ul>\n";
|
||||
$html .= "</div> <!-- table of contents -->\n";
|
||||
echo $html;
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a section Table-of-contents line for a section
|
||||
*
|
||||
* @param int $sect_num The section number to echo (as a list element)
|
||||
*
|
||||
* @return string the table-of-conents list item
|
||||
*/
|
||||
protected function sectionTOC($sect_num)
|
||||
{
|
||||
$sect_data = $this->sections[$sect_num];
|
||||
$id = $sect_data['id'];
|
||||
$title = $sect_data['title'];
|
||||
$tooltip = $this->constructTooltip($sect_data['code']);
|
||||
|
||||
return "<li><a class=\"reference internal\" href=\"#$id\" id=\"id$sect_num\" $tooltip>$title</a></li>\n";
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the start of a section (using <h1>)
|
||||
*
|
||||
* @param int $sect_num The desired section number
|
||||
*
|
||||
* @return nothing
|
||||
*/
|
||||
protected function startSection($sect_num)
|
||||
{
|
||||
$sect_data = $this->sections[$sect_num];
|
||||
$id = $sect_data['id'];
|
||||
$text_code = $sect_data['code'];
|
||||
$tooltip = $this->constructTooltip($sect_data['code']);
|
||||
$title = $sect_data['title'];
|
||||
$hclass = 'class="toc-backref"';
|
||||
$html = "<div class=\"section\" id=\"$id\">\n";
|
||||
$html .= "<h1><a $hclass href=\"#id$sect_num\" $tooltip>$title</a></h1>\n";
|
||||
echo $html;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the end of a section
|
||||
*
|
||||
* @param int $sect_num The desired section number
|
||||
*
|
||||
* @return nothing
|
||||
*/
|
||||
protected function endSection($sect_num)
|
||||
{
|
||||
echo "</div><?-- end of section $sect_num -->\n";
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the start of a subsection (using <h2>)
|
||||
*
|
||||
* @param array $sect_data An array of data for the subsection (providing 'id' and 'title')
|
||||
*
|
||||
* @return nothing
|
||||
*/
|
||||
protected function startSubSection($sect_data)
|
||||
{
|
||||
$id = $sect_data['id'];
|
||||
$code = $sect_data['code'];
|
||||
$title = JText::_($code);
|
||||
$tooltip = $this->constructTooltip($code);
|
||||
|
||||
$html = "<div class=\"section\" id=\"$id\">\n";
|
||||
$html .= "<h2 $tooltip>$title</h2>\n";
|
||||
echo $html;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the start of a subsection (using <h2>)
|
||||
*
|
||||
* @param string $title The subsection title (should be same as in the start)
|
||||
*
|
||||
* @return nothing
|
||||
*/
|
||||
protected function endSubSection($title)
|
||||
{
|
||||
echo "</div><?-- end of subsection $title -->\n";
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct an admonition (note, warning, hint, etc)
|
||||
*
|
||||
* @param string $type The type of admonition (hint, note, important, warning)
|
||||
* @param string $type_code Language token for the name of the admonition (eg, $type)
|
||||
* @param array $text_codes Array of Language tokens for the body text (as separate paragraphs in the admonition)
|
||||
* @param array $replacements Array of replacements to be applied to the body text (see replace functin)
|
||||
* @param bool $terminate Whether to terminatate the <div> that contains the note
|
||||
*
|
||||
* @return nothing
|
||||
*/
|
||||
protected function addAdmonition($type, $type_code, $text_codes, $replacements = null, $terminate = true)
|
||||
{
|
||||
if (!is_array($text_codes))
|
||||
{
|
||||
$text_codes = Array($text_codes);
|
||||
}
|
||||
|
||||
$title = JText::_($type_code);
|
||||
$tooltip = $this->constructTooltip($type_code);
|
||||
|
||||
$html = "<div class=\"$type\">\n";
|
||||
$html .= " <p class=\"first admonition-title\" $tooltip>$title</p>\n";
|
||||
|
||||
foreach ($text_codes as $text_code)
|
||||
{
|
||||
$text = $this->replace(JText::_($text_code), $replacements);
|
||||
$tooltip = $this->constructTooltip($text_code);
|
||||
$html .= " <p class=\"last\" $tooltip>$text</p>\n";
|
||||
}
|
||||
|
||||
if ( $terminate )
|
||||
{
|
||||
$html .= "</div>\n";
|
||||
}
|
||||
|
||||
echo $html;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the end the admonition
|
||||
*
|
||||
* @return nothing
|
||||
*/
|
||||
protected function endAdmonition()
|
||||
{
|
||||
echo "</div>\n";
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a 'hint' admonition
|
||||
*
|
||||
* @param array $text_codes Array of Language tokens for the body text (as separate paragraphs in the admonition)
|
||||
* @param array $replacements Array of replacements to be applied to the body text (see replace functin)
|
||||
* @param bool $terminate Whether to terminatate the <div> that contains the note
|
||||
*
|
||||
* @return nothing
|
||||
*/
|
||||
protected function addHint($text_codes, $replacements = null, $terminate = true)
|
||||
{
|
||||
echo $this->addAdmonition('hint', 'ATTACH_HELP_HINT', $text_codes, $replacements, $terminate);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add an 'important' admonition
|
||||
*
|
||||
* @param array $text_codes Array of Language tokens for the body text (as separate paragraphs in the admonition)
|
||||
* @param array $replacements Array of replacements to be applied to the body text (see replace functin)
|
||||
* @param bool $terminate Whether to terminatate the <div> that contains the note
|
||||
*
|
||||
* @return nothing
|
||||
*/
|
||||
protected function addImportant($text_codes, $replacements = null, $terminate = true)
|
||||
{
|
||||
echo $this->addAdmonition('important', 'ATTACH_HELP_IMPORTANT', $text_codes, $replacements, $terminate);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a 'note' admonition
|
||||
*
|
||||
* @param array $text_codes Array of Language tokens for the body text (as separate paragraphs in the admonition)
|
||||
* @param array $replacements Array of replacements to be applied to the body text (see replace functin)
|
||||
* @param bool $terminate Whether to terminatate the <div> that contains the note
|
||||
*
|
||||
* @return nothing
|
||||
*/
|
||||
protected function addNote($text_codes, $replacements = null, $terminate = true)
|
||||
{
|
||||
echo $this->addAdmonition('note', 'ATTACH_HELP_NOTE', $text_codes, $replacements, $terminate);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a 'warning' admonition
|
||||
*
|
||||
* @param array $text_codes Array of Language tokens for the body text (as separate paragraphs in the admonition)
|
||||
* @param array $replacements Array of replacements to be applied to the body text (see replace functin)
|
||||
* @param bool $terminate Whether to terminatate the <div> that contains the note
|
||||
*
|
||||
* @return nothing
|
||||
*/
|
||||
protected function addWarning($text_codes, $replacements = null, $terminate = true)
|
||||
{
|
||||
echo $this->addAdmonition('warning', 'ATTACH_HELP_WARNING', $text_codes, $replacements, $terminate);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a paragraph
|
||||
*
|
||||
* @param array $text_codes Array of Language tokens for the body text (as separate paragraphs)
|
||||
* @param array $replacements Array of replacements to be applied to the text (see replace functin)
|
||||
* @param string $pclass The class for the paragraph HTML <p> element
|
||||
*
|
||||
* @return nothing
|
||||
*/
|
||||
protected function addParagraph($text_codes, $replacements = null, $pclass = null)
|
||||
{
|
||||
if (!is_array($text_codes))
|
||||
{
|
||||
$text_codes = Array($text_codes);
|
||||
}
|
||||
|
||||
$html = '';
|
||||
|
||||
foreach ($text_codes as $text_code)
|
||||
{
|
||||
$text = $this->replace(JText::_($text_code), $replacements);
|
||||
$tooltip = $this->constructTooltip($text_code);
|
||||
|
||||
if ($pclass)
|
||||
{
|
||||
$html .= "<p class=\"$pclass hasTip\" $tooltip>" . $text . "</p>\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
$html .= "<p class=\"hasTip\" $tooltip>" . $text . "</p>\n";
|
||||
}
|
||||
}
|
||||
|
||||
echo $html;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a preformatted block
|
||||
*
|
||||
* @param string $text The raw string to print literally
|
||||
* @param string $class The class for the HTML <pre> block
|
||||
*
|
||||
* @return nothing
|
||||
*/
|
||||
protected function addPreBlock($text, $class='literal-block')
|
||||
{
|
||||
$html = "<pre class=\"$class\">\n";
|
||||
$html .= $text . "\n";
|
||||
$html .= "</pre>\n";
|
||||
echo $html;
|
||||
}
|
||||
|
||||
/**
|
||||
* Start an a list (unordered by default)
|
||||
*
|
||||
* @param string $type The type of list (defaults to unordered <ul>)
|
||||
* @param string $class The class for the HTML <ul> or <ol> element
|
||||
*
|
||||
* @return nothing
|
||||
*/
|
||||
protected function startList($type = 'ul', $class='simple')
|
||||
{
|
||||
echo "<$type class=\"$class\">\n";
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a list element
|
||||
*
|
||||
* @param array $text_codes Array of Language tokens for the body text (as separate paragraphs inside the list element)
|
||||
* @param array $replacements Array of replacements to be applied to the text (see replace function)
|
||||
* @param bool $terminate Whether to terminatate the <li> that contains the text
|
||||
*
|
||||
* @return nothing
|
||||
*/
|
||||
protected function addListElement($text_codes, $replacements = null, $terminate = true)
|
||||
{
|
||||
$html = '<li>';
|
||||
|
||||
if (!is_array($text_codes))
|
||||
{
|
||||
$text_codes = Array($text_codes);
|
||||
}
|
||||
foreach ($text_codes as $text_code)
|
||||
{
|
||||
$text = $this->replace(JText::_($text_code), $replacements);
|
||||
$tooltip = $this->constructTooltip($text_code);
|
||||
$html .= "<p class=\"hasTip\" $tooltip>$text</p>\n";
|
||||
}
|
||||
|
||||
if ($terminate)
|
||||
{
|
||||
$html .= "</li>\n";
|
||||
}
|
||||
|
||||
echo $html;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a list element for a definition for a term (a word or phrase)
|
||||
*
|
||||
* @param array $text_codes Array of Language tokens for the body text (as separate paragraphs inside the list element)
|
||||
* @param array $replacements Array of replacements to be applied to the text (see replace function)
|
||||
* @param bool $terminate Whether to terminatate the <li> that contains the text
|
||||
*
|
||||
* @return nothing
|
||||
*/
|
||||
protected function addDefinitionListElement($term_code, $definition_codes,
|
||||
$replacements = null, $terminate = true)
|
||||
{
|
||||
// Set up the term
|
||||
$term_tooltip = $this->constructTooltip($term_code);
|
||||
if ($term_tooltip)
|
||||
{
|
||||
$term_tooltip = " class=\"hasTip\" ".$term_tooltip;
|
||||
}
|
||||
$html = "<li><strong $term_tooltip>".JText::_($term_code).':</strong> ';
|
||||
|
||||
// Add the definition
|
||||
if (!is_array($definition_codes))
|
||||
{
|
||||
$definition_codes = Array($definition_codes);
|
||||
}
|
||||
foreach ($definition_codes as $text_code)
|
||||
{
|
||||
$text = $this->replace(JText::_($text_code), $replacements);
|
||||
$tooltip = $this->constructTooltip($text_code);
|
||||
$html .= "<p class=\"hasTip\" $tooltip>$text</p>\n";
|
||||
}
|
||||
|
||||
if ($terminate)
|
||||
{
|
||||
$html .= "</li>\n";
|
||||
}
|
||||
|
||||
echo $html;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the ending of a list element (use with unterminated list element)
|
||||
*
|
||||
* @return nothing
|
||||
*/
|
||||
protected function endListElement()
|
||||
{
|
||||
echo "</li>\n";
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a link as a list element
|
||||
*
|
||||
* @param string $url the URL of the link
|
||||
* @param string $text_code the language token for the text of the link
|
||||
*
|
||||
* @return nothing
|
||||
*/
|
||||
protected function addListElementLink($url, $text_code)
|
||||
{
|
||||
$text = $this->replace(JText::_($text_code), Array('{LINK}' => $url));
|
||||
$tooltip = $this->constructTooltip($text_code);
|
||||
echo "<li><a class=\"reference external\" $tooltip href=\"$url\">$text</a></li>\n";
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a list elment with raw HTML
|
||||
*
|
||||
* @param string $html The HTML to insert into the list element
|
||||
*
|
||||
* @return nothing
|
||||
*/
|
||||
protected function addListElementHtml($html)
|
||||
{
|
||||
echo "<li>$html</li>\n";
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the end of a list
|
||||
*
|
||||
* @param string $type The class for the HTML </ul> or </ol> element
|
||||
*
|
||||
* @return nothing
|
||||
*/
|
||||
protected function endList($type = 'ul')
|
||||
{
|
||||
echo "</$type>\n";
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a line break
|
||||
*
|
||||
* @return nothing
|
||||
*/
|
||||
protected function addLineBreak()
|
||||
{
|
||||
echo "<br/>\n";
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a figure: and image with an optional caption
|
||||
*
|
||||
* @param string $filename Filename for the image (full path)
|
||||
* @param string $alt_code Language token for the text to be use for the 'alt' attribute
|
||||
* @param string $caption_code Language token for the text to use for the caption (OPTIONAL)
|
||||
* @param string $dclass Class for the figure div
|
||||
* @param string $img_attribs attributes for the 'img' html tag
|
||||
*
|
||||
* @return nothing
|
||||
*/
|
||||
protected function addFigure($filename, $alt_code, $caption_code = null, $dclass = 'figure', $img_attribs=array())
|
||||
{
|
||||
$html = "<div class=\"$dclass\">\n";
|
||||
$html .= $this->image($filename, $alt_code, $img_attribs) . "\n";
|
||||
|
||||
if ( $caption_code )
|
||||
{
|
||||
$html .= "<p class=\"caption\" title=\"$caption_code\">" . JText::_($caption_code) . "</p>\n";
|
||||
}
|
||||
|
||||
$html .= '</div>';
|
||||
echo $html;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return an image URL if the file is found
|
||||
*
|
||||
* @param string $filename Filename for the image in the media folder (more below)
|
||||
* @param string $alt_code Language code for text to be inserted into the alt='text' attribute
|
||||
* @param array $attribs Attributes to be added to the image URL
|
||||
*
|
||||
* The file location uses the JHtml::image() function call which expects
|
||||
* to find images in the [base]/media/com_attachments/images directory.
|
||||
* This function has the necessary checks to add level of language folders
|
||||
* (like the translation files). For instance:
|
||||
*
|
||||
* For a file:
|
||||
* [base]/media/com_attachments/images/en-GB/test1.png
|
||||
* Use:
|
||||
* $this->image('com_attachments/test1.png')
|
||||
*
|
||||
* The language tag will be handled automatically.
|
||||
*
|
||||
* @return string image URL (or null if the image was not found)
|
||||
*/
|
||||
protected function image($filename, $alt_code, $attribs = Array())
|
||||
{
|
||||
$lcode = $this->lang->getTag();
|
||||
$alt = '';
|
||||
|
||||
if ($alt_code)
|
||||
{
|
||||
$alt = JText::_($alt_code);
|
||||
}
|
||||
|
||||
// First try the current language
|
||||
$found = JHtml::image('com_attachments/help/' . $lcode . '/' . $filename, $alt, $attribs, true, true);
|
||||
|
||||
if ($found)
|
||||
{
|
||||
return JHtml::image('com_attachments/help/' . $lcode . '/' . $filename, $alt, $attribs, true);
|
||||
}
|
||||
|
||||
// If that fails, return the English/en-GB image
|
||||
if ( $lcode != 'en-GB' )
|
||||
{
|
||||
return JHtml::image('com_attachments/help/en-GB/' . $filename, $alt, $attribs, true);
|
||||
}
|
||||
|
||||
// The image was not found for either language so return nothing
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
@ -0,0 +1,682 @@
|
||||
<?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();
|
||||
|
||||
// Load the tooltip behavior.
|
||||
// JHtml::_('behavior.tooltip');
|
||||
|
||||
// Add the CSS for the attachments list (whether we need it or not)
|
||||
JHtml::stylesheet('com_attachments/attachments_help.css', array(), true);
|
||||
|
||||
// If the user specifies 'show=codes' in the url, the language item codes will
|
||||
// be shown by default. Note that they can still be toggled with the toggles
|
||||
// at the top right and bottom right of the page.
|
||||
if (JRequest::getCmd('show') == 'codes') {
|
||||
JHtml::stylesheet('com_attachments/attachments_help_show_codes.css', array(), true);
|
||||
}
|
||||
|
||||
// Define the section constants
|
||||
define('SECT_INTRO', 1);
|
||||
define('SECT_NEW_V3', 2);
|
||||
define('SECT_FEAT', 3);
|
||||
define('SECT_UPLOAD', 4);
|
||||
define('SECT_SETNGS', 5);
|
||||
define('SECT_PERMS', 6);
|
||||
define('SECT_ACCESS', 7);
|
||||
define('SECT_DISPLY', 8);
|
||||
define('SECT_ATTACH', 9);
|
||||
define('SECT_FILES', 10);
|
||||
define('SECT_STYLE', 11);
|
||||
define('SECT_ICONS', 12);
|
||||
define('SECT_UTILS', 13);
|
||||
define('SECT_WARN', 14);
|
||||
define('SECT_UPGRAD', 15);
|
||||
define('SECT_UNINST', 16);
|
||||
define('SECT_MIGRAT', 17);
|
||||
define('SECT_TRANS', 18);
|
||||
define('SECT_ACKNOW', 19);
|
||||
define('SECT_CONTCT', 20);
|
||||
|
||||
$this->saveSectionInfo(SECT_INTRO, 'introduction', 'ATTACH_HELP_010000_SECTION_TITLE');
|
||||
$this->saveSectionInfo(SECT_NEW_V3, 'v3-features', 'ATTACH_HELP_020000_SECTION_TITLE');
|
||||
$this->saveSectionInfo(SECT_FEAT, 'features', 'ATTACH_HELP_030000_SECTION_TITLE');
|
||||
$this->saveSectionInfo(SECT_UPLOAD, 'uploading', 'ATTACH_HELP_040000_SECTION_TITLE');
|
||||
$this->saveSectionInfo(SECT_SETNGS, 'settings', 'ATTACH_HELP_050000_SECTION_TITLE');
|
||||
$this->saveSectionInfo(SECT_PERMS, 'permissions', 'ATTACH_HELP_060000_SECTION_TITLE');
|
||||
$this->saveSectionInfo(SECT_ACCESS, 'access-levels', 'ATTACH_HELP_070000_SECTION_TITLE');
|
||||
$this->saveSectionInfo(SECT_DISPLY, 'display-filenames', 'ATTACH_HELP_080000_SECTION_TITLE');
|
||||
$this->saveSectionInfo(SECT_ATTACH, 'attaching-urls', 'ATTACH_HELP_090000_SECTION_TITLE');
|
||||
$this->saveSectionInfo(SECT_FILES, 'attached-to-what', 'ATTACH_HELP_100000_SECTION_TITLE');
|
||||
$this->saveSectionInfo(SECT_STYLE, 'css-styling', 'ATTACH_HELP_110000_SECTION_TITLE');
|
||||
$this->saveSectionInfo(SECT_ICONS, 'file-type-icons', 'ATTACH_HELP_120000_SECTION_TITLE');
|
||||
$this->saveSectionInfo(SECT_UTILS, 'admin-utilities', 'ATTACH_HELP_130000_SECTION_TITLE');
|
||||
$this->saveSectionInfo(SECT_WARN, 'warnings', 'ATTACH_HELP_140000_SECTION_TITLE');
|
||||
$this->saveSectionInfo(SECT_UPGRAD, 'upgrading', 'ATTACH_HELP_150000_SECTION_TITLE');
|
||||
$this->saveSectionInfo(SECT_UNINST, 'uninstalling', 'ATTACH_HELP_160000_SECTION_TITLE');
|
||||
$this->saveSectionInfo(SECT_MIGRAT, 'migration', 'ATTACH_HELP_170000_SECTION_TITLE');
|
||||
$this->saveSectionInfo(SECT_TRANS, 'translations', 'ATTACH_HELP_180000_SECTION_TITLE');
|
||||
$this->saveSectionInfo(SECT_ACKNOW, 'acknowledgments', 'ATTACH_HELP_190000_SECTION_TITLE');
|
||||
$this->saveSectionInfo(SECT_CONTCT, 'contact', 'ATTACH_HELP_200000_SECTION_TITLE');
|
||||
|
||||
|
||||
// A few other miscellaneous items
|
||||
|
||||
$tlc = JText::_('ATTACH_HELP_TOGGLE_LANGUAGE_CODES');
|
||||
|
||||
$onContentPrepare = "<tt class=\"docutils literal\">'onContentPrepare'</tt>";
|
||||
|
||||
$main_title_tooltip = $this->constructTooltip('ATTACH_HELP_000000_MAIN_TITLE');
|
||||
$main_version_tooltip = $this->constructTooltip('ATTACH_HELP_000100_MAIN_VERSION');
|
||||
|
||||
$toggle_img = JURI::root(true).'/media/system/images/tooltip.png';
|
||||
|
||||
?>
|
||||
<div class="help-document">
|
||||
<div class="header">
|
||||
<a id="tc_toggle" title="<? echo $tlc ?>" href="<?php echo $this->toggledURL() ?>"><img src="<?php echo $toggle_img ?>"></a>
|
||||
<h1 class="title" <?php echo $main_title_tooltip ?>><?php echo $this->logo_img ?><?php echo JText::_('ATTACH_HELP_000000_MAIN_TITLE') ?></h1>
|
||||
<hr class="header"/>
|
||||
</div>
|
||||
<div class="main">
|
||||
|
||||
<p class="version"><strong><?php echo $this->version . ' - ' . $this->date ?></strong></p>
|
||||
<p><strong<?php echo $main_version_tooltip ?>><?php echo JText::_('ATTACH_HELP_000100_MAIN_VERSION') ?></strong></p>
|
||||
|
||||
<?php
|
||||
// ------------------------------------------------------------
|
||||
// Add the table of contents
|
||||
$this->tableOfContents('ATTACH_HELP_000200_MAIN_CONTENTS');
|
||||
|
||||
// ------------------------------------------------------------
|
||||
// Introduction
|
||||
$this->startSection(SECT_INTRO);
|
||||
$this->addParagraph( 'ATTACH_HELP_010100_TEXT');
|
||||
$this->addWarning( 'ATTACH_HELP_010200_WARNING');
|
||||
$this->addNote( 'ATTACH_HELP_010300_NOTE');
|
||||
$this->addParagraph('ATTACH_HELP_010400_TEXT', Array( '{SECT_TRANS}' => $this->sectionLink(SECT_TRANS) ));
|
||||
$this->addParagraph('ATTACH_HELP_010500_TEXT');
|
||||
$this->startList();
|
||||
$email_list_url = 'http://jmcameron.net/attachments/email-list.html';
|
||||
$email_list_text = JText::sprintf('ATTACH_HELP_010600_TEXT', $email_list_url);
|
||||
$this->addListElementHtml("<a class=\"reference external\" href=\"$email_list_url\">$email_list_text</a>");
|
||||
$this->endList();
|
||||
$this->endSection(SECT_INTRO);
|
||||
|
||||
// ------------------------------------------------------------
|
||||
// New features in Version 3.1
|
||||
$this->startSection(SECT_NEW_V3);
|
||||
$this->startList();
|
||||
$this->addListElement('ATTACH_HELP_020100_TEXT');
|
||||
$this->addListElement('ATTACH_HELP_020200_TEXT');
|
||||
$this->addListElement('ATTACH_HELP_020300_TEXT');
|
||||
$this->addListElement('ATTACH_HELP_020400_TEXT');
|
||||
$this->endList();
|
||||
$this->endSection(SECT_NEW_V3);
|
||||
|
||||
// ------------------------------------------------------------
|
||||
// Major features of the Attachments Extension
|
||||
$this->startSection(SECT_FEAT);
|
||||
$this->startList();
|
||||
$this->addListElement('ATTACH_HELP_030100_TEXT', Array( '{SECT_PERMS}' => $this->sectionLink(SECT_PERMS) ));
|
||||
$this->addListElement('ATTACH_HELP_030200_TEXT', Array( '{SECT_ACCESS}' => $this->sectionLink(SECT_ACCESS) ));
|
||||
$this->addListElement('ATTACH_HELP_030300_TEXT');
|
||||
$this->addListElement('ATTACH_HELP_030400_TEXT');
|
||||
$this->addListElement('ATTACH_HELP_030500_TEXT');
|
||||
$this->addListElement('ATTACH_HELP_030600_TEXT');
|
||||
$this->addListElement('ATTACH_HELP_030700_TEXT');
|
||||
$this->addListElement('ATTACH_HELP_030800_TEXT');
|
||||
$this->startList();
|
||||
$this->addListElement('ATTACH_HELP_030900_TEXT');
|
||||
$this->addListElement('ATTACH_HELP_031000_TEXT');
|
||||
$this->addListElement('ATTACH_HELP_031100_TEXT');
|
||||
$this->addListElement('ATTACH_HELP_031200_TEXT');
|
||||
$this->addListElement('ATTACH_HELP_031300_TEXT',
|
||||
Array( '{SECT_FILES}' => $this->sectionLink(SECT_FILES),
|
||||
'{ONCONTENTPREPARE}' => $onContentPrepare));
|
||||
$this->endList();
|
||||
$this->endList();
|
||||
$this->endSection(SECT_FEAT);
|
||||
|
||||
// ------------------------------------------------------------
|
||||
// Uploading Restrictions
|
||||
$this->startSection(SECT_UPLOAD);
|
||||
$this->addParagraph('ATTACH_HELP_040100_TEXT');
|
||||
$this->addWarning( 'ATTACH_HELP_040200_WARNING');
|
||||
$this->endSection(SECT_UPLOAD);
|
||||
|
||||
// ------------------------------------------------------------
|
||||
// Attachments Settings
|
||||
$this->startSection(SECT_SETNGS);
|
||||
$this->addParagraph('ATTACH_HELP_050100_TEXT');
|
||||
$this->addNote( 'ATTACH_HELP_050150_NOTE');
|
||||
|
||||
// Basic Options
|
||||
$this->startSubSection(Array( 'id' => 'basic-options',
|
||||
'code' => 'ATTACH_HELP_050200_SUBSECTION_TITLE'));
|
||||
echo $this->image('options-basic.png', 'ATTACH_HELP_050200_SUBSECTION_TITLE',
|
||||
'class="float-right drop-shadow"') . "\n";
|
||||
$this->startList();
|
||||
$this->addDefinitionListElement('ATTACH_ATTACHMENTS_PUBLISHED_BY_DEFAULT',
|
||||
'ATTACH_HELP_050300_TEXT');
|
||||
$this->addDefinitionListElement('ATTACH_AUTO_PUBLISH_WARNING',
|
||||
'ATTACH_HELP_050400_TEXT');
|
||||
$this->addDefinitionListElement('ATTACH_DEFAULT_ACCESS_LEVEL',
|
||||
'ATTACH_DEFAULT_ACCESS_LEVEL_DESCRIPTION');
|
||||
$this->addListElement('ATTACH_HELP_050600_TEXT');
|
||||
$this->addHint( 'ATTACH_HELP_050700_HINT_TEXT');
|
||||
$this->addDefinitionListElement('ATTACH_MAX_FILENAME_URL_LENGTH',
|
||||
'ATTACH_HELP_050800_TEXT');
|
||||
$this->addDefinitionListElement('ATTACH_WHERE_SHOULD_ATTACHMENTS_BE_PLACED',
|
||||
'ATTACH_HELP_050900_TEXT', null, false);
|
||||
$this->startList();
|
||||
$this->addListElement('ATTACH_HELP_051000_TEXT');
|
||||
$this->addListElement('ATTACH_HELP_051100_TEXT');
|
||||
$this->addListElement('ATTACH_HELP_051200_TEXT', null, false);
|
||||
$this->addWarning('ATTACH_HELP_051300_WARNING');
|
||||
$this->endListElement();
|
||||
$this->addParagraph( 'ATTACH_HELP_051400_TEXT', null, 'noindent');
|
||||
$this->addPreBlock("<span class="hide">{attachments}</span>");
|
||||
$this->addParagraph( 'ATTACH_HELP_051500_TEXT', null, 'noindent');
|
||||
$this->addWarning( 'ATTACH_HELP_051600_WARNING');
|
||||
$this->addListElement('ATTACH_HELP_051700_TEXT');
|
||||
$this->addListElement('ATTACH_HELP_051800_TEXT');
|
||||
$this->endListElement();
|
||||
$this->endList();
|
||||
$this->endListElement();
|
||||
$this->addDefinitionListElement('ATTACH_ALLOW_FRONTEND_ACCESS_LEVEL_EDITING',
|
||||
'ATTACH_ALLOW_FRONTEND_ACCESS_LEVEL_EDITING_DESCRIPTION');
|
||||
$this->endList();
|
||||
$this->endSubSection('basic-options');
|
||||
|
||||
// Formatting options
|
||||
$this->startSubSection(Array( 'id' => 'formatting-options',
|
||||
'code' => 'ATTACH_HELP_052000_SUBSECTION_TITLE'));
|
||||
echo $this->image('options-formatting.png', 'ATTACH_HELP_052000_SUBSECTION_TITLE',
|
||||
'class="float-right drop-shadow"') . "\n";
|
||||
$this->startList();
|
||||
$this->addListElement('ATTACH_HELP_052100_TEXT');
|
||||
$this->addListElement('ATTACH_HELP_052200_TEXT');
|
||||
$this->addListElement('ATTACH_HELP_052300_TEXT');
|
||||
$this->addListElement('ATTACH_HELP_052400_TEXT');
|
||||
$this->addListElement('ATTACH_HELP_052500_TEXT', null, false);
|
||||
$this->addWarning('ATTACH_HELP_052600_WARNING');
|
||||
$this->endListElement();
|
||||
$this->addListElement('ATTACH_HELP_052650_TEXT');
|
||||
$this->addListElement('ATTACH_HELP_052700_TEXT');
|
||||
$this->addListElement('ATTACH_HELP_052800_TEXT',
|
||||
Array('{DESC}' => JText::_('ATTACH_FORMAT_STRING_FOR_DATES_DESCRIPTION')));
|
||||
$this->addListElement('ATTACH_HELP_052900_TEXT', null, false);
|
||||
$this->startList('ol', 'arabic simple');
|
||||
$this->addListElement('ATTACH_HELP_053000_TEXT',
|
||||
Array('{LABEL}' => JText::_('ATTACH_SORT_FILENAME')));
|
||||
$this->addListElement('ATTACH_HELP_053100_TEXT',
|
||||
Array('{LABEL}' => JText::_('ATTACH_SORT_FILENAME_DESCENDING')));
|
||||
$this->addListElement('ATTACH_HELP_053200_TEXT',
|
||||
Array('{LABEL}' => JText::_('ATTACH_SORT_FILE_SIZE')));
|
||||
$this->addListElement('ATTACH_HELP_053300_TEXT',
|
||||
Array('{LABEL}' => JText::_('ATTACH_SORT_FILE_SIZE_DESCENDING')));
|
||||
$this->addListElement('ATTACH_HELP_053400_TEXT',
|
||||
Array('{LABEL}' => JText::_('ATTACH_SORT_DESCRIPTION')));
|
||||
$this->addListElement('ATTACH_HELP_053500_TEXT',
|
||||
Array('{LABEL}' => JText::_('ATTACH_SORT_DESCRIPTION_DESCENDING')));
|
||||
$this->addListElement('ATTACH_HELP_053600_TEXT',
|
||||
Array('{LABEL}' => JText::_('ATTACH_SORT_DISPLAY_FILENAME_OR_URL')));
|
||||
$this->addListElement('ATTACH_HELP_053700_TEXT',
|
||||
Array('{LABEL}' => JText::_('ATTACH_SORT_DISPLAY_FILENAME_OR_URL_DESCENDING')));
|
||||
$this->addListElement('ATTACH_HELP_053800_TEXT',
|
||||
Array('{LABEL}' => JText::_('ATTACH_CREATOR')));
|
||||
$this->addListElement('ATTACH_HELP_053900_TEXT',
|
||||
Array('{LABEL}' => JText::_('ATTACH_SORT_CREATED_DATE')));
|
||||
$this->addListElement('ATTACH_HELP_054000_TEXT',
|
||||
Array('{LABEL}' => JText::_('ATTACH_SORT_CREATED_DATE_DESCENDING')));
|
||||
$this->addListElement('ATTACH_HELP_054100_TEXT',
|
||||
Array('{LABEL}' => JText::_('ATTACH_SORT_MODIFICATION_DATE')));
|
||||
$this->addListElement('ATTACH_HELP_054200_TEXT',
|
||||
Array('{LABEL}' => JText::_('ATTACH_SORT_MODIFICATION_DATE_DESCENDING')));
|
||||
$this->addListElement('ATTACH_HELP_054300_TEXT',
|
||||
Array('{LABEL}' => JText::_('ATTACH_SORT_ATTACHMENT_ID')));
|
||||
$this->addListElement('ATTACH_HELP_054400_TEXT',
|
||||
Array('{LABEL}' => JText::_('ATTACH_USER_DEFINED_FIELD_1')));
|
||||
$this->addListElement('ATTACH_HELP_054500_TEXT',
|
||||
Array('{LABEL}' => JText::_('ATTACH_USER_DEFINED_FIELD_2')));
|
||||
$this->addListElement('ATTACH_HELP_054600_TEXT',
|
||||
Array('{LABEL}' => JText::_('ATTACH_USER_DEFINED_FIELD_3')));
|
||||
$this->endList();
|
||||
$this->endListElement();
|
||||
$this->endList();
|
||||
$this->endSubSection('formatting-options');
|
||||
|
||||
// Visibilty Options
|
||||
$this->startSubSection(Array( 'id' => 'visibility-options',
|
||||
'code' => 'ATTACH_HELP_055000_SUBSECTION_TITLE'));
|
||||
echo $this->image('options-visibility.png', 'ATTACH_HELP_055000_SUBSECTION_TITLE',
|
||||
'class="float-right drop-shadow"') . "\n";
|
||||
$this->addParagraph('ATTACH_HELP_055100_TEXT');
|
||||
$this->startList();
|
||||
$this->addListElement('ATTACH_HELP_055200_TEXT');
|
||||
$this->addListElement('ATTACH_HELP_055300_TEXT');
|
||||
$this->addListElement('ATTACH_HELP_055400_TEXT');
|
||||
$this->addListElement('ATTACH_HELP_055500_TEXT');
|
||||
$this->addListElement('ATTACH_HELP_055600_TEXT');
|
||||
$this->addListElement('ATTACH_HELP_055700_TEXT');
|
||||
$this->addListElement('ATTACH_HELP_055800_TEXT',
|
||||
Array('{DESCRIPTION}' => JText::_('ATTACH_SHOW_GUEST_ACCESS_LEVELS_DESCRIPTION')));
|
||||
$this->addListElement('ATTACH_HELP_055900_TEXT');
|
||||
$this->endList();
|
||||
$this->endSubSection('visibility-options');
|
||||
|
||||
// Advanced Options
|
||||
$this->startSubSection(Array( 'id' => 'advanced-options',
|
||||
'code' => 'ATTACH_HELP_057000_SUBSECTION_TITLE'));
|
||||
echo $this->image('options-advanced.png', 'ATTACH_HELP_057000_SUBSECTION_TITLE',
|
||||
'class="float-right drop-shadow"') . "\n";
|
||||
$this->startList();
|
||||
$this->addListElement('ATTACH_HELP_057050_TEXT',
|
||||
Array('{DESCRIPTION}' => JText::_('ATTACH_MAX_ATTACHMENT_SIZE_DESCRIPTION'),
|
||||
'{SECT_WARN}' => $this->sectionLink(SECT_WARN)));
|
||||
$this->addListElement('ATTACH_HELP_057100_TEXT');
|
||||
$this->addListElement('ATTACH_HELP_057200_TEXT', Array( '{SECT_STYLE}' => $this->sectionLink(SECT_STYLE) ));
|
||||
$this->addListElement('ATTACH_HELP_057300_TEXT');
|
||||
$blk1 = "<pre class=\"literal-block\">content/attachments/language/qq-QQ/qq-QQ.plg_content_attachments.ini</pre>\n";
|
||||
$blk2 = "<pre class=\"literal-block\">language/overrides/en-GB.override.ini</pre>\n";
|
||||
$this->addListElement('ATTACH_HELP_057400_TEXT', null, false);
|
||||
$this->addNote(Array('ATTACH_HELP_057500_NOTE', 'ATTACH_HELP_057600_NOTE'),
|
||||
Array('{BLOCK1}' => $blk1, '{BLOCK2}' => $blk2));
|
||||
$this->endListElement();
|
||||
$this->addListElement('ATTACH_HELP_057700_TEXT');
|
||||
$this->addListElement('ATTACH_HELP_057800_TEXT');
|
||||
$this->addListElement('ATTACH_HELP_057900_TEXT');
|
||||
$this->addListElement('ATTACH_HELP_057940_TEXT',
|
||||
Array('{DESCRIPTION}' => JText::_('ATTACH_URL_TO_LOGIN_DESCRIPTION')));
|
||||
$this->addListElement('ATTACH_HELP_057960_TEXT',
|
||||
Array('{DESCRIPTION}' => JText::_('ATTACH_URL_TO_REGISTER_DESCRIPTION')));
|
||||
$this->endList();
|
||||
$this->endSubSection('advanced-options');
|
||||
|
||||
// Security Options
|
||||
$this->startSubSection(Array( 'id' => 'security-options',
|
||||
'code' => 'ATTACH_HELP_058000_SUBSECTION_TITLE'));
|
||||
echo $this->image('options-security.png', 'ATTACH_HELP_058000_SUBSECTION_TITLE',
|
||||
'class="float-right drop-shadow"') . "\n";
|
||||
$this->startList();
|
||||
$this->addListElement(Array('ATTACH_HELP_058100_TEXT',
|
||||
'ATTACH_HELP_058200_TEXT',
|
||||
'ATTACH_HELP_058300_TEXT'), null, false);
|
||||
$this->addHint('ATTACH_HELP_058400_HINT');
|
||||
$this->endListElement();
|
||||
$this->addListElement('ATTACH_HELP_058500_TEXT', null, false);
|
||||
$this->startList();
|
||||
$this->addListElement('ATTACH_HELP_058600_TEXT');
|
||||
$this->addListElement('ATTACH_HELP_058700_TEXT');
|
||||
$this->endList();
|
||||
$this->addParagraph('ATTACH_HELP_058800_TEXT');
|
||||
$this->endListElement();
|
||||
$this->endList();
|
||||
$this->endSubSection('security-options');
|
||||
|
||||
// Permissions Options
|
||||
$this->startSubSection(Array( 'id' => 'permissions-options',
|
||||
'code' => 'ATTACH_HELP_059000_SUBSECTION_TITLE'));
|
||||
$this->addParagraph('ATTACH_HELP_059100_TEXT', Array( '{SECT_PERMS}' => $this->sectionLink(SECT_PERMS) ));
|
||||
$this->endSubSection('permissions-options');
|
||||
|
||||
$this->endSection(SECT_SETNGS);
|
||||
|
||||
// ------------------------------------------------------------
|
||||
// Attachments Permissions
|
||||
$this->startSection(SECT_PERMS);
|
||||
$this->addParagraph('ATTACH_HELP_060100_TEXT');
|
||||
$this->addParagraph('ATTACH_HELP_060200_TEXT');
|
||||
$this->addImportant('ATTACH_HELP_060300_IMPORTANT');
|
||||
$this->addParagraph('ATTACH_HELP_060400_TEXT');
|
||||
$this->addFigure( 'options-permissions.png',
|
||||
'ATTACH_HELP_060500_TEXT',
|
||||
'ATTACH_HELP_060600_TEXT',
|
||||
'figure width50', 'class="drop-shadow"');
|
||||
|
||||
$this->addParagraph('ATTACH_HELP_060700_TEXT');
|
||||
$this->startPermissionsTable( 'ATTACH_HELP_060800_TEXT',
|
||||
'ATTACH_HELP_060900_TEXT',
|
||||
'ATTACH_HELP_061000_TEXT' );
|
||||
$this->addPermissionsTableRow('ATTACH_PERMISSION_ADMIN_COMPONENT',
|
||||
'ATTACH_PERMISSION_ADMIN_COMPONENT_DESC', 'core.admin');
|
||||
$this->addPermissionsTableRow('ATTACH_PERMISSION_MANAGE_COMPONENT',
|
||||
'ATTACH_PERMISSION_MANAGE_COMPONENT_DESC', 'core.manage');
|
||||
$this->addPermissionsTableRow('ATTACH_PERMISSION_CREATE',
|
||||
'ATTACH_PERMISSION_CREATE_DESC', 'core.create');
|
||||
$this->addPermissionsTableRow('ATTACH_PERMISSION_DELETE',
|
||||
'ATTACH_PERMISSION_DELETE_DESC', 'core.delete');
|
||||
$this->addPermissionsTableRow('ATTACH_PERMISSION_EDIT',
|
||||
'ATTACH_PERMISSION_EDIT_DESC', 'core.edit');
|
||||
$this->addPermissionsTableRow('ATTACH_PERMISSION_EDITSTATE',
|
||||
'ATTACH_PERMISSION_EDITSTATE_DESC', 'core.edit.state');
|
||||
$this->addPermissionsTableRow('ATTACH_PERMISSION_EDITOWN',
|
||||
'ATTACH_PERMISSION_EDITOWN_DESC', 'core.edit.own');
|
||||
$this->addPermissionsTableRow('ATTACH_PERMISSION_EDITSTATE_OWN',
|
||||
'ATTACH_PERMISSION_EDITSTATE_OWN_DESC', 'attachments.edit.state.own');
|
||||
$this->addPermissionsTableRow('ATTACH_PERMISSION_DELETEOWN',
|
||||
'ATTACH_PERMISSION_DELETEOWN_DESC', 'attachments.delete.own');
|
||||
$this->addPermissionsTableRow('ATTACH_PERMISSION_EDIT_OWNPARENT',
|
||||
'ATTACH_PERMISSION_EDIT_OWNPARENT_DESC', 'attachments.edit.ownparent');
|
||||
$this->addPermissionsTableRow('ATTACH_PERMISSION_EDITSTATE_OWNPARENT',
|
||||
'ATTACH_PERMISSION_EDITSTATE_OWNPARENT_DESC', 'attachments.edit.state.ownparent');
|
||||
$this->addPermissionsTableRow('ATTACH_PERMISSION_DELETE_OWNPARENT',
|
||||
'ATTACH_PERMISSION_DELETE_OWNPARENT_DESC', 'attachments.delete.ownparent');
|
||||
$this->endPermissionsTable();
|
||||
|
||||
// Default permissions
|
||||
$this->startSubSection(Array( 'id' => 'default-permissions',
|
||||
'code' => 'ATTACH_HELP_062000_SUBSECTION_TITLE'));
|
||||
$this->addParagraph('ATTACH_HELP_062100_TEXT');
|
||||
$this->addAdmonition('important hide-title', 'ATTACH_HELP_IMPORTANT',
|
||||
'ATTACH_HELP_062200_IMPORTANT', null, false);
|
||||
$this->startList();
|
||||
$this->addListElement('ATTACH_HELP_062300_TEXT');
|
||||
$this->addListElement('ATTACH_HELP_062400_TEXT');
|
||||
$this->addListElement('ATTACH_HELP_062500_TEXT');
|
||||
$this->addListElement('ATTACH_HELP_062600_TEXT');
|
||||
$this->endList();
|
||||
$this->endAdmonition();
|
||||
$this->addParagraph('ATTACH_HELP_062700_TEXT');
|
||||
$this->endSubSection('default-permissions');
|
||||
|
||||
// Permissions for common scenarios
|
||||
$this->startSubSection(Array( 'id' => 'common-permissions-scenarios',
|
||||
'code' => 'ATTACH_HELP_063000_SUBSECTION_TITLE'));
|
||||
$this->addParagraph('ATTACH_HELP_063100_TEXT');
|
||||
$this->startList();
|
||||
$this->addListElement('ATTACH_HELP_063200_TEXT', null, false);
|
||||
$this->addLineBreak();
|
||||
$this->addParagraph('ATTACH_HELP_063300_TEXT');
|
||||
$this->addFigure( 'permissions-scenario1.png', 'ATTACH_HELP_063400_TEXT','','',
|
||||
'class="drop-shadow"');
|
||||
$this->endListElement();
|
||||
$this->addListElement('ATTACH_HELP_063500_TEXT', null, false);
|
||||
$this->addLineBreak();
|
||||
$this->addParagraph('ATTACH_HELP_063600_TEXT');
|
||||
$this->addFigure( 'permissions-scenario2.png', 'ATTACH_HELP_063700_TEXT','','',
|
||||
'class="drop-shadow"');
|
||||
$this->addParagraph('ATTACH_HELP_063800_TEXT');
|
||||
$this->addParagraph('ATTACH_HELP_063900_TEXT');
|
||||
$this->endListElement();
|
||||
$this->endList();
|
||||
$this->addParagraph('ATTACH_HELP_064000_TEXT');
|
||||
$this->endSubSection('common-permissions-scenarios');
|
||||
|
||||
// Permissions for common scenarios
|
||||
$this->startSubSection(Array( 'id' => 'other-notes-on-permissions',
|
||||
'code' => 'ATTACH_HELP_065000_SUBSECTION_TITLE'));
|
||||
$this->startList();
|
||||
$this->addListElement('ATTACH_HELP_065100_TEXT');
|
||||
$this->endList();
|
||||
$this->endSubSection('other-notes-on-permissions');
|
||||
|
||||
$this->endSection(SECT_PERMS);
|
||||
|
||||
// ------------------------------------------------------------
|
||||
// Access Levels Visibility Control
|
||||
$this->startSection(SECT_ACCESS);
|
||||
$this->addParagraph('ATTACH_HELP_070100_TEXT');
|
||||
$this->startList();
|
||||
$this->addListElement('ATTACH_HELP_070200_TEXT');
|
||||
$this->addListElement('ATTACH_HELP_070300_TEXT');
|
||||
$this->endList();
|
||||
$this->addParagraph('ATTACH_HELP_070400_TEXT');
|
||||
$this->addParagraph('ATTACH_HELP_070500_TEXT');
|
||||
$this->addNote( 'ATTACH_HELP_070600_NOTE');
|
||||
|
||||
$this->endSection(SECT_ACCESS);
|
||||
|
||||
// ------------------------------------------------------------
|
||||
// Display Filename or URL
|
||||
$this->startSection(SECT_DISPLY);
|
||||
$this->addParagraph('ATTACH_HELP_080100_TEXT');
|
||||
$this->endSection(SECT_DISPLY);
|
||||
|
||||
// ------------------------------------------------------------
|
||||
// Attaching URLs
|
||||
$this->startSection(SECT_ATTACH);
|
||||
$this->addParagraph('ATTACH_HELP_090100_TEXT');
|
||||
$this->startList();
|
||||
$this->addListElement('ATTACH_HELP_090200_TEXT');
|
||||
$this->addListElement('ATTACH_HELP_090300_TEXT');
|
||||
$this->endList();
|
||||
$this->addParagraph('ATTACH_HELP_090400_TEXT');
|
||||
$this->endSection(SECT_ATTACH);
|
||||
|
||||
// ------------------------------------------------------------
|
||||
// What Can Files Be Attached To?
|
||||
$this->startSection(SECT_FILES);
|
||||
$this->addParagraph('ATTACH_HELP_100100_TEXT',
|
||||
Array('{ONCONTENTPREPARE}' => $onContentPrepare) );
|
||||
$this->addWarning( 'ATTACH_HELP_100200_WARNING');
|
||||
$this->addParagraph('ATTACH_HELP_100300_TEXT');
|
||||
$this->startList();
|
||||
$manual_url = 'http://jmcameron.net/attachments/';
|
||||
$manual_url_text = JText::sprintf('ATTACH_HELP_100400_TEXT', $manual_url);
|
||||
$this->addListElementHtml("<a class=\"reference external\" href=\"$manual_url\">$manual_url_text</a>");
|
||||
$this->endList();
|
||||
$this->addWarning( 'ATTACH_HELP_100500_WARNING');
|
||||
$this->endSection(SECT_FILES);
|
||||
|
||||
// ------------------------------------------------------------
|
||||
// CSS Styling of Attachment Lists
|
||||
$this->startSection(SECT_STYLE);
|
||||
$this->addParagraph('ATTACH_HELP_110100_TEXT');
|
||||
$this->addParagraph('ATTACH_HELP_110200_TEXT');
|
||||
$this->addPreBlock("media/com_attachments/css/attachments_list.css\n\n to\n\ntemplates/TEMPLATE/css/com_attachments/");
|
||||
$this->addParagraph('ATTACH_HELP_110300_TEXT');
|
||||
$this->endSection(SECT_STYLE);
|
||||
|
||||
// ------------------------------------------------------------
|
||||
// File Type Icons
|
||||
$this->startSection(SECT_ICONS);
|
||||
$this->addParagraph('ATTACH_HELP_120100_TEXT');
|
||||
$this->startList('ol');
|
||||
$this->addListElement('ATTACH_HELP_120200_TEXT');
|
||||
$this->addListElement('ATTACH_HELP_120300_TEXT');
|
||||
$this->addListElement('ATTACH_HELP_120400_TEXT', null, false);
|
||||
$this->addParagraph('ATTACH_HELP_120500_TEXT', null, 'paragraph');
|
||||
$this->endListElement();
|
||||
$this->endList();
|
||||
$this->endSection(SECT_ICONS);
|
||||
|
||||
// ------------------------------------------------------------
|
||||
// Administrative Utility Commands
|
||||
$this->startSection(SECT_UTILS);
|
||||
$this->addParagraph('ATTACH_HELP_130100_TEXT');
|
||||
$this->startList();
|
||||
$this->addListElement('ATTACH_HELP_130200_TEXT');
|
||||
$this->addListElement('ATTACH_HELP_130300_TEXT');
|
||||
$this->addListElement('ATTACH_HELP_130400_TEXT', null, false);
|
||||
$this->addParagraph('ATTACH_HELP_130500_TEXT');
|
||||
$this->startList();
|
||||
$this->addListElement('ATTACH_HELP_130600_TEXT');
|
||||
$this->addListElement('ATTACH_HELP_130700_TEXT');
|
||||
$this->endList();
|
||||
$this->endListElement();
|
||||
$this->addListElement('ATTACH_HELP_130800_TEXT');
|
||||
$this->addListElement('ATTACH_HELP_130900_TEXT');
|
||||
$this->addListElement('ATTACH_HELP_131000_TEXT');
|
||||
$this->addListElement('ATTACH_HELP_131100_TEXT');
|
||||
$this->endList();
|
||||
$this->addNote( 'ATTACH_HELP_131200_NOTE');
|
||||
$this->endSection(SECT_UTILS);
|
||||
|
||||
// ------------------------------------------------------------
|
||||
// Warnings
|
||||
$this->startSection(SECT_WARN);
|
||||
$this->startList();
|
||||
$this->addListElement('ATTACH_HELP_140100_TEXT');
|
||||
$this->addListElement('ATTACH_HELP_140200_TEXT');
|
||||
$this->addListElement('ATTACH_HELP_140300_TEXT');
|
||||
$this->addListElement('ATTACH_HELP_140400_TEXT', null, false);
|
||||
$this->startList();
|
||||
$this->addListElement('ATTACH_HELP_140500_TEXT');
|
||||
$this->addListElement('ATTACH_HELP_140600_TEXT');
|
||||
$this->addListElement('ATTACH_HELP_140700_TEXT',
|
||||
ARRAY('{DEFACCLEVEL}' => JText::_('ATTACH_DEFAULT_ACCESS_LEVEL')));
|
||||
$this->addListElement('ATTACH_HELP_140800_TEXT');
|
||||
$this->addListElement('ATTACH_HELP_140900_TEXT');
|
||||
$this->addListElement('ATTACH_HELP_141000_TEXT');
|
||||
$this->addListElement('ATTACH_HELP_141100_TEXT');
|
||||
$this->endList();
|
||||
$this->endListElement();
|
||||
$this->addListElement('ATTACH_HELP_141200_TEXT', null, false);
|
||||
$this->addPreBlock("php_value upload_max_filesize 32M\nphp_value post_max_size 32M");
|
||||
$this->addParagraph('ATTACH_HELP_141300_TEXT');
|
||||
$this->endListElement();
|
||||
$this->addListElement('ATTACH_HELP_141400_TEXT',
|
||||
Array('{LOCALHOST}' => '<tt class="docutils literal">localhost</tt>'), false);
|
||||
$this->addPreBlock("C:\Windows\System32\drivers\etc\hosts");
|
||||
$this->addParagraph('ATTACH_HELP_141500_TEXT',
|
||||
Array('{IPV6HOST1}' => '<tt class="docutils literal">::1</tt>',
|
||||
'{HOSTS}' => '<tt class="docutils literal">hosts</tt>'));
|
||||
$this->endListElement();
|
||||
$this->addListElement('ATTACH_HELP_141600_TEXT');
|
||||
$this->addListElement('ATTACH_HELP_141700_TEXT');
|
||||
$this->addListElement('ATTACH_HELP_141800_TEXT', null, false);
|
||||
$this->startList();
|
||||
$forums_url = 'http://joomlacode.org/gf/project/attachments3/forum/';
|
||||
$forums_url_text = $this->replace(JText::sprintf('ATTACH_HELP_141900_TEXT', $forums_url),
|
||||
Array('{FORUMS}' => $forums_url));
|
||||
$this->addListElementHtml("<a class=\"reference external\" href=\"$forums_url\">$forums_url_text</a>");
|
||||
$this->endList();
|
||||
$this->endListElement();
|
||||
|
||||
|
||||
$this->endList();
|
||||
$this->endSection(SECT_WARN);
|
||||
|
||||
// ------------------------------------------------------------
|
||||
// Upgrading
|
||||
$this->startSection(SECT_UPGRAD);
|
||||
$this->addParagraph('ATTACH_HELP_150100_TEXT');
|
||||
$this->startList();
|
||||
$this->addListElement('ATTACH_HELP_150200_TEXT');
|
||||
$this->addListElement('ATTACH_HELP_150300_TEXT');
|
||||
$this->endList();
|
||||
$this->endSection(SECT_UPGRAD);
|
||||
|
||||
// ------------------------------------------------------------
|
||||
// Uninstalling
|
||||
$this->startSection(SECT_UNINST);
|
||||
$this->startList();
|
||||
$this->addListElement('ATTACH_HELP_160100_TEXT',
|
||||
Array('{ATTACH_DIR}' => "attachments",
|
||||
'{ATTACH_TBL}' => "#_attachments",
|
||||
'{SECT_UTILS}' => $this->sectionLink(SECT_UTILS),
|
||||
'{DISABLE_SQL}' => JText::_('ATTACH_DISABLE_MYSQL_UNINSTALLATION'),
|
||||
));
|
||||
$this->addListElement('ATTACH_HELP_160200_TEXT');
|
||||
$this->addListElement('ATTACH_HELP_160300_TEXT', null, false);
|
||||
$this->addPreBlock(JText::_('ATTACH_HELP_160400_TEXT'));
|
||||
$this->addParagraph('ATTACH_HELP_160500_TEXT');
|
||||
$this->endListElement();
|
||||
$this->endList();
|
||||
$this->endSection(SECT_UNINST);
|
||||
|
||||
// ------------------------------------------------------------
|
||||
// Migration Attachments from Joomla 1.5 to Joomla 2.5+ or 3.x
|
||||
$this->startSection(SECT_MIGRAT);
|
||||
$this->addParagraph('ATTACH_HELP_170100_TEXT');
|
||||
$this->startList();
|
||||
$migrate_url = 'http://jmcameron.net/attachments/';
|
||||
$migrate_url_text = JText::sprintf('ATTACH_HELP_170000_SECTION_TITLE', $migrate_url);
|
||||
$this->addListElementHtml("<a class=\"reference external\" href=\"$migrate_url\">$migrate_url_text</a>");
|
||||
$this->endList();
|
||||
$this->endSection(SECT_MIGRAT);
|
||||
|
||||
// ------------------------------------------------------------
|
||||
// Translations
|
||||
$this->startSection(SECT_TRANS);
|
||||
$this->addParagraph('ATTACH_HELP_180100_TEXT');
|
||||
$this->addParagraph('ATTACH_HELP_180200_TEXT');
|
||||
$this->startList();
|
||||
$this->addListElement('ATTACH_HELP_181000_TEXT');
|
||||
$this->addListElement('ATTACH_HELP_181100_TEXT');
|
||||
$this->addListElement('ATTACH_HELP_181200_TEXT');
|
||||
$this->addListElement('ATTACH_HELP_181300_TEXT');
|
||||
$this->addListElement('ATTACH_HELP_181400_TEXT');
|
||||
$this->addListElement('ATTACH_HELP_181500_TEXT');
|
||||
$this->addListElement('ATTACH_HELP_181600_TEXT');
|
||||
$this->addListElement('ATTACH_HELP_181700_TEXT');
|
||||
$this->addListElement('ATTACH_HELP_181800_TEXT');
|
||||
$this->addListElement('ATTACH_HELP_181900_TEXT');
|
||||
$this->addListElement('ATTACH_HELP_182000_TEXT');
|
||||
$this->addListElement('ATTACH_HELP_182100_TEXT');
|
||||
$this->addListElement('ATTACH_HELP_182200_TEXT');
|
||||
$this->addListElement('ATTACH_HELP_182300_TEXT');
|
||||
$this->addListElement('ATTACH_HELP_182400_TEXT');
|
||||
$this->addListElement('ATTACH_HELP_182500_TEXT');
|
||||
$this->addListElement('ATTACH_HELP_182600_TEXT');
|
||||
$this->addListElement('ATTACH_HELP_182700_TEXT');
|
||||
$this->addListElement('ATTACH_HELP_182800_TEXT');
|
||||
$this->addListElement('ATTACH_HELP_182900_TEXT');
|
||||
$this->addListElement('ATTACH_HELP_183000_TEXT');
|
||||
$this->addListElement('ATTACH_HELP_183100_TEXT');
|
||||
$this->addListElement('ATTACH_HELP_183200_TEXT');
|
||||
$this->addListElement('ATTACH_HELP_183300_TEXT');
|
||||
$this->addListElement('ATTACH_HELP_183400_TEXT');
|
||||
$this->addListElement('ATTACH_HELP_183500_TEXT');
|
||||
$this->addListElement('ATTACH_HELP_183600_TEXT');
|
||||
$this->addListElement('ATTACH_HELP_183700_TEXT');
|
||||
$this->endList();
|
||||
$this->addParagraph('ATTACH_HELP_185000_TEXT',
|
||||
Array( '{SECT_CONTCT}' => $this->sectionLink(SECT_CONTCT) ));
|
||||
$this->endSection(SECT_TRANS);
|
||||
|
||||
// ------------------------------------------------------------
|
||||
// Acknowledgments
|
||||
$this->startSection(SECT_ACKNOW);
|
||||
$this->addParagraph('ATTACH_HELP_190100_TEXT');
|
||||
$this->startList();
|
||||
$this->addListElement('ATTACH_HELP_190200_TEXT');
|
||||
$this->addListElement('ATTACH_HELP_191000_TEXT', null, false);
|
||||
$this->startList();
|
||||
$this->addListElementLink('http://www.famfamfam.com/lab/icons/silk/',
|
||||
'ATTACH_HELP_191100_TEXT');
|
||||
$this->addListElementLink('http://www.zap.org.au/documents/icons/file-icons/sample.html',
|
||||
'ATTACH_HELP_191200_TEXT');
|
||||
$this->addListElementLink('http://www.brandspankingnew.net/archive/2006/06/doctype_icons_2.html',
|
||||
'ATTACH_HELP_191300_TEXT');
|
||||
$this->addListElementLink('http://eis.bris.ac.uk/~cckhrb/webdev/',
|
||||
'ATTACH_HELP_191400_TEXT');
|
||||
$this->addListElementLink('http://sweetie.sublink.ca',
|
||||
'ATTACH_HELP_191500_TEXT');
|
||||
$this->endList();
|
||||
$this->addParagraph('ATTACH_HELP_191600_TEXT');
|
||||
$this->endListElement();
|
||||
$this->addListElement('ATTACH_HELP_192000_TEXT');
|
||||
$this->addListElement('ATTACH_HELP_192100_TEXT');
|
||||
$this->addListElement('ATTACH_HELP_192200_TEXT');
|
||||
$this->addListElement('ATTACH_HELP_192300_TEXT');
|
||||
$this->endList();
|
||||
$this->endSection(SECT_ACKNOW);
|
||||
|
||||
// ------------------------------------------------------------
|
||||
// Contact
|
||||
$this->startSection(SECT_CONTCT);
|
||||
$email_url = 'mailto:jmcameron@jmcameron.net';
|
||||
$email_url_text = 'jmcameron@jmcameron.net';
|
||||
$email_link = "<a class=\"reference external\" href=\"$email_url\">$email_url_text</a>";
|
||||
$this->addParagraph('ATTACH_HELP_200100_TEXT', Array('{LINK}' => $email_link));
|
||||
$this->endSection(SECT_CONTCT);
|
||||
|
||||
?>
|
||||
|
||||
<a id="tc_toggle" href="<?php echo $this->toggledURL() ?>" title="<?php echo $tlc ?>"><img src="<?php echo $toggle_img ?>"></a>
|
||||
</div><!-- end div.main -->
|
||||
</div><!-- end div.document -->
|
||||
@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
@ -0,0 +1,103 @@
|
||||
<?php
|
||||
/**
|
||||
* Attachments component
|
||||
*
|
||||
* @package Attachments
|
||||
* @subpackage Attachments_Component
|
||||
*
|
||||
* @author Jonathan M. Cameron <jmcameron@jmcameron.net>
|
||||
* @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/
|
||||
*/
|
||||
|
||||
// Check to ensure this file is included in Joomla!
|
||||
defined('_JEXEC') or die();
|
||||
|
||||
// Define the legacy classes, if necessary
|
||||
require_once 'helpview.php';
|
||||
|
||||
// Load the Attachments defines
|
||||
require_once JPATH_SITE . '/components/com_attachments/defines.php';
|
||||
|
||||
|
||||
/**
|
||||
* View for the help page
|
||||
*
|
||||
* @package Attachments
|
||||
* @since 3.1
|
||||
*/
|
||||
class AttachmentsViewHelp extends HelpView
|
||||
{
|
||||
/**
|
||||
* Display the view
|
||||
*
|
||||
* @param string $tpl A template file to load. [optional]
|
||||
*
|
||||
* @return nothing
|
||||
*/
|
||||
public function display($tpl = null)
|
||||
{
|
||||
$this->logo_img = JHtml::image('com_attachments/attachments_help_logo32.png', '', null, true);
|
||||
$this->version = AttachmentsDefines::$ATTACHMENTS_VERSION;
|
||||
$rdate = new JDate(AttachmentsDefines::$ATTACHMENTS_VERSION_DATE);
|
||||
$this->date = JHtml::_('date', $rdate, JText::_('DATE_FORMAT_LC1'));
|
||||
|
||||
parent::display($tpl);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the start of the permissions table including the header
|
||||
*
|
||||
* @param string $col1_code Language token for column 1 (permission name)
|
||||
* @param string $col2_code Language token for column 2 (permission note)
|
||||
* @param string $col3_code Language token for column 3 (permission action)
|
||||
*
|
||||
* @return nothing
|
||||
*/
|
||||
protected function startPermissionsTable($col1_code, $col2_code, $col3_code)
|
||||
{
|
||||
echo "<table id=\"permissions\"class=\"permissions docutils\">\n";
|
||||
echo "<colgroup>\n";
|
||||
echo " <col class=\"col_perm_name\"/>\n";
|
||||
echo " <col class=\"col_perm_note\"/>\n";
|
||||
echo " <col class=\"col_perm_action\"/>\n";
|
||||
echo "</colgroup>\n";
|
||||
echo "<thead>\n";
|
||||
echo " <tr>\n";
|
||||
echo " <th class=\"head\">" . JText::_($col1_code) . "</th>\n";
|
||||
echo " <th class=\"head\">" . JText::_($col2_code) . "</th>\n";
|
||||
echo " <th class=\"head\">" . JText::_($col3_code) . "</th>\n";
|
||||
echo " </tr>\n";
|
||||
echo "</thead>\n";
|
||||
echo "<tbody>\n";
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the a row of the permissions table
|
||||
*
|
||||
* @param string $col1_code Language token for column 1 (permission name)
|
||||
* @param string $col2_code Language token for column 2 (permission note)
|
||||
* @param string $col3_code Language token for column 3 (permission action)
|
||||
*
|
||||
* @return nothing
|
||||
*/
|
||||
protected function addPermissionsTableRow($col1_code, $col2_code, $col3_code)
|
||||
{
|
||||
echo " <tr>\n";
|
||||
echo " <td>" . JText::_($col1_code) . "</td>\n";
|
||||
echo " <td>" . JText::_($col2_code) . "</td>\n";
|
||||
echo " <td>" . JText::_($col3_code) . "</td>\n";
|
||||
echo " </tr>\n";
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the end of the permissions table
|
||||
*
|
||||
* @return nothing
|
||||
*/
|
||||
protected function endPermissionsTable()
|
||||
{
|
||||
echo "</table>\n";
|
||||
}
|
||||
}
|
||||
@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
@ -0,0 +1,151 @@
|
||||
<?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');
|
||||
JHtml::_('behavior.formvalidation');
|
||||
|
||||
if (version_compare(JVERSION, '3.0', 'ge'))
|
||||
{
|
||||
JHtml::_('formbehavior.chosen', 'select');
|
||||
}
|
||||
|
||||
$document = JFactory::getDocument();
|
||||
$uri = JFactory::getURI();
|
||||
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
Joomla.submitbutton = function(task)
|
||||
{
|
||||
if (document.formvalidator.isValid(document.id('component-form')))
|
||||
{
|
||||
Joomla.submitform(task, document.getElementById('component-form'));
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<?php
|
||||
|
||||
if (version_compare(JVERSION, '3.0', 'ge'))
|
||||
{
|
||||
?>
|
||||
<form action="<?php echo JRoute::_('index.php?option=com_config');?>" id="component-form" method="post" name="adminForm" autocomplete="off" class="form-validate form-horizontal">
|
||||
<div class="row-fluid">
|
||||
<div class="span10">
|
||||
<ul class="nav nav-tabs" id="configTabs">
|
||||
<?php
|
||||
$fieldSets = $this->form->getFieldsets();
|
||||
foreach ($fieldSets as $name => $fieldSet) :
|
||||
$label = empty($fieldSet->label) ? 'COM_CONFIG_'.$name.'_FIELDSET_LABEL' : $fieldSet->label;
|
||||
?>
|
||||
<li><a href="#<?php echo $name;?>" data-toggle="tab"><?php echo JText::_($label);?></a></li>
|
||||
<?php
|
||||
endforeach;
|
||||
?>
|
||||
</ul>
|
||||
<div class="tab-content">
|
||||
<?php
|
||||
$fieldSets = $this->form->getFieldsets();
|
||||
foreach ($fieldSets as $name => $fieldSet) :
|
||||
?>
|
||||
<div class="tab-pane" id="<?php echo $name;?>">
|
||||
<?php
|
||||
if (isset($fieldSet->description) && !empty($fieldSet->description)) :
|
||||
echo '<p class="tab-description">'.JText::_($fieldSet->description).'</p>';
|
||||
endif;
|
||||
foreach ($this->form->getFieldset($name) as $field):
|
||||
?>
|
||||
<div class="control-group">
|
||||
<?php if (!$field->hidden && $name != "permissions") : ?>
|
||||
<div class="control-label">
|
||||
<?php echo $field->label; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<div class="<?php if ($name != "permissions") : ?>controls<?php endif; ?>">
|
||||
<?php echo $field->input; ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
endforeach;
|
||||
?>
|
||||
</div>
|
||||
<?php
|
||||
endforeach;
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<input type="hidden" name="id" value="<?php echo $this->component->id;?>" />
|
||||
<input type="hidden" name="option" value="com_attachments" />
|
||||
<input type="hidden" name="component" value="com_attachments" />
|
||||
<input type="hidden" name="old_secure" value="<?php echo $this->params->get('secure'); ?>" />
|
||||
<input type="hidden" name="task" value="params.edit" />
|
||||
<?php echo JHtml::_('form.token'); ?>
|
||||
</div>
|
||||
</form>
|
||||
<script type="text/javascript">
|
||||
jQuery('#configTabs a:first').tab('show'); // Select first tab
|
||||
</script>
|
||||
<?php
|
||||
}
|
||||
else
|
||||
{
|
||||
?>
|
||||
<form action="<?php echo JRoute::_('index.php?option=com_config');?>" id="component-form" method="post" name="adminForm" autocomplete="off" class="form-validate">
|
||||
<?php
|
||||
echo JHtml::_('tabs.start','config-tabs-'.$this->component->option.'_configuration', array('useCookie'=>1));
|
||||
$fieldSets = $this->form->getFieldsets();
|
||||
foreach ($fieldSets as $name => $fieldSet) :
|
||||
$label = empty($fieldSet->label) ? 'COM_CONFIG_'.$name.'_FIELDSET_LABEL' : $fieldSet->label;
|
||||
echo JHtml::_('tabs.panel',JText::_($label), 'publishing-details');
|
||||
if (isset($fieldSet->description) && !empty($fieldSet->description)) :
|
||||
echo '<p class="tab-description">'.JText::_($fieldSet->description).'</p>';
|
||||
endif;
|
||||
?>
|
||||
<ul class="config-option-list" id="attachments-options">
|
||||
<?php
|
||||
foreach ($this->form->getFieldset($name) as $field):
|
||||
?>
|
||||
<li>
|
||||
<?php if (!$field->hidden) : ?>
|
||||
<?php echo $field->label; ?>
|
||||
<?php endif; ?>
|
||||
<?php echo $field->input; ?>
|
||||
</li>
|
||||
<?php
|
||||
endforeach;
|
||||
?>
|
||||
</ul>
|
||||
|
||||
|
||||
<div class="clr"></div>
|
||||
<?php
|
||||
endforeach;
|
||||
echo JHtml::_('tabs.end');
|
||||
?>
|
||||
<div>
|
||||
<input type="hidden" name="id" value="<?php echo $this->component->id;?>" />
|
||||
<input type="hidden" name="option" value="com_attachments" />
|
||||
<input type="hidden" name="component" value="com_attachments" />
|
||||
<input type="hidden" name="old_secure" value="<?php echo $this->params->get('secure'); ?>" />
|
||||
<input type="hidden" name="task" value="params.edit" />
|
||||
<?php echo JHtml::_('form.token'); ?>
|
||||
</div>
|
||||
</form>
|
||||
<?php
|
||||
}
|
||||
@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
@ -0,0 +1,63 @@
|
||||
<?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();
|
||||
|
||||
// Access check.
|
||||
if (!JFactory::getUser()->authorise('core.admin', 'com_attachments')) {
|
||||
return JError::raiseError(404, JText::_('JERROR_ALERTNOAUTHOR') . ' (ERR 174)');
|
||||
}
|
||||
|
||||
/** Define the legacy classes, if necessary */
|
||||
require_once(JPATH_SITE.'/components/com_attachments/legacy/view.php');
|
||||
|
||||
|
||||
/**
|
||||
* View for editing the component parameters
|
||||
* (adapted from administrator/components/com_config/views/component/view.php)
|
||||
*
|
||||
* @package Attachments
|
||||
*/
|
||||
class AttachmentsViewParams extends JViewLegacy
|
||||
{
|
||||
/**
|
||||
* Display the params view
|
||||
*/
|
||||
public function display($tpl = null)
|
||||
{
|
||||
// Add the style sheets
|
||||
JHtml::stylesheet('com_attachments/attachments_admin_form.css', Array(), true);
|
||||
$lang = JFactory::getLanguage();
|
||||
if ( $lang->isRTL() ) {
|
||||
JHtml::stylesheet('com_attachments/attachments_admin_form_rtl.css', Array(), true);
|
||||
}
|
||||
|
||||
$this->addToolBar();
|
||||
|
||||
parent::display($tpl);
|
||||
}
|
||||
|
||||
/**
|
||||
* Setting the toolbar
|
||||
*/
|
||||
protected function addToolBar()
|
||||
{
|
||||
JRequest::setVar('hidemainmenu', true);
|
||||
JToolBarHelper::title(JText::_('ATTACH_CONFIGURATION'), 'attachments.png');
|
||||
JToolBarHelper::apply('params.apply');
|
||||
JToolBarHelper::save('params.save');
|
||||
JToolBarHelper::cancel('params.cancel', 'JTOOLBAR_CLOSE');
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
@ -0,0 +1,37 @@
|
||||
<?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();
|
||||
|
||||
// Load the tooltip behavior.
|
||||
JHtml::_('behavior.tooltip');
|
||||
|
||||
// Hide the vertical scrollbar using javascript
|
||||
$document = JFactory::getDocument();
|
||||
$hide_scrollbar = "window.addEvent('domready', function() {
|
||||
document.documentElement.style.overflow = \"hidden\";
|
||||
document.body.scroll = \"no\";});";
|
||||
$document->addScriptDeclaration($hide_scrollbar);
|
||||
|
||||
?>
|
||||
<div class="attachmentsAdmin" id="utilsList">
|
||||
<h1><?php echo JText::_('ATTACH_ATTACHMENTS_ADMINISTRATIVE_UTILITY_COMMANDS'); ?></h1>
|
||||
<ul>
|
||||
<?php foreach ($this->entries as $link_html)
|
||||
{
|
||||
echo " <li><h2>$link_html</h2></li>\n";
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
</div>
|
||||
@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
@ -0,0 +1,44 @@
|
||||
<?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 the utils controller
|
||||
*
|
||||
* @package Attachments
|
||||
*/
|
||||
class AttachmentsViewUtils extends JViewLegacy
|
||||
{
|
||||
/**
|
||||
* Display the view
|
||||
*
|
||||
* @param string $tpl A template file to load. [optional]
|
||||
*
|
||||
*/
|
||||
public function display($tpl = null)
|
||||
{
|
||||
// Access check.
|
||||
if (!JFactory::getUser()->authorise('core.admin', 'com_attachments'))
|
||||
{
|
||||
return JError::raiseError(404, JText::_('JERROR_ALERTNOAUTHOR') . ' (ERR 171)');
|
||||
}
|
||||
|
||||
parent::display($tpl);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
@ -0,0 +1,49 @@
|
||||
<?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();
|
||||
|
||||
// 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" align="center">
|
||||
<span class="left"> </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>
|
||||
@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
@ -0,0 +1,43 @@
|
||||
<?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 the special controller
|
||||
* (adapted from administrator/components/com_config/views/component/view.php)
|
||||
*
|
||||
* @package Attachments
|
||||
*/
|
||||
class AttachmentsViewWarning extends JViewLegacy
|
||||
{
|
||||
/**
|
||||
* Display the view
|
||||
*/
|
||||
public function display($tpl = null)
|
||||
{
|
||||
// Add the style sheets
|
||||
JHtml::stylesheet('com_attachments/attachments_admin_form.css', Array(), true);
|
||||
$lang = JFactory::getLanguage();
|
||||
if ( $lang->isRTL() ) {
|
||||
JHtml::stylesheet('com_attachments/attachments_admin_form_rtl.css', Array(), true);
|
||||
}
|
||||
|
||||
parent::display($tpl);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user