aboutsummaryrefslogtreecommitdiffhomepage
path: root/inc
diff options
context:
space:
mode:
authornicosomb <nicolas@loeuillet.org>2013-04-21 18:42:20 +0200
committernicosomb <nicolas@loeuillet.org>2013-04-21 18:42:20 +0200
commit6f87a19714057e370a6b970bbfb82af5abd968f9 (patch)
treeda361e8de0c275e7ae4735fedff6ce414ecb781d /inc
parent44e77bfa2481090e559b56fd8ffbe5b175ab55ca (diff)
downloadwallabag-6f87a19714057e370a6b970bbfb82af5abd968f9.tar.gz
wallabag-6f87a19714057e370a6b970bbfb82af5abd968f9.tar.zst
wallabag-6f87a19714057e370a6b970bbfb82af5abd968f9.zip
Fixed #64 - nettoyage de MyTool
Diffstat (limited to 'inc')
-rw-r--r--inc/MyTool.class.php9
-rw-r--r--inc/functions.php25
2 files changed, 28 insertions, 6 deletions
diff --git a/inc/MyTool.class.php b/inc/MyTool.class.php
index 8206f3f7..1f5051a4 100644
--- a/inc/MyTool.class.php
+++ b/inc/MyTool.class.php
@@ -1,4 +1,13 @@
1<?php 1<?php
2/**
3 * poche, a read it later open source system
4 *
5 * @category poche
6 * @author Nicolas Lœuillet <support@inthepoche.com>
7 * @copyright 2013
8 * @license http://www.wtfpl.net/ see COPYING file
9 */
10
2class MyTool 11class MyTool
3{ 12{
4 public static function initPhp() 13 public static function initPhp()
diff --git a/inc/functions.php b/inc/functions.php
index abf70a93..ec5b3d6a 100644
--- a/inc/functions.php
+++ b/inc/functions.php
@@ -1,4 +1,12 @@
1<?php 1<?php
2/**
3 * poche, a read it later open source system
4 *
5 * @category poche
6 * @author Nicolas Lœuillet <support@inthepoche.com>
7 * @copyright 2013
8 * @license http://www.wtfpl.net/ see COPYING file
9 */
2 10
3/** 11/**
4 * Permet de générer l'URL de poche pour le bookmarklet 12 * Permet de générer l'URL de poche pour le bookmarklet
@@ -234,7 +242,7 @@ function display_view($view, $id = 0, $full_head = 'yes')
234 { 242 {
235 case 'export': 243 case 'export':
236 $entries = $store->retrieveAll(); 244 $entries = $store->retrieveAll();
237 $tpl->assign('export', json_encode($entries)); 245 $tpl->assign('export', myTool::renderJson($entries));
238 $tpl->draw('export'); 246 $tpl->draw('export');
239 logm('export view'); 247 logm('export view');
240 break; 248 break;
@@ -300,13 +308,18 @@ function action_to_do($action, $url, $id = 0)
300 if ($url == '') 308 if ($url == '')
301 continue; 309 continue;
302 310
303 if($parametres_url = prepare_url($url)) { 311 if (MyTool::isUrl($url)) {
304 $store->add($url, $parametres_url['title'], $parametres_url['content']); 312 if($parametres_url = prepare_url($url)) {
305 $last_id = $store->getLastId(); 313 $store->add($url, $parametres_url['title'], $parametres_url['content']);
306 if (DOWNLOAD_PICTURES) { 314 $last_id = $store->getLastId();
307 $content = filtre_picture($parametres_url['content'], $url, $last_id); 315 if (DOWNLOAD_PICTURES) {
316 $content = filtre_picture($parametres_url['content'], $url, $last_id);
317 }
308 } 318 }
309 } 319 }
320 else {
321 logm($url . ' is not a valid url');
322 }
310 323
311 logm('add link ' . $url); 324 logm('add link ' . $url);
312 break; 325 break;