<?php $ci =& get_instance(); $user_id = $ci->session->userdata('user_id'); $foursquare_username = PluginStore::get("foursquare_username_{$user_id}", ""); $foursquare_password = PluginStore::get("foursquare_password_{$user_id}", ""); if (isset($_REQUEST['savebutton'])) { PluginStore::set("foursquare_username_{$user_id}", $_REQUEST['username']); PluginStore::set("foursquare_password_{$user_id}", $_REQUEST['password']); $foursquare_username = $_REQUEST['username']; $foursquare_password = $_REQUEST['password']; } ?> <div class="vbx-content-main"> <?php $store = PluginStore::getKeyValues(); ?> <div class="vbx-content-menu vbx-content-menu-top"> <h2 class="vbx-content-heading">FourSquare Account</h2> </div> <div class="vbx-content-container"> <div class="vbx-content-section"> <h3>Store Your Credentials</h3> <form action="" class="vbx-form"> <div class="vbx-input-container"> <label class="field-label">Username <input name="username" size="30" value="<?php echo $foursquare_username; ?>
<?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();
<?php /* ajax.php this file is polled to feed incoming call data to the dashboard return call data as a json array */ $intelCalls = (array) PluginStore::get('IntelCalls', array()); $toShow = isset($_REQUEST['toShow']) ? $_REQUEST['toShow'] : ''; if ($toShow == "") { // return all calls $toReturn = $intelCalls; } else { // return all calls more recent than the specified time $toReturn = array(); foreach ($intelCalls as $call) { if ($call->time > $toShow) { array_push($toReturn, $call); } } } //header('Content-type: application/json'); ?> <?php echo json_encode($toReturn);