original_string: protected function render_badge_alignments(badge_alignments $alignments) {
          $currentbadge = new badge($alignments->currentbadgeid);
          $paging = new paging_bar($alignments->totalcount, $alignments->page, $alignments->perpage, $this->page->url, 'page');
          $htmlpagingbar = $this->render($paging);
          $table = new html_table();
          $table->attributes['class'] = 'generaltable boxaligncenter boxwidthwide';
          $table->head = array('Name', 'URL', '');
  
          foreach ($alignments->alignments as $item) {
              $urlaligment = new moodle_url('alignment.php',
                  array(
                      'id' => $currentbadge->id,
                      'alignmentid' => $item->id,
                  )
              );
              $row = array(
                  html_writer::link($urlaligment, $item->targetname),
                  html_writer::link($item->targeturl, $item->targeturl, array('target' => '_blank'))
              );
              if (!$currentbadge->is_active() && !$currentbadge->is_locked()) {
                  $delete = $this->output->action_icon(
                      new moodle_url('alignment_action.php',
                          array(
                              'id' => $currentbadge->id,
                              'alignmentid' => $item->id,
                              'action' => 'remove'
                          )
                      ), new pix_icon('t/delete', get_string('delete')));
                  $edit = $this->output->action_icon(
                      new moodle_url('alignment.php',
                          array(
                              'id' => $currentbadge->id,
                              'alignmentid' => $item->id,
                              'action' => 'edit'
                          )
                      ), new pix_icon('t/edit', get_string('edit')));
                  $actions = html_writer::tag('div', $edit . $delete, array('class' => 'badge-actions'));
                  array_push($row, $actions);
              }
              $table->data[] = $row;
          }
          $htmltable = html_writer::table($table);
  
          return $htmlpagingbar . $htmltable . $htmlpagingbar;
      }
code: protected function render_badge_alignments(badge_alignments $alignments) {
          $currentbadge = new badge($alignments->currentbadgeid);
          $paging = new paging_bar($alignments->totalcount, $alignments->page, $alignments->perpage, $this->page->url, 'page');
          $htmlpagingbar = $this->render($paging);
          $table = new html_table();
          $table->attributes['class'] = 'generaltable boxaligncenter boxwidthwide';
          $table->head = array('Name', 'URL', '');
  
          foreach ($alignments->alignments as $item) {
              $urlaligment = new moodle_url('alignment.php',
                  array(
                      'id' => $currentbadge->id,
                      'alignmentid' => $item->id,
                  )
              );
              $row = array(
                  html_writer::link($urlaligment, $item->targetname),
                  html_writer::link($item->targeturl, $item->targeturl, array('target' => '_blank'))
              );
              if (!$currentbadge->is_active() && !$currentbadge->is_locked()) {
                  $delete = $this->output->action_icon(
                      new moodle_url('alignment_action.php',
                          array(
                              'id' => $currentbadge->id,
                              'alignmentid' => $item->id,
                              'action' => 'remove'
                          )
                      ), new pix_icon('t/delete', get_string('delete')));
                  $edit = $this->output->action_icon(
                      new moodle_url('alignment.php',
                          array(
                              'id' => $currentbadge->id,
                              'alignmentid' => $item->id,
                              'action' => 'edit'
                          )
                      ), new pix_icon('t/edit', get_string('edit')));
                  $actions = html_writer::tag('div', $edit . $delete, array('class' => 'badge-actions'));
                  array_push($row, $actions);
              }
              $table->data[] = $row;
          }
          $htmltable = html_writer::table($table);
  
          return $htmlpagingbar . $htmltable . $htmlpagingbar;
      }
code_tokens: protected function render_badge_alignments ( badge_alignments $ alignments ) { $ currentbadge = new badge ( $ alignments -> currentbadgeid ) ; $ paging = new paging_bar ( $ alignments -> totalcount , $ alignments -> page , $ alignments -> perpage , $ this -> page -> url , 'page' ) ; $ htmlpagingbar = $ this -> render ( $ paging ) ; $ table = new html_table ( ) ; $ table -> attributes [ 'class' ] = 'generaltable boxaligncenter boxwidthwide' ; $ table -> head = array ( 'Name' , 'URL' , '' ) ; foreach ( $ alignments -> alignments as $ item ) { $ urlaligment = new moodle_url ( 'alignment.php' , array ( 'id' => $ currentbadge -> id , 'alignmentid' => $ item -> id , ) ) ; $ row = array ( html_writer :: link ( $ urlaligment , $ item -> targetname ) , html_writer :: link ( $ item -> targeturl , $ item -> targeturl , array ( 'target' => '_blank' ) ) ) ; if ( ! $ currentbadge -> is_active ( ) && ! $ currentbadge -> is_locked ( ) ) { $ delete = $ this -> output -> action_icon ( new moodle_url ( 'alignment_action.php' , array ( 'id' => $ currentbadge -> id , 'alignmentid' => $ item -> id , 'action' => 'remove' ) ) , new pix_icon ( 't/delete' , get_string ( 'delete' ) ) ) ; $ edit = $ this -> output -> action_icon ( new moodle_url ( 'alignment.php' , array ( 'id' => $ currentbadge -> id , 'alignmentid' => $ item -> id , 'action' => 'edit' ) ) , new pix_icon ( 't/edit' , get_string ( 'edit' ) ) ) ; $ actions = html_writer :: tag ( 'div' , $ edit . $ delete , array ( 'class' => 'badge-actions' ) ) ; array_push ( $ row , $ actions ) ; } $ table -> data [ ] = $ row ; } $ htmltable = html_writer :: table ( $ table ) ; return $ htmlpagingbar . $ htmltable . $ htmlpagingbar ; }
docstring: Renders a table with alignment.
  
  @param badge_alignments $alignments List alignments.
  @return string List alignment to output.
docstring_tokens: Renders a table with alignment .