當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Zend_Form_Element_Checkbox::getDecorator方法代碼示例

本文整理匯總了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++;
         }
     }
 }
開發者ID:belapp,項目名稱:opus4-application,代碼行數:49,代碼來源:WorkflowController.php


注:本文中的Zend_Form_Element_Checkbox::getDecorator方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。