Skip to content

Commit a64cc08

Browse files
v.2.5.0
1 parent 7eb5df1 commit a64cc08

File tree

10 files changed

+55
-46
lines changed

10 files changed

+55
-46
lines changed

com_swjprojects/site/src/Controller/DisplayController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ public function display($cachable = false, $urlparams = [])
110110
if ($link)
111111
{
112112
$uri = Uri::getInstance();
113-
$root = $uri->toString(array('scheme', 'host', 'port'));
113+
$root = $uri->toString(['scheme', 'host', 'port']);
114114
$canonical = Uri::getInstance(Route::_($link))->toString();
115115
$current = $uri->toString(array('path', 'query', 'fragment'));
116116

com_swjprojects/site/src/View/Document/HtmlView.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,16 +101,17 @@ class HtmlView extends BaseHtmlView
101101
*/
102102
public function display($tpl = null)
103103
{
104-
$this->state = $this->get('State');
104+
$model = $this->getModel();
105+
$this->state = $model->getState();
105106
$this->params = $this->state->get('params');
106-
$this->item = $this->get('Item');
107+
$this->item = $model->getItem();
107108
$this->documentation_items = $this->item->documentation_items;
108109
$this->project = $this->item->project;
109110
$this->category = $this->item->category;
110111
$this->menu = Factory::getApplication()->getMenu()->getActive();
111112

112113
// Check for errors
113-
if (count($errors = $this->get('Errors')))
114+
if (count($errors = $model->getErrors()))
114115
{
115116
throw new \Exception(implode('\n', $errors), 500);
116117
}
@@ -351,7 +352,7 @@ protected function _prepareDocument()
351352
}
352353

353354
// Set meta url
354-
$url = Uri::getInstance()->toString(array('scheme', 'host', 'port')) . $item->link;
355+
$url = Uri::getInstance()->toString(['scheme', 'host', 'port']) . $item->link;
355356
$doc->setMetaData('url', $url);
356357

357358
// Set meta twitter

com_swjprojects/site/src/View/Documentation/HtmlView.php

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -116,16 +116,17 @@ class HtmlView extends BaseHtmlView
116116
*/
117117
public function display($tpl = null)
118118
{
119-
$this->state = $this->get('State');
119+
$model = $this->getModel();
120+
$this->state = $model->getState();
120121
$this->params = $this->state->get('params');
121-
$this->project = $this->get('Item');
122-
$this->items = $this->get('Items');
123-
$this->pagination = $this->get('Pagination');
122+
$this->project = $model->getItem();
123+
$this->items = $model->getItems();
124+
$this->pagination = $model->getPagination();
124125
$this->category = $this->project->category;
125126
$this->menu = Factory::getApplication()->getMenu()->getActive();
126127

127128
// Check for errors
128-
if (count($errors = $this->get('Errors')))
129+
if (count($errors = $model->getErrors()))
129130
{
130131
throw new \Exception(implode('\n', $errors), 500);
131132
}
@@ -330,7 +331,7 @@ protected function _prepareDocument()
330331
}
331332

332333
// Set meta url
333-
$url = Uri::getInstance()->toString(array('scheme', 'host', 'port')) . $project->documentation;
334+
$url = Uri::getInstance()->toString(['scheme', 'host', 'port']) . $project->documentation;
334335
$doc->setMetaData('url', $url);
335336

336337
// Set meta twitter

com_swjprojects/site/src/View/Download/HtmlView.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,11 @@ class HtmlView extends BaseHtmlView
4242
*/
4343
public function display($tpl = null)
4444
{
45-
$this->file = $this->get('File');
45+
$model = $this->getModel();
46+
$this->file = $model->getFile();
4647

4748
// Check for errors
48-
if ($errors = $this->get('Errors'))
49+
if ($errors = $model->getErrors())
4950
{
5051
throw new \Exception(implode('\n', $errors), 500);
5152
}

com_swjprojects/site/src/View/Project/HtmlView.php

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -116,16 +116,18 @@ class HtmlView extends BaseHtmlView
116116
*/
117117
public function display($tpl = null)
118118
{
119-
$this->state = $this->get('State');
119+
$app = Factory::getApplication();
120+
$model = $this->getModel();
121+
$this->state = $model->getState();
120122
$this->params = $this->state->get('params');
121-
$this->project = $this->get('Item');
123+
$this->project = $model->getItem();
122124
$this->category = $this->project->category;
123-
$this->relations = $this->get('Relations');
124-
$this->version = $this->get('Version');
125-
$this->menu = Factory::getApplication()->getMenu()->getActive();
125+
$this->relations = $model->getRelations();
126+
$this->version = $model->getVersion();
127+
$this->menu = $app->getMenu()->getActive();
126128

127129
// Check for errors
128-
if (count($errors = $this->get('Errors')))
130+
if (count($errors = $model->getErrors()))
129131
{
130132
throw new \Exception(implode('\n', $errors), 500);
131133
}
@@ -167,7 +169,7 @@ public function display($tpl = null)
167169

168170
// Process the content plugins
169171
PluginHelper::importPlugin('content');
170-
$app = Factory::getApplication();
172+
171173
$offset = $app->getInput()->getUInt('limitstart');
172174
$project->text = &$project->fulltext;
173175

@@ -331,7 +333,7 @@ protected function _prepareDocument()
331333
}
332334

333335
// Set meta url
334-
$url = Uri::getInstance()->toString(array('scheme', 'host', 'port')) . $project->link;
336+
$url = Uri::getInstance()->toString(['scheme', 'host', 'port']) . $project->link;
335337
$doc->setMetaData('url', $url);
336338

337339
// Set meta twitter

com_swjprojects/site/src/View/Projects/HtmlView.php

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -102,15 +102,17 @@ class HtmlView extends BaseHtmlView
102102
*/
103103
public function display($tpl = null)
104104
{
105-
$this->state = $this->get('State');
105+
$app = Factory::getApplication();
106+
$model = $this->getModel();
107+
$this->state = $model->getState();
106108
$this->params = $this->state->get('params');
107-
$this->items = $this->get('Items');
108-
$this->pagination = $this->get('Pagination');
109-
$this->category = $this->get('Item');
110-
$this->menu = Factory::getApplication()->getMenu()->getActive();
109+
$this->items = $model->getItems();
110+
$this->pagination = $model->getPagination();
111+
$this->category = $model->getItem();
112+
$this->menu = $app->getMenu()->getActive();
111113

112114
// Check for errors
113-
if (count($errors = $this->get('Errors')))
115+
if (count($errors = $model->getErrors()))
114116
{
115117
throw new \Exception(implode('\n', $errors), 500);
116118
}
@@ -150,7 +152,7 @@ public function display($tpl = null)
150152
}
151153
$this->params = $category->params;
152154

153-
$app = Factory::getApplication();
155+
154156
$dispatcher = $this->getDispatcher();
155157

156158
$offset = $app->getInput()->getUInt('limitstart');
@@ -325,7 +327,7 @@ protected function _prepareDocument()
325327
}
326328

327329
// Set meta url
328-
$url = Uri::getInstance()->toString(array('scheme', 'host', 'port')) . $category->link;
330+
$url = Uri::getInstance()->toString(['scheme', 'host', 'port']) . $category->link;
329331
$doc->setMetaData('url', $url);
330332

331333
// Set meta twitter

com_swjprojects/site/src/View/Userkeys/HtmlView.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -103,15 +103,15 @@ public function display($tpl = null)
103103
parent::display($tpl);
104104
return $this;
105105
}
106-
107-
$this->state = $this->get('State');
106+
$model = $this->getModel();
107+
$this->state = $model->getState();
108108
$this->params = $this->state->get('params');
109-
$this->items = $this->get('Items');
110-
$this->pagination = $this->get('Pagination');
109+
$this->items = $model->getItems();
110+
$this->pagination = $model->getPagination();
111111
$this->menu = $app->getMenu()->getActive();
112112

113113
// Check for errors
114-
if (count($errors = $this->get('Errors')))
114+
if (count($errors = $model->getErrors()))
115115
{
116116
throw new \Exception(implode('\n', $errors), 500);
117117
}

com_swjprojects/site/src/View/Version/HtmlView.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,15 +106,16 @@ class HtmlView extends BaseHtmlView
106106
*/
107107
public function display($tpl = null)
108108
{
109-
$this->state = $this->get('State');
109+
$model = $this->getModel();
110+
$this->state = $model->getState();
110111
$this->params = $this->state->get('params');
111-
$this->version = $this->get('Item');
112+
$this->version = $model->getItem();
112113
$this->project = $this->version->project;
113114
$this->category = $this->version->category;
114115
$this->menu = Factory::getApplication()->getMenu()->getActive();
115116

116117
// Check for errors
117-
if (count($errors = $this->get('Errors')))
118+
if (count($errors = $model->getErrors()))
118119
{
119120
throw new \Exception(implode('\n', $errors), 500);
120121
}
@@ -326,7 +327,7 @@ protected function _prepareDocument()
326327
}
327328

328329
// Set meta url
329-
$url = Uri::getInstance()->toString(array('scheme', 'host', 'port')) . $version->link;
330+
$url = Uri::getInstance()->toString(['scheme', 'host', 'port']) . $version->link;
330331
$doc->setMetaData('url', $url);
331332

332333
// Set meta twitter

com_swjprojects/site/src/View/Versions/HtmlView.php

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -118,10 +118,11 @@ class HtmlView extends BaseHtmlView
118118
public function display($tpl = null)
119119
{
120120
$app = Factory::getApplication();
121-
$this->state = $this->get('State');
121+
$model = $this->getModel();
122+
$this->state = $model->getState();
122123
$this->params = $this->state->get('params');
123-
$this->items = $this->get('Items');
124-
$this->pagination = $this->get('Pagination');
124+
$this->items = $model->getItems();
125+
$this->pagination = $model->getPagination();
125126
// Flag indicates to not add limitstart=0 to URL
126127
$this->pagination->hideEmptyLimitstart = true;
127128
// Add additional parameters
@@ -143,12 +144,12 @@ public function display($tpl = null)
143144
$this->pagination->setAdditionalUrlParam($parameter, $value);
144145
}
145146

146-
$this->project = $this->get('Item');
147+
$this->project = $model->getItem();
147148
$this->category = $this->project->category;
148149
$this->menu = $app->getMenu()->getActive();
149150

150151
// Check for errors
151-
if (count($errors = $this->get('Errors')))
152+
if (count($errors = $model->getErrors()))
152153
{
153154
throw new \Exception(implode('\n', $errors), 500);
154155
}
@@ -187,7 +188,7 @@ public function display($tpl = null)
187188
}
188189
}
189190
$this->params = $project->params;
190-
$app = Factory::getApplication();
191+
191192
$offset = $app->getInput()->getUInt('limitstart');
192193
$dispatcher = $this->getDispatcher();
193194
// Extra content from events
@@ -353,7 +354,7 @@ protected function _prepareDocument()
353354
}
354355

355356
// Set meta url
356-
$url = Uri::getInstance()->toString(array('scheme', 'host', 'port')) . $project->versions;
357+
$url = Uri::getInstance()->toString(['scheme', 'host', 'port']) . $project->versions;
357358
$doc->setMetaData('url', $url);
358359

359360
// Set meta twitter

script.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ protected function checkKeysParams()
300300
$component->element = 'com_swjprojects';
301301
$component->params = $params->toString();
302302

303-
$this->db->updateObject('#__extensions', $component, array('element'));
303+
$this->db->updateObject('#__extensions', $component, ['element']);
304304
}
305305
}
306306

0 commit comments

Comments
 (0)