本文整理汇总了PHP中Fisharebest\Webtrees\Functions\Functions::getQueryUrl方法的典型用法代码示例。如果您正苦于以下问题:PHP Functions::getQueryUrl方法的具体用法?PHP Functions::getQueryUrl怎么用?PHP Functions::getQueryUrl使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Fisharebest\Webtrees\Functions\Functions
的用法示例。
在下文中一共展示了Functions::getQueryUrl方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: usersLoggedInQuery
/**
* Who is currently logged in?
*
* @param string $type
*
* @return string
*/
private function usersLoggedInQuery($type = 'nolist')
{
$content = '';
// List active users
$NumAnonymous = 0;
$loggedusers = array();
foreach (User::allLoggedIn() as $user) {
if (Auth::isAdmin() || $user->getPreference('visibleonline')) {
$loggedusers[] = $user;
} else {
$NumAnonymous++;
}
}
$LoginUsers = count($loggedusers);
if ($LoginUsers == 0 && $NumAnonymous == 0) {
return I18N::translate('No logged-in and no anonymous users');
}
if ($NumAnonymous > 0) {
$content .= '<b>' . I18N::plural('%s anonymous logged-in user', '%s anonymous logged-in users', $NumAnonymous, I18N::number($NumAnonymous)) . '</b>';
}
if ($LoginUsers > 0) {
if ($NumAnonymous) {
if ($type == 'list') {
$content .= "<br><br>";
} else {
$content .= " " . I18N::translate('and') . " ";
}
}
$content .= '<b>' . I18N::plural('%s logged-in user', '%s logged-in users', $LoginUsers, I18N::number($LoginUsers)) . '</b>';
if ($type == 'list') {
$content .= '<ul>';
} else {
$content .= ': ';
}
}
if (Auth::check()) {
foreach ($loggedusers as $user) {
if ($type == 'list') {
$content .= '<li>' . Filter::escapeHtml($user->getRealName()) . ' - ' . Filter::escapeHtml($user->getUserName());
} else {
$content .= Filter::escapeHtml($user->getRealName()) . ' - ' . Filter::escapeHtml($user->getUserName());
}
if (Auth::id() != $user->getUserId() && $user->getPreference('contactmethod') != 'none') {
if ($type == 'list') {
$content .= '<br><a class="icon-email" href="#" onclick="return message(\'' . $user->getUserId() . '\', \'\', \'' . Filter::escapeJs(Functions::getQueryUrl()) . '\');" title="' . I18N::translate('Send a message') . '"></a>';
} else {
$content .= ' <a class="icon-email" href="#" onclick="return message(\'' . $user->getUserId() . '\', \'\', \'' . Filter::escapeJs(Functions::getQueryUrl()) . '\');" title="' . I18N::translate('Send a message') . '"></a>';
}
}
if ($type == 'list') {
$content .= '</li>';
}
}
}
if ($type == 'list') {
$content .= '</ul>';
}
return $content;
}
示例2: restrictAccess
/**
* Restrict access
*
* @param bool $condition
*
* @return $this
*/
public function restrictAccess($condition)
{
if ($condition !== true) {
header('Location: ' . WT_LOGIN_URL . '?url=' . rawurlencode(Functions::getQueryUrl()));
exit;
}
return $this;
}
示例3: adminPlaces
//.........这里部分代码省略.........
}
}
?>
<script>
function updateList(inactive) {
window.location.href='<?php
if (strstr($_SERVER['REQUEST_URI'], '&inactive', true)) {
$uri = strstr($_SERVER['REQUEST_URI'], '&inactive', true);
} else {
$uri = $_SERVER['REQUEST_URI'];
}
echo $uri, '&inactive=';
?>
'+inactive;
}
function edit_place_location(placeid) {
window.open('module.php?mod=googlemap&mod_action=places_edit&action=update&placeid='+placeid, '_blank', gmap_window_specs);
return false;
}
function add_place_location(placeid) {
window.open('module.php?mod=googlemap&mod_action=places_edit&action=add&placeid='+placeid, '_blank', gmap_window_specs);
return false;
}
function delete_place(placeid) {
var answer=confirm('<?php
echo I18N::translate('Remove this location?');
?>
');
if (answer == true) {
window.location = '<?php
echo Functions::getQueryUrl(array('action' => 'DeleteRecord'));
?>
&action=DeleteRecord&deleteRecord=' + placeid;
}
}
</script>
<p id="gm_breadcrumb">
<?php
$where_am_i = $this->placeIdToHierarchy($parent);
foreach (array_reverse($where_am_i, true) as $id => $place) {
if ($id == $parent) {
if ($place != 'Unknown') {
echo Filter::escapeHtml($place);
} else {
echo I18N::translate('unknown');
}
} else {
echo '<a href="module.php?mod=googlemap&mod_action=admin_places&parent=', $id, '&inactive=', $inactive, '">';
if ($place != 'Unknown') {
echo Filter::escapeHtml($place), '</a>';
} else {
echo I18N::translate('unknown'), '</a>';
}
}
echo ' - ';
}
?>
<a href="module.php?mod=googlemap&mod_action=admin_places&parent=0&inactive=', $inactive, '"><?php
echo I18N::translate('Top level');
?>
</a>
</p>
示例4: getBlock
/**
* Generate the HTML content of this block.
*
* @param int $block_id
* @param bool $template
* @param string[] $cfg
*
* @return string
*/
public function getBlock($block_id, $template = true, $cfg = array())
{
global $WT_TREE;
$id = $this->getName() . $block_id;
$class = $this->getName() . '_block';
$title = $this->getTitle();
$anonymous = 0;
$logged_in = array();
$content = '';
foreach (User::allLoggedIn() as $user) {
if (Auth::isAdmin() || $user->getPreference('visibleonline')) {
$logged_in[] = $user;
} else {
$anonymous++;
}
}
$count_logged_in = count($logged_in);
$content .= '<div class="logged_in_count">';
if ($anonymous) {
$content .= I18N::plural('%s anonymous signed-in user', '%s anonymous signed-in users', $anonymous, I18N::number($anonymous));
if ($count_logged_in) {
$content .= ' | ';
}
}
if ($count_logged_in) {
$content .= I18N::plural('%s signed-in user', '%s signed-in users', $count_logged_in, I18N::number($count_logged_in));
}
$content .= '</div>';
$content .= '<div class="logged_in_list">';
if (Auth::check()) {
foreach ($logged_in as $user) {
$individual = Individual::getInstance($WT_TREE->getUserPreference($user, 'gedcomid'), $WT_TREE);
$content .= '<div class="logged_in_name">';
if ($individual) {
$content .= '<a href="' . $individual->getHtmlUrl() . '">' . $user->getRealNameHtml() . '</a>';
} else {
$content .= $user->getRealNameHtml();
}
$content .= ' - ' . Filter::escapeHtml($user->getUserName());
if (Auth::id() != $user->getUserId() && $user->getPreference('contactmethod') != 'none') {
$content .= ' <a class="icon-email" href="#" onclick="return message(\'' . Filter::escapeHtml($user->getUserName()) . '\', \'\', \'' . Filter::escapeHtml(Functions::getQueryUrl()) . '\');" title="' . I18N::translate('Send a message') . '"></a>';
}
$content .= '</div>';
}
}
$content .= '</div>';
if ($anonymous === 0 && $count_logged_in === 0) {
return '';
}
if ($template) {
return Theme::theme()->formatBlock($id, $title, $class, $content);
} else {
return $content;
}
}
示例5: menuLogin
/**
* A login menu option (or null if we are already logged in).
*
* @return Menu|null
*/
protected function menuLogin()
{
if (Auth::check() || WT_SCRIPT_NAME === 'login.php') {
return null;
} else {
return new Menu(I18N::translate('Sign in'), WT_LOGIN_URL . '?url=' . rawurlencode(Functions::getQueryUrl()), 'menu-login', array('rel' => 'nofollow'));
}
}
示例6: menuLogin
public function menuLogin()
{
if (Auth::check() || Auth::isSearchEngine()) {
return null;
} else {
return '<div class="menu-login btn-group">' . '<a href="' . WT_LOGIN_URL . '?url=' . rawurlencode(Functions::getQueryUrl()) . '" class="btn btn-default">' . I18N::translate('Sign in') . '</a></div>';
}
}
示例7: menuPalette
/**
* Create a menu of palette options
*
* @return Menu
*/
protected function menuPalette()
{
if ($this->tree && Site::getPreference('ALLOW_USER_THEMES') && $this->tree->getPreference('ALLOW_THEME_DROPDOWN')) {
$menu = new Menu(I18N::translate('Palette'), '#', 'menu-color');
foreach ($this->palettes as $palette_id => $palette_name) {
$menu->addSubmenu(new Menu($palette_name, Functions::getQueryUrl(array('themecolor' => $palette_id), '&'), 'menu-color-' . $palette_id . ($this->palette === $palette_id ? ' active' : '')));
}
return $menu;
} else {
return null;
}
}
示例8: menuPalette
/**
* Create a menu of palette options
*
* @return Menu
*/
protected function menuPalette()
{
$menu = new Menu(I18N::translate('Palette'), '#', 'menu-color');
foreach ($this->palettes as $palette_id => $palette_name) {
$menu->addSubmenu(new Menu($palette_name, Functions::getQueryUrl(array('themecolor' => $palette_id), '&'), 'menu-color-' . $palette_id . ($this->palette === $palette_id ? ' active' : '')));
}
return $menu;
}