Ejemplo n.º 1
0
 /**
  * Format the current row's actions column.
  *
  * @param   step    $step       The step for this row.
  * @return  string
  */
 protected function col_actions(step $step)
 {
     $actions = [];
     if ($step->is_first_step()) {
         $actions[] = helper::get_filler_icon();
     } else {
         $actions[] = helper::format_icon_link($step->get_moveup_link(), 't/up', get_string('movestepup', 'tool_usertours'));
     }
     if ($step->is_last_step()) {
         $actions[] = helper::get_filler_icon();
     } else {
         $actions[] = helper::format_icon_link($step->get_movedown_link(), 't/down', get_string('movestepdown', 'tool_usertours'));
     }
     $actions[] = helper::format_icon_link($step->get_edit_link(), 't/edit', get_string('edit'));
     $actions[] = helper::format_icon_link($step->get_delete_link(), 't/delete', get_string('delete'), 'moodle', ['data-action' => 'delete', 'data-id' => $step->get_id()]);
     return implode(' ', $actions);
 }
Ejemplo n.º 2
0
 /**
  * Format the current row's actions column.
  *
  * @param   tour    $tour       The tour for this row.
  * @return  string
  */
 protected function col_actions(tour $tour)
 {
     $actions = [];
     if ($tour->is_first_tour()) {
         $actions[] = helper::get_filler_icon();
     } else {
         $actions[] = helper::format_icon_link($tour->get_moveup_link(), 't/up', get_string('movetourup', 'tool_usertours'));
     }
     if ($tour->is_last_tour($this->tourcount)) {
         $actions[] = helper::get_filler_icon();
     } else {
         $actions[] = helper::format_icon_link($tour->get_movedown_link(), 't/down', get_string('movetourdown', 'tool_usertours'));
     }
     $actions[] = helper::format_icon_link($tour->get_view_link(), 't/viewdetails', get_string('view'));
     $actions[] = helper::format_icon_link($tour->get_edit_link(), 't/edit', get_string('edit'));
     $actions[] = helper::format_icon_link($tour->get_export_link(), 't/export', get_string('exporttour', 'tool_usertours'), 'tool_usertours');
     $actions[] = helper::format_icon_link($tour->get_delete_link(), 't/delete', get_string('delete'), null, ['data-action' => 'delete', 'data-id' => $tour->get_id()]);
     return implode(' ', $actions);
 }