Index: /extensions/manage_info_photos/admin.php
===================================================================
--- /extensions/manage_info_photos/admin.php	(revision 30631)
+++ /extensions/manage_info_photos/admin.php	(revision 30631)
@@ -0,0 +1,374 @@
+<?php
+
+if (!defined('PHPWG_ROOT_PATH'))
+    die('Hacking attempt!');
+global $template, $conf, $user;
+include_once(PHPWG_ROOT_PATH . 'admin/include/tabsheet.class.php');
+load_language('plugin.lang', ADD_INFO_PHOTO_PATH);
+$my_base_url = get_admin_plugin_menu_link(__FILE__);
+
+// +-----------------------------------------------------------------------+
+// | Check Access and exit when user status is not ok                      |
+// +-----------------------------------------------------------------------+
+check_status(ACCESS_ADMINISTRATOR);
+
+//-------------------------------------------------------- sections definitions
+if (!isset($_GET['tab']))
+    $page['tab'] = 'define_information';
+else
+    $page['tab'] = $_GET['tab'];
+
+
+if ($page['tab'] != 'iap') {
+    $tabsheet = new tabsheet();
+    $tabsheet->add('addip', l10n('Information\'s organization'), ADD_INFO_PHOTO_ADMIN . '-define_information');
+    //$tabsheet->add('configuration', l10n('Configuration'), ADD_INFO_PHOTO_ADMIN . '-configuration');
+    $tabsheet->select($page['tab']);
+    $tabsheet->assign();
+} else if ($_GET['tab'] == 'iap') {
+
+    $page['active_menu'] = get_active_menu('photo'); // force oppening "Photos" menu block
+
+    /* Basic checks */
+    check_status(ACCESS_ADMINISTRATOR);
+
+    check_input_parameter('image_id', $_GET, false, PATTERN_ID);
+    $id_img = $_GET['image_id'];
+    $admin_photo_base_url = get_root_url() . 'admin.php?page=photo-' . $_GET['image_id'];
+
+    $page['tab'] = 'iap';
+
+    $tabsheet = new tabsheet();
+    $tabsheet->set_id('photo');
+    $tabsheet->select('iap');
+    $tabsheet->assign();
+
+    $template->assign(
+            'gestionD', array(
+        'A' => 'a'
+    ));
+    
+    $PAED = pwg_db_fetch_assoc(pwg_query("SELECT state FROM " . PLUGINS_TABLE . " WHERE id = 'ExtendedDescription';"));
+    if($PAED['state'] == 'active') add_event_handler('AP_render_content', 'get_user_language_desc');
+
+    $tab_add_info_one_photo = tab_add_info_by_photo($_GET['image_id']);
+    if (pwg_db_num_rows($tab_add_info_one_photo)) {
+        while ($info_photos = pwg_db_fetch_assoc($tab_add_info_one_photo)) {
+
+            $d = data_info_photos($id_img, $info_photos['id_info_pho']);
+            $row = pwg_db_fetch_assoc($d);
+
+            $items = array(
+                'IDPHO' => $_GET['image_id'],
+                'IDINFOPHO' => $info_photos['id_info_pho'],
+                'AIPDESIGNATION' => trigger_change('AP_render_content',$info_photos['designation']),
+                'AIPDATA' => $row['data'],
+            );
+
+            $template->append('info_photos', $items);
+        }
+    }
+
+    if (isset($_POST['submitaddinfoimg'])) {
+        foreach ($_POST['data'] AS $id_info_pho => $data) {
+            $q = 'SELECT 1 FROM ' . ADD_INFO_PHOTO_DATA_TABLE . ' WHERE id_img=' . $id_img . ' AND id_info_pho=' . $id_info_pho;
+            $test = pwg_query($q);
+            $row = pwg_db_fetch_assoc($test);
+            if (count($row) > 0) {
+                if ($data != '') {
+                    $query = 'UPDATE ' . $prefixeTable . 'add_info_photos_data SET data="' . $data . '" WHERE id_img=' . $id_img . ' AND id_info_pho=' . $id_info_pho;
+                    pwg_query($query);
+                } else {
+                    $query = 'DELETE FROM ' . $prefixeTable . 'add_info_photos_data WHERE id_img=' . $id_img . ' AND id_info_pho=' . $id_info_pho;
+                    pwg_query($query);
+                }
+            } else if ($data != '') {
+                $query = 'INSERT ' . $prefixeTable . 'add_info_photos_data(id_img,id_info_pho,data) VALUES (' . $id_img . ',' . $id_info_pho . ',"' . $data . '");';
+                pwg_query($query);
+            }
+            
+        }
+        $redirect_url = ADD_INFO_PHOTO_ADMIN . '-iap&amp;image_id=' . $id_img;
+        $_SESSION['page_infos'] = array(l10n('Personal info photo update'));
+        redirect($redirect_url);
+    }
+}
+
+switch ($page['tab']) {
+    case 'define_information':
+        $template->assign(
+                'addinfotemplate', array(
+            'addinfo' => l10n('addinfo'),
+        ));
+        
+    $PAED = pwg_db_fetch_assoc(pwg_query("SELECT state FROM " . PLUGINS_TABLE . " WHERE id = 'ExtendedDescription';"));
+    if($PAED['state'] == 'active') add_event_handler('AP_render_content', 'get_user_language_desc');
+        
+        $admin_base_url = ADD_INFO_PHOTO_ADMIN . '-define_information';
+        $tab_info_photos = tab_info_photos();
+
+        if (pwg_db_num_rows($tab_info_photos)) {
+            while ($info_photos = pwg_db_fetch_assoc($tab_info_photos)) {
+                if($info_photos['id_info_pho']==1){
+                    $items = array(
+                        'IDINFOPHO' => $info_photos['id_info_pho'],
+                        'AIPDESIGNATION' => l10n('Author'),
+                        'AIPORDER' => $info_photos['orderinfo'],
+                        'AIPACTIVE' => $info_photos['active'],
+                        'AIPEDIT' => $info_photos['edit'],
+                        'U_HIDE' => $admin_base_url . '&amp;hide=' . $info_photos['id_info_pho'],
+                        'U_SHOW' => $admin_base_url . '&amp;show=' . $info_photos['id_info_pho'],
+                    );
+                }else if($info_photos['id_info_pho']==2){
+                    $items = array(
+                        'IDINFOPHO' => $info_photos['id_info_pho'],
+                        'AIPDESIGNATION' => l10n('Created on'),
+                        'AIPORDER' => $info_photos['orderinfo'],
+                        'AIPACTIVE' => $info_photos['active'],
+                        'AIPEDIT' => $info_photos['edit'],
+                        'U_HIDE' => $admin_base_url . '&amp;hide=' . $info_photos['id_info_pho'],
+                        'U_SHOW' => $admin_base_url . '&amp;show=' . $info_photos['id_info_pho'],
+                    );
+                }else if($info_photos['id_info_pho']==3){
+                    $items = array(
+                        'IDINFOPHO' => $info_photos['id_info_pho'],
+                        'AIPDESIGNATION' => l10n('Posted on'),
+                        'AIPORDER' => $info_photos['orderinfo'],
+                        'AIPACTIVE' => $info_photos['active'],
+                        'AIPEDIT' => $info_photos['edit'],
+                        'U_HIDE' => $admin_base_url . '&amp;hide=' . $info_photos['id_info_pho'],
+                        'U_SHOW' => $admin_base_url . '&amp;show=' . $info_photos['id_info_pho'],
+                    );
+                }else if($info_photos['id_info_pho']==4){
+                    $items = array(
+                        'IDINFOPHO' => $info_photos['id_info_pho'],
+                        'AIPDESIGNATION' => l10n('Dimensions'),
+                        'AIPORDER' => $info_photos['orderinfo'],
+                        'AIPACTIVE' => $info_photos['active'],
+                        'AIPEDIT' => $info_photos['edit'],
+                        'U_HIDE' => $admin_base_url . '&amp;hide=' . $info_photos['id_info_pho'],
+                        'U_SHOW' => $admin_base_url . '&amp;show=' . $info_photos['id_info_pho'],
+                    );
+                }else if($info_photos['id_info_pho']==5){
+                    $items = array(
+                        'IDINFOPHO' => $info_photos['id_info_pho'],
+                        'AIPDESIGNATION' => l10n('File'),
+                        'AIPORDER' => $info_photos['orderinfo'],
+                        'AIPACTIVE' => $info_photos['active'],
+                        'AIPEDIT' => $info_photos['edit'],
+                        'U_HIDE' => $admin_base_url . '&amp;hide=' . $info_photos['id_info_pho'],
+                        'U_SHOW' => $admin_base_url . '&amp;show=' . $info_photos['id_info_pho'],
+                    );
+                }else if($info_photos['id_info_pho']==6){
+                    $items = array(
+                        'IDINFOPHO' => $info_photos['id_info_pho'],
+                        'AIPDESIGNATION' => l10n('Filesize'),
+                        'AIPORDER' => $info_photos['orderinfo'],
+                        'AIPACTIVE' => $info_photos['active'],
+                        'AIPEDIT' => $info_photos['edit'],
+                        'U_HIDE' => $admin_base_url . '&amp;hide=' . $info_photos['id_info_pho'],
+                        'U_SHOW' => $admin_base_url . '&amp;show=' . $info_photos['id_info_pho'],
+                    );
+                }else if($info_photos['id_info_pho']==7){
+                    $items = array(
+                        'IDINFOPHO' => $info_photos['id_info_pho'],
+                        'AIPDESIGNATION' => l10n('Tags'),
+                        'AIPORDER' => $info_photos['orderinfo'],
+                        'AIPACTIVE' => $info_photos['active'],
+                        'AIPEDIT' => $info_photos['edit'],
+                        'U_HIDE' => $admin_base_url . '&amp;hide=' . $info_photos['id_info_pho'],
+                        'U_SHOW' => $admin_base_url . '&amp;show=' . $info_photos['id_info_pho'],
+                    );
+                }else if($info_photos['id_info_pho']==8){
+                    $items = array(
+                        'IDINFOPHO' => $info_photos['id_info_pho'],
+                        'AIPDESIGNATION' => l10n('Albums'),
+                        'AIPORDER' => $info_photos['orderinfo'],
+                        'AIPACTIVE' => $info_photos['active'],
+                        'AIPEDIT' => $info_photos['edit'],
+                        'U_HIDE' => $admin_base_url . '&amp;hide=' . $info_photos['id_info_pho'],
+                        'U_SHOW' => $admin_base_url . '&amp;show=' . $info_photos['id_info_pho'],
+                    );
+                }else if($info_photos['id_info_pho']==9){
+                    $items = array(
+                        'IDINFOPHO' => $info_photos['id_info_pho'],
+                        'AIPDESIGNATION' => l10n('Visits'),
+                        'AIPORDER' => $info_photos['orderinfo'],
+                        'AIPACTIVE' => $info_photos['active'],
+                        'AIPEDIT' => $info_photos['edit'],
+                        'U_HIDE' => $admin_base_url . '&amp;hide=' . $info_photos['id_info_pho'],
+                        'U_SHOW' => $admin_base_url . '&amp;show=' . $info_photos['id_info_pho'],
+                    );
+                }else if($info_photos['id_info_pho']==10){
+                    $items = array(
+                        'IDINFOPHO' => $info_photos['id_info_pho'],
+                        'AIPDESIGNATION' => l10n('Average'),
+                        'AIPORDER' => $info_photos['orderinfo'],
+                        'AIPACTIVE' => $info_photos['active'],
+                        'AIPEDIT' => $info_photos['edit'],
+                        'U_HIDE' => $admin_base_url . '&amp;hide=' . $info_photos['id_info_pho'],
+                        'U_SHOW' => $admin_base_url . '&amp;show=' . $info_photos['id_info_pho'],
+                    );
+                }else if($info_photos['id_info_pho']==11){
+                    $items = array(
+                        'IDINFOPHO' => $info_photos['id_info_pho'],
+                        'AIPDESIGNATION' => l10n('Who can see this photo?'),
+                        'AIPORDER' => $info_photos['orderinfo'],
+                        'AIPACTIVE' => $info_photos['active'],
+                        'AIPEDIT' => $info_photos['edit'],
+                        'U_HIDE' => $admin_base_url . '&amp;hide=' . $info_photos['id_info_pho'],
+                        'U_SHOW' => $admin_base_url . '&amp;show=' . $info_photos['id_info_pho'],
+                    );
+                }else{
+                    $items = array(
+                        'IDINFOPHO' => $info_photos['id_info_pho'],
+                        'AIPDESIGNATION' => trigger_change('AP_render_content',$info_photos['designation']),
+                        'AIPORDER' => $info_photos['orderinfo'],
+                        'AIPACTIVE' => $info_photos['active'],
+                        'AIPEDIT' => $info_photos['edit'],
+                        'U_DELETE' => $admin_base_url . '&amp;delete=' . $info_photos['id_info_pho'],
+                        'U_EDIT' => $admin_base_url . '&amp;edit=' . $info_photos['id_info_pho'],
+                        'U_HIDE' => $admin_base_url . '&amp;hide=' . $info_photos['id_info_pho'],
+                        'U_SHOW' => $admin_base_url . '&amp;show=' . $info_photos['id_info_pho'],
+                    );
+                }        
+                $template->append('info_photos', $items);
+            }
+        }
+        
+        if (isset($_POST['submitManualOrderInfo'])){
+            
+            asort($_POST['infoOrd'], SORT_NUMERIC);
+            
+            $data = array();
+            foreach ($_POST['infoOrd'] as $id =>$val){
+            
+            $data[] = array('id_info_pho' => $id, 'orderinfo' => $val+1);
+            }
+            $fields = array('primary' => array('id_info_pho'), 'update' => array('orderinfo'));
+            mass_updates(ADD_INFO_PHOTO_TABLE, $fields, $data);
+
+          $page['infos'][] = l10n('Info manual order was saved');
+          redirect($admin_base_url);
+        }
+        
+        if (isset($_POST['submitaddinfo'])) {
+            $template->assign(
+                    'addinfo_edit2', array(
+                'info' => l10n('info_name'),
+                'AIPID' => 0,
+            ));
+        }
+        if (isset($_POST['submitaddAIP'])) {
+            if (!isset($_POST['inseractive'])) {
+                $_POST['inseractive'] = 0;
+            }
+            if ($_POST['invisibleID'] == 0) {
+                $result = pwg_query('SELECT MAX(orderinfo) FROM piwigo_add_info_photos');
+                $row = pwg_db_fetch_assoc($result);
+                $or = ($row['MAX(orderinfo)'] + 1);
+
+                $q = '
+                INSERT INTO ' . $prefixeTable . 'Add_Info_photos(designation,orderinfo,active,edit)VALUES ("' . $_POST['inserdesignation'] . '","' . $or . '","' . $_POST['inseractive'] . '",1);';
+                pwg_query($q);
+                $_SESSION['page_infos'] = array(l10n('Personal info photo add'));
+            } else {
+                $q = '
+                UPDATE ' . $prefixeTable . 'Add_Info_photos'
+                        . ' set designation ="' . $_POST['inserdesignation'] . '" '
+                        . ' ,active=' . $_POST['inseractive']
+                        . ' WHERE id_info_pho=' . $_POST['invisibleID'] . ';';
+                pwg_query($q);
+                $_SESSION['page_infos'] = array(l10n('Personal info photo update'));
+            }
+            redirect($admin_base_url);
+        }
+
+        if (isset($_GET['edit'])) {
+            check_input_parameter('edit', $_GET, false, PATTERN_ID);
+
+            $result = tab_info_photos($_GET['edit']);
+            $row = pwg_db_fetch_assoc($result);
+            $template->assign(
+                    'addinfo_edit2', array(
+                'AIPID' => $row['id_info_pho'],
+                'AIPDESC' => $row['designation'],
+                'AIPACTIF' => $row['active'],
+            ));
+        }
+
+        if (isset($_GET['delete'])) {
+            check_input_parameter('delete', $_GET, false, PATTERN_ID);
+            $query = 'DELETE FROM ' . ADD_INFO_PHOTO_TABLE . ' WHERE id_info_pho = ' . $_GET['delete'] . ';';
+            pwg_query($query);
+
+            $_SESSION['page_infos'] = array(l10n('Personal info delete'));
+            redirect($admin_base_url);
+        }
+        
+        if (isset($_GET['hide'])) {
+            check_input_parameter('hide', $_GET, false, PATTERN_ID);
+            $query = 'UPDATE ' . ADD_INFO_PHOTO_TABLE . ' SET active = 1 WHERE id_info_pho=' . $_GET['hide'] . ';';
+            pwg_query($query);
+
+            $_SESSION['page_infos'] = array(l10n('Info hide'));
+            redirect($admin_base_url);
+        }
+        
+        if (isset($_GET['show'])) {
+            check_input_parameter('show', $_GET, false, PATTERN_ID);
+            $query = 'UPDATE ' . ADD_INFO_PHOTO_TABLE . ' SET active = 0 WHERE id_info_pho=' . $_GET['show'] . ';';
+            pwg_query($query);
+
+            $_SESSION['page_infos'] = array(l10n('Info show'));
+            redirect($admin_base_url);
+        }
+
+        break;
+    case 'configuration':
+        global $conf;
+
+        $selected = $conf['Add_Info_photos'];
+        $options['Author'] = l10n('Author');
+        $options['datecreate'] = l10n('Created on');
+        $options['datepost'] = l10n('Posted on');
+        $options['Dimensions'] = l10n('Dimensions');
+        $options['File'] = l10n('File');
+        $options['Filesize'] = l10n('Filesize');
+        $options['Tags'] = l10n('tags');
+        $options['Categories'] = l10n('Albums');
+        $options['Visits'] = l10n('Visits');
+        $options['Average'] = l10n('Rating score');
+
+        $template->assign(
+                'gestionA', array(
+            'OPTIONS' => $options,
+            'SELECTED' => $selected
+        ));
+
+
+        if (isset($_POST['Add_Info_photos'])) {
+            conf_update_param('Add_Info_photos', $_POST['Add_Info_photos'], true);
+            $template->delete_compiled_templates();
+            array_push($page['infos'], l10n('Your configuration settings are saved'));
+
+            $selected = $_POST['Add_Info_photos'];
+            $template->assign(
+                    'gestionA', array(
+                'OPTIONS' => $options,
+                'SELECTED' => $selected
+            ));
+        }
+        break;
+
+    case 'addinfo':
+
+
+
+        break;
+}
+
+
+$template->set_filenames(array('plugin_admin_content' => dirname(__FILE__) . '/admin/admin.tpl'));
+$template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content');
+?>
Index: /extensions/manage_info_photos/admin/admin.tpl
===================================================================
--- /extensions/manage_info_photos/admin/admin.tpl	(revision 30631)
+++ /extensions/manage_info_photos/admin/admin.tpl	(revision 30631)
@@ -0,0 +1,141 @@
+{combine_script id='jquery.ui.sortable' require='jquery.ui' load='footer' path='themes/default/js/ui/minified/jquery.ui.sortable.min.js'}
+{footer_script}
+jQuery(document).ready(function(){
+  jQuery(".drag_button").show();
+  jQuery(".categoryLi").css("cursor","move");
+  jQuery(".categoryUl").sortable({
+    axis: "y",
+    opacity: 0.8,
+    update : function() {
+      jQuery("#manualOrderInfo").show();
+    }
+  });
+
+  jQuery("#infoOrdering").submit(function(){
+    ar = jQuery('.categoryUl').sortable('toArray');
+    for(i=0;i < ar.length ;i++) {
+      iord = ar[i].split('iord_');
+      document.getElementsByName('infoOrd[' + iord[1] + ']')[0].value = i;
+    }
+  });
+
+  jQuery("#cancelManualOrderInfo").click(function(){
+    jQuery(".categoryUl").sortable("cancel");
+    jQuery("#manualOrderInfo").hide();
+  });
+  
+  jQuery('.categoryLi').mouseover(function(){
+    jQuery(this).children('span').show();
+  });
+  jQuery('.categoryLi').mouseout(function(){
+    jQuery(this).children('span').hide();
+  });
+  
+});
+{/footer_script}
+
+
+
+<div class="titrePage">
+  <h2>{'Management information on picture page'|@translate}</h2>
+</div>
+{if isset ($addinfotemplate)}
+    <form method="post" >
+        <fieldset>
+            <input class="submit" name="submitaddinfo" type="submit" value="{'Add info photo'|@translate}" />
+  	</fieldset>
+    </form>
+    {if isset ($addinfo_edit2)}
+        <form method="post" >
+            <fieldset>
+            <legend>{'Info add/edit'|@translate}</legend>
+                <input type="hidden" name="invisibleID" value="{$addinfo_edit2.AIPID}">
+                <p class="input">
+                    <label for="inserdesignation">{'Designation'|@translate}</label><br />
+                    <textarea style="margin-left:50px" rows="5" cols="50" class="description" name="inserdesignation" id="aip_add">{$addinfo_edit2.AIPDESC}</textarea>
+                </p>
+                <p class="input" style="width: 700px;">
+                    <label for="inseractive">{'Hide'|@translate}</label>
+                    <input type="checkbox" name="inseractive" {if {$addinfo_edit2.AIPACTIF}==1}checked{/if} value="1">
+                <div style="text-align:center;">
+                    <input class="submit" name="submitaddAIP" type="submit" value="{'Submit'|@translate}" />
+                </div>
+            </fieldset>
+        </form>
+    {/if}
+    <form id="infoOrdering" method="post" >
+        <p id="manualOrderInfo" style="display:none">
+          <input class="submit" name="submitManualOrderInfo" type="submit" value="{'Save order'|@translate}">
+          {'... or '|@translate} <a href="#" id="cancelManualOrderInfo">{'cancel manual order'|@translate}</a>
+        </p>
+	<fieldset>
+	<legend>{'List info'|@translate}</legend>
+          <ul class="categoryUl">
+            {foreach from=$info_photos item=infophoto}
+              <li class="categoryLi{if ($infophoto.AIPEDIT==1)} virtual_cat{/if}" id="iord_{$infophoto.IDINFOPHO}">
+                <img src="{$themeconf.admin_icon_dir}/cat_move.png" class="drag_button" style="display:none;" alt="{'Drag to re-order'|@translate}" title="{'Drag to re-order'|@translate}">
+                {$infophoto.AIPDESIGNATION}
+                <input type="hidden" name="infoOrd[{$infophoto.IDINFOPHO}]" value="{$infophoto.AIPORDER}">
+                <br />
+                <span class="actiononphoto" style="display: none">
+                    <label>{'Hide'|@translate}</label>
+                    {if ($infophoto.AIPACTIVE==0)}
+                        <a href="{$infophoto.U_HIDE}"><span class="graphicalCheckbox icon-check-empty"></span></a>
+                    {/if}
+                    {if ($infophoto.AIPACTIVE==1)}
+                        <a href="{$infophoto.U_SHOW}"><span class="graphicalCheckbox icon-check"></span></a>
+                    {/if}
+                    {if ($infophoto.AIPEDIT==1)}
+                    <a href="{$infophoto.U_EDIT}">
+                      <img src="{$ROOT_URL}{$themeconf.admin_icon_dir}/edit_s.png" alt="{'edit'|@translate}" title="{'edit'|@translate}" />
+                    </a>
+                    <a href="{$infophoto.U_DELETE}" onclick="return confirm( document.getElementById('btn_delete').title + '\n\n' + '{'Are you sure?'|@translate|@escape:'javascript'}');">
+                      <img src="{$ROOT_URL}{$themeconf.admin_icon_dir}/delete.png" id="btn_delete" alt="{'delete'|@translate}" title="{'Delete'|@translate}" />
+                    </a>
+                    {/if}
+                </span>
+                <br />
+              </li>
+            {/foreach}
+          </ul>
+        </fieldset>
+    </form>
+{/if}
+{if isset ($gestionA)}
+	<div>
+		<form method="post" >
+			<fieldset>
+				<legend>{'Add information before'|@translate}</legend>
+		{html_options name="Add_Info_photos" options=$gestionA.OPTIONS selected=$gestionA.SELECTED}
+				<br>	
+				<br>
+					<div style="text-align:center;">
+					<input class="submit" name="submitpab" type="submit" value="{'Save Settings'|@translate}">
+					</div>
+			</fieldset>
+		</form>
+	</div>
+{/if}
+{if isset ($gestionD)}
+<div>
+    <form method="post" >
+	<fieldset>
+	<legend>{'List info photo'|@translate}</legend>
+        <table>
+            {foreach from=$info_photos item=infophoto}
+            <tr>
+                <td style="width: 100px;"><span style="font-weight: bold; text-align: right;" >{$infophoto.AIPDESIGNATION}</span></td>
+                <td><input type="text" size="150" maxlength="250" name="data[{$infophoto.IDINFOPHO}]" value="{$infophoto.AIPDATA}" /></td>
+            </tr>  
+            {/foreach}
+            <tr>   </tr>
+            <tr>
+                <td colspan="2">
+                    <input class="submit" name="submitaddinfoimg" type="submit" value="{'Add info photo'|@translate}" />
+                </td>
+           </tr>
+           </table>
+  	</fieldset>
+    </form>
+</div>
+{/if}
Index: /extensions/manage_info_photos/admin/index.php
===================================================================
--- /extensions/manage_info_photos/admin/index.php	(revision 30631)
+++ /extensions/manage_info_photos/admin/index.php	(revision 30631)
@@ -0,0 +1,30 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Piwigo - a PHP based picture gallery                                  |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2008-2014 Piwigo Team                  http://piwigo.org |
+// | Copyright(C) 2003-2008 PhpWebGallery Team    http://phpwebgallery.net |
+// | Copyright(C) 2002-2003 Pierrick LE GALL   http://le-gall.net/pierrick |
+// +-----------------------------------------------------------------------+
+// | 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                                          |
+// |                                                                       |
+// | 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.                                                                  |
+// +-----------------------------------------------------------------------+
+
+// Recursive call
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: /extensions/manage_info_photos/include/function.aip.inc.php
===================================================================
--- /extensions/manage_info_photos/include/function.aip.inc.php	(revision 30631)
+++ /extensions/manage_info_photos/include/function.aip.inc.php	(revision 30631)
@@ -0,0 +1,78 @@
+<?php 
+function tab_add_info_one_photo($id_img){
+$query = '
+    SELECT aip.id_info_pho,aip.designation,aipd.data,aip.orderinfo
+    FROM ' . ADD_INFO_PHOTO_TABLE . ' AS aip
+    LEFT JOIN ' . ADD_INFO_PHOTO_DATA_TABLE . ' AS aipd ON aip.id_info_pho=aipd.id_info_pho
+    WHERE aipd.id_img = \'' . $id_img . '\' 
+    AND aip.active = 0 
+    ORDER BY aip.orderinfo ASC
+    ;';
+
+return pwg_query($query);
+}
+
+function tab_add_info_one_photo2($id_img){
+$query = '
+    SELECT aip.id_info_pho,aip.designation,aipd.data,aip.orderinfo
+    FROM ' . ADD_INFO_PHOTO_DATA_TABLE . ' AS aipd
+    RIGHT JOIN ' . ADD_INFO_PHOTO_TABLE . ' AS aip ON aip.id_info_pho=aipd.id_info_pho
+    WHERE aipd.id_img = \'' . $id_img . '\' 
+    AND aip.active = 0 
+    ORDER BY aip.orderinfo ASC
+    ;';
+
+return pwg_query($query);
+}
+
+function tab_add_info_by_photo(){
+$query = '
+    SELECT id_info_pho,designation
+    FROM ' . ADD_INFO_PHOTO_TABLE . ' 
+    WHERE active = 0 
+    AND edit = 1 
+    ORDER BY orderinfo ASC
+    ;';
+return pwg_query($query);
+}
+
+function tab_add_info_by_photo_show(){
+$query = '
+    SELECT id_info_pho,designation,orderinfo
+    FROM ' . ADD_INFO_PHOTO_TABLE . ' 
+    WHERE active = 0 
+    ORDER BY orderinfo ASC
+    ;';
+return pwg_query($query);
+}
+
+function data_info_photos($id_img=null,$id_info_pho=NULL){
+$query = '
+    SELECT data
+    FROM ' . ADD_INFO_PHOTO_DATA_TABLE;
+    $wa='WHERE';
+    if($id_img!=null){
+        $query .=' '.$wa.' id_img='.$id_img;$wa='AND';
+    }
+    if($id_info_pho!=null){
+        $query .=' '.$wa.' id_info_pho='.$id_info_pho;$wa='AND';
+    }
+$query .= ';';
+return pwg_query($query);
+}
+
+
+function tab_info_photos($id_info_pho=NULL){
+$query = '
+    SELECT id_info_pho,designation,orderinfo,active,edit
+    FROM ' . ADD_INFO_PHOTO_TABLE;
+    if($id_info_pho!=null){
+        $query .= ' WHERE id_info_pho='.$id_info_pho;
+    }
+
+$query .= ' ORDER BY orderinfo ASC
+    ;';
+return pwg_query($query);
+}
+
+?>
Index: /extensions/manage_info_photos/index.php
===================================================================
--- /extensions/manage_info_photos/index.php	(revision 30631)
+++ /extensions/manage_info_photos/index.php	(revision 30631)
@@ -0,0 +1,30 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Piwigo - a PHP based picture gallery                                  |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2008-2014 Piwigo Team                  http://piwigo.org |
+// | Copyright(C) 2003-2008 PhpWebGallery Team    http://phpwebgallery.net |
+// | Copyright(C) 2002-2003 Pierrick LE GALL   http://le-gall.net/pierrick |
+// +-----------------------------------------------------------------------+
+// | 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                                          |
+// |                                                                       |
+// | 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.                                                                  |
+// +-----------------------------------------------------------------------+
+
+// Recursive call
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: /extensions/manage_info_photos/initadmin.php
===================================================================
--- /extensions/manage_info_photos/initadmin.php	(revision 30631)
+++ /extensions/manage_info_photos/initadmin.php	(revision 30631)
@@ -0,0 +1,31 @@
+<?php
+
+//Ajout du menu admin
+add_event_handler('get_admin_plugin_menu_links', 'add_info_photo_admin_menu');
+
+function add_info_photo_admin_menu($menu) {
+    load_language('plugin.lang', ADD_INFO_PHOTO_PATH);
+    $menu[] = array(
+        'NAME' => l10n('Manage infos photos'),
+        'URL' => ADD_INFO_PHOTO_ADMIN,
+    );
+     return $menu;
+}
+
+add_event_handler('tabsheet_before_select', 'aip_tabsheet_before_select',
+    EVENT_HANDLER_PRIORITY_NEUTRAL);
+
+function aip_tabsheet_before_select($sheets, $id)
+{
+    global $template, $page;
+  if ($id == 'photo')
+  {
+    $sheets['iap'] = array(
+      'caption' => l10n('Info photos'),
+      'url' => ADD_INFO_PHOTO_ADMIN.'-iap&amp;image_id='.$_GET['image_id'],
+      );
+  }
+  return $sheets;
+}
+
+?>
Index: /extensions/manage_info_photos/initpicture.php
===================================================================
--- /extensions/manage_info_photos/initpicture.php	(revision 30631)
+++ /extensions/manage_info_photos/initpicture.php	(revision 30631)
@@ -0,0 +1,227 @@
+<?php
+
+//Ajout du prefiltre
+add_event_handler('loc_begin_picture', 'add_info_photo_pre', 56);
+
+function add_info_photo_pre() {
+    global $template;
+    $template->set_prefilter('picture', 'add_info_photo_preT');
+}
+
+function add_info_photo_preT($content, &$smarty) {
+
+    global $conf;
+
+   //$search = '#^<dl id="standard" class="imageInfoTable">(?:.*\r*)metadata)$#s';
+
+   $search = '<dl id="standard" class="imageInfoTable">';
+    
+   
+   $repla='<dl id="standard" class="imageInfoTable2">{strip}
+{foreach from=$add_info_photos item=addinfophotos}
+    {if $addinfophotos.AIPID == 1 and isset($INFO_AUTHOR)}
+    	<div id="Author" class="imageInfo">
+		<dt>{\'Author\'|@translate}</dt>
+		<dd>{$INFO_AUTHOR}</dd>
+	</div>
+    {else if $addinfophotos.AIPID == 2 and isset($INFO_CREATION_DATE)}
+        <div id="datecreate" class="imageInfo">
+		<dt>{\'Created on\'|@translate}</dt>
+		<dd>{$INFO_CREATION_DATE}</dd>
+	</div>
+    {else if $addinfophotos.AIPID == 3 and isset($INFO_CREATION_DATE)}
+	<div id="datepost" class="imageInfo">
+		<dt>{\'Posted on\'|@translate}</dt>
+		<dd>{$INFO_POSTED_DATE}</dd>
+	</div>
+    {else if $addinfophotos.AIPID == 4 and isset($INFO_DIMENSIONS)}
+	<div id="Dimensions" class="imageInfo">
+		<dt>{\'Dimensions\'|@translate}</dt>
+		<dd>{$INFO_DIMENSIONS}</dd>
+	</div>
+    {else if $addinfophotos.AIPID == 5}
+	<div id="File" class="imageInfo">
+		<dt>{\'File\'|@translate}</dt>
+		<dd>{$INFO_FILE}</dd>
+	</div>
+    {else if $addinfophotos.AIPID == 6 and isset($INFO_FILESIZE)}
+	<div id="Filesize" class="imageInfo">
+		<dt>{\'Filesize\'|@translate}</dt>
+		<dd>{$INFO_FILESIZE}</dd>
+	</div>
+    {else if $addinfophotos.AIPID == 7 and isset($related_tags)}}
+        <dt>{\'Tags\'|@translate}</dt>
+		<dd>
+		{foreach from=$related_tags item=tag name=tag_loop}{if !$smarty.foreach.tag_loop.first}, {/if}<a href="{$tag.URL}">{$tag.name}</a>{/foreach}
+		</dd>
+	</div>
+    {else if $addinfophotos.AIPID == 8 and isset($related_categories)}
+	<div id="Categories" class="imageInfo">
+            <dt>{\'Albums\'|@translate}</dt>
+            <dd>
+                <ul>
+                    {foreach from=$related_categories item=cat}
+                        <li>{$cat}</li>
+                    {/foreach}
+                </ul>
+            </dd>
+	</div>
+    {else if $addinfophotos.AIPID == 9}
+	<div id="Visits" class="imageInfo">
+		<dt>{\'Visits\'|@translate}</dt>
+		<dd>{$INFO_VISITS}</dd>
+	</div>
+    {else if $addinfophotos.AIPID == 10 and isset($rate_summary)}
+	<div id="Average" class="imageInfo">
+		<dt>{\'Rating score\'|@translate}</dt>
+		<dd>
+		{if $rate_summary.count}
+			<span id="ratingScore">{$rate_summary.score}</span> <span id="ratingCount">({$rate_summary.count|@translate_dec:\'%d rate\':\'%d rates\'})</span>
+		{else}
+			<span id="ratingScore">{\'no rate\'|@translate}</span> <span id="ratingCount"></span>
+		{/if}
+		</dd>
+	</div>
+        {if isset($rating)}
+	<div id="rating" class="imageInfo">
+		<dt>
+			<span id="updateRate">{if isset($rating.USER_RATE)}{\'Update your rating\'|@translate}{else}{\'Rate this photo\'|@translate}{/if}</span>
+		</dt>
+		<dd>
+			<form action="{$rating.F_ACTION}" method="post" id="rateForm" style="margin:0;">
+			<div>
+			{foreach from=$rating.marks item=mark name=rate_loop}
+			{if isset($rating.USER_RATE) && $mark==$rating.USER_RATE}
+				<input type="button" name="rate" value="{$mark}" class="rateButtonSelected" title="{$mark}">
+			{else}
+				<input type="submit" name="rate" value="{$mark}" class="rateButton" title="{$mark}">
+			{/if}
+			{/foreach}
+			{strip}{combine_script id=\'core.scripts\' load=\'async\' path=\'themes/default/js/scripts.js\'}
+			{combine_script id=\'rating\' load=\'async\' require=\'core.scripts\' path=\'themes/default/js/rating.js\'}
+			{footer_script}
+				var _pwgRatingAutoQueue = _pwgRatingAutoQueue||[];
+				_pwgRatingAutoQueue.push( {ldelim}rootUrl: \'{$ROOT_URL}\', image_id: {$current.id},
+					onSuccess : function(rating) {ldelim}
+						var e = document.getElementById("updateRate");
+						if (e) e.innerHTML = "{\'Update your rating\'|@translate|@escape:\'javascript\'}";
+						e = document.getElementById("ratingScore");
+						if (e) e.innerHTML = rating.score;
+						e = document.getElementById("ratingCount");
+						if (e) {ldelim}
+							if (rating.count == 1) {ldelim}
+								e.innerHTML = "({\'%d rate\'|@translate|@escape:\'javascript\'})".replace( "%d", rating.count);
+							} else {ldelim}
+								e.innerHTML = "({\'%d rates\'|@translate|@escape:\'javascript\'})".replace( "%d", rating.count);
+              }
+						{rdelim}
+					{rdelim}{rdelim} );
+			{/footer_script}
+			{/strip}
+			</div>
+			</form>
+		</dd>
+	</div>
+        {/if}
+    {else if $addinfophotos.AIPID == 11 and $display_info.privacy_level and isset($available_permission_levels)}
+	<div id="Privacy" class="imageInfo">
+		<dt>{\'Who can see this photo?\'|@translate}</dt>
+		<dd>
+			<div>
+				<a id="privacyLevelLink" href>{$available_permission_levels[$current.level]}</a>
+			</div>
+{combine_script id=\'core.scripts\' load=\'async\' path=\'themes/default/js/scripts.js\'}
+{footer_script require=\'jquery\'}{strip}
+function setPrivacyLevel(id, level){
+(new PwgWS(\'{$ROOT_URL}\')).callService(
+	"pwg.images.setPrivacyLevel", { image_id:id, level:level},
+	{
+		method: "POST",
+		onFailure: function(num, text) { alert(num + " " + text); },
+		onSuccess: function(result) {
+			  jQuery(\'#privacyLevelBox .switchCheck\').css(\'visibility\',\'hidden\');
+				jQuery(\'#switchLevel\'+level).prev(\'.switchCheck\').css(\'visibility\',\'visible\');
+				jQuery(\'#privacyLevelLink\').text(jQuery(\'#switchLevel\'+level).text());
+		}
+	}
+	);
+}
+(SwitchBox=window.SwitchBox||[]).push("#privacyLevelLink", "#privacyLevelBox");
+{/strip}{/footer_script}
+			<div id="privacyLevelBox" class="switchBox" style="display:none">
+				{foreach from=$available_permission_levels item=label key=level}
+					<span class="switchCheck"{if $level != $current.level} style="visibility:hidden"{/if}>&#x2714; </span>
+					<a id="switchLevel{$level}" href="javascript:setPrivacyLevel({$current.id},{$level})">{$label}</a><br>
+				{/foreach}
+			</div>
+		</dd>
+	</div>
+    {else if $addinfophotos.AIPDATA}
+        <div id="add_info class="imageInfo">
+          <dt class="label">{$addinfophotos.AIPDESIGNATION}</dt>
+          <dd class="value">{$addinfophotos.AIPDATA}</dd>
+        </div>
+    {/if}
+{/foreach}
+{/strip}
+</dl>';
+   
+    $replacement = '
+{footer_script}
+jQuery(document).ready(function(){
+    jQuery(\'body\').find(function(){
+        var elt=\'<dl id="standard" class="imageInfoTable2">{strip}{foreach from=$add_info_photos item=addinfophotos}{if $addinfophotos.AIPID == 1 and isset($INFO_AUTHOR)}<div id="Author" class="imageInfo"><dt>{\'Author\'|@translate}</dt><dd>{$INFO_AUTHOR}</dd></div>{else if $addinfophotos.AIPID == 2 and isset($INFO_CREATION_DATE)}<div id="datecreate" class="imageInfo"><dt>{\'Created on\'|@translate}</dt><dd>{$INFO_CREATION_DATE}</dd></div>{else if $addinfophotos.AIPID == 3 and isset($INFO_CREATION_DATE)}<div id="datepost" class="imageInfo"><dt>{\'Posted on\'|@translate}</dt><dd>{$INFO_POSTED_DATE}</dd></div>{else if $addinfophotos.AIPID == 4 and isset($INFO_DIMENSIONS)}<div id="Dimensions" class="imageInfo"><dt>{\'Dimensions\'|@translate}</dt><dd>{$INFO_DIMENSIONS}</dd></div>{else if $addinfophotos.AIPID == 5}<div id="File" class="imageInfo"><dt>{\'File\'|@translate}</dt><dd>{$INFO_FILE}</dd></div>{else if $addinfophotos.AIPID == 6 and isset($INFO_FILESIZE)}<div id="Filesize" class="imageInfo"><dt>{\'Filesize\'|@translate}</dt><dd>{$INFO_FILESIZE}</dd></div>{else if $addinfophotos.AIPID == 7 and isset($related_tags)}}<dt>{\'Tags\'|@translate}</dt><dd>{foreach from=$related_tags item=tag name=tag_loop}{if !$smarty.foreach.tag_loop.first}, {/if}<a href="{$tag.URL}">{$tag.name}</a>{/foreach}</dd></div>{else if $addinfophotos.AIPID == 8 and isset($related_categories)}<div id="Categories" class="imageInfo"><dt>{\'Albums\'|@translate}</dt><dd><ul>{foreach from=$related_categories item=cat}<li>{$cat}</li>{/foreach}</ul></dd></div>{else if $addinfophotos.AIPID == 9}<div id="Visits" class="imageInfo"><dt>{\'Visits\'|@translate}</dt><dd>{$INFO_VISITS}</dd></div>{else if $addinfophotos.AIPID == 10 and isset($rate_summary)}<div id="Average" class="imageInfo"><dt>{\'Rating score\'|@translate}</dt><dd>{if $rate_summary.count}<span id="ratingScore">{$rate_summary.score}</span> <span id="ratingCount">({$rate_summary.count|@translate_dec:\'%d rate\':\'%d rates\'})</span>{else}<span id="ratingScore">{\'no rate\'|@translate}</span> <span id="ratingCount"></span>{/if}</dd></div>{if isset($rating)}<div id="rating" class="imageInfo"><dt><span id="updateRate">{if isset($rating.USER_RATE)}{\'Update your rating\'|@translate}{else}{\'Rate this photo\'|@translate}{/if}</span></dt><dd><form action="{$rating.F_ACTION}" method="post" id="rateForm" style="margin:0;"><div>{foreach from=$rating.marks item=mark name=rate_loop}{if isset($rating.USER_RATE) && $mark==$rating.USER_RATE}        <input type="button" name="rate" value="{$mark}" class="rateButtonSelected" title="{$mark}">{else}        <input type="submit" name="rate" value="{$mark}" class="rateButton" title="{$mark}">{/if}{/foreach}{strip}{combine_script id=\'core.scripts\' load=\'async\' path=\'themes/default/js/scripts.js\'}{combine_script id=\'rating\' load=\'async\' require=\'core.scripts\' path=\'themes/default/js/rating.js\'}{footer_script}var _pwgRatingAutoQueue = _pwgRatingAutoQueue||[];_pwgRatingAutoQueue.push( {ldelim}rootUrl: \'{$ROOT_URL}\', image_id: {$current.id},onSuccess : function(rating) {ldelim}var e = document.getElementById("updateRate");if (e) e.innerHTML = "{\'Update your rating\'|@translate|@escape:\'javascript\'}";e = document.getElementById("ratingScore");if (e) e.innerHTML = rating.score;e = document.getElementById("ratingCount");if (e) {ldelim}if (rating.count == 1) {ldelim}        e.innerHTML = "({\'%d rate\'|@translate|@escape:\'javascript\'})".replace( "%d", rating.count);} else {ldelim}e.innerHTML = "({\'%d rates\'|@translate|@escape:\'javascript\'})".replace( "%d", rating.count);}{rdelim}{rdelim}{rdelim} );{/footer_script}{/strip}</div></form></dd></div>{/if}{else if $addinfophotos.AIPID == 11 and $display_info.privacy_level and isset($available_permission_levels)}<div id="Privacy" class="imageInfo"><dt>{\'Who can see this photo?\'|@translate}</dt><dd><div><a id="privacyLevelLink" href>{$available_permission_levels[$current.level]}</a></div>{combine_script id=\'core.scripts\' load=\'async\' path=\'themes/default/js/scripts.js\'}{footer_script require=\'jquery\'}{strip}function setPrivacyLevel(id, level){(new PwgWS(\'{$ROOT_URL}\')).callService("pwg.images.setPrivacyLevel", { image_id:id, level:level},{method: "POST",onFailure: function(num, text) { alert(num + " " + text); },onSuccess: function(result) {jQuery(\'#privacyLevelBox .switchCheck\').css(\'visibility\',\'hidden\');jQuery(\'#switchLevel\'+level).prev(\'.switchCheck\').css(\'visibility\',\'visible\');jQuery(\'#privacyLevelLink\').text(jQuery(\'#switchLevel\'+level).text());}});}(SwitchBox=window.SwitchBox||[]).push("#privacyLevelLink", "#privacyLevelBox");{/strip}{/footer_script}<div id="privacyLevelBox" class="switchBox" style="display:none">{foreach from=$available_permission_levels item=label key=level}<span class="switchCheck"{if $level != $current.level} style="visibility:hidden"{/if}>&#x2714; </span><a id="switchLevel{$level}" href="javascript:setPrivacyLevel({$current.id},{$level})">{$label}</a><br>{/foreach}</div></dd></div>{else if $addinfophotos.AIPDATA}<div id="add_info class="imageInfo"><dt class="label">{$addinfophotos.AIPDESIGNATION}</dt><dd class="value">{$addinfophotos.AIPDATA}</dd></div>{/if}{/foreach}{/strip}</dl>\';
+        console.log(\'a\');$( "#standard" ).
+        replaceWith(elt);
+    });
+
+});
+{/footer_script}
+
+
+
+
+<dl id="standard" class="imageInfoTable">
+';
+
+
+    return str_replace($search, $repla , $content);
+}
+
+add_event_handler('loc_begin_picture', 'add_InfoT');
+
+function add_InfoT() {
+    global $conf, $page, $template;
+
+    if (!empty($page['image_id'])) {
+        $PAED = pwg_db_fetch_assoc(pwg_query("SELECT state FROM " . PLUGINS_TABLE . " WHERE id = 'ExtendedDescription';"));
+        if ($PAED['state'] == 'active')
+            add_event_handler('AP_render_content', 'get_user_language_desc');
+
+        $tab_add_info_one_photo = tab_add_info_by_photo_show();
+
+        if (pwg_db_num_rows($tab_add_info_one_photo)) {
+            while ($info_photos = pwg_db_fetch_assoc($tab_add_info_one_photo)) {
+
+                $d = data_info_photos($page['image_id'], $info_photos['id_info_pho']);
+                $row = pwg_db_fetch_assoc($d);
+
+                $items = array(
+                    'AIPID' => $info_photos['id_info_pho'],
+                    'AIPORDER' => $info_photos['orderinfo'],
+                    'AIPDESIGNATION' => trigger_change('AP_render_content', $info_photos['designation']),
+                    'AIPDATA' => trigger_change('AP_render_content', $row['data']),
+                );
+
+                $template->append('add_info_photos', $items);
+            }
+        }
+
+        $template->assign(
+                array(
+                    'A' => 'a'
+        ));
+    }
+}
+
+?>
Index: /extensions/manage_info_photos/language/en_UK/description.txt
===================================================================
--- /extensions/manage_info_photos/language/en_UK/description.txt	(revision 30631)
+++ /extensions/manage_info_photos/language/en_UK/description.txt	(revision 30631)
@@ -0,0 +1,1 @@
+Add information about the photo page and organize information
Index: /extensions/manage_info_photos/language/en_UK/index.php
===================================================================
--- /extensions/manage_info_photos/language/en_UK/index.php	(revision 30631)
+++ /extensions/manage_info_photos/language/en_UK/index.php	(revision 30631)
@@ -0,0 +1,30 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Piwigo - a PHP based picture gallery                                  |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2008-2014 Piwigo Team                  http://piwigo.org |
+// | Copyright(C) 2003-2008 PhpWebGallery Team    http://phpwebgallery.net |
+// | Copyright(C) 2002-2003 Pierrick LE GALL   http://le-gall.net/pierrick |
+// +-----------------------------------------------------------------------+
+// | 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                                          |
+// |                                                                       |
+// | 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.                                                                  |
+// +-----------------------------------------------------------------------+
+
+// Recursive call
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: /extensions/manage_info_photos/language/en_UK/plugin.lang.php
===================================================================
--- /extensions/manage_info_photos/language/en_UK/plugin.lang.php	(revision 30631)
+++ /extensions/manage_info_photos/language/en_UK/plugin.lang.php	(revision 30631)
@@ -0,0 +1,18 @@
+<?php
+//admin
+$lang['Manage infos photos'] = 'Manage infos photos';
+$lang['Info photos'] = 'Info photos';
+$lang['Information\'s organization'] = 'Information\'s organization';
+$lang['Personal info photo update'] = 'Personal info photo update';
+$lang['Info manual order was saved'] = 'Info manual order was saved';
+$lang['Personal info photo add'] = 'Personal info photo add';
+$lang['Personal info delete'] = 'Personal info delete';
+$lang['Info hide'] = 'Info hide';
+$lang['Info show'] = 'Info show';
+$lang['Management information on picture page'] = 'Management information on picture page';
+$lang['Add info photo'] = 'Add info photo';
+$lang['Info add/edit'] = 'Info add/edit';
+$lang['Designation'] = 'Designation';
+$lang['List info'] = 'List info';
+
+?>
Index: /extensions/manage_info_photos/language/fr_FR/description.txt
===================================================================
--- /extensions/manage_info_photos/language/fr_FR/description.txt	(revision 30631)
+++ /extensions/manage_info_photos/language/fr_FR/description.txt	(revision 30631)
@@ -0,0 +1,1 @@
+Ajouter des informations sur la page des photos et organiser les informations
Index: /extensions/manage_info_photos/language/fr_FR/index.php
===================================================================
--- /extensions/manage_info_photos/language/fr_FR/index.php	(revision 30631)
+++ /extensions/manage_info_photos/language/fr_FR/index.php	(revision 30631)
@@ -0,0 +1,30 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Piwigo - a PHP based picture gallery                                  |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2008-2014 Piwigo Team                  http://piwigo.org |
+// | Copyright(C) 2003-2008 PhpWebGallery Team    http://phpwebgallery.net |
+// | Copyright(C) 2002-2003 Pierrick LE GALL   http://le-gall.net/pierrick |
+// +-----------------------------------------------------------------------+
+// | 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                                          |
+// |                                                                       |
+// | 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.                                                                  |
+// +-----------------------------------------------------------------------+
+
+// Recursive call
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: /extensions/manage_info_photos/language/fr_FR/plugin.lang.php
===================================================================
--- /extensions/manage_info_photos/language/fr_FR/plugin.lang.php	(revision 30631)
+++ /extensions/manage_info_photos/language/fr_FR/plugin.lang.php	(revision 30631)
@@ -0,0 +1,17 @@
+<?php
+//admin
+$lang['Manage infos photos'] = 'Gérer les infos photos';
+$lang['Info photos'] = 'Photos Info';
+$lang['Information\'s organization'] = 'Organisation des informations';
+$lang['Personal info photo update'] = 'Info photo personnnel mise à jour';
+$lang['Info manual order was saved'] = 'Ordre manual sauvegardé';
+$lang['Personal info photo add'] = 'Info photo personel ajouté';
+$lang['Personal info delete'] = 'Personel info supprimé';
+$lang['Info hide'] = 'Info caché';
+$lang['Info show'] = 'Info affiché';
+$lang['Management information on picture page'] = 'Gestion d\'information sur la page des photos';
+$lang['Add info photo'] = 'Ajouter une nouvelle info';
+$lang['Info add/edit'] = 'Info ajouter/editer';
+$lang['List info'] = 'List info';
+
+?>
Index: /extensions/manage_info_photos/language/index.php
===================================================================
--- /extensions/manage_info_photos/language/index.php	(revision 30631)
+++ /extensions/manage_info_photos/language/index.php	(revision 30631)
@@ -0,0 +1,30 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Piwigo - a PHP based picture gallery                                  |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2008-2014 Piwigo Team                  http://piwigo.org |
+// | Copyright(C) 2003-2008 PhpWebGallery Team    http://phpwebgallery.net |
+// | Copyright(C) 2002-2003 Pierrick LE GALL   http://le-gall.net/pierrick |
+// +-----------------------------------------------------------------------+
+// | 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                                          |
+// |                                                                       |
+// | 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.                                                                  |
+// +-----------------------------------------------------------------------+
+
+// Recursive call
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: /extensions/manage_info_photos/main.inc.php
===================================================================
--- /extensions/manage_info_photos/main.inc.php	(revision 30631)
+++ /extensions/manage_info_photos/main.inc.php	(revision 30631)
@@ -0,0 +1,36 @@
+<?php
+/*
+Plugin Name: Manage Infos Photos
+Version: auto
+Description: Can add information on photos
+Plugin URI: http://piwigo.org/ext/extension_view.php?eid=
+Author: ddtddt
+Author URI: 
+*/
+
+if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+
+global $prefixeTable;
+
+define('ADD_INFO_PHOTO_DIR' , basename(dirname(__FILE__)));
+define('ADD_INFO_PHOTO_PATH' , PHPWG_PLUGINS_PATH . ADD_INFO_PHOTO_DIR . '/');
+if (!defined('ADD_INFO_PHOTO_TABLE')) define('ADD_INFO_PHOTO_TABLE', $prefixeTable.'add_Info_photos');
+if (!defined('ADD_INFO_PHOTO_DATA_TABLE')) define('ADD_INFO_PHOTO_DATA_TABLE', $prefixeTable.'add_Info_photos_data');
+define('ADD_INFO_PHOTO_ADMIN',get_root_url().'admin.php?page=plugin-'.ADD_INFO_PHOTO_DIR);
+
+include_once(ADD_INFO_PHOTO_PATH . 'include/function.aip.inc.php');
+
+ // Plugin on picture page
+if (script_basename() == 'picture')  
+{  
+  include_once(dirname(__FILE__).'/initpicture.php');
+}
+
+
+  // Plugin for admin
+if (script_basename() == 'admin')   
+{
+  include_once(dirname(__FILE__).'/initadmin.php');
+}
+
+?>
Index: /extensions/manage_info_photos/maintain.class.php
===================================================================
--- /extensions/manage_info_photos/maintain.class.php	(revision 30631)
+++ /extensions/manage_info_photos/maintain.class.php	(revision 30631)
@@ -0,0 +1,80 @@
+<?php
+defined('PHPWG_ROOT_PATH') or die('Hacking attempt!');
+
+class manage_info_photos_maintain extends PluginMaintain
+{
+  private $installed = false;
+
+  function __construct($plugin_id){
+    parent::__construct($plugin_id);
+  }
+
+  function install($plugin_version, &$errors=array()){
+       global $prefixeTable;
+
+if (!defined('ADD_INFO_PHOTO_TABLE')) define('ADD_INFO_PHOTO_TABLE', $prefixeTable.'add_Info_photos');
+	$query = "CREATE TABLE IF NOT EXISTS ". ADD_INFO_PHOTO_TABLE ." (
+id_info_pho SMALLINT(5) UNSIGNED NOT NULL auto_increment,
+designation VARCHAR(255) NOT NULL ,
+orderinfo SMALLINT(5) UNSIGNED NOT NULL ,
+active SMALLINT(5) UNSIGNED NOT NULL ,
+edit SMALLINT(5) UNSIGNED NOT NULL ,
+PRIMARY KEY (id_info_pho))DEFAULT CHARSET=utf8;";
+	$result = pwg_query($query);
+
+if (!defined('ADD_INFO_PHOTO_DATA_TABLE')) define('ADD_INFO_PHOTO_DATA_TABLE', $prefixeTable.'add_Info_photos_data');
+      	$query = "CREATE TABLE IF NOT EXISTS ". ADD_INFO_PHOTO_DATA_TABLE ." (
+id_img SMALLINT(5) UNSIGNED NOT NULL ,
+id_info_pho SMALLINT(5) UNSIGNED NOT NULL ,
+data VARCHAR(255) NOT NULL ,
+PRIMARY KEY (id_img,id_info_pho))DEFAULT CHARSET=utf8;";
+	$result = pwg_query($query);
+        
+$q = 'INSERT INTO ' . $prefixeTable . 'Add_Info_photos(id_info_pho,designation,orderinfo,active,edit)VALUES (1,"author",1,0,0);';
+    pwg_query($q);
+$q = 'INSERT INTO ' . $prefixeTable . 'Add_Info_photos(id_info_pho,designation,orderinfo,active,edit)VALUES (2,"Created on",2,0,0);';
+    pwg_query($q);
+$q = 'INSERT INTO ' . $prefixeTable . 'Add_Info_photos(id_info_pho,designation,orderinfo,active,edit)VALUES (3,"Posted on",3,0,0);';
+    pwg_query($q);
+$q = 'INSERT INTO ' . $prefixeTable . 'Add_Info_photos(id_info_pho,designation,orderinfo,active,edit)VALUES (4,"Dimensions",4,0,0);';
+    pwg_query($q);    
+$q = 'INSERT INTO ' . $prefixeTable . 'Add_Info_photos(id_info_pho,designation,orderinfo,active,edit)VALUES (5,"File",5,0,0);';
+    pwg_query($q);          
+$q = 'INSERT INTO ' . $prefixeTable . 'Add_Info_photos(id_info_pho,designation,orderinfo,active,edit)VALUES (6,"Filesize",6,0,0);';
+    pwg_query($q);
+$q = 'INSERT INTO ' . $prefixeTable . 'Add_Info_photos(id_info_pho,designation,orderinfo,active,edit)VALUES (7,"Tags",7,0,0);';
+    pwg_query($q);   
+$q = 'INSERT INTO ' . $prefixeTable . 'Add_Info_photos(id_info_pho,designation,orderinfo,active,edit)VALUES (8,"Albums",8,0,0);';
+    pwg_query($q);      
+$q = 'INSERT INTO ' . $prefixeTable . 'Add_Info_photos(id_info_pho,designation,orderinfo,active,edit)VALUES (9,"Visits",9,0,0);';
+    pwg_query($q);       
+$q = 'INSERT INTO ' . $prefixeTable . 'Add_Info_photos(id_info_pho,designation,orderinfo,active,edit)VALUES (10,"Average",10,0,0);';
+    pwg_query($q);
+$q = 'INSERT INTO ' . $prefixeTable . 'Add_Info_photos(id_info_pho,designation,orderinfo,active,edit)VALUES (11,"Who can see this photo?",11,0,0);';
+    pwg_query($q); 
+    
+  }
+
+  function activate($plugin_version, &$errors=array()){
+  
+  }
+
+  function update($old_version, $new_version, &$errors=array()){
+    global $conf;
+    if (!isset($conf['Add_Info_photos'])) {
+        conf_update_param('Add_Info_photos','Categories',true);
+    }
+  }
+  
+  function deactivate(){
+  }
+
+  function uninstall(){
+    conf_delete_param('Add_Info_photos');
+    $q = 'DROP TABLE ' . $prefixeTable . 'add_Info_photos;';
+    pwg_query($q);
+    $q = 'DROP TABLE ' . $prefixeTable . 'add_Info_photos_data;';
+    pwg_query($q);
+  }
+}
+?>
