/** * Renders the noneditable email address content. * If the model is a person, and the user accessing this element has right to access the email module, * then the email address will be clickable. When clicked it will open a modal create email window. * Takes the model attribute value and converts it into * at most 3 items. Email Address display, Opt Out checkbox, * and Invalid Email checkbox. * @return A string containing the element's content. */ protected function renderControlNonEditable() { $addressModel = $this->model->{$this->attribute}; $emailAddress = $addressModel->emailAddress; $optOut = $addressModel->optOut; $isInvalid = $addressModel->isInvalid; $content = null; if (!empty($emailAddress)) { $content .= EmailMessageUtil::renderEmailAddressAsMailToOrModalLinkStringContent($emailAddress, $this->model) . EmailMessageUtil::renderEmailAddressState($emailAddress, $this->model); if ($optOut || $isInvalid) { $content .= ' ('; } if ($optOut) { $content .= Zurmo::t('EmailMessagesModule', 'Opted Out'); } if ($isInvalid) { if ($optOut) { $content .= ', '; } $content .= Zurmo::t('Core', 'Invalid'); } if ($optOut || $isInvalid) { $content .= ')'; } } return $content; }