original_string: public function print_badge_table_actions($badge, $context) {
          $actions = "";
  
          if (has_capability('moodle/badges:configuredetails', $context) && $badge->has_criteria()) {
              // Activate/deactivate badge.
              if ($badge->status == BADGE_STATUS_INACTIVE || $badge->status == BADGE_STATUS_INACTIVE_LOCKED) {
                  // "Activate" will go to another page and ask for confirmation.
                  $url = new moodle_url('/badges/action.php');
                  $url->param('id', $badge->id);
                  $url->param('activate', true);
                  $url->param('sesskey', sesskey());
                  $return = new moodle_url(qualified_me());
                  $url->param('return', $return->out_as_local_url(false));
                  $actions .= $this->output->action_icon($url, new pix_icon('t/show', get_string('activate', 'badges'))) . " ";
              } else {
                  $url = new moodle_url(qualified_me());
                  $url->param('lock', $badge->id);
                  $url->param('sesskey', sesskey());
                  $actions .= $this->output->action_icon($url, new pix_icon('t/hide', get_string('deactivate', 'badges'))) . " ";
              }
          }
  
          // Award badge manually.
          if ($badge->has_manual_award_criteria() &&
                  has_capability('moodle/badges:awardbadge', $context) &&
                  $badge->is_active()) {
              $url = new moodle_url('/badges/award.php', array('id' => $badge->id));
              $actions .= $this->output->action_icon($url, new pix_icon('t/award', get_string('award', 'badges'))) . " ";
          }
  
          // Edit badge.
          if (has_capability('moodle/badges:configuredetails', $context)) {
              $url = new moodle_url('/badges/edit.php', array('id' => $badge->id, 'action' => 'details'));
              $actions .= $this->output->action_icon($url, new pix_icon('t/edit', get_string('edit'))) . " ";
          }
  
          // Duplicate badge.
          if (has_capability('moodle/badges:createbadge', $context)) {
              $url = new moodle_url('/badges/action.php', array('copy' => '1', 'id' => $badge->id, 'sesskey' => sesskey()));
              $actions .= $this->output->action_icon($url, new pix_icon('t/copy', get_string('copy'))) . " ";
          }
  
          // Delete badge.
          if (has_capability('moodle/badges:deletebadge', $context)) {
              $url = new moodle_url(qualified_me());
              $url->param('delete', $badge->id);
              $actions .= $this->output->action_icon($url, new pix_icon('t/delete', get_string('delete'))) . " ";
          }
  
          return $actions;
      }
code: public function print_badge_table_actions($badge, $context) {
          $actions = "";
  
          if (has_capability('moodle/badges:configuredetails', $context) && $badge->has_criteria()) {
              // Activate/deactivate badge.
              if ($badge->status == BADGE_STATUS_INACTIVE || $badge->status == BADGE_STATUS_INACTIVE_LOCKED) {
                  // "Activate" will go to another page and ask for confirmation.
                  $url = new moodle_url('/badges/action.php');
                  $url->param('id', $badge->id);
                  $url->param('activate', true);
                  $url->param('sesskey', sesskey());
                  $return = new moodle_url(qualified_me());
                  $url->param('return', $return->out_as_local_url(false));
                  $actions .= $this->output->action_icon($url, new pix_icon('t/show', get_string('activate', 'badges'))) . " ";
              } else {
                  $url = new moodle_url(qualified_me());
                  $url->param('lock', $badge->id);
                  $url->param('sesskey', sesskey());
                  $actions .= $this->output->action_icon($url, new pix_icon('t/hide', get_string('deactivate', 'badges'))) . " ";
              }
          }
  
          // Award badge manually.
          if ($badge->has_manual_award_criteria() &&
                  has_capability('moodle/badges:awardbadge', $context) &&
                  $badge->is_active()) {
              $url = new moodle_url('/badges/award.php', array('id' => $badge->id));
              $actions .= $this->output->action_icon($url, new pix_icon('t/award', get_string('award', 'badges'))) . " ";
          }
  
          // Edit badge.
          if (has_capability('moodle/badges:configuredetails', $context)) {
              $url = new moodle_url('/badges/edit.php', array('id' => $badge->id, 'action' => 'details'));
              $actions .= $this->output->action_icon($url, new pix_icon('t/edit', get_string('edit'))) . " ";
          }
  
          // Duplicate badge.
          if (has_capability('moodle/badges:createbadge', $context)) {
              $url = new moodle_url('/badges/action.php', array('copy' => '1', 'id' => $badge->id, 'sesskey' => sesskey()));
              $actions .= $this->output->action_icon($url, new pix_icon('t/copy', get_string('copy'))) . " ";
          }
  
          // Delete badge.
          if (has_capability('moodle/badges:deletebadge', $context)) {
              $url = new moodle_url(qualified_me());
              $url->param('delete', $badge->id);
              $actions .= $this->output->action_icon($url, new pix_icon('t/delete', get_string('delete'))) . " ";
          }
  
          return $actions;
      }
code_tokens: public function print_badge_table_actions ( $ badge , $ context ) { $ actions = "" ; if ( has_capability ( 'moodle/badges:configuredetails' , $ context ) && $ badge -> has_criteria ( ) ) { // Activate/deactivate badge. if ( $ badge -> status == BADGE_STATUS_INACTIVE || $ badge -> status == BADGE_STATUS_INACTIVE_LOCKED ) { // "Activate" will go to another page and ask for confirmation. $ url = new moodle_url ( '/badges/action.php' ) ; $ url -> param ( 'id' , $ badge -> id ) ; $ url -> param ( 'activate' , true ) ; $ url -> param ( 'sesskey' , sesskey ( ) ) ; $ return = new moodle_url ( qualified_me ( ) ) ; $ url -> param ( 'return' , $ return -> out_as_local_url ( false ) ) ; $ actions .= $ this -> output -> action_icon ( $ url , new pix_icon ( 't/show' , get_string ( 'activate' , 'badges' ) ) ) . " " ; } else { $ url = new moodle_url ( qualified_me ( ) ) ; $ url -> param ( 'lock' , $ badge -> id ) ; $ url -> param ( 'sesskey' , sesskey ( ) ) ; $ actions .= $ this -> output -> action_icon ( $ url , new pix_icon ( 't/hide' , get_string ( 'deactivate' , 'badges' ) ) ) . " " ; } } // Award badge manually. if ( $ badge -> has_manual_award_criteria ( ) && has_capability ( 'moodle/badges:awardbadge' , $ context ) && $ badge -> is_active ( ) ) { $ url = new moodle_url ( '/badges/award.php' , array ( 'id' => $ badge -> id ) ) ; $ actions .= $ this -> output -> action_icon ( $ url , new pix_icon ( 't/award' , get_string ( 'award' , 'badges' ) ) ) . " " ; } // Edit badge. if ( has_capability ( 'moodle/badges:configuredetails' , $ context ) ) { $ url = new moodle_url ( '/badges/edit.php' , array ( 'id' => $ badge -> id , 'action' => 'details' ) ) ; $ actions .= $ this -> output -> action_icon ( $ url , new pix_icon ( 't/edit' , get_string ( 'edit' ) ) ) . " " ; } // Duplicate badge. if ( has_capability ( 'moodle/badges:createbadge' , $ context ) ) { $ url = new moodle_url ( '/badges/action.php' , array ( 'copy' => '1' , 'id' => $ badge -> id , 'sesskey' => sesskey ( ) ) ) ; $ actions .= $ this -> output -> action_icon ( $ url , new pix_icon ( 't/copy' , get_string ( 'copy' ) ) ) . " " ; } // Delete badge. if ( has_capability ( 'moodle/badges:deletebadge' , $ context ) ) { $ url = new moodle_url ( qualified_me ( ) ) ; $ url -> param ( 'delete' , $ badge -> id ) ; $ actions .= $ this -> output -> action_icon ( $ url , new pix_icon ( 't/delete' , get_string ( 'delete' ) ) ) . " " ; } return $ actions ; }
docstring: Prints action icons for the badge.
docstring_tokens: Prints action icons for the badge .