本文整理汇总了PHP中Settings::get_Settings方法的典型用法代码示例。如果您正苦于以下问题:PHP Settings::get_Settings方法的具体用法?PHP Settings::get_Settings怎么用?PHP Settings::get_Settings使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Settings
的用法示例。
在下文中一共展示了Settings::get_Settings方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: require_login
<?php
// Display lists of image sources, or lists of projects that used image sources
// List contents vary with user permissions
$relPath = '../../pinc/';
include_once $relPath . 'base.inc';
include_once $relPath . 'theme.inc';
include_once $relPath . 'project_states.inc';
include_once $relPath . 'dpsql.inc';
include_once $relPath . 'misc.inc';
// array_get()
include_once $relPath . 'pg.inc';
require_login();
$theme_args['css_data'] = "\nh1 { margin-top: 1em; }\ntable.individual { border-collapse: collapse; width: 80%; margin: auto; }\ntable.individual td,th { border: 1px solid #999; padding: 5px; }\ntable.individual td.center { text-align: center; }\ntable.individual th { background-color: #eeeeee; }\n.headerbg { background-color: " . $theme['color_logobar_bg'] . "; }\n\ntable.listing { width: 90%; margin: auto; border: solid black 1px; border-collapse: collapse; }\ntable.listing td,th { padding: 5px; }\ntable.listing th { background-color: #eeeeee; }\ntable.listing th + td { vertical-align: top; border: none; }\ntable.listing th.tl { vertical-align: top; text-align: left; border: none;}\ntable.listing td.center { text-align: center; }\ntr.first { border-top: double black; }\n.fullname { font-size: 120%; }\n.sourcelink { font-size: 90%; margin: 10px 0px 3px 25px; }\n.w15 { width: 15%; }\n";
$which = get_enumerated_param($_GET, 'which', 'DONE', array('ALL', 'DONE', 'INPROG'));
$locuserSettings =& Settings::get_Settings($pguser);
// ---------------------------------------
// Page construction varies with whether the user is logged in or out
if (isset($GLOBALS['pguser'])) {
$logged_in = TRUE;
} else {
$logged_in = FALSE;
}
if ($logged_in) {
if (user_is_image_sources_manager()) {
$min_vis_level = 0;
} else {
if (user_is_PM()) {
$min_vis_level = 1;
} else {
$min_vis_level = 2;
示例2: log_request_for_approval
function log_request_for_approval($requestor_username)
{
global $general_help_email_addr, $image_sources_manager_addr, $code_url, $site_abbreviation, $site_name, $site_signoff;
$userSettings =& Settings::get_Settings($requestor_username);
$userSettings->add_value('is_approval_notify', $this->code_name);
$subject = sprintf(_('%s: New Image Source proposed'), $site_abbreviation) . " : " . $this->display_name;
$body = "Hello,\n\nYou are receiving this email because\n" . "you are listed as an Image Sources manager at the {$site_name}\n" . "site. If this is an error, please contact <{$general_help_email_addr}>.\n\n" . "{$requestor_username} has proposed that {$this->display_name} be added\n" . "to the list of Image Sources. To edit or approve this Image Source,\n" . "visit\n {$code_url}/tools/project_manager/manage_image_sources.php?action=show_sources#{$this->code_name}" . "\n\n{$site_signoff}";
maybe_mail($image_sources_manager_addr, $subject, $body);
}
示例3: TaskDetails
function TaskDetails($tid)
{
global $requester_u_id, $tasks_url;
global $os_array, $browser_array, $tasks_close_array;
global $pguser;
if (!is_numeric($tid)) {
ShowNotification("Error: task identifier '{$tid}' is not numeric.");
return;
}
$res = mysql_query("SELECT * FROM tasks WHERE task_id = {$tid} LIMIT 1");
if (mysql_num_rows($res) >= 1) {
while ($row = mysql_fetch_assoc($res)) {
$userSettings =& Settings::get_Settings($pguser);
$notification_settings = $userSettings->get_values('taskctr_notice');
if (in_array($tid, $notification_settings) || in_array('all', $notification_settings)) {
$already_notified = 1;
} else {
$already_notified = 0;
}
$opened_by_link = property_format_value('opened_by', $row, FALSE);
$edited_by_link = property_format_value('edited_by', $row, FALSE);
// Task id, summary, and possible Edit/Re-Open Task buttons.
echo "<table class='tasks'>\n";
echo "<tr bgcolor='#ecdbb7'>";
echo "<td width='90%' valign='middle'>";
echo "Task #{$tid} " . property_format_value('task_summary', $row, FALSE);
echo "</td>";
echo "<td width='10%' valign='middle' style='text-align:right;'>";
echo "<form action='{$tasks_url}' method='post'>\n";
if ((user_is_a_sitemanager() || user_is_taskcenter_mgr() || $row['opened_by'] == $requester_u_id) && empty($row['closed_reason'])) {
echo "<input type='hidden' name='action' value='show_editing_form'>\n";
echo "<input type='hidden' name='task_id' value='{$tid}'>\n";
echo "<input type='submit' value='Edit Task' class='taskinp2'>\n";
} elseif (!empty($row['closed_reason'])) {
echo "<input type='hidden' name='action' value='reopen'>\n";
echo "<input type='hidden' name='task_id' value='{$tid}'>\n";
echo "<input type='submit' value='Re-Open Task' class='taskinp2'>\n";
} else {
echo " \n";
}
echo "</form>";
echo "</td>";
echo "</tr>";
echo "</table>\n";
echo "<table class='tasks'>\n";
// Row 1: Opened & Last edited. Link to toggle task notifications.
echo "<tr>";
echo "<td width='50%'>";
echo "<small class='task'>";
echo "Opened by {$opened_by_link} - " . property_format_value('date_opened', $row, FALSE);
echo "<br />";
echo "Last edited by {$edited_by_link} - " . property_format_value('date_edited', $row, FALSE);
echo "</small>";
echo "</td>";
echo "<td width='50%' style='text-align:right;'>";
if (empty($already_notified)) {
echo "<a href='{$tasks_url}?action=notify_me&task_id={$tid}'>Signup for task notifications</a>";
} else {
echo "<a href='{$tasks_url}?action=unnotify_me&task_id={$tid}'>Remove me from task notifications</a>";
}
echo "</tr>\n";
// Row 2: most of the task's simple properties
echo "<tr>";
echo "<td width='40%'>";
echo "<table class='taskplain'>\n";
property_echo_value_tr('task_type', $row);
property_echo_value_tr('task_category', $row);
property_echo_value_tr('task_status', $row);
property_echo_value_tr('task_assignee', $row);
property_echo_value_tr('task_os', $row);
echo "</table>";
echo "</td>";
echo "<td width='50%'>";
echo "<table class='taskplain'>\n";
property_echo_value_tr('task_browser', $row);
property_echo_value_tr('task_severity', $row);
property_echo_value_tr('task_priority', $row);
property_echo_value_tr('task_version', $row);
property_echo_value_tr('percent_complete', $row);
echo "</table>";
echo "</td>";
echo "</tr>\n";
// Row 3: summary of votes/metoos
$voteInfo = mysql_query("SELECT id FROM tasks_votes WHERE task_id = {$tid}");
$osInfo = mysql_query("SELECT DISTINCT vote_os FROM tasks_votes WHERE task_id = {$tid}");
$browserInfo = mysql_query("SELECT DISTINCT vote_browser FROM tasks_votes WHERE task_id = {$tid}");
if (mysql_num_rows($voteInfo) > 0) {
$reportedOS = "";
$reportedBrowser = "";
echo "<tr>";
echo "<td colspan='2'>";
echo "<table class='taskplain'>";
echo "<tr>";
echo "<td width='25%'>";
echo "<b>Votes </b>";
echo "</td>\n";
echo "<td width='75%'>";
echo mysql_num_rows($voteInfo);
echo "</td>";
echo "</tr>";
//.........这里部分代码省略.........
示例4: die
// And it's an action hat is valid for the subject user at the current time.
// So put it on the queue.
// (Don't execute any actions unless they're all valid.)
$actions[$activity_id] = $action_type;
}
if (count($actions) == 0) {
die("Warning: you did not specify any modifications");
}
echo "<br>\n";
echo "Those modifications appear to be valid.<br>\n";
echo "Performing them now...<br>\n";
foreach ($actions as $activity_id => $action_type) {
echo "<br>\n";
echo "{$action_type} {$activity_id} ...<br>\n";
$yesno = $action_type == 'grant' ? 'yes' : 'no';
$userSettings =& Settings::get_Settings($subject_username);
$userSettings->set_value("{$activity_id}.access", $yesno);
log_access_change($subject_username, $pguser, $activity_id, $action_type);
}
echo "<br>\n";
echo "Done<br>\n<br>\n";
if ($notify_user) {
echo "Notifying user... " . notify_user($subject_username, $actions) . "<br>\n<br>\n";
}
echo "Hit 'Back' to return to user's detail page. (And you may need to reload.)<br>\n";
// -----------------------------------------------------------------------------
function notify_user($username, $actions)
{
global $site_name, $site_signoff;
$user = new User($username);
if (count($actions) == 1 && array_search('grant', $actions) !== false) {