diff --git a/admin/manage_custom_nav_elements.php b/admin/manage_custom_nav_elements.php index 4b36b55c..d1d78ae5 100644 --- a/admin/manage_custom_nav_elements.php +++ b/admin/manage_custom_nav_elements.php @@ -16,15 +16,7 @@ hesk_session_start(); hesk_dbConnect(); hesk_isLoggedIn(); -//hesk_checkPermission('can_man_email_tpl'); - -// Are we performing an action? -$showEditPanel = false; -if (isset($_GET['action'])) { - if ($_GET['action'] == 'edit') { - $showEditPanel = true; - } -} +//hesk_checkPermission('can_man_custom_nav'); // Are we saving? if (isset($_POST['action'])) { @@ -52,21 +44,6 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
- -
-
-
-
-

EDIT CUSTOM NAV ELEMENT[!]

-
-
-
-
-
-
-
-
-
- EDIT, DELETE + + + + + + + + @@ -158,12 +144,37 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
+ +
+
+

+ Edit Custom Navigation Menu Element +

+
+ +
+
+
+
+
+
+
+ + get = array(); @@ -50,6 +55,10 @@ class ApplicationContext { // API Checker $this->get[ApiChecker::class] = new ApiChecker($this->get[ModsForHeskSettingsGateway::class]); + // Custom Navigation + $this->get[CustomNavElementGateway::class] = new CustomNavElementGateway(); + $this->get[CustomNavElementHandler::class] = new CustomNavElementHandler($this->get[CustomNavElementGateway::class]); + // Logging $this->get[LoggingGateway::class] = new LoggingGateway(); diff --git a/api/BusinessLogic/Navigation/CustomNavElement.php b/api/BusinessLogic/Navigation/CustomNavElement.php new file mode 100644 index 00000000..d720d6b7 --- /dev/null +++ b/api/BusinessLogic/Navigation/CustomNavElement.php @@ -0,0 +1,24 @@ +customNavElementGateway = $customNavElementGateway; + } + + + function getAllCustomNavElements($heskSettings) { + return $this->customNavElementGateway->getAllCustomNavElements($heskSettings); + } + + function deleteCustomNavElement() { + + } + + function saveCustomNavElement() { + + } + + function createCustomNavElement() { + + } +} \ No newline at end of file diff --git a/api/BusinessLogic/Navigation/CustomNavElementPlace.php b/api/BusinessLogic/Navigation/CustomNavElementPlace.php new file mode 100644 index 00000000..3114fdc7 --- /dev/null +++ b/api/BusinessLogic/Navigation/CustomNavElementPlace.php @@ -0,0 +1,10 @@ +id = intval($dataRow['id']); $userContext->username = $dataRow['user']; diff --git a/api/Controllers/Navigation/CustomNavElementController.php b/api/Controllers/Navigation/CustomNavElementController.php new file mode 100644 index 00000000..a36bfe78 --- /dev/null +++ b/api/Controllers/Navigation/CustomNavElementController.php @@ -0,0 +1,17 @@ +get[CustomNavElementHandler::class]; + + output($handler->getAllCustomNavElements($hesk_settings)); + } +} \ No newline at end of file diff --git a/api/DataAccess/Navigation/CustomNavElementGateway.php b/api/DataAccess/Navigation/CustomNavElementGateway.php new file mode 100644 index 00000000..3e025f36 --- /dev/null +++ b/api/DataAccess/Navigation/CustomNavElementGateway.php @@ -0,0 +1,22 @@ +init(); + + $rs = hesk_dbQuery("SELECT `t2`.`id` AS `xref_id`, `t2`.*, `t1`.* FROM `" . hesk_dbEscape($heskSettings['db_pfix']) . "custom_nav_element` AS `t1` + INNER JOIN `" . hesk_dbEscape($heskSettings['db_pfix']) . "custom_nav_element_to_text` AS `t2` + ON `t1`.`id` = `t2`.`nav_element_id`"); + + while ($row = hesk_dbFetchAssoc($rs)) { + var_dump($row); + } + + $this->close(); + } +} \ No newline at end of file diff --git a/api/index.php b/api/index.php index 92e87d99..8c34cb35 100644 --- a/api/index.php +++ b/api/index.php @@ -186,6 +186,8 @@ Link::all(array( /* Internal use only routes */ // Resend email response '/v1-internal/staff/tickets/{i}/resend-email' => \Controllers\Tickets\ResendTicketEmailToCustomerController::class, + // Custom Navigation + '/v1-internal/custom-navigation' => \Controllers\Navigation\CustomNavElementController::class . '::getAll', // Any URL that doesn't match goes to the 404 handler '404' => 'handle404' diff --git a/language/en/text.php b/language/en/text.php index 18aca4be..6a03a541 100644 --- a/language/en/text.php +++ b/language/en/text.php @@ -52,6 +52,7 @@ $hesklang['resend_email_notification'] = 'Re-send Email Notification'; $hesklang['email_notification_sent'] = 'Email notification sent!'; $hesklang['email_notification_resend_failed'] = 'Error occurred when trying to send notification email.'; $hesklang['edit_category'] = 'Edit Category'; +$hesklang['custom_nav_element_deleted'] = 'Custom Navigation Element Deleted!'; // ADDED OR MODIFIED IN Mods for HESK 3.0.0 $hesklang['you_have_x_messages'] = 'You have %s new %s'; // %s: Number of new messages, "message" or "messages", depending on #