-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #263 from humhub/fix/js-fixes
Js Fixes
- Loading branch information
Showing
8 changed files
with
91 additions
and
15 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
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 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 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 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 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 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 |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<?php | ||
|
||
/** | ||
* @link https://www.humhub.org/ | ||
* @copyright Copyright (c) 2022 HumHub GmbH & Co. KG | ||
* @license https://www.humhub.com/licences | ||
*/ | ||
|
||
namespace humhub\modules\tasks\widgets; | ||
|
||
use humhub\modules\content\components\ContentContainerActiveRecord; | ||
use humhub\modules\tasks\helpers\TaskListUrl; | ||
use humhub\modules\tasks\models\Task; | ||
use humhub\modules\tasks\permissions\CreateTask; | ||
use yii\base\Widget; | ||
|
||
/** | ||
* Widget for rendering the Tasks header. | ||
*/ | ||
class TaskHeader extends Widget | ||
{ | ||
/** | ||
* @var null|ContentContainerActiveRecord | ||
*/ | ||
public $contentContainer; | ||
|
||
/** | ||
* @var bool | ||
*/ | ||
public $displayAddTask = false; | ||
|
||
/** | ||
* @inheritdoc | ||
*/ | ||
public function run() | ||
{ | ||
return $this->render('taskHeader', [ | ||
'addTaskUrl' => $this->getAddTaskUrl(), | ||
]); | ||
} | ||
|
||
private function getAddTaskUrl(): ?string | ||
{ | ||
if ($this->displayAddTask && (new Task($this->contentContainer))->content->canEdit()) { | ||
return TaskListUrl::addTaskListTask(null, $this->contentContainer); | ||
} | ||
|
||
return null; | ||
} | ||
|
||
} |
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