/** * Override to change the editableTemplate to place the label above the input. * @see DetailsView::resolveElementDuringFormLayoutRender() */ protected function resolveElementDuringFormLayoutRender(&$element) { if ($element->getAttribute() == 'description') { $element->editableTemplate = '<td colspan="{colspan}">{content}{error}</td>'; } elseif ($element instanceof FilesElement) { $element->editableTemplate = FilesElement::getEditableTemplateForInlineEdit(); } else { $element->editableTemplate = '<td colspan="{colspan}">{label}<br/>{content}{error}</td>'; } }
protected function renderMissionContent() { $userUrl = Yii::app()->createUrl('/users/default/details', array('id' => $this->model->createdByUser->id)); $content = '<div class="comment model-details-summary">'; $content .= ZurmoHtml::link($this->model->createdByUser->getAvatarImage(100), $userUrl); $content .= '<span class="user-details">'; $content .= ZurmoHtml::link(strval($this->model->createdByUser), $userUrl, array('class' => 'user-link')); $content .= '</span>'; $element = new TextAreaElement($this->model, 'description'); $element->nonEditableTemplate = '<div class="comment-content">{content}</div>'; $content .= $element->render(); if ($this->model->reward != null) { $element = new TextElement($this->model, 'reward'); $element->nonEditableTemplate = '<div class="comment-content">' . Zurmo::t('MissionsModule', 'Reward') . ': {content}</div>'; $content .= $element->render(); } if ($this->model->takenByUser->id > 0) { $element = new UserElement($this->model, 'takenByUser'); $element->nonEditableTemplate = '<div class="comment-content">' . Zurmo::t('MissionsModule', 'Taken By') . ': {content}</div>'; $content .= $element->render(); } if (!DateTimeUtil::isDateTimeValueNull($this->model, 'dueDateTime')) { $element = new DateTimeElement($this->model, 'dueDateTime'); $element->nonEditableTemplate = '<div class="comment-content">' . Zurmo::t('MissionsModule', 'Due') . ': {content}</div>'; $content .= $element->render(); } $date = '<span class="comment-details"><strong>' . DateTimeUtil::convertDbFormattedDateTimeToLocaleFormattedDisplay($this->model->createdDateTime, 'long', null) . '</strong></span>'; $content .= $date; if ($this->model->files->count() > 0) { $element = new FilesElement($this->model, 'null'); $element->nonEditableTemplate = '<div>{content}</div>'; $content .= '<div><strong>' . Zurmo::t('MissionsModule', 'Attachments') . '</strong></div>'; $content .= $element->render(); } $element = new MissionStatusElement($this->model, 'status'); $element->nonEditableTemplate = '<div class="comment-content">' . Zurmo::t('MissionsModule', 'Status') . ': {content}</div>'; $content .= $element->render(); $content .= '</div>'; return ZurmoHtml::tag('div', array('id' => 'ModelDetailsSummaryView'), $content); }
protected function renderFiles(&$content) { $element = new FilesElement($this->model, null, $this->form); $this->wrapContentInDiv($filesContent); $filesContent = $element->render(); $this->wrapContentInTableRow($filesContent); $content .= $filesContent; }
protected function renderConversationRelatedToAndAttachmentsContent() { $element = new ConversationItemsElement($this->model, 'null'); $element->nonEditableTemplate = '<td colspan="{colspan}">{content}</td>'; $contentForTable = $element->render(); if ($this->model->files->count() > 0) { $element = new FilesElement($this->model, 'null'); $element->nonEditableTemplate = '<td colspan="{colspan}" class="conversation-related-Attachments">{content}</td>'; $contentForTable .= $element->render(); } $content = ZurmoHtml::tag('table', array('class' => 'thread-details'), $contentForTable); return $content; }