Skip to content

Commit

Permalink
Notifier to insert "More Information" and "Important Links" sidebox l…
Browse files Browse the repository at this point in the history
…inks (zencart#6451)

* Notifier to insert "More Information" sidebox links

Similar to PR zencart#6443, but for the "More Information" sidebox.  Includes minor reformatting/refactoring.

* Might as well include the ezpages sidebox, too
  • Loading branch information
lat9 authored May 14, 2024
1 parent 2e6eaf1 commit 7cd4d6d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 11 deletions.
2 changes: 2 additions & 0 deletions includes/modules/sideboxes/ezpages.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@

$var_linksList = $page_query_list_sidebox;

$zco_notifier->notify('NOTIFY_EZPAGES_SIDEBOX_ADDITIONS', [], $var_linksList);

require($template->get_template_dir('tpl_ezpages.php',DIR_WS_TEMPLATE, $current_page_base,'sideboxes'). '/tpl_ezpages.php');

$zco_notifier->notify('NOTIFY_END_EZPAGES_SIDEBOX');
Expand Down
27 changes: 16 additions & 11 deletions includes/modules/sideboxes/more_information.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,29 +9,34 @@
*/

// initialize
$more_information = array();
$more_information = [];

// test if links should display
if (DEFINE_PAGE_2_STATUS <= 1) {
if (DEFINE_PAGE_2_STATUS <= 1) {
$more_information[] = '<a href="' . zen_href_link(FILENAME_PAGE_2) . '">' . BOX_INFORMATION_PAGE_2 . '</a>';
}
if (DEFINE_PAGE_3_STATUS <= 1) {
}
if (DEFINE_PAGE_3_STATUS <= 1) {
$more_information[] = '<a href="' . zen_href_link(FILENAME_PAGE_3) . '">' . BOX_INFORMATION_PAGE_3 . '</a>';
}
if (DEFINE_PAGE_4_STATUS <= 1) {
}
if (DEFINE_PAGE_4_STATUS <= 1) {
$more_information[] = '<a href="' . zen_href_link(FILENAME_PAGE_4) . '">' . BOX_INFORMATION_PAGE_4 . '</a>';
}
}

// insert additional links below to add to the more_information box
// Example:
// $more_information[] = '<a href="' . zen_href_link(FILENAME_DEFAULT) . '">' . 'TESTING' . '</a>';

// -----
// ... or create an observer-class file that monitors the following notification.
//
$zco_notifier->notify('NOTIFY_MORE_INFORMATION_SIDEBOX_ADDITIONS', [], $more_information);


// only show if links are active
if (sizeof($more_information) > 0) {
require($template->get_template_dir('tpl_more_information.php',DIR_WS_TEMPLATE, $current_page_base,'sideboxes'). '/tpl_more_information.php');
if (count($more_information) > 0) {
require $template->get_template_dir('tpl_more_information.php', DIR_WS_TEMPLATE, $current_page_base, 'sideboxes') . '/tpl_more_information.php';

$title = BOX_HEADING_MORE_INFORMATION;
$title_link = false;
require($template->get_template_dir($column_box_default, DIR_WS_TEMPLATE, $current_page_base,'common') . '/' . $column_box_default);
}
require $template->get_template_dir($column_box_default, DIR_WS_TEMPLATE, $current_page_base, 'common') . '/' . $column_box_default;
}

0 comments on commit 7cd4d6d

Please sign in to comment.