input->cookie; $tmpl = VikRequest::getVar('tmpl'); $view = VikRequest::getVar('view'); if ($tmpl == 'component') { return; } // check platform $platform = defined('ABSPATH') && function_exists('wp_die') ? 'wp' : 'j'; if ($platform == 'wp') { /** * @wponly Hide menu for Pro-update views */ if (in_array($view, ['getpro'])) { return; } } // JS lang def JText::script('VBOGUESTREVSVCMREQ'); JText::script('VBO_QUICK_ACTIONS'); $session = JFactory::getSession(); $admin_user = JFactory::getUser(); $has_vcm = is_file(VCM_SITE_PATH.DIRECTORY_SEPARATOR.'helpers'.DIRECTORY_SEPARATOR.'lib.vikchannelmanager.php'); $backlogo = VikBooking::getBackendLogo(); $vbo_auth_global = $admin_user->authorise('core.vbo.global', 'com_vikbooking'); $vbo_auth_rateplans = $admin_user->authorise('core.vbo.rateplans', 'com_vikbooking'); $vbo_auth_rooms = $admin_user->authorise('core.vbo.rooms', 'com_vikbooking'); $vbo_auth_pricing = $admin_user->authorise('core.vbo.pricing', 'com_vikbooking'); $vbo_auth_bookings = $admin_user->authorise('core.vbo.bookings', 'com_vikbooking'); $vbo_auth_availability = $admin_user->authorise('core.vbo.availability', 'com_vikbooking'); $vbo_auth_management = $admin_user->authorise('core.vbo.management', 'com_vikbooking'); $vbo_auth_pms = $admin_user->authorise('core.vbo.pms', 'com_vikbooking'); $reviews_dld = 0; // check for stored quick actions only once $admin_menu_actions_checked = $session->get('admin_menu.actions.check', null, 'vikbooking'); if (!$admin_menu_actions_checked) { $session->set('admin_menu.actions.check', 1, 'vikbooking'); } /** * Check VCM subscription status. * * @since 1.15.0 (J) - 1.5.0 (WP) */ $vcm_expiration_reminder = VikBooking::getVCMSubscriptionStatus(); /** * New back-end menu structure would support sub-titles for menu entries. * * * * @since 1.16.0 (J) - 1.6.0 (WP) */ ?>
= 0) { // subscription is expiring, but it's not expired yet, display a modal-reminder ?> ' . ''; } public static function pUpdateProgram($version) { /** * @wponly do nothing */ } /** * Method to add parameters to the update extra query. * * @joomlaonly this class is automatically loaded by Joomla * to invoke this method when updating the component. * * @param Update &$update An update definition * @param JTable &$table The update instance from the database * * @return void * * @since 1.16.0 (J) - 1.6.0 (WP) */ public static function prepareUpdate(&$update, &$table) { // get current domain $server = JFactory::getApplication()->input->server; // build query array $query = [ 'domain' => base64_encode($server->getString('HTTP_HOST')), 'ip' => $server->getString('REMOTE_ADDR'), ]; // get license key $license_key = VBOFactory::getConfig()->get('licensekey'); if ($license_key) { $query['key'] = $license_key; } // always refresh the extra query before an update $update->set('extra_query', http_build_query($query, '', '&')); } /** * Returns the information about the first setup metrics and minimum requirements. * * @return array associative list of metrics. * * @since 1.16.4 (J) - 1.6.4 (WP) */ public static function getFirstSetupMetrics() { $dbo = JFactory::getDbo(); $q = "SELECT COUNT(*) FROM `#__vikbooking_prices`;"; $dbo->setQuery($q); $totprices = $dbo->loadResult(); $q = "SELECT COUNT(*) FROM `#__vikbooking_rooms`;"; $dbo->setQuery($q); $totrooms = $dbo->loadResult(); $q = "SELECT COUNT(*) FROM `#__vikbooking_dispcost`;"; $dbo->setQuery($q); $totdailyfares = $dbo->loadResult(); $metrics = [ 'totprices' => $totprices, 'totrooms' => $totrooms, 'totdailyfares' => $totdailyfares, 'completed' => ($totprices && $totrooms && $totdailyfares), ]; // shortcodes (if platform-supported) if (VBOPlatformDetection::isWordPress()) { /** * @wponly - check if some shortcodes have been defined before showing the Dashboard */ $model = JModel::getInstance('vikbooking', 'shortcodes'); $metrics['shortcodes'] = $model->all('post_id'); // calculate again the completed status $metrics['completed'] = ($metrics['completed'] && $metrics['shortcodes']); } return $metrics; } }