本文整理汇总了PHP中FreePBX::Contactmanager方法的典型用法代码示例。如果您正苦于以下问题:PHP FreePBX::Contactmanager方法的具体用法?PHP FreePBX::Contactmanager怎么用?PHP FreePBX::Contactmanager使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FreePBX
的用法示例。
在下文中一共展示了FreePBX::Contactmanager方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: contactmanager_getdestinfo
function contactmanager_getdestinfo($dest)
{
if (substr(trim($dest), 0, 19) == 'ext-contactmanager,') {
$exten = explode(',', $dest);
$exten = $exten[1];
$cm = \FreePBX::Contactmanager();
$entries = $cm->getContactsByUserID(-1);
$destinations = array();
foreach ($entries as $entry) {
$name = !empty($entry['displayname']) ? $entry['displayname'] : $entry['fname'] . " " . $entry['lname'];
if (!empty($entry['numbers'])) {
foreach ($entry['numbers'] as $type => $number) {
if ($number == $exten) {
switch ($entry['type']) {
case "internal":
case "external":
return array('description' => sprintf(_("Contact Manager: %s"), $name . "(" . $type . ")"), 'edit_url' => 'config.php?display=contactmanager&action=showentry&group=' . urlencode($entry['groupid']) . '&entry=' . urlencode($entry['uid']));
break;
case "userman":
return array('description' => sprintf(_("Contact Manager: %s"), $name . "(" . $type . ")"), 'edit_url' => 'display=userman&action=showuser&user=' . urlencode($entry['id']));
break;
}
break;
}
}
}
}
return array();
} else {
return false;
}
/*
global $active_modules;
if (substr(trim($dest),0,14) == 'ext-miscdests,') {
$exten = explode(',',$dest);
$exten = $exten[1];
$thisexten = miscdests_get($exten);
if (empty($thisexten)) {
return array();
} else {
//$type = isset($active_modules['announcement']['type'])?$active_modules['announcement']['type']:'setup';
return array('description' => sprintf(_("Misc Destination: %s"),$thisexten['description']),
'edit_url' => 'config.php?display=miscdests&id='.urlencode($exten),
);
}
} else {
return false;
}
*/
}
示例2:
<?php
// License for all code of this FreePBX module can be found in the license file inside the module directory
// Copyright 2013 Schmooze Com Inc.
//
$contactmanager = FreePBX::Contactmanager();
echo $contactmanager->myShowPage();