Permalink
Browse files

Merge branch 'MDL-60646-master' of git://github.com/junpataleta/moodle

  • Loading branch information...
dmonllao authored and snake committed Jan 29, 2018
2 parents f372f96 + 4369677 commit e9fd486eb6dc3d08011b1e5de5243c7fed68a072
Showing with 17 additions and 7 deletions.
  1. +17 −7 user/portfolio.php
@@ -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);

0 comments on commit e9fd486

Please sign in to comment.