~ / Public Domain Software / AmDictionary PHP5 Class / More Control $_
More Control

This is a run of the AmDictionary PHP5 Class similar to the first example but with an addition of edit controls. (I am not a guru in CSS, so the design of the edit controls may contain some shortcomings. I will correct it as soon as I find time for an in-depth study of the complexity of absolute, relative, and fixed positioning in CSS.)

This view of the dictionary should be, of course, served from within a login-secured page. If you are running your site with the help of the CMS system, then the CMS itself provides you with ready-to-use secured pages. If you are to run dictionary as a standalone site, then you need to implement logging on your own. However, the release of the AmDictionary PHP5 Class includes an idea of such a page which you can modify in order to meet your needs.

Other noteworthy things in this example are links. The indexes have links that generate lists, the lists have links that generate entries. All these links are, of course, fully and automatically handled and maintained by the class. But there is one more type of links: cross-references between entries. The entry „поддерживать” makes a reference to another entry „поддержать”. If you focus on the „поддерживать” entry, then you will see in its edit box how this link is cooked. The class provides you with the function REF(target-entry) — with its help you can safely construct cross-references between entries, moreover, you can even make references to entries that will appear in the future. Another example for the use of REF() is shown in the „обвинять” entry which makes a reference to „обвинить”. But, what is interesting, there is no separate „обвинить” entry in the dictionary — „обвинить” has only a „by-the-way”-definition inside „обвин||ение” („~ить”). In such a case, you can use an extended form of the reference function: REF(target-entry)AS(link-name).

One more thing that might be interesting for potential users of my class is an ability to use categories for properly arranging the work in a multi-editor environment. You can create categories to meet your needs, but you can also add magic to some category and use it for excluding unwanted interference when two editors attempt to modify the same entry. If the editor starts writing an entry and continues it for some time, he can lock it for exclusive write access. Other editors, while the lock is in force, can only observe the work progress in a read-only mode. The lock can be removed only by the user who applied it (or by the user who has higher privileges). The entry „аптека” was started, modified, and locked by an editor whose UID=0. You are currently watching this page as a different editor (your UID=13) and therefore you cannot modify the „аптека” entry.

Probably the last interesting entry in this example is „подвергнуть”. Its peculiarity consists in that it has not been published yet and therefore it is visible only on this page (i.e. backend, administration panel). In preceding two examples (frontends) „подвергнуть” is not listed. Unfortunately, the entry was also locked by its author, so we can only wait until he publishes it or ask somebody with higher privileges to override the lock :-(

All entries in this example and others were rewritten from „Russian-English Dictionary — Русско-английский словарь”, Москва, Издательство „Русский язык”, 1978. Though it may be difficult to deal with, Russian was intentionally selected for the examples in order to emphasize interoperability of the presented software.

Nouns Verbs LOCKED All Entries Categorized Uncategorized
Presentation mode. Buttons do not commit any actual changes in the dictionary.
Category:Sort:
А Б В Г Д Е Ж З И К Л М Н О П Р С Т У Ф Х Ц Ч Ш Щ Ы Э Ю Я
Presentation mode. Buttons do not commit any actual changes in the dictionary.
Title (search key): Title Alternative (full-fledged presentation): Article Alternative (full-fledged presentation): PublishedCategory:
Nouns
Verbs
LOCKED
Sort:
апте||ка chemist’s shop; drug-store (амер.); ~карь chemist; druggist (амер); ~чка medicine chest (ящчичек с лекарствами); first-aid outfit (первой помощи)
Presentation mode. Buttons do not commit any actual changes in the dictionary.
Title (search key): Title Alternative (full-fledged presentation): Article Alternative (full-fledged presentation): PublishedCategory:
Nouns
Verbs
LOCKED
Sort:
Created On:2008-09-02, 08:33 Created By:UID(0) Modified On:2008-09-02, 13:06 Modified By:UID(0)
AmDictionary PHP5 Class 1.0.0 RC. Copyright © 2008-2012 Aleksander Maksymiuk, http://setpro.net.pl/. This is a free software under the terms of the GNU General Public License.
<?php   /* core code of this example */

  if (!class_exists('AmDictionary')) {
    require('possible/path/amdictionary.class.php');
  }
  /* create */
  $d = new AmDictionary();

  /* do some configuration */
  $d->SetParam('alphabet', '|А|Б|В|Г|Д|Е|Ж|З|И|К|Л|М|Н|О|П|Р|С|Т|У|Ф|Х|Ц|Ч|Ш|Щ|Ы|Э|Ю|Я');
  $d->SetParam('admin_mode', TRUE);
  $d->SetParam('presentation_mode', TRUE);
  $d->SetParam('current_uid', 13);

  /* run (glue desired components together) */
  echo $d->BuildSearch() .
    $d->BuildCatIndex() .
    $d->BuildIndex() .
    $d->BuildCatIndexList() .
    $d->BuildIndexList() .
    $d->BuildSearchList() .
    $d->BuildEntry() .
    $d->BuildDictInfo();

?>