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


PHP AppletInstance::getDropZoneUrl方法代码示例

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


在下文中一共展示了AppletInstance::getDropZoneUrl方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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: foreach

                    $user = VBX_User::get($user->user_id);
                    foreach ($user->devices as $device) {
                        if ($sender == $device->value) {
                            $dispatch = true;
                        }
                    }
                }
        }
    }
}
$response = new TwimlResponse();
if ($dispatch) {
    $subscribers = $ci->db->query(sprintf('SELECT value FROM subscribers WHERE list = %d', $list))->result();
    require_once APPPATH . 'libraries/Services/Twilio.php';
    $service = new Services_Twilio($ci->twilio_sid, $ci->twilio_token);
    if ($body && count($subscribers)) {
        foreach ($subscribers as $subscriber) {
            $service->account->sms_messages->create($number, $subscriber->value, $body);
        }
    }
    $dispatched = AppletInstance::getDropZoneUrl('dispatched');
    if (!empty($dispatched)) {
        $response->redirect($dispatched);
    }
} else {
    $next = AppletInstance::getDropZoneUrl('next');
    if (!empty($next)) {
        $response->redirect($next);
    }
}
$response->respond();
开发者ID:rodrigotanco,项目名称:OpenVBX-Plugin-Subscriptions,代码行数:31,代码来源:twiml.php

示例4: dirname

<?php

require_once dirname(__FILE__) . '/../../lib/dopplr.php';
$user = OpenVBX::getCurrentUser();
$dopplr_token = PluginData::get("dopplr_token_{$user->id}", "");
$dopplr = new Dopplr($dopplr_token);
$response = new Response();
$response->addSay($dopplr->timezone());
$response->addRedirect(AppletInstance::getDropZoneUrl('next'));
$response->Respond();
开发者ID:johndbritton,项目名称:DopplrVBX,代码行数:10,代码来源:twiml.php

示例5: TwimlResponse

<?php

$response = new TwimlResponse();
$now = date_create('now');
$today = date_format($now, 'N') - 1;
/**
 * The names of the applet instance variables for "from" and "to" times
 * are of the form: "range_n_from" and "range_n_to" where "n"
 * is a value between 0 and 6 (inclusive). 0 represents Monday
 * and 6 represents Sunday. In PHP, the value of date_format($now, 'w')
 * for Sunday is 0 - for Monday the value is 1 - and so on.
 * Here, we need to compensate for this by checking to see if the value
 * of date_format($now, 'w') - 1 is -1, and, if so, bring Sunday
 * back into the valid range of values by setting $today to 6.
 */
if ($today == -1) {
    $today = 6;
}
$response->redirect(AppletInstance::getDropZoneUrl(($from = AppletInstance::getValue("range_{$today}_from")) && ($to = AppletInstance::getValue("range_{$today}_to")) && date_create($from) <= $now && $now < date_create($to) ? 'open' : 'closed'));
$response->respond();
开发者ID:hharrysidhu,项目名称:OpenVBX,代码行数:20,代码来源:twiml.php

示例6: Response

$response = new Response();
$fallback = AppletInstance::getDropZoneUrl('fallback');
$choices = AppletInstance::getValue('choices[]');
$start = AppletInstance::getValue('timestart[]');
$finish = AppletInstance::getValue('timefinish[]');
$ci_timezone = AppletInstance::getValue('timezones');
$ci =& get_instance();
$choice_array = array();
if (count($start) == 1) {
    $new_start = array(0 => $start);
    $start = $new_start;
    $new_finish = array(0 => $finish);
    $finish = $new_finish;
}
foreach ($choices as $a => $q) {
    $choice_array[$a] = AppletInstance::getDropZoneUrl('choices[' . $a . ']');
}
function verify_day($key, $today)
{
    $sunday = AppletInstance::getValue('sunday[]');
    $monday = AppletInstance::getValue('monday[]');
    $tuesday = AppletInstance::getValue('tuesday[]');
    $wednesday = AppletInstance::getValue('wednesday[]');
    $thursday = AppletInstance::getValue('thursday[]');
    $friday = AppletInstance::getValue('friday[]');
    $saturday = AppletInstance::getValue('saturday[]');
    $days = array(0 => is_array($sunday) && array_key_exists($key, $sunday) ? $sunday[$key] : $sunday, 1 => is_array($monday) && array_key_exists($key, $monday) ? $monday[$key] : $monday, 2 => is_array($tuesday) && array_key_exists($key, $tuesday) ? $tuesday[$key] : $tuesday, 3 => is_array($wednesday) && array_key_exists($key, $wednesday) ? $wednesday[$key] : $wednesday, 4 => is_array($thursday) && array_key_exists($key, $thursday) ? $thursday[$key] : $thursday, 5 => is_array($friday) && array_key_exists($key, $friday) ? $friday[$key] : $friday, 6 => is_array($saturday) && array_key_exists($key, $saturday) ? $saturday[$key] : $saturday);
    return $days[$today];
}
function verify_time($currentTime, $startTime, $endTime)
{
开发者ID:e6,项目名称:OpenVBX-Plugin-Scheduling,代码行数:31,代码来源:twiml.php

示例7: get_instance

<?php

$ci =& get_instance();
$list = AppletInstance::getValue('list');
if (!empty($_REQUEST['From'])) {
    $number = normalize_phone_to_E164($_REQUEST['From']);
    $subscriber = $ci->db->query(sprintf('SELECT id FROM subscribers WHERE list = %d AND value = %s', $list, $number))->num_rows() > 0;
    $next = AppletInstance::getDropZoneUrl($subscriber ? 'pass' : 'fail');
}
$response = new TwimlResponse();
if (!empty($next)) {
    $response->redirect($next);
}
$response->respond();
开发者ID:rodrigotanco,项目名称:OpenVBX-Plugin-Subscriptions,代码行数:14,代码来源:twiml.php

示例8: curlWrap

    $response = curlWrap("/tickets.json", json_encode(array("ticket" => array("subject" => "New Phone Call From " . $phone, "comment" => array("body" => "Call made at " . date('r')), "requester_id" => $response['user']['id']))), "POST");
} else {
    if ($response['count'] > 0) {
        function filterAnon($elem)
        {
            $bool = strpos($elem['name'], "Unknown") === false && strpos($elem['name'], "Anonymous") === false;
            return $bool;
        }
        //filter out unknown and anonymous users
        $known = array_values(array_filter($response['results'], 'filterAnon'));
        if (sizeof($known) > 0) {
            //new ticket with known user as requestor
            $knownUser = $known[0];
            $response = curlWrap("/tickets.json", json_encode(array("ticket" => array("subject" => "New Phone Call From " . $knownUser['name'] . " | " . $phone, "comment" => array("body" => "Call came in at " . date('r')), "requester_id" => $knownUser['id']))), "POST");
        } else {
            //new ticket with existing unknown user as requestor
            $response = curlWrap("/tickets.json", json_encode(array("ticket" => array("subject" => "New Phone Call From " . $phone, "comment" => array("body" => "Call came in at " . date('r')), "requester_id" => $response['results'][0]['id']))), "POST");
        }
    }
}
// openvbx code below
// $primary is getting the url created by what ever applet was put
// into the primary dropzone
$primary = AppletInstance::getDropZoneUrl('primary');
// As long as the primary dropzone is not empty add the redirect
// twiml to $response
if (!empty($primary)) {
    $tResponse->redirect($primary);
}
// This will create the twiml for hellomonkey
$tResponse->respond();
开发者ID:madamkirsty,项目名称:openvbx-zendesk-applet,代码行数:31,代码来源:twiml.php

示例9: setcookie

        Stripe::setApiKey($settings['api_key']);
        try {
            $charge = Stripe_Charge::create(array('card' => $state['card'], 'amount' => $amount, 'currency' => 'usd', 'description' => $description));
            if ($charge->paid && true === $charge->paid) {
                setcookie(STRIPE_COOKIE);
                $next = AppletInstance::getDropZoneUrl('success');
                if (!empty($next)) {
                    $response->redirect($next);
                }
                $response->respond();
                die;
            }
        } catch (Exception $e) {
            $error = $e->getCode();
            $response->addSay($e->getMessage());
            if (array_key_exists($error, $card_errors)) {
                $state[STRIPE_ACTION] = $card_errors[$error];
                $response->redirect();
            } else {
                setcookie(STRIPE_COOKIE);
                $next = AppletInstance::getDropZoneUrl('fail');
                if (!empty($next)) {
                    $response->redirect($next);
                }
                $response->respond();
                die;
            }
        }
}
setcookie(STRIPE_COOKIE, json_encode($state), time() + 5 * 60);
$response->respond();
开发者ID:HighTechTorres,项目名称:TwilioCookbook,代码行数:31,代码来源:twiml.php

示例10: Response

<?php

$response = new Response();
$url = AppletInstance::getValue('url');
$next = AppletInstance::getDropZoneUrl('next');
$fallback = AppletInstance::getDropZoneUrl('fallback');
$curl_handle = curl_init();
curl_setopt($curl_handle, CURLOPT_URL, $url);
curl_setopt($curl_handle, CURLOPT_CONNECTTIMEOUT, 2);
curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($curl_handle);
curl_close($curl_handle);
if (empty($result)) {
    $response->addSay('that didnt work');
    $response->addRedirect($fallback);
    $response->Respond();
} else {
    $response->addSay($result);
    $response->addRedirect($next);
    $response->Respond();
}
开发者ID:kressaty,项目名称:OpenVBX-Plugin-Curling,代码行数:21,代码来源:twiml.php

示例11: isset

<?php

$body = isset($_REQUEST['Body']) ? trim($_REQUEST['Body']) : null;
$keys = (array) AppletInstance::getValue('keys[]');
$responses = (array) AppletInstance::getDropZoneUrl('responses[]');
$menu_items = AppletInstance::assocKeyValueCombine($keys, $responses);
$next = AppletInstance::getDropZoneUrl('invalid-option');
$response = new TwimlResponse();
foreach ($menu_items as $regex => $redirect) {
    if (!empty($regex) && preg_match("/" . $regex . "/i", $body)) {
        $next = $redirect;
        break;
    }
}
if (!empty($next)) {
    $response->redirect($next);
}
$response->respond();
开发者ID:mymizan,项目名称:OpenVBX-Plugin-Match,代码行数:18,代码来源:twiml.php

示例12: TwimlResponse

<?php

require_once __DIR__ . '/functions.php';
$duration = AppletInstance::getValue('duration');
$enabled = AppletInstance::getValue('enabled');
$instance_id = AppletInstance::getInstanceId();
$limit = AppletInstance::getValue('limit');
$blocked_applet = AppletInstance::getDropZoneUrl('blocked');
$unblocked_applet = AppletInstance::getDropZoneUrl('unblocked');
//$flow_type = AppletInstance::getFlowType();
$response = new TwimlResponse();
if (limit_exceeded($duration, $enabled, $instance_id, $limit)) {
    //number over limit
    $response->redirect($blocked_applet);
} else {
    //number within limit
    $response->redirect($unblocked_applet);
}
$response->respond();
开发者ID:mymizan,项目名称:OpenVBX-Plugin-Throttle,代码行数:19,代码来源:twiml.php

示例13: 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

示例14: Response

<?php

$response = new Response();
/* Fetch all the data to operate the menu */
$digits = isset($_REQUEST['Digits']) ? $_REQUEST['Digits'] : false;
$prompt = AppletInstance::getAudioSpeechPickerValue('prompt');
$invalid_option = AppletInstance::getAudioSpeechPickerValue('invalid-option');
$repeat_count = AppletInstance::getValue('repeat-count', 3);
$next = AppletInstance::getDropZoneUrl('next');
$selected_item = false;
/* Build Menu Items */
$choices = (array) AppletInstance::getDropZoneUrl('choices[]');
$keys = (array) AppletInstance::getDropZoneValue('keys[]');
$menu_items = AppletInstance::assocKeyValueCombine($keys, $choices);
$numDigits = 1;
foreach ($keys as $key) {
    if (strlen($key) > $numDigits) {
        $numDigits = strlen($key);
    }
}
if ($digits !== false) {
    if (!empty($menu_items[$digits])) {
        $selected_item = $menu_items[$digits];
    } else {
        if ($invalid_option) {
            $verb = AudioSpeechPickerWidget::getVerbForValue($invalid_option, null);
            $response->append($verb);
            $response->addRedirect();
        } else {
            $response->addSay('You selected an incorrect option.');
            $response->addRedirect();
开发者ID:JeffaCubed,项目名称:OpenVBX,代码行数:31,代码来源:twiml.php

示例15: define

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) {
                if ($device->is_active == 1) {
                    $numbers[] = $device->value;
                }
            }
            $voicemail = $dial_whom_user_or_group->voicemail;
开发者ID:benrasmusen,项目名称:OpenVBX,代码行数:31,代码来源:twiml.php


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