Skip to content

Commit e08749d

Browse files
committed
Jet Studio: Module delete button added
1 parent 548f574 commit e08749d

File tree

4 files changed

+75
-4
lines changed

4 files changed

+75
-4
lines changed

_tools/studio/application/Parts/modules/views/module/edit/form.phtml

Lines changed: 54 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
<?php
22
namespace JetStudio;
33

4-
use Jet\Tr;
4+
use Jet\SysConf_Jet_Modules;use Jet\Tr;
55
use Jet\Form_Renderer;
66
use Jet\MVC_View;
7+
use Jet\UI;
8+
use Jet\UI_dialog;
79

810
/**
911
* @var MVC_View $this
@@ -88,3 +90,54 @@ $form->renderer()->setDefaultFieldWidth( [
8890
<?= $this->render( 'page/create/dialog' ) ?>
8991
<?= $this->render( 'menu_item/create/dialog' ) ?>
9092

93+
<?php
94+
$delete_module_info = UI::dialog(
95+
id: 'delete_module_info',
96+
title: Tr::_('How to delete module?'),
97+
size: UI_dialog::SIZE_LARGE
98+
);
99+
100+
echo $delete_module_info->start();
101+
102+
?>
103+
<b><?=Tr::_('Deleting a module is potential risc operation!')?></b>
104+
<br><br>
105+
<p><?=Tr::_('But it is possible for sure and it is very easy.')?></p>
106+
107+
<ol start="1">
108+
<?php if($current->isMandatory()): ?>
109+
<li><?=Tr::_('This module is <b>marked as mandatory</b>.<br><br>Please change manually this definition in the manifest file:<br><b>%manifest_path%</b>', [
110+
'manifest_path' => $current->getModuleDir().SysConf_Jet_Modules::getManifestFileName()
111+
])?>
112+
<br><br>
113+
<?=Tr::_('And then reload Jet Studio')?>
114+
<br><br>
115+
</li>
116+
<?php endif; ?>
117+
118+
<?php if($current->isActivated()):?>
119+
<li>
120+
<?=Tr::_('Deactivate module by this tool using <b>"Deactivate" button</b>.')?>
121+
<br><br>
122+
</li>
123+
<?php endif; ?>
124+
125+
<?php if($current->isInstalled()): ?>
126+
<li>
127+
<?=Tr::_('Uninstall module by this tool using <b>"Uninstall" button</b>.')?>
128+
<br><br>
129+
</li>
130+
<?php endif; ?>
131+
132+
<li>
133+
<?=Tr::_('Manually delete directory:<br><b>%module_dir%</b>', [
134+
'module_dir'=>$current->getModuleDir()
135+
])?>
136+
<br><br>
137+
</li>
138+
</ol>
139+
<?php
140+
echo $delete_module_info->end();
141+
142+
?>
143+

_tools/studio/application/Parts/modules/views/module/edit/toolbar.phtml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,6 @@ else:
4545

4646
<?= UI::button_create( Tr::_( 'Add page' ) )->setOnClick( 'Modules.editModule.addPage.openDialog()' ) ?>
4747
<?= UI::button_create( Tr::_( 'Add menu item' ) )->setOnClick( 'Modules.editModule.addMenuItem.openDialog()' ) ?>
48-
48+
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
49+
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
50+
<?= UI::button_delete( Tr::_('Delete this module') )->setOnClick("$('#delete_module_info').modal('show');");

_tools/studio/application/dictionaries/cs_CZ/modules.php

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
'Add controller' => 'Přidat kontroler',
1515
'Add menu item' => 'Přidat položku menu',
1616
'Delete this content' => 'Smazat tento obsah',
17-
'Delete this module' => 'Smazat tneto modul',
17+
'Delete this module' => 'Smazat tento modul',
1818
'Please select module wizard' => 'Prosím zvolte wizard modulu',
1919
'Setup module wizard' => 'Nastavit wizard modulu',
2020
'Save and generate' => 'Uložit a generovat',
@@ -139,5 +139,13 @@
139139
'System' => 'System',
140140
'Invalid module name format' => 'Neplatný formát názvu modulu',
141141
'Module with the same name already exists' => 'Modul se stejným jménem již existuje',
142-
'Please enter menu item label' => '',
142+
'Please enter menu item label' => 'Prosím zadejte popisek menu',
143+
'But it is possible for sure and it is very easy.' => 'Ale samozřejmě je to možné a je to velice snadné.',
144+
'This module is <b>marked as mandatory</b>.<br><br>Please change manually this definition in the manifest file:<br><b>%manifest_path%</b>' => 'Tento module <b>je označen jako povinný</b>.<br><br>Prosím změňte ručně tuto definici v souboru manifestu:<br><b>%manifest_path%</b>',
145+
'Deactivate module by this tool using <b>"Deactivate" button</b>.' => 'Deaktivujte modul pomocí tohoto nástroje <b>kliknutím na tlačítko "Deaktivovat"</b>',
146+
'Uninstall module by this tool using <b>"Uninstall" button</b>.' => 'Odinstalujte modul pomocí tohoto nástroje <b>kliknutím na tlačítko "Odinstalovat"</b>',
147+
'Manually delete directory:<br><b>%module_dir%</b>' => 'Ručně smažte adresář:<br><b>%module_dir%</b>',
148+
'And then reload Jet Studio' => 'A pak obnovte tuto stránku Jet Studia',
149+
'Deleting a module is potential risc operation!' => 'Smazání modulu je potencionálně riziková operace!',
150+
'How to delete module?' => 'Jak smazat modul?',
143151
];

_tools/studio/application/dictionaries/en_US/modules.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,4 +143,12 @@
143143
'Please select controller action' => '',
144144
'URL conflicts with page <b>%page%</b>' => '',
145145
'Module <b>%module%</b> has been deactivated' => '',
146+
'How to delete module?' => '',
147+
'Deleting a module is potential risc operation!' => '',
148+
'But it is possible for sure and it is very easy.' => '',
149+
'Deactivate module by this tool using <b>"Deactivate" button</b>.' => '',
150+
'Uninstall module by this tool using <b>"Uninstall" button</b>.' => '',
151+
'Manually delete directory:<br><b>%module_dir%</b>' => '',
152+
'This module is <b>marked as mandatory</b>.<br><br>Please change manually this definition in the manifest file:<br><b>%manifest_path%</b>' => '',
153+
'And then reload Jet Studio' => '',
146154
];

0 commit comments

Comments
 (0)