Skip to content

Commit

Permalink
Workshop: uses navigation block + settings block instead of own tabs
Browse files Browse the repository at this point in the history
  • Loading branch information
mudrd8mz committed May 4, 2010
1 parent a345de6 commit 08af32a
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 89 deletions.
18 changes: 15 additions & 3 deletions mod/workshop/allocation.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
$workshop = $DB->get_record('workshop', array('id' => $cm->instance), '*', MUST_EXIST);
$workshop = new workshop($workshop, $cm, $course);

$PAGE->set_url($workshop->allocation_url(), array('cmid' => $cmid, 'method' => $method));
$PAGE->set_url($workshop->allocation_url($method));

require_login($course, false, $cm);
$context = $PAGE->context;
Expand All @@ -58,8 +58,20 @@
echo $OUTPUT->header();

$allocators = workshop::installed_allocators();
$currenttab = 'allocation';
include(dirname(__FILE__) . '/tabs.php');
if (!empty($allocators)) {
$tabs = array();
$row = array();
$inactive = array();
$activated = array();
foreach ($allocators as $methodid => $methodname) {
$row[] = new tabobject($methodid, $workshop->allocation_url($methodid)->out(), $methodname);
if ($methodid == $method) {
$currenttab = $methodid;
}
}
}
$tabs[] = $row;
print_tabs($tabs, $currenttab, $inactive, $activated);

if (!empty($initresult)) {
echo $OUTPUT->container_start('allocator-init-results');
Expand Down
2 changes: 0 additions & 2 deletions mod/workshop/editform.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,6 @@
// Output starts here

echo $OUTPUT->header();
$currenttab = 'editform';
include(dirname(__FILE__) . '/tabs.php');
echo $OUTPUT->heading(get_string('pluginname', 'workshopform_' . $workshop->strategy));

$mform->display();
Expand Down
3 changes: 0 additions & 3 deletions mod/workshop/excompare.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,6 @@

// Output starts here
echo $OUTPUT->header();
//$currenttab = 'example';
//include(dirname(__FILE__) . '/tabs.php');
//$currenttab = 'example';
echo $OUTPUT->heading(get_string('assessedexample', 'workshop'), 2);

echo $wsoutput->example_full($example, true);
Expand Down
2 changes: 0 additions & 2 deletions mod/workshop/exsubmission.php
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,6 @@

// Output starts here
echo $OUTPUT->header();
$currenttab = 'example';
include(dirname(__FILE__) . '/tabs.php');
echo $OUTPUT->heading(format_string($workshop->name), 2);

// if in edit mode, display the form to edit the example
Expand Down
9 changes: 7 additions & 2 deletions mod/workshop/locallib.php
Original file line number Diff line number Diff line change
Expand Up @@ -879,11 +879,16 @@ public function updatemod_url() {
}

/**
* @param string $method allocation method
* @return moodle_url to the allocation page
*/
public function allocation_url() {
public function allocation_url($method=null) {
global $CFG;
return new moodle_url('/mod/workshop/allocation.php', array('cmid' => $this->cm->id));
$params = array('cmid' => $this->cm->id);
if (!empty($method)) {
$params['method'] = $method;
}
return new moodle_url('/mod/workshop/allocation.php', $params);
}

/**
Expand Down
2 changes: 0 additions & 2 deletions mod/workshop/submission.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,6 @@

// Output starts here
echo $OUTPUT->header();
$currenttab = 'submission';
include(dirname(__FILE__) . '/tabs.php');
echo $OUTPUT->heading(format_string($workshop->name), 2);

// if in edit mode, display the form to edit the submission
Expand Down
74 changes: 0 additions & 74 deletions mod/workshop/tabs.php

This file was deleted.

1 change: 0 additions & 1 deletion mod/workshop/view.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@
/// Output starts here

echo $OUTPUT->header();
include(dirname(__FILE__) . '/tabs.php');
echo $OUTPUT->heading(format_string($workshop->name), 2);
echo $wsoutput->user_plan($workshop->prepare_user_plan($USER->id, $PAGE->context));

Expand Down

0 comments on commit 08af32a

Please sign in to comment.