Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -156,13 +156,12 @@ public function delete()
$cid = $input->get('cid', array(), 'array');
$deleted_ids = Array();

/** @var \JMCameron\Component\Attachments\Administrator\Model\AttachmentModel $model */
$model = $this->getModel('Attachment');
$attachment = $model->getTable();

if (count($cid))
{
/** @var \JMCameron\Component\Attachments\Administrator\Model\AttachmentModel $model */
$model = $this->getModel('Attachment');
$attachment = $model->getTable();


// Loop through the attachments and delete them one-by-one
foreach ($cid as $attachment_id)
{
Expand Down
2 changes: 1 addition & 1 deletion attachments_component/admin/tmpl/help/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
?>
<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>
<a id="tc_toggle" title="<?php 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 Text::_('ATTACH_HELP_000000_MAIN_TITLE') ?></h1>
<hr class="header"/>
</div>
Expand Down
3 changes: 2 additions & 1 deletion attachments_component/site/tmpl/attachments/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,8 @@
else {
$url = $base_url . $attachment->url;
if (strtoupper(substr(PHP_OS,0,3) == 'WIN')) {
$url = utf8_encode($url);
// $url = utf8_encode($url); Deprecated from php 8.2
$url = iconv('ISO-8859-1', 'UTF-8', $url);
}
}
$tooltip = Text::sprintf('ATTACH_DOWNLOAD_THIS_FILE_S', $actual_filename);
Expand Down
2 changes: 1 addition & 1 deletion attachments_component/site/tmpl/update/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@
<?php endif; ?>
<?php if ( $params->get('allow_frontend_access_editing', false) ): ?>
&nbsp;&nbsp;&nbsp;&nbsp;
<div class="at_control"><label for="access" title="<?php echo $this->access_level_tooltip; ?>"><? echo Text::_('ATTACH_ACCESS_COLON'); ?></label> <?php echo $this->access_level; ?></div>
<div class="at_control"><label for="access" title="<?php echo $this->access_level_tooltip; ?>"><?php echo Text::_('ATTACH_ACCESS_COLON'); ?></label> <?php echo $this->access_level; ?></div>
<?php endif; ?>
<?php if ( $params->get('user_field_1_name') ): ?>
<p><label for="user_field_1"><?php echo $params->get('user_field_1_name'); ?>:</label>
Expand Down
2 changes: 1 addition & 1 deletion attachments_component/site/tmpl/upload/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@
<?php endif; ?>
<?php if ( $params->get('allow_frontend_access_editing', false) ): ?>
&nbsp;&nbsp;&nbsp;&nbsp;
<div class="at_control"><label for="access" title="<?php echo $this->access_level_tooltip; ?>"><? echo Text::_('ATTACH_ACCESS_COLON'); ?></label> <?php echo $this->access_level; ?></div>
<div class="at_control"><label for="access" title="<?php echo $this->access_level_tooltip; ?>"><?php echo Text::_('ATTACH_ACCESS_COLON'); ?></label> <?php echo $this->access_level; ?></div>
<?php endif; ?>
<?php if ( $params->get('user_field_1_name', false) ): ?>
<p><label for="user_field_1"><?php echo $params->get('user_field_1_name'); ?>:</label>
Expand Down
12 changes: 5 additions & 7 deletions attachments_for_content/attachments_for_content.php
Original file line number Diff line number Diff line change
Expand Up @@ -496,14 +496,13 @@ public function isParentPublished($parent_id, $parent_entity = 'default')
}

$now = Factory::getDate()->toUnix();
$nullDate = Factory::getDate($db->getNullDate())->toUnix();

if ($article)
{
$publish_up = Factory::getDate($article->publish_up)->toUnix();
$publish_down = Factory::getDate($article->publish_down)->toUnix();
$publish_up = $article->publish_up? Factory::getDate($article->publish_up)->toUnix() : null;
$publish_down = $article->publish_down? Factory::getDate($article->publish_down)->toUnix() : null;

$published = (($article->state == 1) && ($now >= $publish_up) && (($publish_down == $nullDate) || ($now <= $publish_down)));
$published = (($article->state == 1) && ($now >= $publish_up) && (($publish_down === null) || ($now <= $publish_down)));
}
else
{
Expand Down Expand Up @@ -593,11 +592,10 @@ public function getParentPublishedFilter($parent_state, $filter_entity)
if (($filter_entity == 'ALL') || ($filter_entity == 'ARTICLE'))
{
$now = Factory::getDate()->toSql();
$nullDate = $db->getNullDate();
$where[] = "EXISTS (SELECT * FROM #__content AS c1 " .
"WHERE (a.parent_entity = 'article' AND c1.id = a.parent_id AND c1.state=1 AND " .
'(c1.publish_up = ' . $db->quote($nullDate) . ' OR c1.publish_up <= ' . $db->quote($now) . ') AND ' .
'(c1.publish_down = ' . $db->quote($nullDate) . ' OR c1.publish_down >= ' . $db->quote($now) . ')))';
'(c1.publish_up IS null OR c1.publish_up <= ' . $db->quote($now) . ') AND ' .
'(c1.publish_down IS null OR c1.publish_down >= ' . $db->quote($now) . ')))';
}

if (($filter_entity == 'ALL') || ($filter_entity == 'CATEGORY'))
Expand Down
4 changes: 2 additions & 2 deletions pkg_attachments/language/en-GB/en-GB.pkg_attachments.sys.ini
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@

; English translation

ATTACH_PACKAGE_ATTACHMENTS_FOR_JOOMLA_16PLUS="Attachments for Joomla 2.5+ or 3.x"
ATTACH_PACKAGE_ATTACHMENTS_FOR_JOOMLA_40PLUS="Attachments for Joomla 4.0+"
ATTACH_PACKAGE_NOTICE_UNINSTALL_PACKAGE_S="To uninstall the Attachments extension, uninstall the Package '%s'!"
PKG_ATTACHMENTS="Package: Attachments for Joomla 2.5+ or 3.x"
PKG_ATTACHMENTS="Package: Attachments for Joomla 4.0+"
19 changes: 9 additions & 10 deletions pkg_attachments/pkg_attachments.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,15 @@
<description>ATTACH_PACKAGE_ATTACHMENTS_FOR_JOOMLA_40PLUS</description>

<files folder="packages">
<file type="plugin" id="attachments" group="content">attachments_plugin.zip</file>
<file type="plugin" id="attachments" group="search">attachments_search.zip</file>
<file type="plugin" id="attachments_plugin_framework" group="attachments">attachments_plugin_framework.zip</file>
<file type="plugin" id="attachments_for_content" group="attachments">attachments_for_content.zip</file>
<file type="plugin" id="show_attachments" group="system">show_attachments_in_editor_plugin.zip</file>
<file type="plugin" id="add_attachment" group="editors-xtd">add_attachment_btn_plugin.zip</file>
<file type="plugin" id="insert_attachments_token" group="editors-xtd">insert_attachments_token_btn_plugin.zip</file>
<file type="plugin" id="attachments" group="quickicon">attachments_quickicon_plugin.zip</file>

<file type="component" id="com_attachments">attachments_component.zip</file>
<file type="component" id="com_attachments">attachments_component.zip</file>
<file type="plugin" id="attachments" group="content">attachments_plugin.zip</file>
<file type="plugin" id="attachments" group="search">attachments_search.zip</file>
<file type="plugin" id="attachments_plugin_framework" group="attachments">attachments_plugin_framework.zip</file>
<file type="plugin" id="attachments_for_content" group="attachments">attachments_for_content.zip</file>
<file type="plugin" id="show_attachments" group="system">show_attachments_in_editor_plugin.zip</file>
<file type="plugin" id="add_attachment" group="editors-xtd">add_attachment_btn_plugin.zip</file>
<file type="plugin" id="insert_attachments_token" group="editors-xtd">insert_attachments_token_btn_plugin.zip</file>
<file type="plugin" id="attachments" group="quickicon">attachments_quickicon_plugin.zip</file>
</files>

<updateservers>
Expand Down