original_string: public static function get_subwikis($wikiid) {
          global $USER;
  
          $warnings = array();
  
          $params = self::validate_parameters(self::get_subwikis_parameters(), array('wikiid' => $wikiid));
  
          // Get wiki instance.
          if (!$wiki = wiki_get_wiki($params['wikiid'])) {
              throw new moodle_exception('incorrectwikiid', 'wiki');
          }
  
          // Validate context and capabilities.
          list($course, $cm) = get_course_and_cm_from_instance($wiki, 'wiki');
          $context = context_module::instance($cm->id);
          self::validate_context($context);
          require_capability('mod/wiki:viewpage', $context);
  
          $returnedsubwikis = wiki_get_visible_subwikis($wiki, $cm, $context);
          foreach ($returnedsubwikis as $subwiki) {
              $subwiki->canedit = wiki_user_can_edit($subwiki);
          }
  
          $result = array();
          $result['subwikis'] = $returnedsubwikis;
          $result['warnings'] = $warnings;
          return $result;
      }
code: public static function get_subwikis($wikiid) {
          global $USER;
  
          $warnings = array();
  
          $params = self::validate_parameters(self::get_subwikis_parameters(), array('wikiid' => $wikiid));
  
          // Get wiki instance.
          if (!$wiki = wiki_get_wiki($params['wikiid'])) {
              throw new moodle_exception('incorrectwikiid', 'wiki');
          }
  
          // Validate context and capabilities.
          list($course, $cm) = get_course_and_cm_from_instance($wiki, 'wiki');
          $context = context_module::instance($cm->id);
          self::validate_context($context);
          require_capability('mod/wiki:viewpage', $context);
  
          $returnedsubwikis = wiki_get_visible_subwikis($wiki, $cm, $context);
          foreach ($returnedsubwikis as $subwiki) {
              $subwiki->canedit = wiki_user_can_edit($subwiki);
          }
  
          $result = array();
          $result['subwikis'] = $returnedsubwikis;
          $result['warnings'] = $warnings;
          return $result;
      }
code_tokens: public static function get_subwikis ( $ wikiid ) { global $ USER ; $ warnings = array ( ) ; $ params = self :: validate_parameters ( self :: get_subwikis_parameters ( ) , array ( 'wikiid' => $ wikiid ) ) ; // Get wiki instance. if ( ! $ wiki = wiki_get_wiki ( $ params [ 'wikiid' ] ) ) { throw new moodle_exception ( 'incorrectwikiid' , 'wiki' ) ; } // Validate context and capabilities. list ( $ course , $ cm ) = get_course_and_cm_from_instance ( $ wiki , 'wiki' ) ; $ context = context_module :: instance ( $ cm -> id ) ; self :: validate_context ( $ context ) ; require_capability ( 'mod/wiki:viewpage' , $ context ) ; $ returnedsubwikis = wiki_get_visible_subwikis ( $ wiki , $ cm , $ context ) ; foreach ( $ returnedsubwikis as $ subwiki ) { $ subwiki -> canedit = wiki_user_can_edit ( $ subwiki ) ; } $ result = array ( ) ; $ result [ 'subwikis' ] = $ returnedsubwikis ; $ result [ 'warnings' ] = $ warnings ; return $ result ; }
docstring: Returns the list of subwikis the user can see in a specific wiki.
  
  @param int $wikiid The wiki instance ID.
  @return array Containing a list of warnings and a list of subwikis.
  @since Moodle 3.1
docstring_tokens: Returns the list of subwikis the user can see in a specific wiki .