Move more templates to the core.
authorFlorent Bruneau <florent.bruneau@polytechnique.org>
Sun, 17 Aug 2008 19:57:09 +0000 (21:57 +0200)
committerFlorent Bruneau <florent.bruneau@polytechnique.org>
Sun, 17 Aug 2008 19:57:09 +0000 (21:57 +0200)
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
core
include/banana/hooks.inc.php
modules/platal.php
modules/profile.php
templates/core/plwizard.tpl [deleted file]
templates/skin/common.content.tpl
templates/skin/common.triggers.tpl [deleted file]

diff --git a/core b/core
index 7cb40d8..9b41ca2 160000 (submodule)
--- a/core
+++ b/core
@@ -1 +1 @@
-Subproject commit 7cb40d85a05eb9d16218b9504ee484741e2e92e3
+Subproject commit 9b41ca2c58fdac3cf09f6a89051d9bc5e81c11d2
index aa44917..71e4aff 100644 (file)
@@ -290,7 +290,7 @@ class PlatalBananaPage extends BananaPage
     {
         $tpl = parent::prepare();
         global $wiz;
-        $wiz = new PlWizard('Banana', 'core/plwizard.tpl', true, false);
+        $wiz = new PlWizard('Banana', PlPage::getCoreTpl('plwizard.tpl'), true, false);
         foreach ($this->pages as $name=>&$mpage) {
             $wiz->addPage($this->handler, $mpage['text'], $name);
         }
index d72c110..767c63e 100644 (file)
@@ -456,7 +456,7 @@ Adresse de secours : " . Post::v('email') : ""));
         }
         $wp = new PlWikiPage($dom . '.Admin');
         $conf = explode('%0a', $wp->getField('text'));
-        $wiz = new PlWizard('Tour d\'horizon', 'core/plwizard.tpl', true);
+        $wiz = new PlWizard('Tour d\'horizon', PlPage::getCoreTpl('plwizard.tpl'), true);
         foreach ($conf as $line) {
             $list = preg_split('/\s*[*|]\s*/', $line, -1, PREG_SPLIT_NO_EMPTY);
             $wiz->addPage('ReviewPage', $list[0], $list[1]);
index 5e1a3cf..224d9ce 100644 (file)
@@ -317,7 +317,7 @@ class ProfileModule extends PLModule
         $page->addJsLink('grades.js');
         $page->addJsLink('profile.js');
         $page->addJsLink('jquery.autocomplete.js');
-        $wiz = new PlWizard('Profil', 'core/plwizard.tpl', true, true);
+        $wiz = new PlWizard('Profil', PlPage::getCoreTpl('plwizard.tpl'), true, true);
         require_once dirname(__FILE__) . '/profile/page.inc.php';
         $wiz->addPage('ProfileGeneral', 'Général', 'general');
         $wiz->addPage('ProfileAddresses', 'Adresses personnelles', 'adresses');
diff --git a/templates/core/plwizard.tpl b/templates/core/plwizard.tpl
deleted file mode 100644 (file)
index df409dd..0000000
+++ /dev/null
@@ -1,106 +0,0 @@
-{**************************************************************************}
-{*                                                                        *}
-{*  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               *}
-{*                                                                        *}
-{**************************************************************************}
-
-<script type="text/javascript">//<![CDATA[
-  {if ($stateless || $id gt $current) && $wiz_ajax}
-  {literal}
-  function changePage(obj, id)
-  {
-    var myUrl = obj.href;
-    $.ajax({ url: myUrl + "/ajax",
-             global: false,
-             dataTye: 'html',
-             error: function(request, error) {
-                      document.location = myUrl;
-                    },
-             success: function(data) {
-                        if (is_IE) {
-                          $(".wiz_tab").removeClass("active");
-                          $("#wiz_tab_" + id).addClass("active");
-                          $(".wiz_content").html(data);
-                          if (typeof wizPage_onLoad == 'function') {
-                              wizPage_onLoad(id);
-                          }
-                          auto_links();
-                        } else {
-                          $(".wiz_content").fadeOut('normal',
-                              function() {
-                                $(".wiz_tab").removeClass("active");
-                                $("#wiz_tab_" + id).addClass("active");
-                                $(".wiz_content").html(data).fadeIn('normal');
-                                if (typeof wizPage_onLoad == 'function') {
-                                  wizPage_onLoad(id);
-                                }
-                                auto_links();
-                              });
-                        }
-                      }
-          });
-    return false;
-  }
-  {/literal}
-  {else}
-  {literal}
-  function changePage(obj)
-  {
-    return true;
-  }
-  {/literal}
-  {/if}
-//]]></script>
-
-<div class="wizard" style="clear: both">
-  <div class="wiz_header">
-    {foreach from=$pages item=title key=id}
-    {if $stateless || $id gt $current}
-    {assign var=tag value="a"}
-    {else}
-    {assign var=tag value="div"}
-    {/if}
-    <{$tag} class="wiz_tab {if $id eq $current}active{/if} {if !$stateless && $current gt $id}grayed{/if}"
-            style="display: block; float: left; width: {$tab_width}%; vertical-align: middle"
-            id="wiz_tab_{$lookup[$id]}"
-            {if $tag eq "a"}
-            href="{$wiz_baseurl}/{$lookup[$id]}"
-            onclick="return changePage(this, '{$lookup[$id]}')"
-            {/if}
-            >
-      <span style="vertical-align: middle">{$title}</span>
-    </{$tag}>
-    {/foreach}
-    <div style="clear: both"></div>
-  </div>
-  <div class="wiz_content" style="clear: both">
-    {include file="skin/common.triggers.tpl"}
-    {include file=$wiz_page}
-  </div>
-</div>
-
-<script type="text/javascript">
-{literal}
-if (typeof wizPage_onLoad == 'function') {
-    wizPage_onLoad({/literal}'{$lookup[$current]}'{literal});
-}
-{/literal}
-</script>
-
-{* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *}
index 4781db6..7823905 100644 (file)
@@ -38,7 +38,7 @@ Nous conseillons très vivement d'utiliser des navigateurs récents, tels
 {/if}
 
 {if !$pl_no_errors || $pl_failure}
-{include file="skin/common.triggers.tpl"}
+{include core=triggers.tpl}
 {/if}
 
 {if !$pl_failure && $pl_tpl}{include file=$pl_tpl}{/if}
diff --git a/templates/skin/common.triggers.tpl b/templates/skin/common.triggers.tpl
deleted file mode 100644 (file)
index 9a507a2..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-{**************************************************************************}
-{*                                                                        *}
-{*  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=$pl_triggers key=type item=triggers}
-{if $triggers|@count}
-<div class="{$type}">
-  <ul>
-    {foreach from=$triggers item=err}
-    <li>{$err|smarty:nodefaults}</li>
-    {/foreach}
-  </ul>
-</div>
-{/if}
-{/foreach}
-
-{* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *}