Skip to content

Commit

Permalink
Update to working state
Browse files Browse the repository at this point in the history
  • Loading branch information
alex7r committed Jul 20, 2017
1 parent 32a9bcd commit 081186c
Show file tree
Hide file tree
Showing 11 changed files with 276 additions and 53 deletions.
2 changes: 2 additions & 0 deletions Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
namespace JoomPlaceX;


use Joomla\Registry\Registry;

class Controller extends \JControllerBase
{
protected $_default_action = 'display';
Expand Down
4 changes: 2 additions & 2 deletions Dispatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ public function execute($task = null)

public function dispatch($task = null)
{
$this->input->def('view',$this->default_view);

if(\JFactory::getApplication()->isClient('administrator')){
$this->addMustHaveButtons();
}

$this->input->def('view',$this->default_view);

if(strpos($task,'.')){
list($controllerName, $action) = explode('.', $task);
}else{
Expand Down
29 changes: 29 additions & 0 deletions Helper.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php
/**
* Created by PhpStorm.
* User: Alexandr
* Date: 23.06.2017
* Time: 14:22
*/

namespace JoomPlaceX;


class Helper
{
public static function renderLayout($layoutId, $data = array(), $path = null, $component, $nestingLevel = 1, $method = 'render'){
$layout = new \JLayoutFile($layoutId);
$layout->setComponent($component);
$iPs = $layout->getIncludePaths();
$iPs[] = $path;
$layout->setIncludePaths($iPs);
$html = $layout->$method($data);
if(!$html && --$nestingLevel){
$layoutId = explode('.',$layoutId);
array_pop($layoutId);
$layoutId = implode('.',$layoutId);
self::renderLayout($layoutId,$data,$path,$component,$nestingLevel,$method);
}
return $html;
}
}
Loading

0 comments on commit 081186c

Please sign in to comment.