aboutsummaryrefslogtreecommitdiffhomepage
path: root/inc
diff options
context:
space:
mode:
authornicosomb <nicolas@loeuillet.org>2013-04-15 09:38:41 +0200
committernicosomb <nicolas@loeuillet.org>2013-04-15 09:38:41 +0200
commit8046748b424f95a92ab599ecc973f57eb05246ce (patch)
treee3a2a66569337662a58cf8eba71125f7154c799a /inc
parent3e188a7c8de484a57c05126072f76860c7746b39 (diff)
downloadwallabag-8046748b424f95a92ab599ecc973f57eb05246ce.tar.gz
wallabag-8046748b424f95a92ab599ecc973f57eb05246ce.tar.zst
wallabag-8046748b424f95a92ab599ecc973f57eb05246ce.zip
découpage des vues dans plusieurs fichiers tpl
Diffstat (limited to 'inc')
-rw-r--r--inc/config.php10
-rwxr-xr-xinc/functions.php28
2 files changed, 14 insertions, 24 deletions
diff --git a/inc/config.php b/inc/config.php
index f9a4701e..6d8be9ee 100644
--- a/inc/config.php
+++ b/inc/config.php
@@ -13,4 +13,14 @@ include 'db.php';
13include 'functions.php'; 13include 'functions.php';
14require_once 'Readability.php'; 14require_once 'Readability.php';
15require_once 'Encoding.php'; 15require_once 'Encoding.php';
16require_once 'rain.tpl.class.php';
17
18$db = new db(DB_PATH);
19
20raintpl::$tpl_dir = './tpl/';
21raintpl::$cache_dir = './cache/';
22raintpl::$base_url = get_poche_url();
23raintpl::configure('path_replace', false);
24raintpl::configure('debug', false);
25$tpl = new raintpl();
16?> \ No newline at end of file 26?> \ No newline at end of file
diff --git a/inc/functions.php b/inc/functions.php
index 0b9eb936..ffd400ef 100755
--- a/inc/functions.php
+++ b/inc/functions.php
@@ -3,7 +3,7 @@
3/** 3/**
4 * Permet de générer l'URL de poche pour le bookmarklet 4 * Permet de générer l'URL de poche pour le bookmarklet
5 */ 5 */
6function url() 6function get_poche_url()
7{ 7{
8 $protocol = "http"; 8 $protocol = "http";
9 if(isset($_SERVER['HTTPS'])) { 9 if(isset($_SERVER['HTTPS'])) {
@@ -15,29 +15,6 @@ function url()
15 return $protocol . "://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; 15 return $protocol . "://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
16} 16}
17 17
18/**
19 * Génération de la page "vue d'un article"
20 */
21function generate_page($entry)
22{
23 raintpl::$tpl_dir = './tpl/';
24 raintpl::$cache_dir = "./cache/";
25 raintpl::$base_url = url();
26 raintpl::configure( 'path_replace', false );
27 raintpl::configure('debug', false);
28
29 $tpl = new raintpl();
30
31 $tpl->assign("id", $entry['id']);
32 $tpl->assign("url", $entry['url']);
33 $tpl->assign("title", $entry['title']);
34 $tpl->assign("content", $entry['content']);
35 $tpl->assign("is_fav", $entry['is_fav']);
36 $tpl->assign("is_read", $entry['is_read']);
37
38 $tpl->draw( "index");
39}
40
41// function define to retrieve url content 18// function define to retrieve url content
42function get_external_file($url, $timeout) 19function get_external_file($url, $timeout)
43{ 20{
@@ -111,6 +88,9 @@ function get_external_file($url, $timeout)
111 } 88 }
112} 89}
113 90
91/**
92 * Préparation de l'URL avec récupération du contenu avant insertion en base
93 */
114function prepare_url($url) 94function prepare_url($url)
115{ 95{
116 $parametres = array(); 96 $parametres = array();