Skip to content

Commit

Permalink
Add upgrade script
Browse files Browse the repository at this point in the history
  • Loading branch information
theboxer committed Oct 7, 2024
1 parent ad7f572 commit 12ccb2a
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
24 changes: 24 additions & 0 deletions setup/includes/upgrades/common/3.1.0-trash-menu.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php

/**
* Scripts add the new trash menu
*
* @var modX $modx
* @package setup
*/

use MODX\Revolution\modMenu;

$trashMenu = $modx->getObject(modMenu::class, ['text' => 'trash']);
if (!$trashMenu) {
$trashMenu = $modx->newObject(modMenu::class);
$trashMenu->fromArray([
'menuindex' => 4,
'text' => 'trash',
'description' => 'trash_desc',
'parent' => 'site',
'permissions' => 'menu_trash',
'action' => 'resource/trash',
], '', true, true);
$trashMenu->save();
}
1 change: 1 addition & 0 deletions setup/includes/upgrades/mysql/3.1.0-pl.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@
/* run upgrades common to all db platforms */
include dirname(__DIR__) . '/common/3.1.0-remove-deprecated-resource-fields.php';
include dirname(__DIR__) . '/common/3.1.0-modify-usergrouprole-authority-index.php';
include dirname(__DIR__) . '/common/3.1.0-trash-menu.php';

0 comments on commit 12ccb2a

Please sign in to comment.