Index: /extensions/Extra_special_functions/tags/2.1.b/index.php
===================================================================
--- /extensions/Extra_special_functions/tags/2.1.b/index.php	(revision 7770)
+++ /extensions/Extra_special_functions/tags/2.1.b/index.php	(revision 7770)
@@ -0,0 +1,8 @@
+<?php
+// Recursive call
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: /extensions/Extra_special_functions/tags/2.1.b/language/cs_CZ/description.txt
===================================================================
--- /extensions/Extra_special_functions/tags/2.1.b/language/cs_CZ/description.txt	(revision 7770)
+++ /extensions/Extra_special_functions/tags/2.1.b/language/cs_CZ/description.txt	(revision 7770)
@@ -0,0 +1,1 @@
+Do menu Zobrazit přidá funkce 'Všechny objekty pod-kategorií', 'Kalendář podle data vložení', 'Kalendář podle data vytvoření' a funkci 'Zobrazit nově vložené / všechny'.
Index: /extensions/Extra_special_functions/tags/2.1.b/language/cs_CZ/index.php
===================================================================
--- /extensions/Extra_special_functions/tags/2.1.b/language/cs_CZ/index.php	(revision 7770)
+++ /extensions/Extra_special_functions/tags/2.1.b/language/cs_CZ/index.php	(revision 7770)
@@ -0,0 +1,8 @@
+<?php
+// Recursive call
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: /extensions/Extra_special_functions/tags/2.1.b/language/cs_CZ/plugin.lang.php
===================================================================
--- /extensions/Extra_special_functions/tags/2.1.b/language/cs_CZ/plugin.lang.php	(revision 7770)
+++ /extensions/Extra_special_functions/tags/2.1.b/language/cs_CZ/plugin.lang.php	(revision 7770)
@@ -0,0 +1,9 @@
+<?php
+
+$lang['posted-monthly-calendar'] = 'Kalendář podle data vložení';
+$lang['created-monthly-calendar'] = 'Kalendář podle data vytvoření';
+$lang['flat'] = 'Všechny objekty pod-kategorií';
+$lang['filter-start-recent'] = 'Zobrazit nově vložené';
+$lang['filter-stop'] = 'Zobrazit všechny';
+
+?>
Index: /extensions/Extra_special_functions/tags/2.1.b/language/en_UK/description.txt
===================================================================
--- /extensions/Extra_special_functions/tags/2.1.b/language/en_UK/description.txt	(revision 7770)
+++ /extensions/Extra_special_functions/tags/2.1.b/language/en_UK/description.txt	(revision 7770)
@@ -0,0 +1,1 @@
+Adds functions 'Flat all elements', 'Calendar by posted date', 'Calendar by creation date' and toggle function 'Display recently posted / all' into special functions.
Index: /extensions/Extra_special_functions/tags/2.1.b/language/en_UK/index.php
===================================================================
--- /extensions/Extra_special_functions/tags/2.1.b/language/en_UK/index.php	(revision 7770)
+++ /extensions/Extra_special_functions/tags/2.1.b/language/en_UK/index.php	(revision 7770)
@@ -0,0 +1,8 @@
+<?php
+// Recursive call
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: /extensions/Extra_special_functions/tags/2.1.b/language/en_UK/plugin.lang.php
===================================================================
--- /extensions/Extra_special_functions/tags/2.1.b/language/en_UK/plugin.lang.php	(revision 7770)
+++ /extensions/Extra_special_functions/tags/2.1.b/language/en_UK/plugin.lang.php	(revision 7770)
@@ -0,0 +1,9 @@
+<?php
+
+$lang['posted-monthly-calendar'] = 'Calendar by post date';
+$lang['created-monthly-calendar'] = 'Calendar by creation date';
+$lang['flat'] = 'All photos';
+$lang['filter-start-recent'] = 'Display recently posted';
+$lang['filter-stop'] = 'Display all';
+
+?>
Index: /extensions/Extra_special_functions/tags/2.1.b/language/fr_FR/description.txt
===================================================================
--- /extensions/Extra_special_functions/tags/2.1.b/language/fr_FR/description.txt	(revision 7770)
+++ /extensions/Extra_special_functions/tags/2.1.b/language/fr_FR/description.txt	(revision 7770)
@@ -0,0 +1,1 @@
+Ajoute les fonctionnalités "Tous les éléments", "Calendrier par date d'ajout", "Calendrier par date de création", et l'option "Ajouté récemment / Tout afficher" dans le menu "Spéciales".
Index: /extensions/Extra_special_functions/tags/2.1.b/language/fr_FR/index.php
===================================================================
--- /extensions/Extra_special_functions/tags/2.1.b/language/fr_FR/index.php	(revision 7770)
+++ /extensions/Extra_special_functions/tags/2.1.b/language/fr_FR/index.php	(revision 7770)
@@ -0,0 +1,8 @@
+<?php
+// Recursive call
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: /extensions/Extra_special_functions/tags/2.1.b/language/fr_FR/plugin.lang.php
===================================================================
--- /extensions/Extra_special_functions/tags/2.1.b/language/fr_FR/plugin.lang.php	(revision 7770)
+++ /extensions/Extra_special_functions/tags/2.1.b/language/fr_FR/plugin.lang.php	(revision 7770)
@@ -0,0 +1,9 @@
+<?php
+
+$lang['posted-monthly-calendar'] = 'Calendrier par date d\'ajout';
+$lang['created-monthly-calendar'] = 'Calendrier par date de création';
+$lang['flat'] = 'Toutes les photos';
+$lang['filter-start-recent'] = 'Ajoutés récemment';
+$lang['filter-stop'] = 'Tout afficher';
+
+?>
Index: /extensions/Extra_special_functions/tags/2.1.b/language/index.php
===================================================================
--- /extensions/Extra_special_functions/tags/2.1.b/language/index.php	(revision 7770)
+++ /extensions/Extra_special_functions/tags/2.1.b/language/index.php	(revision 7770)
@@ -0,0 +1,8 @@
+<?php
+// Recursive call
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: /extensions/Extra_special_functions/tags/2.1.b/language/it_IT/description.txt
===================================================================
--- /extensions/Extra_special_functions/tags/2.1.b/language/it_IT/description.txt	(revision 7770)
+++ /extensions/Extra_special_functions/tags/2.1.b/language/it_IT/description.txt	(revision 7770)
@@ -0,0 +1,1 @@
+Aggiunge le funzionalità "Tutti gli elementi", "Calendario per data di aggiunta", "Calendario per data di creazione", e l'opzione "Aggiunti di recente / Mostra tutto" nel menu "Speciale".
Index: /extensions/Extra_special_functions/tags/2.1.b/language/it_IT/index.php
===================================================================
--- /extensions/Extra_special_functions/tags/2.1.b/language/it_IT/index.php	(revision 7770)
+++ /extensions/Extra_special_functions/tags/2.1.b/language/it_IT/index.php	(revision 7770)
@@ -0,0 +1,8 @@
+<?php
+// Recursive call
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: /extensions/Extra_special_functions/tags/2.1.b/main.inc.php
===================================================================
--- /extensions/Extra_special_functions/tags/2.1.b/main.inc.php	(revision 7770)
+++ /extensions/Extra_special_functions/tags/2.1.b/main.inc.php	(revision 7770)
@@ -0,0 +1,113 @@
+<?php
+/*
+Plugin Name: Extra special functions
+Version: 2.1.a
+Description: Adds functions 'Flat all elements', 'Calendar by posted date', 'Calendar by creation date' and toggle function 'Display recently posted / all' into special functions.
+Plugin URI: http://piwigo.org/ext/extension_view.php?eid=460
+Author: Pavel Budka
+Author URI: http://budkovi.ic.cz
+*/
+
+if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+
+function add_extra_functions($menu_ref_arr)
+{
+  $menu = & $menu_ref_arr[0];
+  global $filter, $user;
+  
+  if (($block = $menu->get_block('mbSpecials')) != null )
+  {
+    load_language('plugin.lang', PHPWG_PLUGINS_PATH . basename(dirname(__FILE__)) . '/');
+
+    $str = $_SERVER['QUERY_STRING'];
+    $args = explode('&',$str);
+    $filter_rec = ($filter['enabled'] && $filter['recent_period']!=-1);
+    // remove previously added extra functions from url
+    $url_rest='';
+    foreach($args as $arg) {
+    if (strncmp($arg,'filter',6) == 0)
+      ; // ommit this parameter 
+    elseif (!empty($arg) && $arg[0] != '/')
+        $url_rest.='&'.$arg;
+    else
+      $cat_arg=$arg;
+      } // foreach
+    if (isset($cat_arg))
+      $cat_els = explode('/',$cat_arg);
+    else
+      $cat_els = array();
+          
+    // set of modificatiors
+    $items = array('flat' => 'display all elements in all sub-albums', 
+                'posted-monthly-calendar' => 'display a calendar by posted date',
+                'created-monthly-calendar' => 'display a calendar by creation date');
+                
+    // remove previously added extra functions from url
+    foreach($items as $item => $label)
+      if(($id=array_search($item,$cat_els)) != false)
+        unset($cat_els[$id]);
+    $cat_els=array_values($cat_els);
+                
+    // TODO: &filter=start-recent-20, &filter=stop
+    
+    // remove other functions
+//    $block->data=array();
+    
+    // add extra functions to url and to menu
+    foreach($items as $item => $label) {
+    // prepare url
+    array_push ($cat_els,$item);
+   
+    $url='';
+    foreach($cat_els as $cat_el)
+      if (empty($url)) 
+        $url.='?'.$cat_el;
+      else 
+        $url.='/'.$cat_el;
+    $url.=$url_rest;
+    array_pop($cat_els);
+    
+    // extend menu
+    array_push($block->data, 
+      array(
+        'URL' => $url,
+        'TITLE' => l10n($label),
+        'NAME' => l10n($item)
+        )
+      
+    );
+  } // for
+  
+  // add filter extra function to url and to menu
+  $url='';
+  foreach($cat_els as $cat_el)
+    if (empty($url)) 
+      $url.='?'.$cat_el;
+    else 
+      $url.='/'.$cat_el;
+  $url.=$url_rest;
+  if ($url[0] == '&') $url[0]='?';  
+
+  // extend menu
+  if(!$filter_rec)
+    array_push($block->data, 
+      array(
+        'URL' => $url.'&'.'filter=start-recent-'.$user['recent_period'],
+        'TITLE' => l10n('display only recently posted images'),
+        'NAME' => l10n('filter-start-recent')
+        ));
+  else 
+    array_push($block->data, 
+      array(
+        'URL' => $url.'&'.'filter=stop',
+        'TITLE' => l10n('return to the display of all images'),
+        'NAME' => l10n('filter-stop')
+        ));
+  
+  } // if
+  
+} // add_link_mostcommented
+
+add_event_handler('blockmanager_apply' , 'add_extra_functions');
+
+?>
