Index: /extensions/Fotorama/admin.php
===================================================================
--- /extensions/Fotorama/admin.php	(revision 27148)
+++ /extensions/Fotorama/admin.php	(revision 27148)
@@ -0,0 +1,33 @@
+<?php
+
+defined('FOTORAMA_PATH') or die('Hacking attempt!');
+
+global $conf, $template, $page;
+
+if (isset($_POST['submit']))
+{
+  $conf['Fotorama'] = array(
+    'shadows' => isset($_POST['shadows']),
+    'autoplay' => isset($_POST['autoplay']),
+    'stopautoplayontouch' => isset($_POST['stopautoplayontouch']),
+    'loop' => isset($_POST['loop']),
+    );
+  if (isset($_POST['allowfullscreen']))
+    $conf['Fotorama']['allowfullscreen'] = $_POST['allowfullscreen'];
+  if (isset($_POST['fit']))
+    $conf['Fotorama']['fit'] = $_POST['fit'];
+  if (isset($_POST['transition']))
+    $conf['Fotorama']['transition'] = $_POST['transition'];
+
+  conf_update_param('Fotorama', serialize($conf['Fotorama']));
+  $page['infos'][] = l10n('Information data registered in database');
+}
+
+$template->assign(array(
+  'Fotorama' => $conf['Fotorama'],
+  ));
+
+$template->set_filename('admintools_content', realpath(FOTORAMA_PATH . 'template/admin.tpl'));
+$template->assign_var_from_handle('ADMIN_CONTENT', 'admintools_content');
+
+?>
Index: /extensions/Fotorama/main.inc.php
===================================================================
--- /extensions/Fotorama/main.inc.php	(revision 27147)
+++ /extensions/Fotorama/main.inc.php	(revision 27148)
@@ -2,5 +2,5 @@
 /*
 Plugin Name: Fotorama
-Version: 2.6.a
+Version: 2.6.d
 Description: Fotorama based full-screen slideshow
 Author: JanisV
@@ -13,15 +13,26 @@
 if (mobile_theme()) return;
 
-define('FOTORAMA_PATH' , PHPWG_PLUGINS_PATH . basename(dirname(__FILE__)) . '/'); 
+define('FOTORAMA_ID',       basename(dirname(__FILE__)));
+define('FOTORAMA_PATH' ,    PHPWG_PLUGINS_PATH . FOTORAMA_ID . '/');
+define('FOTORAMA_ADMIN',    get_root_url() . 'admin.php?page=plugin-' . FOTORAMA_ID);
 
 add_event_handler('init', 'Fotorama_init');
+if (defined('IN_ADMIN'))
+{
+  add_event_handler('get_admin_plugin_menu_links', 'Fotorama_admin_menu');
+} 
 
 function Fotorama_init()
 {
-  global $conf, $user, $page;
+  global $conf;
   
+  load_language('plugin.lang', FOTORAMA_PATH);
+
+  $conf['Fotorama'] = unserialize($conf['Fotorama']);
+
   add_event_handler('loc_end_picture', 'Fotorama_end_picture');
   add_event_handler('loc_end_page_header', 'Fotorama_end_page_header');
 }
+
 function Fotorama_end_picture()
 {
@@ -94,4 +105,5 @@
     $template->assign('items', $picture);
     $template->assign('current_rank', $page['current_rank']);
+    $template->assign(array('Fotorama' => $conf['Fotorama']));
     $template->set_filenames( array('slideshow' => realpath(FOTORAMA_PATH.'template/slideshow.tpl')));
   }
@@ -112,3 +124,13 @@
 }
 
+function Fotorama_admin_menu($menu)
+{
+  $menu[] = array(
+    'NAME' => 'Fotorama',
+    'URL'  => FOTORAMA_ADMIN,
+  );
+
+  return $menu;
+}
+
 ?>
Index: /extensions/Fotorama/maintain.inc.php
===================================================================
--- /extensions/Fotorama/maintain.inc.php	(revision 27148)
+++ /extensions/Fotorama/maintain.inc.php	(revision 27148)
@@ -0,0 +1,62 @@
+<?php
+
+defined('PHPWG_ROOT_PATH') or die('Hacking attempt!');
+
+class Fotorama_maintain extends PluginMaintain
+{
+  private $installed = false;
+
+  private $default_conf = array(
+    'allowfullscreen' => 'native',
+    'fit' => 'scaledown',
+    'transition' => 'slide',
+    'shadows' => false,
+    'autoplay' => true,
+    'stopautoplayontouch' => false,
+    'loop' => true,
+  );
+
+  function __construct($plugin_id)
+  {
+    parent::__construct($plugin_id);
+  }
+
+  function install($plugin_version, &$errors=array())
+  {
+    global $conf;
+
+    if (empty($conf['Fotorama']))
+    {
+      $conf['Fotorama'] = serialize($this->default_conf);
+      conf_update_param('Fotorama', $conf['Fotorama']);
+    }
+    else
+    {
+      $new_conf = is_string($conf['Fotorama']) ? unserialize($conf['Fotorama']) : $conf['Fotorama'];
+
+      $conf['Fotorama'] = serialize($new_conf);
+      conf_update_param('Fotorama', $conf['Fotorama']);
+    }
+    
+    $this->installed = true;
+  }
+
+  function activate($plugin_version, &$errors=array())
+  {
+    if (!$this->installed)
+    {
+      $this->install($plugin_version, $errors);
+    }
+  }
+
+  function deactivate()
+  {
+  }
+
+  function uninstall()
+  {
+    conf_delete_param('Fotorama');
+  }
+}
+
+?>
Index: /extensions/Fotorama/template/admin.tpl
===================================================================
--- /extensions/Fotorama/template/admin.tpl	(revision 27148)
+++ /extensions/Fotorama/template/admin.tpl	(revision 27148)
@@ -0,0 +1,72 @@
+<div class="titrePage">
+<h2>Fotorama</h2>
+</div>
+
+<form action="" method="post" class="properties">
+
+<fieldset id="Fotorama">
+<legend>{'Configuration'|@translate}</legend>
+<ul>
+  <li>
+    <label for="allowfullscreen">
+      <b>{'allowfullscreen'|@translate}</b> 
+    </label>
+    <select class="categoryDropDown" id="allowfullscreen" name="allowfullscreen">
+      <option value="false"{if $Fotorama.allowfullscreen == 'false'} selected{/if}>{'false'|@translate}</option>
+      <option value="true"{if $Fotorama.allowfullscreen == 'true'} selected{/if}>{'true'|@translate}</option>
+      <option value="native"{if $Fotorama.allowfullscreen == 'native'} selected{/if}>{'native'|@translate}</option>
+    </select>
+  </li>
+  <li>
+    <label for="fit">
+      <b>{'fit'|@translate}</b> 
+    </label>
+    <select class="categoryDropDown" id="fit" name="fit">
+      <option value="contain"{if $Fotorama.fit == 'contain'} selected{/if}>{'contain'|@translate}</option>
+      <option value="cover"{if $Fotorama.fit == 'cover'} selected{/if}>{'cover'|@translate}</option>
+      <option value="scaledown"{if $Fotorama.fit == 'scaledown'} selected{/if}>{'scaledown'|@translate}</option>
+      <option value="none"{if $Fotorama.fit == 'none'} selected{/if}>{'none'|@translate}</option>
+    </select>
+  </li>
+  <li>
+    <label for="transition">
+      <b>{'transition'|@translate}</b> 
+    </label>
+    <select class="categoryDropDown" id="transition" name="transition">
+      <option value="slide"{if $Fotorama.transition == 'slide'} selected{/if}>{'slide'|@translate}</option>
+      <option value="crossfade"{if $Fotorama.transition == 'crossfade'} selected{/if}>{'crossfade'|@translate}</option>
+      <option value="dissolve"{if $Fotorama.transition == 'dissolve'} selected{/if}>{'dissolve'|@translate}</option>
+    </select>
+  </li>
+  <li>
+    <input type="checkbox" id="shadows" name="shadows"{if $Fotorama.shadows} checked="checked"{/if}>
+    <label for="shadows">
+      <b>{'shadows'|@translate}</b>
+    </label>
+  </li>
+  <li>
+    <input type="checkbox" id="autoplay" name="autoplay"{if $Fotorama.autoplay} checked="checked"{/if}>
+    <label for="autoplay">
+      <b>{'autoplay'|@translate}</b>
+    </label>
+  </li>
+  <li>
+    <input type="checkbox" id="stopautoplayontouch" name="stopautoplayontouch"{if $Fotorama.stopautoplayontouch} checked="checked"{/if}>
+    <label for="stopautoplayontouch">
+      <b>{'stopautoplayontouch'|@translate}</b>
+    </label>
+  </li>
+  <li>
+    <input type="checkbox" id="loop" name="loop"{if $Fotorama.loop} checked="checked"{/if}>
+    <label for="loop">
+      <b>{'loop'|@translate}</b>
+    </label>
+  </li>
+</ul>
+</fieldset>
+
+<p class="formButtons">
+  <input type="hidden" name="pwg_token" value="{$PWG_TOKEN}">
+  <input type="submit" name="submit" value="{'Save Settings'|@translate}">
+</p>
+</form>
Index: /extensions/Fotorama/template/index.php
===================================================================
--- /extensions/Fotorama/template/index.php	(revision 27148)
+++ /extensions/Fotorama/template/index.php	(revision 27148)
@@ -0,0 +1,7 @@
+<?php
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: /extensions/Fotorama/template/slideshow.tpl
===================================================================
--- /extensions/Fotorama/template/slideshow.tpl	(revision 27147)
+++ /extensions/Fotorama/template/slideshow.tpl	(revision 27148)
@@ -18,6 +18,8 @@
 	<div id="content">
 	<div id="theImage">
-      <div class="fotorama" data-startindex="{$current_rank}" data-ratio="16/9" data-fit="scaledown" data-auto="false"
-        data-width="100%" data-maxheight="100%" data-minheight="200" data-height="{$item_height}" data-allowfullscreen="native" data-autoplay=true data-stopautoplayontouch=false data-loop=true data-nav=false>
+      <div class="fotorama" data-startindex="{$current_rank}" data-ratio="16/9" data-fit="{$Fotorama['fit']}" data-auto="false"
+        data-width="100%" data-maxheight="100%" data-minheight="200" data-height="{$item_height}" data-shadows="{$Fotorama['shadows']}"
+        data-allowfullscreen="{$Fotorama['allowfullscreen']}" data-autoplay="{if $Fotorama['autoplay']}true{else}false{/if}" data-transition="{$Fotorama['transition']}"
+        data-stopautoplayontouch="{$Fotorama['stopautoplayontouch']}" data-loop="{$Fotorama['stopautoplayontouch']}" data-nav=false>
       {foreach from=$items item=thumbnail}
         <a href="{$thumbnail['derivative']->get_url()}" data-full="{$thumbnail['derivative_big']->get_url()}" data-url="{$thumbnail['url']}" data-title="{$thumbnail['TITLE']}"></a>
