芝麻web文件管理V1.00
编辑当前文件:/home/pulsehostuk9/public_html/cloud.pulsehost.co.uk/modules/Contacts/Classes/ContactListItem.php
Id = null; $this->IdStr = null; $this->IdUser = null; $this->ETag = null; $this->IsGroup = false; $this->IsOrganization = false; $this->Name = ''; $this->Email = ''; $this->Emails = array(); $this->Phones = array(); $this->Frequency = 0; $this->UseFriendlyName = false; $this->Global = false; $this->ItsMe = false; $this->ReadOnly = false; $this->Auto = false; $this->ForSharedToAll = false; $this->SharedToAll = false; $this->Events = array(); $this->AgeScore = 1; $this->DateModified = 0; } /** * @param \Sabre\VObject\Component\VCard $oVCard */ public function InitBySabreCardDAVCard($oVCard) { if ($oVCard) { if ($oVCard->name == 'VCARD') { if (isset($oVCard->UID)) { $this->Id = (string)$oVCard->UID; $this->IdStr = $this->Id; } $this->IsGroup = false; if (isset($oVCard->FN)) { $this->Name = (string)$oVCard->FN; } if (isset($oVCard->EMAIL)) { /** @var \Sabre\VObject\Property\FlatText $oEmail */ $oEmail = $oVCard->EMAIL[0]; $this->Email = (string)$oEmail; foreach ($oVCard->EMAIL as $oEmail) { if ($oTypes = $oEmail['TYPE']) { if ($oTypes->has('PREF')) { $this->Email = (string)$oEmail; break; } } } } if (isset($oVCard->{'X-AFTERLOGIC-USE-FREQUENCY'})) { $this->Frequency = (int)$oVCard->{'X-AFTERLOGIC-USE-FREQUENCY'}; } $this->UseFriendlyName = true; if (isset($oVCard->{'X-AFTERLOGIC-USE-FRIENDLY-NAME'})) { $this->UseFriendlyName = '1' === (string)$oVCard->{'X-AFTERLOGIC-USE-FRIENDLY-NAME'}; } } } } /** * @param string $sRowType * @param array $aRow */ public function InitByLdapRowWithType($sRowType, $aRow) { if ($aRow) { switch ($sRowType) { case 'contact': $this->Id = $aRow['un'][0]; $this->IdStr = $this->Id; $this->IsGroup = false; $this->Name = (string) $aRow['cn'][0]; $this->Email = isset($aRow['mail'][0]) ? (string) $aRow['mail'][0] : (isset($aRow['homeemail'][0]) ? (string) $aRow['homeemail'][0] : ''); $this->Frequency = 0; $this->UseFriendlyName = true; break; case 'group': $this->Id = $aRow['un'][0]; $this->IdStr = $this->Id; $this->IsGroup = true; $this->Name = $aRow['cn'][0]; $this->Email = ''; $this->Frequency = 0; $this->UseFriendlyName = true; break; } } } /** * @return string */ public function ToString() { return ($this->UseFriendlyName && 0 < strlen(trim($this->Name)) && !$this->IsGroup) ? '"' . trim($this->Name) . '" <' . trim($this->Email) . '>' : (($this->IsGroup) ? trim($this->Name) : trim($this->Email)); } /** * @return string */ public function __toString() { return $this->ToString(); } }