當前位置: 首頁>>代碼示例>>PHP>>正文


PHP flexible_table::text_sorting方法代碼示例

本文整理匯總了PHP中flexible_table::text_sorting方法的典型用法代碼示例。如果您正苦於以下問題:PHP flexible_table::text_sorting方法的具體用法?PHP flexible_table::text_sorting怎麽用?PHP flexible_table::text_sorting使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在flexible_table的用法示例。


在下文中一共展示了flexible_table::text_sorting方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: array


//.........這裏部分代碼省略.........
         $tableheaders[] = get_string('outcome', 'grades');
     }
     require_once $CFG->libdir . '/tablelib.php';
     $table = new flexible_table('mod-assignment-submissions');
     $table->define_columns($tablecolumns);
     $table->define_headers($tableheaders);
     $table->define_baseurl($CFG->wwwroot . '/mod/assignment/submissions.php?id=' . $this->cm->id . '&currentgroup=' . $currentgroup);
     $table->sortable(true, 'lastname');
     //sorted by lastname by default
     $table->collapsible(true);
     $table->initialbars(true);
     $table->column_suppress('picture');
     $table->column_suppress('fullname');
     $table->column_class('picture', 'picture');
     $table->column_class('fullname', 'fullname');
     foreach ($extrafields as $field) {
         $table->column_class($field, $field);
     }
     $table->column_class('grade', 'grade');
     $table->column_class('submissioncomment', 'comment');
     $table->column_class('timemodified', 'timemodified');
     $table->column_class('timemarked', 'timemarked');
     $table->column_class('status', 'status');
     $table->column_class('finalgrade', 'finalgrade');
     if ($uses_outcomes) {
         $table->column_class('outcome', 'outcome');
     }
     $table->set_attribute('cellspacing', '0');
     $table->set_attribute('id', 'attempts');
     $table->set_attribute('class', 'submissions');
     $table->set_attribute('width', '100%');
     $table->no_sorting('finalgrade');
     $table->no_sorting('outcome');
     $table->text_sorting('submissioncomment');
     // Start working -- this is necessary as soon as the niceties are over
     $table->setup();
     /// Construct the SQL
     list($where, $params) = $table->get_sql_where();
     if ($where) {
         $where .= ' AND ';
     }
     if ($filter == self::FILTER_SUBMITTED) {
         $where .= 's.timemodified > 0 AND ';
     } else {
         if ($filter == self::FILTER_REQUIRE_GRADING) {
             $where = '';
             if ($assignment->assignmenttype != 'offline') {
                 $where .= 's.timemarked < s.timemodified AND ';
             }
         }
     }
     if ($sort = $table->get_sql_sort()) {
         $sort = ' ORDER BY ' . $sort;
     }
     $ufields = user_picture::fields('u', $extrafields);
     if (!empty($users)) {
         $select = "SELECT {$ufields},\n                              s.id AS submissionid, s.grade, s.submissioncomment,\n                              s.timemodified, s.timemarked,\n                              CASE WHEN s.timemarked > 0 AND s.timemarked >= s.timemodified THEN 1\n                                   ELSE 0 END AS status ";
         $sql = 'FROM {user} u ' . 'LEFT JOIN {assignment_submissions} s ON u.id = s.userid
                 AND s.assignment = ' . $this->assignment->id . ' ' . 'WHERE ' . $where . 'u.id IN (' . implode(',', $users) . ') ';
         $ausers = $DB->get_records_sql($select . $sql . $sort, $params, $table->get_page_start(), $table->get_page_size());
         $table->pagesize($perpage, count($users));
         ///offset used to calculate index of student in that particular query, needed for the pop up to know who's next
         $offset = $page * $perpage;
         $strupdate = get_string('update');
         $strgrade = get_string('grade');
         $strview = get_string('view');
開發者ID:saurabh947,項目名稱:MoodleLearning,代碼行數:67,代碼來源:lib.php


注:本文中的flexible_table::text_sorting方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。