当前位置: 首页>>代码示例>>PHP>>正文


PHP AppletInstance::getUserGroupPickerValue方法代码示例

本文整理汇总了PHP中AppletInstance::getUserGroupPickerValue方法的典型用法代码示例。如果您正苦于以下问题:PHP AppletInstance::getUserGroupPickerValue方法的具体用法?PHP AppletInstance::getUserGroupPickerValue怎么用?PHP AppletInstance::getUserGroupPickerValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在AppletInstance的用法示例。


在下文中一共展示了AppletInstance::getUserGroupPickerValue方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __construct

 public function __construct($settings = array())
 {
     $this->response = new TwimlResponse();
     $this->cookie_name = 'state-' . AppletInstance::getInstanceId();
     $this->version = AppletInstance::getValue('version', null);
     $this->callerId = AppletInstance::getValue('callerId', null);
     if (empty($this->callerId) && !empty($_REQUEST['From'])) {
         $this->callerId = $_REQUEST['From'];
     }
     /* Get current instance	 */
     $this->dial_whom_selector = AppletInstance::getValue('dial-whom-selector');
     $this->dial_whom_user_or_group = AppletInstance::getUserGroupPickerValue('dial-whom-user-or-group');
     $this->dial_whom_number = AppletInstance::getValue('dial-whom-number');
     $this->no_answer_action = AppletInstance::getValue('no-answer-action', 'hangup');
     $this->no_answer_group_voicemail = AppletInstance::getAudioSpeechPickerValue('no-answer-group-voicemail');
     $this->no_answer_redirect = AppletInstance::getDropZoneUrl('no-answer-redirect');
     $this->no_answer_redirect_number = AppletInstance::getDropZoneUrl('no-answer-redirect-number');
     $this->dial_whom_instance = get_class($this->dial_whom_user_or_group);
     if (count($settings)) {
         foreach ($settings as $setting => $value) {
             if (isset($this->{$setting})) {
                 $this->{$setting} = $value;
             }
         }
     }
 }
开发者ID:ryanlarrabure,项目名称:OpenVBX,代码行数:26,代码来源:TwimlDial.php

示例2: __construct

 public function __construct()
 {
     $this->response = new Response();
     $this->cookie_name = 'state-' . AppletInstance::getInstanceId();
     $this->version = AppletInstance::getValue('version', null);
     $this->callerId = AppletInstance::getValue('callerId', null);
     if (empty($this->callerId)) {
         $this->callerId = $_REQUEST['From'];
     }
     /* Get current instance	 */
     $this->dial_whom_selector = AppletInstance::getValue('dial-whom-selector');
     $this->dial_whom_user_or_group = AppletInstance::getUserGroupPickerValue('dial-whom-user-or-group');
     $this->dial_whom_number = AppletInstance::getValue('dial-whom-number');
     $this->no_answer_action = AppletInstance::getValue('no-answer-action', 'hangup');
     $this->no_answer_group_voicemail = AppletInstance::getAudioSpeechPickerValue('no-answer-group-voicemail');
     $this->no_answer_redirect = AppletInstance::getDropZoneUrl('no-answer-redirect');
     $this->no_answer_redirect_number = AppletInstance::getDropZoneUrl('no-answer-redirect-number');
 }
开发者ID:JeffaCubed,项目名称:OpenVBX,代码行数:18,代码来源:TwimlDial.php

示例3:

<?php

// get the current owner (user or group) to decide if we should show the Prompt area on load
$currentlyIsUser = AppletInstance::getUserGroupPickerValue('permissions') instanceof VBX_User;
?>

<div class="vbx-applet voicemail-applet">

		<div class="prompt-for-group" style="display: <?php 
echo $currentlyIsUser ? "none" : "";
?>
">
			<h2>Prompt</h2>
			<p>What will the caller hear before leaving their message?</p>
			<?php 
echo AppletUI::AudioSpeechPicker('prompt');
?>
		</div>
		
		<div class="prompt-for-individual" style="display: <?php 
echo !$currentlyIsUser ? "none" : "";
?>
">
			<h2>Prompt</h2>
			
			<div class="vbx-full-pane">
				<fieldset class="vbx-input-container">
					The individual's personal voicemail greeting will be played.
				</fieldset>
			</div>
		</div>
开发者ID:hharrysidhu,项目名称:OpenVBX,代码行数:31,代码来源:ui.php

示例4: header

<?php

header("Content-type: text/xml\n");
error_reporting(E_NONE);
include "chirbit.php";
$user = AppletInstance::getUserGroupPickerValue('chirbit-controller');
$user_id = $user->values["id"];
$chirbit_username = PluginStore::get("chirbit_username_{$user_id}", "");
$chirbit_password = PluginStore::get("chirbit_password_{$user_id}", "");
$prompt = AppletInstance::getAudioSpeechPickerValue('prompt');
$after = AppletInstance::getAudioSpeechPickerValue('after');
$title = AppletInstance::getValue("title", "");
$response = new Response();
if (isset($_REQUEST['RecordingUrl'])) {
    chirbit_post($chirbit_username, $chirbit_password, $_REQUEST['RecordingUrl'], $title);
    $verb = AudioSpeechPickerWidget::getVerbForValue($after, null);
    $response->append($verb);
    $response->addHangup();
} else {
    $verb = AudioSpeechPickerWidget::getVerbForValue($prompt, null);
    $response->append($verb);
    $response->addRecord();
}
$response->Respond();
开发者ID:andrewwatson,项目名称:Chirbit-VBX-Plugin,代码行数:24,代码来源:twiml.php

示例5: define

define('DIAL_ACTION', 'dialAction');
define('DIAL_COOKIE', 'state-' . AppletInstance::getInstanceId());
/* States */
define('DIAL_STATE_DIAL', 'dialStateDial');
define('DIAL_STATE_NO_ANSWER', 'dialStateNoAnswer');
define('DIAL_STATE_RECORDING', 'dialStateRecording');
define('DIAL_STATE_HANGUP', 'dialStateHangup');
$response = new Response();
// Default State
$state = array();
$state[DIAL_ACTION] = DIAL_STATE_DIAL;
$state[DIAL_NUMBER_INDEX] = 0;
$version = AppletInstance::getValue('version', null);
/* Get current instance	 */
$dial_whom_selector = AppletInstance::getValue('dial-whom-selector');
$dial_whom_user_or_group = AppletInstance::getUserGroupPickerValue('dial-whom-user-or-group');
$dial_whom_number = AppletInstance::getValue('dial-whom-number');
$no_answer_action = AppletInstance::getValue('no-answer-action', 'hangup');
$no_answer_group_voicemail = AppletInstance::getAudioSpeechPickerValue('no-answer-group-voicemail');
$no_answer_redirect = AppletInstance::getDropZoneUrl('no-answer-redirect');
$no_answer_redirect_number = AppletInstance::getDropZoneUrl('no-answer-redirect-number');
$numbers = array();
$voicemail = null;
if ($dial_whom_selector === 'user-or-group') {
    $dial_whom_instance = null;
    if (is_object($dial_whom_user_or_group)) {
        $dial_whom_instance = get_class($dial_whom_user_or_group);
    }
    switch ($dial_whom_instance) {
        case 'VBX_User':
            foreach ($dial_whom_user_or_group->devices as $device) {
开发者ID:benrasmusen,项目名称:OpenVBX,代码行数:31,代码来源:twiml.php

示例6: userGroupPicker

 public static function userGroupPicker($name = 'userGroupPicker', $label = 'Select a User or Group')
 {
     $value = AppletInstance::getUserGroupPickerValue($name);
     $widget = new UserGroupPickerWidget($name, $label, $value);
     return $widget->render();
 }
开发者ID:howethomas,项目名称:OpenVBX,代码行数:6,代码来源:AppletUI.php

示例7: array

} else {
    if ($status == 'transcribe-call') {
        $zendesk_user = $CI->db->get_where('plugin_store', array('key' => 'zendesk_user'))->row();
        $zendesk_user = json_decode($zendesk_user->value);
        define('ZENDESK_URL', $zendesk_user->url);
        define('ZENDESK_EMAIL', $zendesk_user->email);
        define('ZENDESK_PASSWORD', $zendesk_user->password);
        define('ZENDESK_TIMEZONE', (int) $zendesk_user->timezone);
        // create a ticket to zendesk
        $xml = '<ticket>' . '<subject>Phone Call from ' . format_phone($_REQUEST['Caller']) . ' on ' . gmdate('M d g:i a', gmmktime() + ZENDESK_TIMEZONE * 60 * 60) . '</subject>' . '<description>' . $_REQUEST['TranscriptionText'] . "\n" . 'Recording: ' . $_REQUEST['RecordingUrl'] . '</description>' . '</ticket>';
        $new_ticket = zendesk_client('/tickets.xml', 'POST', $xml);
        $params = http_build_query($_REQUEST);
        $redirect_url = site_url('twiml/transcribe') . '?' . $params;
        header("Location: {$redirect_url}");
    } else {
        $permissions = AppletInstance::getUserGroupPickerValue('permissions');
        // get the prompt that the user configured
        $isUser = $permissions instanceof VBX_User ? TRUE : FALSE;
        if ($isUser) {
            $prompt = $permissions->voicemail;
        } else {
            $prompt = AppletInstance::getAudioSpeechPickerValue('prompt');
        }
        $verb = AudioSpeechPickerWidget::getVerbForValue($prompt, new Say("Please leave a message."));
        $response->append($verb);
        // add a <Record>, and use VBX's default transcription handle$response->addRecord(array('transcribe'=>'TRUE', 'transcribeCallback' => site_url('/twiml/transcribe') ));
        $action_url = base_url() . "twiml/applet/voice/{$flow_id}/{$instance_id}?status=save-call";
        $transcribe_url = base_url() . "twiml/applet/voice/{$flow_id}/{$instance_id}?status=transcribe-call";
        $response->addRecord(array('transcribe' => 'TRUE', 'action' => $action_url, 'transcribeCallback' => $transcribe_url));
    }
}
开发者ID:stevenyan,项目名称:Zendesk-VBX,代码行数:31,代码来源:twiml.php

示例8: get_instance

<?php

$ci =& get_instance();
$dispatcher = AppletInstance::getUserGroupPickerValue('dispatcher');
$list = AppletInstance::getValue('list');
$dispatch = false;
if (!empty($_REQUEST['From'])) {
    $sender = normalize_phone_to_E164($_REQUEST['From']);
    $number = normalize_phone_to_E164($_REQUEST['To']);
    $body = $_REQUEST['Body'];
    if (is_null($dispatcher)) {
        $dispatch = true;
    } else {
        switch (get_class($dispatcher)) {
            case 'VBX_User':
                foreach ($dispatcher->devices as $device) {
                    if ($sender == $device->value) {
                        $dispatch = true;
                    }
                }
                break;
            case 'VBX_Group':
                foreach ($dispatcher->users as $user) {
                    $user = VBX_User::get($user->user_id);
                    foreach ($user->devices as $device) {
                        if ($sender == $device->value) {
                            $dispatch = true;
                        }
                    }
                }
        }
开发者ID:rodrigotanco,项目名称:OpenVBX-Plugin-Subscriptions,代码行数:31,代码来源:twiml.php

示例9: get_instance

<?php

$ci =& get_instance();
$moderator = AppletInstance::getUserGroupPickerValue('moderator');
$confId = AppletInstance::getValue('conf-id');
$confName = AppletInstance::getInstanceId() . $confId;
$caller = normalize_phone_to_E164(isset($_REQUEST['From']) ? $ci->input->get_post('From') : '');
$isModerator = false;
$defaultWaitUrl = 'http://twimlets.com/holdmusic?Bucket=com.twilio.music.ambient';
$waitUrl = AppletInstance::getValue('wait-url', $defaultWaitUrl);
$record = AppletInstance::getValue('record', 'do-not-record');
$hasModerator = false;
if (!is_null($moderator)) {
    $hasModerator = true;
    switch (get_class($moderator)) {
        case 'VBX_User':
            foreach ($moderator->devices as $device) {
                if ($device->value == $caller) {
                    $isModerator = true;
                }
            }
            break;
        case 'VBX_Group':
            foreach ($moderator->users as $user) {
                $user = VBX_User::get($user->user_id);
                foreach ($user->devices as $device) {
                    if ($device->value == $caller) {
                        $isModerator = true;
                    }
                }
            }
开发者ID:wiserweb,项目名称:OpenVBX,代码行数:31,代码来源:twiml.php

示例10: Response

<?php

$response = new Response();
$forward = AppletInstance::getUserGroupPickerValue('forward');
$devices = array();
switch (get_class($forward)) {
    case 'VBX_User':
        foreach ($forward->devices as $device) {
            $devices[] = $device;
        }
        $voicemail = $forward->voicemail;
        break;
    case 'VBX_Group':
        foreach ($forward->users as $user) {
            $user = VBX_User::get($user->user_id);
            foreach ($user->devices as $device) {
                $devices[] = $device;
            }
        }
        $voicemail = $groupVoicemail;
        break;
    default:
        break;
}
$required_params = array('SmsSid', 'From', 'To', 'Body');
$sms_found = true;
foreach ($required_params as $param) {
    if (!in_array($param, array_keys($_REQUEST))) {
        $sms_found = false;
    }
}
开发者ID:joshgomez,项目名称:OpenVBX,代码行数:31,代码来源:twiml.php

示例11:

<?php

$version = AppletInstance::getValue('version', null);
if (AppletInstance::getValue('dial-whom-selector', 'user-or-group') === 'user-or-group') {
    $showVoicemailAction = true;
} else {
    $showVoicemailAction = false;
}
$userOrGroup = AppletInstance::getUserGroupPickerValue('dial-whom-user-or-group');
if ($userOrGroup instanceof VBX_Group) {
    $showGroupVoicemailPrompt = true;
} else {
    $showGroupVoicemailPrompt = false;
}
$dial_whom_selector = AppletInstance::getValue('dial-whom-selector', 'user-or-group');
$no_answer_action = AppletInstance::getValue('no-answer-action', 'voicemail');
?>
<div class="vbx-applet dial-applet">

	<h2>Dial Whom</h2>
	<div class="radio-table">
		<table>
			<tr class="radio-table-row first <?php 
echo $dial_whom_selector === 'user-or-group' ? 'on' : 'off';
?>
">
				<td class="radio-cell">
					<input type="radio" class='dial-whom-selector-radio' name="dial-whom-selector" value="user-or-group" <?php 
echo $dial_whom_selector === 'user-or-group' ? 'checked="checked"' : '';
?>
 />
开发者ID:joshgomez,项目名称:OpenVBX,代码行数:31,代码来源:ui.php

示例12: Response

<?php

include "foursquare_api.php";
$user = AppletInstance::getUserGroupPickerValue('4sq-venue-controller');
$user_id = $user->values["id"];
$foursquare_username = PluginStore::get("foursquare_username_{$user_id}", "");
$foursquare_password = PluginStore::get("foursquare_password_{$user_id}", "");
$default = AppletInstance::getDropZoneUrl('no-venue-default-action');
$response = new Response();
if (!empty($foursquare_username)) {
    $lastVenue = getLastVenue($foursquare_username, $foursquare_password);
    $venues = AppletInstance::getValue('venues[]');
    $venue_options = AppletInstance::getDropZoneUrl('venue-options[]');
    $found = false;
    if (is_array($keys)) {
        foreach ($venues as $id => $value) {
            if ($value == $lastVenue) {
                $response->addRedirect($venue_options[$id]);
                $found = true;
            }
        }
    }
    if (!$found) {
        $response->addRedirect($default);
    }
} else {
    $response->addRedirect($default);
}
$response->Respond();
开发者ID:andrewwatson,项目名称:FourSquare-VBX-Plugin,代码行数:29,代码来源:twiml.php


注:本文中的AppletInstance::getUserGroupPickerValue方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。