From: x2003bruneau Date: Thu, 13 Jul 2006 09:25:27 +0000 (+0000) Subject: Fix xface with last banana and make white region transparent X-Git-Tag: xorg/0.9.11~442 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=7e6495d42e104f9d85561ba58f0bf4d1eb7fce94;hp=1df71310ac4d12fb4c69434ff7d9a792ff7392be;p=platal.git Fix xface with last banana and make white region transparent Fix updateall behaviour git-svn-id: svn+ssh://murphy/home/svn/platal/trunk@458 839d8a87-29fc-0310-9880-83ba4fa771e5 --- diff --git a/htdocs/javascript/xorg.js b/htdocs/javascript/xorg.js index eb7a6d6..66923c1 100644 --- a/htdocs/javascript/xorg.js +++ b/htdocs/javascript/xorg.js @@ -63,6 +63,30 @@ function attachEvent(obj, evt, f, useCapture) { } // }}} +// {{{ dynpost() + +function dynpost(action, values) +{ + var body = document.getElementsByTagName('body')[0]; + + var form = document.createElement('form'); + form.action = action; + form.method = 'post'; + + body.appendChild(form); + + for (var k in values) { + var input = document.createElement('input'); + input.type = 'hidden'; + input.name = k; + input.value = values[k]; + form.appendChild(input); + } + + form.submit(); +} + +// }}} /*************************************************************************** * POPUP THINGS diff --git a/include/banana.inc.php b/include/banana.inc.php index 56f9894..4f009f8 100644 --- a/include/banana.inc.php +++ b/include/banana.inc.php @@ -44,7 +44,7 @@ function hook_makeLink($params) { return $base . '/subscription'; } if (isset($params['xface'])) { - return $base . '/xface/' . $params['xface']; + return $base . '/xface/' . strtr(base64_encode($params['xface']), '+/', '.:'); } if (!isset($params['group'])) { diff --git a/modules/banana.php b/modules/banana.php index fa6576b..4e7aee9 100644 --- a/modules/banana.php +++ b/modules/banana.php @@ -27,7 +27,6 @@ class BananaModule extends PLModule 'banana' => $this->make_hook('banana', AUTH_COOKIE), 'banana/profile' => $this->make_hook('profile', AUTH_MDP), 'banana/subscription' => $this->make_hook('subscription', AUTH_COOKIE), - 'banana/updateall' => $this->make_hook('updateall', AUTH_COOKIE), 'banana/xface' => $this->make_hook('xface', AUTH_COOKIE), ); } @@ -38,6 +37,9 @@ class BananaModule extends PLModule if (!is_null($group)) { $get['group'] = $group; } + if (Post::has('updateall')) { + $get['banana'] = 'updateall'; + } if (!is_null($action)) { if ($action == 'new') { $get['action'] = 'new'; @@ -94,25 +96,17 @@ class BananaModule extends PLModule return PL_OK; } - function handler_updateall(&$page) - { - return BananaModule::run_banana($page, Array('banana' => 'updateall')); - } - function handler_subscription(&$page) { return $this->run_banana($page, Array('subscribe' => 1)); } - function handler_xface() + function handler_xface(&$page, $face = null) { - $args = func_get_args(); - array_shift($args); - $face = join('/', $args); header('Content-Type: image/jpeg'); - passthru('echo ' . escapeshellarg(base64_decode($face)) + passthru('echo ' . escapeshellarg(base64_decode(strtr($face, '.:', '+/'))) . '| uncompface -X ' - . '| convert xbm:- jpg:-'); + . '| convert -transparent white xbm:- gif:-'); return PL_OK; } diff --git a/templates/banana/index.tpl b/templates/banana/index.tpl index f2315c9..27c8385 100644 --- a/templates/banana/index.tpl +++ b/templates/banana/index.tpl @@ -23,7 +23,7 @@

Options

{if !$banana->profile.autoup} -[Mettre à jour] +[Mettre à jour] {/if} [Profil]