Skip to content

Commit bc9d948

Browse files
committed
✨ Refactor Forms Module: Enhance navigation and permissions πŸŽ‰
- Remove deprecated index page and related code πŸ—‘οΈ - Update form menu to include access checks for current user πŸ”’ - Improve path handling in collected forms and embed code πŸ› οΈ - Clean up unused variables and streamline module permissions 🧹 - Add new links for form management and embed code generation πŸ”—
1 parent e8f8433 commit bc9d948

11 files changed

Lines changed: 13 additions & 35 deletions

File tree

β€Žlhc_web/design/defaulttheme/tpl/lhform/index.tpl.phpβ€Ž

Lines changed: 0 additions & 8 deletions
This file was deleted.

β€Žlhc_web/design/defaulttheme/tpl/lhsystem/configuration_tabs_content/chat.tpl.phpβ€Ž

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
<?php include(erLhcoreClassDesign::designtpl('lhsystem/configuration_links/blocking.tpl.php'));?>
99
<?php include(erLhcoreClassDesign::designtpl('lhsystem/configuration_links/look_and_feel.tpl.php'));?>
1010
<?php include(erLhcoreClassDesign::designtpl('lhsystem/configuration_links/integration.tpl.php'));?>
11+
<?php include(erLhcoreClassDesign::designtpl('pagelayouts/parts/modules_menu/form.tpl.php'));?>
1112
</div>
1213
<div class="col-md-6">
1314
<?php include(erLhcoreClassDesign::designtpl('lhsystem/configuration_links/automation.tpl.php'));?>
Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
<?php include(erLhcoreClassDesign::designtpl('pagelayouts/parts/modules_menu/form_pre.tpl.php'));?>
2-
<?php if ($pagelayouts_parts_modules_menu_form_enabled == true && $useFm) : ?>
3-
<li class="nav-item"><a class="nav-link" href="<?php echo erLhcoreClassDesign::baseurl('form/index')?>"><i class="material-icons">attachment</i><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('browseoffer/index','Forms');?></a></li>
4-
<?php endif;?>
2+
<?php if ($pagelayouts_parts_modules_menu_form_enabled == true && $currentUser->hasAccessTo('lhform','manage_fm')) : ?>
3+
<h5><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('system/configuration','Forms');?></h5>
4+
<ul>
5+
<li><a href="<?php echo erLhcoreClassDesign::baseurl('abstract/list')?>/Form"><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('system/configuration','List of forms');?></a></li>
6+
<?php if ($currentUser->hasAccessTo('lhform','generate_js')) : ?>
7+
<li><a href="<?php echo erLhcoreClassDesign::baseurl('form/embedcode')?>"><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('system/configuration','Page embed code');?></a></li>
8+
<?php endif; ?>
9+
</ul>
10+
<?php endif; ?>

β€Žlhc_web/design/defaulttheme/tpl/pagelayouts/parts/modules_menu/modules_permissions.tpl.phpβ€Ž

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,4 @@
33
$useFaq = $currentUser->hasAccessTo('lhfaq','manage_faq');
44
$useChatbox = $currentUser->hasAccessTo('lhchatbox','manage_chatbox');
55
$useBo = $currentUser->hasAccessTo('lhbrowseoffer','manage_bo');
6-
$useFm = $currentUser->hasAccessTo('lhform','manage_fm');
76
?>

β€Žlhc_web/design/defaulttheme/tpl/pagelayouts/parts/top_menu_modules_extra.tpl.phpβ€Ž

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?php if ($useFm || $useBo || $useChatbox || $useFaq || $useQuestionary || $hasExtensionModule) : ?>
1+
<?php if ($useBo || $useChatbox || $useFaq || $useQuestionary || $hasExtensionModule) : ?>
22
<li class="nav-item">
33
<a href="#" class="nav-link"><i class="material-icons">info_outline</i><?php include(erLhcoreClassDesign::designtpl('pagelayouts/parts/extra_modules_title.tpl.php'));?><i class="material-icons arrow md-18">chevron_right</i></a>
44
<ul class="nav nav-second-level collapse">
@@ -10,8 +10,6 @@
1010

1111
<?php include(erLhcoreClassDesign::designtpl('pagelayouts/parts/modules_menu/browseoffer.tpl.php'));?>
1212

13-
<?php include(erLhcoreClassDesign::designtpl('pagelayouts/parts/modules_menu/form.tpl.php'));?>
14-
1513
<?php include(erLhcoreClassDesign::designtpl('pagelayouts/parts/modules_menu/extension_module_multiinclude.tpl.php'));?>
1614
</ul>
1715
</li>

β€Žlhc_web/lib/models/lhabstract/erlhabstractmodelform.phpβ€Ž

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,7 @@ public function dependJs()
7878
public function getModuleTranslations()
7979
{
8080
$metaData = array(
81-
'path' => array(
82-
'url' => erLhcoreClassDesign::baseurl('form/index'),'title' => erTranslationClassLhTranslation::getInstance()->getTranslation('browseoffer/index','Form')),
81+
'path' => array(),
8382
'permission_delete' => array('module' => 'lhform','function' => 'delete_fm'), 'permission' => array('module' => 'lhform','function' => 'manage_fm'),
8483
'name' => erTranslationClassLhTranslation::getInstance()->getTranslation('abstract/browserofferinvitation','Forms list')
8584
);

β€Žlhc_web/modules/lhform/collected.phpβ€Ž

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@
6868
$Result['content'] = $tpl->fetch();
6969

7070
$object_trans = $form->getModuleTranslations();
71-
$Result['path'][] = $object_trans['path'];
7271
$Result['path'][] = array('url' => erLhcoreClassDesign::baseurl('abstract/list').'/Form','title' => $object_trans['name']);
7372
$Result['path'][] = array('title' => (string)$form);
7473

β€Žlhc_web/modules/lhform/embedcode.phpβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
$Result['content'] = $tpl->fetch();
1111
$Result['path'] = array(
12-
array('url' => erLhcoreClassDesign::baseurl('form/index'),'title' => erTranslationClassLhTranslation::getInstance()->getTranslation('form/index','Form')),
12+
array('url' => erLhcoreClassDesign::baseurl('abstract/list').'/Form','title' => erTranslationClassLhTranslation::getInstance()->getTranslation('form/index','Form')),
1313
array('title' => erTranslationClassLhTranslation::getInstance()->getTranslation('system/htmlcode','Page embed code')))
1414

1515
?>

β€Žlhc_web/modules/lhform/index.phpβ€Ž

Lines changed: 0 additions & 10 deletions
This file was deleted.

β€Žlhc_web/modules/lhform/module.phpβ€Ž

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,6 @@
44

55
$ViewList = array();
66

7-
$ViewList['index'] = array(
8-
'params' => array(),
9-
'functions' => array( 'manage_fm' )
10-
);
11-
127
$ViewList['fill'] = array(
138
'params' => array('form_id'),
149
'functions' => array( )

0 commit comments

Comments
Β (0)