Skip to content

Commit 482de50

Browse files
committed
Version 1.6
2 parents 1f02a33 + 983fc21 commit 482de50

11 files changed

Lines changed: 862 additions & 252 deletions

CHANGELOG.md

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# (MODX)EvolutionCMS.plugins.ManagerManager.mm_ddSelectDocuments changelog
2+
3+
4+
## Version 1.6 (2022-04-14)
5+
* \+ Parameters → `filter`: Supports the not-equal-to operator.
6+
* \* Refactoring:
7+
* \* `\DDTools\ObjectTools::extend` is used instead of `array_merge`.
8+
* \* `\DDTools\ObjectTools::convertType` is used instead of `json_encode`.
9+
* \+ Composer.json.
10+
* \+ README.
11+
* \+ README_ru.
12+
* \+ CHANGELOG.
13+
* \+ CHANGELOG_ru.
14+
15+
16+
## Version 1.5 (2016-12-20)
17+
* \+ Parameters → `$params->parentIds[$i]`: Can be equal to `'current'` for using ID of current document.
18+
19+
20+
## Version 1.4 (2016-11-04)
21+
* \* Attention! PHP >= 5.4 is required.
22+
* \* Attention! (MODX)EvolutionCMS.plugins.ManagerManager >= 0.7 is required.
23+
* \* The widget now uses named parameters (with backward compatibility).
24+
* \* jQuery.migrate 3.0 is used.
25+
* \* jQuery.ddMultipleInput has been updated to 1.3.2.
26+
27+
28+
## Version 1.3 (2016-06-06)
29+
* \* The `$max` parameter became less fragile (closes #4).
30+
* \* The `$parentIds` parameter can be equal `0` and `0` by default (closes #1).
31+
* \+ The `$allowDoubling` parameter which allows to select duplicates values were added (closes #5).
32+
33+
34+
## Version 1.2.2 (2014-02-14)
35+
* \* The jQuery.ddMultipleInput plugin has been updated to 1.2.1 (minor style changes).
36+
37+
38+
## Version 1.2.1 (2014-01-09)
39+
* \* Small changes for compatibility with PHP < 5.3.
40+
41+
42+
## Version 1.2 (2013-12-11)
43+
* \* Attention! (MODX)EvolutionCMS.plugins.ManagerManager >= 0.6 is required.
44+
* \+ The ability to use output templates for the document selection list elements (see the parameter `$labelMask`) has been added.
45+
* \+ Suggested results can currenly be filtered by TV's values (see the parameter `$filter`).
46+
* \+ An ability to sort selected elements has been added.
47+
* \* Parsing of `jQuery.parseJSON` function was removed, because the JSON is a correct js-object.
48+
* \* Multibyte encoding Unicode characters of the JSON string has been removed.
49+
* \* Minor optimization: JSON encoding has been taken away from the cycle.
50+
* \* The including of required js and css files is currently being realized while occuring the event `OnDocFormPrerender`. The files are included as html.
51+
* \* The calls of the functions `includeJs` and `includeCss` were replaced by `includeJsCss`.
52+
* \- The jQuery.ddTools library is no longer included here because it is in ManagerManager.
53+
54+
55+
## Version 1.1b (2013-08-09)
56+
* \+ The capability of selecting child documents from several parents has been added (`parentIds` is now a comma separated string).
57+
58+
59+
## Version 1.0b (2013-05-30)
60+
* \+ The first release.
61+
62+
63+
<link rel="stylesheet" type="text/css" href="https://DivanDesign.ru/assets/files/ddMarkdown.css" />
64+
<style>ul{list-style:none;}</style>

CHANGELOG_ru.md

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# (MODX)EvolutionCMS.snippets.ddStartSnippet changelog
2+
3+
4+
## Версия 1.6 (2022-04-14)
5+
* \+ Параметры → `filter`: Поддерживает оператор неравенства.
6+
* \* Рефакторинг:
7+
* \* `\DDTools\ObjectTools::extend` используется вместо `array_merge`.
8+
* \* `\DDTools\ObjectTools::convertType` используется вместо `json_encode`.
9+
* \+ Composer.json.
10+
* \+ README.
11+
* \+ README_ru.
12+
* \+ CHANGELOG.
13+
* \+ CHANGELOG_ru.
14+
15+
16+
## Версия 1.5 (2016-12-20)
17+
* \+ Параметры → `$params->parentIds[$i]`: Может принимать значение `'current'` для использования ID текущего документа.
18+
19+
20+
## Версия 1.4 (2016-11-04)
21+
* \* Внимание! Требуется PHP >= 5.4.
22+
* \* Внимание! Требуется (MODX)EvolutionCMS.plugins.ManagerManager >= 0.7.
23+
* \* Виджет теперь использует стиль именованных параметров (с обратной совместимостью).
24+
* \* Используется jQuery.migrate 3.0.
25+
* \* jQuery.ddMultipleInput обновлён до to 1.3.2.
26+
27+
28+
## Версия 1.3 (2016-06-06)
29+
* \* Менее хрупкий параметр `$max` (closes #4).
30+
* \* Параметр `$parentIds` может равняться `0` и равен `0` по умолчанию (closes #1).
31+
* \+ Добавлен параметр `$allowDoubling`, позволяющий разрешить выбор дубликатов (closes #5).
32+
33+
34+
## Версия 1.2.2 (2014-02-14)
35+
* \* Плагин jQuery.ddMultipleInput обновлён до версии 1.2.1 (небольшие изменения стиля).
36+
37+
38+
## Версия 1.2.1 (2014-01-09)
39+
* \* Небольшие изменения для совместимости с PHP < 5.3.
40+
41+
42+
## Версия 1.2 (2013-12-11)
43+
* \* Внимание! Требуется (MODX)EvolutionCMS.plugins.ManagerManager >= 0.6.
44+
* \+ Добавлена возможность задавать шаблон отображения элемента в списке выбора документов (см. параметр `$labelMask`).
45+
* \+ В условиях фильтрации (параметр `$filter`) могут использоваться не только поля документа, но и TV.
46+
* \+ Добавлена возможность сортировки выбранных элементов.
47+
* \* Убрана обработка `$.parseJSON`, так как JSON является правильным js-объектом.
48+
* \* Убрано кодирование многобайтных символов Unicode в JSON.
49+
* \* Небольшая оптимизация: преобразование в JSON вынесено из цикла.
50+
* \* Подключение необходимых js и css вынесено в отдельное событие `OnDocFormPrerender`, файлы сейчас подключаются в обычном html-виде, а не через js.
51+
* \* Вызовы функций `includeJs` и `includeCss` заменены на вызовы `includeJsCss`.
52+
* \- Убрано подключение библиотеки jQuery.ddTools, т.к. она подключается в самом ManagerManager.
53+
54+
55+
## Версия 1.1b (2013-08-09)
56+
* \+ Добавлена возможность выбирать документы из нескольких родителей (в параметр `parentIds` теперь передаётся список через запятую).
57+
58+
59+
## Версия 1.0b (2013-05-30)
60+
* \+ Первый релиз.
61+
62+
63+
<link rel="stylesheet" type="text/css" href="https://DivanDesign.ru/assets/files/ddMarkdown.css" />
64+
<style>ul{list-style:none;}</style>

README.md

Lines changed: 138 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,139 @@
1-
# mm_ddSelectDocuments
1+
# (MODX)EvolutionCMS.plugins.ManagerManager.mm_ddSelectDocuments
22

3-
Visit the following [link](http://code.divandesign.biz/modx/mm_ddselectdocuments) to read the documentation, instructions & changelog.
3+
A widget for ManagerManager that makes selection of documents IDs easier.
4+
5+
6+
## Requires
7+
8+
* PHP >= 5.4
9+
* [(MODX)EvolutionCMS.plugins.ManagerManager](https://code.divandesign.biz/modx/managermanager) >= 0.7
10+
11+
12+
## Installation
13+
14+
To install you must unzip the archive to `/assets/plungins/managermanager/widgets/ddselectdocuments/`.
15+
16+
17+
You may also read this documentation:
18+
* [(MODX)EvolutionCMS.plugins.ManagerManager](https://code.divandesign.biz/modx/managermanager).
19+
* [(MODX)EvolutionCMS.modules.ddMMEditor](https://code.divandesign.biz/modx/ddmmeditor).
20+
21+
22+
## Parameters description
23+
24+
* `$params`
25+
* Desctription: Parameters, the pass-by-name style is used.
26+
* Valid values:
27+
* `stdClass`
28+
* `arrayAssociative`
29+
* **Required**
30+
31+
* `$params->fields`
32+
* Desctription: The names of TVs for which the widget is applied to.
33+
* Valid values: `stringCommaSeparated`
34+
* **Required**
35+
36+
* `$params->parentIds`
37+
* Desctription: Parent documents IDs.
38+
* Valid values:
39+
* `array`
40+
* `stringCommaSeparated`
41+
* Default value: `[0]`
42+
43+
* `$params->parentIds[$i]`
44+
* Desctription: Document ID.
45+
* Valid values:
46+
* `integer`
47+
* `'current'` — current document ID (for select children)
48+
* **Required**
49+
50+
* `$params->depth`
51+
* Desctription: Depth of search.
52+
* Valid values: `integer`
53+
* Default value: `1`
54+
55+
* `$params->filter`
56+
* Desctription: Filter clauses, separated by `'&'` between pairs and by `'='` or `'!='` between keys and values.
57+
For example, `'template=15&published=1'` means to choose the published documents with template ID == 15.
58+
* Valid values: `stringSeparated`
59+
* Default value: —
60+
61+
* `$params->listItemLabelMask`
62+
* Desctription: Template to be used while rendering elements of the document selection list.
63+
It is set as a string containing placeholders of document fields and TVs.
64+
Also, there is the additional placeholder `[+title+]` that is substituted with either `menutitle` (if defined) or `pagetitle`.
65+
* Valid values: `string`
66+
* Default value: `'[+title+] ([+id+])'`
67+
68+
* `$params->maxSelectedItems`
69+
* Desctription: The largest number of elements that can be selected by user.
70+
* Valid values:
71+
* `integer`
72+
* `0` — means selection without a limit
73+
* Default value: `0`
74+
75+
* `$params->allowDuplicates`
76+
* Desctription: Allows to select duplicates values.
77+
* Valid values: `boolean`
78+
* Default value: `false`
79+
80+
* `$params->roles`
81+
* Desctription: The CMS user roles that the widget is applied to.
82+
* Valid values:
83+
* `stringCommaSeparated`
84+
* `''` — when this parameter is empty then widget is applied to the all roles
85+
* Default value: `''`
86+
87+
* `$params->roles[$i]`
88+
* Desctription: CMS user role ID.
89+
* Valid values: `integer`
90+
* **Required**
91+
92+
* `$params->templates`
93+
* Desctription: Document templates IDs for which the widget is applied to.
94+
* Valid values:
95+
* `stringCommaSeparated`
96+
* `''` — empty value means the widget is applying to all templates
97+
* Default value: `''`
98+
99+
* `$params->templates[$i]`
100+
* Desctription: Template ID.
101+
* Valid values: `integer`
102+
* **Required**
103+
104+
105+
## CMS events
106+
107+
* `OnDocFormPrerender`
108+
* `OnDocFormRender`
109+
110+
111+
## Examples
112+
113+
114+
### Select 3 favorite published products
115+
116+
```php
117+
mm_ddSelectDocuments([
118+
//TV for which the widget is applied to
119+
'fields' => 'favoriteProducts',
120+
//Let 314 is ID of catalog document, that contains children-products
121+
'parentIds' => [314],
122+
//Search in 3 levels
123+
'depth' => 3,
124+
//Display only published documents with template ID == 42
125+
'filter' => 'template=42&published=1',
126+
//Only 3 or less products can be selected
127+
'maxSelectedItems' => 3
128+
]);
129+
```
130+
131+
132+
## Links
133+
134+
* [Home page](https://code.divandesign.biz/modx/mm_ddselectdocuments)
135+
* [Telegram chat](https://t.me/dd_code)
136+
* [Packagist](https://packagist.org/packages/dd/evolutioncms-plugins-managermanager-mm_ddselectdocuments)
137+
138+
139+
<link rel="stylesheet" type="text/css" href="https://DivanDesign.ru/assets/files/ddMarkdown.css" />

0 commit comments

Comments
 (0)