PluginProbe
VikBooking Hotel Booking Engine & PMS / 1.8.16
VikBooking Hotel Booking Engine & PMS v1.8.16
1.8.16 1.8.15 1.8.14 1.8.13 1.8.12 1.8.11 1.8.10 1.8.9 1.8.6 1.8.7 1.8.8 trunk 1.6.0 1.6.1 1.6.2 1.6.3 1.6.4 1.6.5 1.6.6 1.6.7 1.6.8 1.6.9 1.7.0 1.7.1 1.7.2 All 37 releases
← All changes | admin/helpers/admin_widgets.php +8 -9 1.8.7 → 1.8.16 View file →
@@ -277,8 +277,9 @@
277 277 $container = new stdClass;
278 278 $container->size = 'medium';
279 279 $container->widgets = [
280 280 'finance',
281 + 'inquiries_chat',
281 282 'currency_converter',
282 283 ];
283 284 // push container
284 285 array_push($section->containers, $container);
@@ -473,11 +474,12 @@
473 474 * containers and widgets.
474 475 */
475 476 public function getWidgetsMap()
476 477 {
477 - $q = "SELECT `setting` FROM `#__vikbooking_config` WHERE `param`='admin_widgets_map';";
478 - $this->dbo->setQuery($q);
479 - $map = $this->dbo->loadResult();
478 + $config = VBOFactory::getConfig();
479 +
480 + $map = $config->get('admin_widgets_map', null);
481 +
480 482 if ($map) {
481 483 $map = json_decode($map);
482 484 return is_object($map) && !empty($map->sections) && is_array($map->sections) ? $map : $this->getDefaultWidgetsMap();
483 485 }
@@ -482,12 +484,11 @@
482 484 return is_object($map) && !empty($map->sections) && is_array($map->sections) ? $map : $this->getDefaultWidgetsMap();
483 485 }
484 486
485 487 $default_map = $this->getDefaultWidgetsMap();
486 - $q = "INSERT INTO `#__vikbooking_config` (`param`,`setting`) VALUES ('admin_widgets_map', " . $this->dbo->quote(json_encode($default_map)) . ");";
487 - $this->dbo->setQuery($q);
488 - $this->dbo->execute();
489 488
489 + $config->set('admin_widgets_map', $default_map);
490 +
490 491 return $default_map;
491 492 }
492 493
493 494 /**
@@ -506,11 +507,9 @@
506 507 // prepare new map object
507 508 $map = new stdClass;
508 509 $map->sections = $sections;
509 510
510 - $q = "UPDATE `#__vikbooking_config` SET `setting`=" . $this->dbo->quote(json_encode($map)) . " WHERE `param`='admin_widgets_map';";
511 - $this->dbo->setQuery($q);
512 - $this->dbo->execute();
511 + VBOFactory::getConfig()->set('admin_widgets_map', $map);
513 512
514 513 return true;
515 514 }
516 515