}
// }}}
+// {{{ 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
return $base . '/subscription';
}
if (isset($params['xface'])) {
- return $base . '/xface/' . $params['xface'];
+ return $base . '/xface/' . strtr(base64_encode($params['xface']), '+/', '.:');
}
if (!isset($params['group'])) {
'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),
);
}
if (!is_null($group)) {
$get['group'] = $group;
}
+ if (Post::has('updateall')) {
+ $get['banana'] = 'updateall';
+ }
if (!is_null($action)) {
if ($action == 'new') {
$get['action'] = 'new';
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;
}
<h1>Options</h1>
{if !$banana->profile.autoup}
-[<a href="{rel}/banana/updateall">Mettre à jour</a>]
+[<a href='javascript:dynpost("{rel}/{$platal->path}", {ldelim}"updateall": 1{rdelim})'>Mettre à jour</a>]
{/if}
[<a href="{rel}/banana/profile">Profil</a>]