Scrutinizer GitHub App not installed

We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.

Install GitHub App

GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Passed
Push — master ( 14584b...f60880 )
by Sebastian
02:42
created

Calendar::main()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 2
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
namespace Kitodo\Dlf\Plugin;
3
4
/**
5
 * (c) Kitodo. Key to digital objects e.V. <[email protected]>
6
 *
7
 * This file is part of the Kitodo and TYPO3 projects.
8
 *
9
 * @license GNU General Public License version 3 or later.
10
 * For the full copyright and license information, please read the
11
 * LICENSE.txt file that was distributed with this source code.
12
 */
13
14
use Kitodo\Dlf\Common\Helper;
15
16
/**
17
 * Plugin 'Calendar' for the 'dlf' extension
18
 *
19
 * @author Alexander Bigga <[email protected]>
20
 * @package TYPO3
21
 * @subpackage dlf
22
 * @access public
23
 */
24
class Calendar extends \Kitodo\Dlf\Common\AbstractPlugin {
25
    public $scriptRelPath = 'Classes/Plugin/Calendar.php';
26
27
    /**
28
     * The main method of the PlugIn
29
     *
30
     * @access public
31
     *
32
     * @param string $content: The PlugIn content
33
     * @param array $conf: The PlugIn configuration
34
     *
35
     * @return string The content that is displayed on the website
36
     */
37
    public function main($content, $conf) {
38
        // Nothing to do here.
39
        return $content;
40
    }
41
42
    /**
43
     * The Calendar Method
44
     *
45
     * @access public
46
     *
47
     * @param string $content: The PlugIn content
48
     * @param array $conf: The PlugIn configuration
49
     *
50
     * @return string The content that is displayed on the website
51
     */
52
    public function calendar($content, $conf) {
53
        $this->init($conf);
54
        // Load current document.
55
        $this->loadDocument();
56
        if ($this->doc === NULL) {
57
            // Quit without doing anything if required variables are not set.
58
            return $content;
59
        }
60
        // Load template file.
61
        $this->getTemplate('###TEMPLATECALENDAR###');
62
        // Get all children of year anchor.
63
        $result = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
64
            'tx_dlf_documents.uid AS uid, tx_dlf_documents.title AS title, tx_dlf_documents.year AS year',
65
            'tx_dlf_documents',
66
            'tx_dlf_documents.structure='.Helper::getUidFromIndexName('issue', 'tx_dlf_structures', $this->doc->pid)
0 ignored issues
show
Bug Best Practice introduced by
The property $pid is declared protected in Kitodo\Dlf\Common\Document. Since you implement __get, consider adding a @property or @property-read.
Loading history...
67
                .' AND tx_dlf_documents.partof='.intval($this->doc->uid)
0 ignored issues
show
Bug Best Practice introduced by
The property $uid is declared protected in Kitodo\Dlf\Common\Document. Since you implement __get, consider adding a @property or @property-read.
Loading history...
68
                .Helper::whereClause('tx_dlf_documents'),
69
            '',
70
            'title ASC',
71
            ''
72
        );
73
        // Process results.
74
        while ($resArray = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result)) {
75
            $issues[] = [
76
                'uid' => $resArray['uid'],
77
                'title' => $resArray['title'],
78
                'year' => $resArray['year']
79
            ];
80
        }
81
        //  We need an array of issues with month number as key.
82
        $calendarIssues = [];
83
        foreach ($issues as $issue) {
0 ignored issues
show
Comprehensibility Best Practice introduced by
The variable $issues does not seem to be defined for all execution paths leading up to this point.
Loading history...
84
            $calendarIssues[date('n', strtotime($issue['year']))][date('j', strtotime($issue['year']))][] = $issue;
85
        }
86
        $allIssues = [];
87
        // Get subpart templates.
88
        $subparts['list'] = $this->cObj->getSubpart($this->template, '###ISSUELIST###');
1 ignored issue
show
Comprehensibility Best Practice introduced by
$subparts was never initialized. Although not strictly required by PHP, it is generally a good practice to add $subparts = array(); before regardless.
Loading history...
Deprecated Code introduced by
The function TYPO3\CMS\Frontend\Conte...tRenderer::getSubpart() has been deprecated: since TYPO3 v8, will be removed in TYPO3 v9, please use the MarkerBasedTemplateService instead. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

88
        $subparts['list'] = /** @scrutinizer ignore-deprecated */ $this->cObj->getSubpart($this->template, '###ISSUELIST###');

This function has been deprecated. The supplier of the function has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.

Loading history...
89
        $subparts['month'] = $this->cObj->getSubpart($this->template, '###CALMONTH###');
0 ignored issues
show
Deprecated Code introduced by
The function TYPO3\CMS\Frontend\Conte...tRenderer::getSubpart() has been deprecated: since TYPO3 v8, will be removed in TYPO3 v9, please use the MarkerBasedTemplateService instead. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

89
        $subparts['month'] = /** @scrutinizer ignore-deprecated */ $this->cObj->getSubpart($this->template, '###CALMONTH###');

This function has been deprecated. The supplier of the function has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.

Loading history...
90
        $subparts['week'] = $this->cObj->getSubpart($subparts['month'], '###CALWEEK###');
0 ignored issues
show
Deprecated Code introduced by
The function TYPO3\CMS\Frontend\Conte...tRenderer::getSubpart() has been deprecated: since TYPO3 v8, will be removed in TYPO3 v9, please use the MarkerBasedTemplateService instead. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

90
        $subparts['week'] = /** @scrutinizer ignore-deprecated */ $this->cObj->getSubpart($subparts['month'], '###CALWEEK###');

This function has been deprecated. The supplier of the function has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.

Loading history...
91
        $subparts['singleday'] = $this->cObj->getSubpart($subparts['list'], '###SINGLEDAY###');
0 ignored issues
show
Deprecated Code introduced by
The function TYPO3\CMS\Frontend\Conte...tRenderer::getSubpart() has been deprecated: since TYPO3 v8, will be removed in TYPO3 v9, please use the MarkerBasedTemplateService instead. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

91
        $subparts['singleday'] = /** @scrutinizer ignore-deprecated */ $this->cObj->getSubpart($subparts['list'], '###SINGLEDAY###');

This function has been deprecated. The supplier of the function has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.

Loading history...
92
        // Build calendar for given year.
93
        $year = date('Y', strtotime($issues[0]['year']));
94
        $subPartContent = '';
95
        for ($i = 0; $i <= 11; $i++) {
96
            $markerArray = [
97
                '###DAYMON_NAME###' => strftime('%a', strtotime('last Monday')),
98
                '###DAYTUE_NAME###' => strftime('%a', strtotime('last Tuesday')),
99
                '###DAYWED_NAME###' => strftime('%a', strtotime('last Wednesday')),
100
                '###DAYTHU_NAME###' => strftime('%a', strtotime('last Thursday')),
101
                '###DAYFRI_NAME###' => strftime('%a', strtotime('last Friday')),
102
                '###DAYSAT_NAME###' => strftime('%a', strtotime('last Saturday')),
103
                '###DAYSUN_NAME###' => strftime('%a', strtotime('last Sunday')),
104
                '###MONTHNAME###'  => strftime('%B', strtotime($year.'-'.($i + 1).'-1'))
105
            ];
106
            // Reset week content of new month.
107
            $subWeekPartContent = '';
108
            $firstOfMonth = strtotime($year.'-'.($i + 1).'-1');
109
            $lastOfMonth = strtotime('last day of', ($firstOfMonth));
110
            $firstOfMonthStart = strtotime('last Monday', $firstOfMonth);
111
            // There are never more than 6 weeks in a month.
112
            for ($j = 0; $j <= 5; $j++) {
113
                $firstDayOfWeek = strtotime('+ '.$j.' Week', $firstOfMonthStart);
114
                $weekArray = [
115
                    '###DAYMON###' => '&nbsp;',
116
                    '###DAYTUE###' => '&nbsp;',
117
                    '###DAYWED###' => '&nbsp;',
118
                    '###DAYTHU###' => '&nbsp;',
119
                    '###DAYFRI###' => '&nbsp;',
120
                    '###DAYSAT###' => '&nbsp;',
121
                    '###DAYSUN###' => '&nbsp;',
122
                ];
123
                // Every week has seven days. ;-)
124
                for ($k = 0; $k <= 6; $k++) {
125
                    $currentDayTime = strtotime('+ '.$k.' Day', $firstDayOfWeek);
126
                    if ($currentDayTime >= $firstOfMonth
127
                        && $currentDayTime <= $lastOfMonth) {
128
                        $dayLinks = '';
129
                        $dayLinksText = [];
130
                        $dayLinksList = '';
131
                        $currentMonth = date('n', $currentDayTime);
132
                        if (is_array($calendarIssues[$currentMonth])) {
133
                            foreach ($calendarIssues[$currentMonth] as $id => $day) {
134
                                if ($id == date('j', $currentDayTime)) {
135
                                    $dayLinks = $id;
136
                                    foreach ($day as $issue) {
137
                                        $dayLinkLabel = empty($issue['title']) ? strftime('%x', $currentDayTime) : $issue['title'];
138
                                        $linkConf = [
139
                                            'useCacheHash' => 1,
140
                                            'parameter' => $this->conf['targetPid'],
141
                                            'additionalParams' => '&'.$this->prefixId.'[id]='.urlencode($issue['uid']),
142
                                            'ATagParams' => ' class="title"',
143
                                        ];
144
                                        $dayLinksText[] = $this->cObj->typoLink($dayLinkLabel, $linkConf);
145
                                        // Save issues for list view.
146
                                        $allIssues[$currentDayTime][] = $this->cObj->typoLink($dayLinkLabel, $linkConf);
147
                                    }
148
                                }
149
                            }
150
                            if (!empty($dayLinksText)) {
151
                                $dayLinksList = '<ul>';
152
                                foreach ($dayLinksText as $link) {
153
                                    $dayLinksList .= '<li>'.$link.'</li>';
154
                                }
155
                                $dayLinksList .= '</ul>';
156
                            }
157
                            $dayLinkDiv = '<div class="issues"><h4>'.strftime('%d', $currentDayTime).'</h4><div>'.$dayLinksList.'</div></div>';
158
                        }
159
                        switch (strftime('%w', strtotime('+ '.$k.' Day', $firstDayOfWeek))) {
160
                            case '0':
161
                                $weekArray['###DAYSUN###'] = ((int) $dayLinks === (int) date('j', $currentDayTime)) ? $dayLinkDiv : strftime('%d', $currentDayTime);
0 ignored issues
show
Comprehensibility Best Practice introduced by
The variable $dayLinkDiv does not seem to be defined for all execution paths leading up to this point.
Loading history...
162
                                break;
163
                            case '1':
164
                                $weekArray['###DAYMON###'] = ((int) $dayLinks === (int) date('j', $currentDayTime)) ? $dayLinkDiv : strftime('%d', $currentDayTime);
165
                                break;
166
                            case '2':
167
                                $weekArray['###DAYTUE###'] = ((int) $dayLinks === (int) date('j', $currentDayTime)) ? $dayLinkDiv : strftime('%d', $currentDayTime);
168
                                break;
169
                            case '3':
170
                                $weekArray['###DAYWED###'] = ((int) $dayLinks === (int) date('j', $currentDayTime)) ? $dayLinkDiv : strftime('%d', $currentDayTime);
171
                                break;
172
                            case '4':
173
                                $weekArray['###DAYTHU###'] = ((int) $dayLinks === (int) date('j', $currentDayTime)) ? $dayLinkDiv : strftime('%d', $currentDayTime);
174
                                break;
175
                            case '5':
176
                                $weekArray['###DAYFRI###'] = ((int) $dayLinks === (int) date('j', $currentDayTime)) ? $dayLinkDiv : strftime('%d', $currentDayTime);
177
                                break;
178
                            case '6':
179
                                $weekArray['###DAYSAT###'] = ((int) $dayLinks === (int) date('j', $currentDayTime)) ? $dayLinkDiv : strftime('%d', $currentDayTime);
180
                                break;
181
                        }
182
                    }
183
                }
184
                // Fill the weeks.
185
                $subWeekPartContent .= $this->cObj->substituteMarkerArray($subparts['week'], $weekArray);
0 ignored issues
show
Deprecated Code introduced by
The function TYPO3\CMS\Frontend\Conte...substituteMarkerArray() has been deprecated: since TYPO3 v8, will be removed in TYPO3 v9, please use the MarkerBasedTemplateService instead. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

185
                $subWeekPartContent .= /** @scrutinizer ignore-deprecated */ $this->cObj->substituteMarkerArray($subparts['week'], $weekArray);

This function has been deprecated. The supplier of the function has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.

Loading history...
186
            }
187
            // Fill the month markers.
188
            $subPartContent .= $this->cObj->substituteMarkerArray($subparts['month'], $markerArray);
0 ignored issues
show
Deprecated Code introduced by
The function TYPO3\CMS\Frontend\Conte...substituteMarkerArray() has been deprecated: since TYPO3 v8, will be removed in TYPO3 v9, please use the MarkerBasedTemplateService instead. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

188
            $subPartContent .= /** @scrutinizer ignore-deprecated */ $this->cObj->substituteMarkerArray($subparts['month'], $markerArray);

This function has been deprecated. The supplier of the function has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.

Loading history...
189
            // Fill the week markers with the week entries.
190
            $subPartContent = $this->cObj->substituteSubpart($subPartContent, '###CALWEEK###', $subWeekPartContent);
0 ignored issues
show
Deprecated Code introduced by
The function TYPO3\CMS\Frontend\Conte...er::substituteSubpart() has been deprecated: since TYPO3 v8, will be removed in TYPO3 v9, please use the MarkerBasedTemplateService instead. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

190
            $subPartContent = /** @scrutinizer ignore-deprecated */ $this->cObj->substituteSubpart($subPartContent, '###CALWEEK###', $subWeekPartContent);

This function has been deprecated. The supplier of the function has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.

Loading history...
191
        }
192
        // Link to years overview
193
        $linkConf = [
194
            'useCacheHash' => 1,
195
            'parameter' => $this->conf['targetPid'],
196
            'additionalParams' => '&'.$this->prefixId.'[id]='.urlencode($this->doc->parentId),
0 ignored issues
show
Bug Best Practice introduced by
The property $parentId is declared protected in Kitodo\Dlf\Common\Document. Since you implement __get, consider adding a @property or @property-read.
Loading history...
197
        ];
198
        $allYearsLink = $this->cObj->typoLink($this->pi_getLL('allYears', '', TRUE).' '.$this->doc->getTitle($this->doc->parentId), $linkConf);
199
        // Link to current year.
200
        $linkConf = [
201
            'useCacheHash' => 1,
202
            'parameter' => $this->conf['targetPid'],
203
            'additionalParams' => '&'.$this->prefixId.'[id]='.urlencode($this->doc->uid),
204
        ];
205
        $yearLink = $this->cObj->typoLink($year, $linkConf);
206
        $subPartContentList = '';
207
        // Prepare list as alternative of the calendar view.
208
        foreach ($allIssues as $dayTime => $issues) {
209
            $markerArrayDay['###DATE_STRING###'] = strftime('%A, %x', $dayTime);
210
            $markerArrayDay['###ITEMS###'] = '';
211
            foreach ($issues as $issue) {
212
                $markerArrayDay['###ITEMS###'] .= $issue;
213
            }
214
            $subPartContentList .= $this->cObj->substituteMarkerArray($subparts['singleday'], $markerArrayDay);
0 ignored issues
show
Deprecated Code introduced by
The function TYPO3\CMS\Frontend\Conte...substituteMarkerArray() has been deprecated: since TYPO3 v8, will be removed in TYPO3 v9, please use the MarkerBasedTemplateService instead. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

214
            $subPartContentList .= /** @scrutinizer ignore-deprecated */ $this->cObj->substituteMarkerArray($subparts['singleday'], $markerArrayDay);

This function has been deprecated. The supplier of the function has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.

Loading history...
215
        }
216
        $this->template = $this->cObj->substituteSubpart($this->template, '###SINGLEDAY###', $subPartContentList);
0 ignored issues
show
Deprecated Code introduced by
The function TYPO3\CMS\Frontend\Conte...er::substituteSubpart() has been deprecated: since TYPO3 v8, will be removed in TYPO3 v9, please use the MarkerBasedTemplateService instead. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

216
        $this->template = /** @scrutinizer ignore-deprecated */ $this->cObj->substituteSubpart($this->template, '###SINGLEDAY###', $subPartContentList);

This function has been deprecated. The supplier of the function has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.

Loading history...
217
        if (count($allIssues) < 6) {
218
            $listViewActive = TRUE;
219
        } else {
220
            $listViewActive = FALSE;
221
        }
222
        $markerArray = [
223
            '###CALENDARVIEWACTIVE###' => $listViewActive ? '' : 'active',
224
            '###LISTVIEWACTIVE###' => $listViewActive ? 'active' : '',
225
            '###CALYEAR###' => $yearLink,
226
            '###CALALLYEARS###' => $allYearsLink,
227
            '###LABEL_CALENDAR###' => $this->pi_getLL('label.view_calendar'),
228
            '###LABEL_LIST_VIEW###' => $this->pi_getLL('label.view_list'),
229
        ];
230
        $this->template = $this->cObj->substituteMarkerArray($this->template, $markerArray);
0 ignored issues
show
Deprecated Code introduced by
The function TYPO3\CMS\Frontend\Conte...substituteMarkerArray() has been deprecated: since TYPO3 v8, will be removed in TYPO3 v9, please use the MarkerBasedTemplateService instead. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

230
        $this->template = /** @scrutinizer ignore-deprecated */ $this->cObj->substituteMarkerArray($this->template, $markerArray);

This function has been deprecated. The supplier of the function has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.

Loading history...
231
        return $this->cObj->substituteSubpart($this->template, '###CALMONTH###', $subPartContent);
0 ignored issues
show
Deprecated Code introduced by
The function TYPO3\CMS\Frontend\Conte...er::substituteSubpart() has been deprecated: since TYPO3 v8, will be removed in TYPO3 v9, please use the MarkerBasedTemplateService instead. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

231
        return /** @scrutinizer ignore-deprecated */ $this->cObj->substituteSubpart($this->template, '###CALMONTH###', $subPartContent);

This function has been deprecated. The supplier of the function has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.

Loading history...
232
    }
233
234
    /**
235
     * The Year Method
236
     *
237
     * @access public
238
     *
239
     * @param string $content: The PlugIn content
240
     * @param array $conf: The PlugIn configuration
241
     *
242
     * @return string The content that is displayed on the website
243
     */
244
    public function years($content, $conf) {
245
        $this->init($conf);
246
        // Load current document.
247
        $this->loadDocument();
248
        if ($this->doc === NULL) {
249
            // Quit without doing anything if required variables are not set.
250
            return $content;
251
        }
252
        // Load template file.
253
        $this->getTemplate('###TEMPLATEYEAR###');
254
        // Get subpart templates
255
        $subparts['year'] = $this->cObj->getSubpart($this->template, '###LISTYEAR###');
1 ignored issue
show
Deprecated Code introduced by
The function TYPO3\CMS\Frontend\Conte...tRenderer::getSubpart() has been deprecated: since TYPO3 v8, will be removed in TYPO3 v9, please use the MarkerBasedTemplateService instead. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

255
        $subparts['year'] = /** @scrutinizer ignore-deprecated */ $this->cObj->getSubpart($this->template, '###LISTYEAR###');

This function has been deprecated. The supplier of the function has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.

Loading history...
Comprehensibility Best Practice introduced by
$subparts was never initialized. Although not strictly required by PHP, it is generally a good practice to add $subparts = array(); before regardless.
Loading history...
256
        // Get the title of the anchor file
257
        $titleAnchor = $this->doc->getTitle($this->doc->uid);
0 ignored issues
show
Bug Best Practice introduced by
The property $uid is declared protected in Kitodo\Dlf\Common\Document. Since you implement __get, consider adding a @property or @property-read.
Loading history...
258
        // Get all children of anchor. This should be the year anchor documents
259
        $result = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
260
            'tx_dlf_documents.uid AS uid, tx_dlf_documents.title AS title',
261
            'tx_dlf_documents',
262
            'tx_dlf_documents.structure='.Helper::getUidFromIndexName('year', 'tx_dlf_structures', $this->doc->pid)
0 ignored issues
show
Bug Best Practice introduced by
The property $pid is declared protected in Kitodo\Dlf\Common\Document. Since you implement __get, consider adding a @property or @property-read.
Loading history...
263
                .' AND tx_dlf_documents.partof='.intval($this->doc->uid)
264
                .Helper::whereClause('tx_dlf_documents'),
265
            '',
266
            'title ASC',
267
            ''
268
        );
269
        // Process results.
270
        while ($resArray = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result)) {
271
            $years[] = [
272
                'title' => $resArray['title'],
273
                'uid' => $resArray['uid']
274
            ];
275
        }
276
        $subYearPartContent = '';
277
        if (count($years) > 0) {
0 ignored issues
show
Comprehensibility Best Practice introduced by
The variable $years does not seem to be defined for all execution paths leading up to this point.
Loading history...
278
            foreach ($years as $year) {
279
                $linkConf = [
280
                    'useCacheHash' => 1,
281
                    'parameter' => $this->conf['targetPid'],
282
                    'additionalParams' => '&'.$this->prefixId.'[id]='.urlencode($year['uid']),
283
                    'title' => $titleAnchor.': '.$year['title']
284
                ];
285
                $yearArray = [
286
                    '###YEARNAME###' => $this->cObj->typoLink($year['title'], $linkConf),
287
                ];
288
                $subYearPartContent .= $this->cObj->substituteMarkerArray($subparts['year'], $yearArray);
0 ignored issues
show
Deprecated Code introduced by
The function TYPO3\CMS\Frontend\Conte...substituteMarkerArray() has been deprecated: since TYPO3 v8, will be removed in TYPO3 v9, please use the MarkerBasedTemplateService instead. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

288
                $subYearPartContent .= /** @scrutinizer ignore-deprecated */ $this->cObj->substituteMarkerArray($subparts['year'], $yearArray);

This function has been deprecated. The supplier of the function has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.

Loading history...
289
            }
290
        }
291
        // link to years overview (should be itself here)
292
        $linkConf = [
293
            'useCacheHash' => 1,
294
            'parameter' => $this->conf['targetPid'],
295
            'additionalParams' => '&'.$this->prefixId.'[id]='.$this->doc->uid,
296
        ];
297
        $allYearsLink = $this->cObj->typoLink($this->pi_getLL('allYears', '', TRUE).' '.$this->doc->getTitle($this->doc->uid), $linkConf);
298
        // Fill markers.
299
        $markerArray = [
300
            '###LABEL_CHOOSE_YEAR###' => $this->pi_getLL('label.please_choose_year'),
301
            '###CALALLYEARS###' => $allYearsLink
302
        ];
303
        $this->template = $this->cObj->substituteMarkerArray($this->template, $markerArray);
0 ignored issues
show
Deprecated Code introduced by
The function TYPO3\CMS\Frontend\Conte...substituteMarkerArray() has been deprecated: since TYPO3 v8, will be removed in TYPO3 v9, please use the MarkerBasedTemplateService instead. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

303
        $this->template = /** @scrutinizer ignore-deprecated */ $this->cObj->substituteMarkerArray($this->template, $markerArray);

This function has been deprecated. The supplier of the function has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.

Loading history...
304
        // Fill the week markers
305
        return $this->cObj->substituteSubpart($this->template, '###LISTYEAR###', $subYearPartContent);
0 ignored issues
show
Deprecated Code introduced by
The function TYPO3\CMS\Frontend\Conte...er::substituteSubpart() has been deprecated: since TYPO3 v8, will be removed in TYPO3 v9, please use the MarkerBasedTemplateService instead. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

305
        return /** @scrutinizer ignore-deprecated */ $this->cObj->substituteSubpart($this->template, '###LISTYEAR###', $subYearPartContent);

This function has been deprecated. The supplier of the function has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.

Loading history...
306
    }
307
}
308