Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: tmhub/core
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 1.3.8
Choose a base ref
...
head repository: tmhub/core
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Loading
Showing with 2,988 additions and 2,411 deletions.
  1. +18 −24 app/code/community/TM/Core/Block/Adminhtml/Module/Grid.php
  2. +39 −0 app/code/community/TM/Core/Block/Adminhtml/Module/Grid/Filter/Version.php
  3. +33 −18 app/code/community/TM/Core/Block/Adminhtml/Module/Grid/Renderer/Actions.php
  4. +35 −0 app/code/community/TM/Core/Block/Adminhtml/Module/Grid/Renderer/Version.php
  5. +50 −0 app/code/community/TM/Core/Block/Adminhtml/Renderer/Actions.php
  6. +0 −35 app/code/community/TM/Core/Block/Adminhtml/Support/Edit.php
  7. +0 −16 app/code/community/TM/Core/Block/Adminhtml/Support/Edit/Form.php
  8. +0 −39 app/code/community/TM/Core/Block/Adminhtml/Support/Edit/Form/Element/Theard.php
  9. +0 −182 app/code/community/TM/Core/Block/Adminhtml/Support/Edit/Form/Element/Theard/Content.php
  10. +0 −207 app/code/community/TM/Core/Block/Adminhtml/Support/Edit/Tab/Main.php
  11. +0 −12 app/code/community/TM/Core/Block/Adminhtml/Support/Edit/Tabs.php
  12. +0 −12 app/code/community/TM/Core/Block/Adminhtml/Support/List.php
  13. +0 −203 app/code/community/TM/Core/Block/Adminhtml/Support/List/Grid.php
  14. +30 −0 app/code/community/TM/Core/Block/Libraries.php
  15. +18 −0 app/code/community/TM/Core/Helper/Data.php
  16. +207 −0 app/code/community/TM/Core/Helper/Firephp.php
  17. +25 −0 app/code/community/TM/Core/Model/Adminhtml/System/Config/Backend/Serialized/Array.php
  18. +146 −0 app/code/community/TM/Core/Model/Image/Uploader.php
  19. +2 −1 app/code/community/TM/Core/Model/Module.php
  20. +14 −6 app/code/community/TM/Core/Model/Module/Upgrade.php
  21. +0 −257 app/code/community/TM/Core/Model/Oauth/Client.php
  22. +13 −0 app/code/community/TM/Core/Model/Observer.php
  23. +68 −0 app/code/community/TM/Core/Model/Observer/Module.php
  24. +0 −17 app/code/community/TM/Core/Model/Resource/Module/AdminGridCollection.php
  25. +6 −0 app/code/community/TM/Core/Model/Resource/Module/Collection.php
  26. +51 −0 app/code/community/TM/Core/Model/Resource/Module/Collection/Abstract.php
  27. +36 −0 app/code/community/TM/Core/Model/Resource/Module/LocalCollection.php
  28. +0 −502 app/code/community/TM/Core/Model/Resource/Module/MergedCollection.php
  29. +225 −134 app/code/community/TM/Core/Model/Resource/Module/RemoteCollection.php
  30. +0 −416 app/code/community/TM/Core/Model/Resource/Support/Collection.php
  31. +39 −0 app/code/community/TM/Core/Model/System/Config/Source/CmsBlock.php
  32. +38 −0 app/code/community/TM/Core/controllers/Adminhtml/Tmcore/ModuleController.php
  33. +0 −282 app/code/community/TM/Core/controllers/Adminhtml/Tmcore/SupportController.php
  34. +0 −10 app/code/community/TM/Core/etc/adminhtml.xml
  35. +36 −3 app/code/community/TM/Core/etc/config.xml
  36. +62 −0 app/code/community/TM/Core/sql/tm_core_setup/mysql4-upgrade-1.5.8-1.6.0.php
  37. +6 −25 app/design/adminhtml/default/default/layout/tmcore.xml
  38. +1 −8 app/design/frontend/base/default/layout/tm/core.xml
  39. +1 −1 app/locale/{el_Gr → el_GR}/TM_Core.csv
  40. +2 −0 app/locale/en_US/TM_Core.csv
  41. +5 −0 js/lib/jquery/jquery-1.12.0.min.js
  42. +1 −1 js/lib/jquery/noconflict.js
  43. +50 −0 js/tm/adminhtml/core/actions.css
  44. +18 −0 js/tm/adminhtml/core/actions.js
  45. +23 −0 js/tm/lib/chosen/LICENSE.md
  46. BIN js/tm/lib/chosen/chosen-sprite.png
  47. BIN js/tm/lib/chosen/chosen-sprite@2x.png
  48. +430 −0 js/tm/lib/chosen/chosen.css
  49. +1,190 −0 js/tm/lib/chosen/chosen.proto.js
  50. +2 −0 js/tm/lib/chosen/chosen.proto.min.js
  51. +66 −0 js/tm/lib/event.simulate.js
  52. +2 −0 modman
42 changes: 18 additions & 24 deletions app/code/community/TM/Core/Block/Adminhtml/Module/Grid.php
Original file line number Diff line number Diff line change
@@ -6,16 +6,19 @@ public function __construct()
{
parent::__construct();
$this->setId('moduleGrid');
$this->setDefaultSort('code');
$this->setDefaultDir('ASC');
$this->setDefaultSort('release_date');
$this->setDefaultDir('DESC');
$this->setDefaultFilter(array(
'version' => TM_Core_Block_Adminhtml_Module_Grid_Filter_Version::VERSION_AVAILABLE
));
$this->setSaveParametersInSession(true);
$this->setUseAjax(true);
$this->setVarNameFilter('module_filter');
}

protected function _prepareCollection()
{
$collection = Mage::getResourceModel('tmcore/module_AdminGridCollection');
$collection = Mage::getResourceModel('tmcore/module_collection');
$this->setCollection($collection);
return parent::_prepareCollection();
}
@@ -29,31 +32,25 @@ protected function _prepareColumns()
));

$this->addColumn('version', array(
'header' => Mage::helper('tmcore')->__('Local Version'),
'align' => 'right',
'header' => Mage::helper('tmcore')->__('Version'),
'align' => 'center',
'filter' => 'tmcore/adminhtml_module_grid_filter_version',
'renderer' => 'tmcore/adminhtml_module_grid_renderer_version',
'index' => 'version',
'width' => '80px'
));

$this->addColumn('latest_version', array(
'header' => Mage::helper('tmcore')->__('Latest Version'),
'align' => 'right',
'index' => 'latest_version',
'width' => '80px'
'width' => '150px'
));

$this->addColumn('version_status', array(
'header' => Mage::helper('tmcore')->__('Version Status'),
'width' => '60px',
'index' => 'version_status',
'renderer' => 'tmcore/adminhtml_module_grid_renderer_versionStatus',
'type' => 'options',
'options' => Mage::getModel('tmcore/module')->getVersionStatuses()
$this->addColumn('release_date', array(
'header' => Mage::helper('tmcore')->__('Latest Release Date'),
'index' => 'release_date',
'filter' => false,
'width' => '180px',
'type' => 'datetime',
));

$this->addColumn('actions', array(
'header' => Mage::helper('tmcore')->__('Actions'),
'width' => '200px',
'width' => '160px',
'filter' => false,
'sortable' => false,
'renderer' => 'tmcore/adminhtml_module_grid_renderer_actions'
@@ -69,9 +66,6 @@ public function getGridUrl()

public function getRowUrl($row)
{
if ($row->hasUpgradesDir() || $row->getIdentityKeyLink()) {
return $this->getUrl('*/*/manage', array('id' => $row->getId()));
}
return false;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?php

class TM_Core_Block_Adminhtml_Module_Grid_Filter_Version
extends Mage_Adminhtml_Block_Widget_Grid_Column_Filter_Select
{
const VERSION_AVAILABLE = 'available';
const VERSION_UNAVAILABLE = 'unavailable';

protected static $_options = array(
null => null,
self::VERSION_AVAILABLE => 'Available',
self::VERSION_UNAVAILABLE => 'Unavailable',
);

protected function _getOptions()
{
$result = array();
foreach (self::$_options as $code => $label) {
$result[] = array(
'value' => $code,
'label' => Mage::helper('tmcore')->__($label)
);
}

return $result;
}

public function getCondition()
{
switch ($this->getValue()) {
case self::VERSION_AVAILABLE:
return array('notnull' => true);
case self::VERSION_UNAVAILABLE:
return array('null' => true);
default:
return null;
}
}
}
Original file line number Diff line number Diff line change
@@ -1,45 +1,60 @@
<?php

class TM_Core_Block_Adminhtml_Module_Grid_Renderer_Actions
extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract
class TM_Core_Block_Adminhtml_Module_Grid_Renderer_Actions extends TM_Core_Block_Adminhtml_Renderer_Actions
{
/**
* Renders grid column
*
* @param Varien_Object $row
* @return string
*/
public function render(Varien_Object $row)
public function getActions(Varien_Object $row)
{
$links = array();

if ($row->getChangelog()) {
if ($row->getVersionStatus() === TM_Core_Model_Module::VERSION_OUTDATED) {
$links[] = sprintf(
'<a href="javascript:void(0)" onclick="%s">%s</a><div style="display:none" class="changelog"><div class="title">%s</div><div class="content">%s</div></div>',
"tmcoreWindow.update(this.next('.changelog').down('.content').innerHTML, this.next('.changelog').down('.title').innerHTML).show()",
Mage::helper('tmcore')->__('Changelog'),
strip_tags($row->getCode()),
nl2br(htmlspecialchars($row->getChangelog()))
'<a href="%s">%s</a>',
$this->getUrl('*/*/upgrade/', array('_current' => true, 'id' => $row->getId())),
Mage::helper('tmcore')->__('Run Upgrades')
);
}

if ($row->getDownloadLink()) {
if ($row->hasUpgradesDir() || $row->getIdentityKeyLink()) {
$links[] = sprintf(
'<a href="%s">%s</a>',
$this->getUrl('*/*/manage/', array('_current' => true, 'id' => $row->getId())),
Mage::helper('tmcore')->__('Open Installer')
);
}

if ($row->getDocsLink()) {
$links[] = sprintf(
'<a href="%s" title="%s" onclick="window.open(this.href); return false;">%s</a>',
$row->getDownloadLink(),
Mage::helper('tmcore')->__('Download Latest Version'),
Mage::helper('tmcore')->__('Download')
$row->getDocsLink(),
Mage::helper('tmcore')->__('Read Documentation'),
Mage::helper('tmcore')->__('Read Documentation')
);
}

if ($row->hasUpgradesDir() || $row->getIdentityKeyLink()) {
if ($row->getChangelogLink()) {
$links[] = sprintf(
'<a href="%s">%s</a>',
$this->getUrl('*/*/manage/', array('_current' => true, 'id' => $row->getId())),
Mage::helper('tmcore')->__('Manage')
'<a href="%s" title="%s" onclick="window.open(this.href); return false;">%s</a>',
$row->getChangelogLink(),
Mage::helper('tmcore')->__('View Changelog'),
Mage::helper('tmcore')->__('View Changelog')
);
}

if ($row->getDownloadLink()) {
$links[] = sprintf(
'<a href="%s" title="%s" onclick="window.open(this.href); return false;">%s</a>',
$row->getDownloadLink(),
Mage::helper('tmcore')->__('Download Latest Version'),
Mage::helper('tmcore')->__('Download')
);
}

return implode(' | ', $links);
return $links;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?php

class TM_Core_Block_Adminhtml_Module_Grid_Renderer_Version
extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract
{
/**
* Renders grid column
*
* @param Varien_Object $row
* @return string
*/
public function render(Varien_Object $row)
{
$currentVersion = $row->getData($this->getColumn()->getIndex());

if (!$currentVersion) {
return 'N/A';
}

$latestVersion = $row->getData('latest_version');

$result = version_compare($currentVersion, $latestVersion, '>=');
if ($result) {
$severity = 'grid-severity-notice';
$title = $this->__('Module is up to date');
} else {
$severity = 'grid-severity-major';
$title = $this->__("The latest version is %s", $latestVersion);
}

return '<span class="' . $severity . '" title="' . $title . '"><span>'
. $currentVersion
. '</span></span>';
}
}
50 changes: 50 additions & 0 deletions app/code/community/TM/Core/Block/Adminhtml/Renderer/Actions.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<?php

class TM_Core_Block_Adminhtml_Renderer_Actions extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract
{
/**
* Returns array of html links, that will be wrapped into actions dropdown
*
* @param Varien_Object $row [description]
* @return array
*/
public function getActions(Varien_Object $row)
{
return array();
}

/**
* Renders grid column
*
* @param Varien_Object $row
* @return string
*/
public function render(Varien_Object $row)
{
$actions = $this->getActions($row);

if (!$actions) {
return '';
}

$result = '<div class="tm-action-select-wrap">';
if (count($actions) > 1) {
$result .= '<a href="javascript:void(0)" class="tm-action-select">'
. Mage::helper('adminhtml')->__('Select')
. '</a>';

$result .= '<ul class="tm-action-menu">';
foreach ($actions as $action) {
$result .= '<li>' . $action . '</li>';
}
$result .= '</ul>';
} else {
foreach ($actions as $action) {
$result .= $action;
}
}
$result .= '</div>';

return $result;
}
}
35 changes: 0 additions & 35 deletions app/code/community/TM/Core/Block/Adminhtml/Support/Edit.php

This file was deleted.

16 changes: 0 additions & 16 deletions app/code/community/TM/Core/Block/Adminhtml/Support/Edit/Form.php

This file was deleted.

This file was deleted.

Loading