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


PHP Status::to_css_class方法代码示例

本文整理汇总了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;
 }
开发者ID:jlsa,项目名称:justitia,代码行数:29,代码来源:PageWithEntity.php

示例2: write_the_submission

 function write_the_submission()
 {
     if (isset($_REQUEST['redirect'])) {
         echo '<a href="' . htmlspecialchars($_REQUEST['redirect']) . '">&larr; 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();
 }
开发者ID:jlsa,项目名称:justitia,代码行数:9,代码来源:admin_view_submission.php

示例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) . '">&larr; prev</a> | ';
     }
     echo '<a href="admin_submissions.php?start=' . ($start + 10) . '">next &rarr;</a>';
 }
开发者ID:jlsa,项目名称:justitia,代码行数:15,代码来源:admin_submissions.php

示例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--;
         }
     }
 }
开发者ID:jlsa,项目名称:justitia,代码行数:23,代码来源:admin_user_submission.php

示例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);
}
开发者ID:jlsa,项目名称:justitia,代码行数:24,代码来源:ajax_submission.php

示例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";
 }
开发者ID:jlsa,项目名称:justitia,代码行数:40,代码来源:admin_results.php

示例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();
 }
开发者ID:jlsa,项目名称:justitia,代码行数:16,代码来源:index.php


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