From 8c5c6d646a25e0d90a00ea798d18e535533c4814 Mon Sep 17 00:00:00 2001 From: x2001corpet Date: Wed, 21 Mar 2007 22:28:36 +0000 Subject: [PATCH] add jquery script, use it to autoload on xnet when xorg cookie is present git-svn-id: svn+ssh://murphy/home/svn/platal/trunk@1597 839d8a87-29fc-0310-9880-83ba4fa771e5 --- Makefile | 10 +++++++++- include/platal.inc.php | 2 +- modules/xnet.php | 5 ++++- templates/xnet/skin.tpl | 8 ++++++-- 4 files changed, 20 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 230f576..4004963 100644 --- a/Makefile +++ b/Makefile @@ -17,7 +17,7 @@ VCS_FILTER = ! -name .arch-ids ! -name CVS all: build -build: core banana wiki +build: core banana wiki jquery q: @echo -e "Code statistics\n" @@ -102,6 +102,14 @@ htdocs/images/banana: htdocs/css/banana.css: cd $(@D) && ln -sf /usr/share/banana/css/style.css $(@F) +## +## jquery +## + +jquery: htdocs/javascript/jquery.js +htdocs/javascript/jquery.js: + wget http://jquery.com/src/jquery-latest.pack.js -O htdocs/javascript/jquery.js -q + ################################################################################ .PHONY: build dist clean wiki build-wiki banana diff --git a/include/platal.inc.php b/include/platal.inc.php index 8b0b211..2d49ff7 100644 --- a/include/platal.inc.php +++ b/include/platal.inc.php @@ -40,7 +40,7 @@ function __autoload($cls) { $cls = strtolower($cls); $path = dirname(dirname(__FILE__)); - if (!@include "$path/classes/$cls.php") { + if (!include "$path/classes/$cls.php") { if (substr($cls, -1, 3) == 'req') { @include 'validations.inc.php'; return; diff --git a/modules/xnet.php b/modules/xnet.php index 66972df..1f30778 100644 --- a/modules/xnet.php +++ b/modules/xnet.php @@ -200,8 +200,11 @@ class XnetModule extends PLModule function handler_autologin(&$page) { + $allkeys = func_get_args(); + unset($allkeys[0]); + $url = join('/',$allkeys); header("Content-type: text/javascript; charset=utf-8"); - echo '$.ajax({ url: "index?forceXml=1", dataType: "xml", success: function(xml) { $("body").empty(); $("body",xml).prependTo("body"); }});'; + echo '$.ajax({ url: "'.$url.'?forceXml=1", dataType: "xml", success: function(xml) { $("body",xml).insertBefore("body"); $("body:eq(1)").remove(); }});'; exit; } } diff --git a/templates/xnet/skin.tpl b/templates/xnet/skin.tpl index 1babec4..e082b2d 100644 --- a/templates/xnet/skin.tpl +++ b/templates/xnet/skin.tpl @@ -210,8 +210,12 @@ {list_all_my_groups} {if !$smarty.session.auth} -
Me connecter :
- polytechnicien +
Me connecter :
+ polytechnicien + {if $platal->pl_self() neq 'exit'} + + + {/if} {/if} -- 2.1.4