Issues (1270)

index.php (10 issues)

1
<?php
2
3
    set_include_path(dirname(__FILE__)."/include".PATH_SEPARATOR.
4
        get_include_path());
5
6
    require_once "autoload.php";
7
    require_once "sessions.php";
8
    require_once "functions.php";
9
    require_once "sanity_check.php";
10
    require_once "config.php";
11
    require_once "db-prefs.php";
12
13
    if (!init_plugins()) {
14
        return;
15
    }
16
17
    login_sequence();
18
19
    header('Content-Type: text/html; charset=utf-8');
20
21
?>
22
<!DOCTYPE html>
23
<html>
24
<head>
25
	<title>Tiny Tiny RSS</title>
26
    <meta name="viewport" content="initial-scale=1,width=device-width" />
27
28
	<?php if ($_SESSION["uid"]) {
29
        $theme = get_pref("USER_CSS_THEME", false, false);
30
        if ($theme && theme_exists("$theme")) {
31
            echo stylesheet_tag(get_theme_path($theme), 'theme_css');
0 ignored issues
show
Deprecated Code introduced by
The function stylesheet_tag() has been deprecated: Use Twig filter cssTag ( Ignorable by Annotation )

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

31
            echo /** @scrutinizer ignore-deprecated */ stylesheet_tag(get_theme_path($theme), 'theme_css');

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...
32
        }
33
    }
34
35
    print_user_stylesheet()
36
37
    ?>
38
	<style type="text/css">
39
	<?php
40
        foreach (PluginHost::getInstance()->get_plugins() as $n => $p) {
41
            if (method_exists($p, "get_css")) {
42
                echo $p->get_css();
43
            }
44
        }
45
    ?>
46
	</style>
47
48
	<link rel="shortcut icon" type="image/png" href="images/favicon.png"/>
49
	<link rel="icon" type="image/png" sizes="72x72" href="images/favicon-72px.png" />
50
51
	<script>
52
		dojoConfig = {
53
			async: true,
54
			cacheBust: "<?php echo get_scripts_timestamp(); ?>",
55
			packages: [
56
				{ name: "fox", location: "../../js" },
57
			]
58
		};
59
	</script>
60
61
	<?php
62
    foreach (array("lib/prototype.js",
63
                "lib/scriptaculous/scriptaculous.js?load=effects,controls",
64
                "lib/dojo/dojo.js",
65
                "lib/dojo/tt-rss-layer.js",
66
                "js/tt-rss.js",
67
                "js/common.js",
68
                "errors.php?mode=js") as $jsfile) {
69
70
        echo javascript_tag($jsfile);
0 ignored issues
show
Deprecated Code introduced by
The function javascript_tag() has been deprecated: Use Twig filter jsTag ( Ignorable by Annotation )

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

70
        echo /** @scrutinizer ignore-deprecated */ javascript_tag($jsfile);

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...
71
72
    } ?>
73
74
	<script type="text/javascript">
75
		require({cache:{}});
76
	</script>
77
78
	<script type="text/javascript">
79
	<?php
80
        foreach (PluginHost::getInstance()->get_plugins() as $n => $p) {
0 ignored issues
show
Comprehensibility Bug introduced by
$n is overwriting a variable from outer foreach loop.
Loading history...
Comprehensibility Bug introduced by
$p is overwriting a variable from outer foreach loop.
Loading history...
81
            if (method_exists($p, "get_js")) {
82
                $script = $p->get_js();
83
84
                if ($script) {
85
                    echo "try {
86
					    $script
87
					} catch (e) {
88
                        console.warn('failed to initialize plugin JS: $n', e);
89
                    }";
90
                }
91
            }
92
        }
93
94
        init_js_translations();
95
    ?>
96
	</script>
97
98
	<style type="text/css">
99
		@media (prefers-color-scheme: dark) {
100
			body {
101
				background : #303030;
102
			}
103
		}
104
105
		body.css_loading * {
106
			display : none;
107
		}
108
	</style>
109
110
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
111
	<meta name="referrer" content="no-referrer"/>
112
</head>
113
114
<body class="flat ttrss_main ttrss_index css_loading">
115
116
<div id="overlay" style="display : block">
117
	<div id="overlay_inner">
118
		<?php echo __("Loading, please wait...") ?>
119
		<div dojoType="dijit.ProgressBar" places="0" style="width : 300px" id="loading_bar"
120
	     progress="0" maximum="100">
121
		</div>
122
		<noscript><br/><?php print_error('Javascript is disabled. Please enable it.') ?></noscript>
0 ignored issues
show
The call to print_error() has too many arguments starting with 'Javascript is disabled. Please enable it.'. ( Ignorable by Annotation )

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

122
		<noscript><br/><?php /** @scrutinizer ignore-call */ print_error('Javascript is disabled. Please enable it.') ?></noscript>

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. Please note the @ignore annotation hint above.

Loading history...
Deprecated Code introduced by
The function print_error() has been deprecated: Use twig function errorMessage ( Ignorable by Annotation )

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

122
		<noscript><br/><?php /** @scrutinizer ignore-deprecated */ print_error('Javascript is disabled. Please enable it.') ?></noscript>

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...
123
	</div>
124
</div>
125
126
<div id="notify" class="notify"></div>
127
<div id="cmdline" style="display : none"></div>
128
129
<div id="main" dojoType="dijit.layout.BorderContainer">
130
    <div id="feeds-holder" dojoType="dijit.layout.ContentPane" region="leading" style="width : 20%" splitter="true">
131
        <div id="feedlistLoading">
132
            <img src='images/indicator_tiny.gif'/>
133
            <?php echo  __("Loading, please wait..."); ?></div>
134
        <?php
135
            foreach (PluginHost::getInstance()->get_hooks(PluginHost::HOOK_FEED_TREE) as $p) {
0 ignored issues
show
Comprehensibility Bug introduced by
$p is overwriting a variable from outer foreach loop.
Loading history...
136
            echo $p->hook_feed_tree();
137
            }
138
        ?>
139
        <div id="feedTree"></div>
140
    </div>
141
142
    <div dojoType="dijit.layout.BorderContainer" region="center" id="content-wrap">
143
        <div id="toolbar-frame" dojoType="dijit.layout.ContentPane" region="top">
144
            <div id="toolbar" dojoType="fox.Toolbar">
145
146
            <i class="material-icons net-alert" style="display : none"
147
                title="<?php echo __("Communication problem with server.") ?>">error_outline</i>
148
149
            <i class="material-icons log-alert" style="display : none"
150
                 title="<?php echo __("Recent entries found in event log.") ?>">warning</i>
151
152
            <i id="updates-available" class="material-icons icon-new-version" style="display : none"
153
               title="<?php echo __('Updates are available from Git.') ?>">new_releases</i>
154
155
            <?php
156
            foreach (PluginHost::getInstance()->get_hooks(PluginHost::HOOK_MAIN_TOOLBAR_BUTTON) as $p) {
0 ignored issues
show
Comprehensibility Bug introduced by
$p is overwriting a variable from outer foreach loop.
Loading history...
157
                echo $p->hook_main_toolbar_button();
158
            }
159
            ?>
160
161
            <form id="toolbar-headlines" action="" style="order : 10" onsubmit='return false'>
162
163
            </form>
164
165
            <form id="toolbar-main" action="" style="order : 20" onsubmit='return false'>
166
167
            <select name="view_mode" title="<?php echo __('Show articles') ?>"
168
                onchange="App.onViewModeChanged()"
169
                dojoType="fox.form.Select">
170
                <option selected="selected" value="adaptive"><?php echo __('Adaptive') ?></option>
171
                <option value="all_articles"><?php echo __('All Articles') ?></option>
172
                <option value="marked"><?php echo __('Starred') ?></option>
173
                <option value="published"><?php echo __('Published') ?></option>
174
                <option value="unread"><?php echo __('Unread') ?></option>
175
                <option value="has_note"><?php echo __('With Note') ?></option>
176
                <!-- <option value="noscores"><?php echo __('Ignore Scoring') ?></option> -->
177
            </select>
178
179
			<select title="<?php echo __('Sort articles') ?>"
180
                onchange="App.onViewModeChanged()"
181
                dojoType="fox.form.Select" name="order_by">
182
183
				<option selected="selected" value="default"><?php echo __('Default') ?></option>
184
                <option value="feed_dates"><?php echo __('Newest first') ?></option>
185
                <option value="date_reverse"><?php echo __('Oldest first') ?></option>
186
                <option value="title"><?php echo __('Title') ?></option>
187
            </select>
188
189
            <div dojoType="fox.form.ComboButton" onclick="Feeds.catchupCurrent()">
190
                <span><?php echo __('Mark as read') ?></span>
191
                <div dojoType="dijit.DropDownMenu">
192
                    <div dojoType="dijit.MenuItem" onclick="Feeds.catchupCurrent('1day')">
193
                        <?php echo __('Older than one day') ?>
194
                    </div>
195
                    <div dojoType="dijit.MenuItem" onclick="Feeds.catchupCurrent('1week')">
196
                        <?php echo __('Older than one week') ?>
197
                    </div>
198
                    <div dojoType="dijit.MenuItem" onclick="Feeds.catchupCurrent('2week')">
199
                        <?php echo __('Older than two weeks') ?>
200
                    </div>
201
                </div>
202
            </div>
203
204
            </form>
205
206
            <div class="action-chooser" style="order : 30">
207
208
                <?php
209
                    foreach (PluginHost::getInstance()->get_hooks(PluginHost::HOOK_TOOLBAR_BUTTON) as $p) {
0 ignored issues
show
Comprehensibility Bug introduced by
$p is overwriting a variable from outer foreach loop.
Loading history...
210
                            echo $p->hook_toolbar_button();
211
                    }
212
                ?>
213
214
                <div dojoType="fox.form.DropDownButton" class="action-button" title="<?php echo __('Actions...') ?>">
215
					<span><i class="material-icons">menu</i></span>
216
                    <div dojoType="dijit.Menu" style="display: none">
217
                        <div dojoType="dijit.MenuItem" onclick="App.onActionSelected('qmcPrefs')"><?php echo __('Preferences...') ?></div>
218
                        <div dojoType="dijit.MenuItem" onclick="App.onActionSelected('qmcSearch')"><?php echo __('Search...') ?></div>
219
                        <div dojoType="dijit.MenuItem" disabled="1"><?php echo __('Feed actions:') ?></div>
220
                        <div dojoType="dijit.MenuItem" onclick="App.onActionSelected('qmcAddFeed')"><?php echo __('Subscribe to feed...') ?></div>
221
                        <div dojoType="dijit.MenuItem" onclick="App.onActionSelected('qmcEditFeed')"><?php echo __('Edit this feed...') ?></div>
222
                        <div dojoType="dijit.MenuItem" onclick="App.onActionSelected('qmcRemoveFeed')"><?php echo __('Unsubscribe') ?></div>
223
                        <div dojoType="dijit.MenuItem" disabled="1"><?php echo __('All feeds:') ?></div>
224
                        <div dojoType="dijit.MenuItem" onclick="App.onActionSelected('qmcCatchupAll')"><?php echo __('Mark as read') ?></div>
225
                        <div dojoType="dijit.MenuItem" onclick="App.onActionSelected('qmcShowOnlyUnread')"><?php echo __('(Un)hide read feeds') ?></div>
226
                        <div dojoType="dijit.MenuItem" disabled="1"><?php echo __('Other actions:') ?></div>
227
                        <div dojoType="dijit.MenuItem" onclick="App.onActionSelected('qmcToggleWidescreen')"><?php echo __('Toggle widescreen mode') ?></div>
228
                        <div dojoType="dijit.MenuItem" onclick="App.onActionSelected('qmcHKhelp')"><?php echo __('Keyboard shortcuts help') ?></div>
229
230
                        <?php
231
                            foreach (PluginHost::getInstance()->get_hooks(PluginHost::HOOK_ACTION_ITEM) as $p) {
0 ignored issues
show
Comprehensibility Bug introduced by
$p is overwriting a variable from outer foreach loop.
Loading history...
232
                                echo $p->hook_action_item();
233
                            }
234
                        ?>
235
236
                        <?php if (!$_SESSION["hide_logout"]) { ?>
237
                            <div dojoType="dijit.MenuItem" onclick="App.onActionSelected('qmcLogout')"><?php echo __('Logout') ?></div>
238
                        <?php } ?>
239
                    </div>
240
                </div>
241
            </div>
242
        </div> <!-- toolbar -->
243
        </div> <!-- toolbar pane -->
244
        <div id="headlines-wrap-inner" dojoType="dijit.layout.BorderContainer" region="center">
245
            <div id="floatingTitle" style="display : none"></div>
246
            <div id="headlines-frame" dojoType="dijit.layout.ContentPane" tabindex="0"
247
                    region="center">
248
                <div id="headlinesInnerContainer">
249
                    <div class="whiteBox"><?php echo __('Loading, please wait...') ?></div>
250
                </div>
251
            </div>
252
            <div id="content-insert" dojoType="dijit.layout.ContentPane" region="bottom"
253
                style="height : 50%" splitter="true"></div>
254
        </div>
255
    </div>
256
</div>
257
258
</body>
259
</html>
260