-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
85a69d0
commit ddd1f10
Showing
13 changed files
with
142 additions
and
101 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
# JUHome | ||
Component for custom FronPage | ||
Component for custom FrontPage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,19 @@ | ||
<?php | ||
/** | ||
* @package JUHome Component | ||
* @version @version@ | ||
* @version 3.x | ||
* @author Denys D. Nosov ([email protected]) | ||
* @copyright (C) 2011-2018 by Denys D. Nosov (https://joomla-ua.org) | ||
* @copyright (C) 2011-2019 by Denys D. Nosov (https://joomla-ua.org) | ||
* @license GNU General Public License version 2 or later | ||
* | ||
* @since 3.0 | ||
*/ | ||
|
||
defined('_JEXEC') or die; | ||
|
||
jimport('joomla.application.component.controller'); | ||
|
||
use Joomla\CMS\Factory; | ||
use Joomla\CMS\MVC\Controller\BaseController; | ||
|
||
defined('_JEXEC') or die; | ||
|
||
/** | ||
* Content Component Controller | ||
* | ||
|
@@ -36,14 +34,14 @@ public function display($cachable = false, $urlparams = false) | |
{ | ||
$params = Factory::getApplication()->getParams(); | ||
|
||
if( $params->get('cache_home', '0') == 1 ) | ||
if($params->get('cache_home', '0') == 1) | ||
{ | ||
$cachable = true; | ||
} | ||
|
||
$vName = $this->input->get('view', 'home'); | ||
$this->input->set('view', $vName); | ||
|
||
return parent::display($cachable, array( 'Itemid' => 'INT' )); | ||
return parent::display($cachable, [ 'Itemid' => 'INT' ]); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,18 @@ | ||
<?php | ||
/** | ||
* @package JUHome Component | ||
* @version @version@ | ||
* @version 3.x | ||
* @author Denys D. Nosov ([email protected]) | ||
* @copyright (C) 2011-2018 by Denys D. Nosov (https://joomla-ua.org) | ||
* @copyright (C) 2011-2019 by Denys D. Nosov (https://joomla-ua.org) | ||
* @license GNU General Public License version 2 or later | ||
* | ||
* @since 3.0 | ||
*/ | ||
|
||
defined('_JEXEC') or die; | ||
|
||
use Joomla\CMS\Factory; | ||
use Joomla\CMS\MVC\Controller\BaseController; | ||
|
||
jimport('joomla.application.component.controller'); | ||
defined('_JEXEC') or die; | ||
|
||
$controller = BaseController::getInstance('Home'); | ||
$controller->execute(Factory::getApplication()->input->get('task')); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,16 +2,15 @@ | |
<extension type="component" version="3.5" method="upgrade"> | ||
<name>home</name> | ||
<author>Denys Nosov</author> | ||
<creationDate>14.11.2018</creationDate> | ||
<copyright>(C) 2011-2018 Joomla! Ukraine. All rights reserved.</copyright> | ||
<creationDate>02.17.2019</creationDate> | ||
<copyright>(C) 2011-2019 Joomla! Ukraine. All rights reserved.</copyright> | ||
<license>GNU General Public License version 2 or later</license> | ||
<authorEmail>[email protected]</authorEmail> | ||
<authorUrl>https://joomla-ua.org</authorUrl> | ||
<version>3.1.0</version> | ||
<version>3.2.0</version> | ||
<description>Home - component for display modules and create Home Page</description> | ||
<files> | ||
<filename>controller.php</filename> | ||
<filename>index.html</filename> | ||
<filename>metadata.xml</filename> | ||
<filename>router.php</filename> | ||
<filename>home.php</filename> | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,94 @@ | ||
<?php | ||
/** | ||
* @package JUHome Component | ||
* @version @version@ | ||
* @version 3.x | ||
* @author Denys D. Nosov ([email protected]) | ||
* @copyright (C) 2011-2018 by Denys D. Nosov (https://joomla-ua.org) | ||
* @copyright (C) 2011-2019 by Denys D. Nosov (https://joomla-ua.org) | ||
* @license GNU General Public License version 2 or later | ||
* | ||
* @since 3.0 | ||
*/ | ||
|
||
use Joomla\CMS\Component\Router\RouterView; | ||
|
||
defined('_JEXEC') or die; | ||
|
||
function homeBuildRoute($query) | ||
class HomeRouter extends RouterView | ||
{ | ||
$segments = array(); | ||
protected $noIDs = false; | ||
|
||
/** | ||
* HomeRouter constructor. | ||
* | ||
* @param null $app | ||
* @param null $menu | ||
* | ||
* @since 1.0 | ||
*/ | ||
public function __construct($app = null, $menu = null) | ||
{ | ||
parent::__construct($app, $menu); | ||
} | ||
|
||
/** | ||
* @param $query | ||
* | ||
* @return array | ||
* | ||
* @since 1.0 | ||
*/ | ||
public function build(&$query) | ||
{ | ||
if(isset($query[ 'view' ])) | ||
{ | ||
unset($query[ 'view' ]); | ||
} | ||
|
||
return []; | ||
} | ||
|
||
if( isset($query[ 'view' ]) ) | ||
/** | ||
* @param $segments | ||
* | ||
* @return array | ||
* | ||
* @since 1.0 | ||
*/ | ||
public function parse(&$segments) | ||
{ | ||
unset($query[ 'view' ]); | ||
if($segments[ 0 ] === $this->app->getMenu()->getActive()->alias) | ||
{ | ||
return [ 'view' => 'home' ]; | ||
} | ||
|
||
return [ 'view' => 'homes' ]; | ||
|
||
} | ||
} | ||
|
||
/** | ||
* @param $query | ||
* | ||
* @return array | ||
* | ||
* @since 1.0 | ||
*/ | ||
function homeBuildRoute(&$query) | ||
{ | ||
$router = new HomeRouter($this->app, $this->app->getMenu()); | ||
|
||
return $segments; | ||
return $router->build($query); | ||
} | ||
|
||
|
||
/** | ||
* @return array | ||
* | ||
* @since 3.0 | ||
* @since 1.0 | ||
*/ | ||
function homeParseRoute() | ||
{ | ||
$vars = array(); | ||
|
||
$vars[ 'view' ] = 'home'; | ||
$router = new HomeRouter($this->app, $this->app->getMenu()); | ||
|
||
return $vars; | ||
return $router->parse($segments); | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
<?php | ||
/** | ||
* @package JUHome Component | ||
* @version @version@ | ||
* @version 3.x | ||
* @author Denys D. Nosov ([email protected]) | ||
* @copyright (C) 2011-2018 by Denys D. Nosov (https://joomla-ua.org) | ||
* @copyright (C) 2011-2019 by Denys D. Nosov (https://joomla-ua.org) | ||
* @license GNU General Public License version 2 or later | ||
* | ||
* @since 3.0 | ||
|
@@ -13,9 +13,9 @@ | |
|
||
$load = new HomeViewHome(); | ||
|
||
if( $params->get('display_title') ) | ||
if($this->params->get('display_title')) | ||
{ | ||
echo '<h1>' . $params->get('page_title') . '</h1>'; | ||
echo '<h1>' . $this->params->get('page_title') . '</h1>'; | ||
} | ||
|
||
echo $load->LoadPositionForHome($home->mod_name_pref, $style = ($home->style ? : 'raw')); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
<?php | ||
/** | ||
* @package JUHome Component | ||
* @version @version@ | ||
* @version 3.x | ||
* @author Denys D. Nosov ([email protected]) | ||
* @copyright (C) 2011-2018 by Denys D. Nosov (https://joomla-ua.org) | ||
* @copyright (C) 2011-2019 by Denys D. Nosov (https://joomla-ua.org) | ||
* @license GNU General Public License version 2 or later | ||
* | ||
* @since 3.0 | ||
|
@@ -13,4 +13,4 @@ | |
|
||
$load = new HomeViewHome(); | ||
|
||
echo $load->LoadPositionForHome($home->mod_name_pref, $style = 'raw'); | ||
echo $load->LoadPositionForHome($home->mod_name_pref, 'raw'); |
Oops, something went wrong.