Skip to content

Commit 60af40c

Browse files
David Monllaosnake
David Monllao
authored andcommitted
Merge branch 'MDL-60646-34' of git://github.com/junpataleta/moodle into MOODLE_34_STABLE
2 parents 17fed89 + f5bb389 commit 60af40c

File tree

1 file changed

+17
-7
lines changed

1 file changed

+17
-7
lines changed

user/portfolio.php

+17-7
Original file line numberDiff line numberDiff line change
@@ -113,14 +113,24 @@
113113
$table->data = array();
114114

115115
foreach ($instances as $i) {
116+
// Contents of the actions (Show / hide) column.
117+
$actions = '';
118+
119+
// Configure icon.
120+
if ($i->has_user_config()) {
121+
$configurl = new moodle_url($baseurl);
122+
$configurl->param('config', $i->get('id'));
123+
$actions .= html_writer::link($configurl, $OUTPUT->pix_icon('t/edit', get_string('configure', 'portfolio')));
124+
}
125+
126+
// Hide/show icon.
116127
$visible = $i->get_user_config('visible', $USER->id);
117-
$table->data[] = array($i->get('name'), $i->get('plugin'),
118-
($i->has_user_config()
119-
? '<a href="' . $baseurl . '?config=' . $i->get('id') . '">' .
120-
$OUTPUT->pix_icon('t/edit', get_string('configure')) . '</a>' : '') .
121-
' <a href="' . $baseurl . '?hide=' . $i->get('id') . '">' .
122-
$OUTPUT->pix_icon('t/' . (($visible) ? 'hide' : 'show')), get_string($visible ? 'hide' : 'show') . '</a><br />'
123-
);
128+
$visibilityaction = $visible ? 'hide' : 'show';
129+
$showhideurl = new moodle_url($baseurl);
130+
$showhideurl->param('hide', $i->get('id'));
131+
$actions .= html_writer::link($showhideurl, $OUTPUT->pix_icon('t/' . $visibilityaction, get_string($visibilityaction)));
132+
133+
$table->data[] = array($i->get('name'), $i->get('plugin'), $actions);
124134
}
125135

126136
echo html_writer::table($table);

0 commit comments

Comments
 (0)