Ejemplo n.º 1
0
        $PAGE->navbar->add(get_string('showfacesbygroup', 'block_faces'));
    }
}
$PAGE->set_url('/blocks/faces/showfaces/show.php');
$PAGE->set_context(context_course::instance($cid));
$PAGE->set_heading(get_string('pluginname', 'block_faces'));
$PAGE->set_title(get_string('pluginname', 'block_faces'));
echo $OUTPUT->header();
echo build_menu($cid);
// Render the page
$selectgroupsec = optional_param('selectgroupsec', '', PARAM_TEXT);
if (isset($selectgroupsec)) {
    if ($selectgroupsec == 'all' || $selectgroupsec == '') {
        echo render_all();
    } else {
        echo render_group();
    }
} else {
    echo render_all();
}
/**
 * 
 * Create the HTML output for the list on the right
 * hand side of the showfaces.php page
 * @param int $cid course id 
 * */
function build_menu($cid)
{
    global $DB, $CFG, $rendertype;
    $orderby = '';
    $orderby = optional_param('orderby', 'firstname', PARAM_TEXT);
Ejemplo n.º 2
0
//
/**
 * FACES BLOCK FOR MOODLE
 *
 * @package    block_faces
 * @copyright  2014 Kyle Goslin, Daniel McSweeney
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
 */
require_once "../../../config.php";
global $CFG, $DB;
require_login();
$cid = optional_param('cid', 0, PARAM_INT);
$PAGE->set_context(context_course::instance($cid));
require_once '../showfaces/renderFaces.php';
$rendertype = optional_param('rendertype', '', PARAM_TEXT);
if (isset($rendertype)) {
    if ($rendertype == 'all' || $rendertype == '') {
        echo render_all();
    } else {
        if ($rendertype == 'group') {
            echo render_group();
        }
    }
} else {
    render_group();
}
?>

<script>window.print();</script>