Browse Source

Custom nav elements now working on proper pages

tags/3.1.0
Mike Koch 2 years ago
parent
commit
b82293d96d

+ 19
- 3
admin/manage_custom_nav_elements.php View File

@@ -88,7 +88,12 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
<div class="row">
<div class="col-md-12">
<div class="form-group">
<label for="place" class="col-md-4 col-sm-12 control-label"><?php echo $hesklang['place']; ?></label>
<label for="place" class="col-md-4 col-sm-12 control-label">
<?php echo $hesklang['place']; ?>
<i class="fa fa-question-circle settingsquestionmark" data-toggle="htmlpopover"
title="<?php echo $hesklang['place']; ?>"
data-content="<?php echo $hesklang['place_help']; ?>"></i>
</label>
<div class="col-md-8 col-sm-12">
<select name="place" id="place" class="form-control"
data-error="<?php echo htmlspecialchars($hesklang['this_field_is_required']); ?>"
@@ -142,7 +147,12 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
<div class="col-md-6 col-sm-12">
<h4><?php echo $hesklang['url']; ?></h4>
<div class="form-group">
<label for="image-type" class="col-md-4 col-sm-12 control-label"><?php echo $hesklang['url']; ?></label>
<label for="image-type" class="col-md-4 col-sm-12 control-label">
<?php echo $hesklang['url']; ?>
<i class="fa fa-question-circle settingsquestionmark" data-toggle="htmlpopover"
title="<?php echo $hesklang['url']; ?>"
data-content="<?php echo $hesklang['url_help']; ?>"></i>
</label>
<div class="col-md-8 col-sm-12">
<input type="text" name="url" class="form-control"
data-error="<?php echo htmlspecialchars($hesklang['this_field_is_required']); ?>"
@@ -164,7 +174,12 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
</div>
</div>
<div class="form-group" id="image-url-group">
<label for="image-url" class="col-md-4 col-sm-12 control-label"><?php echo $hesklang['image_url']; ?></label>
<label for="image-url" class="col-md-4 col-sm-12 control-label">
<?php echo $hesklang['image_url']; ?>
<i class="fa fa-question-circle settingsquestionmark" data-toggle="htmlpopover"
title="<?php echo $hesklang['image_url']; ?>"
data-content="<?php echo $hesklang['image_url_help']; ?>"></i>
</label>
<div class="col-md-8 col-sm-12">
<input type="text" name="image-url" class="form-control"
data-error="<?php echo htmlspecialchars($hesklang['this_field_is_required']); ?>"
@@ -219,6 +234,7 @@ echo mfh_get_hidden_fields_for_language(
'homepage_block',
'customer_navigation',
'staff_navigation',
'error_saving_custom_nav_element',
)
);
?>

+ 1
- 1
admin/service_messages.php View File

@@ -361,7 +361,7 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
<p style="display:none"
id="footer-icon"><?php echo $hesklang['sm_iconpicker_footer_label']; ?></p>

<div name="icon" class="btn btn-default iconpicker-container" data-toggle="iconpicker"
<div class="btn btn-default iconpicker-container" data-toggle="iconpicker"
data-icon="<?php echo $icon; ?>"></div>
</div>
</div>

+ 20
- 1
inc/header.inc.php View File

@@ -325,7 +325,26 @@ if ($modsForHesk_settings['show_icons']) {
<a href="<?php echo HESK_PATH; ?>calendar.php"><i class="fa fa-calendar" <?php echo $iconDisplay; ?>></i>&nbsp;<?php echo $hesklang['calendar_title_case']; ?></a>
</li>
<?php endif; ?>
<?php include('custom/header-custom.inc.php'); ?>
<?php
$customNavRs = hesk_dbQuery("SELECT * FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "custom_nav_element` AS `t1`
INNER JOIN `" . hesk_dbEscape($hesk_settings['db_pfix']) . "custom_nav_element_to_text` AS `t2`
ON `t1`.`id` = `t2`.`nav_element_id`
AND `t2`.`language` = '" . hesk_dbEscape($hesk_settings['language']) . "'
WHERE `t1`.`place` = 2");

while ($row = hesk_dbFetchAssoc($customNavRs)):
?>
<li>
<a href="<?php echo $row['url']; ?>">
<?php if ($row['image_url'] !== null): ?>
<img src="<?php echo $row['image_url']; ?>" alt="<?php echo $row['text']; ?>" <?php echo $iconDisplay; ?>>
<?php else: ?>
<i class="<?php echo $row['font_icon']; ?>" <?php echo $iconDisplay; ?>></i>
<?php endif; ?>
<?php echo $row['text']; ?>
</a>
</li>
<?php endwhile; ?>
</ul>
<?php if ($hesk_settings['can_sel_lang']) { ?>
<div class="navbar-form navbar-right" role="search" style="margin-right: 20px; min-width: 80px;">

+ 20
- 1
inc/show_admin_nav.inc.php View File

@@ -123,7 +123,26 @@ $mails = mfh_get_mail_headers_for_dropdown($_SESSION['id'], $hesk_settings, $hes
</li>
<?php
endif;
?>

$customNavRs = hesk_dbQuery("SELECT * FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "custom_nav_element` AS `t1`
INNER JOIN `" . hesk_dbEscape($hesk_settings['db_pfix']) . "custom_nav_element_to_text` AS `t2`
ON `t1`.`id` = `t2`.`nav_element_id`
AND `t2`.`language` = '" . hesk_dbEscape($hesk_settings['language']) . "'
WHERE `t1`.`place` = 3");

while ($row = hesk_dbFetchAssoc($customNavRs)):
?>
<li>
<a href="<?php echo $row['url']; ?>">
<?php if ($row['image_url'] !== null): ?>
<img src="<?php echo $row['image_url']; ?>" alt="<?php echo $row['text']; ?>" <?php echo $iconDisplay; ?>>
<?php else: ?>
<i class="<?php echo $row['font_icon']; ?>" <?php echo $iconDisplay; ?>></i>
<?php endif; ?>
<?php echo $row['text']; ?>
</a>
</li>
<?php endwhile; ?>
</ul>
</div>
<!-- Navbar Right Menu -->

+ 32
- 1
index.php View File

@@ -1391,7 +1391,38 @@ function print_start()
</div>
</a>
</div>
<?php endif; ?>
<?php endif;

$customNavRs = hesk_dbQuery("SELECT * FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "custom_nav_element` AS `t1`
INNER JOIN `" . hesk_dbEscape($hesk_settings['db_pfix']) . "custom_nav_element_to_text` AS `t2`
ON `t1`.`id` = `t2`.`nav_element_id`
AND `t2`.`language` = '" . hesk_dbEscape($hesk_settings['language']) . "'
WHERE `t1`.`place` = 1");

while ($row = hesk_dbFetchAssoc($customNavRs)):
?>
<div class="col-sm-6 col-xs-12">
<a href="<?php echo $row['url']; ?>" class="button-link">
<div class="panel panel-default">
<div class="panel-body">
<div class="row">
<div class="col-xs-1">
<?php if ($row['image_url'] !== null): ?>
<img src="<?php echo $row['image_url']; ?>" alt="<?php echo $row['text']; ?>">
<?php else: ?>
<i class="<?php echo $row['font_icon']; ?> black" style="font-size: 32px"></i>
<?php endif; ?>
</div>
<div class="col-xs-11">
<b><?php echo $row['text']; ?></b><br>
<?php echo $row['subtext']; ?>
</div>
</div>
</div>
</div>
</a>
</div>
<?php endwhile; ?>
</div>
<?php
if ($hesk_settings['kb_enable'])

+ 5
- 4
internal-api/js/manage-custom-nav-elements.js View File

@@ -14,6 +14,7 @@ $(document).ready(function() {
searchText: $('#search-icon').text(),
labelFooter: $('#footer-icon').text(),
resetButton: false,
search: false,
icon: 'fa fa-adn'
});

@@ -107,7 +108,7 @@ $(document).ready(function() {
loadTable();
},
error: function(data) {
mfhAlert.error("[!]Error saving custom nav element (" + data.responseJSON.logId + ")");
mfhAlert.errorWithLog(mfhLang.text('error_saving_custom_nav_element'), data.responseJSON);
console.error(data);
},
complete: function() {
@@ -227,7 +228,7 @@ function bindEditModal() {
var $modal = $('#nav-element-modal');

$modal.find('#edit-label').show();
$modal.find('#crate-label').hide();
$modal.find('#create-label').hide();
$modal.find('select[name="place"]').val(element.place);
$modal.find('input[name="id"]').val(element.id);
$modal.find('input[name="url"]').val(element.url);
@@ -258,7 +259,7 @@ function bindEditModal() {
$modal.find('#image-url-group').show();
} else {
$modal.find('select[name="image-type"]').val('font-icon');
$('[data-toggle="iconpicker"]').iconpicker('setIcon', element.fontIcon);
$('[data-toggle="nav-iconpicker"]').iconpicker('setIcon', element.fontIcon);
$modal.find('#font-icon-group').show();
$modal.find('#image-url-group').hide();
}
@@ -272,7 +273,7 @@ function bindCreateModal() {
$('#create-button').click(function() {
var $modal = $('#nav-element-modal');
$modal.find('#edit-label').hide();
$modal.find('#crate-label').show();
$modal.find('#create-label').show();
$modal.find('select[name="place"]').val(1);
$modal.find('input[name="id"]').val(-1);
var $textLanguages = $modal.find('[data-text-language]');

+ 4
- 0
language/en/text.php View File

@@ -75,7 +75,11 @@ $hesklang['create_custom_nav_element_title_case'] = 'Create Custom Nav Element';
$hesklang['place'] = 'Place';
$hesklang['image_type'] = 'Image Type';
$hesklang['image_url'] = 'Image URL';
$hesklang['image_url_help'] = 'The URL of the image you wish to use. For customer/staff navigation, recommended size is <b>16x16px</b>. For the homepage blocks, recommended size is <b>32x32px</b>.';
$hesklang['font_icon'] = 'Font Icon';
$hesklang['error_saving_custom_nav_element'] = 'Error saving custom nav element!';
$hesklang['place_help'] = 'The location of the custom navigation element.';
$hesklang['url_help'] = 'The URL where the user should be taken to. Both relative and absolute URLs are supported.';

// 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 #

Loading…
Cancel
Save