当前位置: 首页>>代码示例>>PHP>>正文


PHP UserAttributeKey::get方法代码示例

本文整理汇总了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;
		}
	}
开发者ID:ronlobo,项目名称:concrete5,代码行数:29,代码来源:search.php

示例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];
开发者ID:ricardomccerqueira,项目名称:rcerqueira.portfolio,代码行数:31,代码来源:bulk_properties.php

示例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;
     }
 }
开发者ID:VonUniGE,项目名称:concrete5-1,代码行数:22,代码来源:search.php


注:本文中的UserAttributeKey::get方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。