本文整理汇总了PHP中Route::urlize方法的典型用法代码示例。如果您正苦于以下问题:PHP Route::urlize方法的具体用法?PHP Route::urlize怎么用?PHP Route::urlize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Route
的用法示例。
在下文中一共展示了Route::urlize方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: display
function display()
{
$this->view->assign('subscriptionconfig', Route::urlize('conf', false, 'groupsubscribedlistconfig'));
$this->view->assign('getbookmark', $this->call("ajaxGetBookmark"));
$this->view->assign('setbookmark', $this->call("ajaxSetBookmark", "''"));
$this->view->assign('preparebookmark', $this->prepareBookmark());
}
示例2: prepareList
function prepareList($list)
{
//0:data 1:server 2:node
$affiliation = array("owner", "member", "none");
$html = '<form id="affiliationsManaging">';
foreach ($list[0] as $item) {
//0:jid 1:affiliation 2:subid
$html .= '
<div class="element">
<label for="' . $item[0] . '_' . $item[2] . '">
<a href="' . Route::urlize('friend', $item[0]) . '">' . $item[0] . '</a>
</label>
<div class="select">
<select name="' . $item[0] . '_' . $item[2] . '">';
foreach ($affiliation as $status) {
$status == $item[1] ? $selected = "selected" : ($selected = "");
$html .= '<option ' . $selected . '>' . t($status) . '</option>';
}
$html .= ' </select>
</div>
</div>';
}
$ok = $this->call('ajaxChangeAffiliation', "'" . $list[1] . "'", "'" . $list[2] . "'", "movim_parse_form('affiliationsManaging')");
$html .= '
<hr />
<br />
<a
class="button color green oppose"
onclick="' . $ok . '">
<i class="fa fa-check"></i> ' . __('button.validate') . '
</a></form><div class="clear"></div>';
return $html;
}
示例3: display
function display()
{
ob_clean();
if (!$this->get('f')) {
return;
}
$from = $this->get('f');
if (filter_var($from, FILTER_VALIDATE_EMAIL)) {
$node = 'urn:xmpp:microblog:0';
} else {
return;
}
$pd = new \modl\PostnDAO();
$cd = new \modl\ContactDAO();
$this->view->assign('contact', $cd->get($from, true));
$this->view->assign('uri', Route::urlize('blog', array($from)));
if (isset($from) && isset($node)) {
$messages = $pd->getPublic($from, $node, 10, 0);
$this->view->assign('messages', $messages);
}
if (isset($messages[0])) {
header("Content-Type: application/atom+xml; charset=UTF-8");
$this->view->assign('date', date('c'));
}
}
示例4: onPublish
function onPublish($packet)
{
list($to, $node, $id, $repost) = array_values($packet->content);
if (!$repost) {
$this->ajaxCreateComments($to, $id);
}
RPC::call('MovimUtils.redirect', Route::urlize('news', [$to, $node, $id]));
}
示例5: load
function load()
{
if ($this->_view == 'node') {
$this->_from = $this->get('s');
$this->_node = $this->get('n');
if (!$this->validateServerNode($this->_from, $this->_node)) {
return;
}
$pd = new \Modl\ItemDAO();
$this->_item = $pd->getItem($this->_from, $this->_node);
$this->_mode = 'group';
$this->url = Route::urlize('node', array($this->_from, $this->_node));
} else {
$this->_from = $this->get('f');
$cd = new \modl\ContactDAO();
$this->_contact = $cd->get($this->_from, true);
if (filter_var($this->_from, FILTER_VALIDATE_EMAIL)) {
$this->_node = 'urn:xmpp:microblog:0';
} else {
return;
}
$this->_mode = 'blog';
$this->url = Route::urlize('blog', $this->_from);
}
$pd = new \modl\PostnDAO();
if ($this->_id = $this->get('i')) {
if (Validator::int()->between(0, 100)->validate($this->_id)) {
$this->_messages = $pd->getNodeUnfiltered($this->_from, $this->_node, $this->_id * $this->_paging, $this->_paging + 1);
$this->_page = $this->_id + 1;
} elseif (Validator::string()->length(5, 100)->validate($this->_id)) {
$this->_messages = $pd->getPublicItem($this->_from, $this->_node, $this->_id);
if (is_object($this->_messages[0])) {
$this->title = $this->_messages[0]->title;
$description = stripTags($this->_messages[0]->contentcleaned);
if (!empty($description)) {
$this->description = $description;
}
$attachements = $this->_messages[0]->getAttachements();
if ($attachements && array_key_exists('pictures', $attachements)) {
$this->image = urldecode($attachements['pictures'][0]['href']);
}
}
if ($this->_view == 'node') {
$this->url = Route::urlize('node', array($this->_from, $this->_node, $this->_id));
} else {
$this->url = Route::urlize('blog', array($this->_from, $this->_id));
}
}
} else {
$this->_page = 1;
$this->_messages = $pd->getNodeUnfiltered($this->_from, $this->_node, 0, $this->_paging + 1);
}
if (count($this->_messages) == $this->_paging + 1) {
array_pop($this->_messages);
}
}
示例6: prepareList
function prepareList($list)
{
$configlist = $this->tpl();
$sd = new \Modl\SubscriptionDAO();
$listhtml = '';
//if($sd != null && $sd->getSubscribed() != null) {
foreach ($sd->getSubscribed() as $s) {
if ($s->name != null) {
$name = $s->name;
} else {
$name = $s->node;
}
if (isset($list[$s->server . $s->node])) {
$checked = 'checked';
} else {
$checked = '';
}
$switch = $this->call('ajaxChangeSubscribed', "'" . $s->server . "'", "'" . $s->node . "'", "this.checked", "'" . $name . "'");
$listhtml .= '
<li class="action">
<span class="icon bubble color ' . stringToColor($s->node) . '">
' . firstLetterCapitalize($s->node) . '
</span>
<form>
<div class="action">
<div class="checkbox">
<input
type="checkbox"
id="privacy' . $s->node . '"
name="privacy' . $s->node . '"
' . $checked . '
onchange="' . $switch . '"/>
<label for="privacy' . $s->node . '"></label>
</div>
</div>
</form>
<a href="' . Route::urlize('node', array($s->server, $s->node)) . '">' . $name . '
</a>
</li>';
}
$configlist->assign('list', $listhtml);
return $configlist->draw('_pubsubsubscriptionconfig_list', true);
//} else return t('No public groups found');
}
示例7: display
function display()
{
$this->view->assign('base_uri', BASE_URI);
$this->view->assign('base_host', BASE_HOST);
$this->view->assign('error_uri', Route::urlize('disconnect'));
$r = new Route();
$this->view->assign('current_page', $r->find());
if (!isset($_SERVER['HTTP_MOD_REWRITE']) || !$_SERVER['HTTP_MOD_REWRITE']) {
$this->view->assign('page_key_uri', '?q=');
} else {
$this->view->assign('page_key_uri', '');
}
$this->view->assign('secure_websocket', file_get_contents(CACHE_PATH . 'websocket'));
// And we load some public values of the system configuration
$cd = new \Modl\ConfigDAO();
$config = $cd->get();
$public_conf = array('bosh_url' => $config->boshurl, 'timezone' => $config->timezone);
$this->view->assign('server_conf', json_encode($public_conf));
}
示例8: ajaxLogin
function ajaxLogin($form)
{
// We get the Server Configuration
$cd = new \Modl\ConfigDAO();
$config = $cd->get();
// First we check the form
$validate_login = Validator::email()->length(6, 40);
$validate_password = Validator::string()->length(4, 40);
$login = $form->login->value;
$password = $form->pass->value;
if (!$validate_login->validate($login)) {
$this->showErrorBlock('login_format');
return;
}
if (!$validate_password->validate($password)) {
$this->showErrorBlock('password_format');
return;
}
list($username, $host) = explode('@', $login);
// Check whitelisted server
if ($config->xmppwhitelist != '' && !in_array($host, explode(',', $config->xmppwhitelist))) {
$this->showErrorBlock('unauthorized');
return;
}
// We check if we already have an open session
$sd = new \Modl\SessionxDAO();
$here = $sd->getHash(sha1($username . $password . $host));
if ($here) {
RPC::call('Login.setCookie', $here->session);
RPC::call('movim_redirect', Route::urlize('main'));
$this->showErrorBlock('conflict');
return;
}
// We try to get the domain
$domain = \Moxl\Utils::getDomain($host);
// We launch the XMPP socket
RPC::call('register', $host);
// We create a new session or clear the old one
$s = Sessionx::start();
$s->init($username, $password, $host, $domain);
\Moxl\Stanza\Stream::init($host);
}
示例9: doLogin
private function doLogin($login, $password)
{
// We get the Server Configuration
$cd = new \Modl\ConfigDAO();
$config = $cd->get();
// First we check the form
$validate_login = Validator::email()->length(1, 254);
$validate_password = Validator::stringType()->length(1, 128);
if (!$validate_login->validate($login)) {
$this->showErrorBlock('login_format');
return;
}
if (!$validate_password->validate($password)) {
$this->showErrorBlock('password_format');
return;
}
list($username, $host) = explode('@', $login);
// Check whitelisted server
if ($config->xmppwhitelist != '' && !in_array($host, explode(',', $config->xmppwhitelist))) {
$this->showErrorBlock('unauthorized');
return;
}
// We check if we already have an open session
$sd = new \Modl\SessionxDAO();
$here = $sd->getHash(sha1($username . $password . $host));
if ($here) {
//if($s->get('hash') == sha1($username.$password.$host)) {
RPC::call('Login.setCookie', $here->session);
RPC::call('MovimUtils.redirect', Route::urlize('main'));
$this->showErrorBlock('conflict');
return;
}
$s = Session::start();
// We create a new session or clear the old one
$s->set('password', $password);
$s->set('username', $username);
$s->set('host', $host);
$s->set('jid', $login);
$s->set('hash', sha1($username . $password . $host));
$s = Sessionx::start();
$s->init($username, $password, $host);
// We launch the XMPP socket
RPC::call('register', $host);
\Moxl\Stanza\Stream::init($host);
}
示例10: load
function load()
{
if ($this->_view == 'node') {
$this->_from = $this->get('s');
$this->_node = $this->get('n');
if (!$this->validateServerNode($this->_from, $this->_node)) {
return;
}
$pd = new \Modl\ItemDAO();
$this->_item = $pd->getItem($this->_from, $this->_node);
$this->_mode = 'group';
$this->url = Route::urlize('node', array($this->_from, $this->_node));
} elseif ($this->_view == 'tag' && $this->validateTag($this->get('t'))) {
$this->_mode = 'tag';
$this->_tag = $this->get('t');
$this->title = '#' . $this->_tag;
} else {
$this->_from = $this->get('f');
$cd = new \modl\ContactDAO();
$this->_contact = $cd->get($this->_from, true);
if (filter_var($this->_from, FILTER_VALIDATE_EMAIL)) {
$this->_node = 'urn:xmpp:microblog:0';
} else {
return;
}
$this->_mode = 'blog';
$this->url = Route::urlize('blog', $this->_from);
}
$pd = new \modl\PostnDAO();
if ($this->_id = $this->get('i')) {
if (Validator::stringType()->between('1', '100')->validate($this->_id)) {
if (isset($this->_tag)) {
$this->_messages = $pd->getPublicTag($this->get('t'), $this->_id * $this->_paging, $this->_paging + 1);
} else {
$this->_messages = $pd->getNodeUnfiltered($this->_from, $this->_node, $this->_id * $this->_paging, $this->_paging + 1);
}
$this->_page = $this->_id + 1;
} elseif (Validator::stringType()->length(5, 100)->validate($this->_id)) {
$this->_messages[0] = $pd->getPublicItem($this->_from, $this->_node, $this->_id);
if (is_object($this->_messages[0])) {
$this->title = $this->_messages[0]->title;
$description = stripTags($this->_messages[0]->contentcleaned);
if (!empty($description)) {
$this->description = truncate($description, 100);
}
$attachments = $this->_messages[0]->getAttachments();
if ($attachments && array_key_exists('pictures', $attachments)) {
$this->image = urldecode($attachments['pictures'][0]['href']);
}
}
if ($this->_view == 'node') {
$this->url = Route::urlize('node', array($this->_from, $this->_node, $this->_id));
} else {
$this->url = Route::urlize('blog', array($this->_from, $this->_id));
}
}
} else {
$this->_page = 1;
if (isset($this->_tag)) {
$this->_messages = $pd->getPublicTag($this->get('t'), 0, $this->_paging + 1);
} else {
$this->_messages = $pd->getNodeUnfiltered($this->_from, $this->_node, 0, $this->_paging + 1);
}
}
if (count($this->_messages) == $this->_paging + 1) {
array_pop($this->_messages);
}
if ($this->_node == 'urn:xmpp:microblog:0') {
$this->user = new User($this->_from);
$cssurl = $this->user->getDumpedConfig('cssurl');
if (isset($cssurl) && $cssurl != '' && Validator::url()->validate($cssurl)) {
$this->addrawcss($cssurl);
}
}
}
示例11: redirect
function redirect($page, $params = false)
{
$url = \Route::urlize($page, $params);
header('Location: ' . $url);
}
示例12: ajaxSearchContact
/**
* @brief Search for a contact to add
*/
function ajaxSearchContact($jid)
{
if (filter_var($jid, FILTER_VALIDATE_EMAIL)) {
RPC::call('movim_redirect', Route::urlize('contact', $jid));
RPC::commit();
} else {
Notification::append(null, $this->__('roster.jid_error'));
}
}
示例13: accountNext
function accountNext($server)
{
return Route::urlize('accountnext', array($server));
}
示例14: redirect
function redirect($page)
{
$url = Route::urlize($page, array($this->fetchGet('err')));
header('Location: ' . $url);
}
示例15: onPostDisconnect
function onPostDisconnect($data)
{
RPC::call('movim_reload', Route::urlize('disconnect'));
}