original_string: protected function getPageLinksArray()
      {
          $links = [];
          $types = $this->getPageLinkTypes();
  
          $links[] = ['name' => Lang::get('backend::lang.pagelist.select_page'), 'url' => false];
  
          $iterator = function ($links, $level = 0) use (&$iterator) {
              $result = [];
              foreach ($links as $linkUrl => $link) {
  
                  /*
                   * Remove scheme and host from URL
                   */
                  $baseUrl = Request::getSchemeAndHttpHost();
                  if (strpos($linkUrl, $baseUrl) === 0) {
                      $linkUrl = substr($linkUrl, strlen($baseUrl));
                  }
  
                  $linkName = str_repeat('&nbsp;', $level * 4);
                  $linkName .= is_array($link) ? array_get($link, 'title', '') : $link;
                  $result[] = ['name' => $linkName, 'url' => $linkUrl];
  
                  if (is_array($link)) {
                      $result = array_merge(
                          $result,
                          $iterator(array_get($link, 'links', []), $level + 1)
                      );
                  }
              }
  
              return $result;
          };
  
          foreach ($types as $typeCode => $typeName) {
              $links = array_merge($links, $iterator($this->getPageLinks($typeCode)));
          }
  
          return $links;
      }
code: protected function getPageLinksArray()
      {
          $links = [];
          $types = $this->getPageLinkTypes();
  
          $links[] = ['name' => Lang::get('backend::lang.pagelist.select_page'), 'url' => false];
  
          $iterator = function ($links, $level = 0) use (&$iterator) {
              $result = [];
              foreach ($links as $linkUrl => $link) {
  
                  /*
                   * Remove scheme and host from URL
                   */
                  $baseUrl = Request::getSchemeAndHttpHost();
                  if (strpos($linkUrl, $baseUrl) === 0) {
                      $linkUrl = substr($linkUrl, strlen($baseUrl));
                  }
  
                  $linkName = str_repeat('&nbsp;', $level * 4);
                  $linkName .= is_array($link) ? array_get($link, 'title', '') : $link;
                  $result[] = ['name' => $linkName, 'url' => $linkUrl];
  
                  if (is_array($link)) {
                      $result = array_merge(
                          $result,
                          $iterator(array_get($link, 'links', []), $level + 1)
                      );
                  }
              }
  
              return $result;
          };
  
          foreach ($types as $typeCode => $typeName) {
              $links = array_merge($links, $iterator($this->getPageLinks($typeCode)));
          }
  
          return $links;
      }
code_tokens: protected function getPageLinksArray ( ) { $ links = [ ] ; $ types = $ this -> getPageLinkTypes ( ) ; $ links [ ] = [ 'name' => Lang :: get ( 'backend::lang.pagelist.select_page' ) , 'url' => false ] ; $ iterator = function ( $ links , $ level = 0 ) use ( & $ iterator ) { $ result = [ ] ; foreach ( $ links as $ linkUrl => $ link ) { /*
                   * Remove scheme and host from URL
                   */ $ baseUrl = Request :: getSchemeAndHttpHost ( ) ; if ( strpos ( $ linkUrl , $ baseUrl ) === 0 ) { $ linkUrl = substr ( $ linkUrl , strlen ( $ baseUrl ) ) ; } $ linkName = str_repeat ( '&nbsp;' , $ level * 4 ) ; $ linkName .= is_array ( $ link ) ? array_get ( $ link , 'title' , '' ) : $ link ; $ result [ ] = [ 'name' => $ linkName , 'url' => $ linkUrl ] ; if ( is_array ( $ link ) ) { $ result = array_merge ( $ result , $ iterator ( array_get ( $ link , 'links' , [ ] ) , $ level + 1 ) ) ; } } return $ result ; } ; foreach ( $ types as $ typeCode => $ typeName ) { $ links = array_merge ( $ links , $ iterator ( $ this -> getPageLinks ( $ typeCode ) ) ) ; } return $ links ; }
docstring: Returns a single collection of available page links.
  This implementation has room to place links under
  different groups based on the link type.
  @return array
docstring_tokens: Returns a single collection of available page links . This implementation has room to place links under different groups based on the link type .