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


PHP groups_print_course_menu函数代码示例

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


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

示例1: standard_upload_file_form

 /**
  * A renderer for the standard upload file form.
  *
  * @param object $course The course we are doing all of this action in.
  * @param object $mform The mform for uploading CSV files.
  * @return string html to be displayed.
  */
 public function standard_upload_file_form($course, $mform)
 {
     $output = groups_print_course_menu($course, 'index.php?id=' . $course->id, true);
     $output .= html_writer::start_tag('div', array('class' => 'clearer'));
     $output .= html_writer::end_tag('div');
     // Form.
     ob_start();
     $mform->display();
     $output .= ob_get_contents();
     ob_end_clean();
     return $output;
 }
开发者ID:evltuma,项目名称:moodle,代码行数:19,代码来源:renderer.php

示例2: html_table

        $table = new html_table();
        $table->head = $header;
        $csvimport->init();
        $previewdata = array();
        while ($numlines <= $formdata->previewrows) {
            $lines = $csvimport->next();
            if ($lines) {
                $previewdata[] = $lines;
            }
            $numlines++;
        }
        $table->data = $previewdata;
        echo html_writer::table($table);
    } else {
        // Display the standard upload file form.
        groups_print_course_menu($course, 'index.php?id=' . $id);
        echo html_writer::start_tag('div', array('class' => 'clearer'));
        echo html_writer::end_tag('div');
        $mform->display();
        echo $OUTPUT->footer();
        die;
    }
}
// Data has already been submitted so we can use the $iid to retrieve it.
$csvimport = new csv_import_reader($iid, 'grade');
$header = $csvimport->get_columns();
// we create a form to handle mapping data from the file to the database.
$mform2 = new grade_import_mapping_form(null, array('gradeitems' => $gradeitems, 'header' => $header));
$mform2->set_data(array('iid' => $iid, 'id' => $id, 'importcode' => $importcode, 'verbosescales' => $verbosescales));
// Here, if we have data, we process the fields and enter the information into the database.
if ($formdata = $mform2->get_data()) {
开发者ID:covex-nn,项目名称:moodle,代码行数:31,代码来源:index.php

示例3: get_string

    // Navigation and header
    $strreports = get_string("reports");
    $strcompletion = get_string('activitycompletion', 'completion');

    $PAGE->set_title($strcompletion);
    $PAGE->set_heading($course->fullname);
    echo $OUTPUT->header();

    if ($svgcleverness) {
        $PAGE->requires->js('/report/progress/textrotate.js');
        $PAGE->requires->js_function_call('textrotate_init', null, true);
    }

    // Handle groups (if enabled)
    groups_print_course_menu($course,$CFG->wwwroot.'/report/progress/?course='.$course->id);
}

if (count($activities)==0) {
    echo $OUTPUT->container(get_string('err_noactivities', 'completion'), 'errorbox errorboxcontent');
    echo $OUTPUT->footer();
    exit;
}

// If no users in this course what-so-ever
if (!$grandtotal) {
    echo $OUTPUT->container(get_string('err_nousers', 'completion'), 'errorbox errorboxcontent');
    echo $OUTPUT->footer();
    exit;
}
开发者ID:Jtgadbois,项目名称:Pedadida,代码行数:29,代码来源:index.php

示例4: grade_report_user

         $user = $userdata->user;
         $report = new grade_report_user($courseid, $gpr, $context, $user->id);
         $studentnamelink = html_writer::link(new moodle_url('/user/view.php', array('id' => $report->user->id, 'course' => $courseid)), fullname($report->user));
         echo $OUTPUT->heading(get_string('pluginname', 'gradereport_user') . ' - ' . $studentnamelink);
         if ($report->fill_table()) {
             echo '<br />' . $report->print_table(true);
         }
         echo "<p style = 'page-break-after: always;'></p>";
     }
     $gui->close();
 } else {
     // Only show one user's report
     $report = new grade_report_user($courseid, $gpr, $context, $userid);
     $studentnamelink = html_writer::link(new moodle_url('/user/view.php', array('id' => $report->user->id, 'course' => $courseid)), fullname($report->user));
     print_grade_page_head($courseid, 'report', 'user', get_string('pluginname', 'gradereport_user') . ' - ' . $studentnamelink, false, false, true, null, null, $report->user);
     groups_print_course_menu($course, $gpr->get_return_url('index.php?id=' . $courseid, array('userid' => 0)));
     if ($user_selector) {
         $renderer = $PAGE->get_renderer('gradereport_user');
         $showallusersoptions = true;
         echo $renderer->graded_users_selector('user', $course, $userid, $currentgroup, $showallusersoptions);
     }
     if ($currentgroup and !groups_is_member($currentgroup, $userid)) {
         echo $OUTPUT->notification(get_string('groupusernotmember', 'error'));
     } else {
         if ($report->fill_table()) {
             echo '<br />' . $report->print_table(true, $userid, $courseid);
             //START BY @HARSHA
             //echo '<br />'.$report->print_table(true);
         }
     }
 }
开发者ID:harshasunny,项目名称:grade,代码行数:31,代码来源:index.php

示例5: setup_groups

 /**
  * Sets up this object's group variables, mainly to restrict the selection of users to display.
  */
 protected function setup_groups()
 {
     /// find out current groups mode
     if ($this->groupmode = groups_get_course_groupmode($this->course)) {
         $this->currentgroup = groups_get_course_group($this->course, true);
         $this->group_selector = groups_print_course_menu($this->course, $this->pbarurl, true);
         if ($this->groupmode == SEPARATEGROUPS and !$this->currentgroup and !has_capability('moodle/site:accessallgroups', $this->context)) {
             $this->currentgroup = -2;
             // means can not access any groups at all
         }
         if ($this->currentgroup) {
             $this->groupsql = " JOIN {groups_members} gm ON gm.userid = u.id ";
             $this->groupwheresql = " AND gm.groupid = :gr_grpid ";
             $this->groupwheresql_params = array('gr_grpid' => $this->currentgroup);
         }
     }
 }
开发者ID:tyleung,项目名称:CMPUT401MoodleExams,代码行数:20,代码来源:lib.php

示例6: required_param

 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
 */
require __DIR__ . '/../../config.php';
$courseid = required_param('courseid', PARAM_INT);
require_login($courseid);
$manager = block_xp_manager::get($courseid);
$context = $manager->get_context();
if (!$manager->can_view_ladder_page()) {
    throw new moodle_exception('nopermissions', '', '', 'view_ladder_page');
}
// Some stuff.
$url = new moodle_url('/blocks/xp/ladder.php', array('courseid' => $courseid));
$strladder = get_string('ladder', 'block_xp');
// Page info.
$PAGE->set_context($context);
$PAGE->set_pagelayout('course');
$PAGE->set_title($strladder);
$PAGE->set_heading($COURSE->fullname);
$PAGE->set_url($url);
$manager = block_xp_manager::get($courseid);
$group = groups_get_course_group($manager->get_course(), true);
$renderer = $PAGE->get_renderer('block_xp');
echo $OUTPUT->header();
echo $OUTPUT->heading($strladder);
echo $renderer->navigation($manager, 'ladder');
echo $renderer->notices($manager);
groups_print_course_menu($manager->get_course(), $url);
$table = new block_xp_ladder_table('block_xp_ladder', $courseid, $group, array('identitymode' => $manager->get_config('identitymode'), 'rankmode' => $manager->get_config('rankmode'), 'neighboursonly' => $manager->get_config('neighbours') > 0, 'neighboursabove' => $manager->get_config('neighbours'), 'neighboursbelow' => $manager->get_config('neighbours')));
$table->define_baseurl($url);
echo $table->out(20, false);
echo $OUTPUT->footer();
开发者ID:antoniorodrigues,项目名称:redes-digitais,代码行数:31,代码来源:ladder.php

示例7: aconnect_logout

    }
    aconnect_logout($aconnect);
}
// Log in the current user
$login = $usrobj->username;
$password = $usrobj->username;
$https = false;
if (isset($CFG->adobeconnect_https) and !empty($CFG->adobeconnect_https)) {
    $https = true;
}
$aconnect = new connect_class_dom($CFG->adobeconnect_host, $CFG->adobeconnect_port, '', '', '', $https);
$aconnect->request_http_header_login(1, $login);
$adobesession = $aconnect->get_cookie();
if ($cm->groupmode) {
    // Not sure if this is needed anymore...
    groups_print_course_menu($course, "view.php?id={$id}");
}
$aconnect = aconnect_login();
// Get the Meeting details
$cond = array('instanceid' => $adobeconnect->id, 'groupid' => $groupid);
$scoid = $DB->get_field('adobeconnect_meeting_groups', 'meetingscoid', $cond);
$meetfldscoid = aconnect_get_folder($aconnect, 'my-meetings');
$filter = array('filter-sco-id' => $scoid);
if ($meeting = aconnect_meeting_exists($aconnect, $meetfldscoid, $filter)) {
    $meeting = current($meeting);
} else {
    $message = get_string('nomeeting', 'adobeconnect');
    $OUTPUT->notification($message);
    aconnect_logout($aconnect);
    die;
}
开发者ID:rrusso,项目名称:moodle2-adobeconnect,代码行数:31,代码来源:view.php

示例8: array

if ($mycourses = enrol_get_my_courses()) {
    $courselist = array();
    $popupurl = new moodle_url('/user/index.php?roleid=' . $roleid . '&sifirst=&silast=');
    foreach ($mycourses as $mycourse) {
        $coursecontext = context_course::instance($mycourse->id);
        $courselist[$mycourse->id] = format_string($mycourse->shortname, true, array('context' => $coursecontext));
    }
    if (has_capability('moodle/site:viewparticipants', $systemcontext)) {
        unset($courselist[SITEID]);
        $courselist = array(SITEID => format_string($SITE->shortname, true, array('context' => $systemcontext))) + $courselist;
    }
    $select = new single_select($popupurl, 'id', $courselist, $course->id, null, 'courseform');
    $select->set_label(get_string('mycourses'));
    $controlstable->data[0]->cells[] = $OUTPUT->render($select);
}
if ($groupmenu = groups_print_course_menu($course, $baseurl->out(), true)) {
    $controlstable->data[0]->cells[] = $groupmenu;
}
if (!isset($hiddenfields['lastaccess'])) {
    // Get minimum lastaccess for this course and display a dropbox to filter by lastaccess going back this far.
    // We need to make it diferently for normal courses and site course.
    if (!$isfrontpage) {
        $minlastaccess = $DB->get_field_sql('SELECT min(timeaccess)
                                               FROM {user_lastaccess}
                                              WHERE courseid = ?
                                                    AND timeaccess != 0', array($course->id));
        $lastaccess0exists = $DB->record_exists('user_lastaccess', array('courseid' => $course->id, 'timeaccess' => 0));
    } else {
        $minlastaccess = $DB->get_field_sql('SELECT min(lastaccess)
                                               FROM {user}
                                              WHERE lastaccess != 0');
开发者ID:alanaipe2015,项目名称:moodle,代码行数:31,代码来源:index.php

示例9: strip_tags

                $rolenames[$role->id] = strip_tags(role_get_name($role, $context));
                // Used in menus etc later on
            } else {
                $rolenames[$role->id] = strip_tags(format_string($role->name));
                // Used in menus etc later on
            }
        }
    }
    /// If there are multiple Roles in the course, then show a drop down menu for switching
    if (count($rolenames) > 1) {
        echo '<div class="rolesform">';
        echo get_string('currentrole', 'role') . ': ';
        $rolenames = array(0 => get_string('all')) + $rolenames;
        popup_form("{$wwwroot}/blocks/email_list/email/participants.php?id={$courseid}&amp;group={$selgroup}&amp;page={$page}&amp;perpage={$perpage}&amp;search={$search}&amp;fname={$firstinitial}&amp;lname={$lastinitial}&amp;contextid={$context->id}&amp;roleid=", $rolenames, 'rolesform', $roleid, '');
        echo '</div>';
    }
    // Prints group selector for users with a viewallgroups capability if course groupmode is separate
    echo '<br />';
    groups_print_course_menu($course, $wwwroot . '/blocks/email_list/email/participants.php?id=' . $course->id);
    echo '<br /><br />';
    echo '<div id="participants"></div>' . '<iframe id="idsearch" name="bssearch" src="get_users.php?id=' . $courseid . '&amp;roleid=' . $roleid . '&amp;group=' . $selgroup . '&amp;page=' . $page . '&amp;perpage=' . $perpage . '&amp;search=' . $search . '&amp;fname=' . $firstinitial . '&amp;lname=' . $lastinitial . '" style="display:none;"></iframe>' . "\n\n";
    print_spacer(1, 4, false);
    if ($perpage == '7') {
        echo '<div id="to_all_users" class="all_users"><img src="' . $CFG->wwwroot . '/blocks/email_list/email/images/add.png" height="16" width="16" alt="' . get_string("course") . '" /> <a href="' . $wwwroot . '/blocks/email_list/email/participants.php?id=' . $courseid . '&amp;group=' . $selgroup . '&amp;perpage=99999&amp;search=' . $search . '&amp;roleid=' . $roleid . '&amp;fname=' . $firstinitial . '&amp;lname=' . $lastinitial . '">' . get_string('showallusers') . '</a></div>';
    } else {
        echo '<div id="to_all_users" class="all_users"><img src="' . $CFG->wwwroot . '/blocks/email_list/email/images/delete.png" height="16" width="16" alt="' . get_string("course") . '" /> <a href="' . $wwwroot . '/blocks/email_list/email/participants.php?id=' . $courseid . '&amp;group=' . $selgroup . '&amp;perpage=7&amp;search=' . $search . '&amp;roleid=' . $roleid . '&amp;fname=' . $firstinitial . '&amp;lname=' . $lastinitial . '">' . get_string('showperpage', '', 7) . '</a></div>';
    }
}
// Print close button
close_window_button();
print_footer();
开发者ID:henriquecrang,项目名称:e-UNI,代码行数:31,代码来源:participants.php

示例10: AND

         $members1[] = $row->user1;
         $members1[] = $row->user2;
     }
     $select = "apid={$antipla->id} AND (user1={$seed->user2} OR user2={$seed->user2})";
     $results = get_records_select('block_anti_plagiarism_pairs', $select);
     $members2 = array();
     foreach ($results as $row) {
         $members2[] = $row->user1;
         $members2[] = $row->user2;
     }
     $members = array_unique(array_intersect($members1, $members2));
     $member_str = implode(',', $members);
     $select = "apid={$antipla->id} AND user1 IN ({$member_str}) AND user2 IN ({$member_str})";
     $results = get_records_select('block_anti_plagiarism_pairs', $select, 'rank');
 } else {
     groups_print_course_menu($course, "view.php?id={$id}&block={$block}&action={$action}");
     $group = groups_get_course_group($course);
     echo '<div class="clearer"></div>';
     $where = "apid = {$antipla->id}";
     if ($group != 0) {
         if ($users = groups_get_members($group, 'u.id', 'u.id')) {
             $users = array_keys($users);
             $userids = implode(',', $users);
             $where .= ' AND (user1 IN (' . $userids . ') OR user2 IN (' . $userids . '))';
         } else {
             $results = false;
         }
     }
     $where .= $action === 'confirmed' ? ' AND confirmed=1' : '';
     if (!isset($results)) {
         $results = get_records_select('block_anti_plagiarism_pairs', $where, 'rank');
开发者ID:rabeshi,项目名称:anti_plagiarism,代码行数:31,代码来源:view.php

示例11: setup_groups

 /**
  * Sets up this object's group variables, mainly to restrict the selection of users to display.
  */
 function setup_groups()
 {
     global $CFG;
     /// find out current groups mode
     if ($this->groupmode = groups_get_course_groupmode($this->course)) {
         $this->currentgroup = groups_get_course_group($this->course, true);
         $this->group_selector = groups_print_course_menu($this->course, $this->pbarurl, true);
         if ($this->groupmode == SEPARATEGROUPS and !$this->currentgroup and !has_capability('moodle/site:accessallgroups', $this->context)) {
             $this->currentgroup = -2;
             // means can not accesss any groups at all
         }
         if ($this->currentgroup) {
             $this->groupsql = " JOIN {$CFG->prefix}groups_members gm ON gm.userid = u.id ";
             $this->groupwheresql = " AND gm.groupid = {$this->currentgroup} ";
         }
     }
 }
开发者ID:edwinphillips,项目名称:moodle-485cb39,代码行数:20,代码来源:lib.php

示例12: get_content

 function get_content()
 {
     global $COURSE, $CFG, $USER;
     if ($this->content !== NULL) {
         return $this->content;
     }
     $filteropt = new stdClass();
     $filteropt->overflowdiv = true;
     if ($this->content_is_trusted()) {
         // fancy html allowed only on course, category and system blocks.
         $filteropt->noclean = true;
     }
     $this->content = new stdClass();
     $this->content->text = '';
     $usegroupmenu = true;
     if (has_capability('moodle/site:accessallgroups', context_course::instance($COURSE->id))) {
         $usegroupmenu = true;
     } else {
         $usergroupings = groups_get_user_groups($COURSE->id, $USER->id);
         if (count($usergroupings) == 1) {
             $usergroups = array_pop($usergroupings);
             if (count($usergroups) == 1) {
                 $usegroupmenu = false;
                 $uniquegroup = array_pop($usergroups);
             }
         }
     }
     $coursegroups = groups_get_all_groups($COURSE->id);
     if ($coursegroups && $usegroupmenu) {
         $this->content->text .= groups_print_course_menu($COURSE, $CFG->wwwroot . '/course/view.php?id=' . $COURSE->id, true);
     }
     $gid = 0 + groups_get_course_group($COURSE, $USER->id);
     if (@$uniquegroup && !$gid) {
         $gid = $uniquegroup;
     }
     $textkeys = array('text_all');
     if (!empty($coursegroups)) {
         $textkeys[] = 'text_' . $gid;
     }
     foreach ($textkeys as $tk) {
         if (isset($this->config->{$tk})) {
             $format = FORMAT_HTML;
             // Check to see if the format has been properly set on the config
             $formatkey = str_replace('text_', 'format_', $tk);
             if (isset($this->config->{$formatkey})) {
                 $format = $this->config->{$formatkey};
             }
             // rewrite url
             $this->config->{$tk} = file_rewrite_pluginfile_urls($this->config->{$tk}, 'pluginfile.php', $this->context->id, 'block_groupspecifichtml', 'content', NULL);
             // Default to FORMAT_HTML which is what will have been used before the
             // editor was properly implemented for the block.
             $this->content->text .= format_text($this->config->{$tk}, $format, $filteropt);
         } else {
             $this->content->text .= '';
         }
     }
     $this->content->footer = '';
     unset($filteropt);
     // memory footprint
     if (empty($this->content->text)) {
         $this->content->text = '&nbsp;';
     }
     return $this->content;
 }
开发者ID:actXc,项目名称:moodle-block_groupspecifichtml,代码行数:64,代码来源:block_groupspecifichtml.php

示例13: foreach

        } else {
            if (!empty($data->addbcc)) {
                foreach ($userids as $userid) {
                    $message->add_recipient('bcc', $userid);
                }
            }
        }
    }
    $url = new moodle_url('/local/mail/compose.php', array('m' => $messageid));
    redirect($url);
}
// Display page
echo $OUTPUT->header();
echo $OUTPUT->container_start('mail-recipients');
echo $OUTPUT->heading(get_string('addrecipients', 'local_mail'), 2);
groups_print_course_menu($COURSE, $PAGE->url);
echo html_writer::start_tag('form', array('method' => 'post', 'action' => $url));
$participants->display();
echo $OUTPUT->container_start('buttons');
$label = get_string('addto', 'local_mail');
$attributes = array('type' => 'submit', 'name' => 'addto', 'value' => $label);
echo html_writer::empty_tag('input', $attributes);
$label = get_string('addcc', 'local_mail');
$attributes = array('type' => 'submit', 'name' => 'addcc', 'value' => $label);
echo html_writer::empty_tag('input', $attributes);
$label = get_string('addbcc', 'local_mail');
$attributes = array('type' => 'submit', 'name' => 'addbcc', 'value' => $label);
echo html_writer::empty_tag('input', $attributes);
$label = get_string('cancel');
$attributes = array('type' => 'submit', 'name' => 'cancel', 'value' => $label);
echo html_writer::empty_tag('input', $attributes);
开发者ID:miguelangelUvirtual,项目名称:uEducon,代码行数:31,代码来源:recipients.php

示例14: chr

        $line = "\n" . chr(0);
    } else {
        header('Content-Type: text/csv; charset=UTF-8');
        $sep = ",";
        $line = "\n";
    }
} else {
    // Navigation and header
    $strcompletion = get_string('coursecompletion');
    $PAGE->set_title($strcompletion);
    $PAGE->set_heading($course->fullname);
    echo $OUTPUT->header();
    $PAGE->requires->yui2_lib(array('yahoo', 'dom', 'element', 'event'));
    $PAGE->requires->js('/course/report/completion/textrotate.js');
    // Handle groups (if enabled)
    groups_print_course_menu($course, $CFG->wwwroot . '/course/report/completion/?course=' . $course->id);
}
// Generate where clause
$where = array();
$where_params = array();
if ($sifirst !== 'all') {
    $where[] = $DB->sql_like('u.firstname', ':sifirst', false);
    $where_params['sifirst'] = $sifirst . '%';
}
if ($silast !== 'all') {
    $where[] = $DB->sql_like('u.lastname', ':silast', false);
    $where_params['silast'] = $silast . '%';
}
// Get user match count
$total = $completion->get_num_tracked_users(implode(' AND ', $where), $where_params, $group);
// Total user count
开发者ID:sebastiansanio,项目名称:tallerdeprogramacion2fiuba,代码行数:31,代码来源:index.php

示例15: email_choose_users_to_send


//.........这里部分代码省略.........
        }
        // we are looking for all users with this role assigned in this context or higher
        if ($usercontexts = get_parent_contexts($context)) {
            $listofcontexts = '(' . implode(',', $usercontexts) . ')';
        } else {
            $listofcontexts = '(' . $sitecontext->id . ')';
            // must be site
        }
        if ($roleid) {
            $selectrole = " AND r.roleid = {$roleid} ";
        } else {
            $selectrole = " ";
        }
        if ($context->id != $frontpagectx->id) {
            $select = 'SELECT DISTINCT u.id, u.username, u.firstname, u.lastname ';
        } else {
            $select = 'SELECT u.id, u.username, u.firstname, u.lastname ';
        }
        if ($context->id != $frontpagectx->id) {
            $from = "FROM {$CFG->prefix}user u\n\t                LEFT OUTER JOIN {$CFG->prefix}context ctx\n\t                    ON (u.id=ctx.instanceid AND ctx.contextlevel = " . CONTEXT_USER . ")\n\t                JOIN {$CFG->prefix}role_assignments r\n\t                    ON u.id=r.userid\n\t                LEFT OUTER JOIN {$CFG->prefix}user_lastaccess ul\n\t                    ON (r.userid=ul.userid and ul.courseid = {$course->id}) ";
        } else {
            $from = "FROM {$CFG->prefix}user u\n\t                LEFT OUTER JOIN {$CFG->prefix}context ctx\n\t                    ON (u.id=ctx.instanceid AND ctx.contextlevel = " . CONTEXT_USER . ") ";
        }
        $hiddensql = has_capability('moodle/role:viewhiddenassigns', $context) ? '' : ' AND r.hidden = 0 ';
        // exclude users with roles we are avoiding
        if ($avoidroles) {
            $adminroles = 'AND r.roleid NOT IN (';
            $adminroles .= implode(',', $avoidroles);
            $adminroles .= ')';
        } else {
            $adminroles = '';
        }
        // join on 2 conditions
        // otherwise we run into the problem of having records in ul table, but not relevant course
        // and user record is not pulled out
        if ($context->id != $frontpagectx->id) {
            $where = "WHERE (r.contextid = {$context->id} OR r.contextid in {$listofcontexts})\n\t            AND u.deleted = 0 {$selectrole}\n\t            AND (ul.courseid = {$course->id} OR ul.courseid IS NULL)\n\t            AND u.username != 'guest'\n\t            {$adminroles}\n\t            {$hiddensql} ";
        } else {
            $where = "WHERE u.deleted = 0\n\t            AND u.username != 'guest'";
        }
        if ($currentgroup and $course->groupmode != 0) {
            // Displaying a group by choice
            $from .= 'LEFT JOIN ' . $CFG->prefix . 'groups_members gm ON u.id = gm.userid ';
            // $currentgroup can be an array of groups id
            if (is_array($currentgroup)) {
                $where .= ' AND gm.groupid IN (' . implode(',', $currentgroup) . ') ';
            } else {
                if ($currentgroup == 0) {
                    if (!has_capability('block/email_list:viewallgroups', $context) && $COURSE->groupmode == 1) {
                        $groupids = groups_get_groups_for_user($USER->id, $COURSE->id);
                        $where .= 'AND gm.groupid IN (' . implode(',', $groupids) . ')';
                    }
                } else {
                    $where .= 'AND gm.groupid = ' . $currentgroup;
                }
            }
            $where .= ' AND gm.groupid = ' . $currentgroup;
        }
        $sort = ' ORDER BY u.firstname, u.lastname';
        $userlist = get_records_sql($select . $from . $where . $sort);
        if ($userlist) {
            foreach ($userlist as $user) {
                $unselectedusers[$user->id] = addslashes(fullname($user, has_capability('moodle/site:viewfullnames', $context)));
            }
        }
        /// If there are multiple Roles in the course, then show a drop down menu for switching
        if (count($rolenames) > 1) {
            echo '<div class="rolesform">';
            echo get_string('currentrole', 'role') . ': ';
            $rolenames = array(0 => get_string('all')) + $rolenames;
            popup_form("{$CFG->wwwroot}/blocks/email_list/email/participants.php?id={$courseid}&amp;group={$currentgroup}&amp;contextid={$context->id}&amp;roleid=", $rolenames, 'rolesform', $roleid, '');
            echo '</div>';
        }
        // Prints group selector for users with a viewallgroups capability if course groupmode is separate
        echo '<br />';
        groups_print_course_menu($course, $CFG->wwwroot . '/blocks/email_list/email/participants.php?id=' . $course->id);
        echo '<br /><br />';
    }
    // Prepare tags
    $straddusersto = get_string('addusersto', 'block_email_list');
    $stradduserscc = get_string('cc', 'block_email_list');
    $straddusersbcc = get_string('bcc', 'block_email_list');
    $stradd = get_string('ok');
    $strto = get_string('to', 'block_email_list');
    $strcc = get_string('cc', 'block_email_list');
    $strbcc = get_string('bcc', 'block_email_list');
    $strselectedusersremove = get_string('selectedusersremove', 'block_email_list');
    $straction = get_string('selectaction', 'block_email_list');
    $strcancel = get_string('cancel');
    // Create an object for define parametrer
    $options = new stdClass();
    $options->id = $courseid;
    // Prepare url
    $toform = email_build_url($options, true);
    -($url = $CFG->wwwroot . '/blocks/email_list/email/sendmail.php');
    if ($options) {
        $urlhtml = email_build_url($options);
    }
    include_once 'participants.html';
}
开发者ID:hmatulis,项目名称:RTL-BIDI-Hebrew-Moodle-Plugins,代码行数:101,代码来源:lib.php


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