Index: /extensions/PublicAdmin/include/index.php
===================================================================
--- /extensions/PublicAdmin/include/index.php	(revision 24879)
+++ /extensions/PublicAdmin/include/index.php	(revision 24879)
@@ -0,0 +1,7 @@
+<?php
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: /extensions/PublicAdmin/include/install.inc.php
===================================================================
--- /extensions/PublicAdmin/include/install.inc.php	(revision 24879)
+++ /extensions/PublicAdmin/include/install.inc.php	(revision 24879)
@@ -0,0 +1,22 @@
+<?php
+defined('PHPWG_ROOT_PATH') or die('Hacking attempt!');
+
+function publicadmin_install() 
+{
+  global $conf;
+  
+  if (empty($conf['publicadmin']))
+  {
+    $conf['publicadmin'] = serialize(array());
+  
+    conf_update_param('publicadmin', $conf['publicadmin']);
+  }
+}
+
+function publicadmin_uninstall()
+{
+  global $conf;
+  
+  pwg_query('DELETE FROM `'. CONFIG_TABLE .'` WHERE param = "publicadmin";');
+  unset($conf['publicadmin']);
+}
Index: /extensions/PublicAdmin/include/public_events.inc.php
===================================================================
--- /extensions/PublicAdmin/include/public_events.inc.php	(revision 24879)
+++ /extensions/PublicAdmin/include/public_events.inc.php	(revision 24879)
@@ -0,0 +1,23 @@
+<?php
+defined('PUBLICADMIN_PATH') or die('Hacking attempt!');
+
+function publicadmin_picture_page()
+{
+  global $template, $picture;
+  
+  if (empty($picture['current']['comment']))
+  {
+    $template->assign('COMMENT_IMG', '');
+  }
+  if (empty($picture['current']['date_creation']))
+  {
+    $template->assign('INFO_CREATION_DATE', '(unknown)');
+  }
+  
+  $template->assign(array(
+    'PUBLICADMIN_PATH' => PUBLICADMIN_PATH,
+  ));
+  
+  $template->set_filename('puba_picture', realpath(PUBLICADMIN_PATH . 'template/picture.tpl'));
+  $template->parse('puba_picture');
+}
Index: /extensions/PublicAdmin/index.php
===================================================================
--- /extensions/PublicAdmin/index.php	(revision 24879)
+++ /extensions/PublicAdmin/index.php	(revision 24879)
@@ -0,0 +1,7 @@
+<?php
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: /extensions/PublicAdmin/language/en_UK/description.txt
===================================================================
--- /extensions/PublicAdmin/language/en_UK/description.txt	(revision 24879)
+++ /extensions/PublicAdmin/language/en_UK/description.txt	(revision 24879)
@@ -0,0 +1,1 @@
+Do some admin task from the public pages
Index: /extensions/PublicAdmin/language/en_UK/index.php
===================================================================
--- /extensions/PublicAdmin/language/en_UK/index.php	(revision 24879)
+++ /extensions/PublicAdmin/language/en_UK/index.php	(revision 24879)
@@ -0,0 +1,7 @@
+<?php
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: /extensions/PublicAdmin/language/en_UK/plugin.lang.php
===================================================================
--- /extensions/PublicAdmin/language/en_UK/plugin.lang.php	(revision 24879)
+++ /extensions/PublicAdmin/language/en_UK/plugin.lang.php	(revision 24879)
@@ -0,0 +1,3 @@
+<?php
+
+?>
Index: /extensions/PublicAdmin/language/fr_FR/description.txt
===================================================================
--- /extensions/PublicAdmin/language/fr_FR/description.txt	(revision 24879)
+++ /extensions/PublicAdmin/language/fr_FR/description.txt	(revision 24879)
@@ -0,0 +1,1 @@
+Rend possibles certaines tâches d'aministration depuis la partie publique
Index: /extensions/PublicAdmin/language/fr_FR/index.php
===================================================================
--- /extensions/PublicAdmin/language/fr_FR/index.php	(revision 24879)
+++ /extensions/PublicAdmin/language/fr_FR/index.php	(revision 24879)
@@ -0,0 +1,7 @@
+<?php
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: /extensions/PublicAdmin/language/fr_FR/plugin.lang.php
===================================================================
--- /extensions/PublicAdmin/language/fr_FR/plugin.lang.php	(revision 24879)
+++ /extensions/PublicAdmin/language/fr_FR/plugin.lang.php	(revision 24879)
@@ -0,0 +1,3 @@
+<?php
+
+?>
Index: /extensions/PublicAdmin/language/index.php
===================================================================
--- /extensions/PublicAdmin/language/index.php	(revision 24879)
+++ /extensions/PublicAdmin/language/index.php	(revision 24879)
@@ -0,0 +1,7 @@
+<?php
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: /extensions/PublicAdmin/main.inc.php
===================================================================
--- /extensions/PublicAdmin/main.inc.php	(revision 24879)
+++ /extensions/PublicAdmin/main.inc.php	(revision 24879)
@@ -0,0 +1,48 @@
+<?php 
+/*
+Plugin Name: Public Admin
+Version: auto
+Description: Do some admin task from the public pages
+Plugin URI: auto
+Author: Mistic
+Author URI: http://www.strangeplanet.fr
+*/
+
+defined('PHPWG_ROOT_PATH') or die('Hacking attempt!');
+
+// +-----------------------------------------------------------------------+
+// | Define plugin constants                                               |
+// +-----------------------------------------------------------------------+
+defined('PUBLICADMIN_ID') or define('PUBLICADMIN_ID', basename(dirname(__FILE__)));
+define('PUBLICADMIN_PATH' ,   PHPWG_PLUGINS_PATH . PUBLICADMIN_ID . '/');
+// define('PUBLICADMIN_ADMIN',   get_root_url() . 'admin.php?page=plugin-' . PUBLICADMIN_ID);
+define('PUBLICADMIN_VERSION', 'auto');
+
+
+// +-----------------------------------------------------------------------+
+// | Add event handlers                                                    |
+// +-----------------------------------------------------------------------+
+// add_event_handler('init', 'publicadmin_init');
+
+if (!defined('IN_ADMIN'))
+{
+  include_once(PUBLICADMIN_PATH . 'include/public_events.inc.php');
+  
+  add_event_handler('loc_end_picture', 'publicadmin_picture_page');
+}
+
+
+// +-----------------------------------------------------------------------+
+// | plugin initialization                                                 |
+// +-----------------------------------------------------------------------+
+// function publicadmin_init()
+// {
+  // global $conf, $pwg_loaded_plugins;
+  
+  // include_once(PUBLICADMIN_PATH . 'include/install.inc.php');
+  // request_plugin_update(PUBLICADMIN_ID, PUBLICADMIN_VERSION, 'publicadmin_install');
+  
+  // load_language('plugin.lang', PUBLICADMIN_PATH);
+  
+  // $conf['publicadmin'] = unserialize($conf['publicadmin']);
+// }
Index: /extensions/PublicAdmin/maintain.inc.php
===================================================================
--- /extensions/PublicAdmin/maintain.inc.php	(revision 24879)
+++ /extensions/PublicAdmin/maintain.inc.php	(revision 24879)
@@ -0,0 +1,25 @@
+<?php
+defined('PHPWG_ROOT_PATH') or die('Hacking attempt!');
+
+// defined('PUBLICADMIN_ID') or define('PUBLICADMIN_ID', basename(dirname(__FILE__)));
+// include_once(PHPWG_PLUGINS_PATH . PUBLICADMIN_ID . '/include/install.inc.php');
+
+
+// function plugin_install() 
+// {
+  // publicadmin_install();
+  // define('publicadmin_installed', true);
+// }
+
+// function plugin_activate()
+// {
+  // if (!defined('publicadmin_installed'))
+  // {
+    // publicadmin_install();
+  // }
+// }
+
+// function plugin_uninstall() 
+// {
+  // publicadmin_uninstall();
+// }
Index: /extensions/PublicAdmin/template/index.php
===================================================================
--- /extensions/PublicAdmin/template/index.php	(revision 24879)
+++ /extensions/PublicAdmin/template/index.php	(revision 24879)
@@ -0,0 +1,7 @@
+<?php
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: /extensions/PublicAdmin/template/picture.tpl
===================================================================
--- /extensions/PublicAdmin/template/picture.tpl	(revision 24879)
+++ /extensions/PublicAdmin/template/picture.tpl	(revision 24879)
@@ -0,0 +1,92 @@
+{combine_css path=$PUBLICADMIN_PATH|cat:'template/style.css'}
+
+{footer_script}{literal}
+(function($){
+    var editable = {
+        'name': {
+            type: 'text',
+            selector: '.browsePath h2'
+        },
+        'comment': {
+            type: 'textarea',
+            selector: '.imageComment'
+        },
+        'author': {
+            type: 'text',
+            selector: '#Author.imageInfo dd'
+        },
+        'date_available': {
+            type: 'date',
+            selector: '#datepost.imageInfo dd'
+        },
+        'date_creation': {
+            type: 'date',
+            selector: '#datecreate.imageInfo dd'
+        }
+    };
+    
+    {/literal}
+    $('#imageHeaderBar').append('<div id=publicAdmin><span class=edit>{'Edit'|translate}</span><span class=save>{'Save'|translate}</span><span class=cancel>{'Cancel'|translate}</span></div>');
+    {literal}
+    
+    $('#publicAdmin .edit').on('click', function() {
+        $(this).hide().siblings().show();
+        
+        $.each(editable, function(name, item) {
+            var $item = $(item.selector);
+          
+            switch (item.type) {
+            case 'text':
+                $item.after('<input type=text class=publicAdmin name='+ name +' value="'+ $item.html() +'">');
+                break;
+                
+            case 'textarea':
+                $item.after('<textarea class=publicAdmin name='+ name +'>'+ $item.html() +'</textarea>');
+                break;
+                
+            default:
+                return true;
+            }
+            
+            $item.hide();
+        });
+    });
+    
+    $('#publicAdmin .save').on('click', function() {
+        var y = new PwgWS('{/literal}{$ROOT_URL}{literal}'),
+            data = {
+                image_id: {/literal}{$current.id}{literal},
+                single_value_mode: 'replace',
+                name: $(editable['name'].selector).next().val(),
+                comment: $(editable['comment'].selector).next().val()
+            };
+            
+          if ($(editable['author'].selector).length) {
+              data.author = $(editable['author'].selector).next().val();
+          }
+            
+        y.callService('pwg.images.setInfo', data, {
+            method: 'POST',
+            onFailure: function(num, text) {alert(num + " " + text); },
+            onSuccess: function(result) {
+                $('#publicAdmin .cancel').trigger('click');
+                
+                $.each(data, function(name, content) {
+                    if (!editable[name]) return true;
+                    $(editable[name].selector).html(content);
+                });
+            }
+        });
+    });
+    
+    $('#publicAdmin .cancel').on('click', function() {
+      $('.publicAdmin').each(function() {
+        $(this).prev().show();
+        $(this).remove();
+      });
+      
+      $(this).siblings().addBack().hide().filter('.edit').show();
+    });
+
+}(jQuery));
+{/literal}{/footer_script}
Index: /extensions/PublicAdmin/template/style.css
===================================================================
--- /extensions/PublicAdmin/template/style.css	(revision 24879)
+++ /extensions/PublicAdmin/template/style.css	(revision 24879)
@@ -0,0 +1,44 @@
+#publicAdmin span {
+  color:white;
+  font-weight:bold;
+  padding:3px 8px;
+  border-radius:5px;
+  float:left;
+  margin:0 5px;
+  cursor:pointer;
+}
+
+#publicAdmin .edit {
+  background:blue;
+}
+#publicAdmin .edit:hover {
+  background:#55f;
+}
+#publicAdmin .save {
+  background:green;
+  display:none;
+}
+#publicAdmin .save:hover {
+  background:#585;
+}
+#publicAdmin .cancel {
+  background:red;
+  display:none;
+}
+#publicAdmin .cancel:hover {
+  background:#f55;
+}
+
+textarea.publicAdmin {
+  display:block;
+  width:500px;
+  height:150px;
+  margin:0 auto;
+}
+
+.publicAdmin {
+  box-shadow:0px 0px 10px red;
+  border-radius:5px;
+  z-index:1000;
+  position:relative;
+}
