Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
75 commits
Select commit Hold shift + click to select a range
14a6cba
Add new parameter to XML files changelogurl
NunoLopesPT May 17, 2017
4a5a587
Modal on Update view using the changelogurl
NunoLopesPT May 17, 2017
9a05cee
CodeStyle
NunoLopesPT May 17, 2017
eaa19cd
Merge branch 'show_changelog' of https://github.com/NunoLopes96/gsoc1…
NunoLopesPT May 23, 2017
8f7c94d
Added new column on Update view / button changelog / codestyle changes
NunoLopesPT May 23, 2017
e5907c6
Null to lower case
NunoLopesPT May 23, 2017
bbfc298
Merge branch 'master' of https://github.com/joomla-projects/gsoc17_ex…
NunoLopesPT Jun 6, 2017
b83f010
Merge branch 'master' of https://github.com/joomla-projects/gsoc17_ex…
NunoLopesPT Jun 13, 2017
016d4c0
Added changelog modal in the manage view and bug fix
NunoLopesPT Jul 3, 2017
6d1453a
NL
NunoLopesPT Jul 3, 2017
3762575
Read changelogurl parameter of an extensions in the xml installation …
NunoLopesPT Jul 6, 2017
65fea02
codestyle
NunoLopesPT Jul 6, 2017
ac1d41d
Added feature to Libraries / Modules / Packages and Plugins
NunoLopesPT Jul 6, 2017
b3d9a98
Added Language changelogurl in install and update
NunoLopesPT Jul 6, 2017
a75ab12
Changelog to Templates added
NunoLopesPT Jul 6, 2017
417b5f9
added changelog url to Files
NunoLopesPT Jul 7, 2017
d702a54
Merge branch 'master' of https://github.com/joomla-projects/gsoc17_ex…
NunoLopesPT Jul 24, 2017
04b2a45
Merge branch 'master' of https://github.com/joomla-projects/gsoc17_ex…
NunoLopesPT Jul 25, 2017
fa7126a
Merge branch 'master' of https://github.com/NunoLopes96/gsoc17_expand…
NunoLopesPT Jul 25, 2017
ad91562
Codestyle
NunoLopesPT Jul 26, 2017
69e9576
Added namespaces and replaced Jhtml for JHtml
NunoLopesPT Jul 26, 2017
abe632f
Merge branch 'master' of https://github.com/NunoLopes96/gsoc17_expand…
NunoLopesPT Jul 26, 2017
1b8450d
Merge branch 'show_changelog' of https://github.com/NunoLopes96/gsoc1…
NunoLopesPT Jul 26, 2017
4119c94
Update files merged
NunoLopesPT Jul 26, 2017
cc525be
Update default.php
NunoLopesPT Jul 26, 2017
16d7a3e
Update default.php
NunoLopesPT Jul 26, 2017
62be1da
Update default.php
NunoLopesPT Jul 26, 2017
65b854b
Merge branch 'master' of https://github.com/NunoLopes96/gsoc17_expand…
NunoLopesPT Jul 27, 2017
5380927
Code style
NunoLopesPT Aug 9, 2017
775e102
Code style
NunoLopesPT Aug 9, 2017
d955415
Merge branch '4.0-dev' of https://github.com/joomla/joomla-cms into s…
NunoLopesPT Aug 14, 2017
84e2e43
code style
NunoLopesPT Aug 14, 2017
7688ea8
CodeStyle
NunoLopesPT Aug 15, 2017
45e7793
reame.md
NunoLopesPT Aug 22, 2017
ff09c0a
Merge remote-tracking branch 'upstream/4.0-dev' into show_changelog
NunoLopesPT Aug 28, 2017
e2be3bf
Merge branch '4.0-dev' of https://github.com/joomla/joomla-cms into s…
NunoLopesPT Aug 28, 2017
e2788f3
Merge branch '4.0-dev' into show_changelog
roland-d May 27, 2018
31f820e
Working on the changelog notification
roland-d May 28, 2018
84517e2
Merge branch '4.0-dev' into show_changelog
roland-d Jun 3, 2018
1c797e6
Adding the badges and reading the XML
roland-d Jun 4, 2018
5c1d96d
Work on changelog layout
roland-d Jun 10, 2018
d94c8a0
Merge branch '4.0-dev' into show_changelog
roland-d Jul 1, 2018
79497a8
Start code cleanup
roland-d Jul 1, 2018
f457496
Use namespaced Log
roland-d Jul 2, 2018
b934fa7
Fix language entry
roland-d Jul 2, 2018
541e07e
Code style fixes
roland-d Jul 2, 2018
9680550
Merge branch '4.0-dev' into show_changelog
roland-d Jul 2, 2018
f8e5afc
Merge branch '4.0-dev' into show_changelog
roland-d Jul 3, 2018
d50f936
Merge branch '4.0-dev' into show_changelog
roland-d Feb 24, 2019
70edcba
Propagate changes to new files
roland-d Feb 24, 2019
037b78d
Merge branch '4.0-dev' into show_changelog
roland-d Feb 26, 2019
68b2a0d
Merge branch '4.0-dev' into show_changelog
roland-d Mar 3, 2019
f821d38
Merge branch 'nuno_show_changelog' into show_changelog
roland-d Mar 3, 2019
2a9ed82
Remove obsolete comment
roland-d Mar 3, 2019
28cacea
Implementing changelog adapterˆ
roland-d Mar 3, 2019
23e8d2a
Work on dealing with multiple entries in changelogˆ
roland-d Mar 3, 2019
4253442
Code cleanup
roland-d Mar 4, 2019
7c032af
Further cˆode cleanup
roland-d Mar 4, 2019
d64c320
Merge branch '4.0-dev' into show_changelog
roland-d Mar 4, 2019
2082d4f
Specify source page
roland-d Mar 4, 2019
c4a64c2
Codestyle fix
roland-d Mar 4, 2019
2012ef3
Changelog styling
ciar4n Mar 7, 2019
340eb46
Merge pull request #12 from ciar4n/24026
roland-d Mar 7, 2019
41ef8a1
Merge branch '4.0-dev' into show_changelog
roland-d Mar 7, 2019
1a8e8cf
Make responsive
ciar4n Mar 7, 2019
4fa3c00
Merge branch '4.0-dev' into show_changelog
roland-d Mar 9, 2019
ae1486d
Merge branch '4.0-dev' into show_changelog
roland-d Mar 21, 2019
d82eca2
Update changelog modal title #24026
roland-d Mar 21, 2019
6b9b1e0
Merge pull request #13 from ciar4n/24026-small-screen
roland-d Mar 21, 2019
733df8c
Merge branch '4.0-dev' into show_changelog
wilsonge Mar 22, 2019
d11b919
Fixing the JS errors #24026
roland-d Mar 22, 2019
dddb244
Merge branch '4.0-dev' into show_changelog
roland-d Mar 22, 2019
2888102
Make javascript-cs happy #24026
roland-d Mar 23, 2019
cd29f72
Update Postgres SQL #24026
roland-d Mar 23, 2019
1eefa69
Merge branch '4.0-dev' into show_changelog
wilsonge Mar 25, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ALTER TABLE `#__extensions` ADD COLUMN `changelogurl` text AFTER `element`;
ALTER TABLE `#__updates` ADD COLUMN `changelogurl` text AFTER `infourl`;
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ALTER TABLE "#__extensions" ADD COLUMN "changelogurl" text;
ALTER TABLE "#__updates" ADD COLUMN "changelogurl" text;
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,14 @@

defined('_JEXEC') or die;

use Joomla\CMS\Application\CMSApplication;
use Joomla\CMS\Language\Text;
use Joomla\CMS\MVC\Controller\BaseController;
use Joomla\CMS\MVC\Factory\MVCFactoryInterface;
use Joomla\CMS\Response\JsonResponse;
use Joomla\CMS\Router\Route;
use Joomla\CMS\Session\Session;
use Joomla\Component\Installer\Administrator\Model\ManageModel;
use Joomla\Utilities\ArrayHelper;

/**
Expand Down Expand Up @@ -49,6 +52,8 @@ public function __construct($config = array(), MVCFactoryInterface $factory = nu
*
* @return void
*
* @throws \Exception
*
* @since 1.6
*/
public function publish()
Expand All @@ -67,7 +72,7 @@ public function publish()
}
else
{
/* @var \Joomla\Component\Installer\Administrator\Model\ManageModel $model */
/** @var ManageModel $model */
$model = $this->getModel('manage');

// Change the state of the records.
Expand Down Expand Up @@ -98,14 +103,16 @@ public function publish()
*
* @return void
*
* @throws \Exception
*
* @since 1.5
*/
public function remove()
{
// Check for request forgeries.
Session::checkToken() or jexit(Text::_('JINVALID_TOKEN'));

/* @var \Joomla\Component\Installer\Administrator\Model\ManageModel $model */
/** @var ManageModel $model */
$model = $this->getModel('manage');

$eid = $this->input->get('cid', array(), 'array');
Expand All @@ -128,12 +135,37 @@ public function refresh()
// Check for request forgeries.
Session::checkToken() or jexit(Text::_('JINVALID_TOKEN'));

/* @var \Joomla\Component\Installer\Administrator\Model\ManageModel $model */
/** @var ManageModel $model */
$model = $this->getModel('manage');

$uid = $this->input->get('cid', array(), 'array');
$uid = ArrayHelper::toInteger($uid, array());
$model->refresh($uid);
$this->setRedirect(Route::_('index.php?option=com_installer&view=manage', false));
}

/**
* Load the changelog for a given extension.
*
* @return void
*
* @since __DEPLOY_VERSION__
*/
public function loadChangelog()
{
/** @var ManageModel $model */
$model = $this->getModel('manage');

$eid = $this->input->get('eid', 0, 'int');
$source = $this->input->get('source', 'manage', 'string');

if (!$eid)
{
return;
}

$output = $model->loadChangelog($eid, $source);

echo (new JsonResponse($output));
}
}
94 changes: 89 additions & 5 deletions administrator/components/com_installer/Model/ManageModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,14 @@

defined('_JEXEC') or die;

use Joomla\CMS\Changelog\Changelog;
use Joomla\CMS\Extension\ExtensionHelper;
use Joomla\CMS\Factory;
use Joomla\CMS\Installer\Installer;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Layout\FileLayout;
use Joomla\CMS\MVC\Factory\MVCFactoryInterface;
use Joomla\CMS\Table\Extension;
use Joomla\Component\Templates\Administrator\Table\StyleTable;
use Joomla\Database\DatabaseQuery;

Expand Down Expand Up @@ -64,6 +67,8 @@ public function __construct($config = array(), MVCFactoryInterface $factory = nu
*
* @return void
*
* @throws \Exception
*
* @since 1.6
*/
protected function populateState($ordering = 'name', $direction = 'asc')
Expand Down Expand Up @@ -94,6 +99,8 @@ protected function populateState($ordering = 'name', $direction = 'asc')
*
* @return boolean True on success
*
* @throws \Exception
*
* @since 1.5
*/
public function publish(&$eid = array(), $value = 1)
Expand All @@ -117,7 +124,7 @@ public function publish(&$eid = array(), $value = 1)
}

// Get a table object for the extension type
$table = new \Joomla\CMS\Table\Extension($this->getDbo());
$table = new Extension($this->getDbo());

// Enable the extension in the table and store it in the database
foreach ($eid as $i => $id)
Expand Down Expand Up @@ -182,7 +189,7 @@ public function refresh($eid)

// Get an installer object for the extension type
$installer = Installer::getInstance();
$result = 0;
$result = 0;

// Uninstall the chosen extensions
foreach ($eid as $id)
Expand All @@ -200,6 +207,8 @@ public function refresh($eid)
*
* @return boolean True on success
*
* @throws \Exception
*
* @since 1.5
*/
public function remove($eid = array())
Expand All @@ -222,10 +231,10 @@ public function remove($eid = array())

// Get an installer object for the extension type
$installer = Installer::getInstance();
$row = new \Joomla\CMS\Table\Extension($this->getDbo());
$row = new \Joomla\CMS\Table\Extension($this->getDbo());

// Uninstall the chosen extensions
$msgs = array();
$msgs = array();
$result = false;

foreach ($eid as $id)
Expand All @@ -235,7 +244,7 @@ public function remove($eid = array())
$result = false;

$langstring = 'COM_INSTALLER_TYPE_TYPE_' . strtoupper($row->type);
$rowtype = Text::_($langstring);
$rowtype = Text::_($langstring);

if (strpos($rowtype, $langstring) !== false)
{
Expand Down Expand Up @@ -376,4 +385,79 @@ protected function getListQuery()

return $query;
}

/**
* Load the changelog details for a given extension.
*
* @param integer $eid The extension ID
* @param string $source The view the changelog is for, this is used to determine which version number to show
*
* @return string The output to show in the modal.
*
* @since __DEPLOY_VERSION__
*/
public function loadChangelog($eid, $source)
{
// Get the changelog URL
$db = $this->getDbo();
$query = $db->getQuery(true)
->select(
$db->quoteName(
array(
'extensions.element',
'extensions.type',
'extensions.changelogurl',
'extensions.manifest_cache',
'extensions.client_id'
)
)
)
->select($db->quoteName('updates.version', 'updateVersion'))
->from($db->quoteName('#__extensions', 'extensions'))
->leftJoin(
$db->quoteName('#__updates', 'updates')
. ' ON ' . $db->quoteName('updates.extension_id') . ' = ' . $db->quoteName('extensions.extension_id')
)
->where($db->quoteName('extensions.extension_id') . ' = ' . (int) $eid);
$db->setQuery($query);

$extensions = $db->loadObjectList();
$this->translate($extensions);
$extension = array_shift($extensions);

if (!$extension->changelogurl)
{
return '';
}

$changelog = new Changelog;
$changelog->setVersion($source === 'manage' ? $extension->version : $extension->updateVersion);
$changelog->loadFromXml($extension->changelogurl);

// Read all the entries
$entries = array(
'security' => array(),
'fix' => array(),
'addition' => array(),
'change' => array(),
'remove' => array(),
'language' => array(),
'note' => array()
);

array_walk(
$entries,
function (&$value, $name) use ($changelog) {
if ($field = $changelog->get($name))
{
$value = $changelog->get($name)->data;
}
}
);

$layout = new FileLayout('joomla.installer.changelog');
$output = $layout->render($entries);

return $output;
}
}
26 changes: 23 additions & 3 deletions administrator/components/com_installer/tmpl/manage/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,14 +104,34 @@
<?php echo $item->type_translated; ?>
</td>
<td class="d-none d-md-table-cell">
<?php echo @$item->version != '' ? $item->version : '&#160;'; ?>
<?php if ($item->version !== '') : ?>
<?php if ($item->changelogurl !== null) : ?>
<a href="#changelogModal" onclick="Joomla.loadChangelog(<?php echo $item->extension_id; ?>, 'manage'); return false;" data-toggle="modal">
<?php echo $item->version?>
</a>
<?php
echo HTMLHelper::_(
'bootstrap.renderModal',
'changelogModal',
array(
'title' => Text::sprintf('COM_INSTALLER_CHANGELOG_TITLE', $item->name, $item->version),
),
''
);
?>
<?php else : ?>
<?php echo $item->version; ?>
<?php endif; ?>
<?php else :
echo '&#160;';
endif; ?>
</td>
<td class="d-none d-md-table-cell">
<?php echo @$item->creationDate != '' ? $item->creationDate : '&#160;'; ?>
<?php echo isset($item->creationDate) && $item->creationDate !== '' ? $item->creationDate : '&#160;'; ?>
</td>
<td class="d-none d-md-table-cell">
<span class="editlinktip hasTooltip" title="<?php echo HTMLHelper::_('tooltipText', Text::_('COM_INSTALLER_AUTHOR_INFORMATION'), $item->author_info, 0); ?>">
<?php echo @$item->author != '' ? $item->author : '&#160;'; ?>
<?php echo isset($item->author) && $item->author !== '' ? $item->author : '&#160;'; ?>
</span>
</td>
<td class="d-none d-md-table-cell">
Expand Down
36 changes: 30 additions & 6 deletions administrator/components/com_installer/tmpl/update/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,13 @@
<?php if ($this->showMessage) : ?>
<?php echo $this->loadTemplate('message'); ?>
<?php endif; ?>

<?php if ($this->ftp) : ?>
<?php echo $this->loadTemplate('ftp'); ?>
<?php endif; ?>
<?php echo LayoutHelper::render('joomla.searchtools.default', array('view' => $this)); ?>
<?php if (empty($this->items)) : ?>
<div class="alert alert-info">
<?php echo JText::_('COM_INSTALLER_MSG_UPDATE_NOUPDATES'); ?>
<?php echo Text::_('COM_INSTALLER_MSG_UPDATE_NOUPDATES'); ?>
</div>
<?php else : ?>
<table class="table">
Expand All @@ -43,9 +42,9 @@
</caption>
<thead>
<tr>
<td style="width:1%" class="text-center">
<th style="width:1%" class="text-center">
<?php echo HTMLHelper::_('grid.checkall'); ?>
</td>
</th>
<th scope="col">
<?php echo HTMLHelper::_('searchtools.sort', 'COM_INSTALLER_HEADING_NAME', 'u.name', $listDirn, $listOrder); ?>
</th>
Expand All @@ -61,8 +60,11 @@
<th scope="col">
<?php echo Text::_('COM_INSTALLER_NEW_VERSION'); ?>
</th>
<th scope="col" class="d-none d-md-table-cell">
<?php echo HTMLHelper::_('searchtools.sort', 'COM_INSTALLER_HEADING_FOLDER', 'folder_translated', $listDirn, $listOrder); ?>
<th scope="col">
<?php echo Text::_('COM_INSTALLER_CHANGELOG'); ?>
</th>
<th class="d-none d-md-table-cell">
<?php echo JHtml::_('searchtools.sort', 'COM_INSTALLER_HEADING_FOLDER', 'folder_translated', $listDirn, $listOrder); ?>
</th>
<th scope="col" class="d-none d-md-table-cell">
<?php echo Text::_('COM_INSTALLER_HEADING_INSTALLTYPE'); ?>
Expand Down Expand Up @@ -102,6 +104,28 @@
<td>
<span class="badge badge-success"><?php echo $item->version; ?></span>
</td>
<td class="hidden-sm-down text-center">
<?php if ($item->changelogurl !== null) : ?>
<a href="#changelogModal" class="btn btn-info btn-xs" onclick="Joomla.loadChangelog(<?php echo $item->extension_id; ?>, 'update'); return false;" data-toggle="modal">
<?php echo Text::_('COM_INSTALLER_CHANGELOG'); ?>
</a>
<?php
echo HTMLHelper::_(
'bootstrap.renderModal',
'changelogModal',
array(
'title' => Text::sprintf('COM_INSTALLER_CHANGELOG_TITLE', $item->name, $item->version),
),
''
);
?>
<?php else:?>
<span>
<?php echo Text::_('COM_INSTALLER_TYPE_NONAPPLICABLE')?>
</span>

<?php endif; ?>
</td>
<td class="d-none d-md-table-cell">
<?php echo $item->folder_translated; ?>
</td>
Expand Down
9 changes: 9 additions & 0 deletions administrator/language/en-GB/en-GB.com_installer.ini
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,15 @@
COM_INSTALLER="Installer"
COM_INSTALLER_AUTHOR_INFORMATION="Author Information"
COM_INSTALLER_CACHETIMEOUT_LABEL="Updates Caching (in hours)"
COM_INSTALLER_CHANGELOG="Changelog"
COM_INSTALLER_CHANGELOG_ADDITION="New Features"
COM_INSTALLER_CHANGELOG_CHANGE="Changes"
COM_INSTALLER_CHANGELOG_FIX="Bug Fixes"
COM_INSTALLER_CHANGELOG_LANGUAGE="Language"
COM_INSTALLER_CHANGELOG_NOTE="Notes"
COM_INSTALLER_CHANGELOG_REMOVE="Removed Features"
COM_INSTALLER_CHANGELOG_SECURITY="Security Fixes"
COM_INSTALLER_CHANGELOG_TITLE="Changelog - %s - %s"
COM_INSTALLER_CONFIGURATION="Installer: Options"
COM_INSTALLER_CONFIRM_UNINSTALL="Are you sure you want to uninstall? Confirming will permanently delete the selected item(s)!"
COM_INSTALLER_CURRENT_VERSION="Installed"
Expand Down
Loading