summaryrefslogtreecommitdiff
path: root/tpl/notes
diff options
context:
space:
mode:
Diffstat (limited to 'tpl/notes')
-rw-r--r--tpl/notes/edit.php6
-rw-r--r--tpl/notes/inc_relativestree.php93
-rw-r--r--tpl/notes/move.php4
-rw-r--r--tpl/notes/user.php6
-rw-r--r--tpl/notes/view.php8
5 files changed, 15 insertions, 102 deletions
diff --git a/tpl/notes/edit.php b/tpl/notes/edit.php
index 7e4d88f..54f5157 100644
--- a/tpl/notes/edit.php
+++ b/tpl/notes/edit.php
@@ -2,13 +2,13 @@
require("tpl/general/top.php");
-echo '<div class="small_right"><a href="view-notes-' . $note['id'] . '">return to note</a></div>';
+echo '<div class="small_right"><a href="view-notes-' . $note['id'] . '">revenir à la note</a></div>';
require("tpl/general/inc_form.php");
if (isset($preview)) {
- echo '<hr /><h1>Preview</h1>';
- echo' <div class="error">Warning : this is only a preview. Click the "Edit note" button above to save changes.</div>';
+ echo '<hr /><h1>Aperçu</h1>';
+ echo '<div class="error">Attention : ceci n\'est qu\'un aperçu ! Pensez à enregistrer vos changements lorsque vous serez satisfait.</div>';
echo $preview;
}
diff --git a/tpl/notes/inc_relativestree.php b/tpl/notes/inc_relativestree.php
index be0e224..fd47ab4 100644
--- a/tpl/notes/inc_relativestree.php
+++ b/tpl/notes/inc_relativestree.php
@@ -1,92 +1,5 @@
<?php
-/* OLD WAY
-
-// ******* FETCH DATA
-
-if ($note['parent_id'] != 0) {
- $brothers = array();
- $n = sql("SELECT id, title, owner FROM notes WHERE parent = " . $note['parent_id'] . " ".
- ($note['owner'] == $user['id'] ? "" : " AND public != 0 ").
- "ORDER BY title ASC");
- while ($nn = mysql_fetch_assoc($n)) $brothers[] = $nn;
-}
-$children = array();
-$n = sql("SELECT id, title, owner FROM notes WHERE parent = " . $note['id'] . " " .
- ($note['owner'] == $user['id'] ? "" : " AND public != 0 ") .
- "ORDER BY title ASC");
-while ($nn = mysql_fetch_assoc($n)) $children[] = $nn;
-
-$user_root_notes = array();
-$n = sql("SELECT id, title, owner FROM notes WHERE parent = 0 AND owner = " . $note['owner'] . " " .
- ($note['owner'] == $user['id'] ? "" : " AND public != 0 ") .
- "ORDER BY title ASC");
-while ($nn = mysql_fetch_assoc($n)) $user_root_notes[] = $nn;
-
-// ****** DISPLAY TREE
-
-echo '</div><div class="contents-left">';
-echo '<h1>' . $note['ownername'] . '</h1><br />';
-echo '<div class="small_right"><a href="user-notes-' . $note['owner'] . '">complete tree</a></div>';
-
-function list_brothers_and_children() {
- global $brothers, $children, $note, $user, $can_new;
- echo '<div class="tree_branch">';
- foreach($brothers as $b) {
- if ($b['id'] == $note['id']) {
- echo '<p>' . $b['title'] . '</p><div class="tree_branch">';
- foreach($children as $nn) {
- echo '<p><a href="view-notes-' . $nn['id'] . '">' . $nn['title'] . '</a></p>';
- }
- if ($can_new) {
- echo '<p><a class="tool_link" href="new-notes-' . $b['id'] . '">+ new note</a></p>';
- }
- echo '</div>';
- } else {
- echo '<p><a href="view-notes-' . $b['id'] .'">' . $b['title'] . '</a></p>';
- }
- }
- if ($can_new) {
- echo '<p><a class="tool_link" href="new-notes-' . $note['parent_id'] . '">+ new note</a></p>';
- }
- echo '</div>';
-}
-
-echo '<div class="tree_branch">';
-$did_show_up = false;
-foreach($user_root_notes as $n) {
- if ($n['id'] == $note['id']) {
- $did_show_up = true;
- echo '<p>' . $n['title'] . '</p><div class="tree_branch">';
- foreach($children as $nn) {
- echo '<p><a href="view-notes-' . $nn['id'] . '">' . $nn['title'] . '</a></p>';
- }
- if ($can_new) {
- echo '<p><a class="tool_link" href="new-notes-' . $note['id'] . '">+ new note</a></p>';
- }
- echo '</div>';
- } else {
- echo '<p><a href="view-notes-' . $n['id'] . '">' . $n['title'] . '</a></p>';
- if ($n['id'] == $note['parent_id']) {
- $did_show_up = true;
- list_brothers_and_children();
- }
- }
-}
-if ($can_new) {
- echo '<p><a class="tool_link" href="new-notes-0">+ new note</a></p>';
-}
-echo '</div>';
-
-if (!$did_show_up) {
- echo '<br /><br />';
- echo '<a href="view-notes-' . $note['parent_id'] . '">' . $note['parent_title'] . '</a>';
- list_brothers_and_children();
-}
-
-*/
-
-// *** NEW WAY
$notes_tree = array();
$notes_parents = array();
@@ -110,7 +23,7 @@ for($id = $note['id']; $id != 0; $id = $notes_parents[$id]) {
echo '</div><div class="contents-left">';
echo '<h1>' . $note['ownername'] . '</h1><br />';
-echo '<div class="small_right"><a href="user-notes-' . $note['owner'] . '">complete tree</a></div>';
+echo '<div class="small_right"><a href="user-notes-' . $note['owner'] . '">voir tout</a></div>';
function n_tree_branch($id) {
global $notest, $note, $can_new;
@@ -126,11 +39,11 @@ function n_tree_branch($id) {
echo '</div>';
} else if ($can_new && $branch['id'] == $note['id']) {
echo '<div class="tree_branch">';
- if ($can_new) echo '<p><a class="tool_link" href="new-notes-' . $branch['id'] . '">+ new note</a></p>';
+ if ($can_new) echo '<p><a class="tool_link" href="new-notes-' . $branch['id'] . '">+ nouvelle note</a></p>';
echo '</div>';
}
}
- if ($can_new) echo '<p><a class="tool_link" href="new-notes-' . $id . '">+ new note</a></p>';
+ if ($can_new) echo '<p><a class="tool_link" href="new-notes-' . $id . '">+ nouvelle note</a></p>';
}
echo '<div class="tree_root">';
diff --git a/tpl/notes/move.php b/tpl/notes/move.php
index d94e745..985b89a 100644
--- a/tpl/notes/move.php
+++ b/tpl/notes/move.php
@@ -4,12 +4,12 @@ require("tpl/general/top.php");
function f($n) {
global $note;
- return $n['title'] . ' - <a class="tool_link" href="move-notes-' . $note['id'] . '-' . $n['id'] . '">move here</a>';
+ return $n['title'] . ' - <a class="tool_link" href="move-notes-' . $note['id'] . '-' . $n['id'] . '">déplacer ici</a>';
}
require("tpl/general/inc_tree.php");
tree($notes_tree, @f);
-echo '<a class="tool_link" href="move-notes-'.$note['id'].'-0">move to root</a>';
+echo '<a class="tool_link" href="move-notes-'.$note['id'].'-0">déplacer à la racine</a>';
$can_new = false;
require("tpl/notes/inc_relativestree.php");
diff --git a/tpl/notes/user.php b/tpl/notes/user.php
index 4da34e9..06099ac 100644
--- a/tpl/notes/user.php
+++ b/tpl/notes/user.php
@@ -1,5 +1,5 @@
<?php
-$title = $note_owner['name'] . "'s notebook";
+$title = "Bloc-notes de " . $note_owner['name'] ;
require("tpl/general/top.php");
function f($n) {
@@ -9,11 +9,11 @@ function f($n) {
require("tpl/general/inc_tree.php");
tree($notes_tree, @f);
if ($note_owner['id'] == $user['id']) {
- echo '<a class="tool_link" href="new-notes-0">create new note</a>';
+ echo '<a class="tool_link" href="new-notes-0">nouvelle note</a>';
}
echo '</div><div class="contents-left">';
-echo '<h1>Other users</h1>';
+echo '<h1>Autres bloc-notes</h1>';
echo "<ul>";
foreach($users as $u) {
if ($u['id'] == $userid) {
diff --git a/tpl/notes/view.php b/tpl/notes/view.php
index c33e836..7615fe3 100644
--- a/tpl/notes/view.php
+++ b/tpl/notes/view.php
@@ -6,10 +6,10 @@ $t = array();
if ($note['parent_id'] != 0) {
$t[] = 'parent : <a href="view-notes-'. $note['parent_id'] . '">' . $note['parent_title'] . '</a>';
}
-if ($can_edit) $t[] = '<a href="edit-notes-' . $note['id'] . '">edit</a>';
-$t[] = '<a href="source-notes-' . $note['id'] . '">view source</a>';
-if ($can_move) $t[] = '<a href="move-notes-' . $note['id'] . '">move</a>';
-if ($can_delete) $t[] = '<a href="delete-notes-' . $note['id'] . '">delete</a>';
+if ($can_edit) $t[] = '<a href="edit-notes-' . $note['id'] . '">modifier</a>';
+$t[] = '<a href="source-notes-' . $note['id'] . '">code source</a>';
+if ($can_move) $t[] = '<a href="move-notes-' . $note['id'] . '">déplacer</a>';
+if ($can_delete) $t[] = '<a href="delete-notes-' . $note['id'] . '">supprimer</a>';
echo '<div class="small_right">' . implode(' | ', $t) . '</div>';
echo $note['html'];