📜 ⬆️ ⬇️

MODx - search by admin part or Doc Finder 1.6

Search by admin

So, looking through Extraz on the official MODx website, I found a rather old module called “Doc Finder 1.6”. I didn’t know what kind of animal it was, but the name intrigued ... After unsuccessful searches on the Internet (regarding the use of this module by Russian colleagues), it became clear that it’s not very popular with us and S. Zuev from the cad site writes several times .kurganobl.ru , and that about the old version and only partly Russified.

In general, I decided that maybe it is necessary for someone else besides me, therefore, I installed and Russified this miracle as much as possible.

Let's start in order:

1. What is it for?

In order to easily find any documents, snippets, chunks, modules, etc. by keywords, as well as to make the replacement of words and lines in these documents, snippets, etc. etc.


A) I, in general, have not seen analogues
B) a friendly interface that allows the module to be used not only by you, but also by those who are “not really the same”
B) a variety of search settings:
search using regular expressions and logical operators, search by a range of creation dates and last editing, search by various fields, various types of documents, etc.
D) convenient information output
D) the history of search queries and replacements (trifle, but how nice!)


2. Where to watch Demo?

You can here trymodx.com
Login: demo_user
Password: demo_user

3. Installation

Only 6 steps:
0. We start the module from here
1. Copy the entire docfinder folder to the / assets / modules / directory.
2.Open the Modules section in the admin panel (Modules)> Manage Modules (Manage Modules).
3. We create a new module with the name Doc Finder 1.6 (this is how the author of the module suggests, but personally I liked it more simply: Search by documents).
4. Insert the include ($ modx-> config ['base_path']. "Assets / modules / docfinder / index.php"); in the code of the new module.
5. We save the module.
6. Update the admin panel and see the new module.

4. Russification

Dear Zuev Russified the module, but I did not find how to download it from it on the page, besides, the module is already old, and the Russification is not complete:
“We did not translate some words - they are used not only for display, but also as function arguments.”

Those. it turned out like this:


Well, so I decided to take matters into my own hands and added a translation and arguments so that it would not break the work of the module, but at the same time that everything would be on ours.
I made a bunch of different test documents, both pages and templates, modules and so on, to see which, in the end, there are arguments in general. He translated everything he found and, just in case, left the conclusion of the original name, if he did not find alternatives in Russian.

What happened to me:

And so, the files that need to be changed:

1. functions.php
2. template.php

And for the very lazy: ready, you can say the assembly (in the folder ENG - the original files)

If there are comments on the translation or implementation of the Russification of the "function arguments" - say, I will try to correct as quickly as possible.

Source: https://habr.com/ru/post/102635/

All Articles