original_string: public function category_listing_actions(core_course_category $category = null) {
          $actions = array();
  
          $cancreatecategory = $category && $category->can_create_subcategory();
          $cancreatecategory = $cancreatecategory || core_course_category::can_create_top_level_category();
          if ($category === null) {
              $category = core_course_category::top();
          }
  
          if ($cancreatecategory) {
              $url = new moodle_url('/course/editcategory.php', array('parent' => $category->id));
              $actions[] = html_writer::link($url, get_string('createnewcategory'), array('class' => 'btn btn-secondary'));
          }
          if (core_course_category::can_approve_course_requests()) {
              $actions[] = html_writer::link(new moodle_url('/course/pending.php'), get_string('coursespending'));
          }
          if (count($actions) === 0) {
              return '';
          }
          return html_writer::div(join(' ', $actions), 'listing-actions category-listing-actions mb-3');
      }
code: public function category_listing_actions(core_course_category $category = null) {
          $actions = array();
  
          $cancreatecategory = $category && $category->can_create_subcategory();
          $cancreatecategory = $cancreatecategory || core_course_category::can_create_top_level_category();
          if ($category === null) {
              $category = core_course_category::top();
          }
  
          if ($cancreatecategory) {
              $url = new moodle_url('/course/editcategory.php', array('parent' => $category->id));
              $actions[] = html_writer::link($url, get_string('createnewcategory'), array('class' => 'btn btn-secondary'));
          }
          if (core_course_category::can_approve_course_requests()) {
              $actions[] = html_writer::link(new moodle_url('/course/pending.php'), get_string('coursespending'));
          }
          if (count($actions) === 0) {
              return '';
          }
          return html_writer::div(join(' ', $actions), 'listing-actions category-listing-actions mb-3');
      }
code_tokens: public function category_listing_actions ( core_course_category $ category = null ) { $ actions = array ( ) ; $ cancreatecategory = $ category && $ category -> can_create_subcategory ( ) ; $ cancreatecategory = $ cancreatecategory || core_course_category :: can_create_top_level_category ( ) ; if ( $ category === null ) { $ category = core_course_category :: top ( ) ; } if ( $ cancreatecategory ) { $ url = new moodle_url ( '/course/editcategory.php' , array ( 'parent' => $ category -> id ) ) ; $ actions [ ] = html_writer :: link ( $ url , get_string ( 'createnewcategory' ) , array ( 'class' => 'btn btn-secondary' ) ) ; } if ( core_course_category :: can_approve_course_requests ( ) ) { $ actions [ ] = html_writer :: link ( new moodle_url ( '/course/pending.php' ) , get_string ( 'coursespending' ) ) ; } if ( count ( $ actions ) === 0 ) { return '' ; } return html_writer :: div ( join ( ' ' , $ actions ) , 'listing-actions category-listing-actions mb-3' ) ; }
docstring: Renderers the actions that are possible for the course category listing.
  
  These are not the actions associated with an individual category listing.
  That happens through category_listitem_actions.
  
  @param core_course_category $category
  @return string
docstring_tokens: Renderers the actions that are possible for the course category listing .