aboutsummaryrefslogtreecommitdiffhomepage
path: root/inc/functions.php
diff options
context:
space:
mode:
authornicosomb <nicolas@loeuillet.org>2013-04-19 11:41:12 +0200
committernicosomb <nicolas@loeuillet.org>2013-04-19 11:41:12 +0200
commita1953dff8f39b225b408c3046246e9446a01f305 (patch)
tree70b1989080f5fcf9581dc6aa208664efaeb7b02d /inc/functions.php
parentc00cdfdd3bc8e53750d34c60d13cd2d885c5d4fd (diff)
downloadwallabag-a1953dff8f39b225b408c3046246e9446a01f305.tar.gz
wallabag-a1953dff8f39b225b408c3046246e9446a01f305.tar.zst
wallabag-a1953dff8f39b225b408c3046246e9446a01f305.zip
tout est recentré sur index.php0.1
Diffstat (limited to 'inc/functions.php')
-rw-r--r--inc/functions.php47
1 files changed, 46 insertions, 1 deletions
diff --git a/inc/functions.php b/inc/functions.php
index 13acd36f..ef1fc0e2 100644
--- a/inc/functions.php
+++ b/inc/functions.php
@@ -226,10 +226,55 @@ function remove_directory($directory)
226 } 226 }
227} 227}
228 228
229function display_view($view, $id = 0, $full_head = 'yes')
230{
231 global $tpl;
232
233 switch ($view)
234 {
235 case 'view':
236 $entry = get_article($id);
237
238 if ($entry != NULL) {
239 $tpl->assign('id', $entry[0]['id']);
240 $tpl->assign('url', $entry[0]['url']);
241 $tpl->assign('title', $entry[0]['title']);
242 $tpl->assign('content', $entry[0]['content']);
243 $tpl->assign('is_fav', $entry[0]['is_fav']);
244 $tpl->assign('is_read', $entry[0]['is_read']);
245 $tpl->assign('load_all_js', 0);
246 $tpl->draw('view');
247 }
248 else {
249 logm('error in view call : entry is NULL');
250 }
251
252 logm('view link #' . $id);
253 break;
254 default: # home view
255 $entries = get_entries($view);
256
257 $tpl->assign('entries', $entries);
258
259 if ($full_head == 'yes') {
260 $tpl->assign('load_all_js', 1);
261 $tpl->draw('head');
262 $tpl->draw('home');
263 }
264
265 $tpl->draw('entries');
266
267 if ($full_head == 'yes') {
268 $tpl->draw('js');
269 $tpl->draw('footer');
270 }
271 break;
272 }
273}
274
229/** 275/**
230 * Appel d'une action (mark as fav, archive, delete) 276 * Appel d'une action (mark as fav, archive, delete)
231 */ 277 */
232
233function action_to_do($action, $url, $id = 0) 278function action_to_do($action, $url, $id = 0)
234{ 279{
235 global $db; 280 global $db;