| Code Coverage | ||||||||||
| Classes and Traits | Functions and Methods | Lines | ||||||||
| Total |  | 0.00% | 0 / 1 |  | 0.00% | 0 / 5 | CRAP |  | 0.00% | 0 / 25 | 
| WallEntry |  | 0.00% | 0 / 1 |  | 0.00% | 0 / 5 | 72 |  | 0.00% | 0 / 25 | 
| getEditUrl |  | 0.00% | 0 / 1 | 2 |  | 0.00% | 0 / 3 | |||
| isInModal |  | 0.00% | 0 / 1 | 2 |  | 0.00% | 0 / 3 | |||
| run |  | 0.00% | 0 / 1 | 2 |  | 0.00% | 0 / 4 | |||
| getContextMenu |  | 0.00% | 0 / 1 | 12 |  | 0.00% | 0 / 8 | |||
| getWallEntryViewParams |  | 0.00% | 0 / 1 | 6 |  | 0.00% | 0 / 7 | |||
| <?php | |
| /** | |
| * @link https://www.humhub.org/ | |
| * @copyright Copyright (c) 2018 HumHub GmbH & Co. KG | |
| * @license https://www.humhub.com/licences | |
| * | |
| */ | |
| namespace humhub\modules\tasks\widgets; | |
| use humhub\modules\content\widgets\WallEntryControlLink; | |
| use humhub\modules\tasks\assets\Assets; | |
| use humhub\modules\content\widgets\EditLink; | |
| use humhub\modules\content\widgets\DeleteLink; | |
| use humhub\modules\tasks\helpers\TaskUrl; | |
| use Yii; | |
| /** | |
| * @inheritdoc | |
| */ | |
| class WallEntry extends \humhub\modules\content\widgets\WallEntry | |
| { | |
| public $editMode = self::EDIT_MODE_MODAL; | |
| public function getEditUrl() | |
| { | |
| return TaskUrl::editTask($this->contentObject, 0, 1); | |
| } | |
| public function isInModal() | |
| { | |
| return Yii::$app->request->get('cal'); | |
| } | |
| /** | |
| * @inheritdoc | |
| */ | |
| public function run() | |
| { | |
| Assets::register($this->view); | |
| return $this->render('wallEntry', ['task' => $this->contentObject, 'justEdited' => $this->justEdited]); | |
| } | |
| public function getContextMenu() | |
| { | |
| if(!$this->isInModal() || !$this->contentObject->content->canEdit()) { | |
| return parent::getContextMenu(); | |
| } | |
| // TODO: remove this after simplestream modal edit/delete runs as expected | |
| $this->controlsOptions['prevent'] = [EditLink::class , DeleteLink::class]; | |
| $result = parent::getContextMenu(); | |
| return $result; | |
| } | |
| public function getWallEntryViewParams() | |
| { | |
| $params = parent::getWallEntryViewParams(); | |
| if($this->isInModal()) { | |
| $params['showContentContainer'] = true; | |
| } | |
| return $params; | |
| } | |
| } |