countShortPins()) { // access last alert date $config = VBOFactory::getConfig(); $warn_last_ts = (int) $config->get('warn_cpin_ts', 0); if ($warn_last_ts && (time() - $warn_last_ts) > (86400 * 2)) { // enforce urgent normalization $config->set('warn_cpin_ts', 0); JFactory::getApplication()->redirect( VBOFactory::getPlatform()->getUri()->addCSRF('index.php?option=com_vikbooking&task=maintenance.normalize_short_pins', $xhtml = false) ); JFactory::getApplication()->close(); } // update last alert date $config->set('warn_cpin_ts', time()); // display alert message with button to normalize records JFactory::getApplication()->enqueueMessage(sprintf( '%s %s', JText::translate('VBO_CUSTOMERS_SHORT_PIN_ALERT'), VBOFactory::getPlatform()->getUri()->addCSRF('index.php?option=com_vikbooking&task=maintenance.normalize_short_pins', $xhtml = true), JText::translate('VBADMINNOTESUPD') ), 'warning'); } $vbo_app = VikBooking::getVboApplication(); // get admin widgets helper $widgets_helper = VikBooking::getAdminWidgetsInstance(); $widgets_map = $widgets_helper->getWidgetsMap(); // get all widgets by preloading their assets (if any) $widgets_names = $widgets_helper->getWidgetNames($preload = true); $widgets_welcome = $widgets_helper->showWelcome(); // global permissions are necessary to customize the admin widgets $vbo_auth_global = JFactory::getUser()->authorise('core.vbo.global', 'com_vikbooking'); // check if the notification audio file exists within VCM $notif_audio_path = implode(DIRECTORY_SEPARATOR, [VCM_ADMIN_PATH, 'assets', 'css', 'audio', 'new_notification.mp3']); $notif_audio_url = is_file($notif_audio_path) ? (VCM_ADMIN_URI . implode('/', ['assets', 'css', 'audio', 'new_notification.mp3'])) : null; // theme color preferences $color_scheme = VikBooking::getAppearancePref(); $scheme_name = JText::translate('VBO_APPEARANCE_PREF_AUTO'); $current_mode = 'magic'; if ($color_scheme == 'light') { $scheme_name = JText::translate('VBO_APPEARANCE_PREF_LIGHT'); $current_mode = 'sun'; } elseif ($color_scheme == 'dark') { $scheme_name = JText::translate('VBO_APPEARANCE_PREF_DARK'); $current_mode = 'moon'; } // load sortable library JHtml::fetch('jquery.framework', true, true); JHtml::fetch('script', VBO_SITE_URI.'resources/jquery-ui.sortable.min.js'); // load language vars for JavaScript JText::script('VBO_WIDGETS_WELCOME'); JText::script('VBO_WIDGETS_ADDWIDGCONT'); JText::script('VBO_WIDGETS_RESTDEFAULT'); JText::script('VBO_WIDGETS_ADDNEWWIDG'); JText::script('VBO_WIDGETS_SAVINGMAP'); JText::script('VBO_WIDGETS_ERRSAVINGMAP'); JText::script('VBO_WIDGETS_LASTUPD'); JText::script('VBO_WIDGETS_ENTERSECTNAME'); JText::script('VBO_WIDGETS_NEWSECT'); JText::script('VBO_WIDGETS_CONFRMELEM'); JText::script('VBO_WIDGETS_SELCONTSIZE'); JText::script('VBO_WIDGETS_UPDWIDGCONT'); JText::script('VBO_WIDGETS_EDITWIDGCONT'); JText::script('VBO_WIDGETS_ERRDISPWIDG'); JText::script('VBO_STICKYN_TITLE'); JText::script('VBO_STICKYN_TEXT'); JText::script('VBO_STICKYN_TEXT2'); JText::script('VBO_STICKYN_CUSTOMURI'); JText::script('VBO_BROWSER_NOTIFS_ON'); JText::script('VBO_BROWSER_NOTIFS_OFF'); JText::script('VBO_BROWSER_NOTIFS_OFF_HELP'); JText::script('VBO_ADMIN_WIDGET'); JText::script('VBO_CONGRATS'); JText::script('VBO_APPEARANCE_PREF_AUTO'); JText::script('VBO_APPEARANCE_PREF_LIGHT'); JText::script('VBO_APPEARANCE_PREF_DARK'); /** * Monitor request vars to see if a widget should be loaded within a modal. * Only the dashboard at the moment allows to render an admin widget within * a modal through query string values, because all other pages will render * the multitask panel that can quickly render any admin widget. * * @since 1.16.0 (J) - 1.6.0 (WP) * @since 1.16.5 (J) - 1.6.5 (WP) added payload support for clicked Push notifications. */ $app = JFactory::getApplication(); $load_widget = $app->input->get('load_widget', ''); $multitask_data = $app->input->get('multitask_data', [], 'array'); $multitask_options = []; $push_notification = $app->input->get('push_notification', '', 'base64'); if (!$load_widget && $push_notification) { // parse the payload to detect the proper type of widget to render list($load_widget, $multitask_data, $multitask_options) = VBOMultitaskParser::queryPushData($multitask_data, base64_decode($push_notification)); } // process widget data, if any if (!empty($load_widget) && $desired_widget = $widgets_helper->getWidget($load_widget)) { $multitask_data['_modalTitle'] = $desired_widget->getName(); $data_payload = json_encode($multitask_data); $options_payload = json_encode($multitask_options); // append script to DOM to render the widget within a modal JFactory::getDocument()->addScriptDeclaration( << { VBOCore.renderModalWidget('$load_widget', $data_payload, $options_payload, false); }, 500); }); })(jQuery); JS ); } ?>
printYesNoButtons('vbocustwidgets', JText::translate('VBYES'), JText::translate('VBNO'), 0, 1, 0, 'vboWidgetsToggleManage(false);'); ?>
sections as $seck => $section) { ?>
containers)) { $section->containers = array(); } $tot_containers = count($section->containers); foreach ($section->containers as $conk => $container) { $container_css = $widgets_helper->getContainerCssClass($container->size); ?>
widgets)) { $container->widgets = array(); } foreach ($container->widgets as $widk => $widget_id) { $widget_instance = $widgets_helper->getWidget($widget_id); if ($widget_instance === false) { continue; } ?>
render(); ?>

×