當前位置: 首頁>>代碼示例>>PHP>>正文


PHP FreePBX::Contactmanager方法代碼示例

本文整理匯總了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;
    }
    */
}
開發者ID:ringfreejohn,項目名稱:pbxframework,代碼行數:51,代碼來源:functions.inc.php

示例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();
開發者ID:ringfreejohn,項目名稱:pbxframework,代碼行數:7,代碼來源:page.contactmanager.php


注:本文中的FreePBX::Contactmanager方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。