aboutsummaryrefslogtreecommitdiffhomepage
path: root/inc/poche/pocheCore.php
diff options
context:
space:
mode:
Diffstat (limited to 'inc/poche/pocheCore.php')
-rw-r--r--inc/poche/pocheCore.php18
1 files changed, 10 insertions, 8 deletions
diff --git a/inc/poche/pocheCore.php b/inc/poche/pocheCore.php
index 52c603ac..34c15d84 100644
--- a/inc/poche/pocheCore.php
+++ b/inc/poche/pocheCore.php
@@ -136,10 +136,16 @@ function fetch_url_content($url)
136 136
137function display_view($view, $id = 0, $full_head = 'yes') 137function display_view($view, $id = 0, $full_head = 'yes')
138{ 138{
139 global $tpl, $store, $msg; 139 global $tpl, $store;
140 140
141 switch ($view) 141 switch ($view)
142 { 142 {
143 case 'install':
144 pocheTool::logm('install mode');
145 break;
146 case 'import';
147 pocheTool::logm('import mode');
148 break;
143 case 'export': 149 case 'export':
144 $entries = $store->retrieveAll(); 150 $entries = $store->retrieveAll();
145 $tpl->assign('export', pocheTool::renderJson($entries)); 151 $tpl->assign('export', pocheTool::renderJson($entries));
@@ -157,8 +163,8 @@ function display_view($view, $id = 0, $full_head = 'yes')
157 break; 163 break;
158 case 'view': 164 case 'view':
159 $entry = $store->retrieveOneById($id); 165 $entry = $store->retrieveOneById($id);
160
161 if ($entry != NULL) { 166 if ($entry != NULL) {
167 pocheTool::logm('view link #' . $id);
162 $tpl->assign('id', $entry['id']); 168 $tpl->assign('id', $entry['id']);
163 $tpl->assign('url', $entry['url']); 169 $tpl->assign('url', $entry['url']);
164 $tpl->assign('title', $entry['title']); 170 $tpl->assign('title', $entry['title']);
@@ -177,12 +183,9 @@ function display_view($view, $id = 0, $full_head = 'yes')
177 else { 183 else {
178 pocheTool::logm('error in view call : entry is NULL'); 184 pocheTool::logm('error in view call : entry is NULL');
179 } 185 }
180
181 pocheTool::logm('view link #' . $id);
182 break; 186 break;
183 default: # home view 187 default: # home view
184 $entries = $store->getEntriesByView($view); 188 $entries = $store->getEntriesByView($view);
185
186 $tpl->assign('entries', $entries); 189 $tpl->assign('entries', $entries);
187 190
188 if ($full_head == 'yes') { 191 if ($full_head == 'yes') {
@@ -192,7 +195,6 @@ function display_view($view, $id = 0, $full_head = 'yes')
192 } 195 }
193 196
194 $tpl->draw('entries'); 197 $tpl->draw('entries');
195
196 if ($full_head == 'yes') { 198 if ($full_head == 'yes') {
197 $tpl->draw('js'); 199 $tpl->draw('js');
198 $tpl->draw('footer'); 200 $tpl->draw('footer');
@@ -202,11 +204,11 @@ function display_view($view, $id = 0, $full_head = 'yes')
202} 204}
203 205
204/** 206/**
205 * Appel d'une action (mark as fav, archive, delete) 207 * Call action (mark as fav, archive, delete, etc.)
206 */ 208 */
207function action_to_do($action, $url, $id = 0) 209function action_to_do($action, $url, $id = 0)
208{ 210{
209 global $store, $msg; 211 global $store;
210 212
211 switch ($action) 213 switch ($action)
212 { 214 {