Skip to content

Commit deb01ee

Browse files
Add support for Joomla tags; breaks support for Joomla 3.9.10
1 parent 30031ff commit deb01ee

File tree

19 files changed

+475
-273
lines changed

19 files changed

+475
-273
lines changed

administrator/components/com_jtg/controller.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ public function display($cachable = false, $urlparams = false)
122122
case 'files':
123123
case 'toshow':
124124
case 'tohide':
125+
case 'files.batch':
125126
$input->set('view', 'files');
126127
$input->set('layout', 'default');
127128
break;

administrator/components/com_jtg/controllers/files.php

Lines changed: 63 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@
2020

2121
jimport('joomla.application.component.controller');
2222
use Joomla\Utilities\ArrayHelper;
23+
use Joomla\CMS\MVC\Controller\FormController;
24+
use Joomla\CMS\Factory;
25+
use Joomla\CMS\Uri\Uri;
26+
2327
JTable::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_jtg/tables');
2428

2529
/**
@@ -29,8 +33,59 @@
2933
* @subpackage Frontend
3034
* @since 0.8
3135
*/
32-
class JtgControllerFiles extends JtgController
36+
class JtgControllerFiles extends FormController
3337
{
38+
/**
39+
* View method for JTG
40+
*
41+
* This function override joomla.application.component.controller
42+
* View Cache not yet implemented in JTrackGallery
43+
*
44+
* @param boolean $cachable If true, the view output will be cached
45+
* @param array $urlparams An array of safe url parameters and their variable types
46+
*
47+
* @return void
48+
*/
49+
public function display($cachable = false, $urlparams = false)
50+
{
51+
require_once JPATH_COMPONENT . '/helpers/jtg.php';
52+
// Load the submenu.
53+
JtgHelper::addSubmenu($this->getTask());
54+
$input = Factory::getApplication()->input;
55+
switch ($this->getTask())
56+
{
57+
default:
58+
$input->set('view', 'default');
59+
break;
60+
61+
case 'files':
62+
case 'toshow':
63+
case 'tohide':
64+
case 'batch':
65+
$input->set('view', 'files');
66+
$input->set('layout', 'default');
67+
break;
68+
69+
case 'upload':
70+
$input->set('view', 'files');
71+
$input->set('layout', 'upload');
72+
break;
73+
74+
case 'newfiles':
75+
$input->set('view', 'files');
76+
$input->set('layout', 'import');
77+
break;
78+
79+
case 'newfile':
80+
case 'editfile':
81+
case 'updateGeneratedValues':
82+
$input->set('view', 'files');
83+
$input->set('layout', 'form');
84+
break;
85+
}
86+
parent::display();
87+
}
88+
3489
/**
3590
* function_description
3691
*
@@ -408,4 +463,11 @@ function fetchJPTfiles ()
408463
$model = $this->getModel('files');
409464
echo $model->_fetchJPTfiles();
410465
}
466+
467+
public function batch($model = null)
468+
{
469+
$model = $this->getModel('files');
470+
$this->setRedirect((string)Uri::getInstance());
471+
return parent::batch($model);
472+
}
411473
}

0 commit comments

Comments
 (0)