PluginProbe
CSS & JavaScript Toolbox / 8.2
CSS & JavaScript Toolbox v8.2
trunk 0.3 0.8 10 10.1 11 11.2 11.3 11.4 11.5 11.6 11.7 11.8 11.9 11.9.1 12 12.0 12.0.1 12.0.3 12.0.4 12.0.5 12.0.6 12.0.7 6.0 6.0.11 All 60 releases
← All changes | controllers/templates-lookup.php +24 -53 128.2 View file →
@@ -9,11 +9,11 @@
9 9 // import dependencies.
10 10 cssJSToolbox::import('framework:mvc:controller-ajax.inc.php');
11 11
12 12 /**
13 -*
13 +*
14 14 * DESCRIPTION
15 -*
15 +*
16 16 * @author ??
17 17 * @version ??
18 18 */
19 19 class CJTTemplatesLookupController extends CJTAjaxController {
@@ -19,17 +19,17 @@
19 19 class CJTTemplatesLookupController extends CJTAjaxController {
20 20
21 21 /**
22 22 * put your comment there...
23 - *
23 + *
24 24 * @var mixed
25 25 */
26 26 protected $controllerInfo = array('model' => 'templates-lookup', 'view' => 'templates/lookup');
27 -
27 +
28 28 /**
29 - *
29 + *
30 30 * Initialize new object.
31 - *
31 + *
32 32 * @return void
33 33 */
34 34 public function __construct() {
35 35 parent::__construct();
@@ -38,14 +38,13 @@
38 38 $this->registryAction('embedded');
39 39 $this->registryAction('link');
40 40 $this->registryAction('unlink');
41 41 $this->registryAction('unlinkAll');
42 - $this->registryAction('getBlockLinkedTemplates');
43 42 }
44 -
43 +
45 44 /**
46 45 * put your comment there...
47 - *
46 + *
48 47 * @param mixed $tpl
49 48 */
50 49 protected function displayAction($tpl = null) {
51 50 // Prepare inputs
@@ -52,12 +51,12 @@
52 51 $this->model->inputs['blockId'] = $_REQUEST['blockId'];
53 52 // Display view!
54 53 parent::displayAction();
55 54 }
56 -
55 +
57 56 /**
58 57 * put your comment there...
59 - *
58 + *
60 59 */
61 60 protected function embeddedAction() {
62 61 // Read inputs.
63 62 $this->model->inputs['templateId'] = $_REQUEST['templateId'];
@@ -65,42 +64,16 @@
65 64 // Get embedded template code!
66 65 $this->response['code'] = $this->model->embedded();
67 66 }
68 67
69 - /**
70 - * put your comment there...
71 - *
72 - */
73 - protected function getBlockLinkedTemplatesAction() {
74 -
75 -
76 - $blockId = isset($_GET['blockId']) ? esc_html($_GET['blockId']) : null;
77 -
78 - try {
79 -
80 - if (!$blockId) {
81 -
82 - throw new Exception('Invalid Request parameters');
83 - }
84 -
85 - $this->response = CJTBlockTemplatesModel::getLinkedTemplatesCount($blockId);
86 - }
87 - catch (Exception $exception) {
88 -
89 -
90 - }
91 -
92 -
93 - }
94 -
95 - /**
96 - * put your comment there...
97 - *
98 - */
68 +/**
69 +* put your comment there...
70 +*
71 +*/
99 72 protected function linkAction() {
100 73 // Read inputs.
101 74 $this->model->inputs['templateId'] = $_REQUEST['templateId'];
102 - $this->model->inputs['blockId'] = $_REQUEST['blockId'];
75 + $this->model->inputs['blockId'] = $_REQUEST['blockId'];
103 76 // Link template!
104 77 $this->model->link();
105 78 // Response with new state!
106 79 $this->response['newState'] = array(
@@ -105,21 +78,20 @@
105 78 // Response with new state!
106 79 $this->response['newState'] = array(
107 80 'action' => 'unlink',
108 81 'text' => cssJSToolbox::getText('Unlink'),
109 - 'className' => 'template-action unlink-template',
110 - 'count' => CJTBlockTemplatesModel::getLinkedTemplatesCount($_REQUEST['blockId'])
82 + 'className' => 'template-action unlink-template'
111 83 );
112 84 }
113 -
85 +
114 86 /**
115 87 * put your comment there...
116 - *
88 + *
117 89 */
118 90 protected function unlinkAction() {
119 91 // Read inputs.
120 92 $this->model->inputs['templateId'] = $_REQUEST['templateId'];
121 - $this->model->inputs['blockId'] = $_REQUEST['blockId'];
93 + $this->model->inputs['blockId'] = $_REQUEST['blockId'];
122 94 // Link template!
123 95 $this->model->unlink();
124 96 // Response with new state!
125 97 $this->response['newState'] = array(
@@ -124,16 +96,15 @@
124 96 // Response with new state!
125 97 $this->response['newState'] = array(
126 98 'action' => 'link',
127 99 'text' => cssJSToolbox::getText('Link'),
128 - 'className' => 'template-action link-template',
129 - 'count' => CJTBlockTemplatesModel::getLinkedTemplatesCount($_REQUEST['blockId'])
100 + 'className' => 'template-action link-template'
130 101 );
131 102 }
132 -
103 +
133 104 /**
134 105 * put your comment there...
135 - *
106 + *
136 107 */
137 108 protected function unlinkAllAction() {
138 109 // Read inputs!
139 110 $this->model->inputs['blockId'] = $_REQUEST['blockId'];
@@ -144,6 +115,6 @@
144 115 'text' => cssJSToolbox::getText('Link'),
145 116 'className' => 'template-action link-template'
146 117 );
147 118 }
148 -
149 -} // End class.
119 +
120 +} // End class.