Index: /extensions/lmt/admin/index.php
===================================================================
--- /extensions/lmt/admin/index.php (revision 3396)
+++ /extensions/lmt/admin/index.php (revision 3396)
@@ -0,0 +1,33 @@
+
Index: /extensions/lmt/admin/lmt_admin.tpl
===================================================================
--- /extensions/lmt/admin/lmt_admin.tpl (revision 3396)
+++ /extensions/lmt/admin/lmt_admin.tpl (revision 3396)
@@ -0,0 +1,12 @@
+
+
+
:: {$plugin.LMT_VERSION} ::
+ {'lmt_title'|@translate} {$TABSHEET_TITLE}
+
+ {*{$tabsheet}*}
+
+
+{*{$plugin.LMT_TITLE}
*}
+
+{$LMT_BODY_PAGE}
+
Index: /extensions/lmt/admin/lmt_js.tpl
===================================================================
--- /extensions/lmt/admin/lmt_js.tpl (revision 3396)
+++ /extensions/lmt/admin/lmt_js.tpl (revision 3396)
@@ -0,0 +1,19 @@
+{literal}
+function get_licence_text(txt, published)
+{
+ returned='';
+ switch(txt)
+ {
+ {/literal}
+ {foreach from=$datas.shortlicencetext key=name item=nfo}
+ case '{$name}':
+ returned='{$nfo.txt}';
+ if(published) returned = "{$nfo.published} "+returned;
+ break;
+ {/foreach}
+ {literal}
+ }
+
+ return(returned);
+}
+{/literal}
Index: /extensions/lmt/admin/plugin_admin.php
===================================================================
--- /extensions/lmt/admin/plugin_admin.php (revision 3396)
+++ /extensions/lmt/admin/plugin_admin.php (revision 3396)
@@ -0,0 +1,26 @@
+>
+ ------------------------------------------------------------------------------
+ See main.inc.php for release information
+
+ --------------------------------------------------------------------------- */
+
+if (!defined('PHPWG_ROOT_PATH')) { die('Hacking attempt!'); }
+
+include(LMT_PATH."lmt_aip.class.inc.php");
+
+global $prefixeTable;
+
+load_language('plugin.lang', LMT_PATH);
+
+$main_plugin_object = get_plugin_data($plugin_id);
+
+$plugin_aip = new LMT_AIP($prefixeTable, $main_plugin_object->get_filelocation());
+$plugin_aip->manage();
+?>
Index: /extensions/lmt/admin/plugin_admin_config.tpl
===================================================================
--- /extensions/lmt/admin/plugin_admin_config.tpl (revision 3396)
+++ /extensions/lmt/admin/plugin_admin_config.tpl (revision 3396)
@@ -0,0 +1,332 @@
+{literal}
+
+{/literal}
+
+
+
+
+
+
Index: /extensions/lmt/admin/plugin_admin_help.tpl
===================================================================
--- /extensions/lmt/admin/plugin_admin_help.tpl (revision 3396)
+++ /extensions/lmt/admin/plugin_admin_help.tpl (revision 3396)
@@ -0,0 +1,27 @@
+
+
{'lmt_whatisit'|@translate}
+
{'lmt_whatisit_def1'|@translate}
+
{'lmt_whatisit_def2'|@translate}
+
{'lmt_official_website'|@translate}
+
+
+
{'lmt_four_way'|@translate}
+
+
+
{'lmt_six_licences'|@translate}
+
+
+
+
Index: /extensions/lmt/admin/plugin_admin_list.tpl
===================================================================
--- /extensions/lmt/admin/plugin_admin_list.tpl (revision 3396)
+++ /extensions/lmt/admin/plugin_admin_list.tpl (revision 3396)
@@ -0,0 +1,47 @@
+
+
+
+
+
+
+
+
Index: /extensions/lmt/admin/plugin_admin_listitems.tpl
===================================================================
--- /extensions/lmt/admin/plugin_admin_listitems.tpl (revision 3396)
+++ /extensions/lmt/admin/plugin_admin_listitems.tpl (revision 3396)
@@ -0,0 +1,24 @@
+
+ {foreach from=$imgliste key=name item=data}
+ -
+
+
+ {/foreach}
+
Index: /extensions/lmt/admin/plugin_admin_manage.tpl
===================================================================
--- /extensions/lmt/admin/plugin_admin_manage.tpl (revision 3396)
+++ /extensions/lmt/admin/plugin_admin_manage.tpl (revision 3396)
@@ -0,0 +1,166 @@
+
+{if $nbphotos==0}
+ {'lmt_caddie_is_empty_please_fill_it'|@translate}
+{else}
+
+{literal}
+
+{/literal}
+
+
+
+
+
+
+{/if}
Index: /extensions/lmt/admin/plugin_admin_manageaut.tpl
===================================================================
--- /extensions/lmt/admin/plugin_admin_manageaut.tpl (revision 3396)
+++ /extensions/lmt/admin/plugin_admin_manageaut.tpl (revision 3396)
@@ -0,0 +1,75 @@
+{literal}
+
+{/literal}
+
+{'lmt_author_nfo'|@translate}
+
+
+
+
+
Index: /extensions/lmt/admin/plugin_admin_manageaut_edit.tpl
===================================================================
--- /extensions/lmt/admin/plugin_admin_manageaut_edit.tpl (revision 3396)
+++ /extensions/lmt/admin/plugin_admin_manageaut_edit.tpl (revision 3396)
@@ -0,0 +1,64 @@
+{literal}
+
+{/literal}
+
+
+
+
+
Index: /extensions/lmt/admin/plugin_admin_manageitems.tpl
===================================================================
--- /extensions/lmt/admin/plugin_admin_manageitems.tpl (revision 3396)
+++ /extensions/lmt/admin/plugin_admin_manageitems.tpl (revision 3396)
@@ -0,0 +1,30 @@
+
+ {foreach from=$imgliste key=name item=data}
+ -
+
+
+
+
+
+
+
+
+
+ |
+
+
+
+ [ {$data.catname} ]
+ [ {$data.file} ]
+ {if $data.licencei!=""}
+
+ {$data.aut_text1}
+ {$data.aut_text2}
+ {/if}
+
+ |
+
+
+
+ {/foreach}
+
Index: /extensions/lmt/img/index.php
===================================================================
--- /extensions/lmt/img/index.php (revision 3396)
+++ /extensions/lmt/img/index.php (revision 3396)
@@ -0,0 +1,33 @@
+
Index: /extensions/lmt/index.php
===================================================================
--- /extensions/lmt/index.php (revision 3396)
+++ /extensions/lmt/index.php (revision 3396)
@@ -0,0 +1,33 @@
+
Index: /extensions/lmt/language/en_UK/index.php
===================================================================
--- /extensions/lmt/language/en_UK/index.php (revision 3396)
+++ /extensions/lmt/language/en_UK/index.php (revision 3396)
@@ -0,0 +1,33 @@
+
Index: /extensions/lmt/language/en_UK/plugin.lang.php
===================================================================
--- /extensions/lmt/language/en_UK/plugin.lang.php (revision 3396)
+++ /extensions/lmt/language/en_UK/plugin.lang.php (revision 3396)
@@ -0,0 +1,175 @@
+ This parameter is used to force the maximum height of the display area.';
+$lang['lmt_help_config'][2] = 'Selects whether or not the management of licenses. Compared to completely disable the plugin, this option allows to disable the license management on the public part of the site while retaining the administration of the plugin actived.';
+$lang['lmt_help_config'][3] = 'This option will always display the licence of the element, even if the licence by default it is assigned.
If this option is not activated, the licence will be displayed only for elements with a particular licence.';
+$lang['lmt_help_config'][4] = 'This option allows you to select the licence will be applied by default to the elements for which no licence has been affected.';
+$lang['lmt_help_config'][5] = 'This option allows you to choose whether to display or not the licence by default on all pages (will be shown on the footer).';
+$lang['lmt_help_config'][6] = 'If enabled, the logo indicating the licence is a hyperlink redirecting the user to a page explaining in more detail the operating conditions of the item.';
+$lang['lmt_help_config'][7] = 'The license text displayed at the bottom of the page is changed according to your needs.
It is possible to view items in automatically:
[logo=80x15] insert the 80x15 logo of the default licence
[logo=88x31] insert the 88x31 logo of the default licence
[logo=text]insert the text of the default licence';
+$lang['lmt_help_config'][8] = 'This option allows you to select the author who will be assigned to the licence used by default.';
+$lang['lmt_help_config'][9] = 'This option allows you to choose the number of items displayed per page.';
+$lang['lmt_icon_80x15'] = '80x15 icon';
+$lang['lmt_icon_88x31'] = '88x31 icon';
+$lang['lmt_icon_text'] = 'Text';
+$lang['lmt_image'] = 'Image';
+$lang['lmt_lbl_cc-by'] = 'Attribution';
+$lang['lmt_lbl_cc-by-nc'] = 'Attribution, Non commercial';
+$lang['lmt_lbl_cc-by-nc-nd'] = 'Attribution, Non Commercial, No Derivative Works';
+$lang['lmt_lbl_cc-by-nc-sa'] = 'Attribution, Non Commercial, Share Alike';
+$lang['lmt_lbl_cc-by-nd'] = 'Attribution, No Derivative Works';
+$lang['lmt_lbl_cc-by-sa'] = 'Attribution, Share Alike';
+$lang['lmt_lbl_cc-cleft'] = 'Copyleft';
+$lang['lmt_lbl_cc-cright'] = 'Copyright';
+$lang['lmt_lbl_cc-default'] = 'Licence by default';
+$lang['lmt_lbl_cc_s-by'] = 'Creative Commons BY';
+$lang['lmt_lbl_cc_s-by-nc'] = 'Creative Commons BY-NC';
+$lang['lmt_lbl_cc_s-by-nc-nd'] = 'Creative Commons BY-NC-ND';
+$lang['lmt_lbl_cc_s-by-nc-sa'] = 'Creative Commons BY-NC-SA';
+$lang['lmt_lbl_cc_s-by-nd'] = 'Creative Commons BY-ND';
+$lang['lmt_lbl_cc_s-by-sa'] = 'Creative Commons BY-SA';
+$lang['lmt_lbl_cc_s-cleft'] = 'Copyleft';
+$lang['lmt_lbl_cc_s-cright'] = '© Copyright';
+$lang['lmt_lbl_cc_s-default'] = ' - ';
+$lang['lmt_lbl_under-by'] = 'Published under license';
+$lang['lmt_lbl_under-by-nc'] = 'Published under license';
+$lang['lmt_lbl_under-by-nc-nd'] = 'Published under license';
+$lang['lmt_lbl_under-by-nc-sa'] = 'Published under license';
+$lang['lmt_lbl_under-by-nd'] = 'Published under license';
+$lang['lmt_lbl_under-by-sa'] = 'Published under license';
+$lang['lmt_lbl_under-cleft'] = 'Published under license';
+$lang['lmt_lbl_under-cright'] = '';
+$lang['lmt_lbl_under-default'] = '';
+$lang['lmt_licence'] = 'Licence';
+$lang['lmt_licence_config'] = 'Licences management';
+$lang['lmt_licence_to_apply'] = 'Choice of licence';
+$lang['lmt_list'] = 'Photos licensed';
+$lang['lmt_lst_apply_filter'] = 'Filter';
+$lang['lmt_lst_default_licence'] = 'The photos are by default published under the following licence';
+$lang['lmt_lst_nb_photos'] = 'photos';
+$lang['lmt_lst_special_licence'] = 'The following photos are published with a licence';
+$lang['lmt_manage'] = 'Managing assignments';
+$lang['lmt_manageaut'] = 'Manage authors';
+$lang['lmt_modify'] = 'Edit';
+$lang['lmt_name'] = 'Name';
+$lang['lmt_nav_first'] = 'First';
+$lang['lmt_nav_last'] = 'Last';
+$lang['lmt_nav_next'] = 'Next';
+$lang['lmt_nav_prev'] = 'Previous';
+$lang['lmt_nb_author_one'] = '1 author set';
+$lang['lmt_nb_author_zero'] = 'There is no author set';
+$lang['lmt_nb_authors'] = 'authors set';
+$lang['lmt_no_author'] = '<No author>';
+$lang['lmt_no_element_selected'] = 'There is no selected items !';
+$lang['lmt_no_text'] = 'No text is filled !';
+$lang['lmt_nofilter'] = 'All licences';
+$lang['lmt_official_website'] = 'The official Creative Commons website';
+$lang['lmt_redirect_config'] = 'Redirections';
+$lang['lmt_redirect_urls'] = 'URL redirects';
+$lang['lmt_release'] = 'r';
+$lang['lmt_replace_caddie'] = 'Purge caddie and add the elements';
+$lang['lmt_save_config'] = 'Configuration saved';
+$lang['lmt_select_all'] = 'All';
+$lang['lmt_select_invert'] = 'Reverse';
+$lang['lmt_select_none'] = 'None';
+$lang['lmt_six_licences'] = 'The 6 licences';
+$lang['lmt_title'] = 'Licence Management Tool';
+$lang['lmt_warning_config'] = 'Footer text management';
+$lang['lmt_warning_texts_help'] = '';
+$lang['lmt_way_--'] = 'Attribution';
+$lang['lmt_way_nc'] = 'No Commercial Use';
+$lang['lmt_way_nd'] = 'No Derivative';
+$lang['lmt_way_sa'] = 'Share Alike';
+$lang['lmt_whatisit'] = 'What is Creative Commons?';
+$lang['lmt_whatisit_def1'] = 'Creative Commons is a non profit organization that offers flexible contracts, free of copyright to distribute your creations. Applied to your photos (or other media you put online) these contracts allow anyone to use without having to systematically seek to obtain a permit.';
+$lang['lmt_whatisit_def2'] = 'There are 6 licenses which are based on 4 principles that define the conditions of use.';
+$lang['lmt_yesno_n'] = 'No';
+$lang['lmt_yesno_y'] = 'Yes';
+
+
+?>
Index: /extensions/lmt/language/fr_FR/index.php
===================================================================
--- /extensions/lmt/language/fr_FR/index.php (revision 3396)
+++ /extensions/lmt/language/fr_FR/index.php (revision 3396)
@@ -0,0 +1,33 @@
+
Index: /extensions/lmt/language/fr_FR/plugin.lang.php
===================================================================
--- /extensions/lmt/language/fr_FR/plugin.lang.php (revision 3396)
+++ /extensions/lmt/language/fr_FR/plugin.lang.php (revision 3396)
@@ -0,0 +1,180 @@
+Creative Commons ?';
+$lang['lmt_whatisit_def1'] = 'Creative Commons est une organisation à but non lucratif qui propose gratuitement des contrats flexibles de droit d\'auteur pour diffuser vos créations. Appliqués à vos photos (ou autres médias que vous mettez en ligne) ces contrats permettent à quiconque de les exploiter sans avoir à vous solliciter systématiquement pour obtenir une autorisation.';
+$lang['lmt_whatisit_def2'] = 'Il existe 6 licences qui s\'articulent autour de 4 principes et qui définissent les conditions d\'utilisation.';
+$lang['lmt_four_way'] = 'Les 4 principes';
+$lang['lmt_six_licences'] = 'Les 6 licences';
+
+$lang['lmt_way_--'] = 'Paternité';
+$lang['lmt_way_nd'] = 'Pas de Modification';
+$lang['lmt_way_nc'] = 'Pas d\'Utilisation Commerciale';
+$lang['lmt_way_sa'] = 'Partage à l\'Identique des Conditions Initiales';
+
+$lang['lmt_cc-all'] = 'Toutes licences';
+$lang['lmt_lbl_cc-by'] = 'Paternité';
+$lang['lmt_lbl_cc-by-nd'] = 'Paternité, Pas de Modification';
+$lang['lmt_lbl_cc-by-nc'] = 'Paternité, Pas d\'Utilisation Commerciale';
+$lang['lmt_lbl_cc-by-nc-nd'] = 'Paternité, Pas d\'Utilisation Commerciale, Pas de Modification';
+$lang['lmt_lbl_cc-by-nc-sa'] = 'Paternité, Pas d\'Utilisation Commerciale, Partage des Conditions Initiales à l\'Identique';
+$lang['lmt_lbl_cc-by-sa'] = 'Paternité, Partage des Conditions Initiales à l\'Identique';
+$lang['lmt_lbl_cc-cright'] = 'Copyright';
+$lang['lmt_lbl_cc-cleft'] = 'Copyleft';
+$lang['lmt_lbl_cc-default'] = 'Licence par défaut';
+
+$lang['lmt_lbl_cc_s-by'] = 'Creative Commons BY';
+$lang['lmt_lbl_cc_s-by-nd'] = 'Creative Commons BY-ND';
+$lang['lmt_lbl_cc_s-by-nc'] = 'Creative Commons BY-NC';
+$lang['lmt_lbl_cc_s-by-nc-nd'] = 'Creative Commons BY-NC-ND';
+$lang['lmt_lbl_cc_s-by-nc-sa'] = 'Creative Commons BY-NC-SA';
+$lang['lmt_lbl_cc_s-by-sa'] = 'Creative Commons BY-SA';
+$lang['lmt_lbl_cc_s-cright'] = '© Copyright';
+$lang['lmt_lbl_cc_s-cleft'] = 'Copyleft';
+$lang['lmt_lbl_cc_s-default'] = ' - ';
+
+$lang['lmt_lbl_under-by'] = 'Publié sous licence';
+$lang['lmt_lbl_under-by-nd'] = 'Publié sous licence';
+$lang['lmt_lbl_under-by-nc'] = 'Publié sous licence';
+$lang['lmt_lbl_under-by-nc-nd'] = 'Publié sous licence';
+$lang['lmt_lbl_under-by-nc-sa'] = 'Publié sous licence';
+$lang['lmt_lbl_under-by-sa'] = 'Publié sous licence';
+$lang['lmt_lbl_under-cright'] = '';
+$lang['lmt_lbl_under-cleft'] = 'Publié sous licence';
+$lang['lmt_lbl_under-default'] = '';
+
+
+$lang['lmt_nofilter'] = 'Toutes licences';
+
+$lang['lmt_def_--'] = 'L\'oeuvre peut être librement utilisée, à la condition de l\'attribuer à son l\'auteur en citant son nom';
+$lang['lmt_def_nc'] = 'Le titulaire de droits peut autoriser tous les types d’utilisation ou au contraire restreindre aux utilisations non commerciales (les utilisations commerciales restant soumises à son autorisation).';
+$lang['lmt_def_nd'] = 'Le titulaire de droits peut continuer à réserver la faculté de réaliser des oeuvres de type dérivées ou au contraire autoriser à l\'avance les modifications, traductions...';
+$lang['lmt_def_sa'] = 'A la possibilité d\'autoriser à l\'avance les modifications peut se superposer l\'obligation pour les oeuvres dites dérivées d\'être proposées au public avec les mêmes libertés (sous les mêmes options Creative Commons) que l\'oeuvre originaire.';
+
+$lang['lmt_general_text'] = "[logo=80x15]Les médias de ce site sont soumis au droit d'auteur et sont, sauf indications contraires, diffusés sous licence Creative Commons [logo=text]";
+
+$lang['lmt_lst_default_licence'] = "Les photos sont par défaut publiées sous la licence suivante";
+$lang['lmt_lst_special_licence'] = "Les photos suivantes sont publiées avec une licence particulière";
+$lang['lmt_lst_apply_filter'] = 'Filtrer';
+$lang['lmt_lst_nb_photos'] = 'photos';
+
+$lang['lmt_caddie_items'] = 'Eléments du panier';
+$lang['lmt_apply_do_nothing'] = 'Appliquer la licence sans toucher au panier';
+$lang['lmt_apply_do_clear'] = 'Appliquer la licence et vider tout le panier';
+$lang['lmt_apply_do_clear_selected'] = 'Appliquer la licence et vider les élements sélectionnés du panier';
+$lang['lmt_dontapply_do_clear_selected'] = 'Vider les élements sélectionnés du panier sans appliquer de licence';
+
+$lang['lmt_apply'] = 'Appliquer';
+$lang['lmt_bydefault'] = "Appliquer la licence par défaut";
+$lang['lmt_choose_select'] = "";
+$lang['lmt_select_all'] = "Tout";
+$lang['lmt_select_none'] = "Aucun";
+$lang['lmt_select_invert'] = "Inverser";
+$lang['lmt_licence_to_apply'] = "Choix de la licence";
+$lang['lmt_no_element_selected'] = "Il n'y a aucun élément de sélectionné !";
+
+$lang["lmt_add_licence_ok"] = "La licence a été appliquée sur les élements sélectionnés";
+$lang["lmt_add_licence_ko"] = "La licence n'a pu être appliquée sur les élements sélectionnés";
+$lang["lmt_clear_caddie_ok"] = "Le panier a été purgé";
+$lang["lmt_clear_caddie_ko"] = "Le panier n'a pu être purgé";
+$lang["lmt_clear_si_caddie_ok"] = "Les éléments sélectionnés ont été purgés du panier";
+$lang["lmt_clear_si_caddie_ko"] = "Les éléments sélectionnés n'ont pu être purgés du panier";
+$lang["lmt_caddie_not_updated"] = "Le panier n'a pas pu être mis à jour";
+$lang["lmt_caddie_updated"] = "Le panier a été mis à jour";
+$lang["lmt_add_to_caddie"] = "Ajouter les élements dans le panier";
+$lang["lmt_replace_caddie"] = "Purger le panier et y ajouter les élements";
+$lang["lmt_caddie_is_empty_please_fill_it"] = "L'application d'une licence s'effectue sur le contenu du panier. Malheureusement celui-ci est vide...";
+
+$lang["lmt_redirect_config"] = "Redirections";
+$lang["lmt_general_config"] = "Options générales";
+$lang['lmt_display_config'] = "Options d'affichage";
+$lang['lmt_cfg_list_maxheight'] = "Hauteur maximale des listes";
+$lang['lmt_cfg_list_maxitems'] = "Nombre maximum d'éléments affichés";
+$lang['lmt_licence_config'] = "Gestion des licences";
+$lang["lmt_cfg_licence_activated"] = "Activer la gestion des licences";
+$lang["lmt_cfg_licence_visible"] = "La licence est toujours affichée, même s'il s'agit d'une licence par défaut";
+$lang["lmt_cfg_licence_logo"] = "Type de logo affiché";
+$lang["lmt_warning_config"] = "Gestion du texte de bas de page";
+$lang["lmt_cfg_warning_visible"] = "Afficher la licence appliquée par défaut en bas de page";
+$lang["lmt_cfg_warning_link"] = "Activer la redirection";
+$lang["lmt_cfg_warning_texts"] = "Texte de bas de page";
+$lang["lmt_do_save"] = "Enregistrer la configuration";
+$lang["lmt_save_config"] = "Configuration enregistrée";
+$lang["lmt_cfg_licence_default"] = "Choix de la licence appliquée par défaut";
+$lang['lmt_cfg_licence_default_author'] = "Choix de l'auteur pour la licence par défaut";
+
+$lang["lmt_yesno_y"] = "Oui";
+$lang["lmt_yesno_n"] = "Non";
+
+$lang["lmt_icon_80x15"] = "Icone 80x15";
+$lang["lmt_icon_88x31"] = "Icone 88x31";
+$lang["lmt_icon_text"] = "Texte";
+$lang['example'] = "Exemple de l'affichage";
+$lang['lmt_warning_texts_help'] = "";
+
+$lang["lmt_help_config"][1] = "En fonction du nombre d'éléments disposant d'une licence particulière ou du nombre du nombre d'éléments présents dans votre panier, la zone d'affichage va être plus ou moins grande. Une zone d'affichage trop grande peut réduire le confort de lecture de la page.
Ce paramètre permet de forcer la hauteur maximale de la zone d'affichage.";
+$lang["lmt_help_config"][2] = "Permet d'activer ou non la gestion des licences. Par rapport à une désactivation complète du plugin, cette option permet de désactiver la gestion des licences sur la partie publique du site tout en conservant l'administration du plugin actif.";
+$lang["lmt_help_config"][3] = "Cette option permet d'afficher systématiquement la licence de l'élément, même si la licence par défaut lui est affecté.
Si cette option n'est pas activée, la licence ne sera affichée que pour les éléments disposant d'une licence particulière.";
+$lang["lmt_help_config"][4] = "Cette option permet de sélectionner la licence qui sera appliquée par défaut aux éléments pour lesquels aucune licence particulière n'aura été affectée.";
+$lang["lmt_help_config"][5] = "Cette option permet de choisir s'il faut afficher ou non la licence par défaut sur toutes les pages (sera affiché en bas de page).";
+$lang["lmt_help_config"][6] = "Si activé, le logo indiquant la licence est un hyperlien redirigeant l'utilisateur sur une page expliquant plus en détail les conditions d'exploitation de l'élément.";
+$lang["lmt_help_config"][7] = "Le texte de licence affiché en bas de page est modifiable selon vos besoins.
Il est possible d'afficher des éléments en automatique :
[logo=80x15] insère le logo 80x15 de la licence par défaut
[logo=88x31] insère le logo 88x31 de la licence par défaut
[logo=text] insère le texte de la licence par défaut";
+$lang["lmt_help_config"][8] = "Cette option permet de sélectionner l'auteur qui sera affecté pour la licence appliquée par défaut.";
+$lang["lmt_help_config"][9] = "Cette option permet de choisir le nombre d'éléments affichés par page.";
+
+$lang["lmt_author_nfo"] = "Lorsque le logo d'une licence est apposé sur la page d'un élément visualisé, il est possible de préciser l'auteur qui en détient les droits.";
+$lang["lmt_author_title"] = "Liste des auteurs";
+$lang["lmt_nb_author_zero"] = "Il n'y a aucun auteur de paramétré";
+$lang["lmt_nb_author_one"] = "1 auteur de paramétré";
+$lang["lmt_nb_authors"] = "auteurs de paramétrés";
+$lang["lmt_add_author"] = "Ajouter un auteur";
+$lang["lmt_author_txt1"] = "Texte 1";
+$lang["lmt_author_txt2"] = "Texte 2";
+$lang["lmt_action"] = "Actions";
+$lang["lmt_authoradd_title"] = "Ajouter un auteur";
+$lang["lmt_authormodify_title"] = "Modifier un auteur";
+$lang["lmt_add"] = "Ajouter";
+$lang["lmt_delete"] = "Supprimer";
+$lang["lmt_modify"] = "Modifier";
+$lang["lmt_cancel"] = "Annuler";
+$lang["lmt_no_text"] = "Aucun texte n'est renseigné !";
+$lang["lmt_author_added"] = "L'auteur a été ajouté";
+$lang["lmt_cannot_add_author"] = "L'auteur n'a pu être ajouté";
+$lang["lmt_author_deleted"] = "L'auteur a été supprimé";
+$lang["lmt_cannot_delete_author"] = "L'auteur n'a pu être supprimé";
+$lang["lmt_error_on_image_author"] = "Problème lors de la mise à jour des éléments rattachés à l'auteur supprimé";
+$lang["lmt_author_one_image_updated"] = "Une image rattachée à cet auteur a été mise à jour";
+$lang["lmt_author_nb_images_updated"] = "images rattachées à cet auteur ont été mises à jour";
+$lang["lmt_author_modified"] = "L'auteur a été modifé";
+$lang["lmt_cannot_modify_author"] = "L'auteur n'a pu être modifié";
+$lang['lmt_no_author'] = "";
+$lang['lmt_redirect_urls'] = "URLs de redirections";
+
+$lang["lmt_nav_first"] = "Premier";
+$lang["lmt_nav_prev"] = "Précédent";
+$lang["lmt_nav_next"] = "Suivant";
+$lang["lmt_nav_last"] = "Dernier";
+
+?>
Index: /extensions/lmt/language/index.php
===================================================================
--- /extensions/lmt/language/index.php (revision 3396)
+++ /extensions/lmt/language/index.php (revision 3396)
@@ -0,0 +1,33 @@
+
Index: /extensions/lmt/lmt_aim.class.inc.php
===================================================================
--- /extensions/lmt/lmt_aim.class.inc.php (revision 3396)
+++ /extensions/lmt/lmt_aim.class.inc.php (revision 3396)
@@ -0,0 +1,43 @@
+>
+ ------------------------------------------------------------------------------
+ See main.inc.php for release information
+
+ LMT_AIM : classe to manage plugin integration into plugin menu
+
+ --------------------------------------------------------------------------- */
+
+if (!defined('PHPWG_ROOT_PATH')) { die('Hacking attempt!'); }
+
+include_once('lmt_root.class.inc.php');
+
+class LMT_AIM extends LMT_root
+{
+ public function LMT_AIM($prefixeTable, $filelocation)
+ {
+ parent::__construct($prefixeTable, $filelocation);
+ }
+
+ /*
+ initialize events call for the plugin
+ */
+ public function init_events()
+ {
+ parent::init_events();
+ add_event_handler('get_admin_plugin_menu_links', array(&$this, 'plugin_admin_menu') );
+ }
+
+ /* ---------------------------------------------------------------------------
+ Function needed for plugin activation
+ --------------------------------------------------------------------------- */
+
+} // LMT_AIM class
+
+
+?>
Index: /extensions/lmt/lmt_aip.class.inc.php
===================================================================
--- /extensions/lmt/lmt_aip.class.inc.php (revision 3396)
+++ /extensions/lmt/lmt_aip.class.inc.php (revision 3396)
@@ -0,0 +1,996 @@
+>
+ ------------------------------------------------------------------------------
+ See main.inc.php for release information
+
+ LMT_AIP : classe to manage plugin admin pages
+
+ --------------------------------------------------------------------------- */
+
+include_once('lmt_root.class.inc.php');
+include_once(PHPWG_PLUGINS_PATH.'grum_plugins_classes-2/translate.class.inc.php');
+include_once(PHPWG_PLUGINS_PATH.'grum_plugins_classes-2/tables.class.inc.php');
+include_once(PHPWG_PLUGINS_PATH.'grum_plugins_classes-2/genericjs.class.inc.php');
+include_once(PHPWG_PLUGINS_PATH.'grum_plugins_classes-2/pages_navigation.class.inc.php');
+include_once(PHPWG_ROOT_PATH.'admin/include/tabsheet.class.php');
+
+class LMT_AIP extends LMT_root
+{
+ protected $google_translate;
+ protected $tabsheet;
+
+ public function LMT_AIP($prefixeTable, $filelocation)
+ {
+ parent::__construct($prefixeTable, $filelocation);
+ $this->load_config();
+ $this->init_events();
+
+ $this->tabsheet = new tabsheet();
+ $this->tabsheet->add('list',
+ l10n('lmt_list'),
+ $this->page_link."&f_tabsheet=list");
+ $this->tabsheet->add('manage',
+ l10n('lmt_manage'),
+ $this->page_link."&f_tabsheet=manage");
+ $this->tabsheet->add('manageaut',
+ l10n('lmt_manageaut'),
+ $this->page_link."&f_tabsheet=manageaut");
+ $this->tabsheet->add('config',
+ l10n('lmt_config'),
+ $this->page_link."&f_tabsheet=config");
+ $this->tabsheet->add('help',
+ l10n('lmt_help'),
+ $this->page_link."&f_tabsheet=help");
+
+ // don't create this object inside root classe otherwise header is modified
+ // everywhere in admin pages
+ $this->ajax = new Ajax();
+
+ // don't create the google_translate object everytime, otherwise google's js
+ // code is always included in the header even if translation functionalities
+ // aren't needed
+ // translation is needed only if we are in a ajax request
+ /*if((isset($_POST['fmypolls_gomodify_translation'])||isset($_POST['fmypolls_goadd_translation'])))
+ {
+ $this->google_translate = new translate();
+ }
+ */
+ }
+
+ /*
+ initialize events call for the plugin
+ */
+ public function init_events()
+ {
+ parent::init_events();
+ add_event_handler('loc_end_page_header', array(&$this->css, 'apply_CSS'));
+ add_event_handler('loc_end_page_header', array(&$this->css_icn, 'apply_CSS'));
+ }
+
+ /*
+ display administration page
+ */
+ public function manage()
+ {
+ global $template;
+
+ $this->return_ajax_content();
+
+ $template->set_filename('plugin_admin_content', dirname(__FILE__)."/admin/lmt_admin.tpl");
+
+ if(!isset($_REQUEST['f_tabsheet']))
+ {
+ $_REQUEST['f_tabsheet']='list';
+ }
+
+ switch($_REQUEST['f_tabsheet'])
+ {
+ case 'list':
+ $this->display_list_page();
+ break;
+ case 'manage':
+ $this->display_manage_page();
+ break;
+ case 'manageaut':
+ $this->display_manageaut_page();
+ break;
+ case 'managedoc':
+ $this->display_managedoc_page();
+ break;
+ case 'help':
+ $this->display_help_page();
+ break;
+ case 'config':
+ $this->display_config_page();
+ break;
+ }
+
+ $this->tabsheet->select($_REQUEST['f_tabsheet']);
+ $this->tabsheet->assign();
+ $selected_tab=$this->tabsheet->get_selected();
+ $template->assign($this->tabsheet->get_titlename(), "[".$selected_tab['caption']."]");
+
+ $template_plugin["LMT_VERSION"] = "".$this->plugin_name." ".l10n('lmt_release').LMT_VERSION;
+ $template_plugin["LMT_PAGE"] = $_REQUEST['f_tabsheet'];
+ $template_plugin["LMT_TITLE"] = "";
+
+ $template->assign('plugin', $template_plugin);
+ $template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content');
+ }
+
+
+ /*
+ return ajax content
+ */
+ protected function return_ajax_content()
+ {
+ global $ajax, $template;
+
+ if(isset($_REQUEST['ajaxfct']))
+ {
+ //$this->debug("AJAXFCT:".$_REQUEST['ajaxfct']);
+ $result="An error has occured
";
+ switch($_REQUEST['ajaxfct'])
+ {
+ case 'img_list':
+ $result=$this->ajax_img_list($_REQUEST['numpage']);
+ break;
+ case 'manage_list':
+ $result=$this->ajax_manage_list($_REQUEST['numpage']);
+ break;
+ }
+ //$template->
+ $this->ajax->return_result($result);
+ }
+ }
+
+
+ /*
+ manage display of config page & save config
+ */
+ protected function display_config_page()
+ {
+ $languages=get_languages();
+ if(!$this->adviser_abort())
+ {
+
+ if(isset($_POST['submit_save_config']))
+ {
+ foreach($this->my_config as $key => $val)
+ {
+ if(is_array($val))
+ {
+ foreach($languages as $key2 => $val2)
+ {
+ if(isset($_REQUEST[str2url('f_'.$key.'_'.$key2)]))
+ {
+ $this->my_config[$key][$key2] = htmlspecialchars(stripslashes($_REQUEST[str2url('f_'.$key.'_'.$key2)]), ENT_QUOTES);
+ }
+ }
+ }
+ else
+ {
+ if(isset($_REQUEST['f_'.$key]))
+ {
+ $this->my_config[$key] = $_REQUEST['f_'.$key];
+ }
+ }
+
+ }
+ $this->display_result(l10n('lmt_save_config'), $this->save_config());
+ }
+ }
+ $this->display_config();
+ }
+
+
+ /*
+
+ */
+ protected function display_help_page()
+ {
+ global $template;
+
+ $template->set_filename('body_page',
+ dirname($this->filelocation).'/admin/plugin_admin_help.tpl');
+
+ $template->assign('imgdir', LMT_PATH."img/");
+
+ $template->assign_var_from_handle('LMT_BODY_PAGE', 'body_page');
+ }
+
+ /*
+ */
+ protected function display_list_page()
+ {
+ global $template, $conf, $user;
+
+ $template->set_filename('body_page',
+ dirname($this->filelocation).'/admin/plugin_admin_list.tpl');
+
+ if(!isset($_REQUEST['filter']) ||
+ !($_REQUEST['filter']=="BY" ||
+ $_REQUEST['filter']=="BY-SA" ||
+ $_REQUEST['filter']=="BY-ND" ||
+ $_REQUEST['filter']=="BY-NC-ND" ||
+ $_REQUEST['filter']=="BY-NC-SA" ||
+ $_REQUEST['filter']=="BY-NC" ||
+ $_REQUEST['filter']=="CRIGHT" ||
+ $_REQUEST['filter']=="CLEFT"
+ ))
+ {
+ $_REQUEST['filter']='';
+ }
+
+ $datas=array(
+ "LMT_AJAX_URL_LIST" => $this->page_link.'&ajaxfct=img_list&numpage='
+ );
+
+ $filter_list_selected = '';
+ $filter_list_values = array_slice($this->licences,0,count($this->licences)-1);
+ $filter_list_labels = array();
+ foreach($filter_list_values as $key=>$val)
+ {
+ $filter_list_labels[] = "[".l10n("lmt_lbl_cc_s-".strtolower($val))."] ".l10n("lmt_lbl_cc-".strtolower($val));
+ if($val==$_REQUEST['filter'])
+ {
+ $filter_list_selected = $val;
+ }
+ }
+
+ $filter_list_values = array_merge(array(''), $filter_list_values);
+ $filter_list_labels = array_merge(array(l10n('lmt_nofilter')), $filter_list_labels);
+ $default_licence = l10n("lmt_lbl_cc-".strtolower($this->my_config['lmt_licence_default']));
+ $default_licence_img =LMT_PATH."img/".strtolower($this->my_config['lmt_licence_default'])."_80x15.png";
+
+ $results=true;
+ if(isset($_POST["submit_replace_caddie"]))
+ {
+ $sql="DELETE FROM ".CADDIE_TABLE." WHERE user_id='".$user['id']."'";
+ $result=pwg_query($sql);
+ ($result)?$results=true:$results=false;
+ }
+
+ if(isset($_POST["submit_add_to_caddie"]) || isset($_POST["submit_replace_caddie"]))
+ {
+ $sql="REPLACE INTO ".CADDIE_TABLE." SELECT '".$user['id']."', id FROM ".IMAGES_TABLE." WHERE id IN (".implode(",", $img_ids).");";
+ $result=pwg_query($sql);
+ if((!$results)||(!$result))
+ {
+ $this->display_result(l10n("lmt_caddie_not_updated"), false);
+ }
+ else
+ {
+ $this->display_result(l10n("lmt_caddie_updated"), true);
+ }
+ }
+
+ $template->assign('datas', $datas);
+ $template->assign('default_licence', $default_licence);
+ $template->assign('default_licence_img', $default_licence_img);
+ $template->assign('filter_list_values', $filter_list_values);
+ $template->assign('filter_list_labels', $filter_list_labels);
+ $template->assign('filter_list_selected', $filter_list_selected);
+ $template->assign_var_from_handle('LMT_BODY_PAGE', 'body_page');
+ }
+
+
+ /*
+ */
+ protected function display_manage_page()
+ {
+ global $template, $conf, $user;
+
+ /*
+ apply licence
+ */
+ if(isset($_POST['submit_apply_licence']))
+ {
+ $results=array("", "");
+ $lst=array();
+ foreach($_POST as $key => $val)
+ {
+ if((substr($key,0,2)=="fn")&&($val=="1")) $lst[]=substr($key,2);
+ }
+
+ if(count($lst)>0)
+ {
+ if($_POST['manage_caddie']!="napp_clear_selected")
+ {
+ if($_POST['licence']=='DEFAULT')
+ {
+ $sql="DELETE FROM ".$this->tables['images']."
+ WHERE image_id IN (".implode(",", $lst).")";
+ }
+ else
+ {
+ $sql="REPLACE INTO ".$this->tables['images']."
+ SELECT id, '".$_POST['licence']."', '".$_POST['author']."'
+ FROM ".IMAGES_TABLE."
+ WHERE id IN (".implode(",", $lst).")";
+ }
+ $result=pwg_query($sql);
+ ($result)?$results[0].=l10n("lmt_add_licence_ok")."
":$results[1].=l10n("lmt_add_licence_ko")."
";
+ }
+
+ switch($_POST['manage_caddie'])
+ {
+ case 'app_clear':
+ $sql="DELETE FROM ".CADDIE_TABLE." WHERE user_id = '".$user['id']."'";
+ $result=pwg_query($sql);
+ ($result)?$results[0].=l10n("lmt_clear_caddie_ok")."
":$results[1].=l10n("lmt_clear_caddie_ko")."
";
+ break;
+ case 'app_clear_selected':
+ case 'napp_clear_selected':
+ $sql="DELETE FROM ".CADDIE_TABLE."
+ WHERE user_id = '".$user['id']."'
+ AND element_id IN (".implode(",", $lst).")";
+ $result=pwg_query($sql);
+ ($result)?$results[0].=l10n("lmt_clear_si_caddie_ok")."
":$results[1].=l10n("lmt_clear_si_caddie_ko")."
";
+ break;
+ }
+
+ if($results[0]!="")
+ {
+ $this->display_result($results[0], true);
+ }
+
+ if($results[1]!="")
+ {
+ $this->display_result($results[1], false);
+ }
+ }
+ else
+ {
+ $this->display_result(l10n("lmt_no_element_selected"), false);
+ }
+ }
+
+
+ $template->set_filename('body_page',
+ dirname($this->filelocation).'/admin/plugin_admin_manage.tpl');
+
+ $datas=array(
+ "LMT_AJAX_URL_LIST" => $this->page_link.'&ajaxfct=manage_list&numpage='
+ );
+
+ if(!isset($_REQUEST['select']))
+ {
+ $_REQUEST['select']="caddie";
+ }
+
+ $sql="SELECT count(element_id) FROM ".CADDIE_TABLE." WHERE user_id = '".$user['id']."'";
+ $result=pwg_query($sql);
+ $nbphotos=mysql_fetch_array($result);
+
+ $author_list_values = array(0);
+ $author_list_labels = array(l10n("lmt_no_author"));
+ $sql="SELECT * FROM ".$this->tables["licence_author"]." ORDER BY id";
+ $result=pwg_query($sql);
+ if($result)
+ {
+ while($row=mysql_fetch_array($result))
+ {
+ $author_list_values[]=$row['id'];
+ $author_list_labels[]=$row['text1']." ".$row['text2'];
+ }
+ }
+
+ $licences_list_values = array();
+ $licences_list_values = $this->licences;
+ $licences_list_labels = array();
+ foreach($licences_list_values as $key=>$val)
+ {
+ $licences_list_labels[] = "[".l10n("lmt_lbl_cc_s-".strtolower($val))."] ".l10n("lmt_lbl_cc-".strtolower($val));
+ }
+
+/* $licences_list_values = array_merge(array('DEFAULT'), $licences_list_values);
+ $licences_list_labels = array_merge(array(l10n('lmt_bydefault')), $licences_list_labels);*/
+
+ $selectlist_list_values=array("-", "all", "none", "invert");
+ $selectlist_list_values=array_merge($selectlist_list_values, $licences_list_values);
+
+ $selectlist_list_labels=array(
+ l10n("lmt_choose_select"),
+ l10n("lmt_select_all"),
+ l10n("lmt_select_none"),
+ l10n("lmt_select_invert")
+ );
+ $selectlist_list_labels=array_merge($selectlist_list_labels, $licences_list_labels);
+
+ $template->assign('datas', $datas);
+ $template->assign('nbphotos', $nbphotos[0]);
+ $template->assign('selectlist_list_values', $selectlist_list_values);
+ $template->assign('selectlist_list_labels', $selectlist_list_labels);
+ $template->assign('filter_list_selected', "");
+ $template->assign('licences_list_values', $licences_list_values);
+ $template->assign('licences_list_labels', $licences_list_labels);
+ $template->assign('licences_list_selected', "");
+ $template->assign('author_list_values', $author_list_values);
+ $template->assign('author_list_labels', $author_list_labels);
+ $template->assign_var_from_handle('LMT_BODY_PAGE', 'body_page');
+ }
+
+
+ /*
+ display config page
+ */
+ protected function display_config()
+ {
+ global $template, $lang;
+
+ $template->set_filename('body_page',
+ dirname($this->filelocation).'/admin/plugin_admin_config.tpl');
+
+
+ $datas=array(
+ "img_directory" => LMT_PATH."img/"
+ );
+ foreach($this->my_config as $key => $val)
+ {
+ if(!is_array($val))
+ {
+ $datas[$key]=$val;
+ }
+ }
+
+ $lmt_yesno_values=array("y", "n");
+ $lmt_yesno_labels=array(l10n("lmt_yesno_y"), l10n("lmt_yesno_n"));
+
+ $lmt_licence_logo_values=array("80x15", "88x31", "text");
+ $lmt_licence_logo_labels=array(l10n("lmt_icon_80x15"), l10n("lmt_icon_88x31"), l10n("lmt_icon_text"));
+
+ $datas['lmt_redirect_urls']=array();
+ $lmt_licence_default_values = array_slice($this->licences,0,count($this->licences)-1);
+ $lmt_licence_default_labels = array();
+
+ $tmp=array();
+ foreach($lmt_licence_default_values as $key=>$val)
+ {
+ $lmt_licence_default_labels[] = "[".l10n("lmt_lbl_cc_s-".strtolower($val))."] ".l10n("lmt_lbl_cc-".strtolower($val));
+
+ $tmp[]="'".str2url("ilmt_redirect_url-".strToLower($val))."'";
+ $datas['lmt_redirect_urls'][str2url('lmt_redirect_url-'.strToLower($val))]=array(
+ 'text' => l10n("lmt_lbl_cc_s-".strToLower($val)),
+ 'langs' => array()
+ );
+ }
+ $datas['objnames2'] = implode(",", $tmp);
+
+
+ //langs list & texts
+ $datas['lmt_warning_texts']=array();
+
+ $lmt_language_list=array();
+ $lmt_language_list_values=array();
+ $lmt_language_list_labels=array();
+ $lmt_language_selected=str2url(get_default_language());
+ $languages=get_languages();
+
+ foreach($languages as $key => $val)
+ {
+ $lmt_language_list_values[]=str2url($key);
+ $lmt_language_list_labels[]=$val;
+
+ $datas['lmt_warning_texts'][]=array(
+ 'lang' => str2url($key),
+ 'text' => $this->my_config['lmt_warning_texts'][$key]
+ );
+
+ foreach($lmt_licence_default_values as $key2 => $val2)
+ {
+ $datas['lmt_redirect_urls'][str2url('lmt_redirect_url-'.strToLower($val2))]['langs'][str2url($key)]=
+ $this->my_config['lmt_redirect_url-'.strToLower($val2)][$key];
+ }
+ }
+
+ $datas['help']=array();
+ foreach($lang["lmt_help_config"] as $key => $val)
+ {
+ $datas['help']['hlp'.$key]=addslashes($val);
+ }
+
+ $lmt_licence_default_author_values=array(0);
+ $lmt_licence_default_author_labels=array(l10n("lmt_no_author"));
+ $sql="SELECT * FROM ".$this->tables['licence_author']." ORDER BY id";
+ $result=pwg_query($sql);
+ if($result)
+ {
+ while($row=mysql_fetch_array($result))
+ {
+ $lmt_licence_default_author_values[]=$row['id'];
+ $lmt_licence_default_author_labels[]=$row['text1']." ".$row['text2'];
+ }
+ }
+
+ $template->assign('datas', $datas);
+ $template->assign('extended_code', $this->generate_js_licence_author());
+ $template->assign('lmt_yesno_values', $lmt_yesno_values);
+ $template->assign('lmt_yesno_labels', $lmt_yesno_labels);
+ $template->assign('lmt_licence_logo_values', $lmt_licence_logo_values);
+ $template->assign('lmt_licence_logo_labels', $lmt_licence_logo_labels);
+ $template->assign('lmt_licence_default_values', $lmt_licence_default_values);
+ $template->assign('lmt_licence_default_labels', $lmt_licence_default_labels);
+ $template->assign('lmt_licence_default_author_values', $lmt_licence_default_author_values);
+ $template->assign('lmt_licence_default_author_labels', $lmt_licence_default_author_labels);
+ $template->assign('lmt_language_list_values', $lmt_language_list_values);
+ $template->assign('lmt_language_list_labels', $lmt_language_list_labels);
+ $template->assign('lmt_language_selected', $lmt_language_selected);
+ $template->assign_var_from_handle('LMT_BODY_PAGE', 'body_page');
+
+ } //display_config
+
+
+
+
+ /*
+ */
+ protected function display_manageaut_page()
+ {
+ global $template, $conf, $user;
+
+ if(!isset($_REQUEST['action']))
+ {
+ $_REQUEST['action']="list";
+ }
+ if(!isset($_REQUEST['id']))
+ {
+ $_REQUEST['id']="";
+ }
+
+
+ /* ------------------------------------------------------------------------
+ * Add an author
+ * ---------------------------------------------------------------------- */
+ if(isset($_POST['submit_add_author']))
+ {
+ if($_POST["text1"]!="")
+ {
+ $sql="INSERT INTO ".$this->tables["licence_author"]." VALUES('', '". addslashes($_POST["text1"])."', '".addslashes($_POST["text2"])."')";
+ $result=pwg_query($sql);
+ if($result)
+ {
+ $this->display_result(l10n("lmt_author_added"), true);
+ $_REQUEST['action']="list";
+ }
+ else
+ {
+ $this->display_result(l10n("lmt_cannot_add_author"), false);
+ }
+ }
+ else
+ {
+ $this->display_result(l10n("lmt_no_text"), false);
+ }
+ }
+
+ /* ------------------------------------------------------------------------
+ * Modify an author
+ * ---------------------------------------------------------------------- */
+ if(isset($_POST['submit_modify_author']))
+ {
+ if($_POST["text1"]!="")
+ {
+ $sql="UPDATE ".$this->tables["licence_author"]."
+ SET text1 = '". addslashes($_POST["text1"])."',
+ text2 = '".addslashes($_POST["text2"])."'
+ WHERE id = '".$_POST["id"]."'";
+ $result=pwg_query($sql);
+ if($result)
+ {
+ $this->display_result(l10n("lmt_author_modified"), true);
+ $_REQUEST['action']="list";
+ }
+ else
+ {
+ $this->display_result(l10n("lmt_cannot_modify_author"), false);
+ }
+ }
+ else
+ {
+ $this->display_result(l10n("lmt_no_text"), false);
+ }
+ }
+
+ /* ------------------------------------------------------------------------
+ * delete an author
+ * ---------------------------------------------------------------------- */
+ if($_REQUEST['action']=="delete")
+ {
+ $sql="DELETE FROM ".$this->tables['licence_author']." WHERE id = '".$_REQUEST['id']."'";
+ $result=pwg_query($sql);
+ if($result)
+ {
+ if(mysql_affected_rows()==1)
+ {
+ $this->display_result(l10n("lmt_author_deleted"), true);
+
+ $sql="UPDATE ".$this->tables["images"]." SET author_id = NULL
+ WHERE author_id = '".$_REQUEST['id']."'";
+ $result=pwg_query($sql);
+ if($result)
+ {
+ $nbimages=mysql_affected_rows();
+ if($nbimages>0)
+ {
+ $this->display_result($nbimages." ".l10n("lmt_author_nb_images_updated"), true);
+ }
+ }
+ else
+ {
+ $this->display_result(l10n("lmt_cannot_delete_author"), false);
+ }
+ }
+ else
+ {
+ $this->display_result(l10n("lmt_cannot_delete_author"), false);
+ }
+ }
+ else
+ {
+ $this->display_result(l10n("lmt_cannot_delete_author"), false);
+ }
+ $this->display_manageaut_page_list();
+ }
+ elseif($_REQUEST['action']=="add")
+ {
+ $this->display_manageaut_page_add_modify("add");
+ }
+ elseif($_REQUEST['action']=="edit")
+ {
+ $this->display_manageaut_page_add_modify("edit");
+ }
+ else
+ {
+ // list
+ $this->display_manageaut_page_list();
+ }
+ } //display_manageaut
+
+ protected function display_manageaut_page_list()
+ {
+ global $template;
+
+ $template->set_filename('body_page',
+ dirname($this->filelocation).'/admin/plugin_admin_manageaut.tpl');
+
+ $datas=array(
+ "author_list" => array(),
+ "img_directory" => LMT_PATH."img/",
+ "default_licencepublished" => l10n("lmt_lbl_under-".strToLower($this->my_config['lmt_licence_default'])),
+ "default_licenceL" => strToLower($this->my_config['lmt_licence_default']),
+ "default_licenceU" => l10n("lmt_lbl_cc_s-".strToLower($this->my_config['lmt_licence_default'])),
+ "lmt_licence_logo" => $this->my_config['lmt_licence_logo'],
+ "nbauthor" => 0,
+ "add_link" => $this->page_link.'&f_tabsheet=manageaut&action=add'
+ );
+
+ $sql="SELECT * FROM ".$this->tables['licence_author']." ORDER BY id";
+ $result=pwg_query($sql);
+ if($result)
+ {
+ while($row=mysql_fetch_array($result))
+ {
+ $datas["author_list"][]=array(
+ "id" => $row['id'],
+ "text1" => $row['text1'],
+ "text2" => $row['text2'],
+ "lnk_delete" => $this->page_link.'&f_tabsheet=manageaut&action=delete&id='.$row['id'],
+ "lnk_edit" => $this->page_link.'&f_tabsheet=manageaut&action=edit&id='.$row['id']
+ );
+ }
+ $datas["nbauthor"] = count($datas["author_list"]);
+ }
+
+ $template->assign('datas', $datas);
+ //$template->assign('extended_code', $this->generate_js_licence_author());
+ $template->assign_var_from_handle('LMT_BODY_PAGE', 'body_page');
+ }
+
+ protected function display_manageaut_page_add_modify()
+ {
+ global $template;
+
+ $template->set_filename('body_page',
+ dirname($this->filelocation).'/admin/plugin_admin_manageaut_edit.tpl');
+
+ if($_REQUEST["action"]=="edit")
+ {
+ $sql="SELECT * FROM ".$this->tables['licence_author']." WHERE id = '".$_REQUEST['id']."'";
+ $result = pwg_query($sql);
+ if($result)
+ {
+ while($row=mysql_fetch_array($result))
+ {
+ $datas=array(
+ "action" => "modify",
+ "id" => $_REQUEST['id'],
+ "text1" => $row["text1"],
+ "text2" => $row["text2"]
+ );
+ }
+ }
+ else
+ {
+ $datas=array(
+ "action" => "add",
+ "id" => "",
+ "text1" => "",
+ "text2" => "",
+ );
+ }
+ }
+ else
+ {
+ $datas=array(
+ "action" => "add",
+ "id" => "",
+ "text1" => "",
+ "text2" => "",
+ );
+ }
+
+ $datas["urllist"] = $this->page_link.'&f_tabsheet=manageaut';
+
+ $template->assign('datas', $datas);
+ //$template->assign('extended_code', $this->generate_js_licence_author());
+ $template->assign_var_from_handle('LMT_BODY_PAGE', 'body_page');
+ }
+
+
+ /*
+ manage adviser profile
+ return true if user is adviser
+ */
+ protected function adviser_abort()
+ {
+ if(is_adviser())
+ {
+ $this->display_result(l10n("lmt_adviser_not_allowed"), false);
+ return(true);
+ }
+ return(false);
+ }
+
+
+ /*
+ this function return a js to manage licence text
+ */
+ protected function generate_js_licence_author()
+ {
+ $local_tpl = new Template(LMT_PATH."admin/", "");
+ $local_tpl->set_filename('body_page',
+ dirname($this->filelocation).'/admin/lmt_js.tpl');
+
+ $lmt_licence_default_values=array_slice($this->licences,0,count($this->licences)-1);
+ $datas['shortlicencetext']=array();
+ foreach($lmt_licence_default_values as $key=>$val)
+ {
+ $datas['shortlicencetext'][$val] = array(
+ "txt" => l10n("lmt_lbl_cc_s-".strtolower($val)),
+ "published" => l10n("lmt_lbl_under-".strtolower($val))
+ );
+ }
+
+ $local_tpl->assign("datas",$datas);
+
+ return($local_tpl->parse('body_page', true));
+ }
+
+
+ /* ---------------------------------------------------------------------------
+ function to manage database manipulation
+ --------------------------------------------------------------------------- */
+
+
+
+
+
+ /* ---------------------------------------------------------------------------
+ ajax functions
+ --------------------------------------------------------------------------- */
+
+ protected function ajax_img_list($pagenum)
+ {
+ global $conf;
+
+ $local_tpl = new Template(LMT_PATH."admin/", "");
+ $local_tpl->set_filename('body_page',
+ dirname($this->filelocation).'/admin/plugin_admin_listitems.tpl');
+
+ if(!isset($_REQUEST['filter']) ||
+ !($_REQUEST['filter']=="BY" ||
+ $_REQUEST['filter']=="BY-SA" ||
+ $_REQUEST['filter']=="BY-ND" ||
+ $_REQUEST['filter']=="BY-NC-ND" ||
+ $_REQUEST['filter']=="BY-NC-SA" ||
+ $_REQUEST['filter']=="BY-NC" ||
+ $_REQUEST['filter']=="CRIGHT" ||
+ $_REQUEST['filter']=="CLEFT"
+ ))
+ {
+ $_REQUEST['filter']='';
+ }
+
+ $img_ids=array();
+ $img_liste = array();
+ $sql="SELECT SQL_CALC_FOUND_ROWS lmti.*, img.file, img.path, img.tn_ext, cat.id as catid, cat.name as catname, cat.permalink, lmtla.text1, lmtla.text2
+ FROM ".$this->tables["images"]." lmti LEFT OUTER JOIN ".$this->tables["licence_author"]." lmtla ON lmtla.id = lmti.author_id, ".IMAGES_TABLE." img, ".CATEGORIES_TABLE." cat
+ WHERE lmti.image_id = img.id
+ AND img.storage_category_id = cat.id ";
+ if($_REQUEST['filter']!="")
+ {
+ $sql.=" AND lmti.licence_type='".$_REQUEST['filter']."'";
+ }
+
+ $sql.=" ORDER BY cat.id, img.id ";
+
+ if($this->my_config['lmt_list_maxitems']>0)
+ {
+ $refdbt = ($pagenum-1)*$this->my_config['lmt_list_maxitems'];
+ $sql.=" LIMIT ".$refdbt.", ".$this->my_config['lmt_list_maxitems'];
+ }
+
+ $result=pwg_query($sql);
+ if($result)
+ {
+ while($row = mysql_fetch_array($result))
+ {
+ $filenfo = pathinfo($row['path']);
+ preg_match("/(.*)\./i", $filenfo["basename"], $tmp);
+ $filenfo['filename'] = $tmp[1];
+
+ $img_ids[]=$row['image_id'];
+ $img_liste[]=array(
+ 'id' => $row['image_id'],
+ 'licence' => ($row['licence_type']=="CRIGHT")?l10n("lmt_lbl_cc_s-".strtolower($row['licence_type'])):"",
+ 'licencei' => LMT_PATH."img/".strtolower($row['licence_type'])."_80x15.png",
+ 'aut_text1' => $row['text1'],
+ 'aut_text2' => $row['text2'],
+ 'file' => $row['file'],
+ 'catname' => $row['catname'],
+ 'catlink' => make_index_url(
+ array(
+ 'category' => array(
+ 'id' => $row['catid'],
+ 'name' => $row['catname'],
+ 'permalink' => $row['permalink'])
+ )
+ ),
+ 'imglink' => make_picture_url(
+ array(
+ 'image_id' => $row['image_id'],
+ 'category' => array(
+ 'id' => $row['catid'],
+ 'name' => $row['catname'],
+ 'permalink' => $row['permalink'])
+ )
+ ),
+ 'thumb' => $filenfo["dirname"]."/thumbnail/".$conf["prefix_thumbnail"].$filenfo["filename"].".".$row["tn_ext"]
+ );
+ }
+ }
+
+ $sql="select FOUND_ROWS()";
+ $result=pwg_query($sql);
+ $nb=mysql_fetch_array($result);
+
+ $pages_navigation = new pages_navigation();
+ $pages_navigation->set_nb_items($nb[0]);
+ $pages_navigation->set_nb_items_per_page($this->my_config['lmt_list_maxitems']);
+ $pages_navigation->set_current_page($pagenum);
+ $pages_navigation->set_options(array(
+ "text_prev" => l10n("lmt_nav_prev"),
+ "text_next" => l10n("lmt_nav_next"),
+ "text_first" => l10n("lmt_nav_first"),
+ "text_last" => l10n("lmt_nav_last")
+ ));
+ $navbar=$pages_navigation->make_navigation("loadpage");
+ if($navbar!="")
+ {
+ $navbar=", ".$navbar;
+ }
+
+ $local_tpl->assign('imgliste', $img_liste);
+ return($nb[0]." ".l10n("lmt_lst_nb_photos").$navbar."#".$local_tpl->parse('body_page', true));
+ }
+
+ protected function ajax_manage_list($pagenum)
+ {
+ global $conf, $user;
+
+ $local_tpl = new Template(LMT_PATH."admin/", "");
+ $local_tpl->set_filename('body_page',
+ dirname($this->filelocation).'/admin/plugin_admin_manageitems.tpl');
+
+ if(!isset($_REQUEST['select']))
+ {
+ $_REQUEST['select']="caddie";
+ }
+
+ $img_liste = array();
+ $sql="SELECT SQL_CALC_FOUND_ROWS img.id as image_id, img.file, img.path, img.tn_ext, cat.id as catid, cat.name as catname, cat.permalink,
+ lmti.licence_type, lmtla.text1, lmtla.text2
+ FROM ".CATEGORIES_TABLE." cat, ".CADDIE_TABLE." caddie, ".IMAGES_TABLE." img
+ LEFT OUTER JOIN ".$this->tables["images"]." AS lmti
+ ON img.id = lmti.image_id
+ LEFT OUTER JOIN ".$this->tables["licence_author"]." lmtla
+ ON lmtla.id = lmti.author_id
+ WHERE img.storage_category_id = cat.id
+ AND img.id = caddie.element_id
+ AND caddie.user_id = '".$user['id']."'
+ ORDER BY cat.id, img.id ";
+
+ if($this->my_config['lmt_list_maxitems']>0)
+ {
+ $refdbt = ($pagenum-1)*$this->my_config['lmt_list_maxitems'];
+ $sql.=" LIMIT ".$refdbt.", ".$this->my_config['lmt_list_maxitems'];
+ }
+
+ $result=pwg_query($sql);
+
+ if($result)
+ {
+ while($row = mysql_fetch_array($result))
+ {
+ $filenfo = pathinfo($row['path']);
+ preg_match("/(.*)\./i", $filenfo["basename"], $tmp);
+ $filenfo['filename'] = $tmp[1];
+
+ $img_liste[]=array(
+ 'id' => $row['image_id'],
+ 'licence' => ($row['licence_type']=="")?"DEFAULT":$row['licence_type'],
+ 'licencei' => ($row['licence_type']=="")?"":LMT_PATH."img/".strtolower($row['licence_type'])."_80x15.png",
+ 'aut_text1' => $row['text1'],
+ 'aut_text2' => $row['text2'],
+ 'file' => $row['file'],
+ 'catname' => $row['catname'],
+ 'catlink' => make_index_url(
+ array(
+ 'category' => array(
+ 'id' => $row['catid'],
+ 'name' => $row['catname'],
+ 'permalink' => $row['permalink'])
+ )
+ ),
+ 'imglink' => make_picture_url(
+ array('image_id' => $row['image_id'])
+ ),
+ 'thumb' => $filenfo["dirname"]."/thumbnail/".$conf["prefix_thumbnail"].$filenfo["filename"].".".$row["tn_ext"]
+ );
+ }
+ }
+
+ $sql="select FOUND_ROWS()";
+ $result=pwg_query($sql);
+ $nb=mysql_fetch_array($result);
+
+ $pages_navigation = new pages_navigation();
+ $pages_navigation->set_nb_items($nb[0]);
+ $pages_navigation->set_nb_items_per_page($this->my_config['lmt_list_maxitems']);
+ $pages_navigation->set_current_page($pagenum);
+ $pages_navigation->set_options(array(
+ "text_prev" => l10n("lmt_nav_prev"),
+ "text_next" => l10n("lmt_nav_next"),
+ "text_first" => l10n("lmt_nav_first"),
+ "text_last" => l10n("lmt_nav_last")
+ ));
+ $navbar=$pages_navigation->make_navigation("loadpage");
+ if($navbar!="")
+ {
+ $navbar=", ".$navbar;
+ }
+
+ $local_tpl->assign('imgliste', $img_liste);
+ return($nb[0]." ".l10n("lmt_lst_nb_photos").$navbar."#".$local_tpl->parse('body_page', true));
+ }
+
+} //class
+
+?>
Index: /extensions/lmt/lmt_install.class.inc.php
===================================================================
--- /extensions/lmt/lmt_install.class.inc.php (revision 3396)
+++ /extensions/lmt/lmt_install.class.inc.php (revision 3396)
@@ -0,0 +1,102 @@
+>
+ ------------------------------------------------------------------------------
+ See main.inc.php for release information
+
+ LMT_Install : classe to manage plugin install
+
+ --------------------------------------------------------------------------- */
+ @include_once('lmt_root.class.inc.php');
+ @include_once(PHPWG_PLUGINS_PATH.'grum_plugins_classes-2/tables.class.inc.php');
+
+
+ /* lmt class for install process */
+ class LMT_Install extends LMT_root
+ {
+ private $tablef;
+ private $exportfile;
+
+ public function LMT_Install($prefixeTable, $filelocation)
+ {
+ parent::__construct($prefixeTable, $filelocation);
+ $this->tablef= new manage_tables($this->tables);
+ $this->exportfile=dirname($this->filelocation).'/'.$this->plugin_name_files.'.sql';
+ }
+
+ /*
+ function for installation process
+ return true if install process is ok, otherwise false
+ */
+ public function install()
+ {
+ $tables_def=array(
+"CREATE TABLE `".$this->tables['images']."` (
+ `image_id` mediumint(8) unsigned NOT NULL default '0',
+ `licence_type` char(8) NOT NULL default 'cc-none',
+ `author_id` int UNSIGNED NOT NULL default '0',
+ PRIMARY KEY (`image_id`),
+ KEY `by_licence` (`licence_type`),
+ KEY `by_author_id` (`author_id`)
+)
+ENGINE=MyISAM
+CHARACTER SET utf8 COLLATE utf8_general_ci",
+
+"CREATE TABLE `".$this->tables['licence_author']."` (
+ `id` int UNSIGNED NOT NULL AUTO_INCREMENT,
+ `text1` CHAR(25) NOT NULL,
+ `text2` CHAR(25) NOT NULL,
+ PRIMARY KEY (`id`)
+)
+ENGINE = MyISAM
+CHARACTER SET utf8 COLLATE utf8_general_ci",
+ );
+
+ //if present, try to import backup
+ //if backup file
+ $import=$this->tablef->import($this->exportfile);
+ if($import['errors']<0)
+ {
+ $result=$this->tablef->create_tables($tables_def);
+ return($result);
+ }
+ else
+ {
+ return(true);
+ }
+ }
+
+
+ /*
+ function for uninstall process
+ */
+ public function uninstall()
+ {
+ $this->tablef->export($this->exportfile);
+ $this->delete_config();
+ $this->tablef->drop_tables();
+ return('');
+ }
+
+ public function activate()
+ {
+ global $template;
+
+ $this->init_config();
+ $this->load_config();
+ $this->save_config();
+ return('');
+ }
+
+ public function deactivate()
+ {
+ }
+
+ } //class
+
+?>
Index: /extensions/lmt/lmt_pip.class.inc.php
===================================================================
--- /extensions/lmt/lmt_pip.class.inc.php (revision 3396)
+++ /extensions/lmt/lmt_pip.class.inc.php (revision 3396)
@@ -0,0 +1,188 @@
+>
+ ------------------------------------------------------------------------------
+ See main.inc.php for release information
+
+ LMT_PIP : classe to manage plugin public pages
+
+ --------------------------------------------------------------------------- */
+
+include_once('lmt_root.class.inc.php');
+include_once(PHPWG_PLUGINS_PATH.'grum_plugins_classes-2/public_integration.class.inc.php');
+
+class LMT_PIP extends LMT_root
+{
+ protected $section_page;
+
+ public function LMT_PIP($prefixeTable, $filelocation)
+ {
+ parent::__construct($prefixeTable, $filelocation);
+ $this->load_config();
+
+ // don't create this object inside root classe otherwise header is modified
+ // everywhere in admin pages
+ $this->ajax = new Ajax();
+
+ $this->init_events();
+ $this->load_lang();
+ }
+
+ /*
+ load language file
+ */
+ public function load_lang()
+ {
+ global $lang;
+
+ load_language('plugin.lang', LMT_PATH);
+
+ // ajax is managed here ; this permit to use user&language properties inside
+ // ajax content
+ //$this->return_ajax_content();
+ }
+
+ /*
+ initialize events call for the plugin
+ */
+ public function init_events()
+ {
+ parent::init_events();
+/*
+ add_event_handler('blockmanager_apply', array(&$this, 'blockmanager_apply') );
+ add_event_handler('loading_lang', array(&$this, 'load_lang'));
+*/
+ if($this->my_config['lmt_licence_activated']=='y')
+ {
+ add_event_handler('loc_end_page_header', array(&$this->css_icn, 'apply_CSS'));
+ add_event_handler('loc_end_picture', array(&$this, 'manage_licence_element'));
+
+ if($this->my_config['lmt_warning_visible']=='y')
+ {
+ add_event_handler('loc_end_page_tail', array(&$this, 'manage_warning_text'));
+ }
+ }
+ }
+
+
+
+ /* -------------------------------------------------------------------------
+ FUNCTIONS TO MANAGE LMT DISPLAY
+ ------------------------------------------------------------------------- */
+ public function manage_licence_element()
+ {
+ global $template, $page, $user;
+
+ $licence=$this->get_image_licence($page['image_id']);
+ if($licence['licence']=="")
+ {
+ return("");
+ }
+
+ if($this->my_config['lmt_redirect_activated']=='y')
+ {
+ $url=$this->my_config['lmt_redirect_url-'.strToLower($licence['licence'])][$user['language']];
+ if($url=='')
+ {
+ $url=$this->my_config['lmt_redirect_url-'.strToLower($licence['licence'])]['en_UK'];
+ }
+ }
+ else
+ {
+ $url="";
+ }
+
+ $style="";
+ $text="";
+ switch($this->my_config['lmt_licence_logo'])
+ {
+ case '80x15':
+ if($url!="")
+ {
+ $text = "
".$licence['aut_text1']." ".$licence['aut_text2'];
+ }
+ else
+ {
+ $text = "
".$licence['aut_text1']." ".$licence['aut_text2'];
+ }
+ break;
+ case '88x31';
+ $style=" style='text-align:left;'";
+ if($url!="")
+ {
+ $text = " | ".$licence['aut_text1']." ".$licence['aut_text2']." |
";
+ }
+ else
+ {
+ $text = " | ".$licence['aut_text1']." ".$licence['aut_text2']." |
";
+ }
+ break;
+ case 'text';
+ if($url!="")
+ {
+ $text ="
".l10n("lmt_lbl_under-".strToLower($licence['licence']))." ".l10n("lmt_lbl_cc_s-".strToLower($licence['licence']))." ".$licence['aut_text1']." ".$licence['aut_text2'];
+ }
+ else
+ {
+ $text ="
".l10n("lmt_lbl_under-".strToLower($licence['licence']))." ".l10n("lmt_lbl_cc_s-".strToLower($licence['licence']))." ".$licence['aut_text1']." ".$licence['aut_text2'];
+ }
+ break;
+ }
+
+ $template->concat('COMMENT_IMG', ''.$text.'');
+ }
+
+ public function manage_warning_text()
+ {
+ global $template, $user;
+
+
+ if(isset($this->my_config['lmt_warning_texts'][$user['language']]))
+ {
+ $text=$this->my_config['lmt_warning_texts'][$user['language']];
+ }
+ else
+ {
+ $text=$this->my_config['lmt_warning_texts']['en_UK'];
+ }
+
+ $patterns = array('/\[logo=80x15\]/i', '/\[logo=88x31\]/i', '/\[logo=text\]/i');
+ $replacements = array(
+ "",
+ "",
+ l10n("lmt_lbl_cc_s-".strToLower($this->my_config['lmt_licence_default']))
+ );
+
+ if($this->my_config['lmt_redirect_activated']=='y')
+ {
+ $url=$this->my_config['lmt_redirect_url-'.strToLower($this->my_config['lmt_licence_default'])][$user['language']];
+ if($url=='')
+ {
+ $url=$this->my_config['lmt_redirect_url-'.strToLower($this->my_config['lmt_licence_default'])]['en_UK'];
+ }
+ if($url!="")
+ {
+ $replacements[0]="".$replacements[0]."";
+ $replacements[1]="".$replacements[1]."";
+ $replacements[2]="".$replacements[2]."";
+ }
+ }
+
+ $text = preg_replace($patterns, $replacements, $text);
+
+ $template->append("footer_elements", "".htmlspecialchars_decode($text)."");
+ }
+
+
+ /* ---------------------------------------------------------------------------
+ ajax functions
+ --------------------------------------------------------------------------- */
+
+} //class
+
+?>
Index: /extensions/lmt/lmt_root.class.inc.php
===================================================================
--- /extensions/lmt/lmt_root.class.inc.php (revision 3396)
+++ /extensions/lmt/lmt_root.class.inc.php (revision 3396)
@@ -0,0 +1,376 @@
+>
+ ------------------------------------------------------------------------------
+ See main.inc.php for release information
+
+ LMT_root : common classe for admin and public classes
+
+ --------------------------------------------------------------------------- */
+ include_once(PHPWG_PLUGINS_PATH.'grum_plugins_classes-2/common_plugin.class.inc.php');
+ include_once(PHPWG_PLUGINS_PATH.'grum_plugins_classes-2/css.class.inc.php');
+ include_once(PHPWG_PLUGINS_PATH.'grum_plugins_classes-2/ajax.class.inc.php');
+ global $ajax;
+
+ class LMT_root extends common_plugin
+ {
+ protected $css; //the css object
+ protected $css_icn; //the css object
+
+ protected $licences=array('BY', 'BY-ND', 'BY-NC', 'BY-NC-ND', 'BY-NC-SA', 'BY-SA', 'CRIGHT', 'CLEFT', 'DEFAULT');
+
+ public function LMT_root($prefixeTable, $filelocation)
+ {
+ $this->plugin_name='LMT';
+ $this->plugin_name_files="lmt";
+ parent::common_plugin($prefixeTable, $filelocation);
+ $this->section_name=$this->plugin_name_files;
+
+ $this->set_tables_list(array('images', 'licence_author', 'licence_doc'));
+
+
+ $this->css = new css(dirname($this->filelocation).'/'.$this->plugin_name_files.".css");
+ $this->css_icn = new css(dirname($this->filelocation).'/'.$this->plugin_name_files."_icn.css");
+ }
+
+ public function init_events()
+ {
+ add_event_handler('blockmanager_register_blocks', array(&$this, 'register_blocks') );
+ }
+
+ /*
+ menu block management
+ */
+ public function register_blocks()
+ {
+ }
+
+
+
+ /*
+ surchage of common_plugin->save_config function
+ */
+ public function save_config()
+ {
+ if(parent::save_config())
+ {
+ $this->css->make_CSS($this->generate_CSS());
+ $this->css_icn->make_CSS($this->generate_CSS2());
+ return(true);
+ }
+ return(false);
+ }
+
+ /*
+ surchage of common_plugin->save_config function
+ */
+ public function load_config()
+ {
+ parent::load_config();
+ if(!$this->css->css_file_exists())
+ {
+ $this->css->make_CSS($this->generate_CSS());
+ }
+ if(!$this->css_icn->css_file_exists())
+ {
+ $this->css_icn->make_CSS($this->generate_CSS2());
+ }
+ }
+
+ /*
+ intialize default values
+ */
+ public function init_config()
+ {
+ //global $user;
+ $this->my_config=array(
+ 'lmt_mouseovercolor' => '303030', /**/
+ 'lmt_list_maxheight' => '650',
+ 'lmt_list_maxitems' => '0', /* limit number of item displayed ; 0 : no limit */
+ 'lmt_licence_default' => 'BY',
+ 'lmt_licence_default_author' => 0,
+ 'lmt_licence_activated' => 'n',
+ 'lmt_licence_visible' => 'n', /* y:always visible, n:only if needed */
+ 'lmt_licence_logo' => '80x15', /* 80x15, 88x31, text */
+ 'lmt_warning_visible' => 'y', /* y: display a text at the bottom of each page */
+ 'lmt_warning_texts' => array(), /* text displayed - multi lang */
+ 'lmt_redirect_activated' => 'y', /* y: the text is an url to a warning page */
+ 'lmt_redirect_url-by' => array(),
+ 'lmt_redirect_url-by-nd' => array(),
+ 'lmt_redirect_url-by-nc' => array(),
+ 'lmt_redirect_url-by-nc-nd' => array(),
+ 'lmt_redirect_url-by-nc-sa' => array(),
+ 'lmt_redirect_url-by-sa' => array(),
+ 'lmt_redirect_url-cright' => array(),
+ 'lmt_redirect_url-cleft' => array(),
+ );
+
+ $languages=get_languages();
+ foreach($languages as $key => $val)
+ {
+ $lang=substr($key,0,2)."/";
+ if($lang=="en/") { $lang=""; }
+ $this->my_config['lmt_warning_texts'][$key]='';
+ $this->my_config['lmt_redirect_url-by'][$key]='http://creativecommons.org/licenses/by/2.0/'.$lang;
+ $this->my_config['lmt_redirect_url-by-nd'][$key]='http://creativecommons.org/licenses/by-nd/2.0/'.$lang;
+ $this->my_config['lmt_redirect_url-by-nc'][$key]='http://creativecommons.org/licenses/by-nc/2.0/'.$lang;
+ $this->my_config['lmt_redirect_url-by-nc-nd'][$key]='http://creativecommons.org/licenses/by-nc-nd/2.0/'.$lang;
+ $this->my_config['lmt_redirect_url-by-nc-sa'][$key]='http://creativecommons.org/licenses/by-nc-sa/2.0/'.$lang;
+ $this->my_config['lmt_redirect_url-by-sa'][$key]='http://creativecommons.org/licenses/by-sa/2.0/'.$lang;
+ $this->my_config['lmt_redirect_url-cright'][$key]='';
+ $this->my_config['lmt_redirect_url-cleft'][$key]='';
+ }
+
+ }
+
+ /*
+ generate the css code
+ */
+ protected function generate_CSS()
+ {
+ $text = "
+.TableRow:hover
+{
+ background-color:#".$this->my_config['lmt_mouseovercolor'].";
+}
+
+.formtable
+{
+ text-align:justify;
+ display:block;
+ margin-top:0px;
+ margin-bottom:0px;
+ width:100%;
+}
+
+.formtable tr {
+ vertical-align:top;
+}
+
+.littlefont { font-size:90%; }
+table.littlefont th { text-align:center; padding:3px;padding-left:9px;padding-right:9px; }
+table.littlefont td { text-align:left; padding:0px;padding-left:3px;padding-right:3px; }
+
+.lmt_page
+{
+ text-align:justify;
+ margin:8px;
+}
+
+.lmt {
+ text-align:justify;
+}
+
+#list {
+ width:100%;
+ overflow-y:scroll;
+ min-height:250px;
+ max-height:650px;
+}
+
+#ullist li {
+ width:300px;
+ display:block;
+ float:left;
+ text-align:left;
+}
+
+#ullist label {
+ float:left;
+}
+
+#ullist li table {
+ margin:0px;
+ text-align:left;
+ width:300px;
+ font-size:80%;
+}
+
+#ullist li tr {
+ vertical-align:top;
+}
+
+.content ul.thumbnails span.extendwrap1 {
+ margin:0px;
+ cursor:pointer;
+}
+
+.is_on, .is_off {
+ z-index:20;
+ width:12px;
+ height:12px;
+ display:block;
+ cursor:pointer;
+}
+
+.is_on {
+ background:url(./img/cb_on.png);
+}
+.is_off {
+ background:url(./img/cb_off.png);
+}
+
+.icnhelp {
+ weight:bold;
+ text-decoration:none;
+ cursor:help;
+}
+
+.hinthlp {
+ position:absolute;
+ max-width:400px;
+ border:1px solid #000000;
+ background:#ffffa0;
+ color:#000000;
+ top:0px;
+ left:-450px;
+ padding:2px;
+ text-align:justify;
+}
+
+ ";
+ return($text);
+ }
+
+ /*
+ generate the css code
+ */
+ protected function generate_CSS2()
+ {
+ $text = "
+.logo80x15 {
+ position:relative;
+ top:4px;
+ margin-right:4px;
+ border:0px none;
+}
+
+.logo88x31 {
+ position:relative;
+ margin-right:4px;
+ border:0px none;
+}
+
+#theImage img.logo80x15, #theImage img.logo88x31 {
+ border:0px none;
+}
+
+.licencetag {
+ display:block;
+ padding-top:10px;
+ font-size:80%;
+}
+ ";
+ return($text);
+ }
+
+
+
+
+ /* -------------------------------------------------------------------------
+ return the licence type for an image
+ $default = 'y' => if no licence for the picture, return de default licence
+ 'n' => if no licence for the picture, return empty values
+ ------------------------------------------------------------------------- */
+ public function get_image_licence($image_id)
+ {
+
+ $return=array(
+ "default" => "",
+ "licence" => "",
+ "aut_text1" => "",
+ "aut_text2" => ""
+ );
+ $sql="SELECT lmti.licence_type, lmta.text1, lmta.text2
+ FROM ".$this->tables['images']." lmti
+ LEFT OUTER JOIN ".$this->tables['licence_author']." lmta ON lmti.author_id = lmta.id
+ WHERE lmti.image_id = '".$image_id."'";
+ $result=pwg_query($sql);
+ if($result)
+ {
+ while($row=mysql_fetch_array($result))
+ {
+ $return=array(
+ "defaut" => "n",
+ "licence" => $row['licence_type'],
+ "aut_text1" => $row['text1'],
+ "aut_text2" => $row['text2']
+ );
+ }
+ }
+
+ if(($return["licence"]=="")&&($this->my_config["lmt_licence_visible"]=="y"))
+ {
+ $return=array(
+ "defaut" => "y",
+ "licence" => $this->my_config["lmt_licence_default"],
+ "aut_text1" => "",
+ "aut_text2" => ""
+ );
+
+ $sql="SELECT * FROM ".$this->tables['licence_author']."
+ WHERE id = '".$this->my_config["lmt_licence_default_author"]."'";
+ $result=pwg_query($sql);
+ if($result)
+ {
+ while($row=mysql_fetch_array($result))
+ {
+ $return["aut_text1"]=$row['text1'];
+ $return["aut_text2"]=$row['text2'];
+ }
+ }
+ }
+
+ return($return);
+ }
+
+
+ /* -------------------------------------------------------------------------
+ returns an array of image id with the licence type
+ if $licence = "" => return all picture with a specific licences
+ ------------------------------------------------------------------------- */
+ public function get_images_licences($licence)
+ {
+ $sql="".$this->tables['lmt'];
+
+ $result=pwg_query($sql.$sql_where.$sql_order);
+ if($result)
+ {
+ $returned=array();
+ while($row=mysql_fetch_assoc($result))
+ {
+ array_push($returned, $row);
+ }
+ return($returned);
+ }
+ return(false);
+ }
+
+ protected function display_result($action_msg, $result)
+ {
+ global $page;
+
+ if($result)
+ {
+ array_push($page['infos'], $action_msg);
+ }
+ else
+ {
+ array_push($page['errors'], $action_msg);
+ }
+ }
+
+
+ /* ---------------------------------------------------------------------------
+ ajax functions
+ --------------------------------------------------------------------------- */
+
+
+ } //class
+
+?>
Index: /extensions/lmt/main.inc.php
===================================================================
--- /extensions/lmt/main.inc.php (revision 3396)
+++ /extensions/lmt/main.inc.php (revision 3396)
@@ -0,0 +1,75 @@
+>
+--------------------------------------------------------------------------------
+
+:: HISTORY
+
+| release | date |
+| 1.0.0 | 2009/03/01 | first release
+| 1.0.1 | 2009/05/01 | * modify de style for 80x15&text logo (to be centered
+| | | like the 88x31 logo)
+| | | * modify the footer (allows to use html markup)
+| | |
+
+
+:: TO DO
+
+--------------------------------------------------------------------------------
+
+:: NFO
+ LMT_root : common classe for admin and public classes
+ LMT_AIM : classe to manage plugin integration into plugin menu
+ LMT_AIP : classe to manage plugin admin pages
+ LMT_PIP : classe to manage plugin public pages
+
+--------------------------------------------------------------------------------
+*/
+
+// pour faciliter le debug :o)
+ //ini_set('error_reporting', E_ALL);
+ //ini_set('display_errors', true);
+
+if(!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+
+
+define('LMT_DIR' , basename(dirname(__FILE__)));
+define('LMT_PATH' , PHPWG_PLUGINS_PATH . LMT_DIR . '/');
+
+define('LMT_VERSION' , '1.0.1'); // => ne pas oublier la version dans l'entête !!
+
+global $prefixeTable;
+
+
+if(defined('IN_ADMIN'))
+{
+ //LMT admin interface loaded and active only if in admin page
+ include_once("lmt_aim.class.inc.php");
+ $obj=new LMT_AIM($prefixeTable, __FILE__);
+ $obj->init_events();
+}
+else
+{
+ //LMT public interface loaded and active only if in public page
+ include_once("lmt_pip.class.inc.php");
+ $obj=new LMT_PIP($prefixeTable, __FILE__);
+}
+
+set_plugin_data($plugin['id'], $obj);
+
+?>
Index: /extensions/lmt/maintain.inc.php
===================================================================
--- /extensions/lmt/maintain.inc.php (revision 3396)
+++ /extensions/lmt/maintain.inc.php (revision 3396)
@@ -0,0 +1,119 @@
+>
+ ------------------------------------------------------------------------------
+ See main.inc.php for release information
+
+ --------------------------------------------------------------------------- */
+
+if (!defined('PHPWG_ROOT_PATH')) { die('Hacking attempt!'); }
+
+define('LMT_DIR' , basename(dirname(__FILE__)));
+define('LMT_PATH' , PHPWG_PLUGINS_PATH . LMT_DIR . '/');
+
+//ini_set('error_reporting', E_ALL);
+//ini_set('display_errors', true);
+
+global $gpc_installed, $lang; //needed for plugin manager compatibility
+
+/* -----------------------------------------------------------------------------
+LMT needs the Grum Plugin Classe
+----------------------------------------------------------------------------- */
+$gpc_installed=false;
+if(file_exists(PHPWG_PLUGINS_PATH.'grum_plugins_classes-2/common_plugin.class.inc.php'))
+{
+ @include_once(PHPWG_PLUGINS_PATH.'grum_plugins_classes-2/main.inc.php');
+ // need GPC release greater or equal than 2.0.2
+ if(checkGPCRelease(2,0,2))
+ {
+ @include_once('lmt_install.class.inc.php');
+ $gpc_installed=true;
+ }
+}
+
+function gpcMsgError(&$errors)
+{
+ array_push($errors, sprintf(l10n('lmt_gpc2_not_installed'), "2.0.2"));
+}
+// -----------------------------------------------------------------------------
+
+
+
+
+load_language('plugin.lang', LMT_PATH);
+
+
+function plugin_install($plugin_id, $plugin_version, &$errors)
+{
+ global $prefixeTable, $gpc_installed;
+
+ if($gpc_installed)
+ {
+ $obj = new LMT_Install($prefixeTable, __FILE__);
+ $result=$obj->install();
+ if(!$result)
+ {
+ array_push($errors, "error");
+ }
+ }
+ else
+ {
+ gpcMsgError($errors);
+ }
+}
+
+function plugin_activate($plugin_id, $plugin_version, &$errors)
+{
+ global $prefixeTable, $gpc_installed;
+
+ if($gpc_installed)
+ {
+ $obj = new LMT_Install($prefixeTable, __FILE__);
+ $result=$obj->activate();
+ if($result===false or $result!='')
+ {
+ if(is_string($result))
+ {
+ array_push($errors, $result);
+ }
+ else
+ {
+ array_push($errors, "");
+ }
+ }
+ }
+ else
+ {
+ gpcMsgError($errors);
+ }
+}
+
+function plugin_deactivate($plugin_id)
+{
+/* global $prefixeTable;
+ $obj = new install_mypolls($prefixeTable, __FILE__);
+ $obj->deactivate(); */
+}
+
+function plugin_uninstall($plugin_id)
+{
+ global $prefixeTable, $gpc_installed;
+
+ if($gpc_installed)
+ {
+ $obj = new LMT_Install($prefixeTable, __FILE__);
+ $obj->uninstall();
+ }
+ else
+ {
+ gpcMsgError($errors);
+ }
+}
+
+
+?>
Index: /extensions/lmt/templates/index.php
===================================================================
--- /extensions/lmt/templates/index.php (revision 3396)
+++ /extensions/lmt/templates/index.php (revision 3396)
@@ -0,0 +1,33 @@
+