Skip to content

Commit

Permalink
TW20951053 hidename instance setting
Browse files Browse the repository at this point in the history
  • Loading branch information
learningtechnologyservices committed Sep 20, 2024
1 parent fd20439 commit 6eb00ae
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 2 deletions.
1 change: 1 addition & 0 deletions db/install.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true"/>
<FIELD NAME="course" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="0" SEQUENCE="false"/>
<FIELD NAME="name" TYPE="char" LENGTH="100" NOTNULL="true" SEQUENCE="false"/>
<FIELD NAME="hidename" TYPE="int" LENGTH="2" NOTNULL="true" DEFAULT="0" SEQUENCE="false"/>
<FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="0" SEQUENCE="false"/>
<FIELD NAME="intro" TYPE="text" NOTNULL="false" SEQUENCE="false"/>
<FIELD NAME="introformat" TYPE="int" LENGTH="4" NOTNULL="true" DEFAULT="0" SEQUENCE="false"/>
Expand Down
15 changes: 15 additions & 0 deletions db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -235,5 +235,20 @@ function xmldb_board_upgrade(int $oldversion) {
upgrade_mod_savepoint(true, 2022040110, 'board');
}

if ($oldversion < 2022040114) {

// Define field hidename to be added to board.
$table = new xmldb_table('board');
$field = new xmldb_field('hidename', XMLDB_TYPE_INTEGER, '2', null, XMLDB_NOTNULL, null, '0', 'name');

// Conditionally launch add field hidename.
if (!$dbman->field_exists($table, $field)) {
$dbman->add_field($table, $field);
}

// Board savepoint reached.
upgrade_mod_savepoint(true, 2022040114, 'board');
}

return true;
}
1 change: 1 addition & 0 deletions lang/en/board.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
$string['board:manageboard'] = 'Manage columns and manage all posts.';
$string['pluginadministration'] = 'Board module administration';
$string['hideheaders'] = 'Hide column headers from students';
$string['hidename'] = 'Hide embedded board name (needed on some themes)';
$string['completiondetail:notes'] = 'Add notes: {$a}';
$string['completionnotesgroup'] = 'Require notes';
$string['completionnotes'] = 'Require students this number of notes to complete the activity';
Expand Down
4 changes: 3 additions & 1 deletion lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,9 @@ function board_cm_info_view(cm_info $cm) {
$width = get_config('mod_board', 'embed_width');
$height = get_config('mod_board', 'embed_height');
$output = html_writer::start_tag('div', ['class' => 'mod_board_embed_container']);
$output .= html_writer::tag('h3', $board->name);
if (empty($board->hidename)) {
$output .= html_writer::tag('h3', $board->name);
}
$output .= html_writer::start_tag('iframe', [
'src' => new moodle_url('/mod/board/view.php', ['id' => $cm->id, 'embed' => 1]),
'width' => $width,
Expand Down
3 changes: 3 additions & 0 deletions mod_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ public function definition() {
$mform->addElement('checkbox', 'hideheaders', get_string('hideheaders', 'mod_board'));
$mform->setType('hideheaders', PARAM_INT);

$mform->addElement('advcheckbox', 'hidename', get_string('hidename', 'mod_board'));
$mform->setType('hidename', PARAM_INT);

$mform->addElement('select', 'sortby', get_string('sortby', 'mod_board'),
array(
board::SORTBYNONE => get_string('sortbynone', 'mod_board'),
Expand Down
2 changes: 1 addition & 1 deletion version.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
defined('MOODLE_INTERNAL') || die;

$plugin->component = 'mod_board'; // Full name of the plugin (used for diagnostics).
$plugin->version = 2022040113; // The current module version Use 2022.04.01 as base for 4.00.
$plugin->version = 2022040114; // The current module version Use 2022.04.01 as base for 4.00.
$plugin->requires = 2022041900; // Moodle 4.00 and up.
$plugin->release = '1.401.03 (Build 2022040112)';
$plugin->maturity = MATURITY_STABLE;

0 comments on commit 6eb00ae

Please sign in to comment.