PluginProbe
FluentSnippets – High-Performance Code Snippets, Header & Footer Code, Custom CSS & PHP Code Manager / 1.1
FluentSnippets – High-Performance Code Snippets, Header & Footer Code, Custom CSS & PHP Code Manager v1.1
10.56 1.2.1 10 10.1 10.2 10.3 10.31 10.32 10.33 10.34 10.50 10.51 10.52 10.53 10.55 9.0 9.0.1 9.4 trunk 1.0.0 1.1 1.2
easy-code-manager / controllers / setup.php

setup.php in FluentSnippets – High-Performance Code Snippets, Header & Footer Code, Custom CSS & PHP Code Manager 1.1, at controllers/setup.php

105 lines 2.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 *
4 */
5
6 // Disallow direct access.
7 defined('ABSPATH') or die("Access denied");
8
9 // import dependencies.
10 cssJSToolbox::import('framework:mvc:controller-ajax.inc.php');
11
12 /**
13 *
14 */
15 class CJTsetupController extends CJTAjaxController {
16
17 /**
18 * put your comment there...
19 *
20 * @var mixed
21 */
22 protected $controllerInfo = array('model' => 'setup');
23
24 /**
25 * put your comment there...
26 *
27 */
28 public function __construct() {
29 parent::__construct();
30 // Register actions!
31 $this->registryAction('activationFormView');
32 $this->registryAction('getState');
33 $this->registryAction('license');
34 $this->registryAction('reset');
35 }
36
37 /**
38 * Display Activation form!
39 *
40 */
41 protected function activationFormViewAction() {
42 // Display activation for for the requested component!
43 parent::displayAction();
44 }
45
46 /**
47 * put your comment there...
48 *
49 */
50 protected function getStateAction() {
51 # Get component product types
52 $licenseTypes = $this->model->getExtensionProductTypes($_REQUEST['component']);
53 # Return license state back
54 $this->response = $this->model->getStateStruct($licenseTypes);
55 }
56
57 /**
58 * put your comment there...
59 *
60 */
61 protected function licenseAction()
62 {
63
64 $model =& $this->model;
65
66 $action = $_REQUEST['licenseAction'];
67 $state['component'] = $_REQUEST['component'];
68 $state['license'] = $_REQUEST['license'];
69
70 $state['attrs'] = $model->getProductTypeAttrs($state['component']);
71
72 // CJT Store Action Request
73 $state['response'] = $model->dispatchLicenseAction($action, $state['component'], $state['license'], $state['attrs']);
74 // Cahe only if the request is 'activate' or 'deactivate' and the returned state is valid or 'deactivated! respectively.
75 if (($action != 'check') && ($state['response']['license'] == 'valid'))
76 {
77 $state['action'] = $model->cacheState($state['component'], $action, $state);
78 }
79
80 // Return state object includes (component, license, edd response [and action only if valid])
81 $this->response = $state;
82 }
83
84 /**
85 * put your comment there...
86 *
87 */
88 protected function resetAction() {
89 // Initializing!
90 $model =& $this->model;
91 // Read request parameters!
92 $state['component'] = $_REQUEST['component'];
93 $state['license'] = false;
94 // Remove License state cache!
95 $state['response']['license'] = $model->removeCachedLicense($state);
96 // Set response parameters.
97 $state['action'] = 'reset';
98 // With DUMMY EDD response so we're standarizing the response for all actions
99 // even those not belongs to EDD real requests!!
100 $state['response']['item_name'] = $state['component']['name'];
101 $this->response = $state;
102 }
103
104 } // End class.
105