本文整理汇总了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')) {
示例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) {