本文整理汇总了PHP中UserAttributeKey::get方法的典型用法代码示例。如果您正苦于以下问题:PHP UserAttributeKey::get方法的具体用法?PHP UserAttributeKey::get怎么用?PHP UserAttributeKey::get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UserAttributeKey
的用法示例。
在下文中一共展示了UserAttributeKey::get方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: edit_attribute
public function edit_attribute() {
$uo = UserInfo::getByID($_POST['uID']);
$u = new User();
if ($uo->getUserID() == USER_SUPER_ID && (!$u->isSuperUser())) {
throw new Exception(t('Only the super user may edit this account.'));
}
$assignment = PermissionKey::getByHandle('edit_user_properties')->getMyAssignment();
$akID = $_REQUEST['uakID'];
if (!in_array($akID, $assignment->getAttributesAllowedArray())) {
throw new Exception(t('You do not have permission to modify this attribute.'));
}
$ak = UserAttributeKey::get($akID);
if ($_POST['task'] == 'update_extended_attribute') {
$ak->saveAttributeForm($uo);
$val = $uo->getAttributeValueObject($ak);
print $val->getValue('displaySanitized','display');
exit;
}
if ($_POST['task'] == 'clear_extended_attribute') {
$uo->clearAttribute($ak);
$val = $uo->getAttributeValueObject($ak);
print '<div class="ccm-attribute-field-none">' . t('None') . '</div>';
exit;
}
}
示例2: foreach
$fakID = $_REQUEST['fakID'];
$value = '';
$ak = UserAttributeKey::get($fakID);
foreach ($users as $ui) {
if ($ek->validate($ak)) {
$ak->saveAttributeForm($ui);
}
}
$val = $ui->getAttributeValueObject($ak);
print $val->getValue('display');
exit;
}
if ($_POST['task'] == 'clear_extended_attribute') {
$fakID = $_REQUEST['fakID'];
$value = '';
$ak = UserAttributeKey::get($fakID);
foreach ($users as $ui) {
if ($ek->validate($ak)) {
$ui->clearAttribute($ak);
}
}
print '<div class="ccm-attribute-field-none">' . t('None') . '</div>';
exit;
}
function printAttributeRow($ak, $ek)
{
global $users, $form;
$value = '';
for ($i = 0; $i < count($users); $i++) {
$lastValue = $value;
$ui = $users[$i];
示例3: edit_attribute
public function edit_attribute()
{
$uo = UserInfo::getByID($_POST['uID']);
$u = new User();
if ($uo->getUserID() == USER_SUPER_ID && !$u->isSuperUser()) {
throw new Exception(t('Only the super user may edit this account.'));
}
$akID = $_REQUEST['uakID'];
$ak = UserAttributeKey::get($akID);
if ($_POST['task'] == 'update_extended_attribute') {
$ak->saveAttributeForm($uo);
$val = $uo->getAttributeValueObject($ak);
print $val->getValue('displaySanitized', 'display');
exit;
}
if ($_POST['task'] == 'clear_extended_attribute') {
$uo->clearAttribute($ak);
$val = $uo->getAttributeValueObject($ak);
print '<div class="ccm-attribute-field-none">' . t('None') . '</div>';
exit;
}
}