Total Complexity | 8 |
Total Lines | 50 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
15 | class AboutMenuPage extends AbstractDocsMenuPage |
||
16 | { |
||
17 | use OpenInModalTriggerMenuPageTrait; |
||
18 | |||
19 | protected MenuPageHelper $menuPageHelper; |
||
20 | |||
21 | function __construct(MenuPageHelper $menuPageHelper) |
||
24 | } |
||
25 | |||
26 | public function getMenuPageSlug(): string |
||
27 | { |
||
28 | return 'about'; |
||
29 | } |
||
30 | |||
31 | protected function useTabpanelForContent(): bool |
||
34 | } |
||
35 | |||
36 | /** |
||
37 | * Validate the param also |
||
38 | */ |
||
39 | protected function isCurrentScreen(): bool |
||
40 | { |
||
41 | return !$this->menuPageHelper->isDocumentationScreen() && parent::isCurrentScreen(); |
||
42 | } |
||
43 | |||
44 | protected function getContentToPrint(): string |
||
45 | { |
||
46 | $markdownContentParser = MarkdownContentParserFacade::getInstance(); |
||
47 | try { |
||
48 | return $markdownContentParser->getContent('about.md', '', [ContentParserOptions::TAB_CONTENT => true]); |
||
49 | } catch (InvalidArgumentException $e) { |
||
50 | return sprintf( |
||
51 | '<p>%s</p>', |
||
52 | \__('Oops, there was a problem loading the page', 'graphql-api') |
||
53 | ); |
||
54 | } |
||
55 | } |
||
56 | |||
57 | /** |
||
58 | * Enqueue the required assets |
||
59 | */ |
||
60 | protected function enqueueAssets(): void |
||
65 | } |
||
66 | } |
||
67 |