本文整理汇总了PHP中Notification::append方法的典型用法代码示例。如果您正苦于以下问题:PHP Notification::append方法的具体用法?PHP Notification::append怎么用?PHP Notification::append使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Notification
的用法示例。
在下文中一共展示了Notification::append方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: onLocationPublishError
function onLocationPublishError($error)
{
Notification::append(null, $error);
RPC::call('movim_delete', 'mapdiv');
RPC::call('movim_delete', 'mapdata');
RPC::commit();
}
示例2: 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);
}
示例3: 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'));
}
示例4: onMyPresence
function onMyPresence($packet)
{
$html = $this->preparePresence();
RPC::call('MovimTpl.fill', '#presence_widget', $html);
Notification::append(null, $this->__('status.updated'));
RPC::call('Presence.refresh');
RPC::call('MovimUtils.removeClass', '#presence_widget', 'unfolded');
}
示例5: 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'));
}
示例6: ajaxRefresh
function ajaxRefresh()
{
Notification::append(null, $this->__('menu.refresh'));
$sd = new \modl\SubscriptionDAO();
$subscriptions = $sd->getSubscribed();
foreach ($subscriptions as $s) {
$r = new GetItems();
$r->setTo($s->server)->setNode($s->node)->request();
}
}
示例7: ajaxRegister
function ajaxRegister()
{
$cd = new \Modl\ConfigDAO();
$config = $cd->get();
$json = requestURL(MOVIM_API . 'register', 3, array('uri' => BASE_URI, 'rewrite' => false));
$json = json_decode($json);
if (isset($json) && $json->status == 200) {
RPC::call('MovimUtils.reloadThis');
Notification::append(null, $this->__('api.conf_updated'));
}
}
示例8: onDelete
function onDelete($packet)
{
$content = $packet->content;
if (substr($content['node'], 0, 29) == 'urn:xmpp:microblog:0:comments') {
Notification::append(false, $this->__('post.comment_deleted'));
$this->ajaxGetComments($content['server'], substr($content['node'], 30));
} else {
Notification::append(false, $this->__('post.deleted'));
$this->ajaxClear();
RPC::call('MovimTpl.hidePanel');
RPC::call('Menu_ajaxGetAll');
}
}
示例9: ajaxRegister
function ajaxRegister()
{
$rewrite = false;
if (isset($_SERVER['HTTP_MOD_REWRITE']) && $_SERVER['HTTP_MOD_REWRITE']) {
$rewrite = true;
}
$json = requestURL(MOVIM_API . 'register', 1, array('uri' => BASE_URI, 'rewrite' => $rewrite));
$json = json_decode($json);
if (isset($json) && $json->status == 200) {
RPC::call('movim_reload_this');
Notification::append(null, $this->__('api.conf_updated'));
}
}
示例10: ajaxSubmit
function ajaxSubmit($data)
{
if (!$this->validateForm($data)) {
$this->refreshConfig();
Notification::append(null, $this->__('config.not_valid'));
return;
}
$config = $this->user->getConfig();
if (isset($config)) {
$data = array_merge($config, $data);
}
$s = new Set();
$s->setXmlns('movim:prefs')->setData(serialize($data))->request();
}
示例11: 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);
}
}
示例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: 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);
}
示例14: checkConnected
function checkConnected($room, $resource = false)
{
if (!$this->validateRoom($room)) {
return;
}
if ($resource && !$this->validateResource($resource)) {
Notification::append(null, $this->__('chatrooms.bad_id'));
return;
}
$pd = new \Modl\PresenceDAO();
if ($resource == false) {
$session = \Session::start();
$resource = $session->get('username');
}
$presence = $pd->getPresence($room, $resource);
if ($presence != null) {
return true;
} else {
return false;
}
}
示例15: ajaxGetHistory
/**
* @brief Get the chat history
*
* @param string jid
* @param string time
*/
function ajaxGetHistory($jid, $date)
{
if (!$this->validateJid($jid)) {
return;
}
$md = new \Modl\MessageDAO();
$messages = $md->getHistory(echapJid($jid), date(DATE_ISO8601, strtotime($date)), $this->_pagination);
if (count($messages) > 0) {
Notification::append(false, $this->__('message.history', count($messages)));
foreach ($messages as $message) {
if (!preg_match('#^\\?OTR#', $message->body)) {
//RPC::call('Chat.appendMessage', $this->prepareMessage($message), true);
//$this->_msgMap[$message->published.$message->jid] = $message;
$this->prepareMessage($message);
}
}
//foreach($this->_msgMap as $message)
// $this->prepareMessage($message);
RPC::call('Chat.appendMessagesWrapper', $this->_wrapper, true);
$this->_wrapper = array();
//RPC::call('Chat.cleanBubbles');
}
}