original_string: public function lock_summaries(array $locks) {
          $table = new html_table();
          $table->colclasses = array(
              'name',
              'type',
              'default',
              'uses',
              'actions'
          );
          $table->rowclasses = array(
              'lock_name',
              'lock_type',
              'lock_default',
              'lock_uses',
              'lock_actions',
          );
          $table->head = array(
              get_string('lockname', 'cache'),
              get_string('locktype', 'cache'),
              get_string('lockdefault', 'cache'),
              get_string('lockuses', 'cache'),
              get_string('actions', 'cache')
          );
          $table->data = array();
          $tick = $this->output->pix_icon('i/valid', '');
          foreach ($locks as $lock) {
              $actions = array();
              if ($lock['uses'] === 0 && !$lock['default']) {
                  $url = new moodle_url('/cache/admin.php', array('lock' => $lock['name'], 'action' => 'deletelock', 'sesskey' => sesskey()));
                  $actions[] = html_writer::link($url, get_string('delete', 'cache'));
              }
              $table->data[] = new html_table_row(array(
                  new html_table_cell($lock['name']),
                  new html_table_cell($lock['type']),
                  new html_table_cell($lock['default'] ? $tick : ''),
                  new html_table_cell($lock['uses']),
                  new html_table_cell(join(' ', $actions))
              ));
          }
  
          $url = new moodle_url('/cache/admin.php', array('action' => 'newlockinstance', 'sesskey' => sesskey()));
          $select = new single_select($url, 'lock', cache_administration_helper::get_addable_lock_options());
          $select->label = get_string('addnewlockinstance', 'cache');
  
          $html = html_writer::start_tag('div', array('id' => 'core-cache-lock-summary'));
          $html .= $this->output->heading(get_string('locksummary', 'cache'), 3);
          $html .= html_writer::table($table);
          $html .= html_writer::tag('div', $this->output->render($select), array('class' => 'new-instance'));
          $html .= html_writer::end_tag('div');
          return $html;
      }
code: public function lock_summaries(array $locks) {
          $table = new html_table();
          $table->colclasses = array(
              'name',
              'type',
              'default',
              'uses',
              'actions'
          );
          $table->rowclasses = array(
              'lock_name',
              'lock_type',
              'lock_default',
              'lock_uses',
              'lock_actions',
          );
          $table->head = array(
              get_string('lockname', 'cache'),
              get_string('locktype', 'cache'),
              get_string('lockdefault', 'cache'),
              get_string('lockuses', 'cache'),
              get_string('actions', 'cache')
          );
          $table->data = array();
          $tick = $this->output->pix_icon('i/valid', '');
          foreach ($locks as $lock) {
              $actions = array();
              if ($lock['uses'] === 0 && !$lock['default']) {
                  $url = new moodle_url('/cache/admin.php', array('lock' => $lock['name'], 'action' => 'deletelock', 'sesskey' => sesskey()));
                  $actions[] = html_writer::link($url, get_string('delete', 'cache'));
              }
              $table->data[] = new html_table_row(array(
                  new html_table_cell($lock['name']),
                  new html_table_cell($lock['type']),
                  new html_table_cell($lock['default'] ? $tick : ''),
                  new html_table_cell($lock['uses']),
                  new html_table_cell(join(' ', $actions))
              ));
          }
  
          $url = new moodle_url('/cache/admin.php', array('action' => 'newlockinstance', 'sesskey' => sesskey()));
          $select = new single_select($url, 'lock', cache_administration_helper::get_addable_lock_options());
          $select->label = get_string('addnewlockinstance', 'cache');
  
          $html = html_writer::start_tag('div', array('id' => 'core-cache-lock-summary'));
          $html .= $this->output->heading(get_string('locksummary', 'cache'), 3);
          $html .= html_writer::table($table);
          $html .= html_writer::tag('div', $this->output->render($select), array('class' => 'new-instance'));
          $html .= html_writer::end_tag('div');
          return $html;
      }
code_tokens: public function lock_summaries ( array $ locks ) { $ table = new html_table ( ) ; $ table -> colclasses = array ( 'name' , 'type' , 'default' , 'uses' , 'actions' ) ; $ table -> rowclasses = array ( 'lock_name' , 'lock_type' , 'lock_default' , 'lock_uses' , 'lock_actions' , ) ; $ table -> head = array ( get_string ( 'lockname' , 'cache' ) , get_string ( 'locktype' , 'cache' ) , get_string ( 'lockdefault' , 'cache' ) , get_string ( 'lockuses' , 'cache' ) , get_string ( 'actions' , 'cache' ) ) ; $ table -> data = array ( ) ; $ tick = $ this -> output -> pix_icon ( 'i/valid' , '' ) ; foreach ( $ locks as $ lock ) { $ actions = array ( ) ; if ( $ lock [ 'uses' ] === 0 && ! $ lock [ 'default' ] ) { $ url = new moodle_url ( '/cache/admin.php' , array ( 'lock' => $ lock [ 'name' ] , 'action' => 'deletelock' , 'sesskey' => sesskey ( ) ) ) ; $ actions [ ] = html_writer :: link ( $ url , get_string ( 'delete' , 'cache' ) ) ; } $ table -> data [ ] = new html_table_row ( array ( new html_table_cell ( $ lock [ 'name' ] ) , new html_table_cell ( $ lock [ 'type' ] ) , new html_table_cell ( $ lock [ 'default' ] ? $ tick : '' ) , new html_table_cell ( $ lock [ 'uses' ] ) , new html_table_cell ( join ( ' ' , $ actions ) ) ) ) ; } $ url = new moodle_url ( '/cache/admin.php' , array ( 'action' => 'newlockinstance' , 'sesskey' => sesskey ( ) ) ) ; $ select = new single_select ( $ url , 'lock' , cache_administration_helper :: get_addable_lock_options ( ) ) ; $ select -> label = get_string ( 'addnewlockinstance' , 'cache' ) ; $ html = html_writer :: start_tag ( 'div' , array ( 'id' => 'core-cache-lock-summary' ) ) ; $ html .= $ this -> output -> heading ( get_string ( 'locksummary' , 'cache' ) , 3 ) ; $ html .= html_writer :: table ( $ table ) ; $ html .= html_writer :: tag ( 'div' , $ this -> output -> render ( $ select ) , array ( 'class' => 'new-instance' ) ) ; $ html .= html_writer :: end_tag ( 'div' ) ; return $ html ; }
docstring: Display basic information about lock instances.
  
  @todo Add some actions so that people can configure lock instances.
  
  @param array $locks
  @return string
docstring_tokens: Display basic information about lock instances .