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


PHP flexible_table::define_baseurl方法代码示例

本文整理汇总了PHP中flexible_table::define_baseurl方法的典型用法代码示例。如果您正苦于以下问题:PHP flexible_table::define_baseurl方法的具体用法?PHP flexible_table::define_baseurl怎么用?PHP flexible_table::define_baseurl使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在flexible_table的用法示例。


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

示例1: course_report

 /**
  * course_report
  *
  * @param mixed $indicators
  * @param mixed $data
  * @access public
  * @return void
  */
 public function course_report($indicators, $data)
 {
     global $DB, $COURSE;
     if (empty($data)) {
         return '';
     }
     $table = new flexible_table('engagement-course-report');
     $table->define_baseurl(new moodle_url('/report/engagement/index.php', array('id' => $COURSE->id)));
     $headers = array();
     $columns = array();
     $headers[] = get_string('username');
     $columns[] = 'username';
     foreach ($indicators as $indicator) {
         $headers[] = get_string('pluginname', "engagementindicator_{$indicator}");
         $columns[] = "indicator_{$indicator}";
     }
     $headers[] = get_string('total');
     $columns[] = 'total';
     $table->define_headers($headers);
     $table->define_columns($columns);
     $table->sortable(true, 'total', SORT_DESC);
     $table->no_sorting('username');
     $table->column_class('username', 'student');
     foreach ($indicators as $indicator) {
         $table->column_class("indicator_{$indicator}", 'indicator');
     }
     $table->column_class('total', 'total');
     $table->set_attribute('id', 'engagement-course-report');
     $table->set_attribute('class', 'generaltable generalbox boxaligncenter boxwidthwide');
     $table->setup();
     foreach ($data as $user => $ind_data) {
         $row = array();
         $displayname = fullname($DB->get_record('user', array('id' => $user)));
         $url = new moodle_url('/course/report/engagement/index.php', array('id' => $COURSE->id, 'userid' => $user));
         $row[] = html_writer::link($url, $displayname);
         $total = 0;
         $total_raw = 0;
         foreach ($indicators as $indicator) {
             if (isset($ind_data["indicator_{$indicator}"]['raw'])) {
                 $ind_value = $ind_data["indicator_{$indicator}"]['raw'];
                 $weight = $ind_data["indicator_{$indicator}"]['weight'];
             } else {
                 $ind_value = 0;
                 $weight = 0;
             }
             $weighted_value = sprintf("%.0f%%", $ind_value * $weight * 100);
             $raw_value = sprintf("%.0f%%", 100 * $ind_value);
             $row[] = $weighted_value . " ({$raw_value})";
             $total += $ind_value * $weight;
             $total_raw += $ind_value;
         }
         $row[] = sprintf("%.0f%%", $total * 100);
         $table->add_data($row);
     }
     $html = $this->output->notification(get_string('reportdescription', 'coursereport_engagement'));
     ob_start();
     $table->finish_output();
     $html .= ob_get_clean();
     return $html;
 }
开发者ID:netspotau,项目名称:moodle-coursereport_engagement,代码行数:68,代码来源:renderer.php

示例2: run_table_test

 protected function run_table_test($columns, $headers, $sortable, $collapsible, $suppress, $nosorting, $data, $pagesize)
 {
     $table = new flexible_table('tablelib_test');
     $table->define_columns($columns);
     $table->define_headers($headers);
     $table->define_baseurl('/invalid.php');
     $table->sortable($sortable);
     $table->collapsible($collapsible);
     foreach ($suppress as $column) {
         $table->column_suppress($column);
     }
     foreach ($nosorting as $column) {
         $table->no_sorting($column);
     }
     $table->setup();
     $table->pagesize($pagesize, count($data));
     foreach ($data as $row) {
         $table->add_data_keyed($row);
     }
     $table->finish_output();
 }
开发者ID:EmmanuelYupit,项目名称:educursos,代码行数:21,代码来源:tablelib_test.php

示例3: list_transactions

 public function list_transactions($transactions)
 {
     global $CFG;
     $table = new flexible_table('local-magentoconnector-transaction-list');
     $table->define_columns(array('user', 'course', 'transactionid', 'timestamp'));
     $table->define_headers(array(get_string('user'), get_string('course'), get_string('transactionid', 'local_magentoconnector'), get_string('timestamp', 'local_magentoconnector')));
     $table->define_baseurl(new moodle_url('/local/magentoconnector/viewtransactions.php'));
     $table->sortable(false);
     $table->collapsible(false);
     $table->column_class('user', 'user');
     $table->column_class('course', 'course');
     $table->column_class('transactionid', 'transactionid');
     $table->column_class('timestamp', 'timestamp');
     $table->set_attribute('cellspacing', '0');
     $table->set_attribute('id', 'local-magentoconnector-transaction-list');
     $table->set_attribute('class', 'local-magentoconnector-transaction-list generaltable');
     $table->set_attribute('width', '100%');
     $table->setup();
     if ($transactions) {
         $user = new stdClass();
         foreach ($transactions as $transaction) {
             $user->id = $transaction->userid;
             $user->firstname = $transaction->firstname;
             $user->lastname = $transaction->lastname;
             $user->firstnamephonetic = $transaction->firstnamephonetic;
             $user->lastnamephonetic = $transaction->lastnamephonetic;
             $user->middlename = $transaction->middlename;
             $user->alternatename = $transaction->alternatename;
             $row = array();
             $userurl = new moodle_url($CFG->wwwroot . '/user/profile.php', array('id' => $user->id));
             $row[] = html_writer::link($userurl, fullname($user), array('title' => get_string('viewprofile')));
             $courseurl = new moodle_url($CFG->wwwroot . '/course/view.php', array('id' => $transaction->courseid));
             $row[] = html_writer::link($courseurl, $transaction->course, array('title' => $transaction->course));
             $row[] = $transaction->ordernum;
             $row[] = userdate($transaction->timestamp, get_string('strftimedatetime'));
             $table->add_data($row);
         }
     }
     $table->print_html();
 }
开发者ID:srinathweb,项目名称:moodle_magento_connector,代码行数:40,代码来源:renderer.php

示例4: display


//.........这里部分代码省略.........
     unset($states);
     // now calculate statistics and set the values in the $questions array
     $top = max($attemptscores);
     $bottom = min($attemptscores);
     $gap = ($top - $bottom) / 3;
     $top -= $gap;
     $bottom += $gap;
     foreach ($questions as $qid => $q) {
         $questions[$qid] = $this->report_question_stats($q, $attemptscores, $statstable, $top, $bottom);
     }
     unset($attemptscores);
     unset($statstable);
     /// Now check if asked download of data
     if ($download = optional_param('download', NULL)) {
         $filename = clean_filename("{$course->shortname} " . format_string($quiz->name, true));
         switch ($download) {
             case "Excel":
                 $this->Export_Excel($questions, $filename);
                 break;
             case "ODS":
                 $this->Export_ODS($questions, $filename);
                 break;
             case "CSV":
                 $this->Export_CSV($questions, $filename);
                 break;
         }
     }
     /// Construct the table for this particular report
     $tablecolumns = array('id', 'qname', 'responses', 'credits', 'rcounts', 'rpercent', 'facility', 'qsd', 'disc_index', 'disc_coeff');
     $tableheaders = array(get_string('qidtitle', 'quiz_analysis'), get_string('qtexttitle', 'quiz_analysis'), get_string('responsestitle', 'quiz_analysis'), get_string('rfractiontitle', 'quiz_analysis'), get_string('rcounttitle', 'quiz_analysis'), get_string('rpercenttitle', 'quiz_analysis'), get_string('facilitytitle', 'quiz_analysis'), get_string('stddevtitle', 'quiz_analysis'), get_string('dicsindextitle', 'quiz_analysis'), get_string('disccoefftitle', 'quiz_analysis'));
     $table = new flexible_table('mod-quiz-report-itemanalysis');
     $table->define_columns($tablecolumns);
     $table->define_headers($tableheaders);
     $table->define_baseurl($CFG->wwwroot . '/mod/quiz/report.php?q=' . $quiz->id . '&mode=analysis');
     $table->sortable(true);
     $table->no_sorting('rpercent');
     $table->collapsible(true);
     $table->initialbars(false);
     $table->column_class('id', 'numcol');
     $table->column_class('credits', 'numcol');
     $table->column_class('rcounts', 'numcol');
     $table->column_class('rpercent', 'numcol');
     $table->column_class('facility', 'numcol');
     $table->column_class('qsd', 'numcol');
     $table->column_class('disc_index', 'numcol');
     $table->column_class('disc_coeff', 'numcol');
     $table->column_suppress('id');
     $table->column_suppress('qname');
     $table->column_suppress('facility');
     $table->column_suppress('qsd');
     $table->column_suppress('disc_index');
     $table->column_suppress('disc_coeff');
     $table->set_attribute('cellspacing', '0');
     $table->set_attribute('id', 'itemanalysis');
     $table->set_attribute('class', 'generaltable generalbox');
     // Start working -- this is necessary as soon as the niceties are over
     $table->setup();
     $tablesort = $table->get_sql_sort();
     $sorts = explode(",", trim($tablesort));
     if ($tablesort and is_array($sorts)) {
         $sortindex = array();
         $sortorder = array();
         foreach ($sorts as $sort) {
             $data = explode(" ", trim($sort));
             $sortindex[] = trim($data[0]);
             $s = trim($data[1]);
开发者ID:veritech,项目名称:pare-project,代码行数:67,代码来源:report.php

示例5: array


//.........这里部分代码省略.........
        if (!empty($users)) {
            $users = array_keys($users);
        }

        // if groupmembersonly used, remove users who are not in any group
        if ($users and !empty($CFG->enablegroupmembersonly) and $cm->groupmembersonly) {
            if ($groupingusers = groups_get_grouping_members($cm->groupingid, 'u.id', 'u.id')) {
                $users = array_intersect($users, array_keys($groupingusers));
            }
        }

        $tablecolumns = array('picture', 'fullname', 'grade', 'submissioncomment', 'timemodified', 'timemarked', 'status', 'finalgrade');
        if ($uses_outcomes) {
            $tablecolumns[] = 'outcome'; // no sorting based on outcomes column
        }

        $tableheaders = array('',
                              get_string('fullname'),
                              get_string('grade'),
                              get_string('comment', 'assignment'),
                              get_string('lastmodified').' ('.get_string('submission', 'assignment').')',
                              get_string('lastmodified').' ('.get_string('grade').')',
                              get_string('status'),
                              get_string('finalgrade', 'grades'));
        if ($uses_outcomes) {
            $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');
        $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->set_attribute('align', 'center');

        $table->no_sorting('finalgrade');
        $table->no_sorting('outcome');

        // Start working -- this is necessary as soon as the niceties are over
        $table->setup();
开发者ID:nuckey,项目名称:moodle,代码行数:66,代码来源:lib.php

示例6: dialogue_list_conversations

/**
 * List conversations of either open or closed type for the current user
 * 
 * Called when a user clicks the "Current Dialogues" or "Closed Dialogues" tabs
 * rendering those out directly as HTML inside a print_table() showing who the
 * conversation is with, what the subject is, how many entries there are, 
 * how many are un-read and what the most recent post date is 
 *  
 * @param   object  $dialogue
 * @param   int     $groupid    of the group to filter conversations by (default: 0)
 * @param   string  $type       'open' (default) or 'closed'
 * @todo    remove the embedded style for 'th', make it a class driven thing in the theme
 */
function dialogue_list_conversations($dialogue, $groupid = 0, $type = 'open')
{
    global $USER, $CFG;
    $condition = $type == 'closed' ? " closed='1' " : " closed='0' ";
    $tabid = $type == 'closed' ? 3 : 1;
    if (!($course = get_record('course', 'id', $dialogue->course))) {
        error('Course is misconfigured');
    }
    if (!($cm = get_coursemodule_from_instance('dialogue', $dialogue->id, $course->id))) {
        error('Course Module ID was incorrect');
    }
    $context = get_context_instance(CONTEXT_MODULE, $cm->id);
    $dialoguemanagers = array_keys(get_users_by_capability($context, 'mod/dialogue:manage'));
    echo '<style>th.header { text-align: left; }</style>';
    require_once $CFG->libdir . '/tablelib.php';
    $tablecolumns = array('picture', 'subject', 'fullname', 'total', 'unread', 'lastentry');
    $tableheaders = array('', get_string('subject', 'dialogue'), get_string('fullname', ''), get_string('numberofentries', 'dialogue'), get_string('unread', 'dialogue'), get_string('lastentry', 'dialogue'));
    $table = new flexible_table('mod-dialogue-submissions');
    $table->define_columns($tablecolumns);
    $table->define_headers($tableheaders);
    $table->define_baseurl($CFG->wwwroot . '/mod/dialogue/view.php?id=' . $cm->id . '&amp;pane=' . $tabid);
    $table->sortable(true, 'subject');
    $table->collapsible(false);
    //$table->column_suppress('picture'); // supress multiple subsequent row entries
    //$table->column_suppress('fullname');
    $table->set_attribute('cellspacing', '0');
    $table->set_attribute('id', 'dialogue');
    $table->set_attribute('class', 'conversations');
    $table->set_attribute('width', '100%');
    $table->setup();
    $order = '';
    // so we can filter the get_conversations() call later
    $namesort = '';
    // if we want to sort by other calculated fields, e.g. first/last name
    if ($sort = $table->get_sql_sort('mod-dialogue-submissions')) {
        $sortparts = explode(',', $sort);
        $sqlsort = $sortparts[0];
        if (strpos($sqlsort, 'subject') !== false) {
            $order = $sqlsort;
        }
        if (strpos($sqlsort, 'total') !== false) {
            $order = $sqlsort;
        }
        if (strpos($sqlsort, 'lastentry') !== false) {
            $order = $sqlsort;
            $order = str_replace('lastentry', 'c.timemodified', $order);
        }
        if (strpos($sqlsort, 'firstname') !== false) {
            $namesort = $sqlsort;
        }
        if (strpos($sqlsort, 'lastname') !== false) {
            $namesort = $sqlsort;
        }
        if (strpos($sqlsort, 'unread') !== false) {
            $namesort = $sqlsort;
        }
    }
    // list the conversations requiring a resonse from this user in full
    if ($conversations = dialogue_get_conversations($dialogue, $USER, $condition, $order, $groupid)) {
        foreach ($conversations as $conversation) {
            if (in_array($USER->id, $dialoguemanagers)) {
                if (!in_array($conversation->userid, $dialoguemanagers)) {
                    if (!($with = get_record('user', 'id', $conversation->userid))) {
                        error("User's record not found");
                    }
                } else {
                    if (!($with = get_record('user', 'id', $conversation->recipientid))) {
                        error("User's record not found");
                    }
                }
            } else {
                if ($USER->id != $conversation->userid) {
                    if (!($with = get_record('user', 'id', $conversation->userid))) {
                        error("User's record not found");
                    }
                } else {
                    if (!($with = get_record('user', 'id', $conversation->recipientid))) {
                        error("User's record not found");
                    }
                }
            }
            // save sortable field values for each conversation so can sort by them later
            $names[$conversation->id] = fullname($with);
            $unread[$conversation->id] = $conversation->total - $conversation->readings;
            $names_firstlast[$conversation->id] = $with->firstname . ' ' . $with->lastname;
            $names_lastfirst[$conversation->id] = $with->lastname . ' ' . $with->firstname;
            $photos[$conversation->id] = print_user_picture($with, $course->id, true, 0, true);
//.........这里部分代码省略.........
开发者ID:netspotau,项目名称:moodle-mod_dialogue,代码行数:101,代码来源:locallib.php

示例7: navmenu

 /**
  *  Display all the submissions ready for grading
  *
  * @global object
  * @global object
  * @global object
  * @global object
  * @param string $message
  * @return bool|void
  */
 function display_submissions($message = '')
 {
     global $CFG, $DB, $USER, $DB, $OUTPUT;
     require_once $CFG->libdir . '/gradelib.php';
     /* first we check to see if the form has just been submitted
      * to request user_preference updates
      */
     if (isset($_POST['updatepref'])) {
         $perpage = optional_param('perpage', 10, PARAM_INT);
         $perpage = $perpage <= 0 ? 10 : $perpage;
         set_user_preference('assignment_perpage', $perpage);
         set_user_preference('assignment_quickgrade', optional_param('quickgrade', 0, PARAM_BOOL));
     }
     /* next we get perpage and quickgrade (allow quick grade) params
      * from database
      */
     $perpage = get_user_preferences('assignment_perpage', 10);
     $quickgrade = get_user_preferences('assignment_quickgrade', 0);
     $grading_info = grade_get_grades($this->course->id, 'mod', 'assignment', $this->assignment->id);
     if (!empty($CFG->enableoutcomes) and !empty($grading_info->outcomes)) {
         $uses_outcomes = true;
     } else {
         $uses_outcomes = false;
     }
     $page = optional_param('page', 0, PARAM_INT);
     $strsaveallfeedback = get_string('saveallfeedback', 'assignment');
     /// Some shortcuts to make the code read better
     $course = $this->course;
     $assignment = $this->assignment;
     $cm = $this->cm;
     $tabindex = 1;
     //tabindex for quick grading tabbing; Not working for dropdowns yet
     add_to_log($course->id, 'assignment', 'view submission', 'submissions.php?id=' . $this->cm->id, $this->assignment->id, $this->cm->id);
     $navigation = build_navigation($this->strsubmissions, $this->cm);
     print_header_simple(format_string($this->assignment->name, true), "", $navigation, '', '', true, update_module_button($cm->id, $course->id, $this->strassignment), navmenu($course, $cm));
     $course_context = get_context_instance(CONTEXT_COURSE, $course->id);
     if (has_capability('gradereport/grader:view', $course_context) && has_capability('moodle/grade:viewall', $course_context)) {
         echo '<div class="allcoursegrades"><a href="' . $CFG->wwwroot . '/grade/report/grader/index.php?id=' . $course->id . '">' . get_string('seeallcoursegrades', 'grades') . '</a></div>';
     }
     if (!empty($message)) {
         echo $message;
         // display messages here if any
     }
     $context = get_context_instance(CONTEXT_MODULE, $cm->id);
     /// Check to see if groups are being used in this assignment
     /// find out current groups mode
     $groupmode = groups_get_activity_groupmode($cm);
     $currentgroup = groups_get_activity_group($cm, true);
     groups_print_activity_menu($cm, 'submissions.php?id=' . $this->cm->id);
     /// Get all ppl that are allowed to submit assignments
     if ($users = get_users_by_capability($context, 'mod/assignment:submit', 'u.id', '', '', '', $currentgroup, '', false)) {
         $users = array_keys($users);
     }
     // if groupmembersonly used, remove users who are not in any group
     if ($users and !empty($CFG->enablegroupings) and $cm->groupmembersonly) {
         if ($groupingusers = groups_get_grouping_members($cm->groupingid, 'u.id', 'u.id')) {
             $users = array_intersect($users, array_keys($groupingusers));
         }
     }
     $tablecolumns = array('picture', 'fullname', 'grade', 'submissioncomment', 'timemodified', 'timemarked', 'status', 'finalgrade');
     if ($uses_outcomes) {
         $tablecolumns[] = 'outcome';
         // no sorting based on outcomes column
     }
     $tableheaders = array('', get_string('fullname'), get_string('grade'), get_string('comment', 'assignment'), get_string('lastmodified') . ' (' . get_string('submission', 'assignment') . ')', get_string('lastmodified') . ' (' . get_string('grade') . ')', get_string('status'), get_string('finalgrade', 'grades'));
     if ($uses_outcomes) {
         $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 . '&amp;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');
     $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');
     }
//.........这里部分代码省略.........
开发者ID:ajv,项目名称:Offline-Caching,代码行数:101,代码来源:lib.php

示例8: sesskey

        echo $OUTPUT->footer();
        exit;
    }
}
echo $OUTPUT->header();
echo $OUTPUT->heading($stractivities);
/// Get and sort the existing modules
if (!($modules = $DB->get_records('modules', array(), 'name ASC'))) {
    print_error('moduledoesnotexist', 'error');
}
/// Print the table of all modules
// construct the flexible table ready to display
$table = new flexible_table(MODULE_TABLE);
$table->define_columns(array('name', 'instances', 'version', 'hideshow', 'delete', 'settings'));
$table->define_headers(array($stractivitymodule, $stractivities, $strversion, "{$strhide}/{$strshow}", $strdelete, $strsettings));
$table->define_baseurl($CFG->wwwroot . '/' . $CFG->admin . '/modules.php');
$table->set_attribute('id', 'modules');
$table->set_attribute('class', 'generaltable');
$table->setup();
foreach ($modules as $module) {
    if (!file_exists("{$CFG->dirroot}/mod/{$module->name}/lib.php")) {
        $strmodulename = '<span class="notifyproblem">' . $module->name . ' (' . get_string('missingfromdisk') . ')</span>';
        $missing = true;
    } else {
        // took out hspace="\10\", because it does not validate. don't know what to replace with.
        $icon = "<img src=\"" . $OUTPUT->pix_url('icon', $module->name) . "\" class=\"icon\" alt=\"\" />";
        $strmodulename = $icon . ' ' . get_string('modulename', $module->name);
        $missing = false;
    }
    $delete = "<a href=\"modules.php?delete={$module->name}&amp;sesskey=" . sesskey() . "\">{$strdelete}</a>";
    if (file_exists("{$CFG->dirroot}/mod/{$module->name}/settings.php") || file_exists("{$CFG->dirroot}/mod/{$module->name}/settingstree.php")) {
开发者ID:ravivare,项目名称:moodle-1,代码行数:31,代码来源:modules.php

示例9: implode

            }
        }
    }
}
$levels = implode(",", $levels);
// Calculates the number of criteria assigned to current user
$criteriafilter = "\n\tSELECT u.*,\n\t\tCASE WHEN S.comments = 0 AND S.status < 20 THEN 5\n\t\t\tWHEN S.comments = 0 AND S.status >= 20 THEN 20\n\t\t\tWHEN S.comments > 0 THEN 30 END AS status,\n\t\tS.submission\n\tFROM (SELECT\n\ts.id as submission,\n\ts.student,\n\tCOUNT(DISTINCT ec.id) AS comments,\n\ts.sort,\n\ts.status\n\tFROM {emarking_submission} AS s\n\tINNER JOIN {emarking_draft} as d ON (d.submissionid = s.id AND d.qualitycontrol = 0)\n\tINNER JOIN {emarking_page} AS p ON (s.emarking = {$emarking->id} AND p.submission = s.id)\n\tLEFT JOIN {emarking_comment} AS ec ON (ec.page = p.id AND ec.levelid IN ({$levels}))\n\tGROUP BY s.id) AS S\n\tINNER JOIN {user} AS u ON (S.student = u.id)";
// Check if activity is configured with separate groups to filter users
if ($cm->groupmode == SEPARATEGROUPS && $usercangrade && !is_siteadmin($USER) && !$useristeacher) {
    $userfilter .= "\nAND u.id in (SELECT userid\n\t\tFROM {groups_members}\nWHERE groupid in (SELECT groupid\nFROM {groups_members} as gm\nINNER JOIN {groups} as g on (gm.groupid = g.id)\nWHERE gm.userid = {$USER->id} AND g.courseid = e.courseid))";
}
// Define flexible table (can be sorted in different ways)
$showpages = new flexible_table('emarking-kanban-' . $cmid);
$showpages->define_headers(array(get_string('notcorrected', 'mod_emarking'), get_string('marking', 'mod_emarking'), get_string('corrected', 'mod_emarking')));
$showpages->define_columns(array('notcorrected', 'marking', 'corrected'));
$showpages->define_baseurl($urlemarking);
$defaulttsort = $emarking->anonymous ? null : 'status';
$showpages->sortable(false);
$showpages->pageable(false);
$showpages->setup();
// Decide on sorting depending on URL parameters and flexible table configuration
$orderby = $emarking->anonymous ? 'ORDER BY sort ASC' : 'ORDER BY u.lastname ASC';
// Get submissions with extra info to show
$sql = $criterionid == 0 ? "\nSELECT u.*, \n\t\tIFNULL(s.id,0) as submission,\n\t\tIFNULL(s.status,0) as status,\n\t\ts.sort\nFROM {emarking_submission} AS s\n\tINNER JOIN {user} AS u ON (s.emarking = ? AND s.student = u.id)\n{$userfilter}\n{$orderby}" : $criteriafilter . $userfilter . $orderby;
// Run the query on the database
$emarkingpages = $DB->get_records_sql($sql, array($emarking->id));
$notcorrected = "";
$marking = "";
$corrected = "";
// Prepare data for the table
foreach ($emarkingpages as $pageinfo) {
开发者ID:eduagdo,项目名称:emarking,代码行数:31,代码来源:kanban.php

示例10: array

        $tableheaders = array("<b>{$issuenumberstr}</b>", "<b>{$summarystr}</b>", "<b>{$datereportedstr}</b>", "<b>{$reportedbystr}</b>", "<b>{$assignedtostr}</b>", "<b>{$statusstr}</b>", "<b>{$watchesstr}</b>", "<b>{$actionstr}</b>");
    }
} else {
    if (!empty($tracker->parent)) {
        $transferstr = get_string('transfer', 'tracker');
        $tablecolumns = array('resolutionpriority', 'id', 'summary', 'datereported', 'reportedby', 'assignedto', 'status', 'watches', 'transfered', 'action');
        $tableheaders = array("<b>{$prioritystr}</b>", "<b>{$issuenumberstr}</b>", "<b>{$summarystr}</b>", "<b>{$datereportedstr}</b>", "<b>{$reportedbystr}</b>", "<b>{$assignedtostr}</b>", "<b>{$statusstr}</b>", "<b>{$watchesstr}</b>", "<b>{$transferstr}</b>", "<b>{$actionstr}</b>");
    } else {
        $tablecolumns = array('resolutionpriority', 'id', 'summary', 'datereported', 'reportedby', 'assignedto', 'status', 'watches', 'action');
        $tableheaders = array("<b>{$prioritystr}</b>", "<b>{$issuenumberstr}</b>", "<b>{$summarystr}</b>", "<b>{$datereportedstr}</b>", "<b>{$reportedbystr}</b>", "<b>{$assignedtostr}</b>", "<b>{$statusstr}</b>", "<b>{$watchesstr}</b>", "<b>{$actionstr}</b>");
    }
}
$table = new flexible_table('mod-tracker-issuelist');
$table->define_columns($tablecolumns);
$table->define_headers($tableheaders);
$table->define_baseurl($CFG->wwwroot . '/mod/tracker/view.php?id=' . $cm->id . '&view=' . $view . '&screen=' . $screen);
$table->sortable(true, 'resolutionpriority', SORT_ASC);
//sorted by priority by default
$table->collapsible(true);
$table->initialbars(true);
// allow column hiding
// $table->column_suppress('reportedby');
// $table->column_suppress('watches');
$table->set_attribute('cellspacing', '0');
$table->set_attribute('id', 'issues');
$table->set_attribute('class', 'issuelist');
$table->set_attribute('width', '100%');
$table->column_class('resolutionpriority', 'list_priority');
$table->column_class('id', 'list_issuenumber');
$table->column_class('summary', 'list_summary');
$table->column_class('datereported', 'timelabel');
开发者ID:hmatulis,项目名称:RTL-BIDI-Hebrew-Moodle-Plugins,代码行数:31,代码来源:viewissuelist.php

示例11: authorize_print_orders

/**
 * authorize_print_orders
 *
 */
function authorize_print_orders($courseid, $userid)
{
    global $CFG, $USER, $SITE;
    global $strs, $authstrs;
    require_once $CFG->libdir . '/tablelib.php';
    $perpage = 10;
    $status = optional_param('status', AN_STATUS_NONE, PARAM_INT);
    $searchtype = optional_param('searchtype', 'id', PARAM_ALPHA);
    $idortransid = optional_param('idortransid', '0', PARAM_INT);
    $showonlymy = optional_param('showonlymy', 0, PARAM_BOOL);
    $canmanagepayments = has_capability('enrol/authorize:managepayments', get_context_instance(CONTEXT_COURSE, $courseid));
    if ($showonlymy || !$canmanagepayments) {
        $userid = $USER->id;
    }
    $baseurl = $CFG->wwwroot . "/enrol/authorize/index.php?user={$userid}";
    $statusmenu = array(AN_STATUS_NONE => $strs->all, AN_STATUS_AUTH | AN_STATUS_UNDERREVIEW | AN_STATUS_APPROVEDREVIEW => $authstrs->allpendingorders, AN_STATUS_AUTH => $authstrs->authorizedpendingcapture, AN_STATUS_AUTHCAPTURE => $authstrs->authcaptured, AN_STATUS_CREDIT => $authstrs->refunded, AN_STATUS_VOID => $authstrs->cancelled, AN_STATUS_EXPIRE => $authstrs->expired, AN_STATUS_UNDERREVIEW => $authstrs->underreview, AN_STATUS_APPROVEDREVIEW => $authstrs->approvedreview, AN_STATUS_REVIEWFAILED => $authstrs->reviewfailed, AN_STATUS_TEST => $authstrs->tested);
    $sql = "SELECT c.id, c.fullname FROM {$CFG->prefix}course c INNER JOIN {$CFG->prefix}enrol_authorize e ON c.id = e.courseid ";
    if ($userid > 0) {
        $sql .= "WHERE (e.userid='{$userid}') ";
    }
    $sql .= "ORDER BY c.sortorder, c.fullname";
    if ($popupcrs = get_records_sql_menu($sql)) {
        $popupcrs = array($SITE->id => $SITE->fullname) + $popupcrs;
        echo "<table border='0' width='100%' cellspacing='0' cellpadding='3' class='generaltable generalbox'>";
        echo "<tr>";
        echo "<td width='5%' valign='top'>{$strs->status}: </td><td width='10%'>";
        popup_form($baseurl . '&amp;course=' . $courseid . '&amp;status=', $statusmenu, 'statusmenu', $status, '', '', '', false);
        if ($canmanagepayments) {
            echo "<br />\n";
            print_checkbox('showonlymy', '1', $userid == $USER->id, get_string('mypaymentsonly', 'enrol_authorize'), '', "var locationtogo = '{$CFG->wwwroot}/enrol/authorize/index.php?status={$status}&amp;course={$courseid}';\n                                  locationtogo += '&amp;user=' + (this.checked ? '{$USER->id}' : '0');\n                                  top.location.href=locationtogo;");
        }
        echo "</td>\n";
        echo "<td width='5%' valign='top'>{$strs->course}: </td><td width='10%' valign='top'>";
        popup_form($baseurl . '&amp;status=' . $status . '&amp;course=', $popupcrs, 'coursesmenu', $courseid, '', '', '', false);
        echo "</td>\n";
        if (has_capability('enrol/authorize:uploadcsv', get_context_instance(CONTEXT_USER, $USER->id))) {
            echo "<form method='get' action='uploadcsv.php'>";
            echo "<td rowspan='2' align='right' valign='middle' width='50%'><div><input type='submit' value='" . get_string('uploadcsv', 'enrol_authorize') . "' /></div></td>";
            echo "</form>";
        } else {
            echo "<td rowspan=2 width='100%'>&nbsp;</td>";
        }
        echo "</tr>\n";
        echo "<tr><td>{$strs->search}: </td>";
        $searchmenu = array('id' => $authstrs->orderid, 'transid' => $authstrs->transid);
        echo "<form method='POST' action='index.php' autocomplete='off'>";
        echo "<td colspan='3'>";
        choose_from_menu($searchmenu, 'searchtype', $searchtype, '');
        echo " = <fieldset class=\"invisiblefieldset\"><input type='text' size='14' name='idortransid' value='' /> ";
        echo "<input type='submit' value='{$strs->search}' /></fieldset></td>";
        echo "</form>";
        echo "</tr>";
        echo "</table>";
    }
    $table = new flexible_table('enrol-authorize');
    $table->set_attribute('width', '100%');
    $table->set_attribute('cellspacing', '0');
    $table->set_attribute('cellpadding', '3');
    $table->set_attribute('id', 'orders');
    $table->set_attribute('class', 'generaltable generalbox');
    $table->define_columns(array('id', 'timecreated', 'userid', 'status', ''));
    $table->define_headers(array($authstrs->orderid, $strs->time, $authstrs->nameoncard, $strs->status, $strs->action));
    $table->define_baseurl($baseurl . "&amp;status={$status}&amp;course={$courseid}");
    $table->sortable(true, 'id', SORT_DESC);
    $table->pageable(true);
    $table->setup();
    $select = "SELECT e.id, e.paymentmethod, e.transid, e.courseid, e.userid, e.status, e.ccname, e.timecreated, e.settletime ";
    $from = "FROM {$CFG->prefix}enrol_authorize e ";
    $where = "WHERE (1=1) ";
    if ($status > AN_STATUS_NONE) {
        switch ($status) {
            case AN_STATUS_AUTH | AN_STATUS_UNDERREVIEW | AN_STATUS_APPROVEDREVIEW:
                $where .= 'AND (e.status IN(' . AN_STATUS_AUTH . ',' . AN_STATUS_UNDERREVIEW . ',' . AN_STATUS_APPROVEDREVIEW . ')) ';
                break;
            case AN_STATUS_CREDIT:
                $from .= "INNER JOIN {$CFG->prefix}enrol_authorize_refunds r ON e.id = r.orderid ";
                $where .= "AND (e.status = '" . AN_STATUS_AUTHCAPTURE . "') ";
                break;
            case AN_STATUS_TEST:
                $newordertime = time() - 120;
                // -2 minutes. Order may be still in process.
                $where .= "AND (e.status = '" . AN_STATUS_NONE . "') AND (e.transid = '0') AND (e.timecreated < {$newordertime}) ";
                break;
            default:
                $where .= "AND (e.status = '{$status}') ";
                break;
        }
    } else {
        if (empty($CFG->an_test)) {
            $where .= "AND (e.status != '" . AN_STATUS_NONE . "') ";
        }
    }
    if ($courseid != SITEID) {
        $where .= "AND (e.courseid = '" . $courseid . "') ";
    }
    if (!empty($idortransid)) {
//.........这里部分代码省略.........
开发者ID:JackCanada,项目名称:moodle-hacks,代码行数:101,代码来源:locallib.php

示例12: view_plugins_table

    /**
     * Write the HTML for the submission plugins table.
     *
     * @return None
     */
    private function view_plugins_table() {
        global $OUTPUT, $CFG;
        /** Include tablelib.php */
        require_once($CFG->libdir . '/tablelib.php');

        // Set up the table.
        $this->view_header();
        $table = new flexible_table($this->subtype . 'pluginsadminttable');
        $table->define_baseurl($this->pageurl);
        $table->define_columns(array('pluginname', 'version', 'hideshow', 'order',
                'delete', 'settings'));
        $table->define_headers(array(get_string($this->subtype . 'pluginname', 'assign'),
                get_string('version'), get_string('hideshow', 'assign'),
                get_string('order'), get_string('delete'), get_string('settings')));
        $table->set_attribute('id', $this->subtype . 'plugins');
        $table->set_attribute('class', 'generaltable generalbox boxaligncenter boxwidthwide');
        $table->setup();


        $plugins = $this->get_sorted_plugins_list();
        $shortsubtype = substr($this->subtype, strlen('assign'));

        foreach ($plugins as $idx => $plugin) {
            $row = array();

            $row[] = get_string('pluginname', $this->subtype . '_' . $plugin);
            $row[] = get_config($this->subtype . '_' . $plugin, 'version');

            $visible = !get_config($this->subtype . '_' . $plugin, 'disabled');

            if ($visible) {
                $row[] = $this->format_icon_link('hide', $plugin, 'i/hide', get_string('disable'));
            } else {
                $row[] = $this->format_icon_link('show', $plugin, 'i/show', get_string('enable'));
            }

            $movelinks = '';
            if (!$idx == 0) {
                $movelinks .= $this->format_icon_link('moveup', $plugin, 't/up', get_string('up'));
            } else {
                $movelinks .= $OUTPUT->spacer(array('width'=>15));
            }
            if ($idx != count($plugins) - 1) {
                $movelinks .= $this->format_icon_link('movedown', $plugin, 't/down', get_string('down'));
            }
            $row[] = $movelinks;

            if ($row[1] != '') {
                $row[] = $this->format_icon_link('delete', $plugin, 't/delete', get_string('delete'));
            } else {
                $row[] = '&nbsp;';
            }
            if ($row[1] != '' && file_exists($CFG->dirroot . '/mod/assign/' . $shortsubtype . '/' . $plugin . '/settings.php')) {
                $row[] = html_writer::link(new moodle_url('/admin/settings.php',
                        array('section' => $this->subtype . '_' . $plugin)), get_string('settings'));
            } else {
                $row[] = '&nbsp;';
            }
            $table->add_data($row);
        }


        $table->finish_output();
        $this->view_footer();
    }
开发者ID:nicusX,项目名称:moodle,代码行数:70,代码来源:adminlib.php

示例13: authorize_print_orders

/**
 * authorize_print_orders
 *
 */
function authorize_print_orders($courseid, $userid)
{
    global $course;
    global $CFG, $USER, $SITE, $DB, $OUTPUT, $PAGE;
    global $strs, $authstrs;
    $plugin = enrol_get_plugin('authorize');
    require_once $CFG->libdir . '/tablelib.php';
    $perpage = optional_param('perpage', 10, PARAM_INT);
    $showonlymy = optional_param('showonlymy', 0, PARAM_BOOL);
    $searchquery = optional_param('searchquery', '0', PARAM_INT);
    $searchtype = optional_param('searchtype', 'orderid', PARAM_ALPHA);
    $status = optional_param('status', AN_STATUS_NONE, PARAM_INT);
    $coursecontext = context_course::instance($courseid);
    $searchmenu = array('orderid' => $authstrs->orderid, 'transid' => $authstrs->transid, 'cclastfour' => $authstrs->cclastfour);
    $buttons = "<form method='post' action='index.php' autocomplete='off'><div>";
    $buttons .= html_writer::label(get_string('orderdetails', 'enrol_authorize'), 'menusearchtype', false, array('class' => 'accesshide'));
    $buttons .= html_writer::select($searchmenu, 'searchtype', $searchtype, false);
    $buttons .= html_writer::label(get_string('search'), 'searchquery', false, array('class' => 'accesshide'));
    $buttons .= "<input id='searchquery' type='text' size='16' name='searchquery' value='' />";
    $buttons .= "<input type='submit' value='{$strs->search}' />";
    $buttons .= "</div></form>";
    if (has_capability('enrol/authorize:uploadcsv', context_user::instance($USER->id))) {
        $buttons .= "<form method='get' action='uploadcsv.php'><div><input type='submit' value='" . get_string('uploadcsv', 'enrol_authorize') . "' /></div></form>";
    }
    $canmanagepayments = has_capability('enrol/authorize:managepayments', $coursecontext);
    if ($showonlymy || !$canmanagepayments) {
        $userid = $USER->id;
    }
    $baseurl = $CFG->wwwroot . '/enrol/authorize/index.php?user=' . $userid;
    $params = array('userid' => $userid);
    $sql = "SELECT c.id, c.fullname FROM {course} c JOIN {enrol_authorize} e ON c.id = e.courseid ";
    $sql .= $userid > 0 ? "WHERE (e.userid=:userid) " : '';
    $sql .= "ORDER BY c.sortorder, c.fullname";
    if ($popupcrs = $DB->get_records_sql_menu($sql, $params)) {
        $popupcrs = array($SITE->id => $SITE->fullname) + $popupcrs;
    }
    $popupmenu = empty($popupcrs) ? '' : $OUTPUT->single_select(new moodle_url($baseurl . '&status=' . $status), 'course', $popupcrs, $courseid, null, 'coursesmenu');
    $popupmenu .= '<br />';
    $statusmenu = array(AN_STATUS_NONE => $strs->all, AN_STATUS_AUTH | AN_STATUS_UNDERREVIEW | AN_STATUS_APPROVEDREVIEW => $authstrs->allpendingorders, AN_STATUS_AUTH => $authstrs->authorizedpendingcapture, AN_STATUS_AUTHCAPTURE => $authstrs->authcaptured, AN_STATUS_CREDIT => $authstrs->refunded, AN_STATUS_VOID => $authstrs->cancelled, AN_STATUS_EXPIRE => $authstrs->expired, AN_STATUS_UNDERREVIEW => $authstrs->underreview, AN_STATUS_APPROVEDREVIEW => $authstrs->approvedreview, AN_STATUS_REVIEWFAILED => $authstrs->reviewfailed, AN_STATUS_TEST => $authstrs->tested);
    $popupmenu .= $OUTPUT->single_select(new moodle_url($baseurl . '&course=' . $courseid), 'status', $statusmenu, $status, null, 'statusmenu');
    if ($canmanagepayments) {
        $popupmenu .= '<br />';
        $PAGE->requires->js('/enrol/authorize/authorize.js');
        $aid = $OUTPUT->add_action_handler(new component_action('click', 'authorize_jump_to_mypayments', array('userid' => $USER->id, 'status' => $status)));
        $popupmenu .= html_writer::checkbox('enrol_authorize', 1, $userid == $USER->id, get_string('mypaymentsonly', 'enrol_authorize'), array('id' => $aid));
    }
    if (SITEID != $courseid) {
        $shortname = format_string($course->shortname, true, array('context' => $coursecontext));
        $PAGE->navbar->add($shortname, new moodle_url('/course/view.php', array('id' => $course->id)));
    }
    $PAGE->navbar->add($authstrs->paymentmanagement, 'index.php');
    $PAGE->set_title("{$course->shortname}: {$authstrs->paymentmanagement}");
    $PAGE->set_heading($authstrs->paymentmanagement);
    $PAGE->set_headingmenu($popupmenu);
    $PAGE->set_button($buttons);
    echo $OUTPUT->header();
    $table = new flexible_table('enrol-authorize');
    $table->set_attribute('width', '100%');
    $table->set_attribute('cellspacing', '0');
    $table->set_attribute('cellpadding', '3');
    $table->set_attribute('id', 'orders');
    $table->set_attribute('class', 'generaltable generalbox');
    if ($perpage > 100) {
        $perpage = 100;
    }
    $perpagemenus = array(5 => 5, 10 => 10, 20 => 20, 50 => 50, 100 => 100);
    $perpagemenu = $OUTPUT->single_select(new moodle_url($baseurl . '&status=' . $status . '&course=' . $courseid), 'perpage', $perpagemenus, $perpage, array('' => 'choosedots'), 'perpagemenu');
    $table->define_columns(array('id', 'userid', 'timecreated', 'status', 'action'));
    $table->define_headers(array($authstrs->orderid, $authstrs->shopper, $strs->time, $strs->status, $perpagemenu));
    $table->define_baseurl($baseurl . "&amp;status={$status}&amp;course={$courseid}&amp;perpage={$perpage}");
    $table->no_sorting('action');
    $table->sortable(true, 'id', SORT_DESC);
    $table->pageable(true);
    $table->setup();
    $select = "SELECT e.id, e.paymentmethod, e.refundinfo, e.transid, e.courseid, e.userid, e.status, e.ccname, e.timecreated, e.settletime ";
    $from = "FROM {enrol_authorize} e ";
    $where = "WHERE (1=1) ";
    $params = array();
    if (!empty($searchquery)) {
        switch ($searchtype) {
            case 'orderid':
                $where = "WHERE (e.id = :searchquery) ";
                $params['searchquery'] = $searchquery;
                break;
            case 'transid':
                $where = "WHERE (e.transid = :searchquery) ";
                $params['searchquery'] = $searchquery;
                break;
            case 'cclastfour':
                $searchquery = sprintf("%04d", $searchquery);
                $where = "WHERE (e.refundinfo = :searchquery) AND (e.paymentmethod=:method) ";
                $params['searchquery'] = $searchquery;
                $params['method'] = AN_METHOD_CC;
                break;
        }
    } else {
//.........这里部分代码省略.........
开发者ID:JP-Git,项目名称:moodle,代码行数:101,代码来源:locallib.php

示例14: navmenu

 function display_submissions($message = '')
 {
     global $CFG, $db, $USER;
     require_once $CFG->libdir . '/gradelib.php';
     // Update preferences
     if (isset($_POST['updatepref'])) {
         $perpage = optional_param('perpage', 20, PARAM_INT);
         $perpage = $perpage <= 0 ? 20 : $perpage;
         set_user_preference('assignment_perpage', $perpage);
         $moderationtarget = optional_param('moderationtarget', 0, PARAM_INT);
         $moderationtarget = $moderationtarget <= 0 ? 0 : $moderationtarget;
         set_user_preference('assignment_moderationtarget', $moderationtarget);
     }
     // Get preferences
     $perpage = get_user_preferences('assignment_perpage', 10);
     $moderationtarget = get_user_preferences('assignment_moderationtarget', 0);
     // Some shortcuts to make the code read better
     $grading_info = grade_get_grades($this->course->id, 'mod', 'assignment', $this->assignment->id);
     $course = $this->course;
     $assignment = $this->assignment;
     $cm = $this->cm;
     $context = get_context_instance(CONTEXT_MODULE, $cm->id);
     $page = optional_param('page', 0, PARAM_INT);
     // Log this view
     add_to_log($course->id, 'assignment', 'view submission', 'submissions.php?id=' . $this->assignment->id, $this->assignment->id, $this->cm->id);
     // Print header and navigation breadcrumbs
     $navigation = build_navigation($this->strsubmissions, $this->cm);
     print_header_simple(format_string($this->assignment->name, true), "", $navigation, '', '', true, update_module_button($cm->id, $course->id, $this->strassignment), navmenu($course, $cm));
     // Print tabs at top of page
     $tabs = array();
     $row = array();
     $inactive = array();
     $activated = array();
     $row[] = new tabobject('criteria', "type/peerreview/" . self::CRITERIA_FILE . "?id=" . $this->cm->id . "&a=" . $this->assignment->id, get_string('criteria', 'assignment_peerreview'));
     $row[] = new tabobject('submissions', '', get_string('submissions', 'assignment_peerreview'));
     $tabs[] = $row;
     $currenttab = 'submissions';
     $inactive[] = 'submissions';
     $activated[] = 'submissions';
     print_tabs($tabs, $currenttab, $inactive, $activated);
     // Print optional message
     if (!empty($message)) {
         echo $message;
         // display messages here if any
     }
     // Check to see if groups are being used in this assignment
     // find out current groups mode
     // $groupmode = groups_get_activity_groupmode($cm);
     // $currentgroup = groups_get_activity_group($cm, true);
     // groups_print_activity_menu($cm, $CFG->wwwroot.'/mod/assignment/submissions.php?id=' . $cm->id);
     // Get all ppl that are allowed to submit assignments
     // if ($users = get_users_by_capability($context, 'mod/assignment:submit', 'u.id', '', '', '', $currentgroup, '', false)) {
     if ($users = get_users_by_capability($context, 'mod/assignment:submit', 'u.id')) {
         $users = array_keys($users);
     }
     // Filter out teachers
     if ($users && ($teachers = get_users_by_capability($context, 'mod/assignment:grade', 'u.id'))) {
         $users = array_diff($users, array_keys($teachers));
     }
     // Warn if class is too small
     if (count($users) < 5) {
         notify(get_string('numberofstudentswarning', 'assignment_peerreview'));
     }
     // if groupmembersonly used, remove users who are not in any group
     // if ($users and !empty($CFG->enablegroupings) and $cm->groupmembersonly) {
     // if ($groupingusers = groups_get_grouping_members($cm->groupingid, 'u.id', 'u.id')) {
     // $users = array_intersect($users, array_keys($groupingusers));
     // }
     // }
     // Create the table to be shown
     require_once $CFG->libdir . '/tablelib.php';
     $table = new flexible_table('mod-assignment-submissions');
     $tablecolumns = array('picture', 'fullname', 'submitted', 'reviews', 'moderations', 'status', 'seedoreviews', 'suggestedmark', 'finalgrade');
     $table->define_columns($tablecolumns);
     $tableheaders = array('', get_string('fullname'), get_string('submission', 'assignment_peerreview'), get_string('reviewsbystudent', 'assignment_peerreview') . helpbutton('reviewsbystudent', get_string('reviewsbystudent', 'assignment_peerreview'), 'assignment/type/peerreview/', true, false, '', true), get_string('moderationstitle', 'assignment_peerreview') . helpbutton('moderationtarget', get_string('moderationtarget', 'assignment_peerreview'), 'assignment/type/peerreview/', true, false, '', true), get_string('status') . helpbutton('status', get_string('status', 'assignment_peerreview'), 'assignment/type/peerreview/', true, false, '', true), get_string('seedoreviews', 'assignment_peerreview') . helpbutton('seedoreviews', get_string('seedoreviews', 'assignment_peerreview'), 'assignment/type/peerreview/', true, false, '', true), get_string('suggestedgrade', 'assignment_peerreview') . helpbutton('suggestedgrade', get_string('suggestedgrade', 'assignment_peerreview'), 'assignment/type/peerreview/', true, false, '', true), get_string('finalgrade', 'assignment_peerreview') . helpbutton('finalgrade', get_string('finalgrade', 'assignment_peerreview'), 'assignment/type/peerreview/', true, false, '', true));
     $table->define_headers($tableheaders);
     // $table->define_baseurl($CFG->wwwroot.'/mod/assignment/submissions.php?id='.$this->cm->id.'&amp;currentgroup='.$currentgroup);
     $table->define_baseurl($CFG->wwwroot . '/mod/assignment/submissions.php?id=' . $this->cm->id);
     // $table->sortable(true, 'submitted');
     $table->sortable(false);
     $table->collapsible(true);
     // $table->initialbars(true);
     $table->initialbars(false);
     $table->column_suppress('picture');
     $table->column_suppress('fullname');
     $table->column_class('picture', 'picture');
     $table->column_class('fullname', 'fullname');
     $table->column_class('submitted', 'submitted');
     $table->column_class('reviews', 'reviews');
     $table->column_class('moderations', 'moderations');
     $table->column_class('status', 'status');
     $table->column_class('seedoreviews', 'seedoreviews');
     $table->column_class('suggestedmark', 'suggestedmark');
     $table->column_class('finalgrade', 'finalgrade');
     $table->set_attribute('cellspacing', '0');
     $table->set_attribute('id', 'attempts');
     $table->set_attribute('class', 'submissions');
     $table->set_attribute('width', '99%');
     $table->set_attribute('align', 'center');
     $table->column_style('submitted', 'text-align', $alignment);
//.........这里部分代码省略.........
开发者ID:hmatulis,项目名称:RTL-BIDI-Hebrew-Moodle-Plugins,代码行数:101,代码来源:assignment.class.php

示例15: implode

    } else {
        $userids = implode(', ', $userids);
    }
}
$select = 'SELECT u.id, u.firstname, u.lastname ';
$from = 'FROM {user} u ';
$where = 'WHERE u.id IN (' . $userids . ') ';
$order = 'ORDER BY u.firstname ASC, u.lastname ASC ';
$sql = $select . $from . $where . $order;
$usersavail = $DB->get_records_sql($sql);
$table = new flexible_table('meeting-attendance-', $meeting->id);
$tablecolumns = array('fullname', 'attended');
$tableheaders = array(get_string('fullname'), get_string('attended', 'elluminate'));
$table->define_columns($tablecolumns);
$table->define_headers($tableheaders);
$table->define_baseurl($CFG->wwwroot . '/mod/elluminate/attendance.php?id=' . $meeting->id);
$table->set_attribute('cellspacing', '1');
$table->set_attribute('cellpadding', '8');
$table->set_attribute('align', 'center');
$table->set_attribute('class', 'generaltable generalbox');
$table->setup();
if (!empty($usersavail)) {
    $stryes = get_string('yes');
    $strno = get_string('no');
    $yesno = array(0 => $strno, 1 => $stryes);
    foreach ($usersavail as $useravail) {
        $sql = "SELECT a.*\n\t                    FROM {elluminate_attendance} a\n\t                    WHERE a.userid = {$useravail->id}\n\t                    AND a.elluminateid = '{$meeting->id}'\n\t                    AND a.grade > 0";
        /// Display different form items depending on whether we're using a scale
        /// or numerical value for an attendance grade.
        $attended = $DB->get_record_sql($sql);
        if ($canmanage) {
开发者ID:nadavkav,项目名称:Moodle2-Hebrew-plugins,代码行数:31,代码来源:attendance.php


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