mirror of
https://github.com/humhub/humhub.git
synced 2025-02-24 03:06:04 +01:00
Merge pull request #2941 from acs-ferreira/patch-34
Fix BaseStack widget
This commit is contained in:
commit
50d866f231
@ -2,13 +2,14 @@
|
||||
|
||||
/**
|
||||
* @link https://www.humhub.org/
|
||||
* @copyright Copyright (c) 2017 HumHub GmbH & Co. KG
|
||||
* @copyright Copyright (c) 2018 HumHub GmbH & Co. KG
|
||||
* @license https://www.humhub.com/licences
|
||||
*/
|
||||
|
||||
namespace humhub\widgets;
|
||||
|
||||
use Yii;
|
||||
use yii\base\Widget;
|
||||
|
||||
/**
|
||||
* StackWidget is a widget which can hold a set of subwidgets.
|
||||
@ -36,14 +37,14 @@ class BaseStack extends \yii\base\Widget
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public $widgets = array();
|
||||
public $widgets = [];
|
||||
|
||||
/**
|
||||
* Seperator HTML Code (glue)
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $seperator = "";
|
||||
public $seperator = '';
|
||||
|
||||
/**
|
||||
* Template for output
|
||||
@ -51,14 +52,13 @@ class BaseStack extends \yii\base\Widget
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $template = "{content}";
|
||||
public $template = '{content}';
|
||||
|
||||
/**
|
||||
* Initializes the sidebar widget.
|
||||
*/
|
||||
public function init()
|
||||
{
|
||||
|
||||
// Yii 2.0.11 introduced own init event
|
||||
if (version_compare(Yii::getVersion(), '2.0.11', '<')) {
|
||||
$this->trigger(self::EVENT_INIT);
|
||||
@ -74,7 +74,7 @@ class BaseStack extends \yii\base\Widget
|
||||
{
|
||||
$this->trigger(self::EVENT_RUN);
|
||||
|
||||
$content = "";
|
||||
$content = '';
|
||||
|
||||
$i = 0;
|
||||
foreach ($this->getWidgets() as $widget) {
|
||||
@ -123,7 +123,7 @@ class BaseStack extends \yii\base\Widget
|
||||
|
||||
if ($sortA == $sortB) {
|
||||
return 0;
|
||||
} else if ($sortA < $sortB) {
|
||||
} elseif ($sortA < $sortB) {
|
||||
return -1;
|
||||
} else {
|
||||
return 1;
|
||||
|
Loading…
x
Reference in New Issue
Block a user