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


PHP Req::enum方法代码示例

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


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

示例1: define

<?php

/*
   This is the main script that everything else is included
   in.  Mostly what it does is check the user permissions
   to see what they have access to.
*/
define('IN_FS', true);
require_once dirname(__FILE__) . '/header.php';
// Get available do-modes
$modes = str_replace('.php', '', array_map('basename', glob_compat(BASEDIR . "/scripts/*.php")));
$do = Req::enum('do', $modes, $proj->prefs['default_entry']);
if ($do == 'admin' && Req::has('switch') && Req::val('project') != '0') {
    $do = 'pm';
} elseif ($do == 'pm' && Req::has('switch') && Req::val('project') == '0') {
    $do = 'admin';
} elseif (Req::has('show') || Req::has('switch') && $do == 'details' || $do == 'newtask' && Req::val('project') == '0') {
    $do = 'index';
} elseif (Req::has('code')) {
    $_SESSION['oauth_provider'] = 'microsoft';
    $do = 'oauth';
} elseif (Req::has('do') && Req::val('do') == 'tasklist') {
    $do = 'index';
}
// supertask_id for add new sub-task
$supertask_id = 0;
if (Req::has('supertask')) {
    $supertask_id = Req::val('supertask');
}
/* permission stuff */
if (Cookie::has('flyspray_userid') && Cookie::has('flyspray_passhash')) {
开发者ID:kandran,项目名称:flyspray,代码行数:31,代码来源:index.php

示例2: die

if (!defined('IN_FS')) {
    die('Do not access this file directly.');
}
if (!$user->perms('view_reports')) {
    Flyspray::Redirect($baseurl);
}
require_once BASEDIR . '/includes/events.inc.php';
$page->setTitle($fs->prefs['page_title'] . L('reports'));
/**********************\
*  Event reports       *
\**********************/
$events = array(1 => L('opened'), 13 => L('reopened'), 2 => L('closed'), 3 => L('edited'), 14 => L('assignmentchanged'), 29 => L('events.useraddedtoassignees'), 4 => L('commentadded'), 5 => L('commentedited'), 6 => L('commentdeleted'), 7 => L('attachmentadded'), 8 => L('attachmentdeleted'), 11 => L('relatedadded'), 12 => L('relateddeleted'), 9 => L('notificationadded'), 10 => L('notificationdeleted'), 17 => L('reminderadded'), 18 => L('reminderdeleted'));
$user_events = array(30 => L('created'), 31 => L('deleted'));
$page->assign('events', $events);
$page->assign('user_events', $user_events);
$sort = strtoupper(Req::enum('sort', array('desc', 'asc')));
$where = array();
$params = array();
$orderby = '';
switch (Req::val('order')) {
    case 'type':
        $orderby = "h.event_type {$sort}, h.event_date {$sort}";
        break;
    case 'user':
        $orderby = "user_id {$sort}, h.event_date {$sort}";
        break;
    case 'date':
    default:
        $orderby = "h.event_date {$sort}, h.event_type {$sort}";
}
foreach (Req::val('events', array()) as $eventtype) {
开发者ID:manishkhanchandani,项目名称:mkgxy,代码行数:31,代码来源:reports.php


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