本文整理汇总了PHP中ProfileField::get方法的典型用法代码示例。如果您正苦于以下问题:PHP ProfileField::get方法的具体用法?PHP ProfileField::get怎么用?PHP ProfileField::get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ProfileField
的用法示例。
在下文中一共展示了ProfileField::get方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct()
{
gateKeeper();
$message = NULL;
$user = getLoggedInUser();
$user->profile_complete = true;
$profile_type = $user->profile_type;
$fields = ProfileField::get($profile_type);
foreach ($fields as $key => $field) {
if ($field['required'] == "true" && !getInput($key)) {
$message .= "{$field['label']} cannot be empty.";
}
}
if ($message) {
new SystemMessage($message);
forward("editProfile");
}
foreach ($fields as $key => $field) {
$user->{$key} = getInput($key);
}
$user->save();
new Activity($user->guid, "activity:profile:updated", array($user->getURL(), $user->full_name));
new SystemMessage("Your profile has been updated.");
forward("profile/{$user->guid}");
}
示例2: denyDirect
* All Rights Reserved.
*
* NOTICE: All information contained herein is, and remains the property of SocialApparatus
* and its suppliers, if any. The intellectual and technical concepts contained herein
* are proprietary to SocialApparatus and its suppliers and may be covered by U.S. and Foreign
* Patents, patents in process, and are protected by trade secret or copyright law.
*
* Dissemination of this information or reproduction of this material is strictly forbidden
* unless prior written permission is obtained from SocialApparatus.
*
* Contact Shane Barron admin@socia.us for more information.
*/
namespace SocialApparatus;
denyDirect();
$user = getLoggedInUser();
$user_type = isset($user->profile_type) ? $user->profile_type : "default";
$fields = ProfileField::get($user_type);
if ($fields) {
foreach ($fields as $key => $field) {
$fieldname = $key;
$value = isset($user->{$fieldname}) ? $user->{$fieldname} : "";
if ($value && $field['field_type'] == "date") {
$value = date("m/d/Y", $value);
}
$options = isset($field['options']) ? $field['options'] : "";
$class = isset($field['class']) ? $field['class'] : "form-control";
echo display("input/" . $field['field_type'], array("name" => $key, "value" => $value, "label" => $field['label'], "options_values" => $options, "class" => $class));
}
}
echo display('input/submit', array('label' => 'Save', "class" => "btn btn-success", "cancel" => true));
示例3: getLoggedInUserGuid
if (loggedIn()) {
$guid = getLoggedInUserGuid();
$owner = getLoggedInUser();
}
}
}
$url = getSiteURL();
$profile_info_editor = NULL;
$profile_info = NULL;
$truncate = NULL;
$profile_type = $owner->profile_type;
if (!$profile_type) {
$profile_type = "default";
}
$avatar = $owner->icon(LARGE);
$profile_fields = ProfileField::get($profile_type);
$status = $owner->status ? "<div class='well well-sm'>{$owner->status}</div>" : "";
foreach ($profile_fields as $name => $values) {
$field_type = $values['field_type'];
$footer = NULL;
$label = $values['label'];
$value = $owner->{$name};
if ($value) {
if ($values['field_type'] != "textarea" && $values['field_type'] != 'editor' && $values['field_type'] != 'hidden') {
$value_text = display("output/{$field_type}", array("value" => $value, "label" => $label));
$profile_info .= <<<HTML
<tr>
<td>{$value_text}</td>
</tr>
HTML;
} elseif ($values['field_type'] != "hidden") {