Skip to content

Commit

Permalink
Update view.php
Browse files Browse the repository at this point in the history
Added one row table to fix group and preference selectors.
  • Loading branch information
drachels committed May 25, 2023
1 parent 1be8cb3 commit f6a6fce
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions view.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@
$output->init($hq);

// 20230522 Changed to $canask. Process submitted question.
//if (has_capability('mod/hotquestion:ask', $context)) {
if ($canask) {
$mform = new hotquestion_form(null, array($hq->instance->anonymouspost, $hq->cm));
// 20230520 Needed isset so changing unapproved question views do not cause an error.
Expand Down Expand Up @@ -144,9 +143,6 @@
}
}

// 20230519 Added for preference selector.
//echo '<form method="post">';

// Handle priority, vote, newround, removeround, remove question, download questions, and approve question.
if (!empty($action)) {
switch ($action) {
Expand Down Expand Up @@ -280,6 +276,7 @@
':</strong> '.date("l, d M Y, G:i A", $hotquestion->timeclose).'<br>';
}

// 20230522 Added a single row table to make both group and viewunapproved preference drop down menus work.
echo '<table><tr><td>';

// Print group information (A drop down box will be displayed if the user
Expand Down Expand Up @@ -307,10 +304,11 @@
.' <select onchange="this.form.submit()" name="vispreference">'
.'<option selected="true" value="'.$selection.'</option>'
.'</select>';
echo '</td>';
echo '<td>';
// 20230522 Limit the form to this one row/cell of the table.
echo '</form></td>';

// 20230519 This creates the URL link button for all HotQuestions in this course.
echo '<td>';
$url2 = '<a href="'.$CFG->wwwroot . '/mod/hotquestion/index.php?id='.$course->id
.'"class="btn btn-link">'
.get_string('viewallhotquestions', 'hotquestion', $hotquestion->name)
Expand Down Expand Up @@ -348,8 +346,7 @@
echo $output->questions(has_capability('mod/hotquestion:vote', $context));
echo $output->container_end();

// 20230519 Complete the form for this page.
echo '</form>';


// Finish the page.
if (!$ajax) {
Expand Down

0 comments on commit f6a6fce

Please sign in to comment.