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


PHP print_arrow函数代码示例

本文整理汇总了PHP中print_arrow函数的典型用法代码示例。如果您正苦于以下问题:PHP print_arrow函数的具体用法?PHP print_arrow怎么用?PHP print_arrow使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: get_studentnameshtml

 function get_studentnameshtml()
 {
     global $CFG, $USER;
     $studentshtml = '';
     $showuserimage = $this->get_pref('showuserimage');
     $showuseridnumber = $this->get_pref('showuseridnumber');
     $fixedstudents = $this->is_fixed_students();
     $strsortasc = $this->get_lang_string('sortasc', 'grades');
     $strsortdesc = $this->get_lang_string('sortdesc', 'grades');
     $strfirstname = $this->get_lang_string('firstname');
     $strlastname = $this->get_lang_string('lastname');
     if ($this->sortitemid === 'lastname') {
         if ($this->sortorder == 'ASC') {
             $lastarrow = print_arrow('up', $strsortasc, true);
         } else {
             $lastarrow = print_arrow('down', $strsortdesc, true);
         }
     } else {
         $lastarrow = '';
     }
     if ($this->sortitemid === 'firstname') {
         if ($this->sortorder == 'ASC') {
             $firstarrow = print_arrow('up', $strsortasc, true);
         } else {
             $firstarrow = print_arrow('down', $strsortdesc, true);
         }
     } else {
         $firstarrow = '';
     }
     if ($fixedstudents) {
         $studentshtml .= '<div class="left_scroller">
             <table id="fixed_column" class="fixed_grades_column">
                 <tbody class="leftbody">';
         $colspan = '';
         if ($showuseridnumber) {
             $colspan = 'colspan="2"';
         }
         $levels = count($this->gtree->levels) - 1;
         for ($i = 0; $i < $levels; $i++) {
             $studentshtml .= '
                     <tr class="heading name_row">
                         <td ' . $colspan . ' class="fixedcolumn cell c0 topleft">&nbsp;</td>
                     </tr>
                     ';
         }
         $studentshtml .= '<tr class="heading"><th id="studentheader" class="header c0" scope="col"><a href="' . $this->baseurl . '&amp;sortitemid=firstname">' . $strfirstname . '</a> ' . $firstarrow . '/ <a href="' . $this->baseurl . '&amp;sortitemid=lastname">' . $strlastname . '</a>' . $lastarrow . '</th>';
         if ($showuseridnumber) {
             if ('idnumber' == $this->sortitemid) {
                 if ($this->sortorder == 'ASC') {
                     $idnumberarrow = print_arrow('up', $strsortasc, true);
                 } else {
                     $idnumberarrow = print_arrow('down', $strsortdesc, true);
                 }
             } else {
                 $idnumberarrow = '';
             }
             $studentshtml .= '<th class="header c0 useridnumber" scope="col"><a href="' . $this->baseurl . '&amp;sortitemid=idnumber">' . get_string('idnumber') . '</a> ' . $idnumberarrow . '</th>';
         }
         $studentshtml .= '</tr>';
         if ($USER->gradeediting[$this->courseid]) {
             $studentshtml .= '<tr class="controls"><th class="header c0 controls" scope="row" ' . $colspan . '>' . $this->get_lang_string('controls', 'grades') . '</th></tr>';
         }
         $row_classes = array(' even ', ' odd ');
         foreach ($this->users as $userid => $user) {
             $user_pic = null;
             if ($showuserimage) {
                 $user_pic = '<div class="userpic">' . print_user_picture($user, $this->courseid, NULL, 0, true) . "</div>\n";
             }
             $studentshtml .= '<tr class="r' . $this->rowcount++ . $row_classes[$this->rowcount % 2] . '">' . '<th class="c0 user" scope="row" onclick="set_row(this.parentNode.rowIndex);">' . $user_pic . '<a href="' . $CFG->wwwroot . '/user/view.php?id=' . $user->id . '&amp;course=' . $this->course->id . '">' . fullname($user) . "</a></th>\n";
             if ($showuseridnumber) {
                 $studentshtml .= '<th class="header c0 useridnumber" onclick="set_row(this.parentNode.rowIndex);">' . $user->idnumber . "</th>\n";
             }
             $studentshtml .= "</tr>\n";
         }
         if ($this->get_pref('showranges')) {
             $studentshtml .= '<tr class="range r' . $this->rowcount++ . '">' . '<th class="header c0 range " ' . $colspan . ' scope="row">' . $this->get_lang_string('range', 'grades') . '</th></tr>';
         }
         // Averages heading
         $straverage_group = get_string('groupavg', 'grades');
         $straverage = get_string('overallaverage', 'grades');
         $showaverages = $this->get_pref('showaverages');
         $showaverages_group = $this->currentgroup && $showaverages;
         if ($showaverages_group) {
             $studentshtml .= '<tr class="groupavg r' . $this->rowcount++ . '"><th class="header c0" ' . $colspan . 'scope="row">' . $straverage_group . '</th></tr>';
         }
         if ($showaverages) {
             $studentshtml .= '<tr class="avg r' . $this->rowcount++ . '"><th class="header c0" ' . $colspan . 'scope="row">' . $straverage . '</th></tr>';
         }
         $studentshtml .= '</tbody>
             </table>
         </div>
         <div class="right_scroller">
             <table id="user-grades" class="">
                 <tbody class="righttest">';
     } else {
         $studentshtml .= '<table id="user-grades" class="gradestable flexible boxaligncenter generaltable">
                             <tbody>';
     }
     return $studentshtml;
 }
开发者ID:kai707,项目名称:ITSA-backup,代码行数:100,代码来源:lib.php

示例2: get_sort_arrows

    /**
     * Refactored function for generating HTML of sorting links with matching arrows.
     * Returns an array with 'studentname' and 'idnumber' as keys, with HTML ready
     * to inject into a table header cell.
     * @return array An associative array of HTML sorting links+arrows
     */
    public function get_sort_arrows() {
        global $OUTPUT;
        $arrows = array();

        $strsortasc   = $this->get_lang_string('sortasc', 'grades');
        $strsortdesc  = $this->get_lang_string('sortdesc', 'grades');
        $strfirstname = $this->get_lang_string('firstname');
        $strlastname  = $this->get_lang_string('lastname');

        $firstlink = html_writer::link(new moodle_url($this->baseurl, array('sortitemid'=>'firstname')), $strfirstname);
        $lastlink = html_writer::link(new moodle_url($this->baseurl, array('sortitemid'=>'lastname')), $strlastname);
        $idnumberlink = html_writer::link(new moodle_url($this->baseurl, array('sortitemid'=>'idnumber')), get_string('idnumber'));

        $arrows['studentname'] = $lastlink;

        if ($this->sortitemid === 'lastname') {
            if ($this->sortorder == 'ASC') {
                $arrows['studentname'] .= print_arrow('up', $strsortasc, true);
            } else {
                $arrows['studentname'] .= print_arrow('down', $strsortdesc, true);
            }
        }

        $arrows['studentname'] .= ' ' . $firstlink;

        if ($this->sortitemid === 'firstname') {
            if ($this->sortorder == 'ASC') {
                $arrows['studentname'] .= print_arrow('up', $strsortasc, true);
            } else {
                $arrows['studentname'] .= print_arrow('down', $strsortdesc, true);
            }
        }

        $arrows['idnumber'] = $idnumberlink;

        if ('idnumber' == $this->sortitemid) {
            if ($this->sortorder == 'ASC') {
                $arrows['idnumber'] .= print_arrow('up', $strsortasc, true);
            } else {
                $arrows['idnumber'] .= print_arrow('down', $strsortdesc, true);
            }
        }

        return $arrows;
    }
开发者ID:nuckey,项目名称:moodle,代码行数:51,代码来源:lib.php

示例3: get_sort_arrow

 /**
  * Returns an arrow icon inside an <a> tag, for the purpose of sorting a column.
  * @param string $direction
  * @param moodle_url $sort_link
  * @param string HTML
  */
 protected function get_sort_arrow($direction = 'move', $sortlink = null)
 {
     global $OUTPUT;
     $matrix = array('up' => 'desc', 'down' => 'asc', 'move' => 'desc');
     $strsort = $this->get_lang_string('sort' . $matrix[$direction]);
     $arrow = print_arrow($direction, $strsort, true);
     return html_writer::link($sortlink, $arrow, array('title' => $strsort));
 }
开发者ID:saurabh947,项目名称:MoodleLearning,代码行数:14,代码来源:lib.php

示例4: get_sort_arrow

 /**
  * Returns an arrow icon inside an <a> tag, for the purpose of sorting a column.
  * @param string $direction
  * @param string $sort_link
  * @param string HTML
  */
 protected function get_sort_arrow($direction = 'move', $sort_link = null)
 {
     $matrix = array('up' => 'desc', 'down' => 'asc', 'move' => 'desc');
     $strsort = $this->get_lang_string('sort' . $matrix[$direction]);
     $arrow = print_arrow($direction, $strsort, true);
     $html = '<a href="' . $sort_link . '" title="' . $strsort . '">' . $arrow . '</a>';
     return $html;
 }
开发者ID:ajv,项目名称:Offline-Caching,代码行数:14,代码来源:lib.php

示例5: get_sort_arrows

    /**
     * Refactored function for generating HTML of sorting links with matching arrows.
     * Returns an array with 'studentname' and 'idnumber' as keys, with HTML ready
     * to inject into a table header cell.
     * @param array $extrafields Array of extra fields being displayed, such as
     *   user idnumber
     * @return array An associative array of HTML sorting links+arrows
     */
    public function get_sort_arrows(array $extrafields = array()) {
        global $OUTPUT;
        $arrows = array();

        $strsortasc   = $this->get_lang_string('sortasc', 'grades');
        $strsortdesc  = $this->get_lang_string('sortdesc', 'grades');
        $strfirstname = $this->get_lang_string('firstname');
        $strlastname  = $this->get_lang_string('lastname');

        $firstlink = html_writer::link(new moodle_url($this->baseurl, array('sortitemid'=>'firstname')), $strfirstname);
        $lastlink = html_writer::link(new moodle_url($this->baseurl, array('sortitemid'=>'lastname')), $strlastname);

        $arrows['studentname'] = $lastlink;

        if ($this->sortitemid === 'lastname') {
            if ($this->sortorder == 'ASC') {
                $arrows['studentname'] .= print_arrow('up', $strsortasc, true);
            } else {
                $arrows['studentname'] .= print_arrow('down', $strsortdesc, true);
            }
        }

        $arrows['studentname'] .= ' ' . $firstlink;

        if ($this->sortitemid === 'firstname') {
            if ($this->sortorder == 'ASC') {
                $arrows['studentname'] .= print_arrow('up', $strsortasc, true);
            } else {
                $arrows['studentname'] .= print_arrow('down', $strsortdesc, true);
            }
        }

        foreach ($extrafields as $field) {
            $fieldlink = html_writer::link(new moodle_url($this->baseurl,
                    array('sortitemid'=>$field)), get_user_field_name($field));
            $arrows[$field] = $fieldlink;

            if ($field == $this->sortitemid) {
                if ($this->sortorder == 'ASC') {
                    $arrows[$field] .= print_arrow('up', $strsortasc, true);
                } else {
                    $arrows[$field] .= print_arrow('down', $strsortdesc, true);
                }
            }
        }

        return $arrows;
    }
开发者ID:ncsu-delta,项目名称:moodle,代码行数:56,代码来源:lib.php

示例6: print_gauges

function print_gauges()
{
    global $overviewData;
    $web_eu = $overviewData['web_eu'];
    $dataArr = array("web_mem" => $web_eu['memory'], "web_cpu" => $web_eu['cpu'], "web_rps" => $overviewData['web_rps']);
    $threshold = array("web_mem" => 80, "web_cpu" => 90);
    foreach ($dataArr as $key => $data) {
        $curr = $data['current'];
        $prev = $data['previous'];
        $diff = $curr - $prev;
        $label = $data['label'];
        $highest = $data['max'];
        echo '<div class="gauge-wrapper left">';
        if ($key == "web_rps") {
            //no percentage, no color coding
            print_gauge2($key, $label, $curr, 0, 500, $highest);
        } else {
            print_gauge($key, $label, $curr, 0, 100, 40, $threshold[$key], $highest);
            print_arrow($curr - $prev);
        }
        echo '</div>';
        if ($key != "web_rps" && $curr > $threshold[$key]) {
            global $warnMsgArr;
            $warnMsgArr[] = "Web " . $label . " has exceeded its warning threshold of " . $threshold[$key] . "%.";
        }
    }
}
开发者ID:shourya07,项目名称:zperfmon,代码行数:27,代码来源:index.php

示例7: get_headerhtml

 /**
  * Builds and returns the HTML code for the headers.
  * @return string $headerhtml
  */
 function get_headerhtml()
 {
     global $CFG, $USER;
     //        $this->rowcount = 0;
     $fixedstudents = $this->is_fixed_students();
     $strsortasc = $this->get_lang_string('sortasc', 'grades');
     $strsortdesc = $this->get_lang_string('sortdesc', 'grades');
     $strfirstname = $this->get_lang_string('firstname');
     $strlastname = $this->get_lang_string('lastname');
     $showuseridnumber = $this->get_pref('showuseridnumber');
     $showuserimage = $this->get_pref('showuserimage');
     $showquickfeedback = $this->get_pref('showquickfeedback');
     if ($showquickfeedback && $USER->gradeediting[$this->courseid]) {
         $minwidth = '; min-width: 180px';
     } else {
         $minwidth = '';
     }
     // figure out how wide we should make the names column
     $namewidth = 1;
     foreach ($this->users as $user) {
         $namewidth = max($namewidth, strlen($user->firstname), strlen($user->lastname) * 1.4);
     }
     $namewidth = 'style="min-width:' . s(round($namewidth) * 7) . 'px"';
     if ($this->sortitemid === 'lastname') {
         if ($this->sortorder == 'ASC') {
             $lastarrow = print_arrow('up', $strsortasc, true);
         } else {
             $lastarrow = print_arrow('down', $strsortdesc, true);
         }
     } else {
         $lastarrow = '';
     }
     if ($this->sortitemid === 'firstname') {
         if ($this->sortorder == 'ASC') {
             $firstarrow = print_arrow('up', $strsortasc, true);
         } else {
             $firstarrow = print_arrow('down', $strsortdesc, true);
         }
     } else {
         $firstarrow = '';
     }
     // Prepare Table Headers
     $headerhtml = '';
     //        $numrows = count($this->gtree->levels);
     //        $columns_to_unset = array();
     $columncount = 0;
     $headerhtml .= '<tr class="heading r' . $this->rowcount++ . '">';
     //        $colspan = 'colspan="2" ';
     $colspan = '';
     $user_pic = '';
     $name_header = $columncount == 0 ? ' class="name-header"' : '';
     $output = '<div class="inlinebutton" title="Download contents of gradebook as-is to Excel. SAVE CHANGES FIRST!">';
     $output .= '<a href="' . $CFG->wwwroot . '/grade/report/laegrader/index.php?id=' . $this->courseid . '&action=quick-dump" class="inlinebutton"><img src="' . $CFG->wwwroot . '/grade/report/laegrader/copytoexcel.png" /></a></div>';
     $options = array('id' => $this->courseid, 'action' => 'quick-dump');
     $headerhtml .= '<th class=" header c' . $columncount++ . '  nameheader" scope="col" ' . $colspan . $namewidth . '>' . $user_pic . $output . '<a href="' . $this->baseurl . '&amp;sortitemid=firstname">' . $strfirstname . '</a> ' . $firstarrow . '/ <a href="' . $this->baseurl . '&amp;sortitemid=lastname" width="100px"' . $name_header . '>' . $strlastname . '</a>' . $lastarrow . '</th><th class="header gradeheader"></th>';
     //                . '</th><th style="background-color:#ffffff"></th>'; // '#F3DFD0' : '#D0DBF3'
     if ($showuseridnumber) {
         if ('idnumber' == $this->sortitemid) {
             if ($this->sortorder == 'ASC') {
                 $idnumberarrow = print_arrow('up', $strsortasc, true);
             } else {
                 $idnumberarrow = print_arrow('down', $strsortdesc, true);
             }
         } else {
             $idnumberarrow = '';
         }
         $headerhtml .= '<th class="header  c' . $columncount++ . ' useridnumber" scope="col"><a href="' . $this->baseurl . '&amp;sortitemid=idnumber">' . get_string('idnumber') . '</a> ' . $idnumberarrow . '</th>';
     }
     $catcount = 0;
     $catparent = 0;
     foreach ($this->gtree->items as $columnkey => $element) {
         $sort_link = '';
         if (isset($element->id)) {
             $sort_link = $this->baseurl . '&amp;sortitemid=' . $element->id;
         }
         $eid = 'i' . $element->id;
         $object = $element;
         $type = stristr('courseitem,categoryitem', $element->itemtype) ? $element->itemtype . 'item' : 'item';
         $element->type = $type;
         $itemmodule = null;
         $iteminstance = null;
         $columnclass = 'c' . $columncount++;
         $colspan = '';
         $catlevel = '';
         $itemmodule = $object->itemmodule;
         $iteminstance = $object->iteminstance;
         if ($element->id == $this->sortitemid) {
             if ($this->sortorder == 'ASC') {
                 $arrow = $this->get_sort_arrow('up', $sort_link);
             } else {
                 $arrow = $this->get_sort_arrow('down', $sort_link);
             }
         } else {
             $arrow = $this->get_sort_arrow('move', $sort_link);
         }
         $url = $this->baseurl . '&amp;action=display&target=' . $element->id . '&sesskey=' . sesskey();
//.........这里部分代码省略.........
开发者ID:hmatulis,项目名称:RTL-BIDI-Hebrew-Moodle-Plugins,代码行数:101,代码来源:lib.php

示例8: get_headerhtml

 /**
  * Builds and returns the HTML code for the headers.
  * @return string $headerhtml
  */
 function get_headerhtml()
 {
     global $CFG, $USER;
     $strsortasc = $this->get_lang_string('sortasc', 'grades');
     $strsortdesc = $this->get_lang_string('sortdesc', 'grades');
     $strfirstname = $this->get_lang_string('firstname');
     $strlastname = $this->get_lang_string('lastname');
     $showuseridnumber = $this->get_pref('showuseridnumber');
     if ($this->sortitemid === 'lastname') {
         if ($this->sortorder == 'ASC') {
             $lastarrow = print_arrow('up', $strsortasc, true);
         } else {
             $lastarrow = print_arrow('down', $strsortdesc, true);
         }
     } else {
         $lastarrow = '';
     }
     if ($this->sortitemid === 'firstname') {
         if ($this->sortorder == 'ASC') {
             $firstarrow = print_arrow('up', $strsortasc, true);
         } else {
             $firstarrow = print_arrow('down', $strsortdesc, true);
         }
     } else {
         $firstarrow = '';
     }
     // Prepare Table Headers
     $headerhtml = '';
     $numrows = count($this->gtree->levels);
     $columns_to_unset = array();
     foreach ($this->gtree->levels as $key => $row) {
         $columncount = 0;
         if ($key == 0) {
             // do not display course grade category
             // continue;
         }
         $headerhtml .= '<tr class="heading r' . $this->rowcount++ . '">';
         if ($key == $numrows - 1) {
             $headerhtml .= '<th class="header c' . $columncount++ . '" scope="col"><a href="' . $this->baseurl . '&amp;sortitemid=firstname">' . $strfirstname . '</a> ' . $firstarrow . '/ <a href="' . $this->baseurl . '&amp;sortitemid=lastname">' . $strlastname . '</a>' . $lastarrow . '</th>';
             if ($showuseridnumber) {
                 if ('idnumber' == $this->sortitemid) {
                     if ($this->sortorder == 'ASC') {
                         $idnumberarrow = print_arrow('up', $strsortasc, true);
                     } else {
                         $idnumberarrow = print_arrow('down', $strsortdesc, true);
                     }
                 } else {
                     $idnumberarrow = '';
                 }
                 $headerhtml .= '<th class="header c' . $columncount++ . ' useridnumber" scope="col"><a href="' . $this->baseurl . '&amp;sortitemid=idnumber">' . get_string('idnumber') . '</a> ' . $idnumberarrow . '</th>';
             }
         } else {
             $colspan = '';
             if ($showuseridnumber) {
                 $colspan = 'colspan="2" ';
             }
             $headerhtml .= '<td ' . $colspan . 'class="cell c' . $columncount++ . ' topleft">&nbsp;</td>';
             if ($showuseridnumber) {
                 $columncount++;
             }
         }
         foreach ($row as $columnkey => $element) {
             $sort_link = '';
             if (isset($element['object']->id)) {
                 $sort_link = $this->baseurl . '&amp;sortitemid=' . $element['object']->id;
             }
             $eid = $element['eid'];
             $object = $element['object'];
             $type = $element['type'];
             $categorystate = @$element['categorystate'];
             $itemmodule = null;
             $iteminstance = null;
             $columnclass = 'c' . $columncount++;
             if (!empty($element['colspan'])) {
                 $colspan = 'colspan="' . $element['colspan'] . '"';
                 $columnclass = '';
             } else {
                 $colspan = '';
             }
             if (!empty($element['depth'])) {
                 $catlevel = ' catlevel' . $element['depth'];
             } else {
                 $catlevel = '';
             }
             // Element is a filler
             if ($type == 'filler' or $type == 'fillerfirst' or $type == 'fillerlast') {
                 $headerhtml .= '<th class="' . $columnclass . ' ' . $type . $catlevel . '" ' . $colspan . ' scope="col">&nbsp;</th>';
             } else {
                 if ($type == 'category') {
                     $headerhtml .= '<th class="header ' . $columnclass . ' category' . $catlevel . '" ' . $colspan . ' scope="col">' . shorten_text($element['object']->get_name());
                     $headerhtml .= $this->get_collapsing_icon($element);
                     // Print icons
                     if ($USER->gradeediting[$this->courseid]) {
                         $headerhtml .= $this->get_icons($element);
                     }
                     $headerhtml .= '</th>';
//.........这里部分代码省略.........
开发者ID:r007,项目名称:PMoodle,代码行数:101,代码来源:lib.php

示例9: print_arrow

<body onload="refresh_list()">
<div id="main">
<?php 
$page_name = ' - 關鍵字/回應對應表';
include 'header.php';
?>
<script type="text/javascript" src="js/jquery-autocomplete/jquery.autocomplete.js"></script>
<p>請建立<b>『小的機器人』</b>對於『關鍵字』和『回應』的連結 (分別輸入『關鍵字』和相對應的『回應』,會自動帶出系統現有的辭彙,輸入完畢按 Enter): <br>
<span style="font-weight: bold; color: red">注意: 請不要加入具有針對性的關鍵字,否則會考慮封 IP 或直接永久關閉編輯功能</span><br>
關鍵字:<input type="text" size="120" id="origin_input-box" maxlength="140"><span id="origin_rest_length"></span><br />
回應:<input type="text" size="120" id="reply_input-box" maxlength="140"><span id="reply_rest_length"></span>

<hr>
目前資料庫中的關鍵字<?php 
print_arrow();
?>
回應:
<div id="list"></div>
</p>
</div>

<script type="text/javascript">
setTimeout("refresh_list();", 15000);
reply_update_limit();
origin_update_limit();
function origin_update_limit()
{
    $("#origin_rest_length").html((140 - $("#origin_input-box").val().length));
}
function reply_update_limit()
开发者ID:hrs113355,项目名称:OfSmall,代码行数:30,代码来源:link.php

示例10: get_headerhtml

 /**
  * Builds and returns the HTML code for the headers.
  * @return string $headerhtml
  */
 function get_headerhtml()
 {
     global $CFG, $USER;
     $strsortasc = $this->get_lang_string('sortasc', 'grades');
     $strsortdesc = $this->get_lang_string('sortdesc', 'grades');
     $strfirstname = $this->get_lang_string('firstname');
     $strlastname = $this->get_lang_string('lastname');
     if ($this->sortitemid === 'lastname') {
         if ($this->sortorder == 'ASC') {
             $lastarrow = print_arrow('up', $strsortasc, true);
         } else {
             $lastarrow = print_arrow('down', $strsortdesc, true);
         }
     } else {
         $lastarrow = '';
     }
     if ($this->sortitemid === 'firstname') {
         if ($this->sortorder == 'ASC') {
             $firstarrow = print_arrow('up', $strsortasc, true);
         } else {
             $firstarrow = print_arrow('down', $strsortdesc, true);
         }
     } else {
         $firstarrow = '';
     }
     // Prepare Table Headers
     $headerhtml = '';
     $numrows = count($this->gtree->levels);
     $columns_to_unset = array();
     foreach ($this->gtree->levels as $key => $row) {
         $columncount = 0;
         if ($key == 0) {
             // do not display course grade category
             // continue;
         }
         $headerhtml .= '<tr class="heading r' . $this->rowcount++ . '">';
         if ($key == $numrows - 1) {
             $headerhtml .= '<th class="header c' . $columncount++ . ' user" scope="col"><a href="' . $this->baseurl . '&amp;sortitemid=firstname">' . $strfirstname . '</a> ' . $firstarrow . '/ <a href="' . $this->baseurl . '&amp;sortitemid=lastname">' . $strlastname . '</a>' . $lastarrow . '</th>';
         } else {
             $headerhtml .= '<td class="cell c' . $columncount++ . ' topleft">&nbsp;</td>';
         }
         foreach ($row as $columnkey => $element) {
             $sort_link = '';
             if (isset($element['object']->id)) {
                 $sort_link = $this->baseurl . '&amp;sortitemid=' . $element['object']->id;
             }
             $eid = $element['eid'];
             $object = $element['object'];
             $type = $element['type'];
             $categorystate = @$element['categorystate'];
             $itemmodule = null;
             $iteminstance = null;
             $columnclass = 'c' . $columncount++;
             if (!empty($element['colspan'])) {
                 $colspan = 'colspan="' . $element['colspan'] . '"';
                 $columnclass = '';
             } else {
                 $colspan = '';
             }
             if (!empty($element['depth'])) {
                 $catlevel = ' catlevel' . $element['depth'];
             } else {
                 $catlevel = '';
             }
             // Element is a filler
             if ($type == 'filler' or $type == 'fillerfirst' or $type == 'fillerlast') {
                 $headerhtml .= '<th class="' . $columnclass . ' ' . $type . $catlevel . '" ' . $colspan . ' scope="col">&nbsp;</th>';
             } else {
                 if ($type == 'category') {
                     $headerhtml .= '<th class="header ' . $columnclass . ' category' . $catlevel . '" ' . $colspan . ' scope="col">' . $element['object']->get_name();
                     $headerhtml .= $this->get_collapsing_icon($element);
                     // Print icons
                     if ($USER->gradeediting[$this->courseid]) {
                         $headerhtml .= $this->get_icons($element);
                     }
                     $headerhtml .= '</th>';
                 } else {
                     $itemmodule = $element['object']->itemmodule;
                     $iteminstance = $element['object']->iteminstance;
                     if ($element['object']->id == $this->sortitemid) {
                         if ($this->sortorder == 'ASC') {
                             $arrow = $this->get_sort_arrow('up', $sort_link);
                         } else {
                             $arrow = $this->get_sort_arrow('down', $sort_link);
                         }
                     } else {
                         $arrow = $this->get_sort_arrow('move', $sort_link);
                     }
                     $dimmed = '';
                     if ($element['object']->is_hidden()) {
                         $dimmed = ' dimmed_text ';
                     }
                     if ($object->itemtype == 'mod') {
                         $icon = '<img src="' . $CFG->modpixpath . '/' . $object->itemmodule . '/icon.gif" class="icon" alt="' . $this->get_lang_string('modulename', $object->itemmodule) . '"/>';
                     } else {
                         if ($object->itemtype == 'manual') {
//.........这里部分代码省略.........
开发者ID:BackupTheBerlios,项目名称:samouk-svn,代码行数:101,代码来源:lib.php


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