Exemplo n.º 1
0
    // Use new context id, it could have been changed.
    redirect(new moodle_url('/local/batches/index.php'));
}


if ($editform->is_submitted() && !$editform->is_validated())
    $collapse = false;

//$batches = new local_batches();
//$PAGE->navbar->add(get_string('pluginname', 'local_batches'));
echo $OUTPUT->header();
//Heading of the page
echo $OUTPUT->heading(get_string('pluginname', 'local_batches'), '2', 'tmhead2');

print_collapsible_region_start('', 'batches-form', '<button>' . $form_heading . '</button>', false, $collapse);
$editform->display();
print_collapsible_region_end();


if (is_siteadmin()) {
    $school = $hierarchy->get_school_items();
    $sql = "SELECT c.* FROM {cohort} as c
            JOIN {local_batch_map} as map on map.batchid=c.id WHERE contextid = :context";
} else {
    $schools = $hierarchy->get_assignedschools();
    foreach ($schools as $school) {
        $school_id[] = $school->id;
    }
    $schoolids = implode(',', $school_id);
Exemplo n.º 2
0
 /**
  * Output this user_selector as HTML.
  * @param boolean $return if true, return the HTML as a string instead of outputting it.
  * @return mixed if $return is true, returns the HTML as a string, otherwise returns nothing.
  */
 public function display($return = false)
 {
     global $PAGE;
     // Get the list of requested users.
     $search = optional_param($this->name . '_searchtext', '', PARAM_RAW);
     if (optional_param($this->name . '_clearbutton', false, PARAM_BOOL)) {
         $search = '';
     }
     $groupedusers = $this->find_users($search);
     // Output the select.
     $name = $this->name;
     $multiselect = '';
     if ($this->multiselect) {
         $name .= '[]';
         $multiselect = 'multiple="multiple" ';
     }
     $output = '<div class="userselector" id="' . $this->name . '_wrapper">' . "\n" . '<select name="' . $name . '" id="' . $this->name . '" ' . $multiselect . 'size="' . $this->rows . '">' . "\n";
     // Populate the select.
     $output .= $this->output_options($groupedusers, $search);
     // Output the search controls.
     $output .= "</select>\n<div>\n";
     $output .= '<input type="text" name="' . $this->name . '_searchtext" id="' . $this->name . '_searchtext" size="15" value="' . s($search) . '" />';
     $output .= '<input type="submit" name="' . $this->name . '_searchbutton" id="' . $this->name . '_searchbutton" value="' . $this->search_button_caption() . '" />';
     $output .= '<input type="submit" name="' . $this->name . '_clearbutton" id="' . $this->name . '_clearbutton" value="' . get_string('clear') . '" />';
     // And the search options.
     $optionsoutput = false;
     if (!user_selector_base::$searchoptionsoutput) {
         $output .= print_collapsible_region_start('', 'userselector_options', get_string('searchoptions'), 'userselector_optionscollapsed', true, true);
         $output .= $this->option_checkbox('preserveselected', $this->preserveselected, get_string('userselectorpreserveselected'));
         $output .= $this->option_checkbox('autoselectunique', $this->autoselectunique, get_string('userselectorautoselectunique'));
         $output .= $this->option_checkbox('searchanywhere', $this->searchanywhere, get_string('userselectorsearchanywhere'));
         $output .= print_collapsible_region_end(true);
         $PAGE->requires->js_init_call('M.core_user.init_user_selector_options_tracker', array(), false, self::$jsmodule);
         user_selector_base::$searchoptionsoutput = true;
     }
     $output .= "</div>\n</div>\n\n";
     // Initialise the ajax functionality.
     $output .= $this->initialise_javascript($search);
     // Return or output it.
     if ($return) {
         return $output;
     } else {
         echo $output;
     }
 }
Exemplo n.º 3
0
    /**
     * This display all the documentation
     * @param array $functions contains all decription objects
     * @param array $authparam keys contains 'tokenid'
     * @param boolean $printableformat true if we want to display the documentation in a printable format
     * @param array $activatedprotocol
     * @param string $parenturl url of the calling page - needed for the print button url:
     *               '/admin/documentation.php' or '/webservice/wsdoc.php' (default)
     * @return string the html to diplay
     */
    public function documentation_html($functions, $printableformat, $activatedprotocol,
            $authparams, $parenturl = '/webservice/wsdoc.php') {

        $documentationhtml = $this->output->heading(get_string('wsdocapi', 'webservice'));

        $br = html_writer::empty_tag('br', array());
        $brakeline = <<<EOF


EOF;
        /// Some general information
        $docinfo = new stdClass();
        $docurl = new moodle_url('http://docs.moodle.org/dev/Creating_a_web_service_client');
        $docinfo->doclink = html_writer::tag('a',
                        get_string('wsclientdoc', 'webservice'), array('href' => $docurl));
        $documentationhtml .= html_writer::start_tag('table',
                        array('style' => "margin-left:auto; margin-right:auto;"));
        $documentationhtml .= html_writer::start_tag('tr', array());
        $documentationhtml .= html_writer::start_tag('td', array());
        $documentationhtml .= get_string('wsdocumentationintro', 'webservice', $docinfo);
        $documentationhtml .= $br . $br;


        /// Print button
        $authparams['print'] = true;
        //$parameters = array ('token' => $token, 'wsusername' => $username, 'wspassword' => $password, 'print' => true);
        $url = new moodle_url($parenturl, $authparams); // Required
        $documentationhtml .= $this->output->single_button($url, get_string('print', 'webservice'));
        $documentationhtml .= $br;


        /// each functions will be displayed into a collapsible region
        //(opened if printableformat = true)
        foreach ($functions as $functionname => $description) {

            if (empty($printableformat)) {
                $documentationhtml .= print_collapsible_region_start('',
                                'aera_' . $functionname,
                                html_writer::start_tag('strong', array())
                                . $functionname . html_writer::end_tag('strong'),
                                false,
                                !$printableformat,
                                true);
            } else {
                $documentationhtml .= html_writer::tag('strong', $functionname);
                $documentationhtml .= $br;
            }

            /// function global description
            $documentationhtml .= $br;
            $documentationhtml .= html_writer::start_tag('div',
                            array('style' => 'border:solid 1px #DEDEDE;background:#E2E0E0;
                        color:#222222;padding:4px;'));
            $documentationhtml .= $description->description;
            $documentationhtml .= html_writer::end_tag('div');
            $documentationhtml .= $br . $br;

            /// function arguments documentation
            $documentationhtml .= html_writer::start_tag('span', array('style' => 'color:#EA33A6'));
            $documentationhtml .= get_string('arguments', 'webservice');
            $documentationhtml .= html_writer::end_tag('span');
            $documentationhtml .= $br;
            foreach ($description->parameters_desc->keys as $paramname => $paramdesc) {
                /// a argument documentation
                $documentationhtml .= html_writer::start_tag('span', array('style' => 'font-size:80%'));

                if ($paramdesc->required == VALUE_REQUIRED) {
                    $required = get_string('required', 'webservice');
                }
                if ($paramdesc->required == VALUE_DEFAULT) {
                    if ($paramdesc->default === null) {
                        $default = "null";
                    } else {
                        $default = print_r($paramdesc->default, true);
                    }
                    $required = get_string('default', 'webservice', $default);
                }
                if ($paramdesc->required == VALUE_OPTIONAL) {
                    $required = get_string('optional', 'webservice');
                }

                $documentationhtml .= html_writer::start_tag('b', array());
                $documentationhtml .= $paramname;
                $documentationhtml .= html_writer::end_tag('b');
                $documentationhtml .= " (" . $required . ")"; // argument is required or optional ?
                $documentationhtml .= $br;
                $documentationhtml .= "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"
                        . $paramdesc->desc; // argument description
                $documentationhtml .= $br . $br;
                ///general structure of the argument
                $documentationhtml .= $this->colored_box_with_pre_tag(
                                get_string('generalstructure', 'webservice'),
                                $this->detailed_description_html($paramdesc),
                                'FFF1BC');
                ///xml-rpc structure of the argument in PHP format
                if (!empty($activatedprotocol['xmlrpc'])) {
                    $documentationhtml .= $this->colored_box_with_pre_tag(
                                    get_string('phpparam', 'webservice'),
                                    htmlentities('[' . $paramname . '] =>'
                                            . $this->xmlrpc_param_description_html($paramdesc)),
                                    'DFEEE7');
                }
                ///POST format for the REST protocol for the argument
                if (!empty($activatedprotocol['rest'])) {
                    $documentationhtml .= $this->colored_box_with_pre_tag(
                                    get_string('restparam', 'webservice'),
                                    htmlentities($this->rest_param_description_html(
                                                    $paramdesc, $paramname)),
                                    'FEEBE5');
                }
                $documentationhtml .= html_writer::end_tag('span');
            }
            $documentationhtml .= $br . $br;


            /// function response documentation
            $documentationhtml .= html_writer::start_tag('span', array('style' => 'color:#EA33A6'));
            $documentationhtml .= get_string('response', 'webservice');
            $documentationhtml .= html_writer::end_tag('span');
            $documentationhtml .= $br;
            /// function response description
            $documentationhtml .= html_writer::start_tag('span', array('style' => 'font-size:80%'));
            if (!empty($description->returns_desc->desc)) {
                $documentationhtml .= $description->returns_desc->desc;
                $documentationhtml .= $br . $br;
            }
            if (!empty($description->returns_desc)) {
                ///general structure of the response
                $documentationhtml .= $this->colored_box_with_pre_tag(
                                get_string('generalstructure', 'webservice'),
                                $this->detailed_description_html($description->returns_desc),
                                'FFF1BC');
                ///xml-rpc structure of the response in PHP format
                if (!empty($activatedprotocol['xmlrpc'])) {
                    $documentationhtml .= $this->colored_box_with_pre_tag(
                                    get_string('phpresponse', 'webservice'),
                                    htmlentities($this->xmlrpc_param_description_html(
                                                    $description->returns_desc)),
                                    'DFEEE7');
                }
                ///XML response for the REST protocol
                if (!empty($activatedprotocol['rest'])) {
                    $restresponse = "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>"
                            . $brakeline . "<RESPONSE>" . $brakeline;
                    $restresponse .= $this->description_in_indented_xml_format(
                                    $description->returns_desc);
                    $restresponse .="</RESPONSE>" . $brakeline;
                    $documentationhtml .= $this->colored_box_with_pre_tag(
                                    get_string('restcode', 'webservice'),
                                    htmlentities($restresponse),
                                    'FEEBE5');
                }
            }
            $documentationhtml .= html_writer::end_tag('span');
            $documentationhtml .= $br . $br;

            /// function errors documentation for REST protocol
            if (!empty($activatedprotocol['rest'])) {
                $documentationhtml .= html_writer::start_tag('span', array('style' => 'color:#EA33A6'));
                $documentationhtml .= get_string('errorcodes', 'webservice');
                $documentationhtml .= html_writer::end_tag('span');
                $documentationhtml .= $br . $br;
                $documentationhtml .= html_writer::start_tag('span', array('style' => 'font-size:80%'));
                $errormessage = get_string('invalidparameter', 'debug');
                $restexceptiontext = <<<EOF
<?xml version="1.0" encoding="UTF-8"?>
<EXCEPTION class="invalid_parameter_exception">
    <MESSAGE>{$errormessage}</MESSAGE>
    <DEBUGINFO></DEBUGINFO>
</EXCEPTION>
EOF;
                $documentationhtml .= $this->colored_box_with_pre_tag(
                                get_string('restexception', 'webservice'),
                                htmlentities($restexceptiontext),
                                'FEEBE5');

                $documentationhtml .= html_writer::end_tag('span');
            }
            $documentationhtml .= $br . $br;
            if (empty($printableformat)) {
                $documentationhtml .= print_collapsible_region_end(true);
            }
        }

        /// close the table and return the documentation
        $documentationhtml .= html_writer::end_tag('td');
        $documentationhtml .= html_writer::end_tag('tr');
        $documentationhtml .= html_writer::end_tag('table');

        return $documentationhtml;
    }
Exemplo n.º 4
0
                print_collapsible_region_end();
            }
        }
        if (has_capability('mod/workshop:submit', $PAGE->context)) {
            print_collapsible_region_start('', 'workshop-viewlet-ownsubmission', get_string('yoursubmission', 'workshop'));
            echo $output->box_start('generalbox ownsubmission');
            if ($submission = $workshop->get_submission_by_author($USER->id)) {
                echo $output->render($workshop->prepare_submission_summary($submission, true));
            } else {
                echo $output->container(get_string('noyoursubmission', 'workshop'));
            }
            echo $output->box_end();
            print_collapsible_region_end();
        }
        if (has_capability('mod/workshop:viewpublishedsubmissions', $workshop->context)) {
            if ($submissions = $workshop->get_published_submissions()) {
                print_collapsible_region_start('', 'workshop-viewlet-publicsubmissions', get_string('publishedsubmissions', 'workshop'));
                foreach ($submissions as $submission) {
                    echo $output->box_start('generalbox submission-summary');
                    echo $output->render($workshop->prepare_submission_summary($submission, true));
                    echo $output->box_end();
                }
                print_collapsible_region_end();
            }
        }
        break;
    default:
}
$completion = new completion_info($course);
$completion->set_module_viewed($cm);
echo $output->footer();
Exemplo n.º 5
0
echo "<h2 class='tmhead2'>".get_string('pluginname', 'local_positions')."</h2>";

//$positions->print_positionstabs('view', $id = NULL);
$editoroptions = array('maxfiles' => EDITOR_UNLIMITED_FILES, 'maxbytes' => $CFG->maxbytes, 'trusttext' => false, 'noclean' => true);

$editform = new positions_form($CFG->wwwroot.'/local/positions/positions.php?id='.$id.'', array('id' => $id, 'tool' => $positions_instance, 'editoroptions' => $editoroptions));

$editform->set_data($positions_instance);

$positionslist = $DB->get_records('local_positions');
if (empty($positionslist)and has_capability('local/positions:manage', $systemcontext)) {
    $collapse = false;
//    print_error('positionsnotcreated', 'local_positions', $CFG->wwwroot . '/local/positions/positions.php');
}
//if (isset($CFG->allowframembedding) and ! $CFG->allowframembedding and has_capability('local/positions:manage', $systemcontext)) {
//    echo $output->box(get_string('allowframembedding', 'local_positions'));
//}

print_collapsible_region_start('', 'positions-form', $form_header,false,$collapse);
 $editform->display();
print_collapsible_region_end();
echo $output->departments_view();
echo html_writer::script(' $(document).ready(function() {
                        $("#department-index").dataTable({
                        searching: true,
                         "aaSorting": [],
                         "lengthMenu": [[5, 10, 25,50,100, -1], [5,10,25, 50,100, "All"]],
                        "aoColumnDefs": [{ \'bSortable\': false, \'aTargets\': [ 0 ] }]
                        });
                        });');
echo $output->footer();
Exemplo n.º 6
0
 protected function render_workshop_random_examples_helper(workshop_random_examples_helper $helper) {
     $precision = ini_set('precision',4);
     $o = '';
     $infos = array();
     $problems = array();
     $titles = workshop_random_examples_helper::$descriptors[count($helper->slices)];
     
     $helptext = $this->output->heading_with_help("What does this mean?","randomexampleshelp",'workshop');
     
     foreach($helper->slices as $i => $s) {
         $o .= "<div class='slice' style='background-color: #$s->colour; width: $s->width; left: $s->min%'></div>";
         $o .= "<div class='mean' style='background-color: #$s->meancolour; left: $s->mean%'></div>";
         $count = count($s->submissions);
         $infos[] = "<div class='info'><h3 style='color:#$s->meancolour'>$titles[$i]</h3>Range $s->min% to $s->max% | Average $s->mean%</div>";
         if (isset($s->warnings))
             $problems = array_merge($problems, $s->warnings);
         foreach($s->submissions as $a) {
             $o .= "<div class='submission' style='background-color: #$s->subcolour; left:$a->grade%'></div>";
         }
     }
     $problemstr = "";
     if (count($problems)) {
         $problemstr = print_collapsible_region_start('random-examples-problems','random_examples_problems','Warnings','',true,true);
         $problemstr .= "<ul>";
         foreach($problems as $p)
             $problemstr .= "<li>$p</li>";
         $problemstr .= print_collapsible_region_end(true);
         $problemstr .= "</ul>";
     }
     ini_set('precision',$precision);
     return "$helptext<div class='random-examples-helper'>$o</div> <div class='random-examples-info'>" . implode($infos) . "</div>$problemstr";
 }
Exemplo n.º 7
0
if((!is_null($costcenter) ||!is_null($jobfunction) ||!is_null($designation) || $supervisor!=0 || !empty($zone) || !empty($branch) || !empty($category) || $role!=0 || !empty($level)) && $mform->is_submitted()){
  $collapse =0;
}else{
  $collapse=1;
}
if((!is_null($agentdesignation) ||!is_null($city) ||!is_null($state) || $agentsupervisor!=0 || $agentbranchcode!=0 || $agentcode!=0) && $agantmform->is_submitted()){
  $collapse_agent =0;
}else{
  $collapse_agent=1;
}
//if(($costcenterfullname->fullname=='HR-Global'&&$userroleshortname->shortname=='trainers')||is_siteadmin()){
print_collapsible_region_start('', 'department_job_desigantion-filter', get_string('employeesearch','facetoface'),false,$collapse);
$mform->display();
print_collapsible_region_end();

print_collapsible_region_start('', 'agent_job_desigantion-filter', get_string('agentsearch','facetoface'),false,$collapse_agent);
$agantmform->display();
print_collapsible_region_end();
//}


if(!is_null($costcenter) ||!is_null($jobfunction) ||!is_null($designation) ||$supervisor!=0 || !empty($zone) || !empty($branch) || !empty($category) || $role!=0 || !empty($level)){
$select_to_users=select_to_quizusers($quizid,$costcenter,$jobfunction,$designation,$supervisor,$zone,$branch,$role,$category,$level,$USER->id);
$select_from_users=select_from_quizusers($quizid,$costcenter,$jobfunction,$designation,$supervisor,$zone,$branch,$role,$category,$level,$USER->id);
}
else if(!is_null($agentdesignation) ||!is_null($city) ||!is_null($state) || $agentsupervisor!=0 || $agentbranchcode!=0 || $agentcode!=0){

$select_to_users=select_to_agents_quiz($checklist='newusers',$batchid,$agentcode,$agentdesignation,$state,$agentbranchcode,$agentsupervisor,$city);
$select_from_users=select_to_agents_quiz($checklist='enrolledusers',$batchid,$agentcode,$agentdesignation,$state,$agentbranchcode,$agentsupervisor,$city);

}
Exemplo n.º 8
0
}
$host = $hosts[$hostid];
$course = $DB->get_record('mnetservice_enrol_courses', array('id' => $courseid, 'hostid' => $host->id), '*', MUST_EXIST);
echo $OUTPUT->header();
// course name
$icon = html_writer::empty_tag('img', array('src' => $OUTPUT->pix_url('i/course'), 'alt' => get_string('category')));
echo $OUTPUT->heading($icon . s($course->fullname));
// collapsible course summary
if (!empty($course->summary)) {
    unset($options);
    $options->trusted = false;
    $options->para = false;
    $options->filter = false;
    $options->noclean = false;
    $options->overflowdiv = true;
    print_collapsible_region_start('remotecourse summary', 'remotecourse-summary', get_string('coursesummary'), false, true);
    echo format_text($course->summary, $course->summaryformat, $options, $course->id);
    print_collapsible_region_end();
}
$error = '';
$lastfetchenrolments = get_config('mnetservice_enrol', 'lastfetchenrolments');
if (!$usecache or empty($lastfetchenrolments) or time() - $lastfetchenrolments > 600) {
    // fetch fresh data from remote if we just came from the course selection screen
    // or every 10 minutes
    $usecache = false;
    $result = $service->req_course_enrolments($host->id, $course->remoteid, $usecache);
    if ($result !== true) {
        $error .= $service->format_error_message($result);
    }
}
// user selectors
 /**
  * Returns HTML of a collapsible region (start) with beginning content.
  *
  * @param string $id
  * @param string $more
  * @param string $content
  * @return string
  */
 public function start_region($id, $more, $content = '')
 {
     return "\n" . print_collapsible_region_start('collapsablefiltered', $id, $more, false, true, true) . "\n" . $content;
 }
Exemplo n.º 10
0
          <?php 
    $currentuserselector->display();
    ?>
      </td>
      <td id="buttonscell">
          <div id="addcontrols">
              <input name="add" id="add" type="submit" value="<?php 
    echo $THEME->larrow . '&nbsp;' . get_string('add');
    ?>
" title="<?php 
    print_string('add');
    ?>
" /><br />

              <?php 
    print_collapsible_region_start('', 'assignoptions', get_string('enrolmentoptions', 'role'), 'assignoptionscollapse', true);
    ?>
              <p><input type="checkbox" name="hidden" id="hidden" value="1" <?php 
    if ($hidden) {
        echo 'checked="checked" ';
    }
    ?>
/>
              <label for="hidden" title="<?php 
    print_string('createhiddenassign', 'role');
    ?>
">
                  <?php 
    print_string('hidden', 'role');
    ?>
                  <?php 
Exemplo n.º 11
0
    require_capability('mod/teamwork:view', $PAGE->context);
    $teamleader_record = $DB->get_record('teamwork_teammembers', array('userid' => $USER->id, 'teamwork' => $w, 'leader' => 1));
    if (empty($teamleader_record)) {
        redirect("view.php?id={$cm->id}");
    }
    if (!empty($teamid) && !empty($memberid) && !empty($teamleader_record)) {
        if ($teamleader_record->team == $teamid) {
            if ($teamleader_record->userid == $memberid) {
                $DB->delete_records('teamwork_team', array('leader' => $memberid, 'teamwork' => $w));
                $DB->delete_records('teamwork_teammembers', array('team' => $teamid, 'teamwork' => $w));
            } else {
                $DB->delete_records('teamwork_teammembers', array('userid' => $memberid, 'team' => $teamid, 'teamwork' => $w));
            }
        }
    }
    $teamid = $teamleader_record->team;
    $PAGE->set_title(get_string('editteaminfo', 'teamwork'));
    $PAGE->set_heading($course->fullname);
    $output = $PAGE->get_renderer('mod_teamwork');
    /// Output starts here
    echo $output->header();
    print_collapsible_region_start('', 'teamwork-invitedkey', get_string('invitedkey', 'teamwork'));
    $renderable = new teamwork_team_invitedkey($w, $teamid);
    echo $output->render($renderable);
    print_collapsible_region_end();
    print_collapsible_region_start('', 'teamwork-editteaminfo', get_string('editteaminfo', 'teamwork'));
    $renderable = new teamwork_team_manage($w, $teamid);
    echo $output->render($renderable);
    print_collapsible_region_end();
    echo $output->footer();
}
Exemplo n.º 12
0
echo $OUTPUT->header();

echo html_writer::link(new moodle_url('/local/costcenter/courses.php'),'Back',array('id'=>'back_tp_course'));

echo $OUTPUT->heading($instancename);

echo html_writer::link(new moodle_url('/local/mass_enroll/mass_enroll.php',array('id'=>$instance->courseid)),'Bulk enrollment',array('id'=>'bulk_enrollment'));

$addenabled = $canenrol ? '' : 'disabled="disabled"';
$removeenabled = $canunenrol ? '' : 'disabled="disabled"';
if(!empty($data->batch) || !empty($data->skillset) || !empty($data->sub_skillset) || !empty($data->position))
$collapse = false;
else
$collapse = true;

print_collapsible_region_start('', 'batches-form', get_string('filter'),false,$collapse);
$filter_form->display();
print_collapsible_region_end();
?>
<form id="assignform" method="post" action="<?php echo $PAGE->url ?>"><div>
  <input type="hidden" name="sesskey" value="<?php echo sesskey() ?>" />

  <table summary="" class="roleassigntable generaltable generalbox boxaligncenter" cellspacing="0">
    <tr>
      <td id="existingcell">
          <p><label for="removeselect"><?php print_string('enrolledusers', 'enrol'); ?></label></p>
          <input type="button" id="select_remove_all" name="select_remove_all" value="Select all">
          <input type="button" id="select_remove_none" name="select_remove_none" value="Select none">
          <?php $currentuserselector->display() ?>
      </td>
      <td id="buttonscell">
Exemplo n.º 13
0
    $countsubmissions = $teamwork->count_submissions($USER->id);
    $perpage = get_user_preferences('teamwork_perpage', 10);
    $pagingbar = new paging_bar($countsubmissions, $page, $perpage, $PAGE->url, 'page');
    $submissions = $teamwork->get_submissions($USER->id, $phase, 0, $page * $perpage, $perpage);
    $shownames = has_capability('mod/teamwork:viewauthornames', $teamwork->context);
    echo $output->render($pagingbar);
    foreach ($submissions as $submission) {
        echo $output->render($teamwork->prepare_submission_summary($submission, $shownames));
    }
    echo $output->render($pagingbar);
    echo $output->perpage_selector($perpage);
    echo $output->single_button("submission.php?teamwork={$w}&instance={$instancerecord->id}", get_string('createsubmission', 'teamwork'), 'get');
    echo $output->box_end();
    print_collapsible_region_end();
}
print_collapsible_region_start('', 'workshop-viewlet-teamforum', get_string('teamforum', 'teamwork'));
echo $output->box_start('generalbox teamforum');
$associate = $DB->get_record('teamwork_associate_twf', array('course' => $course->id, 'teamwork' => $w));
$assessed = $DB->get_record('twf_discussions', array('userid' => $USER->id, 'teamwork' => $w, 'instance' => $instanceid, 'phase' => $instancerecord->currentphase));
if (!$assessed && (!$ismember || has_capability('mod/teamwork:editsettings', $PAGE->context))) {
    //Output the button for add discussion
    echo '<div class="singlebutton forumaddnew">';
    echo "<form id=\"newdiscussionform\" method=\"get\" action=\"{$CFG->wwwroot}/mod/twf/post.php\">";
    echo '<div>';
    echo "<input type=\"hidden\" name=\"twf\" value=\"{$associate->twf}\" />";
    echo "<input type=\"hidden\" name=\"teamwork\" value=\"{$w}\" />";
    echo "<input type=\"hidden\" name=\"instance\" value=\"{$instanceid}\" />";
    echo "<input type=\"hidden\" name=\"phase\" value=\"{$instancerecord->currentphase}\" />";
    switch ($phaseforum->type) {
        case 'news':
        case 'blog':
Exemplo n.º 14
0
                     //$currentExam .= print_single_button('url', null, 'Start Exam', 'get', '', true, '', false);
                     //$currentExam .= "<br/>";
                     //$currentExam .= print_single_button('url', null, 'Practical Instructions', 'get', '', true, '', false);
                     //$currentExam .= "<br/>";
                     ////$currentExam .= print_single_button($link, $options, $label, 'get', '', true, '', $disabled);
                     //$currentExam .= print_container_end(true);
                     //$currentExam .= "<div id='info_$record->id'></div><br/>";
                     //$currentExam .= "<hr>";
                 } else {
                     echo "Your Exam is OVER2<br />";
                     //echo date($format,$currentTime)." is after ".date($format,$record->endtime). "<br />";
                     $cm = $DB->get_record('course_modules', array('course' => $course->id, 'module' => '12', 'id' => $record->quizid));
                     $quiz = $DB->get_record('quiz', array('id' => $cm->instance));
                     $caption = "<i>" . $quiz->name . ":</i>";
                     $id = "prev_" . $record->id;
                     $prevExam .= print_collapsible_region_start("", $id, $caption, false, true, true);
                     //$prevExam .= "<b>Your Previous Grades for: </b><i>".$quiz->name.":</i><br/><br/>";
                     $prevExam .= $record->grade1 . "/" . $quiz->sumgrades;
                     $prevExam .= " | <a href='{$CFG->wwwroot}/mod/quiz/summary.php?attempt={$record->attemptid}'>Summary</a>";
                     $prevExam .= print_collapsible_region_end(true);
                 }
             }
         }
     }
 }
 $records->close();
 // Counter
 //echo "<script language='JavaScript'>";
 //echo "var countDownInterval=$timeleft;";   //configure refresh interval (in seconds) 1800 = 30 min
 //echo "var c_reloadwidth=200;";   //configure width of displayed text, in px (applicable only in NS4)
 //echo "</script>";
Exemplo n.º 15
0
 /**
  * Output the html for a single section page .
  *
  * @param stdClass $course The course entry from DB
  * @param array $sections The course_sections entries from the DB
  * @param array $mods used for print_section()
  * @param array $modnames used for print_section()
  * @param array $modnamesused used for print_section()
  * @param int $displaysection The section number in the course which is being displayed
  */
 public function print_single_section_page($course, $sections, $mods, $modnames, $modnamesused, $displaysection)
 {
     global $PAGE, $OUTPUT;
     $real_course_display = $course->realcoursedisplay;
     $modinfo = get_fast_modinfo($course);
     $course = course_get_format($course)->get_course();
     $course->realcoursedisplay = $real_course_display;
     $sections = $modinfo->get_section_info_all();
     // Can we view the section in question?
     $context = context_course::instance($course->id);
     $canviewhidden = has_capability('moodle/course:viewhiddensections', $context);
     if (!isset($sections[$displaysection])) {
         // This section doesn't exist
         print_error('unknowncoursesection', 'error', null, $course->fullname);
         return;
     }
     // Copy activity clipboard..
     echo $this->course_activity_clipboard($course, $displaysection);
     // General section if non-empty and course_display is multiple.
     if ($course->realcoursedisplay == COURSE_DISPLAY_MULTIPAGE) {
         $thissection = $sections[0];
         if (($thissection->visible && $thissection->available || $canviewhidden) && ($thissection->summary || $thissection->sequence || $PAGE->user_is_editing())) {
             echo $this->start_section_list();
             echo $this->section_header($thissection, $course, true);
             echo $this->courserenderer->course_section_cm_list($course, $thissection, $displaysection);
             echo $this->courserenderer->course_section_add_cm_control($course, 0, $displaysection);
             echo $this->section_footer();
             echo $this->end_section_list();
         }
     }
     // Start single-section div
     echo html_writer::start_tag('div', array('class' => 'single-section onetopic'));
     //Move controls
     $can_move = false;
     if ($PAGE->user_is_editing() && has_capability('moodle/course:movesections', $context) && $displaysection > 0) {
         $can_move = true;
     }
     $move_list_html = '';
     $count_move_sections = 0;
     //Init custom tabs
     $section = 0;
     $sectionmenu = array();
     $tabs = array();
     $inactive_tabs = array();
     $default_topic = -1;
     while ($section <= $course->numsections) {
         if ($course->realcoursedisplay == COURSE_DISPLAY_MULTIPAGE && $section == 0) {
             $section++;
             continue;
         }
         $thissection = $sections[$section];
         $showsection = true;
         if (!$thissection->visible || !$thissection->available) {
             $showsection = false;
         } else {
             if ($section == 0 && !($thissection->summary || $thissection->sequence || $PAGE->user_is_editing())) {
                 $showsection = false;
             }
         }
         if (!$showsection) {
             $showsection = $canviewhidden || !$course->hiddensections;
         }
         if (isset($displaysection)) {
             if ($showsection) {
                 if ($default_topic < 0) {
                     $default_topic = $section;
                     if ($displaysection == 0) {
                         $displaysection = $default_topic;
                     }
                 }
                 $format_options = course_get_format($course)->get_format_options($thissection);
                 $sectionname = get_section_name($course, $thissection);
                 if ($displaysection != $section) {
                     $sectionmenu[$section] = $sectionname;
                 }
                 $custom_styles = '';
                 $level = 0;
                 if (is_array($format_options)) {
                     if (!empty($format_options['fontcolor'])) {
                         $custom_styles .= 'color: ' . $format_options['fontcolor'] . ';';
                     }
                     if (!empty($format_options['bgcolor'])) {
                         $custom_styles .= 'background-color: ' . $format_options['bgcolor'] . ';';
                     }
                     if (!empty($format_options['cssstyles'])) {
                         $custom_styles .= $format_options['cssstyles'] . ';';
                     }
                     if (isset($format_options['level'])) {
                         $level = $format_options['level'];
                     }
                 }
                 if ($section == 0) {
                     $url = new moodle_url('/course/view.php', array('id' => $course->id, 'section' => 0));
                 } else {
                     $url = course_get_url($course, $section);
                 }
                 $special_style = 'tab_position_' . $section . ' tab_level_' . $level;
                 if ($course->marker == $section) {
                     $special_style = ' marker ';
                 }
                 if (!$thissection->visible || !$thissection->available) {
                     $special_style .= ' dimmed ';
                     if (!$canviewhidden) {
                         $inactive_tabs[] = "tab_topic_" . $section;
                     }
                 }
                 $new_tab = new tabobject("tab_topic_" . $section, $url, '<div style="' . $custom_styles . '" class="tab_content ' . $special_style . '">' . s($sectionname) . "</div>", s($sectionname));
                 if (is_array($format_options) && isset($format_options['level'])) {
                     if ($format_options['level'] == 0 || count($tabs) == 0) {
                         $tabs[] = $new_tab;
                         $new_tab->level = 1;
                     } else {
                         $parent_index = count($tabs) - 1;
                         if (!is_array($tabs[$parent_index]->subtree)) {
                             $tabs[$parent_index]->subtree = array();
                         } else {
                             if (count($tabs[$parent_index]->subtree) == 0) {
                                 $tabs[$parent_index]->subtree[0] = clone $tabs[$parent_index];
                                 $tabs[$parent_index]->subtree[0]->id .= '_index';
                                 $parent_section = $sections[$section - 1];
                                 $parentformat_options = course_get_format($course)->get_format_options($parent_section);
                                 if ($parentformat_options['firsttabtext']) {
                                     $firsttab_text = $parentformat_options['firsttabtext'];
                                 } else {
                                     $firsttab_text = get_string('index', 'format_onetopic');
                                 }
                                 $tabs[$parent_index]->subtree[0]->text = '<div class="tab_content tab_initial">' . $firsttab_text . "</div>";
                                 $tabs[$parent_index]->subtree[0]->level = 2;
                                 if ($displaysection == $section - 1) {
                                     $tabs[$parent_index]->subtree[0]->selected = true;
                                 }
                             }
                         }
                         $new_tab->level = 2;
                         $tabs[$parent_index]->subtree[] = $new_tab;
                     }
                 } else {
                     $tabs[] = $new_tab;
                 }
                 //Init move section list***************************************************************************
                 if ($can_move) {
                     if ($section > 0) {
                         // Move section
                         $baseurl = course_get_url($course, $displaysection);
                         $baseurl->param('sesskey', sesskey());
                         $url = clone $baseurl;
                         $url->param('move', $section - $displaysection);
                         //ToDo: For new feature: subtabs. It is not implemented yet
                         /*
                         $strsubtopictoright = get_string('subtopictoright', 'format_onetopic');
                         $url = new moodle_url('/course/view.php', array('id' => $course->id, 'subtopicmove' => 'right', 'subtopic' => $section));
                         $icon = $this->output->pix_icon('t/right', $strsubtopictoright);
                         $subtopic_move = html_writer::link($url, $icon.get_accesshide($strsubtopictoright), array('class' => 'subtopic-increase-sections'));
                         
                         
                         if ($displaysection != $section) {
                             $move_list_html .= html_writer::tag('li', $subtopic_move . html_writer::link($url, $sectionname));
                            }
                         else {
                             $move_list_html .= html_writer::tag('li', $subtopic_move . $sectionname);
                         }
                         */
                         //Define class from sublevels in order to move a margen in the left. Not apply if it is the first element (condition !empty($move_list_html)) because the first element can't be a sublevel
                         $li_class = '';
                         if (is_array($format_options) && isset($format_options['level']) && $format_options['level'] > 0 && !empty($move_list_html)) {
                             $li_class = 'sublevel';
                         }
                         if ($displaysection != $section) {
                             $move_list_html .= html_writer::tag('li', html_writer::link($url, $sectionname), array('class' => $li_class));
                         } else {
                             $move_list_html .= html_writer::tag('li', $sectionname, array('class' => $li_class));
                         }
                     }
                 }
                 //End move section list***************************************************************************
             }
         }
         $section++;
     }
     // Title with section navigation links.
     $sectionnavlinks = $this->get_nav_links($course, $sections, $displaysection);
     $sectiontitle = '';
     if (!$course->hidetabsbar && count($tabs[0]) > 0) {
         if ($PAGE->user_is_editing() && has_capability('moodle/course:update', $context)) {
             // Increase number of sections.
             $straddsection = get_string('increasesections', 'moodle');
             $url = new moodle_url('/course/changenumsections.php', array('courseid' => $course->id, 'increase' => true, 'sesskey' => sesskey()));
             $icon = $this->output->pix_icon('t/switch_plus', $straddsection);
             $tabs[] = new tabobject("tab_topic_add", $url, $icon, s($straddsection));
             if ($course->numsections > 0) {
                 // Reduce number of sections.
                 $strremovesection = get_string('reducesections', 'moodle');
                 $url = new moodle_url('/course/changenumsections.php', array('courseid' => $course->id, 'increase' => false, 'sesskey' => sesskey()));
                 $icon = $this->output->pix_icon('t/switch_minus', $strremovesection);
                 $tabs[] = new tabobject("tab_topic_remove", $url, $icon, s($strremovesection));
             }
         }
         $sectiontitle .= $OUTPUT->tabtree($tabs, "tab_topic_" . $displaysection, $inactive_tabs);
         //print_tabs($tabs, "tab_topic_" . $displaysection, $inactive_tabs, $active_tabs, true);
     }
     echo $sectiontitle;
     if (!$sections[$displaysection]->uservisible && !$canviewhidden) {
         if (!$course->hiddensections) {
             //Not used more, is controled in /course/view.php
         }
         // Can't view this section.
     } else {
         if ($course->realcoursedisplay != COURSE_DISPLAY_MULTIPAGE || $displaysection !== 0) {
             // Now the list of sections..
             echo $this->start_section_list();
             // The requested section page.
             $thissection = $sections[$displaysection];
             echo $this->section_header($thissection, $course, true);
             // Show completion help icon.
             $completioninfo = new completion_info($course);
             echo $completioninfo->display_help_icon();
             echo $this->courserenderer->course_section_cm_list($course, $thissection, $displaysection);
             echo $this->courserenderer->course_section_add_cm_control($course, $displaysection, $displaysection);
             echo $this->section_footer();
             echo $this->end_section_list();
         }
     }
     // Display section bottom navigation.
     $sectionbottomnav = '';
     $sectionbottomnav .= html_writer::start_tag('div', array('class' => 'section-navigation mdl-bottom'));
     $sectionbottomnav .= html_writer::tag('span', $sectionnavlinks['previous'], array('class' => 'mdl-left'));
     $sectionbottomnav .= html_writer::tag('span', $sectionnavlinks['next'], array('class' => 'mdl-right'));
     $sectionbottomnav .= html_writer::end_tag('div');
     echo $sectionbottomnav;
     // close single-section div.
     echo html_writer::end_tag('div');
     if ($PAGE->user_is_editing() && has_capability('moodle/course:update', $context)) {
         echo '<br class="utilities-separator" />';
         print_collapsible_region_start('move-list-box clearfix collapsible mform', 'course_format_onetopic_config_movesection', get_string('utilities', 'format_onetopic'), '', true);
         //Move controls
         if ($can_move && !empty($move_list_html)) {
             echo html_writer::start_div("form-item clearfix");
             echo html_writer::start_div("form-label");
             echo html_writer::tag('label', get_string('movesectionto', 'format_onetopic'));
             echo html_writer::end_div();
             echo html_writer::start_div("form-setting");
             echo html_writer::tag('ul', $move_list_html, array('class' => 'move-list'));
             echo html_writer::end_div();
             echo html_writer::start_div("form-description");
             echo html_writer::tag('p', get_string('movesectionto_help', 'format_onetopic'));
             echo html_writer::end_div();
             echo html_writer::end_div();
         }
         $baseurl = course_get_url($course, $displaysection);
         $baseurl->param('sesskey', sesskey());
         $url = clone $baseurl;
         global $USER, $OUTPUT;
         if (isset($USER->onetopic_da[$course->id]) && $USER->onetopic_da[$course->id]) {
             $url->param('onetopic_da', 0);
             $text_button_disableajax = get_string('enable', 'format_onetopic');
         } else {
             $url->param('onetopic_da', 1);
             $text_button_disableajax = get_string('disable', 'format_onetopic');
         }
         echo html_writer::start_div("form-item clearfix");
         echo html_writer::start_div("form-label");
         echo html_writer::tag('label', get_string('disableajax', 'format_onetopic'));
         echo html_writer::end_div();
         echo html_writer::start_div("form-setting");
         echo html_writer::link($url, $text_button_disableajax);
         echo html_writer::end_div();
         echo html_writer::start_div("form-description");
         echo html_writer::tag('p', get_string('disableajax_help', 'format_onetopic'));
         echo html_writer::end_div();
         echo html_writer::end_div();
         //Duplicate current section option
         if (has_capability('moodle/course:manageactivities', $context)) {
             $url_duplicate = new moodle_url('/course/format/onetopic/duplicate.php', array('courseid' => $course->id, 'section' => $displaysection, 'sesskey' => sesskey()));
             $link = new action_link($url_duplicate, get_string('duplicate', 'format_onetopic'));
             $link->add_action(new confirm_action(get_string('duplicate_confirm', 'format_onetopic'), null, get_string('duplicate', 'format_onetopic')));
             echo html_writer::start_div("form-item clearfix");
             echo html_writer::start_div("form-label");
             echo html_writer::tag('label', get_string('duplicatesection', 'format_onetopic'));
             echo html_writer::end_div();
             echo html_writer::start_div("form-setting");
             echo $this->render($link);
             echo html_writer::end_div();
             echo html_writer::start_div("form-description");
             echo html_writer::tag('p', get_string('duplicatesection_help', 'format_onetopic'));
             echo html_writer::end_div();
             echo html_writer::end_div();
         }
         print_collapsible_region_end();
     }
 }
Exemplo n.º 16
0
}
//if (isset($CFG->allowframembedding) and ! $CFG->allowframembedding and has_capability('local/costcenter:manage', $systemcontext)) {
//    echo $output->box(get_string('allowframembedding', 'local_costcenter'));
//}
if ($editform->is_cancelled()) {
    redirect($PAGE->url);
} else if ($data = $editform->get_data()) {
    $data->description = $data->description['text'];
    if ($data->id > 0) {
        $costcenter->costcenter_update_instance($data->id, $data);
    } else {
        $costcenter->costcenter_add_instance($data);
    }
    redirect($PAGE->url);
}
print_collapsible_region_start('', 'costcenter-form', $form_header, false, $collapse);
    $editform->display();
print_collapsible_region_end();

echo $output->departments_view();
echo html_writer::script(' $(document).ready(function() {
                        $("#department-index").dataTable({
                        searching: true,
                        responsive: true,
                         "aaSorting": [],
                         "lengthMenu": [[5, 10, 25,50,100, -1], [5,10,25, 50,100, "All"]],
                        "aoColumnDefs": [{ \'bSortable\': false, \'aTargets\': [ 0 ] }],
                        language: {
                            search: "_INPUT_",
                            searchPlaceholder: "Search"
                        }
Exemplo n.º 17
0
}
$PAGE->set_title($teamwork->name);
$PAGE->set_heading($course->fullname);
$output = $PAGE->get_renderer('mod_teamwork');
/// Output starts here
echo $output->header();
// Output tabs here
$inactive = $activated = array();
$inactive[] = 'mytasks';
$activated[] = 'mytasks';
ob_start();
include $CFG->dirroot . '/mod/teamwork/tabs.php';
$output_tab = ob_get_contents();
ob_end_clean();
echo $output_tab;
$teamrecords = $DB->get_records('teamwork_teammembers', array('teamwork' => $w, 'userid' => $USER->id));
foreach ($teamrecords as $teamrecord) {
    $instancerecord = $DB->get_record('teamwork_instance', array('teamwork' => $w, 'team' => $teamrecord->team));
    $userplan = new teamwork_user_plan($teamwork, $instancerecord->id);
    echo $output->render($userplan);
    print_collapsible_region_start('', 'workshop-viewlet-teamsubmission', get_string('teamsubmission', 'teamwork'));
    echo $output->box_start('generalbox teamsubmission');
    echo $output->box_end();
    print_collapsible_region_end();
    print_collapsible_region_start('', 'workshop-viewlet-ownsubmission', get_string('yoursubmission', 'teamwork'));
    echo $output->box_start('generalbox ownsubmission');
    echo $output->single_button("submission.php?teamwork={$w}&instance={$instancerecord->id}", get_string('createsubmission', 'teamwork'), 'get');
    echo $output->box_end();
    print_collapsible_region_end();
}
echo $output->footer();
Exemplo n.º 18
0
function forum_print_posts_nested($course, &$cm, $forum, $discussion, $parent, $reply, $forumtracked, $posts, $parentid = 0, $count = 1, $flag = 0)
{
    global $USER, $CFG, $DB;
    $link = false;
    $modcontext = context_module::instance($cm->id);
    if (!empty($posts[$parent->id]->children)) {
        $posts = $posts[$parent->id]->children;
        foreach ($posts as $post) {
            if ((show_discussion($parentid, $forum) and $post->userid != $USER->id and !$flag) && !has_capability('mod/forum:editanypost', $modcontext)) {
                continue;
            } else {
                $flag = 1;
            }
            echo '<div class="indent">';
            if (!isloggedin()) {
                $ownpost = false;
            } else {
                $ownpost = $USER->id == $post->userid;
            }
            $post->subject = format_string($post->subject);
            $postread = !empty($post->postread);
            if ($forum->type == 'collaborate' and $post->parent == $parentid) {
                $regionid = 'forum-questionview' . $count;
                print_collapsible_region_start('', $regionid, get_string('questionview', 'forum'));
                forum_print_post($post, $discussion, $forum, $cm, $course, $ownpost, $reply, false, '', '', $postread, true, $forumtracked, false, $parentid);
            } else {
                forum_print_post($post, $discussion, $forum, $cm, $course, $ownpost, $reply, false, '', '', $postread, true, $forumtracked, false, $parentid);
            }
            if ($forum->type == 'collaborate') {
                $n = $DB->count_records('forum_posts', array('parent' => $post->id));
                if ($n == 0) {
                    print_collapsible_region_end();
                }
            }
            forum_print_posts_nested($course, $cm, $forum, $discussion, $post, $reply, $forumtracked, $posts, $parentid, $count + 1, $flag);
            $flag = 0;
            echo "</div>\n";
            $count = $count + 1;
        }
    }
}
Exemplo n.º 19
0
} else {
    $can_edit_templet = false;
}
$can_join_team = true;
if (count($teammember_records) >= $teamworkrecord->participationnumlimit) {
    $can_join_team = false;
}
if (count($teammember_records) > 0) {
    print_collapsible_region_start('', 'teamwork-myproject', get_string('myproject', 'teamwork'));
    $renderable = new teamwork_myproject($teamwork->id);
    echo $output->render($renderable);
    print_collapsible_region_end();
}
if ($can_edit_templet) {
    $renderable = new teamwork_templet_list_manager($teamwork->id);
} else {
    if (!$can_join_team || $is_team_leader) {
        $renderable = new teamwork_templet_list_member($teamwork->id);
    } else {
        $renderable = new teamwork_templet_list($teamwork->id);
    }
}
print_collapsible_region_start('', 'teamwork-templetlist', get_string('templetlist', 'teamwork'));
echo $output->render($renderable);
print_collapsible_region_end();
//display control buttons
if ($teamwork->applyover == 0) {
    $renderable = new teamwork_templet_buttons($teamwork->id, $leading_team, $can_edit_templet, $is_team_leader, $can_join_team);
    echo $output->render($renderable);
}
echo $output->footer();
Exemplo n.º 20
0
	   </style>
	   ';
	/*end here*/
}else{
   $iconimage=html_writer::empty_tag('img', array('src'=>$CFG->wwwroot.'/theme/clean/pix/small/my_sessions_small.png','size'=>'15px'));     
    echo "<h2 class='tmhead2'><div class='iconimage'>".$iconimage."</div>".get_string('viewilt','facetoface')."</h2>";
   
}
   
    echo $batchinfo= $f2f_renderer->define_batch_status_icons($frecord,$userid);//*This function returns define_batch_status_icons based on there capabilities*//				   
         echo '<div class="session_type_select">'.$OUTPUT->render($sch).'</div>';
		if(( $filter_starttime!=0 || $filter_endtime!=0) && $daterangemform->is_submitted()){
		  $collapse_date =0;
		}else{
		  $collapse_date=1;
		}
     print_collapsible_region_start('', 'daterange-filter', get_string('datesearch','facetoface'),false,$collapse_date);
       $daterangemform->display();
     print_collapsible_region_end();

echo $table;
echo $OUTPUT->box_end();
}else{
	echo get_string('warning_error', 'facetoface');
	
}
echo $OUTPUT->footer();

echo '</div>';
    
echo my_face2face_table_script($id,$f,$location,$download,$tab,$sessiontype,$userid,$filter_starttime,$filter_endtime,$batchid);
Exemplo n.º 21
0
$PAGE->set_heading($title);
echo $OUTPUT->header();
// Start the question form.
echo html_writer::start_tag('form', array('method' => 'post', 'action' => $actionurl, 'enctype' => 'multipart/form-data', 'id' => 'responseform'));
echo html_writer::start_tag('div');
echo html_writer::empty_tag('input', array('type' => 'hidden', 'name' => 'sesskey', 'value' => sesskey()));
echo html_writer::empty_tag('input', array('type' => 'hidden', 'name' => 'slots', 'value' => $slot));
echo html_writer::empty_tag('input', array('type' => 'hidden', 'name' => 'scrollpos', 'value' => '', 'id' => 'scrollpos'));
echo html_writer::end_tag('div');
// Output the question.
echo $quba->render_question($slot, $options, $displaynumber);
// Finish the question form.
echo html_writer::start_tag('div', array('id' => 'previewcontrols', 'class' => 'controls'));
echo html_writer::empty_tag('input', $restartdisabled + array('type' => 'submit', 'name' => 'restart', 'value' => get_string('restart', 'question')));
echo html_writer::empty_tag('input', $finishdisabled + array('type' => 'submit', 'name' => 'save', 'value' => get_string('save', 'question')));
echo html_writer::empty_tag('input', $filldisabled + array('type' => 'submit', 'name' => 'fill', 'value' => get_string('fillincorrect', 'question')));
echo html_writer::empty_tag('input', $finishdisabled + array('type' => 'submit', 'name' => 'finish', 'value' => get_string('submitandfinish', 'question')));
echo html_writer::end_tag('div');
echo html_writer::end_tag('form');
// Output the technical info.
print_collapsible_region_start('', 'techinfo', get_string('technicalinfo', 'question') . $OUTPUT->help_icon('technicalinfo', 'question'), 'core_question_preview_techinfo_collapsed', true);
foreach ($technical as $info) {
    echo html_writer::tag('p', $info, array('class' => 'notifytiny'));
}
print_collapsible_region_end();
// Display the settings form.
$optionsform->display();
$PAGE->requires->js_module('core_question_engine');
$PAGE->requires->strings_for_js(array('closepreview'), 'question');
$PAGE->requires->yui_module('moodle-question-preview', 'M.question.preview.init');
echo $OUTPUT->footer();
    }
}
// output starts here
$output = $PAGE->get_renderer('mod_workshopplus');
// workshopplus renderer
echo $output->header();
echo $output->heading(format_string($workshopplus->name));
echo $output->heading(get_string('assessedsubmission', 'workshopplus'), 3);
$submission = $workshopplus->get_submission_by_id($submission->id);
// reload so can be passed to the renderer
echo $output->render($workshopplus->prepare_submission($submission, has_capability('mod/workshopplus:viewauthornames', $workshopplus->context)));
// show instructions for assessing as they may contain important information
// for evaluating the assessment
if (trim($workshopplus->instructreviewers)) {
    $instructions = file_rewrite_pluginfile_urls($workshopplus->instructreviewers, 'pluginfile.php', $PAGE->context->id, 'mod_workshopplus', 'instructreviewers', 0, workshopplus::instruction_editors_options($PAGE->context));
    print_collapsible_region_start('', 'workshopplus-viewlet-instructreviewers', get_string('instructreviewers', 'workshopplus'));
    echo $output->box(format_text($instructions, $workshopplus->instructreviewersformat, array('overflowdiv' => true)), array('generalbox', 'instructions'));
    print_collapsible_region_end();
}
// extend the current assessment record with user details
$assessment = $workshopplus->get_assessment_by_id($assessment->id);
if ($isreviewer) {
    $options = array('showreviewer' => true, 'showauthor' => has_capability('mod/workshopplus:viewauthornames', $workshopplus->context), 'showform' => $assessmenteditable or !is_null($assessment->grade), 'showweight' => true);
    $assessment = $workshopplus->prepare_assessment($assessment, $mform, $options);
    $assessment->title = get_string('assessmentbyyourself', 'workshopplus');
    echo $output->render($assessment);
} else {
    $options = array('showreviewer' => has_capability('mod/workshopplus:viewreviewernames', $workshopplus->context), 'showauthor' => has_capability('mod/workshopplus:viewauthornames', $workshopplus->context), 'showform' => $assessmenteditable or !is_null($assessment->grade), 'showweight' => true);
    $assessment = $workshopplus->prepare_assessment($assessment, $mform, $options);
    echo $output->render($assessment);
}
Exemplo n.º 23
0
 /**
  * Renders the full assessment
  *
  * @param workshop_assessment $assessment
  * @return string HTML
  */
 protected function render_workshop_assessment(workshop_assessment $assessment)
 {
     $o = '';
     // output HTML code
     $anonymous = is_null($assessment->reviewer);
     $classes = 'assessment-full';
     if ($anonymous) {
         $classes .= ' anonymous';
     }
     $o .= $this->output->container_start($classes);
     $o .= $this->output->container_start('header');
     if (!empty($assessment->title)) {
         $title = s($assessment->title);
     } else {
         $title = get_string('assessment', 'workshop');
     }
     if ($assessment->url instanceof moodle_url and $this->page->url != $assessment->url) {
         $o .= $this->output->container(html_writer::link($assessment->url, $title), 'title');
     } else {
         $o .= $this->output->container($title, 'title');
     }
     if (!$anonymous) {
         $reviewer = $assessment->reviewer;
         $userpic = $this->output->user_picture($reviewer, array('courseid' => $this->page->course->id, 'size' => 32));
         $userurl = new moodle_url('/user/view.php', array('id' => $reviewer->id, 'course' => $this->page->course->id));
         $a = new stdClass();
         $a->name = fullname($reviewer);
         $a->url = $userurl->out();
         $byfullname = get_string('assessmentby', 'workshop', $a);
         $oo = $this->output->container($userpic, 'picture');
         $oo .= $this->output->container($byfullname, 'fullname');
         $o .= $this->output->container($oo, 'reviewer');
     }
     if (is_null($assessment->realgrade)) {
         $o .= $this->output->container(get_string('notassessed', 'workshop'), 'grade nograde');
     } else {
         $a = new stdClass();
         $a->max = $assessment->maxgrade;
         $a->received = $assessment->realgrade;
         $o .= $this->output->container(get_string('gradeinfo', 'workshop', $a), 'grade');
         if (!is_null($assessment->weight) and $assessment->weight != 1) {
             $o .= $this->output->container(get_string('weightinfo', 'workshop', $assessment->weight), 'weight');
         }
     }
     $o .= $this->output->container_start('actions');
     foreach ($assessment->actions as $action) {
         $o .= $this->output->single_button($action->url, $action->label, $action->method);
     }
     $o .= $this->output->container_end();
     // actions
     $o .= $this->output->container_end();
     // header
     if (!is_null($assessment->form)) {
         $o .= print_collapsible_region_start('assessment-form-wrapper', uniqid('workshop-assessment'), get_string('assessmentform', 'workshop'), '', false, true);
         $o .= $this->output->container(self::moodleform($assessment->form), 'assessment-form');
         $o .= print_collapsible_region_end(true);
         if (!$assessment->form->is_editable()) {
             $o .= $this->overall_feedback($assessment);
         }
     }
     $o .= $this->output->container_end();
     // main wrapper
     return $o;
 }
Exemplo n.º 24
0
            // explicit cast to zero integer
            $formdata->attachment = 0;
        }
        // store the updated values or re-save the new example (re-saving needed because URLs are now rewritten)
        $DB->update_record('teamwork_submissions', $formdata);
        redirect($teamwork->exsubmission_url($formdata->id));
    }
}
// Output starts here
echo $output->header();
echo $output->heading(format_string($teamwork->name), 2);
// show instructions for submitting as they may contain some list of questions and we need to know them
// while reading the submitted answer
if (trim($teamwork->instructauthors)) {
    $instructions = file_rewrite_pluginfile_urls($teamwork->instructauthors, 'pluginfile.php', $PAGE->context->id, 'mod_teamwork', 'instructauthors', 0, teamwork::instruction_editors_options($PAGE->context));
    print_collapsible_region_start('', 'teamwork-viewlet-instructauthors', get_string('instructauthors', 'teamwork'));
    echo $output->box(format_text($instructions, $teamwork->instructauthorsformat, array('overflowdiv' => true)), array('generalbox', 'instructions'));
    print_collapsible_region_end();
}
// if in edit mode, display the form to edit the example
if ($edit and $canmanage) {
    $mform->display();
    echo $output->footer();
    die;
}
// else display the example...
if ($example->id) {
    if ($canmanage and $delete) {
        echo $output->confirm(get_string('exampledeleteconfirm', 'teamwork'), new moodle_url($PAGE->url, array('delete' => 1, 'confirm' => 1)), $teamwork->view_url());
    }
    if ($canmanage and !$delete and !$DB->record_exists_select('teamwork_assessments', 'grade IS NOT NULL AND weight=1 AND submissionid = ?', array($example->id))) {
Exemplo n.º 25
0
     print_collapsible_region_end();
 }
 if (has_capability('mod/workshop:viewpublishedsubmissions', $workshop->context)) {
     $shownames = has_capability('mod/workshop:viewauthorpublished', $workshop->context);
     if ($submissions = $workshop->get_published_submissions()) {
         print_collapsible_region_start('', 'workshop-viewlet-publicsubmissions', get_string('publishedsubmissions', 'workshop'));
         foreach ($submissions as $submission) {
             echo $output->box_start('generalbox submission-summary');
             echo $output->render($workshop->prepare_submission_summary($submission, $shownames));
             echo $output->box_end();
         }
         print_collapsible_region_end();
     }
 }
 if ($assessments = $workshop->get_assessments_by_reviewer($USER->id)) {
     print_collapsible_region_start('', 'workshop-viewlet-assignedassessments', get_string('assignedassessments', 'workshop'));
     $shownames = has_capability('mod/workshop:viewauthornames', $PAGE->context);
     foreach ($assessments as $assessment) {
         $submission = new stdclass();
         $submission->id = $assessment->submissionid;
         $submission->title = $assessment->submissiontitle;
         $submission->timecreated = $assessment->submissioncreated;
         $submission->timemodified = $assessment->submissionmodified;
         $userpicturefields = explode(',', user_picture::fields());
         foreach ($userpicturefields as $userpicturefield) {
             $prefixedusernamefield = 'author' . $userpicturefield;
             $submission->{$prefixedusernamefield} = $assessment->{$prefixedusernamefield};
         }
         if (is_null($assessment->grade)) {
             $class = ' notgraded';
             $submission->status = 'notgraded';
Exemplo n.º 26
0
                redirect($pageurl);
            }
            echo $OUTPUT->confirm(get_string('record_delete', 'block_learning_plan'), '/blocks/learning_plan/view.php?viewpage=5&rem=rem&delete=' . $u_id . '&lp=' . $lp, '/blocks/learning_plan/view.php?viewpage=5');
        }
        break;
}

if($edit!=null|| ($form->is_submitted() && !$form->is_validated()))
$collapse = false;
else
$collapse = true;
$table = $output->learning_plan_info();
if(!$table)
$collapse=false;

print_collapsible_region_start('', 'learningplan-form', $form_header,false,$collapse);
$form->display();
print_collapsible_region_end();
	
if ($table) {
		if(is_siteadmin()){
	echo html_writer::link(new moodle_url('/blocks/learning_plan/bulk_enroll.php'),'Bulk upload',array('id'=>'back_tp_course'));
	echo "<div class='costcenter_filter'></div>";
		}
    echo html_writer::table($table);
} 
//$PAGE->requires->js_init_call('M.block_learning_plan.init', array($viewpage, $setting));
if(!is_siteadmin())
echo $output->enable_datatable('.lp_display');
else
echo html_writer::script('$(document).ready(function() {
Exemplo n.º 27
0
/**
 * Print (or return) a collapsible region, that has a caption that can
 * be clicked to expand or collapse the region.
 *
 * If JavaScript is off, then the region will always be expanded.
 *
 * @param string $contents the contents of the box.
 * @param string $classes class names added to the div that is output.
 * @param string $id id added to the div that is output. Must not be blank.
 * @param string $caption text displayed at the top. Clicking on this will cause the region to expand or contract.
 * @param string $userpref the name of the user preference that stores the user's preferred default state.
 *      (May be blank if you do not wish the state to be persisted.
 * @param boolean $default Initial collapsed state to use if the user_preference it not set.
 * @param boolean $return if true, return the HTML as a string, rather than printing it.
 * @return string|void If $return is false, returns nothing, otherwise returns a string of HTML.
 */
function print_collapsible_region($contents, $classes, $id, $caption, $userpref = '', $default = false, $return = false)
{
    $output = print_collapsible_region_start($classes, $id, $caption, $userpref, $default, true);
    $output .= $contents;
    $output .= print_collapsible_region_end(true);
    if ($return) {
        return $output;
    } else {
        echo $output;
    }
}
Exemplo n.º 28
0
 /**
  * Print the "advanced" UI elements for the form to select which questions. Hidden by default.
  */
 protected function display_advanced_search_form()
 {
     print_collapsible_region_start('', 'advancedsearch', get_string('advancedsearchoptions', 'question'), 'question_bank_advanced_search');
     foreach ($this->searchconditions as $searchcondition) {
         echo $searchcondition->display_options_adv($this);
     }
     print_collapsible_region_end();
 }
Exemplo n.º 29
0
    $PAGE->navbar->add(get_string('mysubmission', 'workshop'), $workshop->submission_url(), navigation_node::TYPE_CUSTOM);
    $PAGE->navbar->add(get_string('editingsubmission', 'workshop'));
} elseif ($ownsubmission) {
    $PAGE->navbar->add(get_string('mysubmission', 'workshop'));
} else {
    $PAGE->navbar->add(get_string('submission', 'workshop'));
}
// Output starts here
$output = $PAGE->get_renderer('mod_workshop');
echo $output->header();
echo $output->heading(format_string($workshop->name), 2);
// show instructions for submitting as thay may contain some list of questions and we need to know them
// while reading the submitted answer
if (trim($workshop->instructauthors)) {
    $instructions = file_rewrite_pluginfile_urls($workshop->instructauthors, 'pluginfile.php', $PAGE->context->id, 'mod_workshop', 'instructauthors', 0, workshop::instruction_editors_options($PAGE->context));
    print_collapsible_region_start('', 'workshop-viewlet-instructauthors', get_string('instructauthors', 'workshop'));
    echo $output->box(format_text($instructions, $workshop->instructauthorsformat, array('overflowdiv' => true)), array('generalbox', 'instructions'));
    print_collapsible_region_end();
}
// if in edit mode, display the form to edit the submission
if ($edit) {
    if (!empty($CFG->enableplagiarism)) {
        require_once $CFG->libdir . '/plagiarismlib.php';
        echo plagiarism_print_disclosure($cm->id);
    }
    $mform->display();
    echo $output->footer();
    die;
}
// else display the submission
if ($submission->id) {
Exemplo n.º 30
0
        $unassigning = $teammember->get_selected_users();
        if (!empty($unassigning)) {
            foreach ($unassigning as $user) {
                $res = $smanager->tm_unassign_employee_fromteam($user->id, $teammanagerid);
            }
            $smanager->tm_success_failure_notification($res, 'unassignsuccess', 'unassignfailure');
            $teammember->invalidate_selected_users();
            $non_teammember->invalidate_selected_users();
        }
    }
    $record_existence = $smanager->tm_records_exists_ornot($rmanager_costcenterid);

    if ($teammanagerid || empty($record_existence))
        $collapse = 0;
    else
        $collapse = 1;

    print_collapsible_region_start('', 'assignemployee_form', get_string('assignemployee_formlabel', 'local_teammanager'), false, $collapse);
    $smanager->tm_assign_employee_select_form($teammanagerid, $form_ccid );
    $smanager->tm_assign_employee_form($teammanagerid, $form_ccid);
    print_collapsible_region_end();
    
    if ($rmanager_costcenterid)
        $tmobject = new teammanager($rmanager_costcenterid);
    else
        $tmobject = new teammanager(null, null, $adminview);

    echo $output->render($tmobject);

    echo $output->footer();
} // endof else