Index: /extensions/menalto2piwigo/admin.php
===================================================================
--- /extensions/menalto2piwigo/admin.php	(revision 28825)
+++ /extensions/menalto2piwigo/admin.php	(revision 28825)
@@ -0,0 +1,379 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Piwigo - a PHP based picture gallery                                  |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2008-2014 Piwigo Team                  http://piwigo.org |
+// +-----------------------------------------------------------------------+
+// | 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.                                                                  |
+// +-----------------------------------------------------------------------+
+
+if( !defined("PHPWG_ROOT_PATH") )
+{
+  die ("Hacking attempt!");
+}
+
+include_once(PHPWG_ROOT_PATH.'admin/include/functions.php');
+include_once(M2P_PATH.'include/functions.inc.php');
+
+$admin_base_url = get_root_url().'admin.php?page=plugin-menalto2piwigo';
+load_language('plugin.lang', dirname(__FILE__).'/');
+
+// +-----------------------------------------------------------------------+
+// | Check Access and exit when user status is not ok                      |
+// +-----------------------------------------------------------------------+
+
+check_status(ACCESS_WEBMASTER);
+
+// +-----------------------------------------------------------------------+
+// | load database config for Menalto                                      |
+// +-----------------------------------------------------------------------+
+
+if (isset($conf['menalto2piwigo']))
+{
+  $conf['menalto2piwigo'] = unserialize($conf['menalto2piwigo']);
+}
+else
+{
+  $conf['menalto2piwigo'] = array(
+    'db_host' => $conf['db_host'],
+    'db_user' => $conf['db_user'],
+    'db_password' => $conf['db_password'],
+    'db_name' => '',
+    'prefix_table' => 'g2_',
+    'prefix_column' => 'g_',
+    );
+}
+
+// +-----------------------------------------------------------------------+
+// | import data from Menalto                                              |
+// +-----------------------------------------------------------------------+
+
+if (isset($_POST['submit']))
+{
+  foreach (array_keys($conf['menalto2piwigo']) as $key)
+  {
+    $conf['menalto2piwigo'][$key] = $_POST[$key];
+  }
+  
+  conf_update_param('menalto2piwigo', serialize($conf['menalto2piwigo']));
+  
+  $pt = $conf['menalto2piwigo']['prefix_table'];
+  $pc = $conf['menalto2piwigo']['prefix_column'];
+
+  // build an associative array like
+  //
+  // $piwigo_paths = array(
+  //   [album 1] => c2
+  //   [album 1/20081220_173438-014.jpg] => i1
+  //   [album 1/20081220_173603-017.jpg] => i2
+  //   [album 1/sub-album 1.1] => c3
+  //   [album 1/sub-album 1.1/1.1.1] => c4
+  //   [album 1/sub-album 1_2] => c5
+  //   [album 2] => c1
+  //   [album 2/20091011_164753-127.jpg] => i3
+  //   [album 2/20091102_172719-190.jpg] => i4
+  // );
+  //
+  // cN for categories, iN for images
+  $piwigo_paths = array();
+
+  $query = '
+SELECT
+    id,
+    REPLACE(path, "./galleries/", "") AS filepath
+  FROM '.IMAGES_TABLE.'
+  WHERE path like "./galleries/%"
+;';
+  $result = pwg_query($query);
+  while ($row = pwg_db_fetch_assoc($result))
+  {
+    $piwigo_paths[$row['filepath']] = 'i'.$row['id'];
+  }
+
+  $query = '
+SELECT
+    id,
+    dir,
+    uppercats
+  FROM '.CATEGORIES_TABLE.'
+  WHERE site_id = 1
+;';
+  $albums = query2array($query, 'id');
+
+  foreach ($albums as $id => $album)
+  {
+    $path_tokens = array();
+    foreach (explode(',', $album['uppercats']) as $uppercat_id)
+    {
+      $path_tokens[] = $albums[$uppercat_id]['dir'];
+    }
+    
+    $albums[$id]['path'] = implode('/', $path_tokens);
+  }
+
+  foreach ($albums as $id => $album)
+  {
+    $piwigo_paths[$album['path']] = 'c'.$id;
+  }
+  unset($albums);
+
+  ksort($piwigo_paths);
+  // echo '<pre>'; print_r($piwigo_paths); echo '</pre>';
+
+  m2p_db_connect();
+
+  // Gallery2 parent Ids (root is always 7!)
+  $ids = array(7,0,0,0,0,0);
+  // Piwigo uppercats
+  $uct = array('NULL',0,0,0,0,0);
+  $ranks = array();
+
+  foreach ($piwigo_paths as $dir => $piwigo_id)
+  {
+    $path = explode('/', $dir);
+    $basename = $path[count($path)-1];
+    $level = count($path);
+
+    $parentId = $ids[$level-1];
+
+    // get id and title/summary/description of tail element in path
+    $query = "
+SELECT 
+    f.".$pc."id,
+    i.".$pc."title,
+    i.".$pc."summary,
+    i.".$pc."description,
+    i.".$pc."canContainChildren,
+    a.".$pc."orderWeight,
+    a.".$pc."viewCount,
+    FROM_UNIXTIME(e.".$pc."creationTimestamp)
+  FROM ".$pt."Item i
+    JOIN ".$pt."FileSystemEntity f ON i.".$pc."id = f.".$pc."id
+    JOIN ".$pt."ChildEntity c ON f.".$pc."id = c.".$pc."id
+    JOIN ".$pt."ItemAttributesMap a ON i.".$pc."id = a.".$pc."itemId
+    JOIN ".$pt."Entity e ON e.".$pc."id = i.".$pc."id
+  WHERE c.".$pc."parentId = ".$parentId."
+    AND f.".$pc."pathComponent='".$basename."'
+;";
+    // echo '<pre>'.$query."</pre>";
+    $row = pwg_db_fetch_row(pwg_query($query));
+    
+    // print "$row[4] - $parentId -> $row[0] : $row[1] $row[2] $row[3]\n";
+    $title = m2p_remove_bbcode($row[1]);
+    $summary = m2p_remove_bbcode($row[2]);
+    $description = m2p_remove_bbcode($row[3]);
+    $weight = $row[5];
+    $views = $row[6];
+    $date_available = $row[7];
+    $ids[$level] = $row[0];
+    $pid[$row[0]] = $dir;
+
+    if ($row[4] == 0)
+    {
+      // Menalto says it's an image
+
+      if (strpos($piwigo_id, 'i') === false)
+      {
+        echo 'Error, '.$piwig_id.' is not an image and Menalto says it is an image';
+      }
+      
+      $comment = "";
+      if ( $summary != "" and $description != "" )
+      {
+        $comment = "<b>$summary</b> - $description";
+      }
+      else
+      {
+        if ($summary != "")
+        {
+          $comment = $summary;
+        }
+        else
+        {
+          $comment = $description;
+        }
+      }
+
+      $image_id = substr($piwigo_id, 1);
+      
+      $image_updates[] = array(
+        'id' => $image_id,
+        'name' => pwg_db_real_escape_string($title),
+        'comment' => pwg_db_real_escape_string($comment),
+        'date_available' => $date_available,
+        );
+      
+      // build a map from gallery2 ids to piwigo image ids
+      $iid[$row[0]] = $image_id;
+    }
+    else
+    {
+      // album (folder)
+      if (strpos($piwigo_id, 'c') === false)
+      {
+        echo 'Error, '.$piwig_id.' is not an album and Menalto says it is an album';
+      }
+      
+      $comment = "";
+      if ( $summary != "" and $description != "" )
+      {
+        $comment = "$summary <!--complete--> $description";
+      }
+      else
+      {
+        if ($summary != "")
+        {
+          $comment = $summary;
+        }
+        else
+        {
+          $comment = "<!--complete-->$description";
+        }
+      }
+
+      // get piwigo category id
+      $cat_id = substr($piwigo_id, 1);
+      $uct[$level] = $cat_id;
+      
+      $cat_updates[] = array(
+        'id' => $cat_id,
+        'name' => pwg_db_real_escape_string($title),
+        'comment' => pwg_db_real_escape_string($comment),
+        'rank' => $weight,
+        );
+
+      // get highlight picture 
+      $query = "
+SELECT d2.".$pc."derivativeSourceId 
+  FROM ".$pt."ChildEntity c
+    JOIN ".$pt."Derivative d1 ON c.".$pc."id = d1.".$pc."id
+    JOIN ".$pt."Derivative d2 ON d1.".$pc."derivativeSourceId=d2.".$pc."id
+  WHERE c.".$pc."parentId = ".$ids[$level];
+      $subresult = pwg_query($query);
+      $subrow = pwg_db_fetch_row($subresult);
+      $hid[$cat_id] = $subrow[0];
+    }
+  }
+
+  // apply highlites as representative images
+  foreach ($hid as $cat_id => $menalto_id)
+  {
+    if (!empty($menalto_id))
+    {
+      $album_thumbs[] = array(
+        'id' => $cat_id,
+        'representative_picture_id' => $iid[$menalto_id],
+        );
+    }
+  }
+
+  // copy comments
+  $query = "
+SELECT
+    c.".$pc."parentId AS id,
+    t.".$pc."subject AS subject,
+    t.".$pc."comment AS comment,
+    t.".$pc."author AS author,
+    FROM_UNIXTIME(t.".$pc."date) AS date
+  FROM ".$pt."ChildEntity c
+    JOIN ".$pt."Comment t ON t.".$pc."id = c.".$pc."id
+  WHERE t.".$pc."publishStatus=0
+";
+  $result = pwg_query($query);
+  while ($row = pwg_db_fetch_assoc($result))
+  {
+    if (isset($iid[ $row['id'] ]))
+    {
+      $comment = $row['comment'];
+      if (!empty($row['subject']))
+      {
+        $comment = '[b]'.$row['subject'].'[/b] '.$comment;
+      }
+
+      $comment_inserts[] = array(
+        'image_id' => $iid[ $row['id'] ],
+        'date' => $row['date'],
+        'author' => pwg_db_real_escape_string($row['author']),
+        'content' => pwg_db_real_escape_string($comment),
+        'validated' => 'true',
+        );
+    }
+  }
+
+  m2p_db_disconnect();
+
+  // echo '<pre>'; print_r($image_updates); echo '</pre>';
+  // echo '<pre>'; print_r($cat_updates); echo '</pre>';
+  // echo '<pre>'; print_r($hid); echo '</pre>';
+  // echo '<pre>'; print_r($iid); echo '</pre>';
+  // echo '<pre>'; print_r($album_thumbs); echo '</pre>';
+  // echo '<pre>'; print_r($comment_inserts); echo '</pre>';
+  
+  mass_updates(
+    IMAGES_TABLE,
+    array(
+      'primary' => array('id'),
+      'update'  => array('name', 'comment', 'date_available'),
+      ),
+    $image_updates
+    );
+
+  mass_updates(
+    CATEGORIES_TABLE,
+    array(
+      'primary' => array('id'),
+      'update'  => array('name', 'comment', 'rank'),
+      ),
+    $cat_updates
+    );
+
+  mass_updates(
+    CATEGORIES_TABLE,
+    array(
+      'primary' => array('id'),
+      'update'  => array('representative_picture_id'),
+      ),
+    $album_thumbs
+    );
+
+  mass_inserts(
+    COMMENTS_TABLE,
+    array_keys($comment_inserts[0]),
+    $comment_inserts
+    );
+  
+  array_push($page['infos'], l10n('Information data registered in database'));
+}
+
+
+// +-----------------------------------------------------------------------+
+// | Template & Form                                                       |
+// +-----------------------------------------------------------------------+
+
+$template->set_filenames(
+  array(
+    'plugin_admin_content' => dirname(__FILE__).'/admin.tpl'
+    )
+  );
+
+$template->assign('action_url', $admin_base_url);
+$template->assign($conf['menalto2piwigo']);
+
+// +-----------------------------------------------------------------------+
+// | Sending html                                                          |
+// +-----------------------------------------------------------------------+
+
+$template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content');
+?>
Index: /extensions/menalto2piwigo/admin.tpl
===================================================================
--- /extensions/menalto2piwigo/admin.tpl	(revision 28825)
+++ /extensions/menalto2piwigo/admin.tpl	(revision 28825)
@@ -0,0 +1,59 @@
+{html_style}{literal}
+fieldset p {text-align:left;}
+{/literal}{/html_style}
+
+<div class="titrePage">
+  <h2>{'Import from Menalto'|translate}</h2>
+</div>
+
+<fieldset>
+  <legend>{'Help'|translate}</legend>
+  <p>{'Menalto2Piwigo plugin imports data from a Menalto Gallery2 installation into Piwigo.'|translate} {'Imported properties:'|translate}</p>
+  <ul>
+    <li>{'Title and description for photos'|translate}</li>
+    <li>{'Name and description for albums'|translate}</li>
+    <li>{'User comments on photos'|translate}</li>
+  </ul>
+
+  <p><strong>{'How to use it?'|translate}</strong></p>
+
+  <ol>
+    <li>{'Copy the content of g2data/albums into piwigo/galleries'|translate}</li>
+    <li><a href="admin.php?page=site_update&amp;site=1">{'Synchronize'|translate}</a></li>
+    <li>{'Submit the form at the end of this page'|translate}</li>
+    <li>{'Install and activate plugins:'|translate} <a href="http://piwigo.org/ext/extension_view.php?eid=175" target="_blank">Extended Description</a></li>
+  </ol>
+</fieldset>
+
+<form method="post" action="{$action_url}">
+<fieldset>
+  <legend>{'Import'|translate}</legend>
+
+  <p><strong>{'database host'|translate}</strong><br>
+    <input type="text" name="db_host" value="{$db_host}">
+  </p>
+
+  <p><strong>{'database name'|translate}</strong><br>
+    <input type="text" name="db_name" value="{$db_name}">
+  </p>
+
+  <p><strong>{'database user'|translate}</strong><br>
+    <input type="text" name="db_user" value="{$db_user}">
+  </p>
+
+  <p><strong>{'database password'|translate}</strong><br>
+    <input type="password" name="db_password" value="{$db_password}">
+  </p>
+
+  <p><strong>{'table prefix'|translate}</strong><br>
+    <input type="text" name="prefix_table" value="{$prefix_table}">
+  </p>
+
+  <p><strong>{'column prefix'|translate}</strong><br>
+    <input type="text" name="prefix_column" value="{$prefix_column}">
+  </p>
+
+  <p class="actionButtons">
+    <input class="submit" type="submit" name="submit" value="{'Start import'|@translate}"/>
+  </p>
+</form>
Index: /extensions/menalto2piwigo/include/functions.inc.php
===================================================================
--- /extensions/menalto2piwigo/include/functions.inc.php	(revision 28825)
+++ /extensions/menalto2piwigo/include/functions.inc.php	(revision 28825)
@@ -0,0 +1,57 @@
+<?php
+function m2p_db_connect()
+{
+  global $conf;
+
+  try
+  {
+    pwg_db_connect(
+      $conf['menalto2piwigo']['db_host'],
+      $conf['menalto2piwigo']['db_user'],
+      $conf['menalto2piwigo']['db_password'],
+      $conf['menalto2piwigo']['db_name']
+      );
+  }
+  catch (Exception $e)
+  {
+    my_error(l10n($e->getMessage()), true);
+  }
+
+  pwg_db_check_charset();
+
+  return true;
+}
+
+function m2p_db_disconnect()
+{
+  global $conf;
+
+  // reconnect to the Piwigo database
+  $pwg_db_link = pwg_db_connect(
+    $conf['db_host'],
+    $conf['db_user'],
+    $conf['db_password'],
+    $conf['db_base']
+    );
+
+  pwg_db_check_charset();
+}
+
+function m2p_remove_bbcode($string)
+{
+  $patterns = array(
+    '\[color=\w+\]',
+    '\[/color\]',
+    '\[b\]',
+    '\[/b\]',
+    '\[i\]',
+    '\[/i\]',
+    );
+
+  foreach ($patterns as $pattern)
+  {
+    $string = preg_replace('#'.$pattern.'#', '', $string);
+  }
+
+  return $string;
+}
Index: /extensions/menalto2piwigo/language/en_UK/description.txt
===================================================================
--- /extensions/menalto2piwigo/language/en_UK/description.txt	(revision 28825)
+++ /extensions/menalto2piwigo/language/en_UK/description.txt	(revision 28825)
@@ -0,0 +1,1 @@
+import data from a Menalto Gallery into Piwigo
Index: /extensions/menalto2piwigo/language/en_UK/index.php
===================================================================
--- /extensions/menalto2piwigo/language/en_UK/index.php	(revision 28825)
+++ /extensions/menalto2piwigo/language/en_UK/index.php	(revision 28825)
@@ -0,0 +1,30 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Piwigo - a PHP based picture gallery                                  |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2008-2009 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/menalto2piwigo/language/en_UK/plugin.lang.php
===================================================================
--- /extensions/menalto2piwigo/language/en_UK/plugin.lang.php	(revision 28825)
+++ /extensions/menalto2piwigo/language/en_UK/plugin.lang.php	(revision 28825)
@@ -0,0 +1,40 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Piwigo - a PHP based picture gallery                                  |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2008-2014 Piwigo Team                  http://piwigo.org |
+// +-----------------------------------------------------------------------+
+// | 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.                                                                  |
+// +-----------------------------------------------------------------------+
+
+$lang['Import from Menalto'] = 'Import from Menalto';
+$lang['Menalto2Piwigo plugin imports data from a Menalto Gallery2 installation into Piwigo.'] = 'Menalto2Piwigo plugins imports data from a Menalto Gallery2 installation into Piwigo.';
+$lang['Imported properties:'] = 'Imported properties:';
+$lang['Title and description for photos'] = 'Title and description for photos';
+$lang['Name and description for albums'] = 'Name and description for albums';
+$lang['User comments on photos'] = 'User comments on photos';
+$lang['How to use it?'] = 'How to use it?';
+$lang['Copy the content of g2data/albums into piwigo/galleries'] = 'Copy the content of g2data/albums into piwigo/galleries';
+$lang['Submit the form at the end of this page'] = 'Submit the form at the end of this page';
+$lang['Install and activate plugins:'] = 'Install and activate plugins:';
+$lang['Import'] = 'Import';
+$lang['database host'] = 'database host';
+$lang['database name'] = 'database name';
+$lang['database user'] = 'database user';
+$lang['database password'] = 'database password';
+$lang['table prefix'] = 'table prefix';
+$lang['column prefix'] = 'column prefix';
+$lang['Start import'] = 'Start import';
+?>
Index: /extensions/menalto2piwigo/language/fr_FR/description.txt
===================================================================
--- /extensions/menalto2piwigo/language/fr_FR/description.txt	(revision 28825)
+++ /extensions/menalto2piwigo/language/fr_FR/description.txt	(revision 28825)
@@ -0,0 +1,1 @@
+importe les données de Menalto Gallery vers Piwigo
Index: /extensions/menalto2piwigo/language/fr_FR/index.php
===================================================================
--- /extensions/menalto2piwigo/language/fr_FR/index.php	(revision 28825)
+++ /extensions/menalto2piwigo/language/fr_FR/index.php	(revision 28825)
@@ -0,0 +1,30 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Piwigo - a PHP based picture gallery                                  |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2008-2009 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/menalto2piwigo/language/fr_FR/plugin.lang.php
===================================================================
--- /extensions/menalto2piwigo/language/fr_FR/plugin.lang.php	(revision 28825)
+++ /extensions/menalto2piwigo/language/fr_FR/plugin.lang.php	(revision 28825)
@@ -0,0 +1,40 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Piwigo - a PHP based picture gallery                                  |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2008-2014 Piwigo Team                  http://piwigo.org |
+// +-----------------------------------------------------------------------+
+// | 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.                                                                  |
+// +-----------------------------------------------------------------------+
+
+$lang['Import from Menalto'] = 'Importer depuis Menalto';
+$lang['Menalto2Piwigo plugin imports data from a Menalto Gallery2 installation into Piwigo.'] = 'Le plugin Menalto2Piwigo importe les données depuis une installation Menalto Gallery2 sur Piwigo.';
+$lang['Imported properties:'] = 'Propriétés importées :';
+$lang['Title and description for photos'] = 'Titre et description des photos';
+$lang['Name and description for albums'] = 'Nom et description des albums';
+$lang['User comments on photos'] = 'Commentaires utilisateur sur les photos';
+$lang['How to use it?'] = 'Comment l\'utiliser ?';
+$lang['Copy the content of g2data/albums into piwigo/galleries'] = 'Copier le contenu de g2data/albums dans piwigo/galleries';
+$lang['Submit the form at the end of this page'] = 'Valider le formulaire en bas de cette page';
+$lang['Install and activate plugins:'] = 'Installer et activer les plugins :';
+$lang['Import'] = 'Import';
+$lang['database host'] = 'Base de données, hôte';
+$lang['database name'] = 'Base de données, nom';
+$lang['database user'] = 'Base de données, utilisateur';
+$lang['database password'] = 'Base de données, mot de passe';
+$lang['table prefix'] = 'Préfixe des tables';
+$lang['column prefix'] = 'Préfixe des colonnes';
+$lang['Start import'] = 'Lancer l\'import';
+?>
Index: /extensions/menalto2piwigo/main.inc.php
===================================================================
--- /extensions/menalto2piwigo/main.inc.php	(revision 28825)
+++ /extensions/menalto2piwigo/main.inc.php	(revision 28825)
@@ -0,0 +1,40 @@
+<?php
+/*
+Plugin Name: Menalto2Piwigo
+Version: auto
+Description: import data from a Menalto Gallery into Piwigo
+Plugin URI: http://piwigo.org/ext/extension_view.php?eid=
+Author: plg
+Author URI: http://le-gall.net/pierrick
+*/
+
+if (!defined('PHPWG_ROOT_PATH'))
+{
+  die('Hacking attempt!');
+}
+
+// +-----------------------------------------------------------------------+
+// | Define plugin constants                                               |
+// +-----------------------------------------------------------------------+
+
+defined('M2P_ID') or define('M2P_ID', basename(dirname(__FILE__)));
+define('M2P_PATH' ,   PHPWG_PLUGINS_PATH.M2P_ID . '/');
+
+// +-----------------------------------------------------------------------+
+// | Add event handlers                                                    |
+// +-----------------------------------------------------------------------+
+
+add_event_handler('get_admin_plugin_menu_links', 'm2p_admin_menu');
+function m2p_admin_menu($menu)
+{
+  array_push(
+    $menu,
+    array(
+      'NAME' => 'Menalto2Piwigo',
+      'URL'  => get_root_url().'admin.php?page=plugin-'.M2P_ID,
+      )
+    );
+
+  return $menu;
+}
+?>
