Skip to content

Commit

Permalink
[FIX] Attempt to modify property "config" on null.
Browse files Browse the repository at this point in the history
  • Loading branch information
Seiger committed Jun 23, 2023
1 parent 2ec0607 commit bbfc1b8
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions manager/media/style/default/style.php
Expand Up @@ -9,22 +9,22 @@
* MODX version: 1.0.3
*/
$style_path = 'media/style/' . ManagerTheme::getTheme() . '/images/';
$modx->config['mgr_date_picker_path'] = 'media/calendar/datepicker.inc.php';
evo()->config['mgr_date_picker_path'] = 'media/calendar/datepicker.inc.php';

if (!empty($_GET['a']) && $_GET['a'] == 2) {
$modx->config['enable_filter'] = 1;
evo()->config['enable_filter'] = 1;

$modx->addSnippet('hasPermission', 'return $modx->hasPermission($key);');
evo()->addSnippet('hasPermission', 'return evo()->hasPermission($key);');

if ($modx->hasPermission('new_template') || $modx->hasPermission('edit_template') || $modx->hasPermission('new_snippet') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('new_plugin') || $modx->hasPermission('edit_plugin') || $modx->hasPermission('manage_metatags')) {
if (evo()->hasPermission('new_template') || evo()->hasPermission('edit_template') || evo()->hasPermission('new_snippet') || evo()->hasPermission('edit_snippet') || evo()->hasPermission('new_plugin') || evo()->hasPermission('edit_plugin') || evo()->hasPermission('manage_metatags')) {
$hasAnyPermission = 1;
} else {
$hasAnyPermission = 0;
}

$modx->addSnippet('hasAnyPermission', 'global $hasAnyPermission; return $hasAnyPermission;');
evo()->addSnippet('hasAnyPermission', 'global $hasAnyPermission; return $hasAnyPermission;');

$modx->addSnippet('getLoginUserName', 'return $modx->getLoginUserName();');
evo()->addSnippet('getLoginUserName', 'return evo()->getLoginUserName();');
}

// Favicon
Expand Down Expand Up @@ -140,7 +140,7 @@

// actions buttons templates
$action = isset($_REQUEST['a']) ? $_REQUEST['a'] : '';
if (!empty($modx->config['global_tabs']) && !isset($_SESSION['stay'])) {
if (!empty(evo()->config['global_tabs']) && !isset($_SESSION['stay'])) {
$_REQUEST['stay'] = 2;
}
if (isset($_REQUEST['stay'])) {
Expand All @@ -156,52 +156,52 @@
case '4':
case '27':
case '72':
if ($modx->hasPermission('new_document')) {
if (evo()->hasPermission('new_document')) {
$addnew = 1;
}
break;
case '16':
case '19':
if ($modx->hasPermission('new_template')) {
if (evo()->hasPermission('new_template')) {
$addnew = 1;
}
break;
case '300':
case '301':
if ($modx->hasPermission('new_snippet') && $modx->hasPermission('new_chunk') && $modx->hasPermission('new_plugin')) {
if (evo()->hasPermission('new_snippet') && evo()->hasPermission('new_chunk') && evo()->hasPermission('new_plugin')) {
$addnew = 1;
}
break;
case '77':
case '78':
if ($modx->hasPermission('new_chunk')) {
if (evo()->hasPermission('new_chunk')) {
$addnew = 1;
}
break;
case '22':
case '23':
if ($modx->hasPermission('new_snippet')) {
if (evo()->hasPermission('new_snippet')) {
$addnew = 1;
}
break;
case '101':
case '102':
if ($modx->hasPermission('new_plugin')) {
if (evo()->hasPermission('new_plugin')) {
$addnew = 1;
}
break;
case '106':
case '107':
case '108':
if ($modx->hasPermission('new_module')) {
if (evo()->hasPermission('new_module')) {
$addnew = 1;
}
if ($modx->hasPermission('exec_module')) {
if (evo()->hasPermission('exec_module')) {
$run = 1;
}
break;
case '88':
if ($modx->hasPermission('new_user')) {
if (evo()->hasPermission('new_user')) {
$addnew = 1;
}
break;
Expand Down Expand Up @@ -234,7 +234,7 @@
<option id="stay3" value="" ' . ($stay == '' ? ' selected="selected"' : '') . '>' . $_lang['close'] . '</option>
</select>
</div>' .
($addnew ? '
($addnew ? '
<a id="Button6" class="btn btn-secondary' . $disabled . '" href="javascript:;" onclick="actions.duplicate();">
<i class="' . $_style["icon_clone"] . '"></i><span>' . $_lang['duplicate'] . '</span>
</a>
Expand Down Expand Up @@ -364,7 +364,7 @@
'static' => array(
'document' => '<div id="actions">
<div class="btn-group">' .
($addnew ? '
($addnew ? '
<a class="btn btn-secondary" href="javascript:;" onclick="actions.new();">
<i class="' . $_style["icon_document"] . '"></i><span>' . $_lang['create_resource_here'] . '</span>
</a>
Expand Down

0 comments on commit bbfc1b8

Please sign in to comment.