当前位置: 首页>>代码示例>>PHP>>正文


PHP Browser::getName方法代码示例

本文整理汇总了PHP中Browser::getName方法的典型用法代码示例。如果您正苦于以下问题:PHP Browser::getName方法的具体用法?PHP Browser::getName怎么用?PHP Browser::getName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Browser的用法示例。


在下文中一共展示了Browser::getName方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: Browser

$input = array_merge($_GET, $_POST);
template_repository_path($template_folder . get_lang());
template_load_dictionnary('translations.xml');
//
// Login/logout
//
// Saves the URL used to access the website
if (!isset($_SESSION['first_input']) && isset($input['action']) && $input['action'] != 'logout' && $input['action'] != 'login' && $input['action'] != 'client_trace') {
    $_SESSION['first_input'] = array_merge($_GET, $_POST);
}
// Saves user's web browser information
if (!isset($_SESSION['browser_name']) || !isset($_SESSION['browser_version']) || !isset($_SESSION['user_os'])) {
    Autoloader::register();
    $browser = new Browser();
    $os = new Os();
    $_SESSION['browser_name'] = $browser->getName();
    $_SESSION['browser_version'] = $browser->getVersion();
    $user_agent = $browser->getUserAgent();
    $_SESSION['browser_full'] = $user_agent->getUserAgentString();
    $_SESSION['user_os'] = $os->getName();
}
// If we're not logged in, we try to log in or display the login form
if (!user_logged_in()) {
    // if the url contains the parameter 'anon' the session is assumed as anonymous
    if (isset($input['anon']) && $input['anon'] == true) {
        user_anonymous_session();
    } else {
        if (isset($input['action']) && $input['action'] == 'login') {
            // The user continues without any authentication
            if (isset($_POST['anonymous_session'])) {
                user_anonymous_session();
开发者ID:jingyexu,项目名称:ezcast,代码行数:31,代码来源:web_index.php

示例2: showOutputStatisticsPlatform

 function showOutputStatisticsPlatform()
 {
     if (loadvar(DATA_OUTPUT_TYPEDATA) != "") {
         if (loadvar(DATA_OUTPUT_TYPEDATA) == DATA_TEST) {
             $_SESSION[SURVEY_EXECUTION_MODE] = SURVEY_EXECUTION_MODE_TEST;
         } else {
             $_SESSION[SURVEY_EXECUTION_MODE] = SURVEY_EXECUTION_MODE_NORMAL;
         }
     } else {
         $_SESSION[SURVEY_EXECUTION_MODE] = SURVEY_EXECUTION_MODE_NORMAL;
     }
     $survey = new Survey($_SESSION['SUID']);
     $headers[] = array('link' => setSessionParamsHref(array('page' => 'sysadmin.output'), Language::headerOutput()), 'label' => Language::headerOutputData());
     $headers[] = array('link' => setSessionParamsHref(array('page' => 'sysadmin.output.statistics'), Language::headerOutputStatistics()), 'label' => Language::headerOutputStatistics());
     $headers[] = array('link' => '', 'label' => Language::headerOutputStatisticsPlatform());
     $returnStr = $this->showOutputHeader($headers);
     $surveys = new Surveys();
     $surveys = $surveys->getSurveys();
     $returnStr .= '<form id=surveyform method="post">';
     $returnStr .= '<span class="label label-default">' . Language::headerOutputStatisticsPlatform() . '</span>';
     $returnStr .= '<div class="well well-sm">';
     $returnStr .= '<table>';
     //if (sizeof($surveys) > 0) {
     $returnStr .= $this->displayComboBox();
     $returnStr .= '<tr><td>' . Language::labelOutputScreenDumpsSurvey() . '</td><td>' . $this->displaySurveys("survey", "survey", $_SESSION["SUID"]) . '</td></tr>';
     $returnStr .= '<script type=text/javascript>
                     $(document).ready(function(){
                         $("#survey").on("change", function(event) {
                             document.getElementById("surveyform").submit();
                         });
                     });
                 </script>';
     //}
     $returnStr .= '<tr><td>' . Language::labelOutputDataType() . '</td><td>';
     $returnStr .= "<select id='typedata' class='selectpicker show-tick' name=" . DATA_OUTPUT_TYPEDATA . ">";
     //$returnStr .= "<option></option>";
     $selected = array('', '');
     if (loadvar(DATA_OUTPUT_TYPEDATA) != "") {
         $selected[loadvar(DATA_OUTPUT_TYPEDATA)] = "selected";
     }
     //print_r($selected);
     $returnStr .= "<option " . $selected[0] . " value=" . DATA_REAL . ">" . Language::optionsDataReal() . "</option>";
     $returnStr .= "<option " . $selected[1] . " value=" . DATA_TEST . ">" . Language::optionsDataTest() . "</option>";
     $returnStr .= "</select>";
     $returnStr .= "</td></tr>";
     $returnStr .= '<script type=text/javascript>
                     $(document).ready(function(){
                         $("#typedata").on("change", function(event) {
                             document.getElementById("surveyform").submit();
                         });
                     });
                 </script>';
     $returnStr .= '</table><br/>';
     $returnStr .= "</form>";
     // high chart
     $returnStr .= '<script src="js/highcharts.js"></script>';
     $returnStr .= '<script src="js/modules/exporting.js"></script>';
     $returnStr .= '<script src="js/export-csv.js"></script>';
     $data = new Data();
     $data = $data->getPlatformData($_SESSION['SUID']);
     // determine devices
     $devices = array();
     require_once "detection_bootstrap.php";
     $detect = new Mobile_Detect();
     $total = sizeof($data);
     if ($total == 0) {
         $total = 1;
     }
     $mobilecount = 0;
     $tabletcount = 0;
     $othercount = 0;
     $browsercounts = array();
     $oscounts = array();
     foreach ($data as $d) {
         $detect->setUserAgent($d);
         if ($detect->isMobile() && !$detect->isTablet()) {
             $mobilecount++;
         } else {
             if ($detect->isTablet()) {
                 $tabletcount++;
             } else {
                 $othercount++;
             }
         }
         $browser = new Browser($d);
         $name = $browser->getName();
         if ($name == 'Navigator') {
             // rename if android mobile browser
             $name = "Android browser";
         }
         if (isset($browsercounts[ucwords($name)])) {
             $browsercounts[ucwords($name)]++;
         } else {
             $browsercounts[ucwords($name)] = 1;
         }
         $os = new Os($d);
         $name = $os->getName();
         if (isset($oscounts[ucwords($name)])) {
             $oscounts[ucwords($name)]++;
         } else {
//.........这里部分代码省略.........
开发者ID:nubissurveying,项目名称:nubis,代码行数:101,代码来源:displayoutput.php


注:本文中的Browser::getName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。