Exemplo n.º 1
0
	public function add($at, $args, $pkg = false) {
		$ak = parent::add('file', $at, $args, $pkg);
		return $ak;
	}
Exemplo n.º 2
0
 public function add($at, $args, $pkg = false)
 {
     // legacy check
     $fargs = func_get_args();
     if (count($fargs) >= 5) {
         $at = $fargs[4];
         $pkg = false;
         $args = array('akHandle' => $fargs[0], 'akName' => $fargs[1], 'akIsSearchable' => $fargs[2]);
     }
     $ak = parent::add('collection', $at, $args, $pkg);
     return $ak;
 }
Exemplo n.º 3
0
	public function add($at, $args, $pkg = false) {

		// legacy check
		$fargs = func_get_args();
		if (count($fargs) >= 5) {
			$at = $fargs[4];
			$pkg = false;
			$args = array('akHandle' => $fargs[0], 'akName' => $fargs[1], 'akIsSearchable' => $fargs[2]);
		}

		CacheLocal::delete('collection_attribute_key_by_handle', $args['akHandle']);

		$ak = parent::add('collection', $at, $args, $pkg);
		return $ak;
	}
Exemplo n.º 4
0
 public function add($type, $args, $pkg = false)
 {
     CacheLocal::delete('user_attribute_key_by_handle', $args['akHandle']);
     $ak = parent::add('user', $type, $args, $pkg);
     extract($args);
     if ($uakProfileDisplay != 1) {
         $uakProfileDisplay = 0;
     }
     if ($uakMemberListDisplay != 1) {
         $uakMemberListDisplay = 0;
     }
     if ($uakProfileEdit != 1) {
         $uakProfileEdit = 0;
     }
     if ($uakProfileEditRequired != 1) {
         $uakProfileEditRequired = 0;
     }
     if ($uakRegisterEdit != 1) {
         $uakRegisterEdit = 0;
     }
     if ($uakRegisterEditRequired != 1) {
         $uakRegisterEditRequired = 0;
     }
     if (isset($uakIsActive) && !$uakIsActive) {
         $uakIsActive = 0;
     } else {
         $uakIsActive = 1;
     }
     $db = Loader::db();
     $displayOrder = $db->GetOne('select max(displayOrder) from UserAttributeKeys');
     if (!$displayOrder) {
         $displayOrder = 0;
     }
     $displayOrder++;
     $v = array($ak->getAttributeKeyID(), $uakProfileDisplay, $uakMemberListDisplay, $uakProfileEdit, $uakProfileEditRequired, $uakRegisterEdit, $uakRegisterEditRequired, $displayOrder, $uakIsActive);
     $db->Execute('insert into UserAttributeKeys (akID, uakProfileDisplay, uakMemberListDisplay, uakProfileEdit, uakProfileEditRequired, uakRegisterEdit, uakRegisterEditRequired, displayOrder, uakIsActive) values (?, ?, ?, ?, ?, ?, ?, ?, ?)', $v);
     $nak = new UserAttributeKey();
     $nak->load($ak->getAttributeKeyID());
     return $nak;
 }
Exemplo n.º 5
0
 public function add($at, $args, $pkg = false)
 {
     CacheLocal::delete('file_attribute_key_by_handle', $args['akHandle']);
     $ak = parent::add('file', $at, $args, $pkg);
     return $ak;
 }