original_string: protected function getTabTitle($type, $template)
      {
          if ($type === 'page') {
              $result = $template->title ?: $template->getFileName();
              if (!$result) {
                  $result = trans('cms::lang.page.new');
              }
  
              return $result;
          }
  
          if ($type === 'partial' || $type === 'layout' || $type === 'content' || $type === 'asset') {
              $result = in_array($type, ['asset', 'content']) ? $template->getFileName() : $template->getBaseFileName();
              if (!$result) {
                  $result = trans('cms::lang.'.$type.'.new');
              }
  
              return $result;
          }
  
          return $template->getFileName();
      }
code: protected function getTabTitle($type, $template)
      {
          if ($type === 'page') {
              $result = $template->title ?: $template->getFileName();
              if (!$result) {
                  $result = trans('cms::lang.page.new');
              }
  
              return $result;
          }
  
          if ($type === 'partial' || $type === 'layout' || $type === 'content' || $type === 'asset') {
              $result = in_array($type, ['asset', 'content']) ? $template->getFileName() : $template->getBaseFileName();
              if (!$result) {
                  $result = trans('cms::lang.'.$type.'.new');
              }
  
              return $result;
          }
  
          return $template->getFileName();
      }
code_tokens: protected function getTabTitle ( $ type , $ template ) { if ( $ type === 'page' ) { $ result = $ template -> title ? : $ template -> getFileName ( ) ; if ( ! $ result ) { $ result = trans ( 'cms::lang.page.new' ) ; } return $ result ; } if ( $ type === 'partial' || $ type === 'layout' || $ type === 'content' || $ type === 'asset' ) { $ result = in_array ( $ type , [ 'asset' , 'content' ] ) ? $ template -> getFileName ( ) : $ template -> getBaseFileName ( ) ; if ( ! $ result ) { $ result = trans ( 'cms::lang.' . $ type . '.new' ) ; } return $ result ; } return $ template -> getFileName ( ) ; }
docstring: Returns the text for a template tab
  @param string $type
  @param string $template
  @return string
docstring_tokens: Returns the text for a template tab