Skip to content

Commit

Permalink
Additional updates
Browse files Browse the repository at this point in the history
(Finding areas I'd missed updating in earlier commits)
  • Loading branch information
smg6511 committed Aug 26, 2024
1 parent 25244e2 commit 19f9c2f
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 11 deletions.
1 change: 1 addition & 0 deletions core/lexicon/en/workspace.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
$_lang['newest_additions'] = 'Newest Additions';
$_lang['no_preview'] = 'No Preview';
$_lang['not_installed'] = 'Not Installed';
$_lang['not_updated'] = 'Not Updated';
$_lang['package'] = 'Package';
$_lang['package_add'] = 'New Package';
$_lang['package_already_downloaded'] = 'Package already downloaded';
Expand Down
18 changes: 12 additions & 6 deletions core/src/Revolution/Processors/System/Log/GetList.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/*
* This file is part of MODX Revolution.
*
Expand All @@ -16,6 +17,7 @@
use MODX\Revolution\modDocument;
use MODX\Revolution\modMenu;
use MODX\Revolution\Processors\Processor;
use MODX\Revolution\Utilities\modFormatter;
use MODX\Revolution\modManagerLog;
use MODX\Revolution\modResource;
use MODX\Revolution\modStaticResource;
Expand Down Expand Up @@ -52,6 +54,7 @@ public function checkPermissions()
*/
public function initialize()
{
$this->formatter = new modFormatter($this->modx);
$this->setDefaultProperties([
'limit' => 20,
'start' => 0,
Expand All @@ -61,7 +64,7 @@ public function initialize()
'actionType' => false,
'dateStart' => false,
'dateEnd' => false,
'dateFormat' => $this->modx->getOption('manager_date_format') . ', ' . $this->modx->getOption('manager_time_format'),
'dateFormat' => '',
]);
return true;
}
Expand Down Expand Up @@ -185,8 +188,8 @@ public function prepareLog(modManagerLog $log)
// Action is prefixed with a namespace, assume we need to load a package
$exp = explode('.', $logArray['action']);
$ns = $exp[0];
$path = $this->modx->getOption("{$ns}.core_path", null,
$this->modx->getOption('core_path') . "components/{$ns}/") . 'model/';
$nsCorePath = $this->modx->getOption('core_path') . "components/{$ns}/";
$path = $this->modx->getOption("{$ns}.core_path", null, $nsCorePath) . 'model/';
$this->modx->addPackage($ns, $path);
}
if (!empty($logArray['classKey']) && !empty($logArray['item'])) {
Expand All @@ -204,7 +207,11 @@ public function prepareLog(modManagerLog $log)
} else {
$logArray['name'] = $log->get('item');
}
$logArray['occurred'] = date($this->getProperty('dateFormat'), strtotime($logArray['occurred']));
$customFormat = $this->getProperty('dateFormat');
$logArray['occurred'] = !empty($customFormat)
? $this->formatter->formatManagerDateTime($logArray['occurred'], '', false, true, $customFormat)
: $this->formatter->formatManagerDateTime($logArray['occurred'])
;

return $logArray;
}
Expand Down Expand Up @@ -245,8 +252,7 @@ public function getNameField($classKey)
case modUserSetting::class:
$field = 'key';
break;
default:
break;
// no default
}
return $field;
}
Expand Down
10 changes: 5 additions & 5 deletions core/src/Revolution/Processors/Workspace/Lexicon/GetList.php
Original file line number Diff line number Diff line change
Expand Up @@ -139,26 +139,26 @@ function parseArray($needle, array $haystack = [])
/* loop through */
$list = [];
foreach ($entries as $name => $value) {
$editedOn = null;
$entryArray = [
'name' => $name,
'value' => $value,
'namespace' => $this->getProperty('namespace'),
'topic' => $this->getProperty('topic'),
'language' => $this->getProperty('language'),
'createdon' => $this->formatter->managerDateEmptyDisplay,
'editedon' => $this->formatter->managerDateEmptyDisplay,
'createdon' => null,
'editedon' => null,
'overridden' => 0,
];
/* if override in db, load */
if (array_key_exists($name, $dbEntries)) {
foreach ($dbEntries[$name] as $k => $v) {
$entryArray[$k] = $v; // array_merge very slow inside loop, don't use it here
}

$entryArray['editedon'] = $this->formatter->formatManagerDateTime($entryArray['editedon']) ?: $this->formatter->formatManagerDateTime($entryArray['createdon']);

$editedOn = $entryArray['editedon'] ?: $entryArray['createdon'] ;
$entryArray['overridden'] = 1;
}
$entryArray['editedon'] = $this->formatter->formatManagerDateTime($editedOn);
$list[] = $entryArray;
}

Expand Down
2 changes: 2 additions & 0 deletions manager/assets/modext/widgets/system/modx.grid.manager.log.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ MODx.panel.ManagerLog = function(config) {
,name: 'dateStart'
,allowBlank: true
,anchor: '100%'
,format: MODx.config.manager_date_format
,listeners: {
'select': {fn: this.filter, scope: this}
,'render': {fn:this._addEnterKeyHandler}
Expand All @@ -85,6 +86,7 @@ MODx.panel.ManagerLog = function(config) {
,name: 'dateEnd'
,allowBlank: true
,anchor: '100%'
,format: MODx.config.manager_date_format
,listeners: {
'select': {fn: this.filter, scope: this}
,'render': {fn:this._addEnterKeyHandler}
Expand Down

0 comments on commit 19f9c2f

Please sign in to comment.