-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[4.0][GSoC 2018] Improve Override Management #21851
Merged
Merged
Changes from 121 commits
Commits
Show all changes
169 commits
Select commit
Hold shift + click to select a range
3610beb
Load correct core files of override files (#2)
anuragteapot 6e82f4f
Merge branch '4.0-dev' of github.com:joomla/joomla-cms
astridx d4a3b55
CS (#3) Coding Standards
anuragteapot c5a2eda
codingstandards
astridx 880c203
codingstandards (#4)
astridx 31f4250
Merge branch '4.0-dev' of github.com:joomla/joomla-cms
astridx 60836d5
Merge branch 'master' of https://github.com/joomla-projects/gsoc18_ov…
astridx c1241de
Test (#6)
anuragteapot a4e762d
Merge branch '4.0-dev' of github.com:joomla/joomla-cms
astridx bcbf86e
Remove Notice: Only available for html-folder
anuragteapot f386da8
Remove Warning if core file not found (#11)
anuragteapot cb15bcb
Merge branch '4.0-dev' of github.com:joomla/joomla-cms
astridx 5adcc2a
Merge branch 'master' of https://github.com/joomla-projects/gsoc18_ov…
astridx 78ef55d
Merge branch '4.0-dev' of github.com:joomla/joomla-cms
astridx 33ea597
Implement the diff view in template manager
anuragteapot 59218fa
Merge branch '4.0-dev' of github.com:joomla/joomla-cms
astridx 36be46e
Merge branch 'master' of https://github.com/joomla-projects/gsoc18_ov…
astridx 2461779
Merge branch '4.0-dev' of github.com:joomla/joomla-cms
astridx d6e08c2
Merge branch '4.0-dev' of github.com:joomla/joomla-cms
astridx b01cb7c
Merge branch '4.0-dev' of github.com:joomla/joomla-cms
astridx 15e5620
coding standard (#17)
astridx d370e94
fix diff (#18) Fix bug in path in case of administrator template over…
anuragteapot ba639ea
Merge branch '4.0-dev' of github.com:joomla/joomla-cms
astridx a94d3ba
Notification after update and TEST (#16)
anuragteapot 53f4ed2
resolved conflicts
astridx a455c92
Merge branch '4.0-dev' of github.com:joomla/joomla-cms
astridx bca8cff
Merge branch '4.0-dev' of github.com:joomla/joomla-cms
astridx 888b7ed
Merge branch '4.0-dev' of github.com:joomla/joomla-cms
astridx 13b6e01
coding standard (#21)
astridx b93b118
correction
astridx fc5702a
correction (#26)
astridx af558b5
Merge branch 'master' of https://github.com/joomla-projects/gsoc18_ov…
astridx c76acf8
Merge branch '4.0-dev' of github.com:joomla/joomla-cms
astridx d647097
Correcthtmlpath (#27)
astridx ab9d211
wip
astridx ff327bb
Merge branch '4.0-dev' of github.com:joomla/joomla-cms
astridx 097dd57
Merge branch '4.0-dev' of github.com:joomla/joomla-cms
astridx b630444
Merge branch '4.0-dev' of github.com:joomla/joomla-cms
astridx 4d8378a
List of updated override files. (#30)
anuragteapot b993c1b
Merge branch '4.0-dev' of github.com:joomla/joomla-cms
astridx 040e551
merge 4.0-dev
astridx 8a7a05c
addcss (#34)
astridx ee81275
merge conflics solved
astridx 850888a
Merge branch '4.0-dev' of github.com:joomla/joomla-cms
astridx dee46fe
Merge branch 'master' of https://github.com/joomla-projects/gsoc18_ov…
astridx 2117faf
Merge branch '4.0-dev' of github.com:joomla/joomla-cms
astridx ef31722
Final Product (#39)
anuragteapot 1a98066
save 3 lines :)
astridx 1931ede
Merge pull request #44 from joomla-projects/standardbutton
anuragteapot 95ba636
Merge branch '4.0-dev' of github.com:joomla/joomla-cms
astridx e83c665
New feature show status. (#47)
anuragteapot e96da2a
Merge branch '4.0-dev' of github.com:joomla/joomla-cms
astridx 10c3d6d
link
b408ed1
Merge branch '4.0-dev' of github.com:joomla/joomla-cms
astridx 2067698
Merge remote-tracking branch 'origin/master' into link
01b7b91
Merge pull request #49 from joomla-projects/link
anuragteapot b442af5
merge
astridx 32c1e13
corrected namespace
astridx 30e468d
Button to Switch (#35)
astridx 8925968
Sql files for fix database (#50)
astridx 36717c4
Merge branch '4.0-dev' of github.com:joomla/joomla-cms
astridx cc607c3
merge 4.0-dev
astridx 5479dd0
Merge branch '4.0-dev' of github.com:joomla/joomla-cms
astridx 2c393ff
Suggestion for displaying Dates in view updates files (#52)
astridx 023e8d5
Merge branch '4.0-dev' of github.com:joomla/joomla-cms
astridx 71fc7bb
Store Date as UTC and show it in server time zone (#57)
astridx 3ff9601
merge 4.0-dev
astridx de068aa
merge 4.0-dev
astridx 173474b
JToolbarHelper to ToolbarHelper
astridx 5cb2736
CS
ac943a2
Merge remote-tracking branch 'origin/4.0-dev'
7c7c268
Merge remote-tracking branch 'origin/master' into cs
34f1d17
Merge remote-tracking branch 'origin/master' into toolbar
cf47962
Toolbar namespace
anuragteapot fce14ad
Merge remote-tracking branch 'origin/master' into cs
b8155c5
namespace
9a5b177
plural
5d50298
name
30bddaf
clean
666127d
text
29ec592
fx
07ede17
sin
c5ca74f
files
80b2c92
s
3430ded
Merge remote-tracking branch 'origin/4.0-dev'
54ccfb6
Merge remote-tracking branch 'origin/master' into cs
eb688cf
merge 4.0-dev
astridx 3280c97
Secure comparison. And clean up.
anuragteapot af09962
merge 4.0-dev
astridx c883dcb
Merge branch '4.0-dev' of github.com:joomla/joomla-cms
astridx 90722ad
Merge remote-tracking branch 'upstream/4.0-dev'
7771111
merge 4.0-dev
astridx c6ba5fe
Merge branch 'master' of https://github.com/joomla-projects/gsoc18_ov…
astridx 2283cb6
Merge branch '4.0-dev' of github.com:joomla/joomla-cms
astridx 8e8d85e
Suggestion for language strings (#60)
astridx a466d98
Merge branch '4.0-dev' of github.com:joomla/joomla-cms
astridx 4048f3d
delete media folder plg_quickicon
astridx 9a6c9eb
add folder plg_quickicon to build/media_src
astridx b402333
delete files in media folder
astridx e37fa0a
Move media folder
anuragteapot d02848f
Move media folder - quickicon
anuragteapot 7996018
Merge branch 'master' of github.com:joomla-projects/gsoc18_override_m…
zero-24 5eb7fb2
Move media folder - System (#66)
anuragteapot c266dc3
Merge branch '4.0-dev' of github.com:joomla/joomla-cms
astridx 7ad3837
delete files in media folder for joomla toolbar (#67)
astridx 292c1d1
Fix button switchers style. (#70)
anuragteapot e176da5
merge 4.0-dev
astridx 7f868bb
changed uitab.addTab for updated files
astridx 8d6d8bb
Bring back core.js changes. (#69)
anuragteapot 205fd7f
Merge branch '4.0-dev' of https://github.com/joomla/joomla-cms
0962080
core
711defc
hound
1e27454
Merge branch '4.0-dev' into gsoc
anuragteapot 22edf9c
CS
de55532
Merge branch 'gsoc' of https://github.com/Anu1601CS/joomla-cms into gsoc
471ea78
scopr
dd302a1
grid
724b105
Merge branch '4.0-dev' into gsoc
anuragteapot f8daef0
Merge branch '4.0-dev' into gsoc
anuragteapot f9fadf0
alpha
6d784b7
Merge branch 'gsoc' of https://github.com/Anu1601CS/joomla-cms into gsoc
2e08fc0
Merge branch '4.0-dev' into gsoc
anuragteapot f0563ee
cs
367ed63
Merge branch 'gsoc' of https://github.com/Anu1601CS/joomla-cms into gsoc
cf92072
Merge branch '4.0-dev' into gsoc
anuragteapot af87954
lang
2d8c13a
Merge branch 'gsoc' of https://github.com/Anu1601CS/joomla-cms into gsoc
8052186
only override file
a8a320a
lang
d7f77d1
override lang installer
dd9e579
Merge branch '4.0-dev' into gsoc
anuragteapot b2459ce
Cs
971a614
Merge branch 'gsoc' of https://github.com/Anu1601CS/joomla-cms into gsoc
9060688
sub
5ec9ffb
Update list of core extensions (#71)
brianteeman bce28b9
Language changes (#76)
brianteeman 6dbf560
Change icon (#74)
brianteeman 4bbca67
Merge branch 'master' of https://github.com/joomla-projects/gsoc18_ov…
9d2ae3d
Merge branch '4.0-dev' into gsoc
anuragteapot 55390d1
lang
577d627
Merge branch 'gsoc' of https://github.com/Anu1601CS/joomla-cms into gsoc
2e3bd86
not core (#75)
brianteeman b3d6594
conf
c5f269d
Merge branch 'master' of https://github.com/joomla-projects/gsoc18_ov…
a33915f
Merge branch 'gsoc' of https://github.com/Anu1601CS/joomla-cms
3c585ef
namespace
a987734
Merge branch '4.0-dev' into gsoc
anuragteapot 0182655
cs
e49a2c2
Merge branch 'gsoc' of https://github.com/Anu1601CS/joomla-cms into gsoc
10e992f
Merge branch '4.0-dev' into gsoc
anuragteapot d93fc74
Merge branch '4.0-dev' into gsoc
anuragteapot 730240e
Updated files (#82)
brianteeman bef1a9c
Update en-GB.com_templates.ini (#81)
brianteeman 93b5113
Update en-GB.plg_quickicon_overridecheck.ini (#80)
brianteeman 90594e7
Update en-GB.plg_quickicon_overridecheck.ini (#79)
brianteeman 5dbe6e2
remove space (#78)
brianteeman 603447e
Merge branch 'master' of https://github.com/joomla-projects/gsoc18_ov…
ca8dc67
remove hardcoded id
c0160f3
Merge branch '4.0-dev' into gsoc
anuragteapot 7eb7ff1
null get function
8422f5a
state
4b71af8
Merge branch '4.0-dev' into gsoc
anuragteapot 8dca90c
clean
f034475
More changes "core" to "original" (#85)
richard67 1468d4e
Merge branch 'master' of https://github.com/joomla-projects/gsoc18_ov…
dedfcf4
cs
0abf606
update
9adaa46
plural
d9b032f
Merge branch '4.0-dev' into gsoc
anuragteapot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
administrator/components/com_admin/sql/updates/mysql/4.0.0-2018-07-19.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
CREATE TABLE IF NOT EXISTS `#__template_overrides` ( | ||
`id` int(10) unsigned NOT NULL AUTO_INCREMENT, | ||
`template` varchar(50) NOT NULL DEFAULT '', | ||
`hash_id` varchar(255) NOT NULL DEFAULT '', | ||
`extension_id` int(11) DEFAULT 0, | ||
`state` tinyint(1) NOT NULL DEFAULT 0, | ||
`action` varchar(50) NOT NULL DEFAULT '', | ||
`client_id` tinyint(1) unsigned NOT NULL DEFAULT 0, | ||
`created_date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', | ||
`modified_date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', | ||
PRIMARY KEY (`id`), | ||
KEY `idx_template` (`template`), | ||
KEY `idx_extension_id` (`extension_id`) | ||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci; | ||
|
||
INSERT INTO `#__extensions` (`extension_id`, `package_id`, `name`, `type`, `element`, `folder`, `client_id`, `enabled`, `access`, `protected`, `manifest_cache`, `params`, `checked_out`, `checked_out_time`, `ordering`, `state`, `namespace`) VALUES | ||
(491, 0, 'plg_installer_override', 'plugin', 'override', 'installer', 0, 1, 1, 1, '', '', 0, '0000-00-00 00:00:00', 4, 0, ''), | ||
(492, 0, 'plg_quickicon_overridecheck', 'plugin', 'overridecheck', 'quickicon', 0, 1, 1, 1, '', '', 0, '0000-00-00 00:00:00', 0, 0, ''), |
18 changes: 18 additions & 0 deletions
18
administrator/components/com_admin/sql/updates/postgresql/4.0.0-2018-07-19.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
CREATE TABLE IF NOT EXISTS "#__template_overrides" ( | ||
"id" serial NOT NULL, | ||
"template" varchar(50) DEFAULT '' NOT NULL, | ||
"hash_id" varchar(255) DEFAULT '' NOT NULL, | ||
"extension_id" bigint DEFAULT 0, | ||
"state" smallint DEFAULT 0 NOT NULL, | ||
"action" varchar(50) DEFAULT '' NOT NULL, | ||
"client_id" smallint DEFAULT 0 NOT NULL, | ||
"created_date" timestamp without time zone DEFAULT '1970-01-01 00:00:00' NOT NULL, | ||
"modified_date" timestamp without time zone DEFAULT '1970-01-01 00:00:00' NOT NULL, | ||
PRIMARY KEY ("id") | ||
); | ||
CREATE INDEX "#__template_overrides_idx_template" ON "#__template_overrides" ("template"); | ||
CREATE INDEX "#__template_overrides_idx_extension_id" ON "#__template_overrides" ("extension_id"); | ||
|
||
INSERT INTO "#__extensions" ("extension_id", "package_id", "name", "type", "element", "folder", "client_id", "enabled", "access", "protected", "manifest_cache", "params", "checked_out", "checked_out_time", "ordering", "state", "namespace") VALUES | ||
(491, 0, 'plg_installer_override', 'plugin', 'override', 'installer', 0, 1, 1, 1, '', '', 0, '1970-01-01 00:00:00', 4, 0, ''), | ||
(492, 0, 'plg_quickicon_overridecheck', 'plugin', 'overridecheck', 'quickicon', 0, 1, 1, 1, '', '', 0, '1970-01-01 00:00:00', 0, 0, ''); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,14 +11,16 @@ | |
|
||
defined('_JEXEC') or die; | ||
|
||
use Joomla\CMS\Client\ClientHelper; | ||
use Joomla\CMS\Factory; | ||
use Joomla\CMS\Language\Text; | ||
use Joomla\CMS\MVC\Controller\BaseController; | ||
use Joomla\CMS\MVC\Factory\MVCFactoryInterface; | ||
use Joomla\Component\Installer\Administrator\Model\InstallModel; | ||
use Joomla\CMS\Language\Text; | ||
use Joomla\CMS\Plugin\PluginHelper; | ||
use Joomla\CMS\Router\Route; | ||
use Joomla\CMS\Session\Session; | ||
use Joomla\CMS\Client\ClientHelper; | ||
use Joomla\CMS\Factory; | ||
use Joomla\Component\Installer\Administrator\Model\InstallModel; | ||
use Joomla\Utilities\ArrayHelper; | ||
|
||
/** | ||
* Template style controller class. | ||
|
@@ -44,6 +46,9 @@ public function __construct($config = array(), MVCFactoryInterface $factory = nu | |
|
||
// Apply, Save & New, and Save As copy should be standard on forms. | ||
$this->registerTask('apply', 'save'); | ||
$this->registerTask('unpublish', 'publish'); | ||
$this->registerTask('publish', 'publish'); | ||
$this->registerTask('deleteOverrideHistory', 'publish'); | ||
} | ||
|
||
/** | ||
|
@@ -74,6 +79,64 @@ public function close() | |
$this->setRedirect(Route::_($url, false)); | ||
} | ||
|
||
/** | ||
* Marked as Checked/Unchecked of override history. | ||
* | ||
* @return void | ||
* | ||
* @since __DEPLOY_VERSION__ | ||
*/ | ||
public function publish() | ||
{ | ||
// Check for request forgeries. | ||
Session::checkToken() or jexit(Text::_('JINVALID_TOKEN')); | ||
|
||
$app = Factory::getApplication(); | ||
$file = $this->input->get('file'); | ||
$id = $this->input->get('id'); | ||
|
||
$ids = $this->input->get('cid', array(), 'array'); | ||
$values = array('publish' => 1, 'unpublish' => 0, 'deleteOverrideHistory' => -3); | ||
$task = $this->getTask(); | ||
$value = ArrayHelper::getValue($values, $task, 0, 'int'); | ||
|
||
if (empty($ids)) | ||
{ | ||
$this->setMessage(Text::_('COM_TEMPLATES_ERROR_NO_FILE_SELECTED'), 'warning'); | ||
} | ||
else | ||
{ | ||
/* @var \Joomla\Component\Templates\Administrator\Model\TemplateModel $model */ | ||
$model = $this->getModel(); | ||
|
||
// Change the state of the records. | ||
if (!$model->publish($ids, $value, $id)) | ||
{ | ||
$this->setMessage(implode('<br>', $model->getErrors()), 'warning'); | ||
} | ||
else | ||
{ | ||
if ($value === 1) | ||
{ | ||
$ntext = 'COM_TEMPLATES_N_OVERRIDE_CHECKED'; | ||
} | ||
elseif ($value === 0) | ||
{ | ||
$ntext = 'COM_TEMPLATES_N_OVERRIDE_UNCHECKED'; | ||
} | ||
elseif ($value === -3) | ||
{ | ||
$ntext = 'COM_TEMPLATES_N_OVERRIDE_DELETED'; | ||
} | ||
|
||
$this->setMessage(Text::plural($ntext, count($ids))); | ||
} | ||
} | ||
|
||
$url = 'index.php?option=com_templates&view=template&id=' . $id . '&file=' . $file; | ||
$this->setRedirect(Route::_($url, false)); | ||
} | ||
|
||
/** | ||
* Method for copying the template. | ||
* | ||
|
@@ -738,4 +801,43 @@ public function extractArchive() | |
$this->setRedirect(Route::_($url, false)); | ||
} | ||
} | ||
|
||
/** | ||
* Fetch and report updates in \JSON format, for A\JAX requests | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Shouldn't it be |
||
* | ||
* @return void | ||
* | ||
* @since __DEPLOY_VERSION__ | ||
*/ | ||
public function ajax() | ||
{ | ||
$app = $this->app; | ||
|
||
if (!Session::checkToken('get')) | ||
{ | ||
$app->setHeader('status', 403, true); | ||
$app->sendHeaders(); | ||
echo Text::_('JINVALID_TOKEN'); | ||
$app->close(); | ||
} | ||
|
||
// Checks status of installer override plugin. | ||
if (!PluginHelper::isEnabled('installer', 'override')) | ||
{ | ||
$error = array('installerOverride' => 'disabled'); | ||
|
||
echo json_encode($error); | ||
|
||
$app->close(); | ||
} | ||
|
||
/* @var \Joomla\Component\Templates\Administrator\Model\TemplateModel $model */ | ||
$model = $this->getModel(); | ||
|
||
$result = $model->getUpdatedList(true, true); | ||
|
||
echo json_encode($result); | ||
|
||
$app->close(); | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update comment