Index: main/plugin-web/i18n/messages_en.xml
===================================================================
--- main/plugin-web/i18n/messages_en.xml (revision 26702)
+++ main/plugin-web/i18n/messages_en.xml (working copy)
@@ -25,8 +25,6 @@
Access to custom tagsTags managementAdd, update or delete tags
- Tag categories management
- Add, update or delete tag categoriesImport tagsImport tags from a XML fileRights on sitemap
@@ -694,7 +692,6 @@
TagDescription
- CategoryTypeSelect tag for more detailsAn error occurred: impossible to set a tag on page or content
@@ -709,7 +706,7 @@
<i>PAGE</i> tagAdd tag
- Add tag on selected category
+ Add tag as a child of the selected tagSee Help for detailsEdit tagEdit selected tag
@@ -717,22 +714,12 @@
Delete tagDelete selected tagSee Help for details
- Add category
- Add category on selected node
- See Help for details
- Edit category
- Edit selected category
- See Help for details
- Delete category
- Delete selected category
- See Help for detailsTagsAn error occurred. Tool cannot displayImport a fileImport tags from a CSV file.
- This button is disabled because no category is selected.Import tags from a XML file
- Please select a XML file from your local storage containing the tags and categories to import.
+ Please select a XML file from your local storage containing the tags to import.FileXML file containing the tags to importPlease select a XML file
@@ -750,7 +737,6 @@
1 tag was not imported. tags were not imported.Error importing the tags
- The tags could not be imported: the selected category does not exist anyware.You must select a file with .xml extension.The file is too large. The tags were not imported.An unexpected error has occurred : The tags were not imported.
@@ -759,8 +745,6 @@
New tagEdit tag
- New category
- Edit categoryTitleNewTag's title.<br/>The internal key, automatically created, will be based on this title.
@@ -778,8 +762,7 @@
OKCancel
- Unable to create tag: parent category no longer exists.
- Key already used for current website.
+ Unable to create tag: parent tag no longer exists.An error occurred : unable to create tag.An error occurred : unable to update tag.Unable to update tag: unknown tag.
@@ -787,19 +770,13 @@
Do you really want to delete this tag?Unable to delete tag: unknown tag.An error occurred : unable to delete tag.
- Unable to create category : unknown parent category.
- Category name already used in current website
- An error occurred : unable to create category.
- An error occurred : unable to update category.
- Unable to update category: unknown category.An error occurred : unable to collect tag data.
- An error occured : unable to collect category data.
- Delete
- Do you really want to delete this category and its sub-categories? Note that tags belonging to these categories will also be deleted ?
- Unable to delete category : unkown category.
- An error occurred: unable to delete category.Invalid key : please type a key without space or special characters. Autrorized characters are A to Z, 0 to 9 and _.
+ Tags
+ Autoposting
+ Enable the autoposting feature for full text search.
+
@@ -1323,6 +1300,8 @@
Check this option to filter contents according to access rights of the connected user.<br/><b>Be careful!</b> Enabling this feature disables this page's cache and degrades its performance: it should not be checked on high traffic pages like the home page.<br/>If this option is disabled the resulting contents will be identical for all visitors having access to the page.TagsService will only display contents tagged with specific tags.<br/>You can leave that field empty.
+ Strict search on tags
+ If strict search is disabled, the service will also display contents tagged with child tags of the selected tags.RSS feedSee the RSS feed for these contentsCheck box to display an RSS feed on contents digest
@@ -1421,11 +1400,13 @@
With checkboxes then by filter on resultsNone (visitor has no choice)Search by tag
- Add criterias on tags by selecting tag categories.<br/>The criteria will be the name of category and display a list of tags.<br/>Select several categories to display several criterias on tags.<br/>Leave empty if you don't want that kind of criteria.
+ Add criterias on tags by selecting a set of tags.<br/>The criteria will be the name of tag and display the list of child tags.<br/>There will be a distinct criterion for each selected tag, with every criterion displaying its own list of child tags.<br/>Leave empty if you do not want to use that kind of criteria.Search by sectionSelect several pages of website to add a section criteria for search engine.<br/>If you choose only one section, search will only apply to pages of the selected section and visitor will have no criteria.<br/>If you select several sections, user will choose a section in a list.<br/>Leave empty to search on every sections.MultisiteCheck box if you want to propose search on all sites for visitors
+ Strict search on tags
+ If strict search is disabled, the service will also display contents tagged with child tags of the selected tags.The search field can not begin with character ? or *.Service identifierOptional, this field allows to give two instances of the same service (in different zones) the same identifier, to make it communicate.<br/>This allows, for instance, to display the results in a zone different of the search form.
@@ -1927,16 +1908,11 @@
Collapse allFilterSelect tags ...
- Add a new tag to the selected category.
+ Add a new tag to the current selection.You are not allowed to add a tag here.
- Please select a custom tag category to add a new tag.
+ Please select a custom tag to be able to add a new child tag.OkCancel
- Click here to select tag category
- Select tag category ...
- Filter
- Ok
- CancelNo tag match the chosen context.Select content ...Search content ...
@@ -2309,7 +2285,6 @@
TagsTags
- CategoriesTags
Index: main/plugin-web/i18n/messages_fr.xml
===================================================================
--- main/plugin-web/i18n/messages_fr.xml (revision 26702)
+++ main/plugin-web/i18n/messages_fr.xml (working copy)
@@ -20,13 +20,11 @@
Redirection d'URLsRedirection d'URLsAutorise l'accès et la gestion des alias de page (ou redirection d'url)
- Droits sur les étiquettes
+ Droits sur les étiquettesEtiquettes personnaliséesAutorise l'accès à la liste des étiquettes personnaliséesGestion des étiquettesAutorise à ajouter, modifier ou supprimer des étiquettes
- Gestion des catégories d'étiquette
- Autorise à ajouter, modifier ou supprimer des catégories d'étiquetteImporter des étiquettesImporter des étiquettes à partir d'un fichier xmlDroits sur le plan du site
@@ -694,7 +692,6 @@
EtiquetteDescription
- CatégorieTypeSélectionner une étiquette pour plus d'informationUne erreur est survenue : impossible d'étiqueter la page / le contenu
@@ -709,7 +706,7 @@
Etiquette de <i>PAGE</i>Ajouter une étiquette
- Ajoute une étiquette au niveau de la catégorie sélectionnée
+ Ajoute une étiquette en tant qu'enfant de l'étiquette sélectionnéeVoir l'aide pour plus de détailsModifier l'étiquetteModifie l'étiquette sélectionnée
@@ -717,22 +714,12 @@
Supprimer l'étiquetteSupprime l'étiquette sélectionnéeVoir l'aide pour plus de détails
- Ajouter une catégorie
- Ajoute une catégorie d'étiquette au niveau de la catégorie sélectionnée
- Voir l'aide pour plus de détails
- Modifier la catégorie
- Modifie la catégorie d'étiquette sélectionnée
- Voir l'aide pour plus de détails
- Supprimer la catégorie
- Supprime la catégorie d'étiquette sélectionnée
- Voir l'aide pour plus de détailsEtiquettesUne erreur survenue empêchant l'affichage de l'outilImporter des étiquettesImporter des étiquettes depuis un fichier xml.
- Ce bouton est désactivé car aucune catégorie n'est sélectionnée.Importer des étiquettes depuis un fichier xml
- Veuillez sélectionner un fichier .xml de votre disque dur contenant les étiquettes et catégories d'étiquettes à importer.
+ Veuillez sélectionner un fichier .xml de votre disque dur contenant les étiquettes à importer.FichierFichier XML contenant les étiquettes à importerVeuillez sélectionner un fichier XML
@@ -750,7 +737,6 @@
1 étiquette n'a pu être importée. étiquettes n'ont pu être importées.Importer des étiquettes
- Les étiquettes n'ont pas pu être importées : la catégorie d'étiquettes sélectionnée n'existe plus.Vous devez sélectionner un fichier XMLLe fichier est trop volumineux. Les étiquettes n'ont pas pu être importées.Une erreur inattendue est survenue : les étiquettes n'ont pas pu être importées.
@@ -759,8 +745,6 @@
Nouvelle étiquetteModifier l'étiquette
- Nouvelle catégorie
- Modifier la catégorieTitreNouveauTitre de l'étiquette.<br/>La clé interne sera calculée automatiquement en fonction de ce titre.
@@ -778,8 +762,7 @@
OKAnnuler
- Impossible de créer l'étiquette: la catégorie parente n'existe plus.
- La clef de cette étiquette est déjà utilisée pour ce site.
+ Impossible de créer l'étiquette: l'étiquette parente n'existe plus.Une erreur inattendue est survenue : l'étiquette n'a pu être créée.Une erreur inattendue est survenue : l'étiquette n'a pu être modifiée.Impossible de modifier l'étiquette: l'étiquette n'existe plus.
@@ -787,19 +770,13 @@
Etes-vous sûr de vouloir supprimer cette étiquette ?Impossible de supprimer l'étiquette: l'étiquette n'existe plus.Une erreur inattendue est survenue : l'étiquette n'a pu être supprimée.
- Impossible de créer la catégorie : la catégorie parente n'existe plus.
- La nom de cette catégorie est déjà utilisée pour ce site
- Une erreur inattendue est survenue : la catégorie n'a pu être créée.
- Une erreur inattendue est survenue : la catégorie n'a pu être modifiée.
- Impossible de modifier la catégorie: la catégorie n'existe plus.Une erreur est survenue : impossible de récupérer les informations sur l'étiquette.
- Une erreur est survenue : impossible de récupérer les informations sur la catégorie d'étiquette.
- Suppression
- Etes-vous sûr de vouloir supprimer cette catégorie d'étiquette et ses sous-catégories et/ou étiquettes ?
- Impossible de supprimer la catégorie : la catégorie n'existe plus.
- Une erreur inattendue est survenue : la catégorie n'a pu être supprimée.La clé est invalide : veuillez choisir une clé sans espace ni accent, composée uniquement des caractères A à Z, 0 à 9 et _.
+ Etiquettes
+ Autopostage
+ Activer l'autopostage pour prendre en compte la hiérarchie des étiquettes dans les recherches plein texte.
+
@@ -1321,9 +1298,11 @@
Masquer les contenus orphelinsCochez cette case si vous ne voulez pas que les contenus orphelins soient remontés.<br/>Un contenu est orphelin si il n'est pas rattaché à une page ou si sa page n'est pas publiée.Prendre en compte les droits de l'utilisateur
- Cochez cette option pour que la remontée de contenus soit personnalisées en fonction des droits d'accès de l'utilisateur connecté.<br/><b>Attention !</b> Ceci désactive la mise en cache de la page et en dégrade donc les performances : il est déconseillé d'activer cette option sur des pages à fort trafic, telle que la page d'accueil du site.<br/>Si cette option est désactivée la remontée de contenus est identique pour tous les visiteurs ayant accès à la page.
+ Cochez cette option pour que seuls les contenus auxquels l'utilisateur a accès soient remontés.<br/><b>Attention !</b> Cocher cette option désactive la mise en cache de la page et en dégrade donc les performances : il est déconseillé de l'activer sur des pages à fort trafic, comme la page d'accueil.EtiquettesLe service remontera uniquement les contenus étant étiquetés avec les étiquettes sélectionnées.<br/>Ce champ peut être vide.
+ Recherche stricte sur les étiquettes
+ Si la recherche stricte n'est pas activée, le service remontera également les contenus étant étiquetés avec des étiquettes filles de celles sélectionnées.Fils RSSVoir le flux RSS de ces contenusCocher la case pour afficher l'icone de flux RSS
@@ -1422,7 +1401,9 @@
Par des cases à cocher puis par filtre sur les résultatsAucun (choix imposé au visiteur)Recherche par étiquette
- Vous pouvez ajouter le critère de recherche par étiquette en sélectionnant une catégorie d'étiquette.<br/>Le critère portera le nom de la catégorie et prendra la forme d'une liste déroulante avec la liste des d'étiquettes de cette catégorie.<br/>Chaque catégorie sélectionnée donne lieu à un critère de ce type.<br/>Laissez ce paramètre vide pour que ce critère n'apparaissse pas.
+ Vous pouvez ajouter le critère de recherche par étiquette en sélectionnant un ensemble d'étiquette.<br/>Le critère portera le nom de l'étiquette et prendra la forme d'une liste déroulante avec la liste des étiquettes filles.<br/>Chaque étiquette sélectionnée donne lieu à un critère de ce type.<br/>Laissez ce paramètre vide pour que ce critère n'apparaissse pas.
+ Recherche stricte sur les étiquettes
+ Si la recherche stricte n'est pas activée, le service remontera également les contenus étant étiquetés avec des étiquettes filles de celles sélectionnées.Recherche par rubriqueVous pouvez ajouter le critère de recherche par rubrique en sélectionnant une ou plusieurs pages de votre site.<br/>Si vous ne sélectionnez qu'une seule rubrique, la recherche ne portera que sur les pages de cette rubrique sans donner le choix aux utilisateurs.<br/>Si vous sélectionnez plus d'une rubrique, l'utilisateur pourra choisir une rubrique dans une liste déroulante.<br/>Laissez ce paramètre vide pour que ce critère n'apparaisse pas et que la recherche s'effectue dans toutes les rubriques du site.Recherche multisite
@@ -1928,17 +1909,12 @@
Fermer toutSupprimer l'étiquetteSélectionnez des étiquettes ...
- Cliquez ici pour ajouter une étiquette à la catégorie sélectionnée.
+ Cliquez ici pour ajouter une étiquette fille à la sélection.Vos droits sont insuffisants pour ajouter une étiquette ici.
- Sélectionnez une catégorie d'étiquettes personnalisées pour en ajouter une.
+ Sélectionnez une étiquette personnalisée pour pouvoir ajouter une étiquette fille.OkAnnulerAucune étiquette ne correspond dans le contexte choisi.
- Cliquez ci-après pour sélectionner une catégorie d'étiquette
- Sélectionnez des catégories d'étiquettes ...
- Filtre
- Ok
- AnnulerSélectionner un contenu ...Rechercher un contenu ...Pour sélectionner le contenu d'une page, choisissez d'abord le site, la langue et la page dans l'arbre ci-dessous. Sélectionnez ensuite un contenu de la page sélectionnée dans la liste déroulante.
@@ -2310,7 +2286,6 @@
EtiquettesEtiquettes
- CatégoriesEtiquettes
Index: main/plugin-web/ribbon/cms-ribbon-tags.xml
===================================================================
--- main/plugin-web/ribbon/cms-ribbon-tags.xml (revision 26702)
+++ main/plugin-web/ribbon/cms-ribbon-tags.xml (working copy)
@@ -20,32 +20,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -53,6 +27,7 @@
+
@@ -60,6 +35,7 @@
+
@@ -67,6 +43,7 @@
+
Index: main/plugin-web/resources/js/org/ametys/web/tool/tag/TagsTool.i18n.js
===================================================================
--- main/plugin-web/resources/js/org/ametys/web/tool/tag/TagsTool.i18n.js (revision 26702)
+++ main/plugin-web/resources/js/org/ametys/web/tool/tag/TagsTool.i18n.js (working copy)
@@ -57,8 +57,8 @@
// Alphabetical sort
this._treeSorter = new Ext.tree.TreeSorter(this._tree, {
- folderSort: true,
- leafAttr: 'leafSort'
+// folderSort: true,
+// leafAttr: 'leafSort'
});
//tree.render();
@@ -158,9 +158,11 @@
{
this.outOfDate(true);
}
-
- // The node is out of date
- this._updateNode (target.getParameters().id)
+ else
+ {
+ // The node is out of date
+ this._updateNode (target.getParameters().id)
+ }
}
}
}
@@ -280,7 +282,7 @@
if (!this._tree.rendered)
return;
- treeLoader.baseParams.categoryID = node.id;
+ treeLoader.baseParams.tagID = node.id;
}
org.ametys.web.tool.tag.TagsTool.prototype._onLoad = function (treeLoader, node)
Index: main/plugin-web/resources/js/org/ametys/web/widgets/TagsWidget.i18n.js
===================================================================
--- main/plugin-web/resources/js/org/ametys/web/widgets/TagsWidget.i18n.js (revision 26702)
+++ main/plugin-web/resources/js/org/ametys/web/widgets/TagsWidget.i18n.js (working copy)
@@ -39,6 +39,10 @@
if (!config.width)
config.width = 470 // default width
+
+ // string to boolean
+ config.onlyTagsWithChildren = config.onlyTagsWithChildren === true || config.onlyTagsWithChildren === 'true';
+ config.allowProviders = config.allowProviders === true || config.allowProviders === 'true';
org.ametys.web.widget.TagsWidget.superclass.constructor.call(this, config);
@@ -88,6 +92,14 @@
*/
onlyCustomTags: false,
/**
+ * @cfg {Boolean} onlyTagsWithChildren If true, only tags with children will be checkable.
+ */
+ onlyTagsWithChildren: false,
+ /**
+ * @cfg {Boolean} allowProviders If true, tag providers will also be checkable.
+ */
+ allowProviders: false,
+ /**
* @cfg {Boolean} allowCreation If true, a link at the dialog bottom proposes to add a new page (defaults to false).
*/
allowCreation: false,
@@ -150,7 +162,7 @@
var params = {'siteName': siteName, 'tags': typeof(values) == 'string' ? values.split(",") : values};
// Necessary synchronous mode to get _rawDisplayValue
- var serverMessage = new org.ametys.servercomm.ServerMessage("web", 'tags.xml', params, org.ametys.servercomm.ServerComm.PRIORITY_SYNCHRONOUS, null, this, null, "xml");
+ var serverMessage = new org.ametys.servercomm.ServerMessage("web", 'tags/list.xml', params, org.ametys.servercomm.ServerComm.PRIORITY_SYNCHRONOUS, null, this, null, "xml");
var response = org.ametys.servercomm.ServerComm.getInstance().send(serverMessage);
var displayValue = '';
@@ -406,7 +418,7 @@
for (var i=0; i < tags.length; i++)
{
var node = this._findChildRecursively (this._tree.getRootNode(), 'name', tags[i]);
- if (node != null)
+ if (node != null && !node.disabled)
{
if (this.multiple)
{
@@ -477,9 +489,11 @@
}
var loader = new org.ametys.web.tree.TagXmlLoader ({
- dataUrl: getPluginDirectUrl("web") + '/tags/list.xml',
+ dataUrl: getPluginDirectUrl("web") + '/tags.xml',
baseParams: baseParams,
checkMode: this.multiple, // to display checkboxes
+ allowProviders: this.allowProviders,
+ onlyTagsWithChildren: this.onlyTagsWithChildren,
syncMode: true // synchronous mode for filters
});
loader.addListener("beforeload", this._onBeforeLoad, this);
@@ -751,7 +765,7 @@
if (this.allowCreation)
{
- if (node == null || node.attributes.type != 'category')
+ if (node == null)
{
this._creationLink.enable();
this._creationLink.update("");
@@ -812,7 +826,7 @@
}
-org.ametys.web.widget.TagsWidget.prototype._createTagCb = function(tagId, categoryId, parentNodeId)
+org.ametys.web.widget.TagsWidget.prototype._createTagCb = function(tagId, parentId, parentNodeId)
{
this._tree.getRootNode().reload();
}
Index: main/plugin-web/resources/js/org/ametys/web/widgets/TagCategoriesWidget.i18n.js
===================================================================
--- main/plugin-web/resources/js/org/ametys/web/widgets/TagCategoriesWidget.i18n.js (revision 26702)
+++ main/plugin-web/resources/js/org/ametys/web/widgets/TagCategoriesWidget.i18n.js (working copy)
@@ -1,490 +0,0 @@
-/*
- * Copyright 2010 Anyware Services
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-Ext.namespace('org.ametys.web.widget');
-
-//Register widget
-org.ametys.utils.Widgets.registerWidget ('string', 'tag-categories', 'org.ametys.web.widget.TagCategoriesWidget');
-org.ametys.utils.Widgets.registerWidget ('string', 'content-tag-categories', 'org.ametys.web.widget.ContentTagCategoriesWidget');
-org.ametys.utils.Widgets.registerWidget ('string', 'page-tag-categories', 'org.ametys.web.widget.PageTagCategoriesWidget');
-
-/**
- * @class This class provides a widget input for selecting tag categories.<br/>
- * Use the {@link org.ametys.web.TagCategoriesWidget#multiple} configuration option to allow multi-selection.<br/>
- * @extends Ext.form.TextField
- * Creates a tag category widget field.
- * @xtype tagcategoryfield
- */
-org.ametys.web.widget.TagCategoriesWidget = function(config)
-{
- config.itemCls = "ametys-input";
- config.labelSeparator = '';
- // private
- config.readOnly = true;
- config.name = config.name;
- config.msgTarget = 'side';
-
- if (!config.width)
- config.width = 470 // default width
-
- org.ametys.web.widget.TagCategoriesWidget.superclass.constructor.call(this, config);
-};
-
-Ext.extend(org.ametys.web.widget.TagCategoriesWidget, Ext.form.TextField, {
- /**
- * @cfg {String} buttonText The button text to display on the select button (defaults to
- * ''). Note that if you supply a value for {@link #buttonCfg}, the buttonCfg.text
- * value will be used instead if available.
- */
- buttonText: '',
- /**
- * @cfg {String} buttonIcon The button icon for the select button.
- * Note that if you supply a value for {@link #buttonCfg}, the buttonCfg.icon
- * value will be used instead if available.
- */
- buttonIcon: getPluginResourcesUrl('web') + '/img/tag/category_16.png',
- /**
- * @cfg {Boolean} buttonOnly True to display the file upload field as a button with no visible
- * text field (defaults to false). If true, all inherited TextField members will still be available.
- */
- buttonOnly: false,
- /**
- * @cfg {Number} buttonOffset The number of pixels of space reserved between the button and the text field
- * (defaults to 5). Note that this only applies if {@link #buttonOnly} = false.
- */
- buttonOffset: 5,
- /**
- * @cfg {String} siteName The site name of tags
- * (defaults to current site).
- */
- siteName: context.parameters.siteName,
- /**
- * @cfg {Boolean} multiple True to allow multi-selection and display checkboxes (defaults to false).
- */
- multiple: false,
- /**
- * @cfg {Number} width The text field width in pixel(defaults to 470)
- */
- /*width: 470,*/
-
- targetType: null,
- xtype: 'tagcategoryfield'
-
-});
-
-org.ametys.web.widget.TagCategoriesWidget.prototype._rawDisplayValue = "";
-org.ametys.web.widget.TagCategoriesWidget.prototype.getDisplayValue = function ()
-{
- return this._rawDisplayValue;
-}
-
-org.ametys.web.widget.TagCategoriesWidget.prototype.setValue = function (values)
-{
- org.ametys.web.widget.TagCategoriesWidget.superclass.setValue.call(this, values);
-
- if ((Ext.isArray(values) && values.length == 0) || (!Ext.isArray(values) && values == ''))
- {
- this._rawDisplayValue = "";
-
- if (this.rendered)
- {
- var text = '<span class="empty">' + "" + '</span>';
- text = org.ametys.utils.Utils.getTruncatedText (this.displayField.el, text, this.displayField.getWidth());
- this.displayField.el.update (text);
- }
- }
- else
- {
- var params = {'siteName': this.siteName, 'categories': typeof(values) == 'string' ? values.split(",") : values};
- var serverMessage = new org.ametys.servercomm.ServerMessage("web", 'tag-categories.xml', params, org.ametys.servercomm.ServerComm.PRIORITY_SYNCHRONOUS, null, this, null, "xml");
- var response = org.ametys.servercomm.ServerComm.getInstance().send(serverMessage);
-
- var displayValue = '';
- if (response != null)
- {
- var nodes = response.selectNodes("TagCategories/*")
- for (var i=0; i < nodes.length; i++)
- {
- if (i != 0)
- {
- displayValue += ", ";
- }
- displayValue += nodes[i].selectSingleNode('title')[org.ametys.servercomm.ServerComm.xmlTextContent];
- }
- }
-
- this._rawDisplayValue = displayValue;
-
- if (this.rendered)
- {
- displayValue = org.ametys.utils.Utils.getTruncatedText (this.displayField.el, displayValue, this.displayField.getWidth());
- this.displayField.el.update(displayValue);
- }
- }
-
-}
-
-/**
- * Set the site name of the tag categories
- * @param {String} The site name or constants among OTHER_SITES, ALL_SITES
- */
-org.ametys.web.widget.TagCategoriesWidget.prototype.setSite = function (siteName)
-{
- this.siteName = siteName;
-}
-
-org.ametys.web.widget.TagCategoriesWidget.prototype.reload = function (siteName)
-{
- this._tree.getRootNode().reload();
- this._tree.collapseAll();
-}
-
-org.ametys.web.widget.TagCategoriesWidget.prototype.onRender = function(ct, position)
-{
- org.ametys.web.widget.TagCategoriesWidget.superclass.onRender.call(this, ct, position);
-
- this.wrap = this.el.wrap({cls:'x-form-field-wrap x-form-tag-wrap'});
- this.el.addClass('x-form-tag-text');
-
- this.displayField = new org.ametys.HtmlContainer ({
- id: this.name + '-display',
- html: '<span class="empty">' + "" + '</span>',
- cls: 'x-form-widget-display-field',
- hidden: false,
- renderTo: this.wrap,
- width: (this.width - 17)
- });
-
- var btnCfg = Ext.applyIf(this.buttonCfg || {}, {
- text: this.buttonText,
- icon: this.buttonIcon
- });
-
- this.button = new Ext.Button(Ext.apply(btnCfg, {
- renderTo: this.wrap,
- disabled: this.disabled,
- widget: this,
- cls: 'x-form-tag-btn' + (btnCfg.iconCls ? ' x-btn-icon' : ''),
- handler: this._selectTagCategories,
- tooltip: ""
- }));
-
- if(this.buttonOnly){
- this.el.hide();
- this.wrap.setWidth(this.button.getEl().getWidth());
- }
-
- if (this.desc)
- {
- this.itemCt.child('div.x-form-element div.x-form-field-wrap').insertSibling({
- id: this.id + '-img',
- tag:'img',
- style: 'padding-left: 20px; padding-top : 7px;',
- src: getPluginResourcesUrl('core') + '/img/administrator/config/help.gif'}, 'after');
-
- var tooltip = new Ext.ToolTip({
- target: this.id + '-img',
- html: this.desc
- });
- }
-
- if (this.width != null && this.width > 0)
- {
- this.setWidth(this.width);
- }
-}
-
-org.ametys.web.widget.TagCategoriesWidget.prototype.markInvalid = function (msg)
-{
- org.ametys.web.widget.TagCategoriesWidget.superclass.markInvalid.call(this, msg);
-
- if(!this.rendered || this.preventMark){ // not rendered
- return;
- }
-
- this.wrap.addClass('x-widget-invalid');
- this.displayField.el.dom.qtip = msg;
- this.displayField.el.dom.qclass = 'x-form-invalid-tip';
-}
-
-org.ametys.web.widget.TagCategoriesWidget.prototype.clearInvalid = function ()
-{
- org.ametys.web.widget.TagCategoriesWidget.superclass.clearInvalid.call(this);
-
- if(!this.rendered || this.preventMark){ // not rendered
- return;
- }
-
- this.wrap.removeClass('x-widget-invalid');
- this.displayField.el.dom.qtip = '';
-}
-
-org.ametys.web.widget.TagCategoriesWidget.prototype.setWidth = function (width)
-{
- org.ametys.web.widget.TagCategoriesWidget.superclass.setWidth.call(this, width);
- // width - btn width - padding left - padding right
- this.displayField.setWidth (width - 22 - 5 - 10);
-
- var text = this.displayField.el.dom.innerHTML;
- text = org.ametys.utils.Utils.getTruncatedText (this.displayField.el, text, width - 22 - 5 - 10);
- this.displayField.el.update (text);
-}
-
-
-/**
- * Display window to select tags
- * @private
- */
-org.ametys.web.widget.TagCategoriesWidget.prototype._selectTagCategories = function ()
-{
- if (!this.widget.delayedInitialize())
- return;
-
- this.widget.box.show();
-
- this.widget._tree.getRootNode().reload(this.widget._fill, this.widget);
- this.widget._tree.collapseAll();
-}
-
-/**
- * Select the tree nodes according to the input field value
- * @private
- */
-org.ametys.web.widget.TagCategoriesWidget.prototype._fill = function ()
-{
- var tags = this.getValue().split(',');
-
- for (var i=0; i < tags.length; i++)
- {
- var node = this._tree.getNodeById(tags[i]);
- if (node != null)
- {
- if (this.multiple)
- {
- node.attributes.checked = true;
- node.getUI().toggleCheck(true);
- }
- else
- {
- node.select();
- }
- }
- }
-
- this._tree.getRootNode().childNodes[0].select();
-}
-
-/**
- * @private
- */
-org.ametys.web.widget.TagCategoriesWidget.prototype.delayedInitialize = function ()
-{
- if (this._initialized)
- return true;
-
- var filterField = new org.ametys.form.TextField ({
- id: 'filter',
-
- width: 200,
- emptyText: "",
-
- enableKeyEvents:true
- });
- filterField.addListener ('keyup', this._filter, this);
-
- var loader = new org.ametys.web.tree.TagXmlLoader ({
- dataUrl: getPluginDirectUrl("web") + '/tags/list.xml',
- baseParams: {siteName: this.siteName, all: 'true'},
- checkMode: this.multiple, // to display checkboxes
- selectCategory: true,
- syncMode: true // synchronous mode for filters
- });
- loader.addListener("beforeload", this._onBeforeLoad, this);
-
- this._tree = new Ext.tree.TreePanel({
- region: 'center',
-
- tool: this,
- autoScroll:true,
- animate:true,
- enableDD:false,
- containerScroll: true,
- border: false,
-
- rootVisible: false,
- root: new Ext.tree.AsyncTreeNode({id: 'root'}),
-
- loader: loader
- });
-
- // Filter
- this._tree.filter = new Ext.tree.TreeFilter (this._tree, {
- clearBlank: true,
- autoClear: true
- });
- this._tree.getSelectionModel().addListener ("selectionchange", this._selectNode, this);
-
- // Alphabetical sort
- this._treeSorter = new Ext.tree.TreeSorter(this._tree, {
- });
-
- this.box = new org.ametys.DialogBox({
- layout: 'border',
- title : "",
- icon : getPluginResourcesUrl('web') + "/img/tag/category_16.png",
-
- width :300,
- height :410,
- autoScroll: true,
-
- items : [ this._tree],
-
- defaultButton: this._tree,
- closeAction: 'hide',
- buttons : [
- {
- text : '',
- widget: this,
- handler : this.ok,
- disabled: !this.multiple
- }, {
- text : '',
- widget: this,
- handler : this.cancel
- }],
- // filter
- tbar: [ filterField]
- });
-
-
- this._initialized = true;
- return true;
-}
-
-/**
- * @private
- */
-org.ametys.web.widget.TagCategoriesWidget.prototype._filter = function (field, event)
-{
- this._tree.filter.clear();
-
- var val = field.getRawValue()
- var re = new RegExp('.*' + val + '.*', 'i');
-
- this._tree.filter.filterBy(function (node)
- {return re.test(node.text) || (!node.isLeaf() && this._filterChildNodesByRe (node, re));
- }, this);
-}
-/**
- * @private
- */
-org.ametys.web.widget.TagCategoriesWidget.prototype._filterChildNodesByRe = function (node, re)
-{
- var childNodes = node.childNodes;
- for (var i=0; i < childNodes.length; i++)
- {
- if (re.test(childNodes[i].text))
- {
- return true;
- }
- else
- {
- return this._filterChildNodesByRe (childNodes[i], re);
- }
- }
- return false;
-}
-
-/**
- * @private
- */
-org.ametys.web.widget.TagCategoriesWidget.prototype._onBeforeLoad = function (treeLoader, node)
-{
- if (!this._tree.rendered)
- return;
-
- treeLoader.baseParams.target = this.targetType;
- treeLoader.baseParams.parentID = node.id != 'root' ? node.id : '';
-}
-
-org.ametys.web.widget.TagCategoriesWidget.prototype.ok = function ()
-{
- this.widget.box.hide ();
-
- var categories = {};
- if (this.widget.multiple)
- {
- var selNodes = this.widget._tree.getChecked();
- for (var i=0; i < selNodes.length; i++)
- {
- categories[selNodes[i].id] = selNodes[i].attributes.title;
- }
- }
- else
- {
- var node = this.widget._tree.getSelectionModel().getSelectedNode();
- categories[node.id] = node.attributes.title;
- }
-
- this.widget._updateField (categories);
-
-}
-
-org.ametys.web.widget.TagCategoriesWidget.prototype.cancel = function ()
-{
- this.widget.box.hide ();
-}
-
-org.ametys.web.widget.TagCategoriesWidget.prototype._updateField = function (tags)
-{
- var values = [];
- for (var i in tags)
- {
- values.push(i);
- }
-
- this.setValue (values);
-}
-
-org.ametys.web.widget.TagCategoriesWidget.prototype._selectNode = function (sm, node)
-{
- if (!this.multiple)
- {
- // No selection or tag category selected
- var catSelected = node == null || node.attributes["type"] == 'category' || node.attributes["type"] == 'tagprovider';
- this.box.buttons[0].setDisabled(!catSelected);
- }
-}
-
-// --------------------------------------------------------------
-org.ametys.web.widget.ContentTagCategoriesWidget = function(config)
-{
- org.ametys.web.widget.ContentTagCategoriesWidget.superclass.constructor.call(this, config);
-};
-
-Ext.extend(org.ametys.web.widget.ContentTagCategoriesWidget, org.ametys.web.widget.TagCategoriesWidget, {
- targetType: 'CONTENT'
-});
-
-//--------------------------------------------------------------
-org.ametys.web.widget.PageTagCategoriesWidget = function(config)
-{
- org.ametys.web.widget.PageTagCategoriesWidget.superclass.constructor.call(this, config);
-};
-
-Ext.extend(org.ametys.web.widget.PageTagCategoriesWidget, org.ametys.web.widget.TagCategoriesWidget, {
- targetType: 'PAGE'
-});
Index: main/plugin-web/resources/js/org/ametys/web/tree/TagXmlLoader.js
===================================================================
--- main/plugin-web/resources/js/org/ametys/web/tree/TagXmlLoader.js (revision 26702)
+++ main/plugin-web/resources/js/org/ametys/web/tree/TagXmlLoader.js (working copy)
@@ -33,7 +33,7 @@
{
org.ametys.web.tree.TagXmlLoader.superclass.processAttributes.call(this, attr);
- if (attr.tagName == "category" || attr.tagName == "tagprovider")
+ if (attr.tagName == "tagprovider")
{
// This is a category node
attr.text = attr.title;
@@ -47,25 +47,25 @@
{
attr.leaf = true;
}
- if (this.checkMode && this.selectCategory)
+ if (this.checkMode && this.allowProviders)
{
attr.checked = false;
}
if (this.syncMode)
{
- // Override these values for our folder nodes because we are loading all data at once. If we were
+ // Override these values for our folder nodes because we are loading all data at once. If we were
// loading each node asynchronously (the default) we would not want to do this:
attr.expanded = true;
attr.loaded = true;
}
}
else
- { // this is it a tag node
-
+ {
+ // this is it a tag node
attr.text = attr.title;
attr.type = "tag";
- attr.leafSort = true; // attribute for sorting
+ attr.leafSort = false; // attribute for sorting
if (attr.target == this.filterTarget)
{
@@ -90,10 +90,22 @@
// Tell the tree this is a leaf node. This could also be passed as an attribute in the original XML,
// but this example demonstrates that you can control this even when you cannot dictate the format of
// the incoming source XML:
- attr.leaf = true;
- if (this.checkMode && !this.selectCategory)
+ attr.leaf = !attr.hasChild ? true : false;
+
+ if (this.checkMode)
{
- attr.checked = false;
+ // empty check box.
+ // nb. Do not show an empty check box for disabled node, or node without children in mode "only tags with children".
+ var dontCheck = !attr.hasChild && this.onlyTagsWithChildren || attr.disabled;
+ attr.checked = dontCheck ? null : false;
+ }
+
+ if (this.syncMode)
+ {
+ // Override these values for our folder nodes because we are loading all data at once. If we were
+ // loading each node asynchronously (the default) we would not want to do this:
+ attr.expanded = true;
+ attr.loaded = true;
}
}
}
@@ -125,12 +137,5 @@
attr.uiProvider = this.uiProviders[attr.uiProvider] || eval(attr.uiProvider);
}
- if (attr.tagName == "category" || attr.tagName == "tagprovider")
- {
- return new Ext.tree.AsyncTreeNode(attr);
- }
- else
- {
- return new Ext.tree.TreeNode(attr);
- }
+ return new Ext.tree.AsyncTreeNode(attr);
}
Index: main/plugin-web/resources/js/org/ametys/web/tag/Actions.i18n.js
===================================================================
--- main/plugin-web/resources/js/org/ametys/web/tag/Actions.i18n.js (revision 26702)
+++ main/plugin-web/resources/js/org/ametys/web/tag/Actions.i18n.js (working copy)
@@ -16,8 +16,6 @@
Ext.namespace('org.ametys.web.tag.Edit');
Ext.namespace('org.ametys.web.tag.Delete');
-Ext.namespace('org.ametys.web.tag.EditCategory');
-Ext.namespace('org.ametys.web.tag.DeleteCategory');
Ext.namespace('org.ametys.web.tag.Tag');
/**
@@ -209,7 +207,7 @@
org.ametys.web.tag.Edit.callback = function (response, args)
{
var tagID = null;
- var categoryID = null;
+ var parentID = null;
if (args[0] == 'new')
{
@@ -220,22 +218,11 @@
}
var msg = response.selectSingleNode("ActionResult/message") != null ? response.selectSingleNode("ActionResult/message")[org.ametys.servercomm.ServerComm.xmlTextContent] : '';
- if (msg == "unknown-category")
- {
- Ext.Msg.show({
- title: "",
- msg: "",
- buttons: Ext.Msg.OK,
- icon: Ext.MessageBox.ERROR
- });
- org.ametys.web.tag.Edit.box.hideWaitMsg();
- return;
- }
- else if (msg == "already-exist")
+ if (msg == "unknown-parent-tag")
{
Ext.Msg.show({
title: "",
- msg: "",
+ msg: "",
buttons: Ext.Msg.OK,
icon: Ext.MessageBox.ERROR
});
@@ -247,10 +234,10 @@
org.ametys.web.tag.Edit.box.hide();
tagID = response.selectSingleNode("ActionResult/id")[org.ametys.servercomm.ServerComm.xmlTextContent];
- categoryID = response.selectSingleNode("ActionResult/categoryID")[org.ametys.servercomm.ServerComm.xmlTextContent];
+ parentID = response.selectSingleNode("ActionResult/parentID")[org.ametys.servercomm.ServerComm.xmlTextContent];
var tagName = response.selectSingleNode('ActionResult/name')[org.ametys.servercomm.ServerComm.xmlTextContent];
- var target = org.ametys.messagebus.bus.MessageBuilder.getInstance().createTarget("tag", {'id': tagID, 'parentID': categoryID, 'name': tagName, 'type': 'tag'});
+ var target = org.ametys.messagebus.bus.MessageBuilder.getInstance().createTarget("tag", {'id': tagID, 'parentID': parentID, 'name': tagName, 'type': 'tag'});
var event = org.ametys.messagebus.bus.MessageBuilder.getInstance().createMessage(org.ametys.ribbon.RibbonManager.EVENTTYPE_CREATED, null, [target]);
org.ametys.messagebus.MessageBus.getInstance().fireMessages([event]);
}
@@ -288,7 +275,7 @@
if (org.ametys.web.tag.Edit._actionCallback != null)
{
- org.ametys.web.tag.Edit._actionCallback(tagID, categoryID);
+ org.ametys.web.tag.Edit._actionCallback(tagID, parentID);
}
}
@@ -352,7 +339,7 @@
* @private
* Initialize the form
*/
-org.ametys.web.tag.Edit._initForm = function (categoryId)
+org.ametys.web.tag.Edit._initForm = function ()
{
if (org.ametys.web.tag.Edit._mode == 'new')
{
@@ -360,11 +347,11 @@
if (org.ametys.web.tag.Edit._parentID == null)
{
- // Get the selected category
+ // Get the selected tag
var targets = org.ametys.ribbon.RibbonManager.getInstance().getCurrentSelectionTargets();
var target = org.ametys.messagebus.message.MessageTargetHelper.findFirst(targets, function(target) { return target.getType() == "tag" });
- if (target == null || target.getParameters().type == 'tag')
+ if (target == null)
return;
parentID = target.getParameters().id;
@@ -499,332 +486,6 @@
/** ------------------------------------ */
/** ------------------------------------ */
-org.ametys.web.tag.EditCategory.add = function(id, config, pluginName)
-{
- org.ametys.web.tag.EditCategory.pluginName = pluginName;
- org.ametys.web.tag.EditCategory._mode = 'new';
- org.ametys.web.tag.EditCategory.act ();
-}
-
-org.ametys.web.tag.EditCategory.edit = function(id, config, pluginName)
-{
- org.ametys.web.tag.EditCategory.pluginName = pluginName;
- org.ametys.web.tag.EditCategory._mode = 'edit';
- org.ametys.web.tag.EditCategory.act ();
-}
-
-/**
- * @private
- * @property {String} _mode Can be 'new' or 'edit'
- */
-org.ametys.web.tag.EditCategory._mode;
-
-org.ametys.web.tag.EditCategory.act = function ()
-{
- if (!org.ametys.web.tag.EditCategory.delayedInitialize())
- return;
-
- if (org.ametys.web.tag.EditCategory._mode == 'new')
- {
- org.ametys.web.tag.EditCategory.box.setTitle("");
- org.ametys.web.tag.EditCategory.box.setIconPath(getPluginResourcesUrl(org.ametys.web.tag.EditCategory.pluginName) + "/img/tag/category_add_16.png");
- }
- else
- {
- org.ametys.web.tag.EditCategory.box.setTitle("");
- org.ametys.web.tag.EditCategory.box.setIconPath(getPluginResourcesUrl(org.ametys.web.tag.EditCategory.pluginName) + "/img/tag/category_edit_16.png");
- }
- org.ametys.web.tag.EditCategory.box.show();
- org.ametys.web.tag.EditCategory._initForm();
-}
-
-/**
- * @private
- */
-org.ametys.web.tag.EditCategory.delayedInitialize = function()
-{
- if (org.ametys.web.tag.EditCategory.initialized)
- return true;
-
- Ext.form.Field.prototype.msgTarget = 'side';
- var formPanel = new Ext.FormPanel( {
- labelWidth :80,
- bodyStyle: 'padding:10px',
-
- defaultType :'textfield',
-
- autoScroll: true,
- items: [ new Ext.form.Hidden ({
- name: 'id'
- }),
- new Ext.form.Hidden ({
- name: 'parentID'
- }),
- new org.ametys.form.TextField ({
- name: 'title',
- fieldLabel: "",
- allowBlank: false,
- width: 200
- }),
- new org.ametys.form.TextAreaField ({
- name: 'description',
- fieldLabel: "",
- width: 200,
- height: 70
- })
- ]
- });
-
- org.ametys.web.tag.EditCategory._form = formPanel.getForm();
-
- org.ametys.web.tag.EditCategory.box = new org.ametys.DialogBox({
- title :"",
- icon : getPluginResourcesUrl(org.ametys.web.tag.EditCategory.pluginName) + "/img/tag/category_add_16.png",
-
- layout :'fit',
- width :370,
- height : 220,
-
- items : [ formPanel ],
-
- defaultButton: org.ametys.web.tag.EditCategory._form.findField('title'),
- closeAction: 'hide',
- buttons : [ {
- text :"",
- handler : org.ametys.web.tag.EditCategory.ok
- }, {
- text :"",
- handler : org.ametys.web.tag.EditCategory.cancel
- } ]
- });
-
- org.ametys.web.tag.EditCategory.initialized = true;
-
- return true;
-}
-
-
-org.ametys.web.tag.EditCategory.ok = function ()
-{
- var form = org.ametys.web.tag.EditCategory._form;
- if (form.isValid())
- {
- org.ametys.web.tag.EditCategory.box.showWaitMsg();
-
- // Parameters
- var params = form.getValues();
- params.siteName = context.parameters.siteName;
- if (org.ametys.web.tag.EditCategory._mode == 'new')
- {
- var serverMessage = new org.ametys.servercomm.ServerMessage(org.ametys.web.tag.EditCategory.pluginName, '/tag-category/add', params, org.ametys.servercomm.ServerComm.PRIORITY_MAJOR, org.ametys.web.tag.EditCategory.callback, this, ['new']);
- org.ametys.servercomm.ServerComm.getInstance().send(serverMessage);
- }
- else
- {
- var serverMessage = new org.ametys.servercomm.ServerMessage(org.ametys.web.tag.EditCategory.pluginName, '/tag-category/update', params, org.ametys.servercomm.ServerComm.PRIORITY_MAJOR, org.ametys.web.tag.EditCategory.callback, this, ['edit']);
- org.ametys.servercomm.ServerComm.getInstance().send(serverMessage);
- }
- }
-}
-
-org.ametys.web.tag.EditCategory.cancel = function ()
-{
- org.ametys.web.tag.EditCategory.box.hide();
-}
-
-org.ametys.web.tag.EditCategory.callback = function (response, args)
-{
- if (args[0] == 'new')
- {
- if (org.ametys.servercomm.ServerComm.handleBadResponse("", response, "org.ametys.web.tag.EditCategory"))
- {
- org.ametys.web.tag.EditCategory.box.hideWaitMsg();
- return;
- }
-
- var msg = response.selectSingleNode("ActionResult/message") != null ? response.selectSingleNode("ActionResult/message")[org.ametys.servercomm.ServerComm.xmlTextContent] : '';
- if (msg == "unknown-category")
- {
- Ext.Msg.show({
- title: "",
- msg: "",
- buttons: Ext.Msg.OK,
- icon: Ext.MessageBox.ERROR
- });
- org.ametys.web.tag.EditCategory.box.hideWaitMsg();
- return;
- }
- else if (msg == "already-exist")
- {
- Ext.Msg.show({
- title: "",
- msg: "",
- buttons: Ext.Msg.OK,
- icon: Ext.MessageBox.ERROR
- });
- org.ametys.web.tag.EditCategory.box.hideWaitMsg();
- return;
- }
-
- org.ametys.web.tag.EditCategory.box.hideWaitMsg();
- org.ametys.web.tag.EditCategory.box.hide();
-
- var id = response.selectSingleNode("ActionResult/id")[org.ametys.servercomm.ServerComm.xmlTextContent];
- var parentID = response.selectSingleNode("ActionResult/parentID")[org.ametys.servercomm.ServerComm.xmlTextContent];
- var target = org.ametys.messagebus.bus.MessageBuilder.getInstance().createTarget("tag", {'id': id, 'parentID': parentID, 'type': 'tag-category'});
- var event = org.ametys.messagebus.bus.MessageBuilder.getInstance().createMessage(org.ametys.ribbon.RibbonManager.EVENTTYPE_CREATED, null, [target]);
- org.ametys.messagebus.MessageBus.getInstance().fireMessages([event]);
- }
- else
- {
- if (org.ametys.servercomm.ServerComm.handleBadResponse("", response, "org.ametys.web.tag.EditCategory"))
- {
- org.ametys.web.tag.EditCategory.box.hideWaitMsg();
- return;
- }
-
- var msg = response.selectSingleNode("ActionResult/message") != null ? response.selectSingleNode("ActionResult/message")[org.ametys.servercomm.ServerComm.xmlTextContent] : '';
- if (msg == "unknown-tag")
- {
- Ext.Msg.show({
- title: "",
- msg: "",
- buttons: Ext.Msg.OK,
- icon: Ext.MessageBox.ERROR
- });
- org.ametys.web.tag.EditCategory.box.hideWaitMsg();
- return;
- }
-
- org.ametys.web.tag.EditCategory.box.hideWaitMsg();
- org.ametys.web.tag.EditCategory.box.hide();
-
- var categoryID = response.selectSingleNode("ActionResult/id")[org.ametys.servercomm.ServerComm.xmlTextContent];
- var title = response.selectSingleNode("ActionResult/title")[org.ametys.servercomm.ServerComm.xmlTextContent];
- var target = org.ametys.messagebus.bus.MessageBuilder.getInstance().createTarget("tag", {'id': categoryID, 'title': title, 'type': 'category'});
- var event = org.ametys.messagebus.bus.MessageBuilder.getInstance().createMessage(org.ametys.ribbon.RibbonManager.EVENTTYPE_METADATACHANGED, null, [target]);
- org.ametys.messagebus.MessageBus.getInstance().fireMessages([event]);
- }
-
-}
-
-/**
- * @private
- * Initialize the form
- */
-org.ametys.web.tag.EditCategory._initForm = function ()
-{
- if (org.ametys.web.tag.EditCategory._mode == 'new')
- {
- // Get the selected category
- var targets = org.ametys.ribbon.RibbonManager.getInstance().getCurrentSelectionTargets();
- var target = org.ametys.messagebus.message.MessageTargetHelper.findFirst(targets, function(target) { return target.getType() == "tag" });
-
- if (target == null || target.getParameters().type == 'tag')
- return;
-
- var categoryID = target.getParameters().id;
-
- var form = org.ametys.web.tag.EditCategory._form;
- form.findField('id').setValue('');
- form.findField('title').setValue('');
- form.findField('title').setValue("");
- form.findField('title').clearInvalid();
- form.findField('description').setValue('');
- form.findField('parentID').setValue(categoryID);
-
- form.findField('title').focus(true);
- }
- else
- {
- var targets = org.ametys.ribbon.RibbonManager.getInstance().getCurrentSelectionTargets();
- var target = org.ametys.messagebus.message.MessageTargetHelper.findFirst(targets, function(target) { return target.getType() == "tag" });
-
- if (target == null || target.getParameters().type != 'category')
- return;
-
- var id = target.getParameters().id;
-
- var serverMessage = new org.ametys.servercomm.ServerMessage(org.ametys.web.tag.EditCategory.pluginName, '/tags/jcr-tag.xml', {'id': id}, org.ametys.servercomm.ServerComm.PRIORITY_SYNCHRONOUS, null, this, null);
- var response = org.ametys.servercomm.ServerComm.getInstance().send(serverMessage);
-
- if (org.ametys.servercomm.ServerComm.handleBadResponse("", response, "org.ametys.web.tag.EditCategory"))
- {
- return;
- }
-
- var id = response.selectSingleNode('category').getAttribute('id');
- var title = response.selectSingleNode('category/title')[org.ametys.servercomm.ServerComm.xmlTextContent];
- var description = response.selectSingleNode('category/description')[org.ametys.servercomm.ServerComm.xmlTextContent];
-
- var form = org.ametys.web.tag.EditCategory._form;
- form.findField('id').setValue(id);
- form.findField('title').setValue(title);
- form.findField('description').setValue(description);
-
- form.findField('title').focus(true);
- }
-}
-
-/** ------------------------------------ */
-/** ------------------------------------ */
-/** ------------------------------------ */
-
-org.ametys.web.tag.DeleteCategory.act = function (id, config, pluginName)
-{
- org.ametys.web.tag.DeleteCategory.pluginName = pluginName;
-
- Ext.Msg.confirm("",
- "",
- org.ametys.web.tag.DeleteCategory._doAction,
- this
- );
-}
-
-org.ametys.web.tag.DeleteCategory._doAction = function(button)
-{
- if (button == 'yes')
- {
- var targets = org.ametys.ribbon.RibbonManager.getInstance().getCurrentSelectionTargets();
- var target = org.ametys.messagebus.message.MessageTargetHelper.findFirst(targets, function(target) { return target.getType() == "tag" });
-
- if (target == null || target.getParameters().type != 'category')
- return;
-
- var params = {'id': target.getParameters().id};
- params.siteName = context.parameters.siteName;
- var serverMessage = new org.ametys.servercomm.ServerMessage(org.ametys.web.tag.DeleteCategory.pluginName, '/tag-category/delete', params, org.ametys.servercomm.ServerComm.PRIORITY_MAJOR, org.ametys.web.tag.DeleteCategory.callback, this, [target.getParameters().id]);
- org.ametys.servercomm.ServerComm.getInstance().send(serverMessage);
- }
-}
-org.ametys.web.tag.DeleteCategory.callback = function (response, args)
-{
- if (org.ametys.servercomm.ServerComm.handleBadResponse("", response, "org.ametys.web.tag.DeleteCategory"))
- {
- return;
- }
-
- var msg = response.selectSingleNode("ActionResult/message") != null ? response.selectSingleNode("ActionResult/message")[org.ametys.servercomm.ServerComm.xmlTextContent] : '';
- if (msg == "unknown-category")
- {
- Ext.Msg.show({
- title: "",
- msg: "",
- buttons: Ext.Msg.OK,
- icon: Ext.MessageBox.ERROR
- });
- return;
- }
-
- var target = org.ametys.messagebus.bus.MessageBuilder.getInstance().createTarget("tag", {'id': args[0], 'type': 'category'});
- var event = org.ametys.messagebus.bus.MessageBuilder.getInstance().createMessage(org.ametys.ribbon.RibbonManager.EVENTTYPE_DELETED, null, [target]);
- org.ametys.messagebus.MessageBus.getInstance().fireMessages([event]);
-}
-
-/** ------------------------------------ */
-/** ------------------------------------ */
-/** ------------------------------------ */
-
/**
* Affect a tag
*/
@@ -918,7 +579,7 @@
org.ametys.web.tag.Tag._filterField.addListener ('keyup', org.ametys.web.tag.Tag._filterTree, true);
var loader = new org.ametys.web.tree.TagXmlLoader ({
- dataUrl: getPluginDirectUrl(org.ametys.web.tag.Tag.pluginName) + '/tags/list.xml',
+ dataUrl: getPluginDirectUrl(org.ametys.web.tag.Tag.pluginName) + '/tags.xml',
baseParams: {siteName: context.parameters.siteName, all: 'true'}, // FIXME
checkMode: true, // to display checkboxes
syncMode: true, // synchronous mode for filters,
@@ -1384,10 +1045,10 @@
var targets = org.ametys.ribbon.RibbonManager.getInstance().getCurrentSelectionTargets();
var target = org.ametys.messagebus.message.MessageTargetHelper.findFirst(targets, function(target) { return target.getType() == "tag" });
- if (target == null || target.getParameters().type == 'tag')
+ if (target == null)
return;
- var categoryId = target.getParameters().id;
+ var tagId = target.getParameters().id;
org.ametys.web.tag.Tag.ImportXml._pluginName = pluginName;
@@ -1397,13 +1058,13 @@
}
org.ametys.web.tag.Tag.ImportXml._dialog.show();
- org.ametys.web.tag.Tag.ImportXml._initForm (categoryId);
+ org.ametys.web.tag.Tag.ImportXml._initForm (tagId);
}
-org.ametys.web.tag.Tag.ImportXml._initForm = function (categoryId)
+org.ametys.web.tag.Tag.ImportXml._initForm = function (tagId)
{
var form = org.ametys.web.tag.Tag.ImportXml._dialog.items.itemAt(0).getForm();
- form.findField('categoryId').setValue(categoryId);
+ form.findField('tagId').setValue(tagId);
form.findField('importFile').reset();
}
@@ -1426,8 +1087,8 @@
cls: 'dialog-text-hint'
}),
new Ext.form.Hidden({
- id: 'categoryId',
- name: 'categoryId',
+ id: 'tagId',
+ name: 'tagId',
value: ''
}),
new org.ametys.form.FileUploadField({
@@ -1553,11 +1214,7 @@
var message = '';
var error = action.result.error;
- if (error == 'unknown-category')
- {
- message = "";
- }
- else if (error == 'invalid-extension')
+ if (error == 'invalid-extension')
{
message = "";
}
Index: main/plugin-web/resources/js/org/ametys/ribbon/control/button/TagCategoryActionButton.js
===================================================================
--- main/plugin-web/resources/js/org/ametys/ribbon/control/button/TagCategoryActionButton.js (revision 26702)
+++ main/plugin-web/resources/js/org/ametys/ribbon/control/button/TagCategoryActionButton.js (working copy)
@@ -1,65 +0,0 @@
-/*
- * Copyright 2010 Anyware Services
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-Ext.namespace('org.ametys.ribbon.control.button');
-
-/**
- * Create the control instance.
- * @param {String} id The unique identifier
- * @param {Map} configuration The configuration of the control instance.
- * @param {String} pluginName The name of the declaring plugin
- * @class This class implements the behavior for an action.
- * @extends org.ametys.ribbon.control.RibbonControl
- */
-org.ametys.ribbon.control.button.TagCategoryActionButton = function(id, configuration, pluginName)
-{
- org.ametys.ribbon.control.button.TagCategoryActionButton.superclass.constructor.call(this, id, configuration, pluginName);
-}
-
-Ext.extend(org.ametys.ribbon.control.button.TagCategoryActionButton, org.ametys.ribbon.control.button.ActionButton, {});
-
-org.ametys.ribbon.control.button.TagCategoryActionButton.prototype.createControl = function(colspan)
-{
- var elmt = org.ametys.ribbon.control.button.TagCategoryActionButton.superclass.createControl.call(this, colspan);
- elmt.disable();
- return elmt;
-}
-
-/**
- * Creates the toggle button
- * @param {integer} colspan The configured colspan. Must be transmited to the control.
- * @return {Ext.form.field} The toggle button created.
- */
-org.ametys.ribbon.control.button.TagCategoryActionButton.prototype.onMessage = function(messages)
-{
- for (var i=0; i < messages.length; i++)
- {
- if (messages[i].getType().getName() == org.ametys.ribbon.RibbonManager.EVENTTYPE_SELECTIONCHANGED)
- {
- var targets = messages[i].getTargets();
- var target = org.ametys.messagebus.message.MessageTargetHelper.findFirst(targets, function(target) { return target.getType() == "tag";});
-
- if (target != null && target.getParameters().type == 'category')
- {
- this.getElements().each(function(element) { element.enable(); })
- }
- else
- {
- this.getElements().each(function(element) { element.disable(); })
- }
- }
- }
-}
Index: main/plugin-web/resources/img/tag/category_add_50.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = image/png
Index: main/plugin-web/resources/img/tag/category_edit_32.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = image/png
Index: main/plugin-web/resources/img/tag/category_add_16.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = image/png
Index: main/plugin-web/resources/img/tag/category_delete_50.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = image/png
Index: main/plugin-web/resources/img/tag/category_delete_32.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = image/png
Index: main/plugin-web/resources/img/tag/category_edit_50.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = image/png
Index: main/plugin-web/resources/img/tag/category_delete_16.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = image/png
Index: main/plugin-web/resources/img/tag/category_add_32.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = image/png
Index: main/plugin-web/resources/img/tag/category_edit_16.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = image/png
Index: main/plugin-web/nodetypes/web_nodetypes.xml
===================================================================
--- main/plugin-web/nodetypes/web_nodetypes.xml (revision 26702)
+++ main/plugin-web/nodetypes/web_nodetypes.xml (working copy)
@@ -211,17 +211,26 @@
ametys:unstructured
-
+
- ametys:tag-category
+ ametys:tag
+
+
+
+ ametys:unstructured
+
+
+
+ ametys:tag
+
Index: main/plugin-web/plugin.xml
===================================================================
--- main/plugin-web/plugin.xml (revision 26702)
+++ main/plugin-web/plugin.xml (working copy)
@@ -1263,13 +1263,6 @@
ametys:tags
-
- tag-category
- ametys:tag-category
-
-
@@ -1279,14 +1272,14 @@
-
+
pageAliasametys:pageAlias
-
+
aliasametys:alias
@@ -1374,7 +1367,7 @@
PLUGINS_WEB_RIGHTS_TAGS_ACCESS_DESCRIPTION
- PLUGINS_WEB_RIGHTS_TAGS_CATEGORY
+ PLUGINS_WEB_RIGHTS_TAGS
@@ -1383,16 +1376,7 @@
PLUGINS_WEB_RIGHTS_TAGS_HANDLE_TAG_DESCRIPTION
- PLUGINS_WEB_RIGHTS_TAGS_CATEGORY
-
-
-
-
-
-
- PLUGINS_WEB_RIGHTS_TAGS_HANDLE_TAGCATEGORY_DESCRIPTION
- PLUGINS_WEB_RIGHTS_TAGS_CATEGORY
+ PLUGINS_WEB_RIGHTS_TAGS
@@ -1401,7 +1385,7 @@
PLUGINS_WEB_RIGHTS_TAGS_IMPORT_XML_DESCRIPTION
- PLUGINS_WEB_RIGHTS_TAGS_CATEGORY
+ PLUGINS_WEB_RIGHTS_TAGS
@@ -1803,7 +1787,6 @@
js/org/ametys/cms/widgets/ExternalSoundWidget.i18n.jsjs/org/ametys/web/widgets/WidgetHelper.i18n.jsjs/org/ametys/web/widgets/TagsWidget.i18n.js
- js/org/ametys/web/widgets/TagCategoriesWidget.i18n.jsjs/org/ametys/web/widgets/ContentTagsWidget.jsjs/org/ametys/web/widgets/PageTagsWidget.jsjs/org/ametys/web/tree/SitesXmlLoader.i18n.js
@@ -2480,7 +2463,7 @@
org.ametys.web.tag.Edit.add
uitool-add-tag
- category|root
+ tag|root
PLUGINS_WEB_UITOOL_TAGS_ADD_TAG_LABEL
PLUGINS_WEB_UITOOL_TAGS_ADD_TAG_DESC
PLUGINS_WEB_UITOOL_TAGS_ADD_TAG_FOOTER
@@ -2543,7 +2526,7 @@
org.ametys.web.tag.Tag.ImportXml
uitool-import-tag
- category|root
+ tag|root
PLUGINS_WEB_UITOOL_TAGS_IMPORT_XML_LABEL
PLUGINS_WEB_UITOOL_TAGS_IMPORT_XML_DESC
@@ -2557,69 +2540,6 @@
Web_Rights_Tags_ImportXml
-
-
-
- org.ametys.web.tag.EditCategory.add
- uitool-add-tagcategory
- category|root
- PLUGINS_WEB_UITOOL_TAGS_ADD_TAG_CATEGORY_LABEL
- PLUGINS_WEB_UITOOL_TAGS_ADD_TAG_CATEGORY_DESC
- PLUGINS_WEB_UITOOL_TAGS_ADD_TAG_CATEGORY_FOOTER
- img/tag/category_add_16.png
- img/tag/category_add_32.png
- img/tag/category_add_50.png
-
-
- js/org/ametys/web/tag/Actions.i18n.js
- js/org/ametys/ribbon/control/button/TagActionButton.js
-
- Web_Rights_Tags_HandleTagCategory
-
-
-
-
- org.ametys.web.tag.EditCategory.edit
- uitool-edit-tagcategory
- category
- PLUGINS_WEB_UITOOL_TAGS_EDIT_TAG_CATEGORY_LABEL
- PLUGINS_WEB_UITOOL_TAGS_EDIT_TAG_CATEGORY_DESC
- PLUGINS_WEB_UITOOL_TAGS_EDIT_TAG_CATEGORY_FOOTER
- img/tag/category_edit_16.png
- img/tag/category_edit_32.png
- img/tag/category_edit_50.png
-
-
- js/org/ametys/web/tag/Actions.i18n.js
- js/org/ametys/ribbon/control/button/TagActionButton.js
-
- Web_Rights_Tags_HandleTagCategory
-
-
-
-
- org.ametys.web.tag.DeleteCategory.act
- uitool-delete-tagcategory
- category
- PLUGINS_WEB_UITOOL_TAGS_DELETE_TAG_CATEGORY_LABEL
- PLUGINS_WEB_UITOOL_TAGS_DELETE_TAG_CATEGORY_DESC
- PLUGINS_WEB_UITOOL_TAGS_DELETE_TAG_CATEGORY_FOOTER
- img/tag/category_delete_16.png
- img/tag/category_delete_32.png
- img/tag/category_delete_50.png
-
-
- js/org/ametys/web/tag/Actions.i18n.js
- js/org/ametys/ribbon/control/button/TagActionButton.js
-
- Web_Rights_Tags_HandleTagCategory
-
@@ -4033,7 +3953,15 @@
PLUGINS_WEB_SERVICE_FRONT_SEARCH_BY_TAG_CATEGORY_DESC
- content-tag-categories
+ content-tags
+
+ true
+ true
+
+
+
+
+ PLUGINS_WEB_SERVICE_FRONT_SEARCH_STRICT_SEARCH_ON_TAGS_DESC
@@ -4104,7 +4032,15 @@
-
+
+
+
+
+
+
+
@@ -4426,6 +4362,10 @@
PLUGINS_WEB_SERVICE_FILTERED_CONTENTS_TAGS_DESCcontent-tags
+
+
+ PLUGINS_WEB_SERVICE_FILTERED_CONTENTS_STRICT_SEARCH_ON_TAGS_DESC
+
@@ -8943,4 +8883,47 @@
logger="org.ametys.web.cache.monitoring.process.CacheMonitoringScheduler" />
+
+
+
+
+
+
+
+ PLUGINS_WEB_TAGS_SITE_CONFIG_AUTOPOSTING_ENABLED_DESC
+ false
+ plugin.repository:PLUGINS_REPOSITORY_CONFIG_CATEGORY
+ PLUGINS_WEB_TAGS_SITE_CONFIG_GROUP
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: main/plugin-web/sitemap-front.xmap
===================================================================
--- main/plugin-web/sitemap-front.xmap (revision 26702)
+++ main/plugin-web/sitemap-front.xmap (working copy)
@@ -167,6 +167,7 @@
+
@@ -275,6 +276,7 @@
+
Index: main/plugin-web/pages/tags/filter.xsl
===================================================================
--- main/plugin-web/pages/tags/filter.xsl (revision 26702)
+++ main/plugin-web/pages/tags/filter.xsl (working copy)
@@ -24,47 +24,49 @@
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
+
-
+
+
-
+
Index: main/plugin-web/pages/services/search/search_3.3.xsl
===================================================================
--- main/plugin-web/pages/services/search/search_3.3.xsl (revision 26702)
+++ main/plugin-web/pages/services/search/search_3.3.xsl (working copy)
@@ -289,10 +289,10 @@
-
-
+
+
-
+ ,
@@ -388,7 +388,7 @@
-
+
@@ -397,8 +397,8 @@
-
-
+
+
Index: main/plugin-web/pages/services/search/search.xsl
===================================================================
--- main/plugin-web/pages/services/search/search.xsl (revision 26702)
+++ main/plugin-web/pages/services/search/search.xsl (working copy)
@@ -422,7 +422,7 @@
-
+
@@ -431,8 +431,8 @@
-
-
+
+
Index: main/plugin-web/pages/services/search/search-criteria/search-criteria_3.3.xsl
===================================================================
--- main/plugin-web/pages/services/search/search-criteria/search-criteria_3.3.xsl (revision 26702)
+++ main/plugin-web/pages/services/search/search-criteria/search-criteria_3.3.xsl (working copy)
@@ -166,7 +166,7 @@
-
+
@@ -325,8 +325,8 @@
-
-
+
+