本文整理汇总了PHP中CContact::loadFull方法的典型用法代码示例。如果您正苦于以下问题:PHP CContact::loadFull方法的具体用法?PHP CContact::loadFull怎么用?PHP CContact::loadFull使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CContact
的用法示例。
在下文中一共展示了CContact::loadFull方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: die
<?php
/* $Id$ $URL$ */
if (!defined('W2P_BASE_DIR')) {
die('You should not access this file directly.');
}
// get GETPARAMETER for contact_id
$contact_id = (int) w2PgetParam($_GET, 'contact_id', 0);
$canRead = $perms->checkModule('contacts', 'view');
if (!$canRead) {
$AppUI->redirect('m=public&a=access_denied');
}
if ($contact_id) {
$contact = new CContact();
$contact->loadFull($AppUI, $contact_id);
// include PEAR vCard class
require_once $AppUI->getLibraryClass('PEAR/Contact_Vcard_Build');
// instantiate a builder object
// (defaults to version 3.0)
$vcard = new Contact_Vcard_Build();
// set a formatted name
$vcard->setFormattedName($contact->contact_first_name . ' ' . $contact->contact_last_name);
// set the structured name parts
$vcard->setName($contact->contact_last_name, $contact->contact_first_name, $contact->contact_type, $contact->contact_title, '');
// set the source of the vCard
$vcard->setSource($w2Pconfig['company_name'] . ' ' . $w2Pconfig['page_title'] . ': ' . $w2Pconfig['site_domain']);
// set the birthday of the contact
$vcard->setBirthday($contact->contact_birthday);
// set a note of the contact
$contact->contact_notes = mb_str_replace("\r", ' ', $contact->contact_notes);
$vcard->setNote($contact->contact_notes);
示例2: die
<?php
if (!defined('W2P_BASE_DIR')) {
die('You should not access this file directly.');
}
// @todo convert to template
// get GETPARAMETER for contact_id
$contact_id = (int) w2PgetParam($_GET, 'contact_id', 0);
$canRead = canView('contacts');
if (!$canRead) {
$AppUI->redirect(ACCESS_DENIED);
}
if ($contact_id) {
$contact = new CContact();
$contact->loadFull(null, $contact_id);
$contactMethods = $contact->getContactMethods();
// instantiate a builder object
// (defaults to version 3.0)
$vcard = new Contact_Vcard_Build();
// set a formatted name
$vcard->setFormattedName($contact->contact_display_name);
// set the structured name parts
$vcard->setName($contact->contact_last_name, $contact->contact_first_name, $contact->contact_type, $contact->contact_title, '');
// set the source of the vCard
$vcard->setSource($w2Pconfig['company_name'] . ' ' . $w2Pconfig['page_title'] . ': ' . $w2Pconfig['site_domain']);
// set the birthday of the contact
$vcard->setBirthday($contact->contact_birthday);
// set a note of the contact
$contact->contact_notes = mb_str_replace("\r", ' ', $contact->contact_notes);
$vcard->setNote($contact->contact_notes);
// add an organization