當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Functions::getQueryUrl方法代碼示例

本文整理匯總了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;
 }
開發者ID:AlexSnet,項目名稱:webtrees,代碼行數:66,代碼來源:Stats.php

示例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;
 }
開發者ID:pal-saugstad,項目名稱:webtrees,代碼行數:15,代碼來源:PageController.php

示例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>
開發者ID:bxbroze,項目名稱:webtrees,代碼行數:66,代碼來源:GoogleMapsModule.php

示例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 .= '&nbsp;|&nbsp;';
         }
     }
     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;
     }
 }
開發者ID:tronsmit,項目名稱:webtrees,代碼行數:64,代碼來源:LoggedInUsersModule.php

示例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'));
     }
 }
開發者ID:tronsmit,項目名稱:webtrees,代碼行數:13,代碼來源:AbstractTheme.php

示例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>';
     }
 }
開發者ID:bxbroze,項目名稱:justlight,代碼行數:8,代碼來源:theme.php

示例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), '&amp;'), 'menu-color-' . $palette_id . ($this->palette === $palette_id ? ' active' : '')));
         }
         return $menu;
     } else {
         return null;
     }
 }
開發者ID:tronsmit,項目名稱:webtrees,代碼行數:17,代碼來源:ColorsTheme.php

示例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), '&amp;'), 'menu-color-' . $palette_id . ($this->palette === $palette_id ? ' active' : '')));
     }
     return $menu;
 }
開發者ID:tunandras,項目名稱:webtrees,代碼行數:13,代碼來源:ColorsTheme.php


注:本文中的Fisharebest\Webtrees\Functions\Functions::getQueryUrl方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。