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


PHP Mobile::isMobile方法代码示例

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


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

示例1: add_order

 /**
  * @param $customer_id
  * @param $total
  * @return mixed
  */
 public function add_order($customer_id, $delivery_id, $total)
 {
     $detect = new Mobile();
     $device_type = $detect->isMobile() ? $detect->isTablet() ? 'tablet' : 'phone' : 'computer';
     $np_city_ref = Arr::get($_POST, 'np_city_ref');
     $np_address_ref = Arr::get($_POST, 'np_address_ref');
     $city = Arr::get($_POST, 'city');
     $address = Arr::get($_POST, 'address');
     if ($delivery_id = 1) {
         $obj_city = ORM::factory('Novaposhta_City', ['Ref' => $np_city_ref]);
         if ($obj_city->loaded()) {
             $city = $obj_city->DescriptionRu;
         }
         $obj_warehouse = ORM::factory('Novaposhta_Warehouse', ['Ref' => $np_address_ref]);
         if ($obj_warehouse->loaded()) {
             $address = $obj_warehouse->DescriptionRu;
         }
     }
     $obj_order = ORM::factory('Shop_Order');
     $obj_order->customer_id = $customer_id;
     $obj_order->delivery_id = $delivery_id;
     $obj_order->total = $total;
     $obj_order->checked = 0;
     $obj_order->device_type = $device_type;
     $obj_order->oblast = Arr::get($_POST, 'oblast');
     $obj_order->region = Arr::get($_POST, 'region');
     $obj_order->city = $city;
     $obj_order->address = $address;
     $obj_order->np_city_ref = $np_city_ref;
     $obj_order->np_address_ref = $np_address_ref;
     $obj_order->postcode = Arr::get($_POST, 'postcode');
     $obj_order->save();
     $obj_order->number = $obj_order->id . Text::random('nozero', 4);
     $obj_order->save();
     return $obj_order->id;
 }
开发者ID:eok8177,项目名称:shopCMS,代码行数:41,代码来源:Order.php

示例2: die

<?php

if (@$magic != "0xDEADBEEF") {
    die("This file cannot be executed directly");
}
if (@is_dir("setup")) {
    $error = new Error("Setup directory exists. You either haven't installed your guestbook, or forgot to delete the setup folder.");
    die($error->showError());
}
if (!file_exists("data.php")) {
    $error = new Error("Data file doesn't exist. Have you installed your guestbook yet?");
    die($error->showError());
}
require_once 'configuration.php';
if ($config['offline']) {
    $error = new Error($config['offlineMessage']);
    die($error->showError());
}
include_once 'classes/mobile/mobile.class.php';
if (Mobile::isMobile($_SERVER['HTTP_USER_AGENT'])) {
    $config['guestbookTheme'] = $config['mobileTheme'];
}
开发者ID:adelnoureddine,项目名称:angora-guestbook,代码行数:22,代码来源:checks.php

示例3: isset

$isMobile = isset($_GET['mobile']) ? $_GET['mobile'] == '1' : false;
// Logout?
if ($_VISSTATE['POST_OUT'] = isset($_GET['logout'])) {
    $_GET['section'] = 'main';
    # Redirect logged out users to the main page.
    Coach::logout();
}
Mobile::setIsMobile($isMobile);
if ($isMobile && !Coach::isLoggedIn()) {
    // Redirect logged out mobile users to login
    $_GET['section'] = 'login';
}
if ($_VISSTATE['COOCKIE'] || $_VISSTATE['POST_IN'] || $_VISSTATE['POST_OUT']) {
    setupGlobalVars(T_SETUP_GLOBAL_VARS__POST_COACH_LOGINOUT);
}
if (Mobile::isMobile()) {
    HTMLOUT::mobile_frame_begin(isset($_SESSION['logged_in']) ? $coach->settings['theme'] : $settings['stylesheet']);
    # Make page frame, banner and menu.
    MTS('Header loaded, login auth, html frame generated');
    // Check if a menu-link was picked, and execute section code from sections.php accordingly.
    switch ($_GET['section']) {
        case 'login':
            sec_login();
            break;
        case 'matches':
            Match_HTMLOUT::userSched();
            break;
        case 'management':
            $teamId = Mobile_HTMLOUT::getSelectedTeamId();
            Team_HTMLOUT::teamManagementBox($teamId);
            break;
开发者ID:rythos42,项目名称:naflm,代码行数:31,代码来源:index.php

示例4: secureVar

$global->assign("MENU_BOX", $boxContent);
$headIncludes = "";
$pageName = secureVar($_GET['a'], 'html');
if (!empty($pageName)) {
    switch ($pageName) {
        case 'sign':
            if (empty($_SERVER['HTTPS']) || $_SERVER['HTTPS'] == "off") {
                $url['pre'] = "http://";
            } else {
                $url['pre'] = "https://";
            }
            $url['completePage'] = $url['pre'] . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
            $url['page'] = substr($url['completePage'], 0, strrpos($url['completePage'], "/") + 1);
            include_once 'classes/mobile/mobile.class.php';
            include_once 'classes/manage/tinymce.class.php';
            if (!Mobile::isMobile($_SERVER['HTTP_USER_AGENT']) && Tinymce::isCompatible($_SERVER['HTTP_USER_AGENT'])) {
                if (extension_loaded('zlib') && ini_get('zlib.output_compression')) {
                    $headIncludes .= "<script type=\"text/javascript\" src=\"javascript/tiny_mce/tiny_mce.js\"></script>";
                } else {
                    $headIncludes .= "<script type=\"text/javascript\" src=\"javascript/tiny_mce/tiny_mce_gzip.js\"></script>\n\n<script type=\"text/javascript\">\ntinyMCE_GZ.init({\n\tplugins : \"bbcode, emotions, inlinepopups, uploadImage, rbyamli\",\n\tlanguages : 'en',\n\tdisk_cache : true,\n\tdebug : false\n});\n</script>";
                }
                $headIncludes .= "\n<script type=\"text/javascript\">\n\tvar characterLimit = " . $res['maxCharMsg'] . ";\n\ttinyMCE.init({\n\t\tmode : \"textareas\",\n\t\ttheme : \"advanced\",\n\t\twidth : 300,\n\t\theight : 200,\n\t\tdocument_base_url : \"" . $url['page'] . "\",\n\t\tremove_trailing_nbsp : true,\n\t\tentity_encoding : \"raw\",\n\t\tplugins : \"bbcode, emotions, inlinepopups, uploadImage, rbyamli\",\n\t\ttheme_advanced_buttons1 : \"bold,italic,underline,link,unlink,image,uploadImage,forecolor,emotions,undo\",\n\t\ttheme_advanced_buttons2 : \"\",\n\t\ttheme_advanced_buttons3 : \"\",\n\t\ttheme_advanced_path_location : \"top\",\n\t\tremove_linebreaks : false,\n\t\ttheme_advanced_path : false,\n\n\t\tsetup :function(ed) {\n\t\t\ted.onBeforeSetContent.add(function(ed, o) {\n\t\t\tvar strip = (tinyMCE.activeEditor.getContent()).replace(/(<([^>]+)>)/ig,\"\");\n\t\t\tvar text = (characterLimit-strip.length);\n\t\t\ttinymce.DOM.setHTML(tinymce.DOM.get(tinyMCE.activeEditor.id + '_path_row'), text);\n\t\t\t}\n\t\t\t);\n\n\t\t\ted.onKeyUp.add(function(ed, e) {\n\t\t\tvar strip = (tinyMCE.activeEditor.getContent()).replace(/(<([^>]+)>)/ig,\"\");\n\t\t\tvar text = (characterLimit-strip.length);\n\t\t\ttinymce.DOM.setHTML(tinymce.DOM.get(tinyMCE.activeEditor.id + '_path_row'), text);\n\t\t\t});\n\t\t}\n\n\t});\n</script>";
            }
            require_once 'includes/content/sign.php';
            break;
        case 'stats':
            require_once 'includes/content/stats.php';
            break;
        default:
            require_once 'includes/content/posts.php';
    }
开发者ID:adelnoureddine,项目名称:angora-guestbook,代码行数:31,代码来源:index.php

示例5: userSched

    public static function userSched()
    {
        global $lng, $coach, $settings, $leagues, $divisions, $tours;
        if (!is_object($coach)) {
            status(false, "You must be logged in to schedule games");
            return;
        }
        if (isset($_POST['creategame'])) {
            // Test input
            $trid = (int) $_POST['trid'];
            $round = (int) $_POST['round'];
            $own_team = (int) $_POST['own_team'];
            $errmsg = '';
            // Logged in coach has access to the tour?
            if (!in_array($trid, array_keys($tours))) {
                $errmsg = 'You do not have access to the tournament ' . $tours[$trid]['tname'];
            }
            // Is the team is really owned by the logged in coach?
            if ($coach->coach_id != get_alt_col('teams', 'team_id', $own_team, 'owned_by_coach_id')) {
                $errmsg = 'The team ' . get_alt_col('teams', 'team_id', $own_team, 'name') . ' is not owned by you';
            }
            // Create match
            if (!$errmsg) {
                list($exitStatus, $mid) = Match::create(array('team1_id' => $own_team, 'team2_id' => get_alt_col('teams', 'name', $_POST['opposing_team_autocomplete'], 'team_id'), 'round' => $round, 'f_tour_id' => $trid));
                $backFromMatchLink = Mobile::isMobile() ? "index.php?mobile=1" : "index.php?section=matches&amp;type=report&amp;mid={$mid}";
                status(!$exitStatus, $exitStatus ? Match::$T_CREATE_ERROR_MSGS[$exitStatus] : "<a href='{$backFromMatchLink}'>Click here</a> to open the match report");
                if (!$exitStatus) {
                    echo "<br>";
                }
            } else {
                status(false, $errmsg);
            }
        }
        $trid = isset($_GET['trid']) && is_numeric($_GET['trid']) ? (int) $_GET['trid'] : 0;
        $lid = $trid ? get_parent_id(T_NODE_TOURNAMENT, $trid, T_NODE_LEAGUE) : false;
        $lname = $lid ? get_parent_name(T_NODE_TOURNAMENT, $trid, T_NODE_LEAGUE) : '- N/A -';
        $did = $trid && get_alt_col('leagues', 'lid', $lid, 'tie_teams') == 1 ? get_parent_id(T_NODE_TOURNAMENT, $trid, T_NODE_DIVISION) : false;
        $dname = $did ? get_parent_name(T_NODE_TOURNAMENT, $trid, T_NODE_DIVISION) : false;
        $_DISABLED = !$trid ? 'DISABLED' : '';
        #print_r(array($trid, $lid, $lname, $did));
        title($lng->getTrn('menu/matches_menu/usersched'));
        $LOCK_FORMS = false;
        ?>
    <div class='boxCommon'>
        <h3 class='boxTitle<?php 
        echo T_HTMLBOX_MATCH;
        ?>
'><?php 
        echo $lng->getTrn('menu/matches_menu/usersched');
        ?>
</h3>
        <div class='boxBody'>
            <form method="POST" id="usersched">
                <?php 
        echo "In tournament ";
        echo HTMLOUT::nodeList(T_NODE_TOURNAMENT, 'trid', array(T_NODE_TOURNAMENT => array('locked' => 0, 'type' => TT_FFA, 'allow_sched' => 1)), array(), array('sel_id' => $trid, 'extra_tags' => array('onChange="document.location.href = \'' . getFormAction('?section=matches&type=usersched') . '&trid=\' + $(this).val();"'), 'init_option' => '<option value="0">- ' . $lng->getTrn('matches/usersched/selecttour') . " -</option>\n"));
        echo ' as ';
        echo '<select name="round" id="round" ' . $_DISABLED . '>';
        $T_ROUNDS = Match::getRounds();
        foreach ($T_ROUNDS as $r => $d) {
            echo "<option value='{$r}' " . ($r == 1 ? 'SELECTED' : '') . ">" . $d . "</option>\n";
        }
        ?>
                </select>
                <br><br>
                Your team
                <?php 
        $teams = array();
        foreach ($coach->getTeams($lid, $did, array('sortby' => 'team_id DESC')) as $t) {
            if (!$t->rdy || $t->is_retired) {
                continue;
            }
            $teams[] = $t;
        }
        ?>
                <select name='own_team' id='own_team' <?php 
        echo $_DISABLED;
        ?>
>
                    <?php 
        echo "<optgroup class='leagues' label='{$lname}'>\n";
        if ($dname) {
            echo "<optgroup class='divisions' label='&nbsp;&nbsp;{$dname}'>\n";
        }
        foreach ($teams as $t) {
            echo "<option style='background-color: white; margin-left: -1em;' value='{$t->team_id}'>&nbsp;&nbsp;&nbsp;{$t->name}</option>\n";
        }
        ?>
                </select>
                &nbsp;
                VS.
                <input type="text" id='opposing_team_autoselect' name="opposing_team_autocomplete" size="30" maxlength="50" <?php 
        echo $_DISABLED;
        ?>
>
                <script>
                    $(document).ready(function(){
                        var options, b;

                        options = {
//.........这里部分代码省略.........
开发者ID:TheNAF,项目名称:naflm,代码行数:101,代码来源:class_match_htmlout.php

示例6: sec_login


//.........这里部分代码省略.........
                $correct_user = $c->mail == $_POST['email'];
                status($correct_user, $correct_user ? '' : $lng->getTrn('login/mismatch'));
                if ($correct_user) {
                    $c->requestPasswdReset();
                    echo "<br><br>";
                    echo $lng->getTrn('login/resetpasswdmail') . '.';
                } else {
                    // Return to same page.
                    unset($_POST['coach']);
                    unset($_POST['email']);
                    $_POST['_retry'] = true;
                    sec_login();
                }
            } else {
                ?>
            <div class='boxCommon'>
                <h3 class='boxTitle<?php 
                echo T_HTMLBOX_COACH;
                ?>
'><?php 
                echo $lng->getTrn('login/forgotpass');
                ?>
</h3>
                <div class='boxBody'>
                <form method="POST" action="<?php 
                echo $_URL_forgotpass;
                ?>
">
                    <?php 
                echo $lng->getTrn('login/loginname');
                ?>
<br>
                    <input type="text" name="coach_AC" size="20" maxlength="50">
                    <br><br>
                    Email<br>
                    <input type="text" name="email" size="20" maxlength="50">
                    <br><br>
                    <input type="submit" name="reqAC" value="<?php 
                echo $lng->getTrn('common/submit');
                ?>
">
                </form>
                </div>
            </div>
            <?php 
            }
        }
    } else {
        title($lng->getTrn('menu/login'));
        ?>
        <div class='boxCommon'>
            <h3 class='boxTitle<?php 
        echo T_HTMLBOX_COACH;
        ?>
'><?php 
        echo $lng->getTrn('menu/login');
        ?>
</h3>
            <div class='boxBody'>
            <form method="POST" action="<?php 
        echo getFormAction('');
        ?>
">
                <?php 
        echo $lng->getTrn('login/loginname');
        ?>
<br>
                <input type="text" name="coach" size="20" maxlength="50"><br><br>
                <?php 
        echo $lng->getTrn('login/passwd');
        ?>
<br>
                <input type="password" name="passwd" size="20" maxlength="50">
                <div style='display: none;'><input type='text' name='hackForHittingEnterToLogin' size='1'></div>
                <br><br>
                <?php 
        echo $lng->getTrn('login/remember');
        ?>
                <input type='checkbox' name='remember' value='1'>
                <br><br>
                <input type="submit" name="login" value="<?php 
        echo $lng->getTrn('login/loginbutton');
        ?>
">
            </form>
            <br><br>
            <?php 
        if (!Mobile::isMobile()) {
            if (Module::isRegistered('Registration') && $settings['allow_registration']) {
                echo "<a href='handler.php?type=registration'><b>Register</b></a>";
            }
            echo "<br><br>";
            echo "<a href='{$_URL_forgotpass}'><b>" . $lng->getTrn('login/forgotpass') . '</b></a>';
        }
        ?>
            </div>
        </div>
        <?php 
    }
}
开发者ID:rythos42,项目名称:naflm,代码行数:101,代码来源:sections.php

示例7: _teamManagementBox


//.........这里部分代码省略.........
:<br>
                <select name="thing">
                <?php 
                $DISABLE = true;
                foreach ($team->getGoods() as $name => $details) {
                    if ($name == 'ff_bought' && !$team->mayBuyFF()) {
                        continue;
                    }
                    if ($team->{$name} > 0) {
                        echo "<option value='{$name}'>{$details['item']}</option>\n";
                        $DISABLE = false;
                    }
                }
                ?>
                </select>
                <input type="hidden" name="type" value="drop_goods">
                <?php 
                break;
                /**************
                 * Set ready state
                 **************/
            /**************
             * Set ready state
             **************/
            case 'ready_state':
                echo $lng->getTrn('profile/team/box_tm/desc/ready_state');
                ?>
                <hr><br>
                <?php 
                echo $lng->getTrn('profile/team/box_tm/fdescs/teamready');
                ?>
                <input type="checkbox" name="bool" value="1" <?php 
                echo $team->rdy ? 'CHECKED' : '';
                ?>
>
                <input type="hidden" name="type" value="ready_state">
                <?php 
                break;
                /***************
                 * Retire
                 **************/
            /***************
             * Retire
             **************/
            case 'retire':
                echo $lng->getTrn('profile/team/box_tm/desc/retire');
                ?>
                <hr><br>
                <?php 
                echo $lng->getTrn('profile/team/box_tm/fdescs/retire');
                ?>
                <input type="checkbox" name="bool" value="1">
                <input type="hidden" name="type" value="retire">
                <?php 
                break;
                /***************
                 * Delete
                 **************/
            /***************
             * Delete
             **************/
            case 'delete':
                echo $lng->getTrn('profile/team/box_tm/desc/delete');
                if (!$this->isDeletable()) {
                    $DISABLE = true;
                }
                ?>
                <hr><br>
                <?php 
                echo $lng->getTrn('profile/team/box_tm/fdescs/suredeleteteam');
                ?>
                <input type="checkbox" name="bool" value="1" <?php 
                echo $DISABLE ? 'DISABLED' : '';
                ?>
>
                <input type="hidden" name="type" value="delete">
                <?php 
                break;
        }
        ?>
            <br><br>
            <input type="submit" name="button" value="OK" <?php 
        echo $DISABLE ? 'DISABLED' : '';
        ?>
                <?php 
        if (in_array($_POST['menu_tmanage'], $tmange_confirm)) {
            echo "onClick=\"if(!confirm('" . $lng->getTrn('common/confirm_box') . "')){return false;}\"";
        }
        ?>
            >
            <?php 
        if (Mobile::isMobile()) {
            echo '<a href="' . getFormAction('') . '">' . $lng->getTrn('common/back') . '</a>';
        }
        ?>
        </form>
    </div>
</div>
<?php 
    }
开发者ID:TheNAF,项目名称:naflm,代码行数:101,代码来源:class_team_htmlout.php


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