PluginProbe ʕ •ᴥ•ʔ
VikAppointments Services Booking Calendar / 1.2.21
VikAppointments Services Booking Calendar v1.2.21
1.2.21 1.2.20 trunk 1.2.17 1.2.18 1.2.19
vikappointments / site / helpers / libraries / wizard / classes / syssubscr.php
vikappointments / site / helpers / libraries / wizard / classes Last commit date
employees.php 5 days ago index.html 5 days ago locations.php 5 days ago locwdays.php 5 days ago options.php 5 days ago packages.php 5 days ago payments.php 5 days ago services.php 5 days ago subscriptions.php 5 days ago syspack.php 5 days ago syssubscr.php 5 days ago system.php 5 days ago taxes.php 5 days ago
syssubscr.php
104 lines
1 <?php
2 /**
3 * @package VikAppointments
4 * @subpackage core
5 * @author E4J s.r.l.
6 * @copyright Copyright (C) 2021 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 /**
15 * Implement the wizard step used to setup the basic
16 * settings of the subscriptions configuration.
17 *
18 * @since 1.7.1
19 */
20 class VAPWizardStepSyssubscr extends VAPWizardStep
21 {
22 /**
23 * Returns the step title.
24 * Used as a very-short description.
25 *
26 * @return string The step title.
27 */
28 public function getTitle()
29 {
30 return JText::translate('VAP_WIZARD_STEP_SYSSUBSCR');
31 }
32
33 /**
34 * Returns the step description.
35 *
36 * @return string The step description.
37 */
38 public function getDescription()
39 {
40 return JText::translate('VAP_WIZARD_STEP_SYSSUBSCR_DESC');
41 }
42
43 /**
44 * Returns an optional step icon.
45 *
46 * @return string The step icon.
47 */
48 public function getIcon()
49 {
50 return '<i class="fas fa-cog"></i>';
51 }
52
53 /**
54 * Return the group to which the step belongs.
55 *
56 * @return string The group name.
57 */
58 public function getGroup()
59 {
60 // belongs to SUBSCRIPTIONS group
61 return JText::translate('VAPMENUSUBSCRIPTIONS');
62 }
63
64 /**
65 * Implements the step execution.
66 *
67 * @param JRegistry $data The request data.
68 *
69 * @return boolean
70 */
71 protected function doExecute($data)
72 {
73 $config = VAPFactory::getConfig();
74
75 // update configuration with the selected values
76 $config->set('enablesubscr', $data->get('enablesubscr', 0));
77 $config->set('subscrmandatory', $data->get('subscrmandatory', 0));
78 $config->set('subscrthreshold', $data->get('subscrthreshold', 0));
79
80 return true;
81 }
82
83 /**
84 * Checks whether the specified step can be skipped.
85 * By default, all the steps are mandatory.
86 *
87 * @return boolean True if skippable, false otherwise.
88 */
89 public function canIgnore()
90 {
91 return true;
92 }
93
94 /**
95 * Checks whether the subscriptions section is enabled.
96 *
97 * @return boolean
98 */
99 public function isEnabled()
100 {
101 return VAPFactory::getConfig()->getBool('enablesubscr');
102 }
103 }
104