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 | libraries/adapter/mvc/controllers/admin.php +60 -0 1.6.0 → 1.8.16 View file →
@@ -1,0 +1,60 @@
1 +<?php
2 +/**
3 + * @package VikWP - Libraries
4 + * @subpackage adapter.mvc
5 + * @author E4J s.r.l.
6 + * @copyright Copyright (C) 2023 E4J s.r.l. All Rights Reserved.
7 + * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
8 + * @link https://vikwp.com
9 + */
10 +
11 +// No direct access
12 +defined('ABSPATH') or die('No script kiddies please!');
13 +
14 +JLoader::import('adapter.mvc.controller');
15 +
16 +/**
17 + * The controller used by the views on the MVC framework.
18 + * An admin-controller is used to handle the actions requested
19 + * by the related view.
20 + *
21 + * The controller can be invoked when the value contained
22 + * in $_REQUEST['task'] is equals to 'MyPluginController' + $_REQUEST['task'].
23 + *
24 + * e.g. $_REQUEST['task'] = 'groups.save' -> MyPluginControllerGroups
25 + *
26 + * @since 10.0
27 + */
28 +abstract class JControllerAdmin extends JController
29 +{
30 + /**
31 + * The controller model.
32 + *
33 + * @var JModel
34 + */
35 + private $_model = null;
36 +
37 + /**
38 + * Magic method to access private properties.
39 + *
40 + * @param string $name The property name to access.
41 + *
42 + * @return mixed The property value if exists, otherwise null.
43 + */
44 + public function __get($name)
45 + {
46 + if ($name == 'model' && !isset($this->_model))
47 + {
48 + $this->_model = $this->getModel();
49 + }
50 +
51 + $name = '_' . $name;
52 +
53 + if (property_exists($this, $name))
54 + {
55 + return $this->{$name};
56 + }
57 +
58 + return null;
59 + }
60 +}