本文整理汇总了PHP中Zend_Form_Element_Checkbox::getDecorator方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Form_Element_Checkbox::getDecorator方法的具体用法?PHP Zend_Form_Element_Checkbox::getDecorator怎么用?PHP Zend_Form_Element_Checkbox::getDecorator使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend_Form_Element_Checkbox
的用法示例。
在下文中一共展示了Zend_Form_Element_Checkbox::getDecorator方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _addPublishNotificationSelection
/**
* add a checkbox for each PersonSubmitter and PersonAuthor (used to select
* recipients for publish notification email)
*
* @param Opus_Document $document
* @param Zend_Form $form
*
*/
private function _addPublishNotificationSelection($document, $form)
{
$form->addElement('hidden', 'plaintext', array('description' => '<br/><p><strong>' . $this->view->translate('admin_workflow_notification_headline') . '</strong></p>' . '<p>' . $this->view->translate('admin_workflow_notification_description') . '</p>', 'ignore' => true, 'decorators' => array(array('Description', array('escape' => false, 'tag' => '')))));
$submitters = $document->getPersonSubmitter();
if (!is_null($submitters) && count($submitters) > 0) {
$label = $this->view->translate('admin_workflow_notification_submitter') . ' ' . trim($submitters[0]->getLastName()) . ", " . trim($submitters[0]->getFirstName());
$element = null;
if (trim($submitters[0]->getEmail()) == '') {
// email notification is not possible since no email address is specified for submitter
$label .= ' (' . $this->view->translate('admin_workflow_notification_noemail') . ')';
$element = new Zend_Form_Element_Checkbox('submitter', array('checked' => false, 'disabled' => true, 'label' => $label));
$element->getDecorator('Label')->setOption('class', 'notification-option option-not-available');
} else {
$label .= ' (' . trim($submitters[0]->getEmail()) . ')';
$element = new Zend_Form_Element_Checkbox('submitter', array('checked' => true, 'label' => $label));
$element->getDecorator('Label')->setOption('class', 'notification-option');
}
$form->addElement($element);
}
$authors = $document->getPersonAuthor();
if (!is_null($authors)) {
$index = 1;
foreach ($authors as $author) {
$id = 'author_' . $index;
$label = $index . '. ' . $this->view->translate('admin_workflow_notification_author') . ' ' . trim($author->getLastName()) . ", " . trim($author->getFirstName());
$element = null;
if (trim($author->getEmail()) == '') {
// email notification is not possible since no email address is specified for author
$label .= ' (' . $this->view->translate('admin_workflow_notification_noemail') . ')';
$element = new Zend_Form_Element_Checkbox($id, array('checked' => false, 'disabled' => true, 'label' => $label));
$element->getDecorator('Label')->setOption('class', 'notification-option option-not-available');
} else {
$label .= ' (' . trim($author->getEmail()) . ')';
$element = new Zend_Form_Element_Checkbox($id, array('checked' => true, 'label' => 'foo', 'label' => $label));
$element->getDecorator('Label')->setOption('class', 'notification-option');
}
$form->addElement($element);
$index++;
}
}
}