protected function resolveNameContent() { $element = new DropDownElement($this->model, 'title', null); $element->nonEditableTemplate = '{content}'; $spanContent = ZurmoHtml::tag('span', array('class' => 'salutation'), $element->render()); $usernameContent = ZurmoHtml::tag('span', array('class' => 'user-name'), $this->model->username); return ZurmoHtml::tag('h2', array(), $spanContent . strval($this->model) . $usernameContent); }
protected function renderEditableSalutationContent() { $params = array('addBlank' => true); $params['inputPrefix'] = $this->resolveInputPrefix(); $element = new DropDownElement($this->model, 'title', $this->form, $params); $element->editableTemplate = '{content}{error}'; return ZurmoHtml::tag('div', array('class' => 'overlay-label-field fifth'), $element->render()); }
protected function resolveNameContent() { $element = new DropDownElement($this->model, 'title', null); $element->nonEditableTemplate = '{content}'; $salutation = $element->render(); if ($salutation != null) { $spanContent = ZurmoHtml::tag('span', array('class' => 'salutation'), $element->render()); } else { $spanContent = null; } return ZurmoHtml::tag('h2', array(), $spanContent . strval($this->model)); }
protected function resolveNameContent() { $element = new DropDownElement($this->model, 'title', null); $element->nonEditableTemplate = '{content}'; $starLink = null; $spanContent = null; if (StarredUtil::modelHasStarredInterface($this->model)) { $starLink = StarredUtil::getToggleStarStatusLink($this->model, null); } $salutation = $element->render(); if ($salutation != null) { $spanContent = ZurmoHtml::tag('span', array('class' => 'salutation'), $element->render()); } return ZurmoHtml::tag('h2', array(), $spanContent . strval($this->model) . $starLink . $this->renderGoToDetailsLink()); }
protected function getEditableHtmlOptions() { $htmlOptions = parent::getEditableHtmlOptions(); $htmlOptions['multiple'] = true; $htmlOptions['class'] = 'multiple'; return $htmlOptions; }
/** * Clear out html options for 'empty' since it is not applicable for a rado dropdown. * @see DropDownElement::getEditableHtmlOptions() */ protected function getEditableHtmlOptions() { $htmlOptions = parent::getEditableHtmlOptions(); $htmlOptions['template'] = '<div class="radio-input">{input}{label}</div>'; if (isset($htmlOptions['empty'])) { unset($htmlOptions['empty']); } return $htmlOptions; }
/** * (non-PHPdoc) * @see Element::renderControlNonEditable() */ protected function renderControlNonEditable() { $attributes = $this->dropDownDependencyDerivedAttributeMetadata->getUsedAttributeNames(); $content = null; foreach ($attributes as $attribute) { $element = new DropDownElement($this->model, $attribute, $this->form); $element->nonEditableTemplate = $this->getNonEditableTemplate(); if ($content != null) { $content .= ' → '; } $content .= $element->render(); } return $content; }
/** * Override so we can force attribute to be set at 'state' since this * is the correct attributeName for anything using this derived element */ public function __construct($model, $attribute, $form = null, array $params = array()) { assert('$attribute == "null"'); parent::__construct($model, $attribute, $form, $params); $this->attribute = $this->resolveAttributeName(); }