本文整理汇总了PHP中OpenVBX::getCurrentUser方法的典型用法代码示例。如果您正苦于以下问题:PHP OpenVBX::getCurrentUser方法的具体用法?PHP OpenVBX::getCurrentUser怎么用?PHP OpenVBX::getCurrentUser使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OpenVBX
的用法示例。
在下文中一共展示了OpenVBX::getCurrentUser方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_greeting
private function get_greeting()
{
$user = OpenVBX::getCurrentUser();
$voicemail_value = $user->voicemail;
$json['mode'] = '';
$json['play'] = '';
$json['say'] = '';
if (!empty($voicemail_value)) {
if (preg_match('/^http/i', $voicemail_value) || preg_match('/^vbx-audio-upload/i', $voicemail_value)) {
$json['mode'] = 'play';
$json['play'] = $voicemail_value;
if (preg_match('/^vbx-audio-upload:\\/\\/(.*)/i', $voicemail_value, $matches)) {
// This is a locally hosted file, and we need to return the correct
// absolute URL for the file.
$json['play'] = real_site_url("audio-uploads/" . $matches[1]);
}
} else {
$json['mode'] = 'say';
$json['say'] = $voicemail_value;
}
}
$data['json'] = $json;
if ($this->response_type != 'json') {
return redirect('voicemail');
}
$this->respond('', 'voicemail/greeting', $data);
}
示例2: getClient
public function getClient()
{
$client = false;
foreach (OpenVBX::getCurrentUser()->devices as $device) {
if ('client:' == substr($device->value, 0, strlen('client:'))) {
$client = $device->value;
break;
}
}
if (!$client) {
throw new Exception('could not find client');
}
return $client;
}
示例3: header
<?php
$user = OpenVBX::getCurrentUser();
$tenant_id = $user->values['tenant_id'];
if (isset($_POST['id'])) {
$flows = OpenVBX::getFlows(array('id' => $_POST['id'], 'tenant_id' => $tenant_id));
$data = $flows[0]->values['data'];
$sms_data = $flows[0]->values['sms_data'];
$export = md5($data . $sms_data) . ':' . base64_encode($data) . ':' . base64_encode($sms_data);
if (isset($_POST['file'])) {
header('Content-type: text/plain');
header('Content-Disposition: attachment; filename=' . preg_replace('/\\W/', '', $flows[0]->values['name']) . '.ovbx');
echo $export;
die;
}
}
$flows = OpenVBX::getFlows(array('tenant_id' => $tenant_id));
?>
<style>
.vbx-export-flow form {
margin-top: 20px;
}
.vbx-export-flow p {
margin: 10px 0;
padding: 0 20px;
}
.vbx-export-flow h3 {
font-size: 14px;
padding: 0 20px;
margin-top: 20px;
}
示例4: foreach
<ul class="user-groups-menu vbx-menu-items-right">
<li class="menu-item"><button id="button-add-user" class="inline-button add-button"><span>Add User</span></button></li>
<li class="menu-item"><button id="button-add-group" class="inline-button add-button"><span>Add Group</span></button></li>
</ul>
</div><!-- .vbx-content-menu -->
<div class="yui-ge accounts-section">
<div class="yui-u first">
<div id="user-container">
<h3>Users</h3>
<p>Drag a user into a group to add them.</p>
<ul class="user-list">
<?php
$admin = OpenVBX::getCurrentUser();
?>
<?php
if (isset($users)) {
$default_avatar = asset_url('assets/i/user-icon.png');
foreach ($users as $user) {
?>
<li class="user" rel="<?php
echo $user->id;
?>
">
<div class="user-utilities">
<img class="gravatar" src="<?php
if ($gravatars) {
echo gravatar_url($user->email, 30, $default_avatar);
} else {