本文整理汇总了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;
}