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


PHP ProfileField::getNewUI方法代碼示例

本文整理匯總了PHP中ProfileField::getNewUI方法的典型用法代碼示例。如果您正苦於以下問題:PHP ProfileField::getNewUI方法的具體用法?PHP ProfileField::getNewUI怎麽用?PHP ProfileField::getNewUI使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在ProfileField的用法示例。


在下文中一共展示了ProfileField::getNewUI方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getAdminUI

 /**
  * Retreives the admin interface of this object
  *
  * @return string The HTML fragment for this interface
  */
 public function getAdminUI()
 {
     // Init values
     $html = '';
     // All sections
     $profileSections = array();
     // Metadata section
     $profileMetadataItems = array();
     //  is_visible
     $title = _("Should this profile be publicly visible?");
     $name = "profile_" . $this->getId() . "_is_visible";
     $data = InterfaceElements::generateInputCheckbox($name, "", _("Yes"), $this->isVisible(), "profile_is_visible_radio");
     $profileMetadataItems[] = InterfaceElements::genSectionItem($data, $title);
     $profileSections[] = InterfaceElements::genSection($profileMetadataItems, _("Profile preferences"));
     // Fields section
     $profileFieldsUI = array();
     $template = $this->getTemplate();
     // Aggregate the fields UI
     $profileFields = $this->getFields();
     //var_dump($profileFields);
     foreach ($template->getFields() as $templateField) {
         //var_dump($templateField);
         if (!empty($profileFields[$templateField->getId()])) {
             //We already have a real field instanciated
             $field = $profileFields[$templateField->getId()];
             //var_dump($field);
             $profileFieldsUI[] = InterfaceElements::genSectionItem($field->getAdminUI());
         } else {
             //show the template admin UI
             //$profileFieldsUI[] = InterfaceElements::genSectionItem($templateField->getUserUI());
             // Init values
             $tmp_html = '';
             $admin_label = $templateField->getAdminLabelContent();
             if ($admin_label != null) {
                 $title = $admin_label->__toString();
             } else {
                 $title = null;
             }
             $tmp_html .= "<fieldset class='admin_container " . get_class($this) . "'>\n";
             if (!empty($title)) {
                 $tmp_html .= "<legend>{$title}</legend>\n";
             }
             $futureProfileFieldId = get_guid();
             $name = "profile_template_field_{$templateField->getId()}_field_future_id";
             $tmp_html .= '<input type="hidden" name="' . $name . '" value="' . $futureProfileFieldId . '">';
             $userData['contentTypeFilter'] = $templateField->getContentTypeFilter();
             //echo "Profile::getAdminUI: userData";pretty_print_r($userData);
             $tmp_html .= ProfileField::getNewUI($futureProfileFieldId, $userData);
             $tmp_html .= "</fieldset>\n";
             $profileFieldsUI[] = $tmp_html;
         }
     }
     $profileSections[] = InterfaceElements::genSection($profileFieldsUI, _("Profile fields"));
     $html .= InterfaceElements::genSection($profileSections, _("Profile"), false, false, get_class($this));
     return $html;
 }
開發者ID:cnlangzi,項目名稱:wifidog-auth,代碼行數:61,代碼來源:Profile.php


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