本文整理汇总了PHP中Status::to_css_class方法的典型用法代码示例。如果您正苦于以下问题:PHP Status::to_css_class方法的具体用法?PHP Status::to_css_class怎么用?PHP Status::to_css_class使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Status
的用法示例。
在下文中一共展示了Status::to_css_class方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_nav_children
function get_nav_children($e)
{
$result = array();
foreach ($e->children() as $e) {
if (!$e->visible()) {
continue;
}
$class = '';
if ($e == $this->entity) {
$class .= 'current ';
if ($e->has_visible_children()) {
$class .= 'ancestor ';
}
} else {
if ($e->is_ancestor_of($this->entity)) {
$class .= 'ancestor ';
}
}
if ($e->submitable()) {
$subm = Authentication::current_user()->status_of_last_submission_to($e);
$class .= Status::to_css_class($subm) . ' ';
}
if (!$e->active()) {
$class .= 'inactive ';
}
$result[] = array('title' => $e->title(), 'url' => $this->nav_script($e) . $e->path(), 'class' => $class);
}
return $result;
}
示例2: write_the_submission
function write_the_submission()
{
if (isset($_REQUEST['redirect'])) {
echo '<a href="' . htmlspecialchars($_REQUEST['redirect']) . '">← back</a>';
}
$this->write_block_begin("Submission", 'block submission ' . Status::to_css_class($this->subm), '', "submission-" . $this->subm->submissionid);
write_submission($this->subm, $this->entity, true);
$this->write_block_end();
}
示例3: write_submissions
function write_submissions()
{
$start = isset($_REQUEST['start']) ? (int) $_REQUEST['start'] : 0;
$subms = $this->entity->latest_submissions($start, 10);
foreach ($subms as $subm) {
$entity = $subm->entity();
$this->write_block_begin($subm->submissionid . ': ' . $entity->title(), 'collapsable block submission ' . Status::to_css_class($subm), '', 'submission-' . $subm->submissionid);
write_submission($subm, $entity, true);
$this->write_block_end();
}
if ($start > 0) {
echo '<a href="admin_submissions.php?start=' . ($start - 10) . '">← prev</a> | ';
}
echo '<a href="admin_submissions.php?start=' . ($start + 10) . '">next →</a>';
}
示例4: write_body
function write_body()
{
echo '<a href="admin_results.php' . htmlspecialchars($this->entity->path()) . '">view all users</a>';
// list submissions
$submissions = $this->user->submissions_to($this->entity);
if (empty($submissions)) {
echo "<em>no submissions have been made for this assignment by this user.</em>";
} else {
$i = count($submissions);
foreach ($submissions as $subm) {
// is this an interesting submission?
$is_interesting = true;
if ($is_interesting) {
$last_submission = $subm;
}
// write
$this->write_block_begin('Submission ' . $i, 'collapsable block submission ' . ($is_interesting ? '' : 'collapsed ') . Status::to_css_class($subm), '', "submission-{$subm->submissionid}");
write_submission($subm, $this->entity);
$this->write_block_end();
$i--;
}
}
}
示例5: intval
<?php
require_once '../lib/bootstrap.inc';
require_once './submission_view.inc';
// -----------------------------------------------------------------------------
// Ajax utility: view a submission for autorefresh
// -----------------------------------------------------------------------------
$submissionid = intval(@$_REQUEST['submissionid']);
$subm = Submission::by_id($submissionid);
$write_block = (isset($_GET['write_block']) and $_GET['write_block'] == "true");
// check access rights
$user = Authentication::require_user();
if (!$user->is_admin && !$subm->is_made_by($user)) {
die("You have no rights to view this submission");
}
if ($write_block) {
$entity = $subm->entity();
Template::write_block_begin($subm->submissionid . ': ' . $entity->title(), 'collapsable block submission ' . Status::to_css_class($subm), '', 'submission-' . $subm->submissionid);
write_submission($subm);
Template::write_block_end();
} else {
echo "<div class=\"newstatus ", Status::to_css_class($subm), "\"></div>";
write_submission($subm);
}
示例6: write_submission_results
function write_submission_results($entities, $users)
{
echo "<table class=\"results\">\n";
// heading
echo "<thead>";
$entity_layers = layered_descendants($this->entity);
print_layers_header($entity_layers);
echo "</thead><tbody>\n";
// user results
$first = true;
foreach ($users as $userinfo) {
$subms = $userinfo['subms'];
$user = $userinfo['user'];
if ($first) {
echo '<tr class="first-child">';
$first = false;
} else {
echo '<tr>';
}
// username
echo '<td><a href="admin_user.php?edit=' . urlencode($user->userid) . '">' . htmlspecialchars($user->name_and_login()) . '</a></td>';
// submissions
foreach ($entities as $e => $entity) {
$subm = isset($subms[$e]) ? $subms[$e] : false;
$status = Status::to_status($subm);
echo '<td class="' . Status::to_css_class($status) . '">';
if ($subm !== false) {
echo '<a href="admin_user_submission.php' . htmlspecialchars($entity->path()) . '?userid=' . $user->userid . '">';
}
echo Status::to_short_text($status);
if ($subm !== false) {
echo '</a>';
}
echo '</td>';
}
echo "</tr>\n";
}
$this->write_submission_summary($entities, $users);
echo "</tbody></table>\n";
}
示例7: write_overview_item
function write_overview_item($e)
{
if (!$e->visible()) {
return;
}
$class = '';
if ($e->submitable()) {
$subm = Authentication::current_user()->status_of_last_submission_to($e);
$class .= Status::to_css_class($subm) . ' ';
}
if (!$e->active()) {
$class .= 'inactive ';
}
$this->write_block_begin($e->title(), 'collapsed linky block ' . $class, 'index.php' . $e->path());
$this->write_block_end();
}