本文整理汇总了PHP中RPC::call方法的典型用法代码示例。如果您正苦于以下问题:PHP RPC::call方法的具体用法?PHP RPC::call怎么用?PHP RPC::call使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RPC
的用法示例。
在下文中一共展示了RPC::call方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: onLocationPublishError
function onLocationPublishError($error)
{
Notification::append(null, $error);
RPC::call('movim_delete', 'mapdiv');
RPC::call('movim_delete', 'mapdata');
RPC::commit();
}
示例2: ajaxShowPosition
function ajaxShowPosition($pos)
{
list($lat, $lon) = explode(',', $pos);
$pos = json_decode(file_get_contents('http://nominatim.openstreetmap.org/reverse?format=json&lat=' . $lat . '&lon=' . $lon . '&zoom=27&addressdetails=1'));
RPC::call('movim_fill', 'postpublishlocation', (string) $pos->display_name);
RPC::commit();
}
示例3: fill
static function fill($html = '', $scroll = false)
{
RPC::call('movim_fill', 'dialog', $html);
if ($scroll) {
RPC::call('Dialog.addScroll');
}
}
示例4: onConfigured
function onConfigured($package)
{
$node = $package->content;
switch ($node) {
case 'storage:bookmarks':
$notif = $this->__('init.bookmark');
break;
case 'urn:xmpp:vcard4':
$notif = $this->__('init.vcard4');
break;
case 'urn:xmpp:avatar:data':
$notif = $this->__('init.avatar');
break;
case 'http://jabber.org/protocol/geoloc':
$notif = $this->__('init.location');
break;
case 'urn:xmpp:pubsub:subscription':
$notif = $this->__('init.subscriptions');
break;
case 'urn:xmpp:microblog:0':
$notif = $this->__('init.microblog');
break;
}
RPC::call('Init.setNode', $node);
Notification::append(null, $notif);
}
示例5: ajaxAddChatroom
function ajaxAddChatroom()
{
$r = new Rooms();
$r->ajaxChatroomAdd(array('jid' => 'movim@conference.movim.eu', 'name' => 'Movim Chatroom', 'nick' => false, 'autojoin' => 0));
$r->ajaxJoin('movim@conference.movim.eu');
RPC::call('MovimUtils.redirect', $this->route('chat'));
}
示例6: onMyAvatarError
function onMyAvatarError()
{
$cd = new \modl\ContactDAO();
$me = $cd->get();
$html = $this->prepareForm($me);
RPC::call('movim_fill', 'avatar_form', $html);
Notification::append(null, $this->__('avatar.not_updated'));
}
示例7: ajaxUnregister
function ajaxUnregister()
{
$cd = new \Modl\ConfigDAO();
$config = $cd->get();
$config->unregister = !$config->unregister;
$cd->set($config);
RPC::call('MovimUtils.reloadThis');
RPC::commit();
}
示例8: onConfig
function onConfig($package)
{
$data = (array) $package->content;
$this->user->setConfig($data);
$html = $this->prepareConfigForm();
RPC::call('movim_fill', 'config_widget', $html);
RPC::call('Config.load');
Notification::append(null, $this->__('config.updated'));
}
示例9: ajaxGet
function ajaxGet($type = 'all', $server = null, $node = null, $page = 0)
{
$html = $this->prepareList($type, $server, $node, $page);
if ($page > 0) {
RPC::call('movim_append', 'menu_wrapper', $html);
} else {
RPC::call('movim_fill', 'menu_widget', $html);
RPC::call('movim_posts_unread', 0);
}
RPC::call('Menu.refresh');
}
示例10: onNotifs
function onNotifs($from = false)
{
$html = $this->prepareNotifs();
RPC::call('MovimTpl.fill', '#notifs_widget', $html);
RPC::call('Notifs.refresh');
if (is_string($from)) {
$cd = new \Modl\ContactDAO();
$contact = $cd->get($from);
$avatar = $contact->getPhoto('s');
if ($avatar == false) {
$avatar = null;
}
Notification::append('invite|' . $from, $contact->getTrueName(), $this->__('notifs.wants_to_talk', $contact->getTrueName()), $avatar, 4);
}
}
示例11: onSessionInitiate
function onSessionInitiate($jingle)
{
$jts = new \JingletoSDP($jingle);
$sdp = $jts->generate();
$cd = new \Modl\ContactDAO();
$contact = $cd->get(cleanJid((string) $jingle->attributes()->initiator));
if (!isset($contact)) {
$contact = new Modl\Contact();
}
if ($sdp) {
RPC::call('movim_desktop_notification', $contact->getTrueName(), $this->__('visio.calling'), $contact->getPhoto('m'));
RPC::call('remoteSetJid', (string) $jingle->attributes()->initiator);
RPC::call('remoteCall', 'onOffer', $sdp);
RPC::commit();
}
}
示例12: ajaxChangePassword
function ajaxChangePassword($form)
{
$validate = Validator::string()->length(6, 40);
$p1 = $form->password->value;
$p2 = $form->password_confirmation->value;
if ($validate->validate($p1) && $validate->validate($p2)) {
if ($p1 == $p2) {
$arr = explodeJid($this->user->getLogin());
$cp = new ChangePassword();
$cp->setTo($arr['server'])->setUsername($arr['username'])->setPassword($p1)->request();
} else {
RPC::call('Account.resetPassword');
Notification::append(null, $this->__('account.password_not_same'));
}
} else {
RPC::call('Account.resetPassword');
Notification::append(null, $this->__('account.password_not_valid'));
}
}
示例13: onCommand
function onCommand($package)
{
$command = $package->content;
$view = $this->tpl();
if (isset($command->note)) {
$view->assign('note', $command->note);
Dialog::fill($view->draw('_adhoc_note', true));
}
if (isset($command->x)) {
$xml = new \XMPPtoForm();
$form = $xml->getHTML($command->x->asXML());
$view->assign('form', $form);
$view->assign('attributes', $command->attributes());
$view->assign('actions', null);
if (isset($command->actions)) {
$view->assign('actions', $command->actions);
}
Dialog::fill($view->draw('_adhoc_form', true), true);
}
RPC::call('AdHoc.initForm');
}
示例14: ajaxDisplay
function ajaxDisplay()
{
$tmp = [];
foreach (scandir(USERS_PATH) as $f) {
if (is_dir(USERS_PATH . '/' . $f)) {
$time = filemtime(USERS_PATH . '/' . $f . '/index.html');
if ($time) {
array_push($tmp, $time);
}
}
}
sort($tmp);
$days = [];
$pattern = "M Y";
foreach ($tmp as $k => $time) {
$key = date($pattern, $time);
if (isset($days[$key])) {
$days[$key]++;
} else {
$days[$key] = 1;
}
}
$data = new stdClass();
$data->labels = [];
$data->datasets = [];
$first = new StdClass();
$first->label = "Monthly Subscriptions";
$first->fillColor = "rgba(255,152,0,0.5)";
$first->strokeColor = "rgba(255,152,0,0.8)";
$first->highlightFill = "rgba(220,220,220,0.75)";
$first->highlightStroke = "rgba(220,220,220,1)";
$values = [];
foreach ($days as $key => $value) {
array_push($data->labels, $key);
array_push($values, $value);
}
$first->data = $values;
array_push($data->datasets, $first);
RPC::call('Statistics.drawGraphs', $data);
}
示例15: ajaxLogin
function ajaxLogin($username)
{
$validate_user = Validator::string()->length(4, 40);
if (!$validate_user->validate($username)) {
Notification::append(null, $this->__('login_anonymous.bad_username'));
return;
}
// We get the Server Configuration
$cd = new \Modl\ConfigDAO();
$config = $cd->get();
$host = 'anonymous.jappix.com';
$password = 'AmISnowden?';
// We try to get the domain
$domain = \Moxl\Utils::getDomain($host);
// We launch the XMPP socket
RPC::call('register', $host);
// We set the username in the session
$s = Session::start();
$s->set('username', $username);
// We create a new session or clear the old one
$s = Sessionx::start();
$s->init($username, $password, $host, $domain);
\Moxl\Stanza\Stream::init($host);
}