Skip to content

Commit f5dbe9c

Browse files
committed
Prepare 1.0.0 release
1 parent 1de8d1d commit f5dbe9c

File tree

100 files changed

+12335
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

100 files changed

+12335
-0
lines changed

com_swjprojects/admin/access.xml

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<access component="com_swjprojects">
3+
<section name="component">
4+
<action name="core.admin" title="JACTION_ADMIN" description="JACTION_ADMIN_COMPONENT_DESC"/>
5+
<action name="core.manage" title="JACTION_MANAGE" description="JACTION_MANAGE_COMPONENT_DESC"/>
6+
<action name="core.create" title="JACTION_CREATE" description="JACTION_CREATE_COMPONENT_DESC"/>
7+
<action name="core.delete" title="JACTION_DELETE" description="JACTION_DELETE_COMPONENT_DESC"/>
8+
<action name="core.edit" title="JACTION_EDIT" description="JACTION_EDIT_COMPONENT_DESC"/>
9+
<action name="core.edit.state" title="JACTION_EDITSTATE" description="JACTION_EDITSTATE_COMPONENT_DESC"/>
10+
</section>
11+
</access>

com_swjprojects/admin/config.xml

+70
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
<?xml version="1.0"?>
2+
<config>
3+
<fieldset name="global" label="JGLOBAL_FIELDSET_OPTIONS">
4+
<field name="sef_advanced" type="hidden" default="1"/>
5+
<field name="files_folder" type="text"
6+
label="COM_SWJPROJECTS_PARAMS_FILES_FOLDER"
7+
description="COM_SWJPROJECTS_PARAMS_FILES_FOLDER_DESC"
8+
class="input-xxlarge"/>
9+
<field name="projects_limit" type="list"
10+
label="COM_SWJPROJECTS_PARAMS_PROJECTS_LIMIT"
11+
default="10">
12+
<option value="5">J5</option>
13+
<option value="10">J10</option>
14+
<option value="15">J15</option>
15+
<option value="20">J20</option>
16+
<option value="25">J25</option>
17+
<option value="30">J30</option>
18+
<option value="50">J50</option>
19+
<option value="100">J100</option>
20+
<option value="0">JALL</option>
21+
</field>
22+
<field name="projects_layout" type="componentlayout"
23+
label="COM_SWJPROJECTS_PARAMS_PROJECTS_LAYOUT"
24+
extension="com_swjprojects"
25+
view="projects"/>
26+
<field name="project_layout" type="componentlayout"
27+
label="COM_SWJPROJECTS_PARAMS_PROJECT_LAYOUT"
28+
extension="com_swjprojects"
29+
view="project"/>
30+
<field name="versions_limit" type="list"
31+
label="COM_SWJPROJECTS_PARAMS_VERSIONS_LIMIT"
32+
default="10">
33+
<option value="5">J5</option>
34+
<option value="10">J10</option>
35+
<option value="15">J15</option>
36+
<option value="20">J20</option>
37+
<option value="25">J25</option>
38+
<option value="30">J30</option>
39+
<option value="50">J50</option>
40+
<option value="100">J100</option>
41+
<option value="0">JALL</option>
42+
</field>
43+
<field name="versions_layout" type="componentlayout"
44+
label="COM_SWJPROJECTS_PARAMS_VERSIONS_LAYOUT"
45+
extension="com_swjprojects"
46+
view="versions"/>
47+
<field name="version_layout" type="componentlayout"
48+
label="COM_SWJPROJECTS_PARAMS_VERSION_LAYOUT"
49+
extension="com_swjprojects"
50+
view="version"/>
51+
<field name="jupdate_cachetimeout" type="integer"
52+
label="COM_SWJPROJECTS_PARAMS_JUPDATE_CACHETIMEOUT"
53+
description="COM_SWJPROJECTS_PARAMS_JUPDATE_CACHETIMEOUT_DESC"
54+
first="0"
55+
last="24"
56+
step="1"
57+
default="0"/>
58+
</fieldset>
59+
<fieldset name="permissions"
60+
label="JCONFIG_PERMISSIONS_LABEL"
61+
description="JCONFIG_PERMISSIONS_DESC">
62+
<field name="rules" type="rules"
63+
label="JCONFIG_PERMISSIONS_LABEL"
64+
class="inputbox"
65+
validate="rules"
66+
filter="rules"
67+
component="com_swjprojects"
68+
section="component"/>
69+
</fieldset>
70+
</config>

com_swjprojects/admin/controller.php

+68
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
<?php
2+
/**
3+
* @package SW JProjects Component
4+
* @version 1.0.0
5+
* @author Septdir Workshop - www.septdir.com
6+
* @copyright Copyright (c) 2018 - 2018 Septdir Workshop. All rights reserved.
7+
* @license GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
8+
* @link https://www.septdir.com/
9+
*/
10+
11+
defined('_JEXEC') or die;
12+
13+
use Joomla\CMS\Language\Text;
14+
use Joomla\CMS\MVC\Controller\BaseController;
15+
use Joomla\CMS\Router\Route;
16+
use Joomla\CMS\Uri\Uri;
17+
18+
class SWJProjectsController extends BaseController
19+
{
20+
/**
21+
* The default view.
22+
*
23+
* @var string
24+
*
25+
* @since 1.0.0
26+
*/
27+
protected $default_view = 'versions';
28+
29+
/**
30+
* Redirect to site.
31+
*
32+
* @since 1.0.0
33+
*/
34+
public function siteRedirect()
35+
{
36+
JLoader::register('SWJProjectsHelperRoute', JPATH_SITE . '/components/com_swjprojects/helpers/route.php');
37+
38+
$page = $this->input->get('page', false);
39+
$id = $this->input->getInt('id');
40+
$catid = $this->input->getInt('catid');
41+
$project_id = $this->input->getInt('project_id');
42+
$version_id = $this->input->getInt('version_id');
43+
$element = $this->input->get('element');
44+
45+
$redirects = array(
46+
'projects' => SWJProjectsHelperRoute::getProjectsRoute($id),
47+
'project' => SWJProjectsHelperRoute::getProjectRoute($id, $catid),
48+
'versions' => SWJProjectsHelperRoute::getVersionsRoute($id, $catid),
49+
'version' => SWJProjectsHelperRoute::getVersionRoute($id, $project_id, $catid),
50+
'download' => SWJProjectsHelperRoute::getDownloadRoute($version_id, $project_id, $element),
51+
'jupdate' => SWJProjectsHelperRoute::getJUpdateRoute($project_id, $element)
52+
);
53+
54+
$redirect = (!empty($page) && !empty($redirects[$page])) ? $redirects[$page] : false;
55+
56+
if (!$redirect)
57+
{
58+
$this->setMessage(Text::_('COM_SWJPROJECTS_ERROR_PAGE_NOT_FOUND'), 'error');
59+
$this->setRedirect(Route::_('index.php?option=com_centers&view=' . $this->input->get('view')));
60+
$this->redirect();
61+
}
62+
63+
// Set Redirect
64+
$debug = ($this->input->get('debug', false)) ? '&debug=1' : '';
65+
$this->setRedirect(Uri::root() . $redirect . $debug);
66+
$this->redirect();
67+
}
68+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
<?php
2+
/**
3+
* @package SW JProjects Component
4+
* @version 1.0.0
5+
* @author Septdir Workshop - www.septdir.com
6+
* @copyright Copyright (c) 2018 - 2018 Septdir Workshop. All rights reserved.
7+
* @license GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
8+
* @link https://www.septdir.com/
9+
*/
10+
11+
defined('_JEXEC') or die;
12+
13+
use Joomla\CMS\Language\Text;
14+
use Joomla\CMS\MVC\Controller\AdminController;
15+
use Joomla\CMS\Router\Route;
16+
use Joomla\CMS\Session\Session;
17+
18+
class SWJProjectsControllerCategories extends AdminController
19+
{
20+
/**
21+
* The prefix to use with controller messages.
22+
*
23+
* @var string
24+
*
25+
* @since 1.0.0
26+
*/
27+
protected $text_prefix = 'COM_SWJPROJECTS_CATEGORIES';
28+
29+
/**
30+
* Rebuild the nested set tree.
31+
*
32+
* @return boolean False on failure or error, true on success.
33+
*
34+
* @since 1.0.0
35+
*/
36+
public function rebuild()
37+
{
38+
Session::checkToken() or jexit(Text::_('JINVALID_TOKEN'));
39+
40+
$this->setRedirect(Route::_('index.php?option=com_swjprojects&view=categories', false));
41+
42+
if ($this->getModel()->rebuild())
43+
{
44+
// Rebuild succeeded
45+
$this->setMessage(Text::_('COM_SWJPROJECTS_CATEGORIES_REBUILD_SUCCESS'));
46+
47+
return true;
48+
}
49+
50+
// Rebuild failed
51+
$this->setMessage(Text::_('COM_SWJPROJECTS_CATEGORIES_REBUILD_FAILURE'));
52+
53+
return false;
54+
}
55+
56+
/**
57+
* Proxy for getModel.
58+
*
59+
* @param string $name The model name.
60+
* @param string $prefix The class prefix.
61+
* @param array $config The array of possible config values.
62+
*
63+
* @return \Joomla\CMS\MVC\Model\BaseDatabaseModel A model object.
64+
*
65+
* @since 1.0.0
66+
*/
67+
public function getModel($name = 'Category', $prefix = 'SWJProjectsModel', $config = array('ignore_request' => true))
68+
{
69+
return parent::getModel($name, $prefix, $config);
70+
}
71+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?php
2+
/**
3+
* @package SW JProjects Component
4+
* @version 1.0.0
5+
* @author Septdir Workshop - www.septdir.com
6+
* @copyright Copyright (c) 2018 - 2018 Septdir Workshop. All rights reserved.
7+
* @license GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
8+
* @link https://www.septdir.com/
9+
*/
10+
11+
defined('_JEXEC') or die;
12+
13+
use Joomla\CMS\MVC\Controller\FormController;
14+
15+
class SWJProjectsControllerCategory extends FormController
16+
{
17+
/**
18+
* The prefix to use with controller messages.
19+
*
20+
* @var string
21+
*
22+
* @since 1.0.0
23+
*/
24+
protected $text_prefix = 'COM_SWJPROJECTS_CATEGORY';
25+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?php
2+
/**
3+
* @package SW JProjects Component
4+
* @version 1.0.0
5+
* @author Septdir Workshop - www.septdir.com
6+
* @copyright Copyright (c) 2018 - 2018 Septdir Workshop. All rights reserved.
7+
* @license GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
8+
* @link https://www.septdir.com/
9+
*/
10+
11+
defined('_JEXEC') or die;
12+
13+
use Joomla\CMS\MVC\Controller\FormController;
14+
15+
class SWJProjectsControllerProject extends FormController
16+
{
17+
/**
18+
* The prefix to use with controller messages.
19+
*
20+
* @var string
21+
*
22+
* @since 1.0.0
23+
*/
24+
protected $text_prefix = 'COM_SWJPROJECTS_PROJECT';
25+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<?php
2+
/**
3+
* @package SW JProjects Component
4+
* @version 1.0.0
5+
* @author Septdir Workshop - www.septdir.com
6+
* @copyright Copyright (c) 2018 - 2018 Septdir Workshop. All rights reserved.
7+
* @license GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
8+
* @link https://www.septdir.com/
9+
*/
10+
11+
defined('_JEXEC') or die;
12+
13+
use Joomla\CMS\MVC\Controller\AdminController;
14+
15+
class SWJProjectsControllerProjects extends AdminController
16+
{
17+
/**
18+
* The prefix to use with controller messages.
19+
*
20+
* @var string
21+
*
22+
* @since 1.0.0
23+
*/
24+
protected $text_prefix = 'COM_SWJPROJECTS_PROJECTS';
25+
26+
/**
27+
* Proxy for getModel.
28+
*
29+
* @param string $name The model name.
30+
* @param string $prefix The class prefix.
31+
* @param array $config The array of possible config values.
32+
*
33+
* @return \Joomla\CMS\MVC\Model\BaseDatabaseModel A model object.
34+
*
35+
* @since 1.0.0
36+
*/
37+
public function getModel($name = 'Project', $prefix = 'SWJProjectsModel', $config = array('ignore_request' => true))
38+
{
39+
return parent::getModel($name, $prefix, $config);
40+
}
41+
}

0 commit comments

Comments
 (0)