Инструменты пользователя

Инструменты сайта


wiki:plugin:data

Различия

Показаны различия между двумя версиями страницы.

Ссылка на это сравнение

Предыдущая версия справа и слеваПредыдущая версия
Следующая версия
Предыдущая версия
wiki:plugin:data [2026/01/18 13:09] – [Список данных (выходные данные)] VladPolskiywiki:plugin:data [2026/01/18 14:32] (текущий) – [Bugs, Feature Requests and Patches] VladPolskiy
Строка 210: Строка 210:
 </code> </code>
  
-==== Related Pages (Output) ====+==== Похожие страницы (Вывод) ====
  
-This mode allows you to display a list of pages which are similar to the current page because they share some of the structured data. Which columns are used for similarity comparison has to be given in the ''cols'' option. Additional filters and sorting options can be set. Here is an example:+Этот режим позволяет отображать список страниц, похожих на текущую страницу, поскольку они имеют общие структурированные данные. Какие столбцы используются для сравнения по сходству, необходимо указать в параметрах ''cols''. Можно задать дополнительные фильтры и параметры сортировки. Вот пример:
  
 <code> <code>
Строка 223: Строка 223:
 </code> </code>
  
-The shown config will look for pages which share values in the columns ''task_tags'' and ''type''. A maximum of 5 pages is shown, sorted by volume.+Представленная конфигурация будет искать страницы, имеющие общие значения в столбцах ''task_tags'' и ''type''. Отображается максимум 5 страниц, отсортированных по объему.
  
-Refer to datatable on what options are available.+Для получения информации о доступных вариантах обратитесь к таблице данных.
  
-This mode will **not** disable caching for the page, so the list might not always be up to date.+В этом режиме кэширование страницы **не** отключается, поэтому список может быть не всегда актуальным.
  
-==== Tag Cloud (Control) ====+==== Облако тегов (контрольное) ====
  
-This syntax will display the values of a given data name as a tag cloud. Each value will link back to the current page (unless configured otherwise by ''target'' option). The page should also contain a Data Table - this table will then be filtered for all entries matching the selected tag.+Этот синтаксис отобразит значения заданного имени данных в виде облака тегов. Каждое значение будет ссылаться на текущую страницу (если иное не указано в ''target'' параметрах). Страница также должна содержать таблицу данных — эта таблица будет отфильтрована для отображения всех записей, соответствующих выбранному тегу.
  
-Example:+Пример:
  
 <code> <code>
Строка 243: Строка 243:
 </code> </code>
  
-The above code would display a cloud of employees assigned to at least two different projects. A maximum of the 20 most busiest employees are shown.+Приведенный выше код отобразит цепочку сотрудников, назначенных как минимум на два разных проекта. Отобразится максимум 20 самых загруженных сотрудников.
  
-These are the possible options for the cloud:+Вот возможные варианты облачных решений:
  
-^ Option(s)       ^ Required? ^ Description ^ +^ Параметры       ^ Необходимый? ^ Описание ^ 
-| field\\ select\\ col | yes  | What attribute is used to build the cloud? | +| field\\ select\\ col | yes  | Какой атрибут используется для построения облака? | 
-| limit\\ max | no | Maximum number of tags to display. If not given all will be displayed | +| limit\\ max | no | Максимальное количество отображаемых тегов. Если не указано, будут отображены все теги. | 
-| min | no | Minimum count a tag must have. If not given all will be shown | +| min | no | Минимальное количество меток, которое должен иметь тег. Если значение не указано, будут показаны все метки. | 
-| page\\ target | no | Give a page which contains the Data Table to control. If not given the current page is used |  +| page\\ target | no | Укажите страницу, содержащую управляемую таблицу данных. Если страница не указана, используется текущая страница. |  
-| summarize | no | Set to 1 to show sum of field |+| summarize | no | Установите значение 1, чтобы отобразить сумму поля. |
  
-Additionally filters can be given as described in the datatable syntax.+Кроме того, фильтры можно задавать, как описано в синтаксисе таблицы данных.
  
-===== Customizing the Styling =====+===== Настройка стиля =====
  
-Position and styling of input and output boxes can be done with simple CSS. Everything given after the syntax keyword will be assigned as additional class name to the surrounding div. Additionally are the field keys used as classes for the entry box items.+Позиционирование и стилизация полей ввода и вывода могут быть выполнены с помощью простого CSS . Все, что указано после ключевого слова синтаксиса, будет присвоено в качестве дополнительного имени класса окружающему div. Кроме того, ключи полей используются в качестве классов для элементов полей ввода.
  
-Let's assume the following "dataentry" box, as specified at the beginning of the page.+Предположим, что используется следующее поле для ввода данных, как указано в начале страницы.
  
 <code> <code>
Строка 271: Строка 271:
 </code> </code>
  
-You now can style this box with CSS in your ''<dokuwiki>/conf/userstyle.css''((About [[devel:css#user_styles|user css styles]])). Here is an example:+Теперь вы можете стилизовать этот блок с помощью CSS в вашем ''<dokuwiki>/conf/userstyle.css''((О [[wiki:devel:css#user_styles|пользовательских CSS-стилях]])). Вот пример:
  
 <code css> <code css>
-div.character24 { +div .character24  {  
-  /* code for the container block, such as position, layout and borders, goes here */ +  /* Здесь размещается код для контейнерного блока, такой как положение, макет и границы */  
-  float: right; +  float :  right ;  
-  width: 33%;+  width :  33% ; 
 } }
- +   
-div.character24 dl > dt {  +div .character24 dl > dt {   
-  /* this will allow you to style the definition terms */ +  /* Это позволит вам стилизовать термины определения */  
-  font-variant: small-caps;+  font-variant :  small-caps ; 
 } }
- +   
-div.character24 dl > dt + dd { +div .character24 dl > dt + dd {  
-  /* this will allow you to style to the definition values */ +  /* Это позволит вам стилизовать значения определения */  
-  font-family: sans-serif;+  font-family :  sans-serif ; 
 } }
- +   
-div.character24 dl dd.name{ +div .character24 dl dd.name {  
-  /* this makes the name larger than the rest */ +  /* Это делает имя больше, чем остальное */  
-  font-size: 120%;+  font-size :  120% ; 
 } }
 </code> </code>
  
-===== Type aliases =====+===== Псевдонимы типов =====
  
-Type aliases are custom data types which are defined by a base type (one of the built-in types like ''page'' or no type), and optionally a prefix, postfix or a comma-separated set of valid values. Type aliases are managed on their own page in the admin menu and stored in the database. They can be used in data entries, lists and tables like the built-in types.+Псевдонимы типов — это пользовательские типы данных, определяемые базовым типом (одним из встроенных типов, например, `<type>` ''page'' или отсутствием типа) и, при необходимости, префиксом, постфиксом или набором допустимых значений, разделенных запятыми. Псевдонимы типов управляются на отдельной странице в меню администратора и хранятся в базе данных. Их можно использовать в записях данных, списках и таблицах, как и встроенные типы.
  
-=== Map type alias ===+=== Псевдоним типа карты ===
  
-For example to create new datatype ''map'' which would open [[http://maps.google.com/maps|Google Maps]]:+Например, чтобы создать новый тип данных ''map'' который будет открывать [[http://maps.google.com/maps|Google Maps]]:
  
-define [[:interwiki]] address map:+определить карту адресов [[wiki:interwiki]]:
 <code> <code>
 map     http://maps.google.com/maps?q={NAME} map     http://maps.google.com/maps?q={NAME}
 </code> </code>
  
-And in Admin -> Data Plugin: Field Aliases (''do=admin&page=data_aliases'') define:+А в разделе Администрирование → Плагин данных: Псевдонимы полей (''do=admin&page=data_aliases'') определите:
  
-^ Type Alias ^ Type ^ Data Prefix ^ Data Postfix ^ Valid values |+^ Псевдоним типа ^ Тип ^ Префикс данных ^ Постфикс данных ^ Допустимые значения |
 | map        | wiki | %%[[map>%%   | %%]] %%          |              |   | map        | wiki | %%[[map>%%   | %%]] %%          |              |  
        
-which you could use now as:+который вы можете использовать сейчас следующим образом:
 <code> <code>
 ---- dataentry  ---- ---- dataentry  ----
Строка 321: Строка 321:
 </code> </code>
  
-You can even enter a valid address, e.g. ''Bahnhofsstraße 5, Regensburg, Deutschland''+Вы даже можете ввести действительный адрес, например: ''Bahnhofsstraße 5, Regensburg, Deutschland''
  
-=== Change tag target with a tag type alias ===+=== Измените целевой объект тега с помощью псевдонима типа тега. ===
  
-Tag links use default the column name as target page. You can change it by a type alias. Give as Prefix the url of the page that has your datatable. Clicking on taglink will filter that table by the tagvalue.+В качестве имени целевой страницы для ссылок тегов по умолчанию используется имя столбца. Вы можете изменить его, указав псевдоним типа. В качестве префикса укажите URL страницы, на которой находится ваша таблица данных. Нажатие на ссылку тега отфильтрует таблицу по значению тега.
  
-^ Type Alias    ^ Type ^ Data Prefix                  ^ Data Postfix ^ Valid values |+^ Псевдоним типа ^ Тип ^ Префикс данных ^ Постфикс данных ^ Допустимые значения |
 | newtag        | tag | namespace:pagewithdatatable   |              |              |  | newtag        | tag | namespace:pagewithdatatable   |              |              | 
  
-which you could use now as:+который вы можете использовать сейчас следующим образом:
 <code> <code>
 ---- dataentry  ---- ---- dataentry  ----
Строка 337: Строка 337:
 </code> </code>
  
-Clicking on this ''cheese'' tag will refer to ''namespace:pagewithdatatable'' and filter on ''cheese''.+Нажатие на этот ''cheese'' тег приведет к переходу по ссылке ''namespace:pagewithdatatable'' и фильтрации по ней ''cheese''.
  
-=== iCal type alias with iCal-Plugin ===+=== псевдоним типа iCal с помощью iCal-плагина ===
  
-If you aggregate any meeting, you´d link to combine them to a downloadable link.+Если вы объедините все встречи, вы можете создать ссылку для их скачивания.
  
-[[.ical|iCal-Plugin]]+[[wiki:plugin:ical|iCal-плагин]]
  
-^ Type Alias ^ Type ^ Data Prefix ^ Data Postfix ^ Valid values |+^ Псевдоним типа ^ Тип ^ Префикс данных ^ Постфикс данных ^ Допустимые значения |
 | ical | wiki | %%{{ical>%%   | %%}} %%          |              |   | ical | wiki | %%{{ical>%%   | %%}} %%          |              |  
  
-=== vCard type alias with vCard Plugin ===+=== псевдоним типа vCard с плагином vCard ===
  
-Setup for the [[plugin:vCard]] plugin is similar to iCal.+Настройка плагина [[wiki:plugin:vCard]] аналогична настройке iCal.
  
  
-===== Custom entry editor =====+===== Редактор пользовательских записей =====
  
-The data plugin is the first plugin to provide a custom editor for its data entries. Data entries have an own edit button. When pressing this button, the user gets an edit form where she can edit the data entries’ content or – depending on the configuration option ''edit_content_only'' – even the structure, i. e. change a field’s name, type or append and delete fields. +Плагин данных — первый плагин, предоставляющий собственный редактор для записей данных. Записи данных имеют собственную кнопку редактирования. При нажатии на эту кнопку пользователь получает форму редактирования, где он может редактировать содержимое записей данных или — в зависимости от параметра конфигурации ''edit_content_only'' — даже структуру, то есть изменять имя поля, тип, а также добавлять и удалять поля.
  
-{{:plugin:data:dataentry_customeditor_structureandvalues.png?500|Custom editor with config "edit_content_only" off let's you edit structure and values}} \\ +{{:wiki:plugin:dataentry_customeditor_structureandvalues.png?400|Custom editor with config "edit_content_only" off let's you edit structure and values}} \\ 
-//Custom editor: Editing structure and values//+//Пользовательский редактор: редактирование структуры и значений.//
  
-{{:plugin:data:dataentry_customeditor_onlyvalues.png?500|Custom editor with config "edit_content_only" on let's you edit only values}}\\ +{{:wiki:plugin:dataentry_customeditor_onlyvalues_1_.png?400|Custom editor with config "edit_content_only" on let's you edit only values}}\\ 
-//Custom editor: Editing only values by switching on config option ''edit_content_only''// +//Пользовательский редактор: редактирование только значений путем включения соответствующей опции в конфигурации.''edit_content_only''// 
  
-=== Nice fields for "edit_content_only" ===+=== Удобные поля для "редактирования только содержимого" ===
  
-When the configuration option ''edit_content_only'' is enabled, some nice fields are used: +При включении этой опции конфигурации ''edit_content_only'' используются некоторые удобные поля: 
-  * Dropdown list is shown filled with the values given in the ''Valid values'' column of [[#type aliases]]. +  * Выпадающий список отображается заполненным значениями, указанными в ''Valid values'' столбце [[#type aliases|псевдонимов типов]]. 
-  * Datepicker for fields of type ''dt''  +  * Выбор даты для полей типа ''dt''  
-  * Autocompletion suggestion of existing pages for [[#type aliases]] based on the ''page'' type\\ (type ''page'' itself don't work)+  * Функция автозаполнения предлагает варианты существующих страниц для [[#type aliases|псевдонимов типов]] на основе самого ''page'' типа ( ''page'' сам тип не работает).
  
-**Requirement**: The datepicker and pagesuggestions needs the [[plugin:bureaucracy|bureaucracy]] plugin, which supplies the JavaScript magic. +**Требование** : Для работы средства выбора даты и подсказок страниц необходим плагин [[wiki:plugin:bureaucracy|bureaucracy]] который обеспечивает необходимую JavaScript-инфраструктуру. 
  
-Page suggestions are activated by a type alias of type ''page''. The second alias shows only pages in ''plugin:'' namespace, demonstrated in the image too. +Подсказки страниц активируются с помощью псевдонима типа ''page''. Второй псевдоним отображает только страницы в ''plugin:'' пространстве имен , что также показано на изображении. 
-^ Type Alias         ^ Type  ^ Data Prefix  ^ Data Postfix  ^ Valid values  ^+^ Псевдоним типа         ^ Тип ^ Префикс данных  ^ Постфикс данных  ^ Допустимые значения  ^
 | pagesuggest        | page  |              |               |               | | pagesuggest        | page  |              |               |               |
 | pagesuggestplugin  | page  |  plugin:     |               |               | | pagesuggestplugin  | page  |  plugin:     |               |               |
  
-{{:plugin:data:dataentry_bureaucracy_datapicker_selects.png?250 |Custom entry editor: datepicker for _dt and selects for alias type with Valid values}}+{{:wiki:plugin:dataentry_bureaucracy_datapicker_selects_1_.png?250 |Custom entry editor: datepicker for _dt and selects for alias type with Valid values}}
  
-{{ :plugin:data:dataentry_bureaucracy_pagepicker.png?270 |Custom entry editor: pagesuggestions for type aliases of page type. Suggestions show page title and in brackets the page name.}}+{{ :wiki:plugin:dataentry_bureaucracy_pagepicker.png?270 |Custom entry editor: pagesuggestions for type aliases of page type. Suggestions show page title and in brackets the page name.}}
  
-//Left: custom editor with datapicker field and a single and a multiple select field.\\ \\ Right: a field with pagesuggestions.//+//Слева: пользовательский редактор с полем выбора данных и полями для одиночного и множественного выбора.//\\   
 +//Справа: поле с подсказками страниц.//
  
-===== Bureaucracy plugin and type aliases=====+===== Плагин бюрократии и псевдонимы типов=====
  
-The nice fields of data plugin used in the custom entry editor are also available for fields in the form of the [[plugin:bureaucracy|Bureaucracy Plugin]]. These are: select of valid values, datepicker and pagesuggestions. Other types are allowed, but are a plain textbox only. +Удобные поля данных, используемые в пользовательском редакторе записей, также доступны для полей в виде [[wiki:plugin:bureaucracy|плагина «Бюрократия»]]. К ним относятся: выбор допустимых значений, календарь и подсказки страниц. Допускаются и другие типы, но только в виде обычного текстового поля.
  
-Some examples of defining form fields in the bureaucracy form, using dataplugin fields: +Несколько примеров определения полей формы в бюрократической форме с использованием полей плагина данных:
  
   data_aliastextbox Tag _fixedtag    data_aliastextbox Tag _fixedtag
Строка 395: Строка 396:
   data_aliastextbox "Plugin Page" _pagesuggestplugin   data_aliastextbox "Plugin Page" _pagesuggestplugin
  
-Last line uses the type alias of previous section, the first two lines are in combination with type alias:  +В последней строке используется псевдоним типа из предыдущего раздела, первые две строки объединены с псевдонимом типа: 
-| fixedtag  | tag  |   |   |  Book, Notebook, Reader  |+| фиксированный тег  | ярлык |   |   |  Книга, тетрадь, читательская книга  | 
 +
     
  
-{{:plugin:data:bureaucracy_form_datepicker.png |Datepicker for dataplugin _dt field in a bureaucracy form}} {{ :plugin:data:bureaucracy_form_selects.png |Single and multiple select for dataplugin field using a type alias with Valid values in a bureacracy form}}+{{:wiki:plugin:bureaucracy_form_datepicker.png |Datepicker for dataplugin _dt field in a bureaucracy form}} {{ :wiki:plugin:bureaucracy_form_selects.png |Single and multiple select for dataplugin field using a type alias with Valid values in a bureacracy form}}
  
-Left image shows a datepicker in a bureaucracy form and right a single and a multiple select, these are created with a type alias which defines some valid values.+На левом изображении показан элемент выбора даты в бюрократической форме, а на правом — элемент выбора одной или нескольких дат; они созданы с использованием псевдонима типа, определяющего допустимые значения.
  
-===== Translation Support =====+===== Поддержка перевода =====
  
-If you use the [[translation]] plugin, you might want to use the same data entries in different languages. The plugin allows for translated field names -- values will not be translated. If you only want to use English field names while having them displayed in your language, you can also follow these instructions.+Если вы используете плагин [[wiki:plugin:translation|перевода]], вам может потребоваться использовать одни и те же записи данных на разных языках. Плагин позволяет переводить названия полей — значения при этом переводиться не будут. Если вы хотите использовать только названия полей на английском языке, отображая их на своем языке, вы также можете следовать этим инструкциям.
  
-To create fieldname translations, create a file in ''conf/lang/<langcode>/data-plugin.php''. The file needs to contain a PHP array named ''$lang'' with the fieldname in the array key and the translation in the value:+Для создания переводов имен полей создайте файл в каталоге `/etc/fieldname/fieldname` ''conf/lang/<langcode>/data-plugin.php''. Этот файл должен содержать PHP-массив ''$lang'' с именем `/etc/fieldname` в качестве ключа и переводом в качестве значения:
  
 <code php conf/lang/en/data-plugin.php> <code php conf/lang/en/data-plugin.php>
Строка 415: Строка 417:
 </code> </code>
  
-Fieldnames are to be given without their type. So it's ''deadline'' not ''deadline_dt''.+Названия полей следует указывать без указания типа. Поэтому это ''deadline'' не так ''deadline_dt''.
  
-After creating or modifiying data-plugin.php file, please update wiki configuration to refresh cache ''%%start?do=admin&page=config%%'', otherwise modifications are not taken into account.+После создания или изменения файла data-plugin.php, пожалуйста, обновите конфигурацию вики, чтобы обновить кэш''%%start?do=admin&page=config%%'', в противном случае изменения не будут учтены.
  
-===== Missing Features =====+===== Отсутствующие функции =====
  
-  * more control options: +  * Дополнительные параметры управления: 
-    * attribute list (similar to tag cloud but as a simple list) +    * Список атрибутов (аналогично облаку тегов, но в виде простого списка) 
-    * search field -- see [[plugin:datasearchform]] plugin +    * поле поиска – см. плагин [[wiki:plugin:datasearchform]] 
-  * **better documentation, examples** +  * **улучшенная документация, примеры** 
-    * Please provide suggestions for which pieces need more attention or where you do not understand stuff. Thanks. +    * Пожалуйста, укажите, какие фрагменты требуют большего внимания или что вам непонятно. Спасибо. 
-  * Add JavaScript support for the content_only edit form to the full-blown form as well +  * Добавьте поддержку JavaScript для формы редактирования content_only в полнофункциональную форму. 
-  * more data types? +  * Больше типов данных? 
-  * links in aggregations and data entries don't generate backlinks +  * Ссылки в агрегированных данных и в самих записях не создают обратных ссылок. 
-  * search data in a specific namespace +  * поиск данных в определенном пространстве имен 
-  * WHERE checks against date fields need SQL INTERVAL equivalent ("WHERE field_dt < %now% + INTERVAL 6 MONTH" equals to "field_dt before 6 months from now") +  * Для проверок типа WHERE по полям даты требуется эквивалент SQL INTERVAL («WHERE field_dt < %now% + INTERVAL 6 MONTH» равно «field_dt before 6 months from now»). 
-  * compare against "this page" name (in datatable) +  * сравнить с названием «этой страницы» (в таблице данных) 
-  * history for the type alias table (changes in the table can affect the pages, but no record and no revert is available). +  * История изменений в таблице псевдонимов типов (изменения в таблице могут повлиять на страницы, но запись и отмена изменений недоступны). 
-  * More data-entry blocks at one page. Reason: the Data Plugin is designed as data-entry block per page. => Recommended alternative: [[plugin:strata|Strata Plugin]], which is equivalent to Data plugin, but bit more sophisticated.+  * Больше блоков ввода данных на одной странице. Причина: плагин Data разработан таким образом, что на каждой странице размещается отдельный блок ввода данных. ⇒ Рекомендуемая альтернатива: [[wiki:plugin:strata|Strata Plugin]], который эквивалентен плагину Data, но немного более функционален.
  
-===== Examples =====+===== Примеры =====
  
-Some use cases:+Некоторые варианты использования:
  
-  * This plugin may be seen in action on this wiki in the [[:dokuinstall|DokuWiki Installations]] namespace.  +  * С работой этого плагина можно ознакомиться на этой вики в пространстве имен [[:wiki:dokuinstall|DokuWiki Installations]].  
-    * Look for the ''datatable'' in the source of [[:dokuinstall|DokuWiki Installations]] +    * Найдите это ''datatable'' в исходном коде [[:wiki:dokuinstall|DokuWiki Installations]] 
-    * and for a ''dataentry'' in some of the [[dokuinstall:southeastern|individual installation pages]]. +    * а также ''dataentry'' на некоторых [[:wiki:dokuinstall:southeastern|страницах, посвященных установке]]. 
-  * Very interesting and organized wiki setup: [[http://www.ickewiki.de/ickewiki|ICKEwiki]] by [[http://www.cosmocode.de/en/wiki/ickewiki|Cosmocode]] integrates the Data Plugin with some other plugins such as [[Bureaucracy]] to a complete enterprise wiki tool. Follow links to the (German) Demo, which let you access the wiki as employee.  +  * Очень интересная и хорошо организованная вики-система: [[http://www.ickewiki.de/ickewiki|ICKEwiki]] от [[http://www.cosmocode.de/en/wiki/ickewiki|Cosmocode]]  интегрирует плагин данных с другими плагинами, такими как [[:wiki:plugin:Bureaucracy]], создавая полноценный корпоративный вики-инструмент. Перейдите по ссылкам на демо-версию (на немецком языке), которая позволяет получить доступ к вики как сотрудник.  
-  * [[plugin:data:list_of_employees|DokuWiki usecase: list of employees]] -- How to use Data Plugin with [[Bureaucracy]] Plugin and [[Wrap]] Plugin. A manual by [[user>lolmaus]].+  * [[:wiki:plugin:data:list_of_employees|Пример использования DokuWiki: список сотрудников]] – Как использовать плагин Data с плагинами [[:wiki:plugin:Bureaucracy]] и [[:wiki:plugin:Wrap]] Руководство от [[user>lolmaus]].
  
-===== Question and Answers =====+===== Вопросы и ответы =====
  
-==== How to refresh data? ====+==== Как обновить данные? ====
  
-The data that is copied to the SQLite database //should// be refreshed automatically whenever the page containing the dataentry box is changed. If you deleted or renamed pages outside the wiki, the database will still contain data about now non-existing pages. These can be cleaned using the ''Data Plugin: Clean up database'' entry in the Admin menu.+Данные, копируемые в базу данных SQLite, должны автоматически обновляться при каждом изменении страницы, содержащей поле ввода данных. Если вы удаляли или переименовывали страницы вне вики, база данных по-прежнему будет содержать данные о страницах, которые теперь не существуют. Их можно очистить с помощью ''Data Plugin: Clean up'' ''database'' соответствующего пункта в меню «Администрирование».
  
-However there might be some bugs making this not always 100% reliable. Refer to the [[#open bugs]] section and [[#changes]] to see what might be broken or what was recently fixed.+Однако могут быть некоторые ошибки, из-за которых это не всегда на 100% надежно. Обратитесь к разделу  [[#открытых ошибок]] и [[#изменений]], чтобы узнать, что может быть неисправно или что было недавно исправлено
  
-When you delete the whole database, all entry pages have to be re-rendered to repopulate the database. There is no automatic way to do so. +При удалении всей базы данных все страницы ввода данных необходимо перерисовать для восстановления ее содержимого. Автоматического способа сделать это нет.
  
-In case page were externally modified, or fresh database, few tricks to refresh the database are: +В случае, если страница была изменена извне или была обновлена ​​база данных, можно использовать несколько способов для ее обновления: 
-  * to download the wiki pages, in batch, using wget, a command-line file downloader; +  * для пакетной загрузки страниц вики с помощью wget, программы для загрузки файлов из командной строки; 
-  * to install the [[plugin:searchindex]] plugin, launch the newly added ''SearchIndex Manager'' panel in Admin menu and click the ''Rebuild Index'' button.+  * Чтобы установить плагин [[wiki:plugin:searchindex]] откройте новую ''SearchIndex Manager'' панель в меню "Администрирование" и нажмите ''Rebuild Index'' кнопку. 
 +Разумеется, вы можете открыть файл базы данных непосредственно в командной строке SQLite и управлять им с помощью SQL-запросов.
  
-You can of course open the database file directly in the SQLite command line client and manipulate it through SQL queries.+==== В чём разница между плагином Strata и плагином Data? ====
  
-==== What is the difference between Strata plugin and Data plugin? ====+Плагин [[wiki:plugin:strata|Strata]] по своим функциональным возможностям является аналогом плагина Data. Однако он обладает более сложным синтаксисом запросов, упрощенной системой псевдонимов и дополнительными функциями, такими как построение графиков или вывод данных на основе предопределенного шаблона. Таким образом, для обработки более сложных данных плагин Strata предоставляет больше возможностей.
  
-The [[plugin:strata|Strata Plugin]] is in the big lines equivalent to Data plugin. However, it has more sophisticated query syntax, less and simpler 'aliastypes' system and additional features like graph or output based at an predefined template. So for handling of more complicated data the Strata Plugin has more opportunities.+==== Как отфильтровать пустые поля/значения? ====
  
-==== How do you filter empty fields/values? ====+Предположим, некоторые записи содержат пустые поля, и вы хотите отобразить такие записи: как написать фильтр в запросе, чтобы вывести их?
  
-Suppose some entries contain empty fields and you want to display such entries: how do you write the filter in the query to output these? +например
- +
-e.g.+
  
 <code> <code>
Строка 481: Строка 482:
 </code> </code>
  
-and if the query is:+и если запрос выглядит так:
 <code> <code>
 ---- datatable ---- ---- datatable ----
Строка 489: Строка 490:
 ---- ----
 </code> </code>
-the output does not show the above record+В выходных данных указанная выше запись не отображается.
  
-^The solution is to change the filter to a value that will always be populated. ^+^Решение состоит в том, чтобы изменить фильтр на значение, которое будет всегда отображаться. ^
 |<code>---- datatable ---- |<code>---- datatable ----
 cols    : %pageid% cols    : %pageid%
Строка 499: Строка 500:
 |  --- [[user>SFITCS|SFITCS]] //2016-10-15 04:58//| |  --- [[user>SFITCS|SFITCS]] //2016-10-15 04:58//|
  
-==== Why don't my variables/placeholders work when I create a table in a namespace template? ====+==== Почему мои переменные/заполнители не работают при создании таблицы в шаблоне пространства имен? ====
  
-DokuWiki calls [[phpfn>strftime]] on ''_template.txt'' when creating a new page. This replaces some combinations of %[a-z] (for example, %title% will become [TAB]itle%). When using placeholders in ''_template.txt'' you should use double percent signs (<nowiki>%%title%%</nowiki>). Strftime will treat those as literal percent characters.+DokuWiki вызывает функцию [[phpfn>strftime]] ''_template.txt'' при создании новой страницы. Это заменяет некоторые комбинации %[az] (например, %title% станет [TAB]itle%). При использовании заполнителей ''_template.txt'' следует использовать двойные знаки процента (<nowiki>%%title%%</nowiki>). Функция strftime будет рассматривать их как обычные символы процента.
  
-==== Other Questions ====+==== Другие вопросы ====
  
-If you still have questions, search the forum and if it hasn't been asked before ask your question there. Please leave bug reports on Github's issue tracker.+Если у вас остались вопросы, поищите на форуме, и если этот вопрос ещё не задавался, задайте его там. Пожалуйста, сообщайте об ошибках в системе отслеживания проблем Github.
  
 ---- ----
  
-===== Customisations =====+===== Настройки =====
  
-**Important!** These are //hacks// -- there is no guarantee they'll always work, and they will **not** survive updates. +**Важно!** Это лишь //уловки// — нет гарантии, что они всегда будут работать, и они не сохранятся после обновлений.
  
-If it breaks you get to keep the pieces. :-)+Если он разобьется, вы сможете оставить себе обломки :-)
  
-==== Customise the Date Format ====+==== Настройте формат даты ====
  
-**NOTE:** The configuration setting for the PHP strftime function in ''/conf/dokuwiki.php'' also need to be changed (can also be changed via **Admin->Configuration**) <code>$conf['dformat']     = '%d/%m/%Y %H:%M';</code>+**ПРИМЕЧАНИЕ:** ''/conf/dokuwiki.php'' Также необходимо изменить параметр конфигурации функции PHP strftime (это можно сделать через Администрирование → Конфигурация ).  
 +<code>$conf['dformat']     = '%d/%m/%Y %H:%M';</code>
  
-To change the default date format from ''yy-mm-dd'' to ''dd-mm-yy'' (e.g. for Australia)+Чтобы изменить формат даты по умолчанию с ''yy-mm-dd'' на ''dd-mm-yy'' (например, для Австралии)
  
-Change this:+Измените это:
 <code php plugins/data/helper.php> <code php plugins/data/helper.php>
-    /** +    /**  
-     * Replace placeholders in sql +     * Заменяет заполнители в SQL  
-     */ +     */  
-    function _replacePlaceholdersInSQL(&$data) { +    function _replacePlaceholdersInSQL ( & $data )  {  
-        global $USERINFO; +        global  $USERINFO ;  
-        // allow current user name in filter: +        // разрешить имя текущего пользователя в фильтре:  
-        $data['sql'] = str_replace('%user%', $_SERVER['REMOTE_USER'], $data['sql']); +        $data [ 'sql' ]  =  str_replace ( '%user%' ,  $_SERVER [ 'REMOTE_USER' ] ,  $data [ 'sql' ] ) ;  
-        $data['sql'] = str_replace('%groups%', implode("','", (array) $USERINFO['grps']), $data['sql']$ +        $data [ 'sql' ]  =  str_replace ( '%groups%' ,  implode ( "','" ,  ( array )  $USERINFO [ 'grps' ] ) ,  $data [ 'sql' ] $ 
-        // allow current date in filter: +         // разрешить текущую дату в фильтре:  
-        $data['sql'] = str_replace('%now%', dformat(null, '%Y-%m-%d'), $data['sql']); +        $data [ 'sql' ]  =  str_replace ( '%now%' , dformat ( null ,  '%Y-%m-%d' ) ,  $data [ 'sql' ] ) ;  
- +  
-        // language filter +        // языковой фильтр  
-        $data['sql'] = $this->makeTranslationReplacement($data['sql']);+        $data [ 'sql' ]  =  $this- > makeTranslationReplacement ( $data [ 'sql' ] ) ; 
     }     }
 </code> </code>
  
-to this:+к этому:
 <code php plugins/data/helper.php> <code php plugins/data/helper.php>
-    /** +    /**  
-     * Replace placeholders in sql +     * Заменяет заполнители в SQL  
-     */ +     */  
-    function _replacePlaceholdersInSQL(&$data) { +    function _replacePlaceholdersInSQL ( & $data )  {  
-        global $USERINFO; +        global  $USERINFO ;  
-        // allow current user name in filter: +        // разрешить имя текущего пользователя в фильтре:  
-        $data['sql'] = str_replace('%user%', $_SERVER['REMOTE_USER'], $data['sql']); +        $data [ 'sql' ]  =  str_replace ( '%user%' ,  $_SERVER [ 'REMOTE_USER' ] ,  $data [ 'sql' ] ) ;  
-        $data['sql'] = str_replace('%groups%', implode("','", (array) $USERINFO['grps']), $data['sql']$ +        $data [ 'sql' ]  =  str_replace ( '%groups%' ,  implode ( "','" ,  ( array )  $USERINFO [ 'grps' ] ) ,  $data [ 'sql' ] $ 
-        // allow current date in filter: +         // разрешить текущую дату в фильтре:  
-        $data['sql'] = str_replace('%now%', dformat(null, '%d-%m-%Y'), $data['sql']); +        $data [ 'sql' ]  =  str_replace ( '%now%' , dformat ( null ,  '%d-%m-%Y' ) ,  $data [ 'sql' ] ) ;  
- +  
-        // language filter +        // языковой фильтр  
-        $data['sql'] = $this->makeTranslationReplacement($data['sql']);+        $data [ 'sql' ]  =  $this- > makeTranslationReplacement ( $data [ 'sql' ] ) ; 
     }     }
 </code> </code>
  
-and change this:+и измените это:
 <code php plugins/data/helper.php> <code php plugins/data/helper.php>
-switch($type) { +switch ( $type )  {  
-            case 'dt': +            case  'dt' :  
-                if(preg_match('/^(\d\d\d\d)-(\d\d?)-(\d\d?)$/', $value, $m)) { +                if ( preg_match ( '/^(\d\d\d\d)-(\d\d?)-(\d\d?)$/' ,  $value ,  $m ) )  {  
-                    return sprintf('%d-%02d-%02d', $m[1], $m[2], $m[3]);+                    return  sprintf ( '%d-%02d-%02d' ,  $m [ 1 ] ,  $m [ 2 ] ,  $m [ 3 ] ) ; 
                 }                 }
 </code> </code>
  
-to this:+к этому:
 <code php plugins/data/helper.php> <code php plugins/data/helper.php>
-switch($type) { +switch ( $type )  {  
-            case 'dt': +            case  'dt' :  
-                if(preg_match('/^(\d\d?)-(\d\d?)-(\d\d\d\d)$/', $value, $m)) { +                if ( preg_match ( '/^(\d\d?)-(\d\d?)-(\d\d\d\d)$/' ,  $value ,  $m ) )  {  
-                    return sprintf('%02d-%02d-%d', $m[1], $m[2], $m[3]);+                    return  sprintf ( '%02d-%02d-%d' ,  $m [ 1 ] ,  $m [ 2 ] ,  $m [ 3 ] ) ; 
                 }                 }
 </code> </code>
  
-and change this:+и измените это:
 <code javascript plugins/data/script.js> <code javascript plugins/data/script.js>
-/** +/**  
- * Init datepicker for all date fields + * Инициализация средства выбора даты для всех полей даты  
- */ + */  
-jQuery(function () { +jQuery ( function  ( )  {  
-    jQuery('.data_type_dt input').datepicker({ +    jQuery ( '.data_type_dt input' ) . datepicker ( {  
-        dateFormat: "yy-mm-dd", +        dateFormat :  "yy-mm-dd" ,  
-        changeMonth: true, +        changeMonth :  true ,  
-        changeYear: true +        changeYear :  true  
-    });+    } ) ;
 </code> </code>
  
-to this:+к этому:
 <code javascript plugins/data/script.js> <code javascript plugins/data/script.js>
-/** +/**  
- * Init datepicker for all date fields + * Инициализация средства выбора даты для всех полей даты  
- */ + */  
-jQuery(function () { +jQuery ( function  ( )  {  
-    jQuery('.data_type_dt input').datepicker({ +    jQuery ( '.data_type_dt input' ) . datepicker ( {  
-        dateFormat: "dd-mm-yy", +        dateFormat :  "dd-mm-yy" ,  
-        changeMonth: true, +        changeMonth :  true ,  
-        changeYear: true +        changeYear :  true  
-    });+    } ) ;
 </code>  --- [[user>SFITCS]] //2016-11-26 01:24// </code>  --- [[user>SFITCS]] //2016-11-26 01:24//
  
-===== Bugs, Feature Requests and Patches =====+===== Сообщения об ошибках, запросы на добавление новых функций и исправления. ===== 
 + 
 +Пожалуйста, сообщайте об ошибках и предлагайте новые функции в [[https://github.com/splitbrain/dokuwiki-plugin-data/issues|системе отслеживания ошибок на GitHub]]. Патчи следует отправлять в формате унифицированного сравнения изменений (unified diff format) или в виде git-патчей для ветки devel. Или еще лучше: создайте форк репозитория на GitHub и отправьте запрос на слияние (merge request). 
 + 
 +===== Дополнения и Файлы===== 
 +  * [[https://www.dokuwiki.org/plugin:data|Ссылка на оригинальную статью]] 
 +  * {{ :wiki:plugin:splitbrain-dokuwiki-plugin-data-2024-01-30-2-gcecb410.zip |Скачать plugin data}}
  
-Please submit bugs and feature requests in the [[https://github.com/splitbrain/dokuwiki-plugin-data/issues|issue tracker on GitHub]]. Patches should be sent unified diff format or as git patches against the devel branch. Or even better: fork the repository at github and send a merge request. 
  
wiki/plugin/data.1768730962.txt.gz · Последнее изменение: — VladPolskiy

Если не указано иное, содержимое этой вики предоставляется на условиях следующей лицензии: Public Domain
Public Domain Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki