From 7cb40d85a05eb9d16218b9504ee484741e2e92e3 Mon Sep 17 00:00:00 2001 From: Florent Bruneau Date: Sun, 17 Aug 2008 21:23:53 +0200 Subject: [PATCH] Move the templates required by the core module in the core. New methods: * PlPage::coreTpl(): same as changeTpl() bug take a tpl from the core * PlPage::getCoreTpl(): return the path to a tpl from the core * template tag {include core=mycoretpl.tpl ...} The "bug" handler require cleanup to be really site independent. Signed-off-by: Florent Bruneau --- classes/plpage.php | 80 ++++++++++---- classes/plset.php | 4 +- classes/pltableeditor.php | 2 +- include/wiki.engine.inc.php | 4 +- modules/core.php | 8 +- templates/403.tpl | 25 +++++ templates/404.tpl | 30 +++++ templates/backtrace.tpl | 80 ++++++++++++++ templates/bug.tpl | 86 +++++++++++++++ templates/csv-importer.tpl | 243 +++++++++++++++++++++++++++++++++++++++++ templates/plset.tpl | 53 +++++++++ templates/plview.multipage.tpl | 84 ++++++++++++++ templates/table-editor.tpl | 160 +++++++++++++++++++++++++++ templates/wiki.help.tpl | 35 ++++++ templates/wiki.tpl | 64 +++++++++++ 15 files changed, 925 insertions(+), 33 deletions(-) create mode 100644 templates/403.tpl create mode 100644 templates/404.tpl create mode 100644 templates/backtrace.tpl create mode 100644 templates/bug.tpl create mode 100644 templates/csv-importer.tpl create mode 100644 templates/plset.tpl create mode 100644 templates/plview.multipage.tpl create mode 100644 templates/table-editor.tpl create mode 100644 templates/wiki.help.tpl create mode 100644 templates/wiki.tpl diff --git a/classes/plpage.php b/classes/plpage.php index 175fc05..5309765 100644 --- a/classes/plpage.php +++ b/classes/plpage.php @@ -72,6 +72,26 @@ abstract class PlPage extends Smarty } // }}} + // {{{ function getCoreTpl() + + public static function getCoreTpl($tpl) + { + global $globals; + return $globals->spoolroot . '/core/templates/' . $tpl; + } + + // }}} + // {{{ function coreTpl() + + /** Use a template from the core. + */ + public function coreTpl($tpl, $type = SKINNED) + { + global $globals; + $this->changeTpl(self::getCoreTpl($tpl), $type); + } + + // }}} // {{{ function raw() public function raw() @@ -93,6 +113,7 @@ abstract class PlPage extends Smarty $this->register_prefilter('trimwhitespace'); $this->register_prefilter('form_force_encodings'); $this->register_prefilter('wiki_include'); + $this->register_prefilter('core_include'); $this->register_prefilter('if_has_perms'); $this->assign('pl_triggers', $this->_errors); $this->assign('pl_errors', $this->nb_errs()); @@ -153,7 +174,9 @@ abstract class PlPage extends Smarty if ($globals->debug & DEBUG_BT) { PlBacktrace::clean(); $this->assign_by_ref('backtraces', PlBacktrace::$bt); - $result = str_replace('@@BACKTRACE@@', $this->fetch('skin/common.backtrace.tpl'), $result); + $result = str_replace('@@BACKTRACE@@', + $this->fetch(self::getCoreTpl('backtrace.tpl')), + $result); } else { $result = str_replace('@@BACKTRACE@@', '', $result); } @@ -312,7 +335,7 @@ abstract class PlPage extends Smarty function escape_xorgDB(&$item, $key) { - if (is_a($item, 'XOrgDBIterator')) { + if ($item instanceof XOrgDBIterator) { $expanded = array(); while ($a = $item->next()) { $expanded[] = $a; @@ -364,32 +387,41 @@ function _to_globals($s) { function at_to_globals($tpl_source, &$smarty) { return preg_replace('/#globals\.([a-zA-Z0-9_.]+?)#/e', '_to_globals(\'\\1\')', $tpl_source); - } +} - // }}} - // {{{ function trimwhitespace +// }}} +// {{{ function trimwhitespace - function trimwhitespace($source, &$smarty) - { - $tags = '(script|pre|textarea)'; - preg_match_all("!<$tags.*?>.*?!ius", $source, $tagsmatches); - $source = preg_replace("!<$tags.*?>.*?!ius", "&&&tags&&&", $source); +function trimwhitespace($source, &$smarty) +{ + $tags = '(script|pre|textarea)'; + preg_match_all("!<$tags.*?>.*?!ius", $source, $tagsmatches); + $source = preg_replace("!<$tags.*?>.*?!ius", "&&&tags&&&", $source); - // remove all leading spaces, tabs and carriage returns NOT - // preceeded by a php close tag. - $source = preg_replace('/((?)\n)[\s]+/m', '\1', $source); - $source = preg_replace("!&&&tags&&&!e", 'array_shift($tagsmatches[0])', $source); + // remove all leading spaces, tabs and carriage returns NOT + // preceeded by a php close tag. + $source = preg_replace('/((?)\n)[\s]+/m', '\1', $source); + $source = preg_replace("!&&&tags&&&!e", 'array_shift($tagsmatches[0])', $source); - return $source; - } + return $source; +} - // }}} - // {{{ function wiki_include +// }}} +// {{{ function wiki_include function wiki_include($source, &$smarty) { + global $globals; return preg_replace('/\{include( [^}]*)? wiki=([^} ]+)(.*?)\}/ui', - '{include\1 file="../spool/wiki.d/cache_\2.tpl"\3 included=1}', + '{include\1 file="' . $globals->spoolroot . '/spool/wiki.d/cache_\2.tpl"\3 included=1}', + $source); +} + +function core_include($source, &$smarty) +{ + global $globals; + return preg_replace('/\{include( [^}]*)? core=([^} ]+)(.*?)\}/ui', + '{include\1 file="' . $globals->spoolroot . '/core/templates/\2"\3}', $source); } @@ -399,11 +431,11 @@ function wiki_include($source, &$smarty) function if_has_perms($source, &$smarty) { $source = preg_replace('/\{if([^}]*) (\!?)hasPerms\(([^)]+)\)([^}]*)\}/', - '{if\1 \2$smarty.session.perms->hasFlagCombination(\3)\4}', - $source); -return preg_replace('/\{if([^}]*) (\!?)hasPerm\(([^)]+)\)([^}]*)\}/', - '{if\1 \2($smarty.session.perms && $smarty.session.perms->hasFlag(\3))\4}', - $source); + '{if\1 \2$smarty.session.perms->hasFlagCombination(\3)\4}', + $source); + return preg_replace('/\{if([^}]*) (\!?)hasPerm\(([^)]+)\)([^}]*)\}/', + '{if\1 \2($smarty.session.perms && $smarty.session.perms->hasFlag(\3))\4}', + $source); } // }}} diff --git a/classes/plset.php b/classes/plset.php index 68a06d5..40183b7 100644 --- a/classes/plset.php +++ b/classes/plset.php @@ -164,7 +164,7 @@ class PlSet if (!isset($args['rechercher'])) { $args['rechercher'] = 'Chercher'; } - $page->changeTpl('core/plset.tpl'); + $page->coreTpl('plset.tpl'); $page->assign('plset_base', $baseurl); $page->assign('plset_mods', $this->mods); $page->assign('plset_mod', $this->mod); @@ -291,7 +291,7 @@ abstract class MultipageView implements PlView $page->assign_by_ref('set', $res); $count = $this->set->count(); $this->pages = intval(ceil($count / $this->entriesPerPage)); - return 'include/plview.multipage.tpl'; + return PlPage::getCoreTpl('plview.multipage.tpl'); } public function args() diff --git a/classes/pltableeditor.php b/classes/pltableeditor.php index d364d0e..b2fd2aa 100644 --- a/classes/pltableeditor.php +++ b/classes/pltableeditor.php @@ -190,7 +190,7 @@ class PLTableEditor // call when done public function apply(PlPage &$page, $action, $id = false) { - $page->changeTpl('core/table-editor.tpl'); + $page->coreTpl('table-editor.tpl'); $list = true; if ($action == 'delete') { S::assert_xsrf_token(); diff --git a/include/wiki.engine.inc.php b/include/wiki.engine.inc.php index c1cbcba..b65abe0 100644 --- a/include/wiki.engine.inc.php +++ b/include/wiki.engine.inc.php @@ -77,7 +77,7 @@ if (Env::v('action') || !$cache_exists) { $wiki_exists = file_exists($wp->filename()); $page =& Platal::page(); -$page->changeTpl('core/wiki.tpl'); +$page->coreTpl('wiki.tpl'); if ($feed) { $wikiAll = str_replace('dc:contributor', 'author', $wikiAll); @@ -99,7 +99,7 @@ if ($feed) { $wikiAll = "

La page de wiki $n n'existe pas. " . "Il te suffit de l'éditer

"; } else { - $page->changeTpl('core/404.tpl'); + $page->coreTpl('404.tpl'); } } diff --git a/modules/core.php b/modules/core.php index b92761c..d025c4a 100644 --- a/modules/core.php +++ b/modules/core.php @@ -51,14 +51,14 @@ class CoreModule extends PLModule { global $globals; header($_SERVER['SERVER_PROTOCOL'] . ' 403 Forbidden'); - $page->changeTpl('core/403.tpl'); + $page->coreTpl('403.tpl'); } function handler_404(&$page) { global $globals, $platal; header($_SERVER['SERVER_PROTOCOL'] . ' 404 Not Found'); - $page->changeTpl('core/404.tpl'); + $page->coreTpl('404.tpl'); $page->assign('near', $platal->near_hook()); } @@ -134,7 +134,7 @@ class CoreModule extends PLModule $location = $_SERVER['HTTP_REFERER']; } - $page->changeTpl('core/bug.tpl', SIMPLE); + $page->coreTpl('bug.tpl', SIMPLE); $page->assign('location', $location); $page->addJsLink('close_on_esc.js'); @@ -162,7 +162,7 @@ class CoreModule extends PLModule function handler_wiki_help(&$page, $action = 'title') { - $page->changeTpl('core/wiki.help.tpl', SIMPLE); + $page->coreTpl('wiki.help.tpl', SIMPLE); $page->assign('wiki_help', MiniWiki::help($action == 'title')); } diff --git a/templates/403.tpl b/templates/403.tpl new file mode 100644 index 0000000..aeea268 --- /dev/null +++ b/templates/403.tpl @@ -0,0 +1,25 @@ +{**************************************************************************} +{* *} +{* Copyright (C) 2003-2008 Polytechnique.org *} +{* http://opensource.polytechnique.org/ *} +{* *} +{* This program is free software; you can redistribute it and/or modify *} +{* it under the terms of the GNU General Public License as published by *} +{* the Free Software Foundation; either version 2 of the License, or *} +{* (at your option) any later version. *} +{* *} +{* This program is distributed in the hope that it will be useful, *} +{* but WITHOUT ANY WARRANTY; without even the implied warranty of *} +{* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *} +{* GNU General Public License for more details. *} +{* *} +{* You should have received a copy of the GNU General Public License *} +{* along with this program; if not, write to the Free Software *} +{* Foundation, Inc., *} +{* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *} +{* *} +{**************************************************************************} + +

Tu n'as pas les permissions nécessaires pour accéder à cette page.

+ +{* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *} diff --git a/templates/404.tpl b/templates/404.tpl new file mode 100644 index 0000000..a606b54 --- /dev/null +++ b/templates/404.tpl @@ -0,0 +1,30 @@ +{**************************************************************************} +{* *} +{* Copyright (C) 2003-2008 Polytechnique.org *} +{* http://opensource.polytechnique.org/ *} +{* *} +{* This program is free software; you can redistribute it and/or modify *} +{* it under the terms of the GNU General Public License as published by *} +{* the Free Software Foundation; either version 2 of the License, or *} +{* (at your option) any later version. *} +{* *} +{* This program is distributed in the hope that it will be useful, *} +{* but WITHOUT ANY WARRANTY; without even the implied warranty of *} +{* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *} +{* GNU General Public License for more details. *} +{* *} +{* You should have received a copy of the GNU General Public License *} +{* along with this program; if not, write to the Free Software *} +{* Foundation, Inc., *} +{* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *} +{* *} +{**************************************************************************} + +

Cette page n'existe pas !!!

+ +{if $near} +

L'adresse suivante semble correspondre à ta demande :
+{icon name="lightbulb" title="Cherchais-tu ?"} {$globals->baseurl}/{$near} +

+{/if} +{* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *} diff --git a/templates/backtrace.tpl b/templates/backtrace.tpl new file mode 100644 index 0000000..7df0dee --- /dev/null +++ b/templates/backtrace.tpl @@ -0,0 +1,80 @@ +{**************************************************************************} +{* *} +{* Copyright (C) 2003-2008 Polytechnique.org *} +{* http://opensource.polytechnique.org/ *} +{* *} +{* This program is free software; you can redistribute it and/or modify *} +{* it under the terms of the GNU General Public License as published by *} +{* the Free Software Foundation; either version 2 of the License, or *} +{* (at your option) any later version. *} +{* *} +{* This program is distributed in the hope that it will be useful, *} +{* but WITHOUT ANY WARRANTY; without even the implied warranty of *} +{* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *} +{* GNU General Public License for more details. *} +{* *} +{* You should have received a copy of the GNU General Public License *} +{* along with this program; if not, write to the Free Software *} +{* Foundation, Inc., *} +{* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *} +{* *} +{**************************************************************************} + +{foreach from=$backtraces key=bt_name item=trace} +
+

+ {if $trace->error}{/if} + Exécution de {$bt_name} : {$trace->traces|@count} actions en {$trace->totaltime|string_format:"%.3f"}s (hover-me pour la trace) + {if $trace->error}{/if} +

+
+{foreach item=query from=$trace->traces} +{if $query.data} +{assign var=cols value=$query.data[0]|@count} +{else} +{assign var=cols value=1} +{/if} + + + + + {if $query.error} + + + + {else} + + + + {/if} +{if $query.data} + + {foreach key=key item=item from=$query.data[0]} + + {/foreach} + + {foreach item=data_row from=$query.data} + + {foreach item=item from=$data_row} + + {/foreach} + + {/foreach} +{/if} +
+ ACTION: +
{$query.action}
+
+
+ ERROR:
+ {$query.error|nl2br} +
+ INFO:
+ {$query.rows} ligne{if $query.rows > 1}s{/if} en {$query.exectime|string_format:"%.3f"}s +
{$key}
{$item}
+{/foreach} +
+
+{/foreach} + +{* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *} diff --git a/templates/bug.tpl b/templates/bug.tpl new file mode 100644 index 0000000..568274d --- /dev/null +++ b/templates/bug.tpl @@ -0,0 +1,86 @@ +{**************************************************************************} +{* *} +{* Copyright (C) 2003-2008 Polytechnique.org *} +{* http://opensource.polytechnique.org/ *} +{* *} +{* This program is free software; you can redistribute it and/or modify *} +{* it under the terms of the GNU General Public License as published by *} +{* the Free Software Foundation; either version 2 of the License, or *} +{* (at your option) any later version. *} +{* *} +{* This program is distributed in the hope that it will be useful, *} +{* but WITHOUT ANY WARRANTY; without even the implied warranty of *} +{* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *} +{* GNU General Public License for more details. *} +{* *} +{* You should have received a copy of the GNU General Public License *} +{* along with this program; if not, write to the Free Software *} +{* Foundation, Inc., *} +{* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *} +{* *} +{**************************************************************************} + + + +
+{if $bug_sent} +

+ Ton message a bien été envoyé au support de {#globals.core.sitename#}, tu devrais en + recevoir une copie d'ici quelques minutes. Nous allons le traiter et y répondre + dans les plus brefs délais. +

+ +
+{else} +
+ {xsrf_token_field} +

Signaler un bug ou demander une amélioration

+
+ +   Sujet : + + +
+ + +
+
+
+ +
+{/if} + +{* vim:set et sws=2 sts=2 sw=2 enc=utf-8: *} diff --git a/templates/csv-importer.tpl b/templates/csv-importer.tpl new file mode 100644 index 0000000..0660a2c --- /dev/null +++ b/templates/csv-importer.tpl @@ -0,0 +1,243 @@ +{**************************************************************************} +{* *} +{* Copyright (C) 2003-2008 Polytechnique.org *} +{* http://opensource.polytechnique.org/ *} +{* *} +{* This program is free software; you can redistribute it and/or modify *} +{* it under the terms of the GNU General Public License as published by *} +{* the Free Software Foundation; either version 2 of the License, or *} +{* (at your option) any later version. *} +{* *} +{* This program is distributed in the hope that it will be useful, *} +{* but WITHOUT ANY WARRANTY; without even the implied warranty of *} +{* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *} +{* GNU General Public License for more details. *} +{* *} +{* You should have received a copy of the GNU General Public License *} +{* along with this program; if not, write to the Free Software *} +{* Foundation, Inc., *} +{* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *} +{* *} +{**************************************************************************} + +{if $form_title} +

{$form_title}

+{/if} + + +
+ {xsrf_token_field} +
+ Import d'un CSV : + {if $csv_page eq 'source'} + Choisir la source + {else} + Choisir la source + {/if} + » + {if $csv_page eq 'values'} + Définir les valeurs + {elseif $smarty.session.csv} + Définir les valeurs + {else} + Définir les valeurs + {/if} + » + {if $csv_page eq 'valid'} + Vérifier et valider + {elseif $csv_action} + Vérifier et valider + {else} + Vérifier et valider + {/if} +
+ {if $csv_page eq 'source'} +
+
+ Entrez les données sous la forme suivante (avec + + comme séparateur) :
+
TITRE1{$smarty.session.csv_separator|default:";"}TITRE2{$smarty.session.csv_separator|default:";"}...
+val1_1{$smarty.session.csv_separator|default:";"}val1_2{$smarty.session.csv_separator|default:";"}...
+val2_1{$smarty.session.csv_separator|default:";"}val2_2{$smarty.session.csv_separator|default:";"}...
+val3_1{$smarty.session.csv_separator|default:";"}val3_2{$smarty.session.csv_separator|default:";"}...
+
+ {elseif $csv_page eq 'values'} +
+ Action à effectuer si l'entrée existe : + +
+ + + + + {if $smarty.session.csv_action eq 'update'} + + {/if} + + {foreach from=$csv_fields item=f} + + + + + {if $smarty.session.csv_action eq 'update'} + + {/if} + + {/foreach} +
ChampValeurMàJ
{$csv_field_desc[$f]|default:$f} + + + + + + + Si + + + + + +
Alors +
Sinon +
+
+ +
+ {elseif $csv_page eq 'valid'} + {if !$csv_done} + + + {foreach from=$csv_fields item=f} + + {/foreach} + + {foreach from=$csv_preview item=assoc} + + {foreach from=$csv_fields item=f} + + {/foreach} + + {/foreach} +
{$csv_field_desc[$f]|default:$f}
{$assoc[$f]}
+ {else} + Les données ont été ajoutées. + {/if} + {/if} + + {if !$csv_done} +
+ + + {if $csv_page eq 'source'} + + {elseif $csv_page eq 'values'} + + {elseif $csv_page eq 'valid'} + + {/if} +
+ {/if} +
+ +{* vim:set et sws=2 sts=2 sw=2 enc=utf-8: *} diff --git a/templates/plset.tpl b/templates/plset.tpl new file mode 100644 index 0000000..a0e4de1 --- /dev/null +++ b/templates/plset.tpl @@ -0,0 +1,53 @@ +{**************************************************************************} +{* *} +{* Copyright (C) 2003-2008 Polytechnique.org *} +{* http://opensource.polytechnique.org/ *} +{* *} +{* This program is free software; you can redistribute it and/or modify *} +{* it under the terms of the GNU General Public License as published by *} +{* the Free Software Foundation; either version 2 of the License, or *} +{* (at your option) any later version. *} +{* *} +{* This program is distributed in the hope that it will be useful, *} +{* but WITHOUT ANY WARRANTY; without even the implied warranty of *} +{* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *} +{* GNU General Public License for more details. *} +{* *} +{* You should have received a copy of the GNU General Public License *} +{* along with this program; if not, write to the Free Software *} +{* Foundation, Inc., *} +{* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *} +{* *} +{**************************************************************************} + +
+

+ {$plset_mods[$plset_mod]} + {if $plset_mods|@count > 1}[ + {assign var=has_prev value=false} + {foreach from=$plset_mods key=mod item=desc name=mods} + {if $mod neq $plset_mod} + {if $has_prev}| {/if} + {$desc} + {assign var=has_prev value=true} + {/if} + {/foreach} + ] + {/if} +

+

+ {if !$plset_count} + Aucune entrée + {elseif $plset_count eq 1} + 1 entrée + {else} + {$plset_count} entrées + {/if} +

+
+ +
+{include file=$plset_content} +
+ +{* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *} diff --git a/templates/plview.multipage.tpl b/templates/plview.multipage.tpl new file mode 100644 index 0000000..edd3313 --- /dev/null +++ b/templates/plview.multipage.tpl @@ -0,0 +1,84 @@ +{**************************************************************************} +{* *} +{* Copyright (C) 2003-2008 Polytechnique.org *} +{* http://opensource.polytechnique.org/ *} +{* *} +{* This program is free software; you can redistribute it and/or modify *} +{* it under the terms of the GNU General Public License as published by *} +{* the Free Software Foundation; either version 2 of the License, or *} +{* (at your option) any later version. *} +{* *} +{* This program is distributed in the hope that it will be useful, *} +{* but WITHOUT ANY WARRANTY; without even the implied warranty of *} +{* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *} +{* GNU General Public License for more details. *} +{* *} +{* You should have received a copy of the GNU General Public License *} +{* along with this program; if not, write to the Free Software *} +{* Foundation, Inc., *} +{* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *} +{* *} +{**************************************************************************} + +{capture name=pages} +{if $plview->pages > 1} + {if $show_bounds}
[{$first} - {$last}] 
{/if} +
+ {if $plview->page neq 1} + {icon name=resultset_first title="Première page"}{* + *}{icon name=resultset_previous title="Page précédente"} + {else} + {icon name=null title=""}{icon name=null title=""} + {/if} + {section name=page loop=$plview->pages+1 start=1} + {if $smarty.section.page.index eq $plview->page} + {$plview->page} + {else} + {$smarty.section.page.index} + {/if} + {/section} + {if $plview->page neq $plview->pages} + {icon name=resultset_next title="Page suivante"}{* + *}{icon name=resultset_last title="Dernière page"} + {else} + {icon name=null title=""}{icon name=null title=""} + {/if} +
+{/if} +{/capture} + +{capture name=order} +{if $plset_count > 1} +
+ Trier par : + {foreach from=$orders key=name item=sort} + [ + {if $name eq $order} + tri ascendant + {$sort.desc} + {elseif $order eq "-$name"} + tri ascendant + {$sort.desc} + {else} + {$sort.desc} + {/if} + ]  + {/foreach} +
+{/if} +{/capture} + + +{$smarty.capture.order|smarty:nodefaults} + +{$smarty.capture.pages|smarty:nodefaults} + +
+ {include file=$plview->templateName()} +
+ +{$smarty.capture.pages|smarty:nodefaults}
+ +{$smarty.capture.order|smarty:nodefaults} + +{* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *} diff --git a/templates/table-editor.tpl b/templates/table-editor.tpl new file mode 100644 index 0000000..e16826e --- /dev/null +++ b/templates/table-editor.tpl @@ -0,0 +1,160 @@ +{**************************************************************************} +{* *} +{* Copyright (C) 2003-2008 Polytechnique.org *} +{* http://opensource.polytechnique.org/ *} +{* *} +{* This program is free software; you can redistribute it and/or modify *} +{* it under the terms of the GNU General Public License as published by *} +{* the Free Software Foundation; either version 2 of the License, or *} +{* (at your option) any later version. *} +{* *} +{* This program is distributed in the hope that it will be useful, *} +{* but WITHOUT ANY WARRANTY; without even the implied warranty of *} +{* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *} +{* GNU General Public License for more details. *} +{* *} +{* You should have received a copy of the GNU General Public License *} +{* along with this program; if not, write to the Free Software *} +{* Foundation, Inc., *} +{* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *} +{* *} +{**************************************************************************} + + +

{$title}

+ +{if $list} + + + + {foreach from=$t->vars item=myval key=myvar}{if $myval.display} + + {/if}{/foreach} + {if !$hideactions} + + {/if} + +{if !$readonly} + + + + +{/if} +{iterate from=$list item=myrow} + +{foreach from=$t->vars item=myval}{if $myval.display} + +{/if}{/foreach} + {if !$hideactions} + + {/if} + +{/iterate} +
{$myval.desc}{if $t->sortfield eq $myvar}{if $t->sortdesc}{icon name="bullet_arrow_down"}{else}{icon name="bullet_arrow_up"}{/if}{/if}action
+ + Nouvelles entrées : ManuellementDepuis un CSV + + + {icon name=add title='nouvelle entrée'} +
+ {assign var="myfield" value=$myval.Field} + {if $myfield eq $t->idfield} + {assign var="idval" value=$myrow.$myfield} + {/if} + {if $myval.Type eq 'timestamp'} + {$myrow.$myfield|date_format:"%x %X"} + {elseif $myval.Type eq 'checkbox'} + + {elseif $myval.Type eq 'ip_address'} + {$myrow.$myfield|uint_to_ip} + {else} + {$myrow.$myfield} + {/if} + + {if !$readonly} + {icon name=page_edit title='éditer'} + {icon name=delete title='supprimer'} + {/if} +
+ +{if ($p_prev > -1) || ($p_next > -1)} + +{/if} + +{elseif $massadd} +{include core=csv-importer.tpl} + +

+back +

+ +{else} + +
+ {xsrf_token_field} + + + + + {foreach from=$t->vars item=myval}{assign var="myfield" value=$myval.Field}{if ($myfield neq $t->idfield) or ($t->idfield_editable)} + + + + + {/if}{/foreach} +
+ {if $id} + modification de l'entrée + {else} + nouvelle entrée + {/if} +
+ {$myval.desc} + + {if $myval.Type eq 'set'} + + {elseif $myval.Type eq 'enum'} + + {elseif ($myval.Type eq 'textarea') or ($myval.Type eq 'varchar200')} + + {elseif ($myval.Type eq 'checkbox')} + + {else} + + {if $myval.Type eq 'timestamp'}jj/mm/aaaa hh:mm:ss{/if} + {if $myval.Type eq 'date'}jj/mm/aaaa{/if} + {if $myval.Type eq 'time'}hh:mm:ss{/if} + {/if} +
+ +

+ +

+ +
+ +

+back +

+ +{/if} + + +{* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *} diff --git a/templates/wiki.help.tpl b/templates/wiki.help.tpl new file mode 100644 index 0000000..216c6d9 --- /dev/null +++ b/templates/wiki.help.tpl @@ -0,0 +1,35 @@ +{**************************************************************************} +{* *} +{* Copyright (C) 2003-2008 Polytechnique.org *} +{* http://opensource.polytechnique.org/ *} +{* *} +{* This program is free software; you can redistribute it and/or modify *} +{* it under the terms of the GNU General Public License as published by *} +{* the Free Software Foundation; either version 2 of the License, or *} +{* (at your option) any later version. *} +{* *} +{* This program is distributed in the hope that it will be useful, *} +{* but WITHOUT ANY WARRANTY; without even the implied warranty of *} +{* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *} +{* GNU General Public License for more details. *} +{* *} +{* You should have received a copy of the GNU General Public License *} +{* along with this program; if not, write to the Free Software *} +{* Foundation, Inc., *} +{* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *} +{* *} +{**************************************************************************} + +

Syntaxe wiki

+ + + + {foreach from=$wiki_help key=syntax item=html} + + + + + {/foreach} +
SyntaxeApparence
{$syntax|nl2br}{$html|smarty:nodefaults}
+ +{* vim:set et sws=2 sts=2 sw=2 enc=utf-8: *} diff --git a/templates/wiki.tpl b/templates/wiki.tpl new file mode 100644 index 0000000..8a76fa3 --- /dev/null +++ b/templates/wiki.tpl @@ -0,0 +1,64 @@ +{**************************************************************************} +{* *} +{* Copyright (C) 2003-2008 Polytechnique.org *} +{* http://opensource.polytechnique.org/ *} +{* *} +{* This program is free software; you can redistribute it and/or modify *} +{* it under the terms of the GNU General Public License as published by *} +{* the Free Software Foundation; either version 2 of the License, or *} +{* (at your option) any later version. *} +{* *} +{* This program is distributed in the hope that it will be useful, *} +{* but WITHOUT ANY WARRANTY; without even the implied warranty of *} +{* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *} +{* GNU General Public License for more details. *} +{* *} +{* You should have received a copy of the GNU General Public License *} +{* along with this program; if not, write to the Free Software *} +{* Foundation, Inc., *} +{* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *} +{* *} +{**************************************************************************} + +{if $canedit || $has_perms} + + + + {if $canedit} + + {/if} + {if $has_perms} + + + + + + + + {/if} + +
+ Voir la page + + Éditer la page + + Historique + + Upload +
+ + + + <-- Droits associés
+{/if} + +{if $text} +{$pmwiki|smarty:nodefaults} +{else} +{include file=$pmwiki_cache} +{/if} +{* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *} -- 2.1.4