Skip to content

Commit

Permalink
Merge branch 'MDL-60646-34' of git://github.com/junpataleta/moodle in…
Browse files Browse the repository at this point in the history
…to MOODLE_34_STABLE
  • Loading branch information
David Monllao authored and snake committed Feb 1, 2018
2 parents 17fed89 + f5bb389 commit 60af40c
Showing 1 changed file with 17 additions and 7 deletions.
24 changes: 17 additions & 7 deletions user/portfolio.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,14 +113,24 @@
$table->data = array();

foreach ($instances as $i) {
// Contents of the actions (Show / hide) column.
$actions = '';

// Configure icon.
if ($i->has_user_config()) {
$configurl = new moodle_url($baseurl);
$configurl->param('config', $i->get('id'));
$actions .= html_writer::link($configurl, $OUTPUT->pix_icon('t/edit', get_string('configure', 'portfolio')));
}

// Hide/show icon.
$visible = $i->get_user_config('visible', $USER->id);
$table->data[] = array($i->get('name'), $i->get('plugin'),
($i->has_user_config()
? '<a href="' . $baseurl . '?config=' . $i->get('id') . '">' .
$OUTPUT->pix_icon('t/edit', get_string('configure')) . '</a>' : '') .
' <a href="' . $baseurl . '?hide=' . $i->get('id') . '">' .
$OUTPUT->pix_icon('t/' . (($visible) ? 'hide' : 'show')), get_string($visible ? 'hide' : 'show') . '</a><br />'
);
$visibilityaction = $visible ? 'hide' : 'show';
$showhideurl = new moodle_url($baseurl);
$showhideurl->param('hide', $i->get('id'));
$actions .= html_writer::link($showhideurl, $OUTPUT->pix_icon('t/' . $visibilityaction, get_string($visibilityaction)));

$table->data[] = array($i->get('name'), $i->get('plugin'), $actions);
}

echo html_writer::table($table);
Expand Down

0 comments on commit 60af40c

Please sign in to comment.